Skip to content
This repository was archived by the owner on Jul 20, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions FishChat.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
TargetAttributes = {
A43B99C51E5DEBD60060676F = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = D3RCVUP6VH;
DevelopmentTeam = YES6B27V8R;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -341,7 +341,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = D3RCVUP6VH;
DEVELOPMENT_TEAM = YES6B27V8R;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -370,7 +370,7 @@
buildSettings = {
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = D3RCVUP6VH;
DEVELOPMENT_TEAM = YES6B27V8R;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
284 changes: 142 additions & 142 deletions FishChat/FishChat.mm
Original file line number Diff line number Diff line change
Expand Up @@ -82,73 +82,73 @@
}
}

// 屏蔽消息

NSMutableArray * filtMessageWrapArr(NSMutableArray *msgList) {
NSMutableArray *msgListResult = [msgList mutableCopy];
for (id msgWrap in msgList) {
Ivar nsFromUsrIvar = class_getInstanceVariable(objc_getClass("CMessageWrap"), "m_nsFromUsr");
NSString *m_nsFromUsr = object_getIvar(msgWrap, nsFromUsrIvar);
if ([FishConfigurationCenter sharedInstance].chatIgnoreInfo[m_nsFromUsr].boolValue) {
[msgListResult removeObject:msgWrap];
}
}
return [msgListResult autorelease];
}

CHDeclareClass(BaseMsgContentViewController)
CHDeclareMethod1(void, BaseMsgContentViewController, viewDidAppear, BOOL, animated)
{
CHSuper1(BaseMsgContentViewController, viewDidAppear, animated);
id contact = [self GetContact];
[FishConfigurationCenter sharedInstance].currentUserName = [contact valueForKey:@"m_nsUsrName"];
}

CHDeclareMethod0(void, ChatRoomInfoViewController, reloadTableData)
{
CHSuper0(ChatRoomInfoViewController, reloadTableData);
NSString *userName = [FishConfigurationCenter sharedInstance].currentUserName;
MMTableViewInfo *tableInfo = [self valueForKeyPath:@"m_tableViewInfo"];
MMTableViewSectionInfo *sectionInfo = [tableInfo getSectionAt:2];
MMTableViewCellInfo *ignoreCellInfo = [objc_getClass("MMTableViewCellInfo") switchCellForSel:@selector(handleIgnoreChatRoom:) target:[FishConfigurationCenter sharedInstance] title:@"屏蔽群消息" on:[FishConfigurationCenter sharedInstance].chatIgnoreInfo[userName].boolValue];
[sectionInfo addCell:ignoreCellInfo];
MMTableView *tableView = [tableInfo getTableView];
[tableView reloadData];
}

CHDeclareClass(AddContactToChatRoomViewController)

CHDeclareMethod0(void, AddContactToChatRoomViewController, reloadTableData)
{
CHSuper0(AddContactToChatRoomViewController, reloadTableData);
NSString *userName = [FishConfigurationCenter sharedInstance].currentUserName;
MMTableViewInfo *tableInfo = [self valueForKeyPath:@"m_tableViewInfo"];
MMTableViewSectionInfo *sectionInfo = [tableInfo getSectionAt:1];
MMTableViewCellInfo *ignoreCellInfo = [objc_getClass("MMTableViewCellInfo") switchCellForSel:@selector(handleIgnoreChatRoom:) target:[FishConfigurationCenter sharedInstance] title:@"屏蔽此傻逼" on:[FishConfigurationCenter sharedInstance].chatIgnoreInfo[userName].boolValue];
[sectionInfo addCell:ignoreCellInfo];
MMTableView *tableView = [tableInfo getTableView];
[tableView reloadData];
}

