Skip to content

Commit

Permalink
Move LCSettingsListController prefs to file and add about
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhduytran0 committed Aug 6, 2024
1 parent 729db4d commit 36b39ea
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 23 deletions.
2 changes: 1 addition & 1 deletion AppInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ - (UIImage*)icon {

- (UIImage *)generateLiveContainerWrappedIcon {
UIImage *icon = self.icon;
if ([NSUserDefaults.standardUserDefaults boolForKey:@"LCDontFrameShortcutIcons"]) {
if (![NSUserDefaults.standardUserDefaults boolForKey:@"LCFrameShortcutIcons"]) {
return icon;
}

Expand Down
38 changes: 17 additions & 21 deletions LCSettingsListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,21 @@

@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.certificatePassword ? @"Renew JIT-less certificate" : @"Setup JIT-less certificate";
PSSpecifier* setupJITLessButton = [PSSpecifier preferenceSpecifierNamed:setupJITLessButtonName target:self set:nil get:nil detail:nil cell:PSButtonCell edit:nil];
setupJITLessButton.identifier = @"setup-jitless";
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.certificatePassword) forKey:@"enabled"];
signTweaksButton.buttonAction = @selector(signTweaksPressed);
[_specifiers addObject:signTweaksButton];
- (NSMutableArray *)specifiers {
if (!_specifiers) {
_specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self bundle:NSBundle.mainBundle];
}

return _specifiers;
}

- (void)loadView {
[super loadView];
NSString *setupJITLessButtonName = LCUtils.certificatePassword ? @"Renew JIT-less certificate" : @"Setup JIT-less certificate";
PSSpecifier *setupJITLessButton = [self specifierForID:@"setup-jitless"];
setupJITLessButton.name = setupJITLessButtonName;
}

- (void)setupJITLessPressed {
if (!LCUtils.isAppGroupSideStore) {
[self showDialogTitle:@"Error" message:@"Unsupported installation method. Please use SideStore to setup this feature."];
Expand All @@ -43,8 +35,12 @@ - (void)setupJITLessPressed {
[UIApplication.sharedApplication openURL:[NSURL URLWithString:[NSString stringWithFormat:@"sidestore://install?url=%@", url]] options:@{} completionHandler:nil];
}

- (void)signTweaksPressed {

- (void)openSourceCode {
[UIApplication.sharedApplication openURL:[NSURL URLWithString:@"https://github.com/khanhduytran0/LiveContainer"] options:@{} completionHandler:nil];
}

- (void)openTwitter {
[UIApplication.sharedApplication openURL:[NSURL URLWithString:@"https://twitter.com/TranKha50277352"] options:@{} completionHandler:nil];
}

@end
2 changes: 1 addition & 1 deletion LCUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ + (BOOL)launchToGuestAppWithURL:(NSURL *)url {
return [NSClassFromString(@"LCSharedUtils") launchToGuestAppWithURL:url];
}

#pragma mark Code sunning
#pragma mark Code signing

+ (void)removeCodeSignatureFromBundleURL:(NSURL *)appURL {
int32_t cpusubtype;
Expand Down
Binary file added Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions Resources/Root.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?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>items</key>
<array>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>footerText</key>
<string>JIT-less allows you to use LiveContainer without having to enable JIT. Requires SideStore.</string>
<key>label</key>
<string>JIT-less</string>
</dict>
<dict>
<key>action</key>
<string>setupJITLessPressed</string>
<key>cell</key>
<string>PSButtonCell</string>
<key>id</key>
<string>setup-jitless</string>
<key>label</key>
<string>Setup JIT-less</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Miscellaneous</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<false/>
<key>defaults</key>
<string>com.kdt.livecontainer</string>
<key>key</key>
<string>LCFrameShortcutIcons</string>
<key>label</key>
<string>Frame shortcut icon</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>About me</string>
</dict>
<dict>
<key>action</key>
<string>openSourceCode</string>
<key>cell</key>
<string>PSButtonCell</string>
<key>icon</key>
<string>GitHub.png</string>
<key>label</key>
<string>khanhduytran0/LiveContainer</string>
</dict>
<dict>
<key>action</key>
<string>openTwitter</string>
<key>cell</key>
<string>PSButtonCell</string>
<key>icon</key>
<string>Twitter.png</string>
<key>label</key>
<string>@TranKha50277352</string>
</dict>
</array>
<key>title</key>
<string>Settings</string>
</dict>
</plist>
Binary file added Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 36b39ea

Please sign in to comment.