diff --git a/Install.sh b/Install.sh new file mode 100755 index 0000000..b0c12b2 --- /dev/null +++ b/Install.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +WeChat_path="/Applications/WeChat.app" + +if [ ! -d "$WeChat_path" ] +then + WeChat_path="/Applications/微信.app" + if [ ! -d "$WeChat_path" ] + then + echo -e "应用程序文件夹中未发现微信" + exit + fi +fi + +app_name="WeChat" +shell_path="$(dirname "$0")" +framework_name="WeChatIntercept" +app_bundle_path="${WeChat_path}/Contents/MacOS" +app_executable_path="${app_bundle_path}/${app_name}" +app_executable_backup_path="${app_executable_path}_backup" +framework_path="${shell_path}/${framework_name}.framework" +echo framework_path-----$framework_path +if [ ! -w "$WeChat_path" ] +then + echo -e "为了将ZY助手写入微信, 请输入密码 : " + sudo chown -R $(whoami) "$WeChat_path" +fi + +if [ ! -f "$app_executable_backup_path" ] || [ -n "$1" -a "$1" = "--force" ] +then + + cp "$app_executable_path" "$app_executable_backup_path" + result="y" +else + read -t 150 -p "已安装ZY助手,是否覆盖?[y/n]:" result +fi + +if [[ "$result" == 'y' ]]; then + cp -r $framework_path ${app_bundle_path} + ${shell_path}/insert_dylib --all-yes "${framework_path}/${framework_name}" "$app_executable_backup_path" "$app_executable_path" + echo "安装成功!" +fi diff --git a/Uninstall.sh b/Uninstall.sh new file mode 100755 index 0000000..7620039 --- /dev/null +++ b/Uninstall.sh @@ -0,0 +1,38 @@ +# !/bin/bash + +WeChat_path="/Applications/WeChat.app" + +if [ ! -d "$WeChat_path" ] +then + WeChat_path="/Applications/微信.app" + if [ ! -d "$WeChat_path" ] + then + echo -e "应用程序文件夹中未发现微信" + exit + fi +fi + +app_name="WeChat" +framework_name="WeChatIntercept" +app_bundle_path="${WeChat_path}/Contents/MacOS" +app_executable_path="${app_bundle_path}/${app_name}" +app_executable_backup_path="${app_executable_path}_backup" +framework_path="${app_bundle_path}/${framework_name}.framework" + +# 备份WeChat原始可执行文件 +if [ -f "$app_executable_backup_path" ] +then + rm "$app_executable_path" + rm -rf "$framework_path" + mv "$app_executable_backup_path" "$app_executable_path" + + if [ -f "$app_executable_backup_path" ] + then + echo "卸载失败,请到 /Applications/WeChat.app/Contents/MacOS 路径,删除 WeChatIntercept.framework、WeChat 两个文件文件,并将 WeChat_backup 重命名为 WeChat" + else + echo "卸载成功!" + fi + +else + echo "未发现ZY助手" +fi diff --git a/WeChatIntercept.framework/Headers b/WeChatIntercept.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/WeChatIntercept.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/WeChatIntercept.framework/Modules b/WeChatIntercept.framework/Modules new file mode 120000 index 0000000..5736f31 --- /dev/null +++ b/WeChatIntercept.framework/Modules @@ -0,0 +1 @@ +Versions/Current/Modules \ No newline at end of file diff --git a/WeChatIntercept.framework/Resources b/WeChatIntercept.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/WeChatIntercept.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/WeChatIntercept.framework/Versions/A/Headers/WeChatIntercept.h b/WeChatIntercept.framework/Versions/A/Headers/WeChatIntercept.h new file mode 100644 index 0000000..78407c1 --- /dev/null +++ b/WeChatIntercept.framework/Versions/A/Headers/WeChatIntercept.h @@ -0,0 +1,80 @@ +// +// WeChatIntercept.h +// WeChatIntercept +// +// Created by 张洋 on 2019/5/30. +// Copyright © 2019 张洋. All rights reserved. +// + +#import + +//! Project version number for WeChatIntercept. +FOUNDATION_EXPORT double WeChatInterceptVersionNumber; + +//! Project version string for WeChatIntercept. +FOUNDATION_EXPORT const unsigned char WeChatInterceptVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +@interface MessageData : NSObject +- (id)initWithMsgType:(long long)arg1; + @property(retain, nonatomic) NSString *fromUsrName; + @property(retain, nonatomic) NSString *toUsrName; + @property(retain, nonatomic) NSString *msgContent; + @property(retain, nonatomic) NSString *msgPushContent; + @property(nonatomic) int messageType; + @property(nonatomic) int msgStatus; + @property(nonatomic) int msgCreateTime; + @property(nonatomic) int mesLocalID; + @property(nonatomic) long long mesSvrID; + @property(retain, nonatomic) NSString *msgVoiceText; + @property(copy, nonatomic) NSString *m_nsEmoticonMD5; +- (BOOL)isChatRoomMessage; +- (NSString *)groupChatSenderDisplayName; +- (id)getRealMessageContent; +- (id)getChatRoomUsrName; +- (BOOL)isSendFromSelf; +- (BOOL)isCustomEmojiMsg; +- (BOOL)isImgMsg; +- (BOOL)isVideoMsg; +- (BOOL)isVoiceMsg; +- (BOOL)canForward; +- (BOOL)IsPlayingSound; +- (id)summaryString:(BOOL)arg1; +- (BOOL)isEmojiAppMsg; +- (BOOL)isAppBrandMsg; +- (BOOL)IsUnPlayed; +- (void)SetPlayed; + @property(retain, nonatomic) NSString *m_nsTitle; +- (id)originalImageFilePath; + @property(retain, nonatomic) NSString *m_nsVideoPath; + @property(retain, nonatomic) NSString *m_nsFilePath; + @property(retain, nonatomic) NSString *m_nsAppMediaUrl; + @property(nonatomic) MessageData *m_refMessageData; + @property(nonatomic) unsigned int m_uiDownloadStatus; +- (void)SetPlayingSoundStatus:(BOOL)arg1; + @end +@interface MessageService : NSObject +- (void)onRevokeMsg:(id)arg1; +- (void)FFToNameFavChatZZ:(id)arg1; +- (void)OnSyncBatchAddMsgs:(NSArray *)arg1 isFirstSync:(BOOL)arg2; +- (void)FFImgToOnFavInfoInfoVCZZ:(id)arg1 isFirstSync:(BOOL)arg2; +- (id)SendTextMessage:(id)arg1 toUsrName:(id)arg2 msgText:(id)arg3 atUserList:(id)arg4; +- (id)GetMsgData:(id)arg1 svrId:(long)arg2; +- (void)AddLocalMsg:(id)arg1 msgData:(id)arg2; +- (void)TranscribeVoiceMessage:(id)arg1 completion:(void (^)(void))arg2; +- (BOOL)ClearUnRead:(id)arg1 FromID:(unsigned int)arg2 ToID:(unsigned int)arg3; +- (BOOL)ClearUnRead:(id)arg1 FromCreateTime:(unsigned int)arg2 ToCreateTime:(unsigned int)arg3; +- (BOOL)hasMsgInChat:(id)arg1; +- (id)GetMsgListWithChatName:(id)arg1 fromLocalId:(unsigned int)arg2 limitCnt:(NSInteger)arg3 hasMore:(char *)arg4 sortAscend:(BOOL)arg5; +- (id)GetMsgListWithChatName:(id)arg1 fromCreateTime:(unsigned int)arg2 limitCnt:(NSInteger)arg3 hasMore:(char *)arg4 sortAscend:(BOOL)arg5; + @end + +@interface MMServiceCenter : NSObject ++ (id)defaultCenter; +- (id)getService:(Class)arg1; + @end +@interface XMLDictionaryParser : NSObject ++ (id)sharedInstance; +- (id)dictionaryWithString:(id)arg1; + @end + diff --git a/WeChatIntercept.framework/Versions/A/Modules/module.modulemap b/WeChatIntercept.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..c582c46 --- /dev/null +++ b/WeChatIntercept.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,6 @@ +framework module WeChatIntercept { + umbrella header "WeChatIntercept.h" + + export * + module * { export * } +} diff --git a/WeChatIntercept.framework/Versions/A/Resources/Info.plist b/WeChatIntercept.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..60f4b76 --- /dev/null +++ b/WeChatIntercept.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,44 @@ + + + + + BuildMachineOSBuild + 18F132 + CFBundleDevelopmentRegion + en + CFBundleExecutable + WeChatIntercept + CFBundleIdentifier + offcn.WeChatIntercept + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + WeChatIntercept + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 10E1001 + DTPlatformVersion + GM + DTSDKBuild + 18E219 + DTSDKName + macosx10.14 + DTXcode + 1021 + DTXcodeBuild + 10E1001 + NSHumanReadableCopyright + Copyright © 2019 张洋. All rights reserved. + + diff --git a/WeChatIntercept.framework/Versions/A/WeChatIntercept b/WeChatIntercept.framework/Versions/A/WeChatIntercept new file mode 100755 index 0000000..bcf471f Binary files /dev/null and b/WeChatIntercept.framework/Versions/A/WeChatIntercept differ diff --git a/WeChatIntercept.framework/Versions/Current b/WeChatIntercept.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/WeChatIntercept.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/WeChatIntercept.framework/WeChatIntercept b/WeChatIntercept.framework/WeChatIntercept new file mode 120000 index 0000000..ff959d2 --- /dev/null +++ b/WeChatIntercept.framework/WeChatIntercept @@ -0,0 +1 @@ +Versions/Current/WeChatIntercept \ No newline at end of file diff --git a/insert_dylib b/insert_dylib new file mode 100755 index 0000000..e9fa7fe Binary files /dev/null and b/insert_dylib differ