|
@@ -67,11 +67,56 @@ int bypassKPP() {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+void tvosRepairs(ViewController *view) {
|
|
|
+
|
|
|
+
|
|
|
+ [view writeTextPlain:@"Performing bootstrap tweaks..."];
|
|
|
+ NSString *ti = @"/usr/lib/TweakInject";
|
|
|
+ NSString *dl = @"/Library/MobileSubstrate/DynamicLibraries";
|
|
|
+ NSString *bash = @"/bin/bash";
|
|
|
+ NSString *usrBash = @"/usr/bin/bash";
|
|
|
+ NSFileManager *man = [NSFileManager defaultManager];
|
|
|
+ NSError *error = nil;
|
|
|
+ //NSString *dlFileType = [man attributesOfItemAtPath:dl error:&error][NSFileType];
|
|
|
+ //NSString *tiFileType = [man attributesOfItemAtPath:ti error:&error][NSFileType];
|
|
|
+ BOOL tiExists = [man fileExistsAtPath:ti];
|
|
|
+ BOOL msExists = [man fileExistsAtPath:dl];
|
|
|
+ BOOL bashExists = [man fileExistsAtPath:bash];
|
|
|
+ //BOOL msSymbolic = [dlFileType isEqualToString:NSFileTypeSymbolicLink];
|
|
|
+
|
|
|
+ if (!tiExists & msExists) {
|
|
|
+
|
|
|
+ [view writeTextPlain:@"Moving %@ to %@...", dl, ti];
|
|
|
+ [man moveItemAtPath:dl toPath:ti error:&error];
|
|
|
+ execprog("/usr/bin/ln", (const char **)&(const char*[]) {
|
|
|
+ "/usr/bin/ln",
|
|
|
+ "-s",
|
|
|
+ [ti UTF8String],
|
|
|
+ [dl UTF8String],
|
|
|
+ NULL
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!bashExists){
|
|
|
+
|
|
|
+ [view writeTextPlain:@"Fixing missing bash.."];
|
|
|
+ [man copyItemAtPath:usrBash toPath:bash error:&error];
|
|
|
+ execprog("/usr/bin/ln", (const char **)&(const char*[]) {
|
|
|
+ "/usr/bin/ln",
|
|
|
+ "-s",
|
|
|
+ [bash UTF8String],
|
|
|
+ "/bin/sh",
|
|
|
+ NULL
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
int makeShitHappen(ViewController *view, BOOL kppless) {
|
|
|
int ret;
|
|
|
|
|
|
- isKppless = kppless;
|
|
|
+ isKppless = FALSE;
|
|
|
fileMgr = [NSFileManager defaultManager];
|
|
|
|
|
|
// run v0rtex
|
|
@@ -156,6 +201,7 @@ int makeShitHappen(ViewController *view, BOOL kppless) {
|
|
|
unlink("/Library/LaunchDaemons/._dropbear.plist");
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
|
|
|
|
|
|
if (file_exists("/meridian/.bootstrap") == 0) {
|
|
@@ -163,7 +209,7 @@ int makeShitHappen(ViewController *view, BOOL kppless) {
|
|
|
unlink("/meridian/.bootstrap");
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+ */
|
|
|
/*
|
|
|
|
|
|
//take these out later, just so i can update the plists as i tweak the payload
|
|
@@ -336,7 +382,7 @@ int makeShitHappen(ViewController *view, BOOL kppless) {
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ tvosRepairs(view);
|
|
|
|
|
|
[view writeText:@"done!"];
|
|
|
}
|
|
@@ -344,6 +390,9 @@ int makeShitHappen(ViewController *view, BOOL kppless) {
|
|
|
//unlink("/usr/lib/libjailbreak.dylib");
|
|
|
//cp("/usr/lib/libjailbreak.dylib","/electra/libjailbreak.dylib");
|
|
|
|
|
|
+ //check to make sure /usr/lib/TweakInject exists and /Library/MobileSubstrate/DynamicLibraries is a symbolic link there
|
|
|
+
|
|
|
+
|
|
|
/*
|
|
|
// add the midnight repo
|
|
|
if (file_exists("/etc/apt/sources.list.d/meridian.list") != 0) {
|
|
@@ -375,7 +424,7 @@ int makeShitHappen(ViewController *view, BOOL kppless) {
|
|
|
[view writeTextPlain:@"exit code: %d", ret];
|
|
|
return 1;
|
|
|
}
|
|
|
- */
|
|
|
+ */
|
|
|
|
|
|
//launch openssh
|
|
|
|
|
@@ -466,6 +515,14 @@ void fixPerms() {
|
|
|
NULL
|
|
|
});
|
|
|
|
|
|
+ rv = execprog("/usr/bin/chown", (const char **)&(const char*[]) {
|
|
|
+ "/usr/bin/chown",
|
|
|
+ "-R",
|
|
|
+ "root:wheel",
|
|
|
+ "/private/etc",
|
|
|
+ NULL
|
|
|
+ });
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -750,7 +807,10 @@ int defecateAmfi() {
|
|
|
}
|
|
|
|
|
|
int launchDropbear() {
|
|
|
- return start_launchdaemon("/Library/LaunchDaemons/dropbear.plist");
|
|
|
+ chmod("/meridian/dropbear/dropbear.plist", 0600);
|
|
|
+ chown("/meridian/dropbear/dropbear.plist", 0, 0);
|
|
|
+ chmod("/etc/dropbear", 0700);
|
|
|
+ return start_launchdaemon("/meridian/dropbear/dropbear.plist");
|
|
|
}
|
|
|
|
|
|
void setUpSubstitute() {
|