-
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CydiaSubstrate crash for real now; Add basic settings screen
Apparently, MSGetImageByName didn't take symlink resolution into account, causing it to return null, leading MSFindSymbol to call _dyld_get_all_image_infos which was hidden
- Loading branch information
1 parent
6d30758
commit 93ad7cd
Showing
17 changed files
with
199 additions
and
124 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#import <UIKit/UIKit.h> | ||
#import <Preferences/PSListController.h> | ||
#import <Preferences/PSSpecifier.h> | ||
|
||
@interface LCSettingsListController : PSListController | ||
@end |
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,51 @@ | ||
#import "LCSettingsListController.h" | ||
#import "LCUtils.h" | ||
#import "UIViewController+LCAlert.h" | ||
|
||
@implementation LCSettingsListController | ||
|
||
- (NSMutableArray*)specifiers { | ||
if(!_specifiers) { | ||
_specifiers = [NSMutableArray new]; | ||
PSSpecifier* jitlessGroup = [PSSpecifier emptyGroupSpecifier]; | ||
jitlessGroup.name = @"JIT-less"; | ||
[jitlessGroup setProperty:@"JIT-less allows you to use LiveContainer without having to enable JIT. Requires SideStore." forKey:@"footerText"]; | ||
[_specifiers addObject:jitlessGroup]; | ||
|
||
NSString *setupJITLessButtonName = LCUtils.certificateData ? @"JIT-less is set up" : @"Setup JIT-less"; | ||
PSSpecifier* setupJITLessButton = [PSSpecifier preferenceSpecifierNamed:setupJITLessButtonName target:self set:nil get:nil detail:nil cell:PSButtonCell edit:nil]; | ||
setupJITLessButton.identifier = @"setup-jitless"; | ||
[setupJITLessButton setProperty:@(!LCUtils.certificateData) forKey:@"enabled"]; | ||
setupJITLessButton.buttonAction = @selector(setupJITLessPressed); | ||
[_specifiers addObject:setupJITLessButton]; | ||
|
||
PSSpecifier* signTweaksButton = [PSSpecifier preferenceSpecifierNamed:@"Sign tweaks" target:self set:nil get:nil detail:nil cell:PSButtonCell edit:nil]; | ||
signTweaksButton.identifier = @"sign-tweaks"; | ||
[signTweaksButton setProperty:@(!!LCUtils.certificateData) forKey:@"enabled"]; | ||
signTweaksButton.buttonAction = @selector(signTweaksPressed); | ||
[_specifiers addObject:signTweaksButton]; | ||
} | ||
return _specifiers; | ||
} | ||
|
||
- (void)setupJITLessPressed { | ||
if (!LCUtils.isAppGroupSideStore) { | ||
[self showDialogTitle:@"Error" message:@"Unsupported installation method. Please use SideStore to setup this feature."]; | ||
return; | ||
} | ||
|
||
NSError *error; | ||
NSURL *url = [LCUtils archiveIPAWithSetupMode:YES error:&error]; | ||
if (!url) { | ||
[self showDialogTitle:@"Error" message:error.localizedDescription]; | ||
return; | ||
} | ||
|
||
[UIApplication.sharedApplication openURL:[NSURL URLWithString:[NSString stringWithFormat:@"sidestore://install?url=%@", url]] options:@{} completionHandler:nil]; | ||
} | ||
|
||
- (void)signTweaksPressed { | ||
|
||
} | ||
|
||
@end |
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,4 @@ | ||
#import <UIKit/UIKit.h> | ||
|
||
@interface LCTabBarController : UITabBarController | ||
@end |
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,25 @@ | ||
#import "LCRootViewController.h" | ||
#import "LCSettingsListController.h" | ||
#import "LCTabBarController.h" | ||
|
||
@implementation LCTabBarController | ||
|
||
- (void)loadView { | ||
[super loadView]; | ||
|
||
LCRootViewController* appTableVC = [LCRootViewController new]; | ||
appTableVC.title = @"Apps"; | ||
|
||
LCSettingsListController* settingsListVC = [LCSettingsListController new]; | ||
settingsListVC.title = @"Settings"; | ||
|
||
UINavigationController* appNavigationController = [[UINavigationController alloc] initWithRootViewController:appTableVC]; | ||
UINavigationController* settingsNavigationController = [[UINavigationController alloc] initWithRootViewController:settingsListVC]; | ||
|
||
appNavigationController.tabBarItem.image = [UIImage systemImageNamed:@"square.stack.3d.up.fill"]; | ||
settingsNavigationController.tabBarItem.image = [UIImage systemImageNamed:@"gear"]; | ||
|
||
self.viewControllers = @[appNavigationController, settingsNavigationController]; | ||
} | ||
|
||
@end |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#import <Foundation/Foundation.h> | ||
|
||
@implementation NSBundle(FixCydiaSubstrate) | ||
|
||
- (NSString *)bundlePath { | ||
NSString *path = self.bundleURL.path; | ||
if ([path hasPrefix:@"/private"]) { | ||
return path; | ||
} | ||
return [@"/private" stringByAppendingPathComponent:path]; | ||
} | ||
|
||
@end |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#import <UIKit/UIKit.h> | ||
|
||
@interface UIViewController(LCAlert) | ||
|
||
- (void)showDialogTitle:(NSString *)title message:(NSString *)message; | ||
- (void)showDialogTitle:(NSString *)title message:(NSString *)message handler:(void(^)(UIAlertAction *))handler; | ||
- (void)showInputDialogTitle:(NSString *)title message:(NSString *)message placeholder:(NSString *)placeholder callback:(NSString *(^)(NSString *inputText))callback; | ||
|
||
@end |
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,48 @@ | ||
#import "UIViewController+LCAlert.h" | ||
|
||
@implementation UIViewController(LCAlert) | ||
|
||
- (void)showDialogTitle:(NSString *)title message:(NSString *)message { | ||
[self showDialogTitle:title message:message handler:nil]; | ||
} | ||
|
||
- (void)showDialogTitle:(NSString *)title message:(NSString *)message handler:(void(^)(UIAlertAction *))handler { | ||
UIAlertController* alert = [UIAlertController alertControllerWithTitle:title | ||
message:message | ||
preferredStyle:UIAlertControllerStyleAlert]; | ||
UIAlertAction* okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:handler]; | ||
[alert addAction:okAction]; | ||
UIAlertAction* copyAction = [UIAlertAction actionWithTitle:@"Copy" style:UIAlertActionStyleDefault | ||
handler:^(UIAlertAction * action) { | ||
UIPasteboard.generalPasteboard.string = message; | ||
if (handler) handler(action); | ||
}]; | ||
[alert addAction:copyAction]; | ||
[self presentViewController:alert animated:YES completion:nil]; | ||
} | ||
|
||
- (void)showInputDialogTitle:(NSString *)title message:(NSString *)message placeholder:(NSString *)placeholder callback:(NSString *(^)(NSString *inputText))callback { | ||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert]; | ||
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) { | ||
textField.placeholder = placeholder; | ||
textField.clearButtonMode = UITextFieldViewModeWhileEditing; | ||
textField.borderStyle = UITextBorderStyleRoundedRect; | ||
}]; | ||
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { | ||
UITextField *textField = alert.textFields[0]; | ||
NSString *error = callback(textField.text.length == 0 ? placeholder : textField.text); | ||
if (error) { | ||
alert.message = error; | ||
} else { | ||
[self dismissViewControllerAnimated:YES completion:nil]; | ||
} | ||
}]; | ||
okAction.shouldDismissHandler = ^{ | ||
return NO; | ||
}; | ||
[alert addAction:okAction]; | ||
[alert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]]; | ||
[self presentViewController:alert animated:YES completion:nil]; | ||
} | ||
|
||
@end |
Oops, something went wrong.