diff --git a/Bootstrap.xcodeproj/project.pbxproj b/Bootstrap.xcodeproj/project.pbxproj index 731c6243..3177b58e 100644 --- a/Bootstrap.xcodeproj/project.pbxproj +++ b/Bootstrap.xcodeproj/project.pbxproj @@ -22,7 +22,7 @@ 84438D602B26546E00A1E407 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84438D5F2B26546E00A1E407 /* MobileCoreServices.framework */; }; 84438D622B2654EB00A1E407 /* MobileContainerManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84438D612B2654EB00A1E407 /* MobileContainerManager.framework */; }; 84438D652B27522400A1E407 /* envbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = 84438D642B27522400A1E407 /* envbuf.c */; }; - 84438D6C2B2CDE0100A1E407 /* AppList.m in Sources */ = {isa = PBXBuildFile; fileRef = 84438D682B2CDE0100A1E407 /* AppList.m */; }; + 84438D6C2B2CDE0100A1E407 /* AppInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 84438D682B2CDE0100A1E407 /* AppInfo.m */; }; 84438D6D2B2CDE0100A1E407 /* AppViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84438D6B2B2CDE0100A1E407 /* AppViewController.m */; }; 84438D6F2B2CE5A300A1E407 /* AppEnabler.m in Sources */ = {isa = PBXBuildFile; fileRef = 84438D6E2B2CE5A300A1E407 /* AppEnabler.m */; }; 847099872B1D855D003FA4ED /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 847099862B1D855D003FA4ED /* AppDelegate.m */; }; @@ -83,8 +83,8 @@ 84438D612B2654EB00A1E407 /* MobileContainerManager.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileContainerManager.framework; path = Bootstrap/Frameworks/MobileContainerManager.framework; sourceTree = ""; }; 84438D632B27522400A1E407 /* envbuf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = envbuf.h; sourceTree = ""; }; 84438D642B27522400A1E407 /* envbuf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = envbuf.c; sourceTree = ""; }; - 84438D682B2CDE0100A1E407 /* AppList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppList.m; sourceTree = ""; }; - 84438D692B2CDE0100A1E407 /* AppList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppList.h; sourceTree = ""; }; + 84438D682B2CDE0100A1E407 /* AppInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppInfo.m; sourceTree = ""; }; + 84438D692B2CDE0100A1E407 /* AppInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppInfo.h; sourceTree = ""; }; 84438D6A2B2CDE0100A1E407 /* AppViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppViewController.h; sourceTree = ""; }; 84438D6B2B2CDE0100A1E407 /* AppViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppViewController.m; sourceTree = ""; }; 84438D6E2B2CE5A300A1E407 /* AppEnabler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppEnabler.m; sourceTree = ""; }; @@ -190,8 +190,8 @@ FE0633B52B41CF6600B94787 /* Views */, FE0633B42B41CF5800B94787 /* Extensions */, FE0633B32B41CF4D00B94787 /* Classes */, - 84438D692B2CDE0100A1E407 /* AppList.h */, - 84438D682B2CDE0100A1E407 /* AppList.m */, + 84438D692B2CDE0100A1E407 /* AppInfo.h */, + 84438D682B2CDE0100A1E407 /* AppInfo.m */, 847099852B1D855D003FA4ED /* AppDelegate.h */, 847099862B1D855D003FA4ED /* AppDelegate.m */, 847099882B1D855D003FA4ED /* SceneDelegate.h */, @@ -378,7 +378,7 @@ 847099982B1D855E003FA4ED /* main.m in Sources */, 84438D522B260FEB00A1E407 /* zstd_wrapper.m in Sources */, 8470998A2B1D855D003FA4ED /* SceneDelegate.m in Sources */, - 84438D6C2B2CDE0100A1E407 /* AppList.m in Sources */, + 84438D6C2B2CDE0100A1E407 /* AppInfo.m in Sources */, 84438D6D2B2CDE0100A1E407 /* AppViewController.m in Sources */, 84438D5D2B264A2800A1E407 /* NSUserDefaults+appDefaults.m in Sources */, ); @@ -571,7 +571,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.4; + MARKETING_VERSION = 1.2.5; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.roothide.Bootstrap; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -609,7 +609,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.2.4; + MARKETING_VERSION = 1.2.5; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.roothide.Bootstrap; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Bootstrap/AppEnabler.m b/Bootstrap/AppEnabler.m index 8292a70a..c1e1c19a 100644 --- a/Bootstrap/AppEnabler.m +++ b/Bootstrap/AppEnabler.m @@ -1,6 +1,6 @@ #import #include -#include "AppList.h" +#include "AppInfo.h" #include "common.h" NSString * relativize(NSURL * to, NSURL * from, BOOL fromIsDir) { diff --git a/Bootstrap/AppList.h b/Bootstrap/AppInfo.h similarity index 97% rename from Bootstrap/AppList.h rename to Bootstrap/AppInfo.h index af805141..afe57c5b 100644 --- a/Bootstrap/AppList.h +++ b/Bootstrap/AppInfo.h @@ -1,7 +1,7 @@ #import -@interface AppList : NSObject +@interface AppInfo : NSObject @property (nonatomic, strong) NSString *infoPlistPath; @property (nonatomic, readonly) NSString* bundleIdentifier; diff --git a/Bootstrap/AppList.m b/Bootstrap/AppInfo.m similarity index 99% rename from Bootstrap/AppList.m rename to Bootstrap/AppInfo.m index de03f781..e8e8f281 100644 --- a/Bootstrap/AppList.m +++ b/Bootstrap/AppInfo.m @@ -1,7 +1,7 @@ // https://github.com/wujianguo/iOSAppsInfo // modified by Shadow- -#import "AppList.h" +#import "AppInfo.h" #import @interface UIImage () @@ -42,7 +42,7 @@ + (instancetype)applicationProxyForIdentifier:(NSString*)identifier; @end -@implementation AppList +@implementation AppInfo { PrivateApi_LSApplicationProxy* _applicationProxy; UIImage* _icon; diff --git a/Bootstrap/AppViewController.m b/Bootstrap/AppViewController.m index 6eb13f8e..25cde6c5 100644 --- a/Bootstrap/AppViewController.m +++ b/Bootstrap/AppViewController.m @@ -2,7 +2,7 @@ #import "AppViewController.h" #include "AppDelegate.h" -#import "AppList.h" +#import "AppInfo.h" #include "common.h" #include "AppDelegate.h" #include @@ -54,7 +54,7 @@ -(void)reloadSearch { isFiltered = true; filteredApps = [[NSMutableArray alloc] init]; searchText = searchText.lowercaseString; - for (AppList* app in appsArray) { + for (AppInfo* app in appsArray) { NSRange nameRange = [app.name.lowercaseString rangeOfString:searchText options:NSCaseInsensitiveSearch]; NSRange bundleIdRange = [app.bundleIdentifier.lowercaseString rangeOfString:searchText options:NSCaseInsensitiveSearch]; if(nameRange.location != NSNotFound || bundleIdRange.location != NSNotFound) { @@ -127,7 +127,7 @@ - (void)viewWillAppear:(BOOL)animated { [self.tableView.refreshControl endRefreshing]; } --(BOOL)tweakEnabled:(AppList*)app { +-(BOOL)tweakEnabled:(AppInfo*)app { struct stat st; if(lstat([app.bundleURL.path stringByAppendingPathComponent:@".jbroot"].fileSystemRepresentation, &st)==0) { return YES; @@ -156,7 +156,7 @@ - (void)updateData:(BOOL)sort { for(id proxy in allInstalledApplications) { - AppList* app = [AppList appWithPrivateProxy:proxy]; + AppInfo* app = [AppInfo appWithPrivateProxy:proxy]; // if(app.isHiddenApp) continue; @@ -196,7 +196,7 @@ - (void)updateData:(BOOL)sort { if(sort) { - NSArray *appsSortedByName = [applications sortedArrayUsingComparator:^NSComparisonResult(AppList *app1, AppList *app2) { + NSArray *appsSortedByName = [applications sortedArrayUsingComparator:^NSComparisonResult(AppInfo *app1, AppInfo *app2) { BOOL enabled1 = [self tweakEnabled:app1]; BOOL enabled2 = [self tweakEnabled:app2]; @@ -217,9 +217,9 @@ - (void)updateData:(BOOL)sort { else { NSMutableArray *newapps = [NSMutableArray array]; - [applications enumerateObjectsUsingBlock:^(AppList *newobj, NSUInteger idx, BOOL * _Nonnull stop) { + [applications enumerateObjectsUsingBlock:^(AppInfo *newobj, NSUInteger idx, BOOL * _Nonnull stop) { __block BOOL hasBeenContained = NO; - [self->appsArray enumerateObjectsUsingBlock:^(AppList *obj, NSUInteger idx, BOOL * _Nonnull stop) { + [self->appsArray enumerateObjectsUsingBlock:^(AppInfo *obj, NSUInteger idx, BOOL * _Nonnull stop) { if ([obj.bundleIdentifier isEqualToString:newobj.bundleIdentifier]) { hasBeenContained = YES; *stop = YES; @@ -231,8 +231,8 @@ - (void)updateData:(BOOL)sort { }]; NSMutableArray *tmpArray = [NSMutableArray array]; - [self->appsArray enumerateObjectsUsingBlock:^(AppList *obj, NSUInteger idx, BOOL * _Nonnull stop) { - [applications enumerateObjectsUsingBlock:^(AppList *newobj, NSUInteger idx, BOOL * _Nonnull stop) { + [self->appsArray enumerateObjectsUsingBlock:^(AppInfo *obj, NSUInteger idx, BOOL * _Nonnull stop) { + [applications enumerateObjectsUsingBlock:^(AppInfo *newobj, NSUInteger idx, BOOL * _Nonnull stop) { if ([obj.bundleIdentifier isEqualToString:newobj.bundleIdentifier]) { [tmpArray addObject:newobj]; *stop = YES; @@ -291,7 +291,7 @@ - (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell"]; - AppList* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row]; + AppInfo* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row]; if(!app.isHiddenApp) { UIImage *image = app.icon; @@ -328,7 +328,7 @@ - (void)switchChanged:(id)sender { CGPoint pos = [switchInCell convertPoint:switchInCell.bounds.origin toView:self.tableView]; NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:pos]; BOOL enabled = switchInCell.on; - AppList* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row]; + AppInfo* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row]; dispatch_async(dispatch_get_global_queue(0, 0), ^{ [AppDelegate showHudMsg:Localized(@"Applying")]; @@ -365,7 +365,7 @@ - (void)cellLongPress:(UIGestureRecognizer *)recognizer long tag = recognizer.view.tag; NSIndexPath* indexPath = [NSIndexPath indexPathForRow:tag&0xFFFFFFFF inSection:tag>>32]; - AppList* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row]; + AppInfo* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row]; dispatch_async(dispatch_get_global_queue(0, 0), ^{ PrivateApi_LSApplicationWorkspace* _workspace = [NSClassFromString(@"LSApplicationWorkspace") new]; diff --git a/Bootstrap/ViewController.m b/Bootstrap/ViewController.m index df5cb5b9..f53ef59d 100644 --- a/Bootstrap/ViewController.m +++ b/Bootstrap/ViewController.m @@ -1,7 +1,7 @@ #include "common.h" #include "credits.h" #include "bootstrap.h" -#include "AppList.h" +#include "AppInfo.h" #include "AppDelegate.h" #import "ViewController.h" #include "AppViewController.h" @@ -151,6 +151,12 @@ void initFromSwiftUI() @end +void setIdleTimerDisabled(BOOL disabled) { + dispatch_async(dispatch_get_main_queue(), ^{ + [[UIApplication sharedApplication] setIdleTimerDisabled:disabled]; + }); +} + BOOL checkTSVersion() { CFURLRef binaryURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (__bridge CFStringRef)NSBundle.mainBundle.executablePath, kCFURLPOSIXPathStyle, false); @@ -184,6 +190,7 @@ void rebuildappsAction() dispatch_async(dispatch_get_global_queue(0, 0), ^{ [AppDelegate showHudMsg:Localized(@"Applying")]; + setIdleTimerDisabled(YES); NSString* log=nil; NSString* err=nil; @@ -194,6 +201,7 @@ void rebuildappsAction() [AppDelegate showMesage:[NSString stringWithFormat:@"%@\n\nstderr:\n%@",log,err] title:[NSString stringWithFormat:@"code(%d)",status]]; } [AppDelegate dismissHud]; + setIdleTimerDisabled(NO); }); } @@ -240,7 +248,7 @@ void reinstallPackageManager() int rebuildIconCache() { -AppList* tsapp = [AppList appWithBundleIdentifier:@"com.opa334.TrollStore"]; + AppInfo* tsapp = [AppInfo appWithBundleIdentifier:@"com.opa334.TrollStore"]; if(!tsapp) { STRAPLOG("trollstore not found!"); return -1; @@ -279,6 +287,7 @@ void rebuildIconCacheAction() [AppDelegate addLogText:Localized(@"Status: Rebuilding Icon Cache")]; dispatch_async(dispatch_get_global_queue(0, 0), ^{ + setIdleTimerDisabled(YES); [AppDelegate showHudMsg:Localized(@"Rebuilding") detail:Localized(@"Don't exit Bootstrap app until show the lock screen")]; NSString* log=nil; @@ -289,6 +298,7 @@ void rebuildIconCacheAction() } [AppDelegate dismissHud]; + setIdleTimerDisabled(NO); }); } @@ -424,6 +434,7 @@ void bootstrapAction() [AppDelegate showHudMsg:Localized(@"Bootstrapping")]; dispatch_async(dispatch_get_global_queue(0, 0), ^{ + setIdleTimerDisabled(YES); const char* argv[] = {NSBundle.mainBundle.executablePath.fileSystemRepresentation, "bootstrap", NULL}; int status = spawn(argv[0], argv, environ, ^(char* outstr, int length){ @@ -435,6 +446,7 @@ void bootstrapAction() }); [AppDelegate dismissHud]; + setIdleTimerDisabled(NO); if(status != 0) { @@ -478,12 +490,14 @@ void unbootstrapAction() dispatch_async(dispatch_get_global_queue(0, 0), ^{ [AppDelegate showHudMsg:Localized(@"Uninstalling")]; + setIdleTimerDisabled(YES); NSString* log=nil; NSString* err=nil; int status = spawnRoot(NSBundle.mainBundle.executablePath, @[@"unbootstrap"], &log, &err); [AppDelegate dismissHud]; + setIdleTimerDisabled(NO); NSString* msg = (status==0) ? Localized(@"bootstrap uninstalled") : [NSString stringWithFormat:@"code(%d)\n%@\n\nstderr:\n%@",status,log,err]; diff --git a/Bootstrap/basebin/bootstrap.dylib b/Bootstrap/basebin/bootstrap.dylib index 3b5f0eb1..6ccfd8ac 100755 Binary files a/Bootstrap/basebin/bootstrap.dylib and b/Bootstrap/basebin/bootstrap.dylib differ diff --git a/Bootstrap/basebin/bootstrapd b/Bootstrap/basebin/bootstrapd index c935c776..a474a139 100755 Binary files a/Bootstrap/basebin/bootstrapd and b/Bootstrap/basebin/bootstrapd differ diff --git a/Bootstrap/basebin/devtest b/Bootstrap/basebin/devtest index d7a8122c..2ac47e2d 100755 Binary files a/Bootstrap/basebin/devtest and b/Bootstrap/basebin/devtest differ diff --git a/Bootstrap/basebin/preload b/Bootstrap/basebin/preload index f57c214f..7285a007 100755 Binary files a/Bootstrap/basebin/preload and b/Bootstrap/basebin/preload differ diff --git a/Bootstrap/basebin/preload.dylib b/Bootstrap/basebin/preload.dylib index 1d43fea0..fb3affa5 100755 Binary files a/Bootstrap/basebin/preload.dylib and b/Bootstrap/basebin/preload.dylib differ diff --git a/Bootstrap/basebin/rebuildapp b/Bootstrap/basebin/rebuildapp index e5f7511c..5478798b 100755 Binary files a/Bootstrap/basebin/rebuildapp and b/Bootstrap/basebin/rebuildapp differ diff --git a/Bootstrap/basebin/uicache b/Bootstrap/basebin/uicache index fba7309e..041e53be 100755 Binary files a/Bootstrap/basebin/uicache and b/Bootstrap/basebin/uicache differ diff --git a/Bootstrap/bootstrap.m b/Bootstrap/bootstrap.m index 3aaf4bb7..6f88328a 100644 --- a/Bootstrap/bootstrap.m +++ b/Bootstrap/bootstrap.m @@ -6,7 +6,7 @@ #include "sources.h" #include "bootstrap.h" #include "NSUserDefaults+appDefaults.h" -#include "AppList.h" +#include "AppInfo.h" extern int decompress_tar_zstd(const char* src_file_path, const char* dst_file_path); @@ -448,7 +448,7 @@ int unbootstrap() [LSApplicationWorkspace.defaultWorkspace _LSPrivateRebuildApplicationDatabasesForSystemApps:YES internal:YES user:YES]; - AppList* tsapp = [AppList appWithBundleIdentifier:@"com.opa334.TrollStore"]; + AppInfo* tsapp = [AppInfo appWithBundleIdentifier:@"com.opa334.TrollStore"]; if(tsapp) { NSString* log=nil; NSString* err=nil; diff --git a/basebin b/basebin index 09aa35ac..10fd3c0f 160000 --- a/basebin +++ b/basebin @@ -1 +1 @@ -Subproject commit 09aa35ac77dffecaab5e28988989fbece48f6b76 +Subproject commit 10fd3c0faeacb83d4e9772c886cb556d083ef6d5