Skip to content

Commit 1afd012

Browse files
committed
兼容16.6.1系统
1 parent eb4cb27 commit 1afd012

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Tweak.x

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,17 @@ typedef CFTypeRef AuthorizationRef;
6262

6363
bool (*original_SMJobSubmit)(CFStringRef domain, CFDictionaryRef job, AuthorizationRef auth, CFErrorRef _Nullable *error);
6464

65+
static NSString *systemDebugserverPath;
66+
6567
bool hooked_SMJobSubmit(CFStringRef domain, CFDictionaryRef job, AuthorizationRef auth, CFErrorRef _Nullable *error) {
6668
LOG(@"Enter hooked_SMJobSubmit %@", job);
6769
NSMutableDictionary *newJobInfo = [NSMutableDictionary dictionaryWithDictionary:(__bridge NSDictionary *)job];
6870
NSMutableArray *programArgs = [newJobInfo[@"ProgramArguments"] mutableCopy];
6971
NSString *program = programArgs[0];
7072
if (enabled) {
71-
if([program isEqualToString:@"/Developer/usr/bin/debugserver"]) {
72-
LOG("Found launch /Developer/usr/bin/debugserver");
73+
if([program isEqualToString:@"/Developer/usr/bin/debugserver"] || [program isEqualToString:@"/usr/libexec/debugserver"]) {
74+
LOG("Found launch %@", program);
75+
systemDebugserverPath = [program copy];
7376
if(debugserverPath.length > 0 && access(debugserverPath.UTF8String, F_OK) == 0){
7477
LOG("Change to launch %@", debugserverPath);
7578
programArgs[0] = debugserverPath;
@@ -96,9 +99,9 @@ bool hooked_SMJobSubmit(CFStringRef domain, CFDictionaryRef job, AuthorizationRe
9699
}
97100
} else {
98101
if([program isEqualToString:debugserverPath]) {
99-
LOG("Found launch %@",debugserverPath);
100-
LOG("Restore launch /Developer/usr/bin/debugserver with mobile");
101-
programArgs[0] = @"/Developer/usr/bin/debugserver";
102+
LOG("Found launch %@", debugserverPath);
103+
LOG("Restore launch system debugserver at %@ with mobile", systemDebugserverPath);
104+
programArgs[0] = systemDebugserverPath;
102105
newJobInfo[@"ProgramArguments"] = programArgs;
103106
newJobInfo[@"UserName"] = @"mobile";
104107
LOG(@"Now SMJobSubmit %@", newJobInfo);

control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: com.byteage.xcoderootdebug
22
Name: XcodeRootDebug
3-
Version: 0.0.1
3+
Version: 0.0.2
44
Architecture: iphoneos-arm
55
Description: Allow Xcode to start a custom debugserver with root privileges to debug iOS apps.
66
Maintainer: h4ck1n

0 commit comments

Comments
 (0)