1 Star 0 Fork 0

tech-tools/WeChatTweak-macOS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.73 KB
一键复制 编辑 原始数据 按行查看 历史
Sunnyyoung 提交于 2017-09-02 20:00 +08:00 . Minor fixed
APP_PATH=/Applications/WeChat.app/Contents/MacOS
APP_NAME=WeChat
BACKUP_NAME=WeChat.bak
FRAMEWORK_PATH=WeChatTweak.framework
FRAMEWORK_NAME=WeChatTweak
DYLIB_NAME=WeChatTweak.dylib
debug::
DYLD_INSERT_LIBRARIES=${FRAMEWORK_PATH}/${FRAMEWORK_NAME} ${APP_PATH}/${APP_NAME} &
install::
@if ! [[ $EUID -eq 0 ]]; then\
echo "This script should be run using sudo or as the root user.";\
exit 1;\
fi
@if ! [ -f "${APP_PATH}/${APP_NAME}" ]; then\
echo "Can not find the WeChat.";\
exit 1;\
fi
@if ! [ -d "${FRAMEWORK_PATH}" ]; then\
echo "Can not find the framework, please build first.";\
exit 1;\
fi
@if [ -f "${APP_PATH}/${DYLIB_NAME}" ]; then\
echo "You're using old version tweak, please uninstall first.";\
exit 1;\
fi
@if [ -d "${APP_PATH}/${FRAMEWORK_PATH}" ]; then\
rm -rf ${APP_PATH}/${FRAMEWORK_PATH};\
cp -R ${FRAMEWORK_PATH} ${APP_PATH};\
echo "Framework found! Replace with new framework successfully!";\
else \
cp ${APP_PATH}/${APP_NAME} ${APP_PATH}/${BACKUP_NAME};\
cp -R ${FRAMEWORK_PATH} ${APP_PATH};\
./insert_dylib @executable_path/${FRAMEWORK_PATH}/${FRAMEWORK_NAME} ${APP_PATH}/${APP_NAME} ${APP_PATH}/${APP_NAME} --all-yes;\
echo "Install successfully!";\
fi
uninstall::
@if ! [[ $EUID -eq 0 ]]; then\
echo "This script should be run using sudo or as the root user.";\
exit 1;\
fi
@if ! [ -f "${APP_PATH}/${APP_NAME}" ]; then\
echo "Can not find the WeChat.";\
exit 1;\
fi
@if ! [ -f "${APP_PATH}/${BACKUP_NAME}" ]; then\
echo "Can not find the WeChat backup file.";\
exit 1;\
fi
@rm -rf ${APP_PATH}/${DYLIB_NAME};
@rm -rf ${APP_PATH}/${FRAMEWORK_PATH};
@mv ${APP_PATH}/${BACKUP_NAME} ${APP_PATH}/${APP_NAME};
@echo "Uninstall successfully";
clean::
rm -rf ${FRAMEWORK_PATH}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tech-tools/WeChatTweak-macOS.git
git@gitee.com:tech-tools/WeChatTweak-macOS.git
tech-tools
WeChatTweak-macOS
WeChatTweak-macOS
master

搜索帮助