Skip to content

Commit a6e18b0

Browse files
committed
Bug fixes and improvements
1: enable roothide blacklist. 2: support more daemon injection. 3: more reliable frida -f support 4: fixed an issue that could cause crashes during userspace reboot 5: disbale logs by default to improve performance. 6: update builtin roothide manager package
1 parent 27ecd75 commit a6e18b0

File tree

8 files changed

+111
-160
lines changed

8 files changed

+111
-160
lines changed

Bootstrap/AppEnabler.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ int enableForApp(NSString* bundlePath)
177177

178178
NSString* log=nil;
179179
NSString* err=nil;
180-
if(spawnBootstrap((char*[]){"/usr/bin/uicache","-p", bundlePath.UTF8String, NULL}, &log, &err) != 0) {
180+
if(spawn_bootstrap_binary((char*[]){"/usr/bin/uicache","-p", bundlePath.UTF8String, NULL}, &log, &err) != 0) {
181181
STRAPLOG("%@\nERR:%@", log, err);
182182
AppInfo* app = [AppInfo appWithBundleIdentifier:appInfo[@"CFBundleIdentifier"]];
183183
if(app && [app.bundleURL.path hasPrefix:@"/Applications/"]) {
@@ -194,7 +194,7 @@ int enableForApp(NSString* bundlePath)
194194

195195
NSString* log=nil;
196196
NSString* err=nil;
197-
if(spawnBootstrap((char*[]){"/usr/bin/uicache","-s","-p", rootfsPrefix(bundlePath).UTF8String, NULL}, &log, &err) != 0) {
197+
if(spawn_bootstrap_binary((char*[]){"/usr/bin/uicache","-s","-p", rootfsPrefix(bundlePath).UTF8String, NULL}, &log, &err) != 0) {
198198
STRAPLOG("%@\nERR:%@", log, err);
199199
ABORT();
200200
}
@@ -207,7 +207,7 @@ int enableForApp(NSString* bundlePath)
207207

208208
NSString* log=nil;
209209
NSString* err=nil;
210-
if(spawnBootstrap((char*[]){"/usr/bin/uicache","-s","-p", rootfsPrefix(bundlePath).UTF8String, NULL}, &log, &err) != 0) {
210+
if(spawn_bootstrap_binary((char*[]){"/usr/bin/uicache","-s","-p", rootfsPrefix(bundlePath).UTF8String, NULL}, &log, &err) != 0) {
211211
STRAPLOG("%@\nERR:%@", log, err);
212212
ABORT();
213213
}
@@ -230,14 +230,14 @@ int disableForApp(NSString* bundlePath)
230230
ASSERT([fm removeItemAtPath:bundlePath error:nil]);
231231

232232
NSString* sysPath = [@"/Applications/" stringByAppendingString:bundlePath.lastPathComponent];
233-
ASSERT(spawnBootstrap((char*[]){"/usr/bin/uicache","-p", rootfsPrefix(sysPath).UTF8String, NULL}, nil, nil) == 0);
233+
ASSERT(spawn_bootstrap_binary((char*[]){"/usr/bin/uicache","-p", rootfsPrefix(sysPath).UTF8String, NULL}, nil, nil) == 0);
234234
}
235235
else if([appInfo[@"CFBundleIdentifier"] hasPrefix:@"com.apple."] || hasTrollstoreMarker(bundlePath.fileSystemRepresentation))
236236
{
237237

238238
ASSERT(restoreApp(bundlePath) == 0);
239239

240-
ASSERT(spawnBootstrap((char*[]){"/usr/bin/uicache","-s","-p", rootfsPrefix(bundlePath).UTF8String, NULL}, nil, nil) == 0);
240+
ASSERT(spawn_bootstrap_binary((char*[]){"/usr/bin/uicache","-s","-p", rootfsPrefix(bundlePath).UTF8String, NULL}, nil, nil) == 0);
241241
}
242242
else
243243
{
@@ -251,9 +251,9 @@ int disableForApp(NSString* bundlePath)
251251
if(encryptedApp && backupVersion.intValue>=1) return 0;
252252

253253
//unregister or respring to keep app's icon on home screen
254-
ASSERT(spawnBootstrap((char*[]){"/usr/bin/uicache","-u", rootfsPrefix(bundlePath).UTF8String, NULL}, nil, nil) == 0);
254+
ASSERT(spawn_bootstrap_binary((char*[]){"/usr/bin/uicache","-u", rootfsPrefix(bundlePath).UTF8String, NULL}, nil, nil) == 0);
255255
//come back
256-
ASSERT(spawnBootstrap((char*[]){"/usr/bin/uicache","-p", rootfsPrefix(bundlePath).UTF8String, NULL}, nil, nil) == 0);
256+
ASSERT(spawn_bootstrap_binary((char*[]){"/usr/bin/uicache","-p", rootfsPrefix(bundlePath).UTF8String, NULL}, nil, nil) == 0);
257257
}
258258

259259
return 0;

Bootstrap/AppViewController.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@ - (void)switchChanged:(id)sender {
316316
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:pos];
317317
BOOL enabled = switchInCell.on;
318318
AppInfo* app = isFiltered? filteredApps[indexPath.row] : appsArray[indexPath.row];
319+
320+
if(enabled && isBlacklistedApp(app.bundleIdentifier.UTF8String)) {
321+
[AppDelegate showMesage:Localized(@"This app is blacklisted by RootHide Manager, please unblacklist it first.") title:@""];
322+
[switchInCell setOn:NO];
323+
return;
324+
}
319325

320326
dispatch_async(dispatch_get_global_queue(0, 0), ^{
321327
[AppDelegate showHudMsg:Localized(@"Applying")];
@@ -326,9 +332,9 @@ - (void)switchChanged:(id)sender {
326332
NSString* log=nil;
327333
NSString* err=nil;
328334
if(enabled) {
329-
status = spawnRoot(NSBundle.mainBundle.executablePath, @[@"enableapp",app.bundleURL.path], &log, &err);
335+
status = spawn_root(NSBundle.mainBundle.executablePath, @[@"enableapp",app.bundleURL.path], &log, &err);
330336
} else {
331-
status = spawnRoot(NSBundle.mainBundle.executablePath, @[@"disableapp",app.bundleURL.path], &log, &err);
337+
status = spawn_root(NSBundle.mainBundle.executablePath, @[@"disableapp",app.bundleURL.path], &log, &err);
332338
}
333339

334340
if(status != 0) {

0 commit comments

Comments
 (0)