Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Apex and Amethyst, change userspace reboot support method #2087

Open
wants to merge 1 commit into
base: v1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,24 @@ - (NSArray *)utilitySources {
@"url" : @"https://ellekit.space/",
@"icon": @"https://ellekit.space/CydiaIcon.png"}];
break;

case ZBJailbreakAmethyst:
[result addObject:@{@"type": @"utility",
@"name": @"Procursus",
@"url" : @"https://apt.procurs.us/",
@"icon": @"https://apt.procurs.us/CydiaIcon.png"}];
break;

case ZBJailbreakApex:
[result addObject:@{@"type": @"utility",
@"name": @"Procursus",
@"url" : @"https://apt.procurs.us/",
@"icon": @"https://apt.procurs.us/CydiaIcon.png"}];
[result addObject:@{@"type": @"utility",
@"name": @"Odyssey Repo",
@"url" : @"https://repo.theodyssey.dev/",
@"icon": @"https://repo.theodyssey.dev/CydiaIcon.png"}];
break;


default:
Expand Down
5 changes: 4 additions & 1 deletion Zebra/ZBDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ typedef NS_ENUM(NSUInteger, ZBJailbreak) {
ZBJailbreakMineekJB64,
ZBJailbreakMineekJB,
ZBJailbreakBakera1n,
ZBJailbreakP0insettia
ZBJailbreakP0insettia,
ZBJailbreakAmethyst,
ZBJailbreakApex
};

typedef NS_ENUM(NSUInteger, ZBBootstrap) {
Expand Down Expand Up @@ -75,6 +77,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSString *)debianArchitecture;
+ (nullable NSString *)packageManagementBinary;
+ (NSString *)path;
+ (BOOL)supportsUserspaceReboot;

+ (void)hapticButton;

Expand Down
25 changes: 24 additions & 1 deletion Zebra/ZBDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@ + (BOOL)needsSimulation {
#endif
}

+ (BOOL)supportsUserspaceReboot {
// all detectable iOS 14+ jailbreaks support userspace reboots
if (@available(iOS 14, *)) {
if (self.jailbreak != ZBJailbreakUnknown && self.jailbreak != ZBJailbreakSimulated) {
return YES;
}
}

switch (self.jailbreak) {
case ZBJailbreakCheckra1n:
case ZBJailbreakChimera:
case ZBJailbreakOdyssey:
case ZBJailbreakAmethyst: return YES;
default: break;
}
return NO;
}

+ (BOOL)isSlingshotBroken:(NSError *_Nullable*_Nullable)error {
#if TARGET_OS_SIMULATOR
return NO; //Since simulated devices don't have su/sling, it isn't broken!
Expand Down Expand Up @@ -247,7 +265,7 @@ + (void)restartSpringBoard {

+ (void)restartDevice {
if (![self needsSimulation]) {
if (@available(iOS 15, *)) {
if ([self supportsUserspaceReboot]) {
// Try userspace reboot
NSLog(@"[Zebra] Trying userspace reboot");
if ([ZBCommand execute:@"launchctl" withArguments:@[@"reboot", @"userspace"] asRoot:YES]) {
Expand Down Expand Up @@ -345,7 +363,10 @@ + (ZBJailbreak)_jailbreak {
@"/.installed_g0blin": @(ZBJailbreakG0blin),
@"/.installed_p0insettia": @(ZBJailbreakP0insettia),
@"/cores/binpack/.installed_overlay": @(ZBJailbreakBakera1n),
@"/.installed_amethyst": @(ZBJailbreakAmethyst),
@"/.installed_apex": @(ZBJailbreakApex)
};

NSDictionary <NSString *, NSNumber *> *jailbreakInstalledDirs = @{
@"/binpack": @(ZBJailbreakCheckra1n),
@"/electra": @(ZBJailbreakElectra),
Expand Down Expand Up @@ -439,6 +460,8 @@ + (NSString *)jailbreakName {
case ZBJailbreakMineekJB: return @"mineekJB";
case ZBJailbreakBakera1n: return @"bakera1n";
case ZBJailbreakP0insettia: return @"p0insettia";
case ZBJailbreakAmethyst: return @"Amethyst";
case ZBJailbreakApex: return @"Apex";
}
}

Expand Down
Loading