CHDeclareMethod6(id, CMessageMgr, GetMsgByCreateTime, id, arg1, FromID, unsigned int, arg2, FromCreateTime, unsigned int, arg3, Limit, unsigned int, arg4, LeftCount, unsigned int*, arg5, FromSequence, unsigned int, arg6)
{
NSLog(@"GetMsgByCreateTime:%@ FromID:%d FromCreateTime:%d Limit:%d FromSequence:%d",arg1,arg2,arg3,arg4,arg6);
id result = CHSuper6(CMessageMgr, GetMsgByCreateTime, arg1, FromID, arg2, FromCreateTime, arg3, Limit, arg4, LeftCount, arg5, FromSequence, arg6);
NSLog(@"msgresult:%@",result);
if ([FishConfigurationCenter sharedInstance].chatIgnoreInfo[arg1].boolValue) {
return filtMessageWrapArr(result);
}
return result;
}

CHDeclareClass(CSyncBaseEvent)
CHDeclareMethod2(BOOL, CSyncBaseEvent, BatchAddMsg, BOOL, arg1, ShowPush, BOOL, arg2)
{
NSMutableArray *msgList = [self valueForKeyPath:@"m_arrMsgList"];
NSMutableArray *msgListResult = filtMessageWrapArr(msgList);
[self setValue:msgListResult forKeyPath:@"m_arrMsgList"];
return CHSuper2(CSyncBaseEvent, BatchAddMsg, arg1, ShowPush, arg2);
}
//// 屏蔽消息
//
//NSMutableArray * filtMessageWrapArr(NSMutableArray *msgList) {
// NSMutableArray *msgListResult = [msgList mutableCopy];
// for (id msgWrap in msgList) {
// Ivar nsFromUsrIvar = class_getInstanceVariable(objc_getClass("CMessageWrap"), "m_nsFromUsr");
// NSString *m_nsFromUsr = object_getIvar(msgWrap, nsFromUsrIvar);
// if ([FishConfigurationCenter sharedInstance].chatIgnoreInfo[m_nsFromUsr].boolValue) {
// [msgListResult removeObject:msgWrap];
// }
// }
// return [msgListResult autorelease];
//}
//
//CHDeclareClass(BaseMsgContentViewController)
//CHDeclareMethod1(void, BaseMsgContentViewController, viewDidAppear, BOOL, animated)
//{
// CHSuper1(BaseMsgContentViewController, viewDidAppear, animated);
// id contact = [self GetContact];
// [FishConfigurationCenter sharedInstance].currentUserName = [contact valueForKey:@"m_nsUsrName"];
//}
//
//CHDeclareMethod0(void, ChatRoomInfoViewController, reloadTableData)
//{
// CHSuper0(ChatRoomInfoViewController, reloadTableData);
// NSString *userName = [FishConfigurationCenter sharedInstance].currentUserName;
// MMTableViewInfo *tableInfo = [self valueForKeyPath:@"m_tableViewInfo"];
// MMTableViewSectionInfo *sectionInfo = [tableInfo getSectionAt:2];
// MMTableViewCellInfo *ignoreCellInfo = [objc_getClass("MMTableViewCellInfo") switchCellForSel:@selector(handleIgnoreChatRoom:) target:[FishConfigurationCenter sharedInstance] title:@"屏蔽群消息" on:[FishConfigurationCenter sharedInstance].chatIgnoreInfo[userName].boolValue];
// [sectionInfo addCell:ignoreCellInfo];
// MMTableView *tableView = [tableInfo getTableView];
// [tableView reloadData];
//}
//
//CHDeclareClass(AddContactToChatRoomViewController)
//
//CHDeclareMethod0(void, AddContactToChatRoomViewController, reloadTableData)
//{
// CHSuper0(AddContactToChatRoomViewController, reloadTableData);
// NSString *userName = [FishConfigurationCenter sharedInstance].currentUserName;
// MMTableViewInfo *tableInfo = [self valueForKeyPath:@"m_tableViewInfo"];
// MMTableViewSectionInfo *sectionInfo = [tableInfo getSectionAt:1];
// MMTableViewCellInfo *ignoreCellInfo = [objc_getClass("MMTableViewCellInfo") switchCellForSel:@selector(handleIgnoreChatRoom:) target:[FishConfigurationCenter sharedInstance] title:@"屏蔽此傻逼" on:[FishConfigurationCenter sharedInstance].chatIgnoreInfo[userName].boolValue];
// [sectionInfo addCell:ignoreCellInfo];
// MMTableView *tableView = [tableInfo getTableView];
// [tableView reloadData];
//}
//
//CHDeclareMethod6(id, CMessageMgr, GetMsgByCreateTime, id, arg1, FromID, unsigned int, arg2, FromCreateTime, unsigned int, arg3, Limit, unsigned int, arg4, LeftCount, unsigned int*, arg5, FromSequence, unsigned int, arg6)
//{
// NSLog(@"GetMsgByCreateTime:%@ FromID:%d FromCreateTime:%d Limit:%d FromSequence:%d",arg1,arg2,arg3,arg4,arg6);
// id result = CHSuper6(CMessageMgr, GetMsgByCreateTime, arg1, FromID, arg2, FromCreateTime, arg3, Limit, arg4, LeftCount, arg5, FromSequence, arg6);
// NSLog(@"msgresult:%@",result);
// if ([FishConfigurationCenter sharedInstance].chatIgnoreInfo[arg1].boolValue) {
// return filtMessageWrapArr(result);
// }
// return result;
//}
//
//CHDeclareClass(CSyncBaseEvent)
//CHDeclareMethod2(BOOL, CSyncBaseEvent, BatchAddMsg, BOOL, arg1, ShowPush, BOOL, arg2)
//{
// NSMutableArray *msgList = [self valueForKeyPath:@"m_arrMsgList"];
// NSMutableArray *msgListResult = filtMessageWrapArr(msgList);
// [self setValue:msgListResult forKeyPath:@"m_arrMsgList"];
// return CHSuper2(CSyncBaseEvent, BatchAddMsg, arg1, ShowPush, arg2);
//}

