mirror of
https://github.com/Sunnyyoung/WeChatTweak-macOS.git
synced 2025-05-23 14:56:08 +08:00
50 lines
1.3 KiB
Makefile
50 lines
1.3 KiB
Makefile
WECHATPATH=/Applications/WeChat.app/Contents/MacOS
|
|
DYLIBFILE=WeChatTweak.dylib
|
|
|
|
build::
|
|
clang -dynamiclib ./WeChatTweak.m -fobjc-link-runtime -current_version 1.0 -compatibility_version 1.0 -o ./${DYLIBFILE}
|
|
|
|
debug::
|
|
make build
|
|
DYLD_INSERT_LIBRARIES=./${DYLIBFILE} ${WECHATPATH}/WeChat &
|
|
|
|
install::
|
|
@if ! [[ $EUID -eq 0 ]]; then\
|
|
echo "This script should be run using sudo or as the root user.";\
|
|
exit 1;\
|
|
fi
|
|
@if ! [ -f "${WECHATPATH}/WeChat" ]; then\
|
|
echo "Can not find the WeChat.";\
|
|
exit 1;\
|
|
fi
|
|
@if ! [ -f "./${DYLIBFILE}" ]; then\
|
|
echo "Can not find the dylib file, please build first.";\
|
|
exit 1;\
|
|
fi
|
|
|
|
@cp ${WECHATPATH}/WeChat ${WECHATPATH}/WeChat.bak;
|
|
@cp ./${DYLIBFILE} ${WECHATPATH}/${DYLIBFILE};
|
|
@./insert_dylib @executable_path/${DYLIBFILE} ${WECHATPATH}/WeChat ${WECHATPATH}/WeChat --all-yes;
|
|
@echo "Install successed!";
|
|
|
|
uninstall::
|
|
@if ! [[ $EUID -eq 0 ]]; then\
|
|
echo "This script should be run using sudo or as the root user.";\
|
|
exit 1;\
|
|
fi
|
|
@if ! [ -f "${WECHATPATH}/WeChat" ]; then\
|
|
echo "Can not find the WeChat.";\
|
|
exit 1;\
|
|
fi
|
|
@if ! [ -f "${WECHATPATH}/WeChat.bak" ]; then\
|
|
echo "Can not find the WeChat backup file.";\
|
|
exit 1;\
|
|
fi
|
|
|
|
@rm -rf ${WECHATPATH}/${DYLIBFILE};
|
|
@mv ${WECHATPATH}/WeChat.bak ${WECHATPATH}/WeChat;
|
|
@echo "Uninstall successed";
|
|
|
|
clean::
|
|
rm -rf ./${DYLIBFILE}
|