tweak 一下
#define AwemeFile(path) @"/Library/PreferenceLoader/Preferences/Aweme/" #path
%hook TTNetworkManagerChromium
- (NSArray*)ServerCertificate {
id list = %orig;
NSMutableArray* temp = [NSMutableArray arrayWithArray:list];
NSString *resourcePath = AwemeFile(charles-ssl-proxying-certificate.cer);
NSData *p12Data = [NSData dataWithContentsOfFile:resourcePath];
[temp addObject:p12Data];
return [temp copy];
}
%end
6 个赞
crifan
(crifan)
49
谢谢分享。
贴出自己的,最新的完整的代码:
#define CHARLES_CERT_FILE @"/Library/PreferenceLoader/Preferences/charles/charles-ssl-proxying-certificate.cer"
%hook TTNetworkManagerChromium
- (NSArray *)ServerCertificate {
NSArray* serverCertList = %orig();
NSMutableArray* newCertList = [NSMutableArray arrayWithArray: serverCertList];
NSString *certResourcePath = CHARLES_CERT_FILE;
NSFileManager *defaultManager = [NSFileManager defaultManager];
BOOL isExistedCert = [defaultManager fileExistsAtPath: certResourcePath];
if (isExistedCert) {
NSData *certP12Data = [NSData dataWithContentsOfFile: certResourcePath];
[newCertList addObject: certP12Data];
}
NSMutableArray* retNewCertList = [newCertList copy];
return retNewCertList;
}
%end
5 个赞
请问怎么操作呀,TTNetworkManager在哪里?怎么找到呀,小白,求大佬指教
大佬好凶弟,教下 我写了tweak hook没用,
crifan
(crifan)
57
此代码,对最新版抖音已无效-》应该是新版抖音已改掉相关逻辑,所以代码已失效。