Skip to content

Commit

Permalink
Collection of small bug fixes (#2041)
Browse files Browse the repository at this point in the history
* [App] Fixes crash when removing a filter

IndexPath was off due to the new 'Show Incompatible Packages' option

* [App] Change community sources for palera1n based on jailbreak type

* [App] Fixes jailbreak detection names for some

* [App] Fixes userspace reboot args

* [App] dist/iphoneos-arm64-rootless/1900 -> dist/1900 for iOS 16
  • Loading branch information
staturnzz authored Jun 2, 2023
1 parent c3ca577 commit 5649e8c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,25 @@ - (NSArray *)utilitySources {
break;

case ZBJailbreakPalera1n:
[result addObject:@{@"type": @"utility",
@"name": @"Procursus",
@"url" : @"https://apt.procurs.us/",
@"icon": @"https://apt.procurs.us/CydiaIcon.png"}];
if ([ZBDevice isPrefixed]) {
[result addObject:@{@"type": @"utility",
@"name": @"Procursus",
@"url" : @"https://apt.procurs.us/",
@"icon": @"https://apt.procurs.us/CydiaIcon.png"}];
[result addObject:@{@"type": @"utility",
@"name": @"ElleKit",
@"url" : @"https://ellekit.space/",
@"icon": @"https://ellekit.space/CydiaIcon.png"}];
} else {
[result addObject:@{@"type": @"utility",
@"name": @"palera1n strap",
@"url" : @"https://strap.palera.in/",
@"icon": @"https://strap.palera.in/CydiaIcon.png"}];
}
[result addObject:@{@"type": @"utility",
@"name": @"palera1n",
@"url" : @"https://repo.palera.in/",
@"icon": @"https://repo.palera.in/CydiaIcon.png"}];
[result addObject:@{@"type": @"utility",
@"name": @"ElleKit",
@"url" : @"https://ellekit.space/",
@"icon": @"https://ellekit.space/CydiaIcon.png"}];
break;

case ZBJailbreakDopamine:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,15 +344,15 @@ - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)
case 3: {
UITableViewRowAction *deleteFilterAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:NSLocalizedString(@"Delete", @"") handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
switch (indexPath.section) {
case 0: {
case 1: {
NSString *section = self->filteredSections[indexPath.row];
[self->filteredSections removeObject:section];

[ZBSettings setFilteredSections:self->filteredSections];
[tableView reloadSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationAutomatic];
break;
}
case 1: {
case 2: {
ZBSource *source = self->sources[indexPath.row];
[self->filteredSources removeObjectForKey:[source baseFilename]];
[self->sources removeObjectAtIndex:indexPath.row];
Expand All @@ -361,7 +361,7 @@ - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)
[tableView reloadSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationAutomatic];
break;
}
case 2: {
case 3: {
NSString *author = [self->blockedAuthors allKeys][indexPath.row];
[self->blockedAuthors removeObjectForKey:author];

Expand Down
17 changes: 11 additions & 6 deletions Zebra/Tabs/Sources/Helpers/ZBBaseSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ - (id)initFromSourceLine:(NSString *)debLine {
debLine = [debLine stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];

NSMutableArray *lineComponents = [[debLine componentsSeparatedByString:@" "] mutableCopy];
[lineComponents removeObject:@""]; //Remove empty strings from the line which exist for some reason
[lineComponents removeObject:@""]; // Remove empty strings from the line which exist for some reason

NSUInteger count = [lineComponents count];
NSString *archiveType = NULL;
Expand All @@ -172,12 +172,17 @@ - (id)initFromSourceLine:(NSString *)debLine {
repositoryURI = lineComponents[1];

if (([self hasCFVersionComponent:repositoryURI]) && count == 3) { // Sources that are known to use CF number in URL but for some reason aren't written in the sources.list properly
int roundedCF = 100.0 * floor((kCFCoreFoundationVersionNumber/100.0) + 0.5);
if (roundedCF > kCFCoreFoundationVersionNumber) roundedCF -= 100.0;

if ([repositoryURI containsString:@"apt.procurs.us"]) { // Have to treat this differently because its special
int roundedCF = 100.0 * floor((kCFCoreFoundationVersionNumber/100.0)+0.5);
if (roundedCF > kCFCoreFoundationVersionNumber) roundedCF -= 100.0;
NSString *kind = [ZBDevice isPrefixed] ? @"iphoneos-arm64-rootless" : @"iphoneos-arm64";
NSString *dist = roundedCF >= 1900 ? @"" : @"iphoneos-arm64-rootless";
NSString *kind = [ZBDevice isPrefixed] ? dist : @"iphoneos-arm64";
distribution = [NSString stringWithFormat:@"%@/%d", kind, roundedCF];
}
else if ([repositoryURI containsString:@"strap.palera.in"]) {
distribution = [NSString stringWithFormat:@"%@/%d", @"iphoneos-arm64", roundedCF];
}
else {
distribution = [NSString stringWithFormat:@"ios/%.2f", kCFCoreFoundationVersionNumber];
}
Expand All @@ -186,7 +191,7 @@ - (id)initFromSourceLine:(NSString *)debLine {
else if (count > 2) {
distribution = lineComponents[2];

//Group all of the components into the components array
// Group all of the components into the components array
for (int i = 3; i < count; i++) {
NSString *component = lineComponents[i];
if (component) {
Expand Down Expand Up @@ -243,7 +248,7 @@ - (id)initFromURL:(NSURL *)url {

- (BOOL)hasCFVersionComponent:(NSString * _Nullable)repositoryURI_ {
NSString *repositoryURI = repositoryURI_ ?: self.repositoryURI;
return [repositoryURI containsString:@"apt.procurs.us"] || [repositoryURI containsString:@"apt.bingner.com"] || [repositoryURI containsString:@"apt.saurik.com"];
return [repositoryURI containsString:@"apt.procurs.us"] || [repositoryURI containsString:@"apt.bingner.com"] || [repositoryURI containsString:@"apt.saurik.com"] || [repositoryURI containsString:@"strap.palera.in"];
}

- (void)verify:(nullable void (^)(ZBSourceVerificationStatus status))completion {
Expand Down
3 changes: 2 additions & 1 deletion Zebra/ZBDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ typedef NS_ENUM(NSUInteger, ZBJailbreak) {
ZBJailbreakMineekJB32,
ZBJailbreakMineekJB64,
ZBJailbreakMineekJB,
ZBJailbreakBakera1n
ZBJailbreakBakera1n,
ZBJailbreakP0insettia
};

typedef NS_ENUM(NSUInteger, ZBBootstrap) {
Expand Down
10 changes: 6 additions & 4 deletions Zebra/ZBDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ + (void)restartDevice {
if (@available(iOS 15, *)) {
// Try userspace reboot
NSLog(@"[Zebra] Trying userspace reboot");
if ([ZBCommand execute:@"launchctl" withArguments:@[@"userspace", @"reboot"] asRoot:YES]) {
if ([ZBCommand execute:@"launchctl" withArguments:@[@"reboot", @"userspace"] asRoot:YES]) {
return;
}
} else if (@available(iOS 11, *)) {
Expand Down Expand Up @@ -343,7 +343,8 @@ + (ZBJailbreak)_jailbreak {
@"/.meridian_installed": @(ZBJailbreakMeridian),
@"/.installed_yaluX": @(ZBJailbreakYalu),
@"/.installed_g0blin": @(ZBJailbreakG0blin),
@"/cores/binpack/.installed_overlay": @(ZBJailbreakBakera1n)
@"/.installed_p0insettia": @(ZBJailbreakP0insettia),
@"/cores/binpack/.installed_overlay": @(ZBJailbreakBakera1n),
};
NSDictionary <NSString *, NSNumber *> *jailbreakInstalledDirs = @{
@"/binpack": @(ZBJailbreakCheckra1n),
Expand Down Expand Up @@ -422,21 +423,22 @@ + (NSString *)jailbreakName {
case ZBJailbreakDopamine: return @"Dopamine";
case ZBJailbreakSocket: return @"socket";
case ZBJailbreakH3lix: return @"h3lix";
case ZBJailbreakBlizzard9: return @"Blizzard";
case ZBJailbreakBlizzard9: return @"Blizzard9";
case ZBJailbreakOpenpwnage: return @"Openpwnage";
case ZBJailbreakHomeDepot: return @"Home Depot";
case ZBJailbreakKok3shi: return @"kok3shi";
case ZBJailbreakP0laris: return @"p0laris";
case ZBJailbreakDoubleH3lix: return @"doubleH3lix";
case ZBJailbreakMeridian: return @"Meridian";
case ZBJailbreakYalu: return @"yalu";
case ZBJailbreakSaigon: return @"palera1n";
case ZBJailbreakSaigon: return @"Saïgon";
case ZBJailbreakG0blin: return @"g0blin";
case ZBJailbreakKok3shiX: return @"kok3shiX";
case ZBJailbreakMineekJB32: return @"mineekJB (32-bit)";
case ZBJailbreakMineekJB64: return @"mineekJB (64-bit)";
case ZBJailbreakMineekJB: return @"mineekJB";
case ZBJailbreakBakera1n: return @"bakera1n";
case ZBJailbreakP0insettia: return @"p0insettia";
}
}

Expand Down

0 comments on commit 5649e8c

Please sign in to comment.