//CHDeclareMethod2(id, CMessageMgr, GetMsg, id, arg1, LocalID, unsigned int, arg2)
//{
Expand All @@ -159,72 +159,72 @@
//}

// 关闭朋友圈入口
CHOptimizedMethod2(self, CGFloat, FindFriendEntryViewController, tableView, UITableView *, tableView, heightForRowAtIndexPath, NSIndexPath *, indexPath)
{
NSIndexPath *timelineIndexPath = [self valueForKeyPath:@"m_WCTimeLineIndexPath"];
if (indexPath.section != 4) {
NSLog(@"## Hide Time Line Entry ##");
return 0;
}
return CHSuper2(FindFriendEntryViewController, tableView, tableView, heightForRowAtIndexPath, indexPath);
}

CHOptimizedMethod2(self, CGFloat, FindFriendEntryViewController, tableView, UITableView *, tableView, heightForHeaderInSection, NSInteger, section)
{
return 0;
}

CHOptimizedMethod2(self, UITableViewCell *, FindFriendEntryViewController, tableView, UITableView *, tableView, cellForRowAtIndexPath, NSIndexPath *, indexPath)
{
NSIndexPath *timelineIndexPath = [self valueForKeyPath:@"m_WCTimeLineIndexPath"];
UITableViewCell *cell = CHSuper2(FindFriendEntryViewController, tableView, tableView, cellForRowAtIndexPath, indexPath);
if (indexPath.section != 4) {
NSLog(@"## Hide Time Line Entry ##");
cell.hidden = YES;
for (UIView *subview in cell.subviews) {
[subview removeFromSuperview];
}
}
return cell;
}

CHOptimizedMethod1(self, void, FindFriendEntryViewController, viewDidAppear, BOOL, animated)
{
CHSuper1(FindFriendEntryViewController, viewDidAppear, animated);
[self performSelector:@selector(reloadData)];
}

// 去掉 TabBar 小红点

CHOptimizedMethod2(self, void, MMTabBarController, setTabBarBadgeImage, id, arg1, forIndex, unsigned int, arg2)
{
if (arg2 != 2 && arg2 != 3) {
CHSuper2(MMTabBarController, setTabBarBadgeImage, arg1, forIndex, arg2);
}
}

CHOptimizedMethod2(self, void, MMTabBarController, setTabBarBadgeString, id, arg1, forIndex, unsigned int, arg2)
{
if (arg2 != 2 && arg2 != 3) {
CHSuper2(MMTabBarController, setTabBarBadgeString, arg1, forIndex, arg2);
}
}

