Skip to content

Commit

Permalink
Undone changes for xenhtml update
Browse files Browse the repository at this point in the history
  • Loading branch information
Micah Gomez committed Feb 26, 2020
1 parent 0916512 commit c51f4c2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
Binary file not shown.
5 changes: 4 additions & 1 deletion FlashBack/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ @implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
setuid(0);
setgid(0);

// Override point for customization after application launch.
[application _setBackgroundStyle:UIBackgroundStyleExtraDarkBlur];

UIColor *barBackground = [UIColor colorWithWhite:0 alpha:0.3];
Expand Down
6 changes: 3 additions & 3 deletions FlashBack/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ - (IBAction)restoreBackup:(id)sender {
[killPrefsTask setLaunchPath:@"/bin/bash"];
[killPrefsTask setArguments:@[ @"killall", @"cfprefsd"]];
[killPrefsTask launch];
[killPrefsTask waitUntilExit];*/
[killPrefsTask waitUntilExit];
NSLog(@"time to respring");
NSTask *respringTask = [[NSTask alloc] init];
[respringTask setLaunchPath:@"/bin/bash"];
[respringTask setLaunchPath:@"/bin/"];
[respringTask setArguments:@[ @"killall", @"backboardd"]];
[respringTask launch];
[respringTask waitUntilExit];
[respringTask waitUntilExit];*/


[restoreBackupAlert dismissViewControllerAnimated:YES completion:nil];
Expand Down
28 changes: 14 additions & 14 deletions FlashBack/main.m
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
//
// main.m
// FlashBack
//
// Created by Micah Gomez on 3/27/19.
// Copyright © 2019 Micah Gomez. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <dlfcn.h>
#import <sys/stat.h>
#import <unistd.h>
#import "AppDelegate.h"
#include <dlfcn.h>

#define FLAG_PLATFORMIZE (1 << 1)

// Special thanks to PsychoTea (@IBSparkles) for getting root on kernel patch jailbreaks, as well as for both Electra's and Meridian's "kppless" jailbreakd daemon.

void platformize_me() {
void* handle = dlopen("/usr/lib/libjailbreak.dylib", RTLD_LAZY);
if (!handle) return;
Expand Down Expand Up @@ -46,13 +41,18 @@ void patch_setuid() {

int main(int argc, char * argv[]) {
@autoreleasepool {
if ([[NSFileManager defaultManager] fileExistsAtPath:@"/usr/lib/libjailbreak.dylib"]){
setuid(0);

if (getuid() != 0) {
//Gets setuid on Electra
patch_setuid();
platformize_me();
setuid(0); // electra requires you to call setuid again
}
//Gets setuid on Meridian
if (getuid() != 0) {
patch_setuid();
}

setuid(0);
setgid(0);
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

0 comments on commit c51f4c2

Please sign in to comment.