|
@@ -400,11 +400,56 @@
|
|
|
DLog(@"\nExtracting DEBIAN files for processing...\n");
|
|
|
[HelperClass returnForProcess:[NSString stringWithFormat:@"/usr/local/bin/dpkg -e %@ %@", self.path, debian]];
|
|
|
|
|
|
+ //clean up any calls to uicache
|
|
|
+
|
|
|
+ NSString *postinst = [debian stringByAppendingPathComponent:@"postinst"];
|
|
|
+
|
|
|
+ //DLog(@"post inst: %@", postinst);
|
|
|
+
|
|
|
+ if ([FM fileExistsAtPath:postinst]){
|
|
|
+ NSString *postinstSource = [NSString stringWithContentsOfFile:postinst encoding:NSUTF8StringEncoding error:nil];
|
|
|
+ if (postinstSource.length > 0){
|
|
|
+ if ([postinstSource rangeOfString:@"uicache"].location != NSNotFound){
|
|
|
+
|
|
|
+ NSMutableArray *lines = [[postinstSource componentsSeparatedByString:@"\n"] mutableCopy];
|
|
|
+
|
|
|
+ //DLog(@"lines: %@", lines);
|
|
|
+
|
|
|
+ __block NSInteger markedForDeath = NSNotFound;
|
|
|
+ [lines enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
|
+
|
|
|
+ // DLog(@"obj: %@", obj);
|
|
|
+
|
|
|
+ if ([obj rangeOfString:@"uicache"].location != NSNotFound){
|
|
|
+
|
|
|
+ if ([obj rangeOfString:@"echo"].location == NSNotFound){
|
|
|
+ DLog(@"\n");
|
|
|
+ DLog(@"found uicache instance '%@' on line: %lu", obj, idx);
|
|
|
+ markedForDeath = idx;
|
|
|
+ }
|
|
|
+ *stop = TRUE;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }];
|
|
|
+
|
|
|
+ if (markedForDeath != NSNotFound){
|
|
|
+
|
|
|
+ [lines removeObjectAtIndex:markedForDeath];
|
|
|
+ NSString *newString = [lines componentsJoinedByString:@"\n"];
|
|
|
+ [newString writeToFile:postinst atomically:TRUE];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
if (newArch != nil) {
|
|
|
|
|
|
NSString *controlPath = [debian stringByAppendingPathComponent:@"control"];
|
|
|
-
|
|
|
NSMutableString *controlFile = [[NSMutableString alloc] initWithContentsOfFile:controlPath encoding:NSASCIIStringEncoding error:nil];
|
|
|
//@"appletvos-arm64"
|
|
|
|