Skip to content

Commit

Permalink
Add 'Allow JIT in Apps' option, sort exploits by their recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
opa334 committed Apr 29, 2024
1 parent 8a85235 commit 1d6da8f
Show file tree
Hide file tree
Showing 39 changed files with 228 additions and 18 deletions.
3 changes: 3 additions & 0 deletions Application/Dopamine/Jailbreak/DOJailbreaker.m
Original file line number Diff line number Diff line change
Expand Up @@ -484,12 +484,15 @@ - (void)runWithError:(NSError **)errOut didRemoveJailbreak:(BOOL*)didRemove show
BOOL removeJailbreakEnabled = [[DOPreferenceManager sharedManager] boolPreferenceValueForKey:@"removeJailbreakEnabled" fallback:NO];
BOOL tweaksEnabled = [[DOPreferenceManager sharedManager] boolPreferenceValueForKey:@"tweakInjectionEnabled" fallback:YES];
BOOL idownloadEnabled = [[DOPreferenceManager sharedManager] boolPreferenceValueForKey:@"idownloadEnabled" fallback:NO];
BOOL appJITEnabled = [[DOPreferenceManager sharedManager] boolPreferenceValueForKey:@"appJITEnabled" fallback:YES];

*errOut = [self gatherSystemInformation];
if (*errOut) return;
*errOut = [self doExploitation];
if (*errOut) return;

gSystemInfo.jailbreakSettings.markAppsAsDebugged = appJITEnabled;

[[DOUIManager sharedInstance] sendLog:DOLocalizedString(@"Building Phys R/W Primitive") debug:NO];
*errOut = [self buildPhysRWPrimitive];
if (*errOut) return;
Expand Down
45 changes: 36 additions & 9 deletions Application/Dopamine/UI/Settings/DOSettingsController.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,24 @@ - (NSArray *)availableKernelExploitNames
- (NSArray *)availablePACBypassIdentifiers
{
NSMutableArray *identifiers = [NSMutableArray new];
for (DOExploit *exploit in _availablePACBypasses) {
[identifiers addObject:exploit.identfier];
}
if (![DOEnvironmentManager sharedManager].isPACBypassRequired) {
[identifiers addObject:@"none"];
}
for (DOExploit *exploit in _availablePACBypasses) {
[identifiers addObject:exploit.identfier];
}
return identifiers;
}

- (NSArray *)availablePACBypassNames
{
NSMutableArray *names = [NSMutableArray new];
if (![DOEnvironmentManager sharedManager].isPACBypassRequired) {
[names addObject:DOLocalizedString(@"None")];
}
for (DOExploit *exploit in _availablePACBypasses) {
[names addObject:exploit.name];
}
if (![DOEnvironmentManager sharedManager].isPACBypassRequired) {
[names addObject:@"None"];
}
return names;
}

Expand Down Expand Up @@ -124,10 +124,12 @@ - (id)specifiers
SEL defGetter = @selector(readPreferenceValue:);
SEL defSetter = @selector(setPreferenceValue:specifier:);

_availableKernelExploits = [exploitManager availableExploitsForType:EXPLOIT_TYPE_KERNEL].allObjects;
NSSortDescriptor *prioritySortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"priority" ascending:NO];

_availableKernelExploits = [[exploitManager availableExploitsForType:EXPLOIT_TYPE_KERNEL] sortedArrayUsingDescriptors:@[prioritySortDescriptor]];
if (envManager.isArm64e) {
_availablePACBypasses = [exploitManager availableExploitsForType:EXPLOIT_TYPE_PAC].allObjects;
_availablePPLBypasses = [exploitManager availableExploitsForType:EXPLOIT_TYPE_PPL].allObjects;
_availablePACBypasses = [[exploitManager availableExploitsForType:EXPLOIT_TYPE_PAC] sortedArrayUsingDescriptors:@[prioritySortDescriptor]];
_availablePPLBypasses = [[exploitManager availableExploitsForType:EXPLOIT_TYPE_PPL] sortedArrayUsingDescriptors:@[prioritySortDescriptor]];
}

PSSpecifier *headerSpecifier = [PSSpecifier emptyGroupSpecifier];
Expand Down Expand Up @@ -201,6 +203,12 @@ - (id)specifiers
[idownloadSpecifier setProperty:@NO forKey:@"default"];
[specifiers addObject:idownloadSpecifier];

PSSpecifier *appJitSpecifier = [PSSpecifier preferenceSpecifierNamed:DOLocalizedString(@"Settings_Apps_JIT") target:self set:@selector(setAppJITEnabled:specifier:) get:@selector(readAppJITEnabled:) detail:nil cell:PSSwitchCell edit:nil];
[appJitSpecifier setProperty:@YES forKey:@"enabled"];
[appJitSpecifier setProperty:@"appJITEnabled" forKey:@"key"];
[appJitSpecifier setProperty:@YES forKey:@"default"];
[specifiers addObject:appJitSpecifier];