CHOptimizedMethod2(self, void, MMTabBarController, setTabBarBadgeValue, id, arg1, forIndex, unsigned int, arg2)
{
if (arg2 != 2 && arg2 != 3) {
CHSuper2(MMTabBarController, setTabBarBadgeValue, arg1, forIndex, arg2);
}
}

// 去掉各种小红点

CHOptimizedMethod1(self, void, UIView, didAddSubview, UIView *, subview)
{
if ([subview isKindOfClass:NSClassFromString(@"MMBadgeView")]) {
subview.hidden = YES;
}
}
//CHOptimizedMethod2(self, CGFloat, FindFriendEntryViewController, tableView, UITableView *, tableView, heightForRowAtIndexPath, NSIndexPath *, indexPath)
//{
// NSIndexPath *timelineIndexPath = [self valueForKeyPath:@"m_WCTimeLineIndexPath"];
// if (indexPath.section != 4) {
// NSLog(@"## Hide Time Line Entry ##");
// return 0;
// }
// return CHSuper2(FindFriendEntryViewController, tableView, tableView, heightForRowAtIndexPath, indexPath);
//}
//
//CHOptimizedMethod2(self, CGFloat, FindFriendEntryViewController, tableView, UITableView *, tableView, heightForHeaderInSection, NSInteger, section)
//{
// return 0;
//}
//
//CHOptimizedMethod2(self, UITableViewCell *, FindFriendEntryViewController, tableView, UITableView *, tableView, cellForRowAtIndexPath, NSIndexPath *, indexPath)
//{
// NSIndexPath *timelineIndexPath = [self valueForKeyPath:@"m_WCTimeLineIndexPath"];
// UITableViewCell *cell = CHSuper2(FindFriendEntryViewController, tableView, tableView, cellForRowAtIndexPath, indexPath);
// if (indexPath.section != 4) {
// NSLog(@"## Hide Time Line Entry ##");
// cell.hidden = YES;
// for (UIView *subview in cell.subviews) {
// [subview removeFromSuperview];
// }
// }
// return cell;
//}
//
//CHOptimizedMethod1(self, void, FindFriendEntryViewController, viewDidAppear, BOOL, animated)
//{
// CHSuper1(FindFriendEntryViewController, viewDidAppear, animated);
// [self performSelector:@selector(reloadData)];
//}
//
//// 去掉 TabBar 小红点
//
//CHOptimizedMethod2(self, void, MMTabBarController, setTabBarBadgeImage, id, arg1, forIndex, unsigned int, arg2)
//{
// if (arg2 != 2 && arg2 != 3) {
// CHSuper2(MMTabBarController, setTabBarBadgeImage, arg1, forIndex, arg2);
// }
//}
//
//CHOptimizedMethod2(self, void, MMTabBarController, setTabBarBadgeString, id, arg1, forIndex, unsigned int, arg2)
//{
// if (arg2 != 2 && arg2 != 3) {
// CHSuper2(MMTabBarController, setTabBarBadgeString, arg1, forIndex, arg2);
// }
//}
//
//CHOptimizedMethod2(self, void, MMTabBarController, setTabBarBadgeValue, id, arg1, forIndex, unsigned int, arg2)
//{
// if (arg2 != 2 && arg2 != 3) {
// CHSuper2(MMTabBarController, setTabBarBadgeValue, arg1, forIndex, arg2);
// }
//}
//
//// 去掉各种小红点
//
//CHOptimizedMethod1(self, void, UIView, didAddSubview, UIView *, subview)
//{
// if ([subview isKindOfClass:NSClassFromString(@"MMBadgeView")]) {
// subview.hidden = YES;
// }
//}

// 微信运动步数

