|
@@ -44,7 +44,7 @@
|
|
[packagesArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
[packagesArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
NSString *debFile = [packagesFolder stringByAppendingPathComponent:obj];
|
|
NSString *debFile = [packagesFolder stringByAppendingPathComponent:obj];
|
|
DLog(@"processing package: %@", debFile);
|
|
DLog(@"processing package: %@", debFile);
|
|
- InputPackage *output = [HelperClass packageForDeb:debFile];
|
|
|
|
|
|
+ InputPackage *output = [InputPackage packageForDeb:debFile];
|
|
output.forceOverwrite = true;
|
|
output.forceOverwrite = true;
|
|
[output installToBootstrapPath:bootstrapPath];
|
|
[output installToBootstrapPath:bootstrapPath];
|
|
}];
|
|
}];
|
|
@@ -384,86 +384,6 @@
|
|
block(temp, termStatus);
|
|
block(temp, termStatus);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-//-rw-r--r-- 1 root wheel 4197184 May 9 19:53 nitotv_3.4.3-63_appletvos-arm64.deb
|
|
|
|
-+ (InputPackageFile *)packageFileFromLine:(NSString *)inputLine {
|
|
|
|
- // "-rwxr-xr-x 0 root wheel 69424 Oct 22 03:56 ./Library/MobileSubstrate/DynamicLibraries/beigelist7.dylib\n",
|
|
|
|
-
|
|
|
|
- //-rwxr-xr-x root/staff 10860 2011-02-02 03:55 ./Library/Frameworks/CydiaSubstrate.framework/Commands/cycc
|
|
|
|
- NSArray *lineObjects = [inputLine spaceDelimitedArray];
|
|
|
|
-
|
|
|
|
- //DLog(@"lineObjects: %@", lineObjects);
|
|
|
|
- /*
|
|
|
|
-
|
|
|
|
- "drwxr-xr-x",
|
|
|
|
- "root/wheel",
|
|
|
|
- 0,
|
|
|
|
- "2018-06-27",
|
|
|
|
- "01:21",
|
|
|
|
- "./"
|
|
|
|
- */
|
|
|
|
- NSString *permissionsAndType = [lineObjects objectAtIndex:0];
|
|
|
|
- NSString *userGroup = [lineObjects objectAtIndex:1];
|
|
|
|
- NSString *size = [lineObjects objectAtIndex:2];
|
|
|
|
- NSString *date = [lineObjects objectAtIndex:3];
|
|
|
|
- NSString *time = [lineObjects objectAtIndex:4];
|
|
|
|
- NSString *path = [lineObjects objectAtIndex:5];
|
|
|
|
-
|
|
|
|
- //@"drwxr-xr-x"
|
|
|
|
- NSString *fileTypeChar = [permissionsAndType substringWithRange:NSMakeRange(0, 1)];
|
|
|
|
- NSString *octalPermissions = [self octalFromSymbols:permissionsAndType];
|
|
|
|
- NSString *octalUG = [self octalFromGroupSymbols:userGroup];
|
|
|
|
- NSString *fileName = [path lastPathComponent];
|
|
|
|
- //NSString *fullPath = [NSString stringWithFormat:@"/%@", path];
|
|
|
|
- NSString *fullPath = path;
|
|
|
|
- if ([path hasPrefix:@"."]){
|
|
|
|
- fullPath = [path substringFromIndex:1];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- InputPackageFile *pf = [InputPackageFile new];
|
|
|
|
- [pf _setFileTypeFromRaw:fileTypeChar];
|
|
|
|
-
|
|
|
|
- switch (pf.type) {
|
|
|
|
- case BSPackageFileTypeLink:
|
|
|
|
- {
|
|
|
|
- fullPath = [lineObjects objectAtIndex:7];
|
|
|
|
- NSString *linkDest = [NSString stringWithFormat:@"/%@", path];
|
|
|
|
- pf.permissions = octalPermissions;
|
|
|
|
- pf.owner = octalUG;
|
|
|
|
- pf.size = size;
|
|
|
|
- pf.time = time;
|
|
|
|
- pf.date = date;
|
|
|
|
- pf.path = fullPath;
|
|
|
|
- pf.basename = fileName;
|
|
|
|
- pf.linkDestination = linkDest;
|
|
|
|
-
|
|
|
|
- return pf;
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
-
|
|
|
|
- case BSPackageFileTypeDirectory:
|
|
|
|
- //DLog(@"we dont want directory entries do we %@", lineObjects);
|
|
|
|
- pf.permissions = octalPermissions;
|
|
|
|
- pf.owner = octalUG;
|
|
|
|
- pf.size = size;
|
|
|
|
- pf.time = time;
|
|
|
|
- pf.date = date;
|
|
|
|
- pf.path = fullPath;
|
|
|
|
- pf.basename = fileName;
|
|
|
|
- return pf;
|
|
|
|
- break;
|
|
|
|
-
|
|
|
|
- default:
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- pf.permissions = octalPermissions;
|
|
|
|
- pf.owner = octalUG;
|
|
|
|
- pf.size = size;
|
|
|
|
- pf.time = time;
|
|
|
|
- pf.date = date;
|
|
|
|
- pf.path = fullPath;
|
|
|
|
- pf.basename = fileName;
|
|
|
|
- return pf;
|
|
|
|
-}
|
|
|
|
|
|
|
|
+ (NSString *)octalFromGroupSymbols:(NSString *)theSymbols {
|
|
+ (NSString *)octalFromGroupSymbols:(NSString *)theSymbols {
|
|
NSArray *groupArray = [theSymbols componentsSeparatedByString:@"/"];
|
|
NSArray *groupArray = [theSymbols componentsSeparatedByString:@"/"];
|
|
@@ -521,35 +441,6 @@
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
-+ (InputPackage *)packageForDeb:(NSString *)debFile {
|
|
|
|
-
|
|
|
|
- NSString *dpkg = [@"dpkg" runPathForSearchPath];
|
|
|
|
- NSString *packageName = [self singleLineReturnForProcess:@"%@ -f %@ Package",dpkg, debFile];
|
|
|
|
- NSString *packageVersion = [self singleLineReturnForProcess:@"%@ -f %@ Version", dpkg, debFile];
|
|
|
|
- NSArray <InputPackageFile *> *fileList = [self returnForProcess:[NSString stringWithFormat:@"%@ -c %@", dpkg, debFile]];
|
|
|
|
-
|
|
|
|
- __block NSMutableArray *finalArray = [NSMutableArray new];
|
|
|
|
-
|
|
|
|
- [fileList enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
|
|
-
|
|
|
|
- InputPackageFile *file = [self packageFileFromLine:obj];
|
|
|
|
- if (file) {
|
|
|
|
- //DLog(@"%@", file);
|
|
|
|
- [finalArray addObject:file];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }];
|
|
|
|
-
|
|
|
|
- InputPackage *pkg = [InputPackage new];
|
|
|
|
- pkg.files = finalArray;
|
|
|
|
- pkg.path = debFile;
|
|
|
|
- pkg.packageName = packageName;
|
|
|
|
- pkg.version = packageVersion;
|
|
|
|
- pkg.validLDIDPath = [self validLDIDPath];
|
|
|
|
- return pkg;
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
+ (NSString *)octalFromSymbols:(NSString *)theSymbols {
|
|
+ (NSString *)octalFromSymbols:(NSString *)theSymbols {
|
|
//DLog(@"%@ %s", self, _cmd);
|
|
//DLog(@"%@ %s", self, _cmd);
|
|
NSString *U = [theSymbols substringWithRange:NSMakeRange(1, 3)];
|
|
NSString *U = [theSymbols substringWithRange:NSMakeRange(1, 3)];
|