if (!envManager.isJailbroken && !envManager.isInstalledThroughTrollStore) {
PSSpecifier *removeJailbreakSwitchSpecifier = [PSSpecifier preferenceSpecifierNamed:DOLocalizedString(@"Button_Remove_Jailbreak") target:self set:@selector(setRemoveJailbreakEnabled:specifier:) get:defGetter detail:nil cell:PSSwitchCell edit:nil];
[removeJailbreakSwitchSpecifier setProperty:@YES forKey:@"enabled"];
Expand Down Expand Up @@ -359,6 +367,25 @@ - (void)setTweakInjectionEnabled:(id)value specifier:(PSSpecifier *)specifier
}
}

- (id)readAppJITEnabled:(PSSpecifier *)specifier
{
DOEnvironmentManager *envManager = [DOEnvironmentManager sharedManager];
if (envManager.isJailbroken) {
bool v = jbclient_platform_jbsettings_get_bool("markAppsAsDebugged");
return @(v);
}
return [self readPreferenceValue:specifier];
}

- (void)setAppJITEnabled:(id)value specifier:(PSSpecifier *)specifier
{
[self setPreferenceValue:value specifier:specifier];
DOEnvironmentManager *envManager = [DOEnvironmentManager sharedManager];
if (envManager.isJailbroken) {
jbclient_platform_jbsettings_set_bool("markAppsAsDebugged", ((NSNumber *)value).boolValue);
}
}

