Skip to content

Commit

Permalink
Merge pull request #57 from hotsjf/master
Browse files Browse the repository at this point in the history
iOS 8 zip fix.

Fixes #58
  • Loading branch information
NinjaLikesCheez committed Nov 6, 2014
2 parents b8ab835 + bc0db5b commit 684b1b3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
12 changes: 8 additions & 4 deletions Classes/Cracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ -(BOOL) execute

Binary *pluginBinary = [[Binary alloc] initWithBinary:[plugin.pluginPath stringByAppendingString:plugin.pluginExecutableName]];

NSString *tempPluginBinaryPath = [_workingDir stringByAppendingFormat:@"/PlugIns/%@", plugin.pluginExecutableName];
NSString *tempPluginBinaryPath = [_workingDir stringByAppendingFormat:@"/PlugIns/%@/%@", [plugin.pluginPath lastPathComponent] ,plugin.pluginExecutableName];
NSError *error;

printf("dumping: attempting to crack plugin: %s\n", plugin.pluginName.UTF8String);
Expand Down Expand Up @@ -444,7 +444,11 @@ void generateMetadata(NSString *origPath,NSString *output)

NSMutableDictionary *metadataPlist = [NSMutableDictionary dictionaryWithContentsOfFile:origPath];

NSDictionary *censorList = [NSDictionary dictionaryWithObjectsAndKeys:fake_email, @"appleId", fake_purchase_date, @"purchaseDate", @"", @"userName", nil];
NSDictionary *censorList = [NSDictionary dictionaryWithObjectsAndKeys:
fake_email, @"appleId",
fake_purchase_date, @"purchaseDate",
@"", @"userName",
nil];

if ([[Preferences sharedInstance] boolForKey:@"CheckMetadata"])
{
Expand Down Expand Up @@ -486,8 +490,8 @@ void generateMetadata(NSString *origPath,NSString *output)
@"", @"product-type",
@"", @"is-purchased-redownload",
@"", @"asset-info",
@"", @"bundleDisplayName",
nil];
@"", @"bundleDisplayName",
nil];
for (id plistItem in metadataPlist)
{
if (([noCensorList objectForKey:plistItem] == nil) && ([censorList objectForKey:plistItem] == nil))
Expand Down
36 changes: 34 additions & 2 deletions Classes/izip.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,16 @@ - (void) zipOriginal:(NSOperation*) operation
NSString *fullPath;
[theURL getResourceValue:&fullPath forKey:NSURLPathKey error:NULL];

//NSLog(@"++++++++++++++++>%@",fullPath);

NSMutableArray *comp = [NSMutableArray arrayWithArray:[fullPath pathComponents]];

[comp removeObjectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 5)]];
//fix iOS 8 bug
if ([UIDevice currentDevice].systemVersion.floatValue >= 8.0){
[comp removeObjectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 8)]];
}else{
[comp removeObjectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 5)]];
}

if (comp.count > 1)
{
Expand All @@ -104,6 +111,8 @@ - (void) zipOriginal:(NSOperation*) operation
[aNewPath appendFormat:@"%@%@",i==0?@"":@"/",comp[i]];
}

//NSLog(@"==============>%@",aNewPath);

[subpaths addObject:aNewPath];

[aNewPath release];
Expand All @@ -115,10 +124,33 @@ - (void) zipOriginal:(NSOperation*) operation
for(NSString *path in subpaths)
{

if ([path hasPrefix:[appGUID stringByAppendingPathComponent:@"Documents"]]||[path hasPrefix:[appGUID stringByAppendingPathComponent:@"Library"]]||[path hasPrefix:[appGUID stringByAppendingPathComponent:@"tmp"]]||([path rangeOfString:@"SC_Info"].location != NSNotFound)||[path hasSuffix:binary])
//NSLog(@"------------------>%@",path);

if ([path hasPrefix:[appGUID stringByAppendingPathComponent:@"Documents"]]||
[path hasPrefix:[appGUID stringByAppendingPathComponent:@"Library"]]||
[path hasPrefix:[appGUID stringByAppendingPathComponent:@"tmp"]]||
([path rangeOfString:@"SC_Info"].location != NSNotFound)||
[path isEqualToString:@"iTunesArtwork"] ||
[path isEqualToString:@"iTunesMetadata.plist"] ||
[path hasSuffix:binary]
)
{
continue;
}
//check plugin
if (_cracker->_app.hasPlugin) {
BOOL should_continue = NO;
NSArray *pa = _cracker->_app.plugins;
for (Plugin *p in pa ) {
if ([path hasSuffix:p.pluginExecutableName]) {
should_continue = YES;
break;
}
}
if (should_continue) {
continue;
}
}

NSString *longPath = [folder stringByAppendingPathComponent:path];

Expand Down

0 comments on commit 684b1b3

Please sign in to comment.