1
0
mirror of https://github.com/opa334/TrollStore.git synced 2026-01-11 23:52:24 +08:00
This commit is contained in:
Jacob Prezant 2026-01-02 16:08:40 -05:00 committed by GitHub
commit eee8cd7858
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -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;
} }

View File

@ -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);