Skip to content

Commit

Permalink
add ios15 support, fix preferencesBundle settings issue for tweaks.
Browse files Browse the repository at this point in the history
preferenceBundle's settings storage in
 jbroot("/var/mobile/Library/Preferences/com.your.tweak.plist")
  • Loading branch information
RootHide authored and RootHide committed Dec 29, 2023
1 parent 8769cb8 commit b24a7a5
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Bootstrap/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ - (void)viewDidLoad {
self.rebuildappsBtn.enabled = NO;
self.uninstallBtn.hidden = NO;
}
else if(@available(iOS 16.0, *))
else if(@available(iOS 15.0, *))
{
self.bootstraBtn.enabled = YES;
[self.bootstraBtn setTitle:Localized(@"Install") forState:UIControlStateNormal];
Expand Down
Binary file modified Bootstrap/basebin/bootstrap.dylib
Binary file not shown.
2 changes: 2 additions & 0 deletions Bootstrap/basebin/bootstrap.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- strip these 3 banned entitlements before re-sign
<key>com.apple.private.skip-library-validation</key>
<false/>
<key>com.apple.private.cs.debugger</key>
<false/>
<key>dynamic-codesigning</key>
<false/>
-->
<key>platform-application</key>
<true/>
<key>get-task-allow</key>
Expand Down
Binary file modified Bootstrap/basebin/bootstrapd
Binary file not shown.
Binary file modified Bootstrap/basebin/fastPathSign
Binary file not shown.
Binary file modified Bootstrap/basebin/preload
Binary file not shown.
Binary file modified Bootstrap/basebin/preload.dylib
Binary file not shown.
Binary file modified Bootstrap/basebin/rebuildapp
Binary file not shown.
12 changes: 9 additions & 3 deletions Bootstrap/bootstrap.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int buildPackageSources()
{
NSFileManager* fm = NSFileManager.defaultManager;

ASSERT([[NSString stringWithUTF8String:DEFAULT_SOURCES] writeToFile:jbroot(@"/etc/apt/sources.list.d/default.sources") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
ASSERT([[NSString stringWithFormat:@(DEFAULT_SOURCES), getCFMajorVersion()] writeToFile:jbroot(@"/etc/apt/sources.list.d/default.sources") atomically:YES encoding:NSUTF8StringEncoding error:nil]);

//Users in some regions seem to be unable to access github.io
SYSLOG("locale=%@", [NSUserDefaults.appDefaults valueForKey:@"locale"]);
Expand All @@ -95,7 +95,7 @@ int buildPackageSources()
ASSERT([fm createDirectoryAtPath:jbroot(@"/var/mobile/Library/Application Support/xyz.willy.Zebra") withIntermediateDirectories:YES attributes:attr error:nil]);
}

ASSERT([[NSString stringWithUTF8String:ZEBRA_SOURCES] writeToFile:jbroot(@"/var/mobile/Library/Application Support/xyz.willy.Zebra/sources.list") atomically:YES encoding:NSUTF8StringEncoding error:nil]);
ASSERT([[NSString stringWithFormat:@(ZEBRA_SOURCES), getCFMajorVersion()] writeToFile:jbroot(@"/var/mobile/Library/Application Support/xyz.willy.Zebra/sources.list") atomically:YES encoding:NSUTF8StringEncoding error:nil]);

return 0;
}
Expand Down Expand Up @@ -150,7 +150,13 @@ int InstallBootstrap(NSString* jbroot_path)
ASSERT(mkdir(jbroot_path.fileSystemRepresentation, 0755) == 0);
ASSERT(chown(jbroot_path.fileSystemRepresentation, 0, 0) == 0);

NSString* bootstrapZstFile = [NSBundle.mainBundle.bundlePath stringByAppendingPathComponent:@"bootstrap.tar.zst"];
NSString* bootstrapZstFile = [NSBundle.mainBundle.bundlePath stringByAppendingPathComponent:
[NSString stringWithFormat:@"strapfiles/bootstrap-%d.tar.zst", getCFMajorVersion()]];
if(![fm fileExistsAtPath:bootstrapZstFile]) {
STRAPLOG("can not find bootstrap file, maybe this version of the app is not for iOS%d", NSProcessInfo.processInfo.operatingSystemVersion.majorVersion);
return -1;
}

NSString* bootstrapTarFile = [NSTemporaryDirectory() stringByAppendingPathComponent:@"bootstrap.tar"];
if([fm fileExistsAtPath:bootstrapTarFile])
ASSERT([fm removeItemAtPath:bootstrapTarFile error:nil]);
Expand Down
6 changes: 3 additions & 3 deletions Bootstrap/sources.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Components:\n\
\n\
Types: deb\n\
URIs: https://roothide.github.io/procursus\n\
Suites: iphoneos-arm64e/1900\n\
Suites: iphoneos-arm64e/%d\n\
Components: main\n\
"

Expand All @@ -36,7 +36,7 @@ Components:\n\
\n\
Types: deb\n\
URIs: https://iosjb.top/procursus\n\
Suites: iphoneos-arm64e/1900\n\
Suites: iphoneos-arm64e/%d\n\
Components: main\n\
"

Expand All @@ -46,7 +46,7 @@ deb https://getzbra.com/repo/ ./\n\
deb https://repo.chariz.com/ ./\n\
deb https://havoc.app/ ./\n\
deb https://roothide.github.io/ ./\n\
deb https://roothide.github.io/procursus iphoneos-arm64e/1900 main\n\
deb https://roothide.github.io/procursus iphoneos-arm64e/%d main\n\
\n\
"

Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ THEOS_PACKAGE_SCHEME = roothide

THEOS_DEVICE_IP = iphone13.local

CFVER ?= 1900

#disable theos auto sign for all mach-o
TARGET_CODESIGN = echo "don't sign"

Expand All @@ -35,7 +33,7 @@ clean::

before-package::
rm -rf ./packages
cp ./bootstrap-$(CFVER).tar.zst ./.theos/_/Applications/Bootstrap.app/bootstrap.tar.zst
cp -a ./strapfiles ./.theos/_/Applications/Bootstrap.app/
ldid -Sentitlements.plist ./.theos/_/Applications/Bootstrap.app/Bootstrap
mkdir -p ./packages/Payload
cp -R ./.theos/_/Applications/Bootstrap.app ./packages/Payload
Expand Down
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions strapfiles/bootstrap-2000.tar.zst

0 comments on commit b24a7a5

Please sign in to comment.