Skip to content

Commit 9e97046

Browse files
committed
支持rootless
1 parent 2578173 commit 9e97046

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ THEOS_DEVICE_PORT = 2222
33

44
ARCHS = arm64 arm64e
55

6+
ifeq ($(THEOS_PACKAGE_SCHEME), rootless)
7+
TARGET = iphone:clang:14.5:15.0 # theos includes the iOS 14.5 SDK by default, it's ok
8+
else
69
TARGET = iphone:clang:14.5:9.0
7-
INSTALL_TARGET_PROCESSES = lockdownd
10+
endif
811

12+
INSTALL_TARGET_PROCESSES = lockdownd
913

1014
include $(THEOS)/makefiles/common.mk
1115

Tweak.x

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#import <Foundation/NSUserDefaults+Private.h>
44
#include <unistd.h>
55
#include <substrate.h>
6+
#include <rootless.h>
67

78
extern char **environ;
89

@@ -15,12 +16,12 @@ static NSString *debugserverPath;
1516
static BOOL isRootUser;
1617

1718
static void reloadSettings() {
18-
NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:@"/private/var/mobile/Library/Preferences/com.byteage.xcoderootdebug.plist"];
19+
NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:ROOT_PATH_NS(@"/var/mobile/Library/Preferences/com.byteage.xcoderootdebug.plist")];
1920
NSNumber * enabledValue = (NSNumber *)[settings objectForKey:@"enabled"];
2021
enabled = (enabledValue)? [enabledValue boolValue] : YES;
2122
debugserverPath = [settings objectForKey:@"debugserverPath"];
2223
if(!debugserverPath.length) {
23-
debugserverPath = @"/usr/bin/debugserver";
24+
debugserverPath = ROOT_PATH_NS(@"/usr/bin/debugserver");
2425
}
2526
NSNumber * isRootUserValue = (NSNumber *)[settings objectForKey:@"isRootUser"];
2627
isRootUser = (isRootUserValue)? [isRootUserValue boolValue] : YES;

build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
make clean
3+
make package FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless
4+
make clean
5+
make package FINALPACKAGE=1

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.2
3+
Version: 0.0.3
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)