2024年8月22日发(作者:藩方)
1
清理keychain逻辑在函数中-[IFMagicMainVC cleanKeychainClick:]
2
NSFileManager*
man =
[NSFileManager defaultManager];
3
if
([man fileExistsAtPath:@"/var/Keychains/"]) {
4
system("cp /var/Keychains/ /tmp/");
5
void*
ppDb =
0;
6
char cmd[256];
if
(0
==
sqlite3_open("/tmp/", &ppDb)) {
7
strcpy(cmd, "DELETE FROM cert WHERE agrp<>'apple' and agrp not like '%apple%' and agrp <> 'ichat' and agrp <>'lockdown-identities'");
8
sqlite3_exec(ppDb, cmd, 0, 0, 0);
9
strcpy(cmd, "DELETE FROM keys WHERE agrp<>'apple' and agrp not like '%apple%' and agrp <> 'ichat' and agrp <>'lockdown-identities'");
10
sqlite3_exec(ppDb, cmd, 0, 0, 0);
11
strcpy(cmd, "DELETE FROM inet WHERE agrp<>'apple' and agrp not like '%apple%' and agrp <> 'ichat' and agrp <>'lockdown-identities'");
sqlite3_exec(ppDb, cmd, 0, 0, 0);
12
system("cp /tmp/keychain-2.* /var/Keychains/");
13
}
14
1
清理pasteboard逻辑在函数中-[IFMagicMainVC cleanPastboardClick:]
1
2
UIPasteboard*
pb =
[UIPasteboard generalPasteboard];
3
if
(pb !=
nil) {
4
NSArray*
items =
[pb items];
5
if
(items !=
nil) {
6
[items removeAllObjects];
7
}
[pb setItems:items];
8
}
9
10
NSFileManager*
man =
[NSFileManager defaultManager];
11
NSProcessInfo*
proc =
[NSProcessInfo processInfo];
12
BOOL
isbe8 =
FALSE;
13
NSOperatingSystemVersion ver;
14
ersion =
8;
15
ersion =
0;
16
ersion =
0;
17
if
([proc respondsToSelector:@selector(isOperatingSystemAtLeastVersion:&ver)]) {
18
isbe8 =
[proc isOperatingSystemAtLeastVersion:&ver];
19
}
20
21
NSString*
pbplist =
nil;
22
NSString*
pbbundle =
nil;
23
if
([man fileExistsAtPath:@"/System/Library/LaunchDaemons/"]) {
24
pbplist =
@"/System/Library/LaunchDaemons/";
25
pbbundle =
@"oardd";
26
}
27
else
if
([man fileExistsAtPath:@"/Library/LaunchDaemons/"]) {
28
pbplist =
@"/Library/LaunchDaemons/";
29
pbbundle =
@"oardd";
}
30
else
if
([man fileExistsAtPath:@"/System/Library/LaunchDaemons/"]) {
31
pbplist =
@"/System/Library/LaunchDaemons/";
32
pbbundle =
@"";
33
}
34
35
BOOL
pbdbexist =
[man fileExistsAtPath:@"/var/mobile/Library/Caches//pasteboardDB"];
36
NSString*
pbcontainer =
nil;
37
if
([man fileExistsAtPath:@"/var/mobile/Library/Caches/"]) {
38
pbcontainer =
@"/var/mobile/Library/Caches/";
39
} else
if
([man fileExistsAtPath:@"/var/mobile/Library/Caches/oard"]) {
40
pbcontainer =
@"/var/mobile/Library/Caches/oard";
41
}
42
if
(!isbe8 && [man fileExistsAtPath:pbplist]) {
43
system("launchctl unload -w");
44
}
45
if
(pbcontainer !=
nil && [man fileExistsAtPath:pbcontainer]) {
46
NSString*
cmd =
[NSString stringWithFormat:@"rm -rf %@/*", pbcontainer];
system([cmd UTF8String]);
47
}
48
if
(pbdbexist) {
49
NSString*
cmd =
[NSString stringWithFormat:@"cp %@ %@", @"/Applications//",
50
@"/var/mobile/Library/Caches//pasteboardDB"];
51
system([cmd UTF8String]);
52
}
53
45
。。。。
46
47
----------------代理/VPN----------------
VPN:未开启
48
iPhone7:/var/mobile/Containers/Data/Application/4930BF56-D0BE-43CE-80F1-406427F7
49
50
51
52
2024年8月22日发(作者:藩方)
1
清理keychain逻辑在函数中-[IFMagicMainVC cleanKeychainClick:]
2
NSFileManager*
man =
[NSFileManager defaultManager];
3
if
([man fileExistsAtPath:@"/var/Keychains/"]) {
4
system("cp /var/Keychains/ /tmp/");
5
void*
ppDb =
0;
6
char cmd[256];
if
(0
==
sqlite3_open("/tmp/", &ppDb)) {
7
strcpy(cmd, "DELETE FROM cert WHERE agrp<>'apple' and agrp not like '%apple%' and agrp <> 'ichat' and agrp <>'lockdown-identities'");
8
sqlite3_exec(ppDb, cmd, 0, 0, 0);
9
strcpy(cmd, "DELETE FROM keys WHERE agrp<>'apple' and agrp not like '%apple%' and agrp <> 'ichat' and agrp <>'lockdown-identities'");
10
sqlite3_exec(ppDb, cmd, 0, 0, 0);
11
strcpy(cmd, "DELETE FROM inet WHERE agrp<>'apple' and agrp not like '%apple%' and agrp <> 'ichat' and agrp <>'lockdown-identities'");
sqlite3_exec(ppDb, cmd, 0, 0, 0);
12
system("cp /tmp/keychain-2.* /var/Keychains/");
13
}
14
1
清理pasteboard逻辑在函数中-[IFMagicMainVC cleanPastboardClick:]
1
2
UIPasteboard*
pb =
[UIPasteboard generalPasteboard];
3
if
(pb !=
nil) {
4
NSArray*
items =
[pb items];
5
if
(items !=
nil) {
6
[items removeAllObjects];
7
}
[pb setItems:items];
8
}
9
10
NSFileManager*
man =
[NSFileManager defaultManager];
11
NSProcessInfo*
proc =
[NSProcessInfo processInfo];
12
BOOL
isbe8 =
FALSE;
13
NSOperatingSystemVersion ver;
14
ersion =
8;
15
ersion =
0;
16
ersion =
0;
17
if
([proc respondsToSelector:@selector(isOperatingSystemAtLeastVersion:&ver)]) {
18
isbe8 =
[proc isOperatingSystemAtLeastVersion:&ver];
19
}
20
21
NSString*
pbplist =
nil;
22
NSString*
pbbundle =
nil;
23
if
([man fileExistsAtPath:@"/System/Library/LaunchDaemons/"]) {
24
pbplist =
@"/System/Library/LaunchDaemons/";
25
pbbundle =
@"oardd";
26
}
27
else
if
([man fileExistsAtPath:@"/Library/LaunchDaemons/"]) {
28
pbplist =
@"/Library/LaunchDaemons/";
29
pbbundle =
@"oardd";
}
30
else
if
([man fileExistsAtPath:@"/System/Library/LaunchDaemons/"]) {
31
pbplist =
@"/System/Library/LaunchDaemons/";
32
pbbundle =
@"";
33
}
34
35
BOOL
pbdbexist =
[man fileExistsAtPath:@"/var/mobile/Library/Caches//pasteboardDB"];
36
NSString*
pbcontainer =
nil;
37
if
([man fileExistsAtPath:@"/var/mobile/Library/Caches/"]) {
38
pbcontainer =
@"/var/mobile/Library/Caches/";
39
} else
if
([man fileExistsAtPath:@"/var/mobile/Library/Caches/oard"]) {
40
pbcontainer =
@"/var/mobile/Library/Caches/oard";
41
}
42
if
(!isbe8 && [man fileExistsAtPath:pbplist]) {
43
system("launchctl unload -w");
44
}
45
if
(pbcontainer !=
nil && [man fileExistsAtPath:pbcontainer]) {
46
NSString*
cmd =
[NSString stringWithFormat:@"rm -rf %@/*", pbcontainer];
system([cmd UTF8String]);
47
}
48
if
(pbdbexist) {
49
NSString*
cmd =
[NSString stringWithFormat:@"cp %@ %@", @"/Applications//",
50
@"/var/mobile/Library/Caches//pasteboardDB"];
51
system([cmd UTF8String]);
52
}
53
45
。。。。
46
47
----------------代理/VPN----------------
VPN:未开启
48
iPhone7:/var/mobile/Containers/Data/Application/4930BF56-D0BE-43CE-80F1-406427F7
49
50
51
52