This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class gCtl = NSClassFromString(@"GameController"); | |
Method getMD5ByGameContent = class_getClassMethod(gCtl, @selector(getMD5ByGameContent:)); | |
Method getMD5ByGameContent_hooked = class_getClassMethod(self, @selector(getMD5ByGameContent_hooked:)); | |
... | |
Class metaClass = objc_getMetaClass(class_getName(gCtl)); | |
class_replaceMethod(metaClass, ... | |
class_replaceMethod(metaClass, ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)StartUpload_hooked:(id)arg1 { | |
CMessageWrap *wrap = (CMessageWrap *)arg1; | |
if (wrap.m_uiGameType == 2) { | |
[self StartUpload_hooked:setDice(arg1, 6)]; | |
} else if (wrap.m_uiGameType == 1) { | |
[self StartUpload_hooked:setJsb(arg1, 1)]; | |
} else { | |
[self StartUpload_hooked:arg1]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class_replaceMethod(upMgr, @selector(StartUpload_hooked:), orig, method_getTypeEncoding(StartUpload)); | |
class_replaceMethod(upMgr, @selector(StartUpload:), swz, method_getTypeEncoding(StartUpload_hooked)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMP orig = method_getImplementation(StartUpload); | |
IMP swz = method_getImplementation(StartUpload_hooked); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (void)load { | |
Class upMgr = NSClassFromString(@"CEmoticonUploadMgr"); | |
Method StartUpload = class_getInstanceMethod(upMgr, @selector(StartUpload:)); | |
Method StartUpload_hooked = class_getInstanceMethod(self, @selector(StartUpload_hooked:)); | |
... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// WeChatDiceEntry.h | |
// | |
// Created by Wang Jinli on 2016/10/28. | |
// Copyright © 2016 Wang Jinli. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/ PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>com.apple.springboard.debugapplications</key> | |
<true/> | |
<key>run-unsigned-code</key> | |
<true/> | |
<key>get-task-allow</key> | |
<true/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%ctor { | |
if ([WCPreferencesManager sharedManager].lockScreenEnabled) { | |
%init(LockScreen); | |
} | |
if ([WCPreferencesManager sharedManager].nCEnabled) { | |
%init(NotificationCenter); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *getWeekStr(int weekInt) { | |
NSDate *startDate = [WCPreferencesManager sharedManager].startDate; | |
NSInteger dur = [WCPreferencesManager sharedManager].duration; | |
NSInteger startDay = [[WCPreferencesManager sharedManager].weekStartDay isEqualToString:@"Monday"] ? 1 : 0; | |
WCSemester *sem = [[WCSemester alloc] initWithStartDate:startDate duration:dur weekStartAt:startDay]; | |
NSInteger week = [sem weekNo:[NSDate date]]; | |
if (week == -1) { return @""; } | |
else { | |
NSString *display = [WCPreferencesManager sharedManager].displayFormat; | |
display = [display stringByReplacingOccurrencesOfString:@"\%W" withString:[NSString stringWithFormat:@"%ld", (long)week + weekInt]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)_preferencesChanged { | |
CFStringRef appID = CFSTR("com.wangjinli.weekcountpb"); | |
CFArrayRef keyList = CFPreferencesCopyKeyList(appID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost); | |
if (!keyList) { | |
[self attemptSettingFallbackPrefs]; | |
return; | |
} | |
NSDictionary *preferences = (NSDictionary *)CFBridgingRelease(CFPreferencesCopyMultiple(keyList, appID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost)); | |
CFRelease(keyList); | |
if (!preferences) { |
NewerOlder