Skip to content

Commit

Permalink
apparently unc0ver doesn't clean up as well as I thought it did... *s…
Browse files Browse the repository at this point in the history
…igh*
  • Loading branch information
Samgisaninja committed May 11, 2020
1 parent c3c5c70 commit 0ab9f9a
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 7 deletions.
4 changes: 2 additions & 2 deletions SuccessionRestore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@
"$(inherited)",
"$(PROJECT_DIR)/SuccessionRestore",
);
MARKETING_VERSION = "1.4.13~b3";
MARKETING_VERSION = 1.4.14;
PRODUCT_BUNDLE_IDENTIFIER = com.samgisaninja.SuccessionRestore;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -649,7 +649,7 @@
"$(inherited)",
"$(PROJECT_DIR)/SuccessionRestore",
);
MARKETING_VERSION = "1.4.13~b3";
MARKETING_VERSION = 1.4.14;
PRODUCT_BUNDLE_IDENTIFIER = com.samgisaninja.SuccessionRestore;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
Binary file not shown.
46 changes: 42 additions & 4 deletions SuccessionRestore/HomePageViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <CoreFoundation/CoreFoundation.h>
#include <spawn.h>
#include <sys/stat.h>
#import <CommonCrypto/CommonDigest.h>

@interface HomePageViewController ()

Expand Down Expand Up @@ -60,10 +61,8 @@ - (void)viewDidLoad {
}
// Don't run on unc0ver 4.0-4.2.X because of restore hang
if ([[NSFileManager defaultManager] fileExistsAtPath:@"/usr/libexec/pwnproxy"]) {
UIAlertController *pwnproxyError = [UIAlertController alertControllerWithTitle:@"Succession is disabled" message:@"Succession is not compatible with unc0ver 4.0-4.2.1" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *exitAction = [UIAlertAction actionWithTitle:@"Exit" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
exit(0);
}];
UIAlertController *pwnproxyError = [UIAlertController alertControllerWithTitle:@"Warning" message:@"Succession is not compatible with unc0ver 4.0-4.2.1. Please make sure that you are running unc0ver 4.3 or higher." preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *exitAction = [UIAlertAction actionWithTitle:@"Exit" style:UIAlertActionStyleDestructive handler:nil];
[pwnproxyError addAction:exitAction];
[self presentViewController:pwnproxyError animated:TRUE completion:nil];
}
Expand Down Expand Up @@ -342,5 +341,44 @@ - (void) URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTa
}
}

int sha1_to_str(const unsigned char *hash, size_t hashlen, char *buf, size_t buflen)
{
if (buflen < (hashlen*2+1)) {
return -1;
}

int i;
for (i=0; i<hashlen; i++) {
sprintf(buf+i*2, "%02X", hash[i]);
}
buf[i*2] = 0;
return 0;
}

NSString *sha1sum(NSString *file)
{
uint8_t buffer[0x1000];
unsigned char md[CC_SHA1_DIGEST_LENGTH];
if (![[NSFileManager defaultManager] fileExistsAtPath:file])
return nil;

NSInputStream *fileStream = [NSInputStream inputStreamWithFileAtPath:file];
[fileStream open];

CC_SHA1_CTX c;
CC_SHA1_Init(&c);
while ([fileStream hasBytesAvailable]) {
NSInteger read = [fileStream read:buffer maxLength:0x1000];
CC_SHA1_Update(&c, buffer, (CC_LONG)read);
}

CC_SHA1_Final(md, &c);

char checksum[CC_SHA1_DIGEST_LENGTH * 2 + 1];
if (sha1_to_str(md, CC_SHA1_DIGEST_LENGTH, checksum, sizeof(checksum)) != 0)
return nil;
return @(checksum);
}

@end

2 changes: 1 addition & 1 deletion Template/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: com.samgisaninja.successionrestore
Name: Succession
Version: 1.4.13
Version: 1.4.14
Architecture: iphoneos-arm
Description: Restore without updating via rootfilesystem DMG
Maintainer: Samg_is_a_Ninja
Expand Down

0 comments on commit 0ab9f9a

Please sign in to comment.