mirror of
https://github.com/opa334/TrollStore.git
synced 2026-01-11 23:52:24 +08:00
Merge 3caf9addd2 into d11c04666a
This commit is contained in:
commit
eee8cd7858
@ -1169,7 +1169,7 @@ int uninstallAppByPath(NSString* appPath, BOOL useCustomMethod)
|
|||||||
|
|
||||||
NSString* standardizedAppPath = appPath.stringByStandardizingPath;
|
NSString* standardizedAppPath = appPath.stringByStandardizingPath;
|
||||||
|
|
||||||
if(![standardizedAppPath hasPrefix:@"/var/containers/Bundle/Application/"] && standardizedAppPath.pathComponents.count == 5)
|
if(![standardizedAppPath hasPrefix:@"/var/containers/Bundle/Application/"] || standardizedAppPath.pathComponents.count < 5)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,6 +58,12 @@ int extract(NSString* fileToExtract, NSString* extractionPath)
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
NSString* currentFile = [NSString stringWithUTF8String:archive_entry_pathname(entry)];
|
NSString* currentFile = [NSString stringWithUTF8String:archive_entry_pathname(entry)];
|
||||||
|
if (currentFile.length == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ([currentFile hasPrefix:@"/"] || [currentFile containsString:@".."]) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
NSString* fullOutputPath = [extractionPath stringByAppendingPathComponent:currentFile];
|
NSString* fullOutputPath = [extractionPath stringByAppendingPathComponent:currentFile];
|
||||||
//printf("extracting %@ to %@\n", currentFile, fullOutputPath);
|
//printf("extracting %@ to %@\n", currentFile, fullOutputPath);
|
||||||
archive_entry_set_pathname(entry, fullOutputPath.fileSystemRepresentation);
|
archive_entry_set_pathname(entry, fullOutputPath.fileSystemRepresentation);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user