Skip to content

Commit

Permalink
Actually call protection_init during jailbreak
Browse files Browse the repository at this point in the history
  • Loading branch information
opa334 committed Apr 29, 2024
1 parent c1290b8 commit 8a85235
Show file tree
Hide file tree
Showing 27 changed files with 45 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Application/Dopamine/Jailbreak/DOJailbreaker.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ typedef NS_ENUM(NSInteger, JBErrorCode) {
JBErrorCodeFailedPlatformize = -9,
JBErrorCodeFailedBasebinTrustcache = -10,
JBErrorCodeFailedLaunchdInjection = -11,
JBErrorCodeFailedInitFakeLib = -12,
JBErrorCodeFailedDuplicateApps = -13,
JBErrorCodeFailedInitProtection = -12,
JBErrorCodeFailedInitFakeLib = -13,
JBErrorCodeFailedDuplicateApps = -14,
};

@implementation DOJailbreaker
Expand Down Expand Up @@ -365,6 +366,15 @@ - (NSError *)injectLaunchdHook
return nil;
}

- (NSError *)applyProtection
{
int r = exec_cmd(JBRootPath("/basebin/jbctl"), "internal", "protection_init", NULL);
if (r != 0) {
return [NSError errorWithDomain:JBErrorDomain code:JBErrorCodeFailedInitProtection userInfo:@{NSLocalizedDescriptionKey : [NSString stringWithFormat:@"Failed initializing protection with error: %d", r]}];
}
return nil;
}

- (NSError *)createFakeLib
{
int r = exec_cmd(JBRootPath("/basebin/jbctl"), "internal", "fakelib_init", NULL);
Expand Down Expand Up @@ -526,6 +536,13 @@ - (void)runWithError:(NSError **)errOut didRemoveJailbreak:(BOOL*)didRemove show
*errOut = [self injectLaunchdHook];
if (*errOut) return;

// Now that we can, protect important system files by bind mounting on top of them
// This will be always be done during the userspace reboot
// We also do it now though in case there is a failure between the now step and the userspace reboot
[[DOUIManager sharedInstance] sendLog:DOLocalizedString(@"Initializing Protection") debug:NO];
*errOut = [self applyProtection];
if (*errOut) return;

[[DOUIManager sharedInstance] sendLog:DOLocalizedString(@"Applying Bind Mount") debug:NO];
*errOut = [self createFakeLib];
if (*errOut) return;
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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "تحسين بيئة الجيلبريك";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "تحميل BaseBin TrustCache";
"Applying Bind Mount" = "تطبيق Bind Mount";
"Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Initialiserer miljø";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Initialisiere Umgebung";
"Initializing Protection" = "Initialisiere Schutz";
"Loading BaseBin TrustCache" = "Lade BaseBin TrustCache";
"Applying Bind Mount" = "Wende Bind Mount an";
"Removing Jailbreak" = "Entferne Jailbreak";
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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Αρχικοποίηση Περιβάλλοντος";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Initializing Jailbreak Environment";
"Initializing Protection" = "Initializing Protection";
"Loading BaseBin TrustCache" = "Loading BaseBin TrustCache";
"Applying Bind Mount" = "Applying Bind Mount";
"Removing Jailbreak" = "Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Inicializando entorno de Jailbreak";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "Cargando BaseBin TrustCache";
"Applying Bind Mount" = "Aplicando montaje por vínculo";
"Removing Jailbreak" = "Eliminando 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Sinisimulan ang Jailbreak Environment";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "Nilo-load ang BaseBin TrustCache";
"Applying Bind Mount" = "Paglalapat ng Bind Mount";
"Removing Jailbreak" = "Tinatatanggal 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Initialisation de l'environnement";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "Chargement des signatures";
"Applying Bind Mount" = "Montage du disque virtuel";
"Removing Jailbreak" = "Suppression du 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Inizializzando l'ambiente";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Initializing Jailbreak Environment";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "Loading BaseBin TrustCache";
"Applying Bind Mount" = "Applying Bind Mount";
"Removing Jailbreak" = "Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Ортаны инициализациялау";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "환경 초기화 중";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "배이스 바이너리 신뢰 캐시 불러오기";
"Applying Bind Mount" = "바인드 마운트 적용";
"Removing Jailbreak" = "탈옥 제거";
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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Omgeving aan het initialiseren";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing Jailbreak*/
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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Inicjowanie Środowiska";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Iniciando o Ambiente do Jailbreak";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Инициализация переменной среды";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "Загружаем BaseBin TrustCache";
/*Applying Bind Mount*/
"Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Initiera miljö";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Initializing Jailbreak Environment";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "Loading BaseBin TrustCache";
"Applying Bind Mount" = "Applying Bind Mount";
"Removing Jailbreak" = "Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Ortam Başlatılıyor";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing Jailbreak*/
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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Ініціалізація середовища";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Initializing Environment";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "Khởi tạo môi trường Jailbreak";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "Đang tải TrustCache BaseBin";
"Applying Bind Mount" = "Đang gắn Bind Mount";
"Removing Jailbreak" = "Đang gỡ bỏ 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "初始化环境";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "将基础套件加载至信任缓存(TrustCache)";
"Applying Bind Mount" = "应用绑定挂载";
"Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "初始化環境";
/*Initializing Protection*/
/*Loading BaseBin TrustCache*/
/*Applying Bind Mount*/
/*Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "初始化环境";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "将基础套件加载至信任缓存(TrustCache)";
"Applying Bind Mount" = "应用绑定挂载";
"Removing 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 @@ -91,6 +91,7 @@

// Logs
"Initializing Environment" = "正在初始化環境";
/*Initializing Protection*/
"Loading BaseBin TrustCache" = "正在載入 BaseBin TrustCache";
"Applying Bind Mount" = "正在套用 Bind Mount";
"Removing Jailbreak" = "正在移除越獄";
Expand Down

0 comments on commit 8a85235

Please sign in to comment.