-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issues with Electra Jailbreak and older jailbreaks where the ap…
…plication needs root access to write to the USB ports.
- Loading branch information
Showing
8 changed files
with
119 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
// | ||
|
||
#import "NXLauncher.h" | ||
#import "main.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>platform-application</key> | ||
<true/> | ||
<key>com.apple.private.skip-library-validation</key> | ||
<true/> | ||
<key>com.apple.private.security.no-container</key> | ||
<true/> | ||
<key>application-identifier</key> | ||
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// main.h | ||
// iOSNXLauncher | ||
// | ||
// Created by Brandon on 2018-07-10. | ||
// Copyright © 2018 XIO. All rights reserved. | ||
// | ||
|
||
#ifndef main_h | ||
#define main_h | ||
|
||
void patch_setuidandplatformize(); | ||
|
||
#endif /* main_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// | ||
// main.cpp | ||
// iOSNXLauncher | ||
// | ||
// Created by Brandon on 2018-07-10. | ||
// Copyright © 2018 XIO. All rights reserved. | ||
// | ||
|
||
#include "main.h" | ||
#include <stdio.h> | ||
#include <dlfcn.h> | ||
#include <unistd.h> | ||
|
||
#import <UIKit/UIKit.h> | ||
#import <iOSNXLauncher-Swift.h> | ||
|
||
void patch_setuid() { | ||
void* handle = dlopen("/usr/lib/libjailbreak.dylib", RTLD_LAZY); | ||
if (!handle) | ||
return; | ||
|
||
// Reset errors | ||
dlerror(); | ||
typedef void (*fix_setuid_prt_t)(pid_t pid); | ||
fix_setuid_prt_t ptr = (fix_setuid_prt_t)dlsym(handle, "jb_oneshot_fix_setuid_now"); | ||
|
||
const char *dlsym_error = dlerror(); | ||
if (dlsym_error) | ||
return; | ||
|
||
ptr(getpid()); | ||
} | ||
|
||
void platformize_me() { | ||
#define FLAG_PLATFORMIZE (1 << 1) | ||
|
||
void* handle = dlopen("/usr/lib/libjailbreak.dylib", RTLD_LAZY); | ||
if (!handle) return; | ||
|
||
// Reset errors | ||
dlerror(); | ||
typedef void (*fix_entitle_prt_t)(pid_t pid, uint32_t what); | ||
fix_entitle_prt_t ptr = (fix_entitle_prt_t)dlsym(handle, "jb_oneshot_entitle_now"); | ||
|
||
const char *dlsym_error = dlerror(); | ||
if (dlsym_error) return; | ||
|
||
ptr(getpid(), FLAG_PLATFORMIZE); | ||
} | ||
|
||
int main(int argc, char* argv[]) { | ||
@autoreleasepool { | ||
platformize_me(); | ||
patch_setuid(); | ||
setuid(0); | ||
setgid(0); | ||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); | ||
} | ||
} |