- (void)setRemoveJailbreakEnabled:(id)value specifier:(PSSpecifier *)specifier
{
[self setPreferenceValue:value specifier:specifier];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ @implementation DOPSListController
- (void)viewDidLoad {
[super viewDidLoad];


[_table setSeparatorColor:[UIColor clearColor]];
[_table setBackgroundColor:[UIColor clearColor]];
[DOPSListController setupViewControllerStyle:self];
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/ar.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "تشغيل الأدوات";
"Settings_iDownload" = "iDownload (محطة المطور)";
"Settings_Verbose_Logs" = "السجلات المطولة";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "إزالة الجيلبريك";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/da.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Tweak-injektion";
"Settings_iDownload" = "iDownload (Udviklerterminal)";
"Settings_Verbose_Logs" = "Detaljerede logfiler";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Fjern Jailbreak";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Tweaks laden";
"Settings_iDownload" = "iDownload (Entwickler-Terminal)";
"Settings_Verbose_Logs" = "Detaillierte Logs";
"Settings_Apps_JIT" = "Erlaube JIT in Apps";

// Settings Buttons
"Button_Remove_Jailbreak" = "Jailbreak entfernen";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/el.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Ενσωμάτωση Tweak";
"Settings_iDownload" = "iDownload (Τερματικό προγραμματιστή)";
"Settings_Verbose_Logs" = "Λεπτομερής καταγραφή";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Αφαίρεση Jailbreak";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Tweak Injection";
"Settings_iDownload" = "iDownload (Developer Shell)";
"Settings_Verbose_Logs" = "Verbose Logs";
"Settings_Apps_JIT" = "Allow JIT in Apps";

// Settings Buttons
"Button_Remove_Jailbreak" = "Remove Jailbreak";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Inyección de ajustes";
"Settings_iDownload" = "iDownload (Shell de desarrollador)";
"Settings_Verbose_Logs" = "Registros detallados";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Eliminar Jailbreak";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/fil.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Tweak Injection";
"Settings_iDownload" = "iDownload (Terminal ng Developer)";
"Settings_Verbose_Logs" = "Mga Verbose Logs";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Tanggalin ang Jailbreak";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Injection de tweaks";
"Settings_iDownload" = "iDownload (Outil de dev)";
"Settings_Verbose_Logs" = "Mode verbose";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Supprimer le jailbreak";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/it.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Iniezione Tweak";
"Settings_iDownload" = "iDownload (Terminal per sviluppatori)";
"Settings_Verbose_Logs" = "Log Dettagliati";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Rimuovi il Jailbreak";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Tweak Injection";
"Settings_iDownload" = "iDownload (開発者用シェル)";
"Settings_Verbose_Logs" = "詳細なログ";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Jailbreak環境の削除";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/kk.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Твиктерді енгізу";
"Settings_iDownload" = "iDownload (Әзірлеуші ​​​​терминалы)";
"Settings_Verbose_Logs" = "Кеңейтілген журналдар";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Джейлбрейкті жою";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/ko.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "트윅 주입";
"Settings_iDownload" = "iDownload (개발자 터미널)";
"Settings_Verbose_Logs" = "로그";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "탈옥 제거";
Expand Down
2 changes: 1 addition & 1 deletion Application/Dopamine/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int main(int argc, char * argv[]) {

// If systemhook isn't loaded and we are already jailbroken, we need to do the checkin ourselves
// This can happen when the jailbreak is hidden or when tweak injection into the Dopamine app is disabled via Choicy
jbclient_process_checkin(NULL, NULL, NULL);
jbclient_process_checkin(NULL, NULL, NULL, NULL);

if ([DOEnvironmentManager sharedManager].isJailbroken) {
setenv("PATH", "/sbin:/bin:/usr/sbin:/usr/bin:/var/jb/sbin:/var/jb/bin:/var/jb/usr/sbin:/var/jb/usr/bin", 1);
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/nl.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Tweak Injection";
"Settings_iDownload" = "iDownload (Ontwikkelaar Terminal)";
"Settings_Verbose_Logs" = "Uitgebreide logs";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Jailbreak verwijderen";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/pl.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Wstrzykiwanie tweaków";
"Settings_iDownload" = "iDownload (terminal dla deweloperów)";
"Settings_Verbose_Logs" = "Logi verbose";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Usuń jailbreak";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/pt-BR.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Injeção de Tweaks";
"Settings_iDownload" = "iDownload (Terminal de desenvolvedor)";
"Settings_Verbose_Logs" = "Logs do Verbose";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Remover o Jailbreak";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Внедрение твиков";
"Settings_iDownload" = "iDownload (Терминал разработчика)";
"Settings_Verbose_Logs" = "Расширенные логи";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Удалить джейлбрейк";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Tweak Injection";
"Settings_iDownload" = "iDownload (Terminal för utvecklare)";
"Settings_Verbose_Logs" = "Omfattande loggar";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Ta Bot Jailbreak";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/th.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Tweak Injection";
"Settings_iDownload" = "iDownload (Developer Shell)";
"Settings_Verbose_Logs" = "Verbose Logs";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "ลบเจลเบรค";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/tr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Tweak Enjeksiyonu";
"Settings_iDownload" = "iDownload (Geliştirici Terminali)";
"Settings_Verbose_Logs" = "Sözlü Loglar";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Jailbreak'i Sil";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/uk.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "ін'єкція твiков";
"Settings_iDownload" = "iDownload (Термінал розробника)";
"Settings_Verbose_Logs" = "Докладні логи";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Видалити джейлбрейк";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/ur.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Tweak Injection";
"Settings_iDownload" = "iDownload (ڈویلپر ٹرمینل)";
"Settings_Verbose_Logs" = "Verbose Logs";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = " جیل بریک اتارلو";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/vi.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "Cho phép chạy Tweak";
"Settings_iDownload" = "iDownload (nhà phát triển)";
"Settings_Verbose_Logs" = "Hiện Log dạng phức tạp";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "Gỡ Jailbreak";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/zh-CN.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "插件注入";
"Settings_iDownload" = "iDownload (开发者终端)";
"Settings_Verbose_Logs" = "详细日志";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "移除越狱";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/zh-HK.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "插件注入";
"Settings_iDownload" = "iDownload (开发商终端)";
"Settings_Verbose_Logs" = "詳細日誌";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "清除越獄";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "插件注入";
"Settings_iDownload" = "iDownload (开发者终端)";
"Settings_Verbose_Logs" = "详细日志";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "移除越狱";
Expand Down
1 change: 1 addition & 0 deletions Application/Dopamine/zh-TW.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"Settings_Tweak_Injection" = "載入插體";
"Settings_iDownload" = "iDownload (開發者终端)";
"Settings_Verbose_Logs" = "詳細日誌";
/*Settings_Apps_JIT*/

// Settings Buttons
"Button_Remove_Jailbreak" = "移除越獄";
Expand Down
34 changes: 34 additions & 0 deletions BaseBin/launchdhook/src/jbserver/jbdomain_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ static int platform_stage_jailbreak_update(const char *updateTar)
return 1;
}

static int platform_jbsettings_get(const char *key, xpc_object_t *valueOut)
{
if (!strcmp(key, "markAppsAsDebugged")) {
*valueOut = xpc_bool_create(jbsetting(markAppsAsDebugged));
return 0;
}
return -1;
}

static int platform_jbsettings_set(const char *key, xpc_object_t value)
{
if (!strcmp(key, "markAppsAsDebugged") && xpc_get_type(value) == XPC_TYPE_BOOL) {
gSystemInfo.jailbreakSettings.markAppsAsDebugged = xpc_bool_get_value(value);
return 0;
}
return -1;
}

struct jbserver_domain gPlatformDomain = {
.permissionHandler = platform_domain_allowed,
.actions = {
Expand All @@ -48,6 +66,22 @@ struct jbserver_domain gPlatformDomain = {
{ 0 },
},
},
// JBS_PLATFORM_JBSETTINGS_GET
{
.handler = platform_jbsettings_get,
.args = (jbserver_arg[]){
{ .name = "key", .type = JBS_TYPE_STRING, .out = false },
{ .name = "value", .type = JBS_TYPE_XPC_GENERIC, .out = true },
},
},
// JBS_PLATFORM_JBSETTINGS_SET
{
.handler = platform_jbsettings_set,
.args = (jbserver_arg[]){
{ .name = "key", .type = JBS_TYPE_STRING, .out = false },
{ .name = "value", .type = JBS_TYPE_XPC_GENERIC, .out = false },
},
},
{ 0 },
},
};
Loading

0 comments on commit 1d6da8f

Please sign in to comment.