Expand All @@ -239,7 +239,7 @@
if([today isEqualToDate:otherDate]) {
modifyToday = YES;
}
if ([FishConfigurationCenter sharedInstance].stepCount == 0 || !modifyToday) {
if ([FishConfigurationCenter sharedInstance].stepCount == 0 || modifyToday == NO) {
[FishConfigurationCenter sharedInstance].stepCount = CHSuper0(WCDeviceStepObject, m7StepCount);
}
return [FishConfigurationCenter sharedInstance].stepCount;
Expand All @@ -254,7 +254,7 @@
MMTableViewSectionInfo *sectionInfo = [objc_getClass("MMTableViewSectionInfo") sectionInfoDefaut];
MMTableViewCellInfo *nightCellInfo = [objc_getClass("MMTableViewCellInfo") switchCellForSel:@selector(handleNightMode:) target:[FishConfigurationCenter sharedInstance] title:@"夜间模式" on:[FishConfigurationCenter sharedInstance].isNightMode];
[sectionInfo addCell:nightCellInfo];
MMTableViewCellInfo *stepcountCellInfo = [objc_getClass("MMTableViewCellInfo") editorCellForSel:@selector(handleStepCount:) target:[FishConfigurationCenter sharedInstance] title:@"微信运动步数" margin:300.0 tip:@"请输入步数" focus:NO text:[NSString stringWithFormat:@"%ld", (long)[FishConfigurationCenter sharedInstance].stepCount]];
MMTableViewCellInfo *stepcountCellInfo = [objc_getClass("MMTableViewCellInfo") editorCellForSel:@selector(handleStepCount:) target:[FishConfigurationCenter sharedInstance] title:@"微信运动步数" margin:200.0 tip:@"请输入步数" focus:NO text:[NSString stringWithFormat:@"%ld", (long)[FishConfigurationCenter sharedInstance].stepCount]];
[sectionInfo addCell:stepcountCellInfo];
[tableInfo insertSection:sectionInfo At:0];
MMTableView *tableView = [tableInfo getTableView];
Expand Down Expand Up @@ -381,16 +381,16 @@ BOOL compareColor(UIColor *color1, UIColor *color2)
CHLoadLateClass(CMessageMgr);
CHHook1(CMessageMgr, onRevokeMsg);
CHLoadLateClass(FindFriendEntryViewController);
CHHook2(FindFriendEntryViewController, tableView, heightForRowAtIndexPath);
CHHook2(FindFriendEntryViewController, tableView, cellForRowAtIndexPath);
CHHook1(FindFriendEntryViewController, viewDidAppear);
// CHHook2(FindFriendEntryViewController, tableView, heightForRowAtIndexPath);
// CHHook2(FindFriendEntryViewController, tableView, cellForRowAtIndexPath);
// CHHook1(FindFriendEntryViewController, viewDidAppear);
CHLoadLateClass(MMTabBarController);
CHHook2(MMTabBarController, setTabBarBadgeImage, forIndex);
CHHook2(MMTabBarController, setTabBarBadgeString, forIndex);
CHHook2(MMTabBarController, setTabBarBadgeValue, forIndex);
// CHHook2(MMTabBarController, setTabBarBadgeImage, forIndex);
// CHHook2(MMTabBarController, setTabBarBadgeString, forIndex);
// CHHook2(MMTabBarController, setTabBarBadgeValue, forIndex);
CHLoadLateClass(WCDeviceStepObject);
CHHook0(WCDeviceStepObject, m7StepCount);
CHLoadLateClass(UIView);
CHHook1(UIView, didAddSubview);
// CHHook1(UIView, didAddSubview);
}
}
2 changes: 1 addition & 1 deletion LatestBuild
3 changes: 3 additions & 0 deletions Shell/autoswimfi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ echo "Copying dylib and mobileprovision"
cp "$DYLIB" "extracted/Payload/$APPLICATION/${DYLIB##*/}"
cp "$MOBILEPROV" "extracted/Payload/$APPLICATION/embedded.mobileprovision"

# echo "删除" ${APPLICATION##*/} "中 watch 相关文件"
rm -rf ${app_path}/*watch* ${app_path}/*Watch*

echo "Insert dylib into Mach-O file"
yololib "extracted/Payload/$APPLICATION/${APPLICATION%.*}" "${DYLIB##*/}"

Expand Down