mirror of https://github.com/opa334/TrollStore.git
Workaround ldid issue, improve app icons
This commit is contained in:
parent
92e4981ac0
commit
ad2b6b6c9f
|
@ -496,8 +496,46 @@ int signApp(NSString* appPath)
|
|||
}
|
||||
else
|
||||
{
|
||||
// Work around an ldid bug where it doesn't keep entitlements on stray binaries
|
||||
NSMutableDictionary* storedEntitlements = [NSMutableDictionary new];
|
||||
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtURL:[NSURL fileURLWithPath:appPath] includingPropertiesForKeys:nil options:0 errorHandler:nil];
|
||||
NSURL* fileURL;
|
||||
while(fileURL = [enumerator nextObject])
|
||||
{
|
||||
NSString* filePath = fileURL.path;
|
||||
|
||||
BOOL isDir;
|
||||
[[NSFileManager defaultManager] fileExistsAtPath:fileURL.path isDirectory:&isDir];
|
||||
|
||||
if([filePath.lastPathComponent isEqualToString:@"Info.plist"])
|
||||
{
|
||||
NSDictionary* infoDictionary = [NSDictionary dictionaryWithContentsOfFile:filePath];
|
||||
NSArray* tsRootBinaries = infoDictionary[@"TSRootBinaries"];
|
||||
if(tsRootBinaries && [tsRootBinaries isKindOfClass:[NSArray class]])
|
||||
{
|
||||
for(NSString* rootBinary in tsRootBinaries)
|
||||
{
|
||||
if([rootBinary isKindOfClass:[NSString class]])
|
||||
{
|
||||
NSString* rootBinaryPath = [[filePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:rootBinary];
|
||||
storedEntitlements[rootBinaryPath] = dumpEntitlementsFromBinaryAtPath(rootBinaryPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// app has entitlements, keep them
|
||||
ldidRet = runLdid(@[@"-s", certArg, appPath], nil, &errorOutput);
|
||||
|
||||
[storedEntitlements enumerateKeysAndObjectsUsingBlock:^(NSString* binaryPath, NSDictionary* entitlements, BOOL* stop)
|
||||
{
|
||||
NSString* tmpEntitlementPlistPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"ent.xml"];
|
||||
[entitlements writeToURL:[NSURL fileURLWithPath:tmpEntitlementPlistPath] error:nil];
|
||||
NSString* tmpEntitlementArg = [@"-S" stringByAppendingString:tmpEntitlementPlistPath];
|
||||
runLdid(@[tmpEntitlementArg, certArg, binaryPath], nil, nil);
|
||||
[[NSFileManager defaultManager] removeItemAtPath:tmpEntitlementPlistPath error:nil];
|
||||
}];
|
||||
}
|
||||
|
||||
NSLog(@"ldid exited with status %d", ldidRet);
|
||||
|
|
|
@ -95,8 +95,15 @@
|
|||
|
||||
// Configure the cell...
|
||||
cell.textLabel.text = [[TSApplicationsManager sharedInstance] displayNameForAppPath:appPath];
|
||||
cell.detailTextLabel.text = appVersion;
|
||||
cell.imageView.image = [UIImage _applicationIconImageForBundleIdentifier:appId format:10 scale:2.0];
|
||||
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ • %@", appVersion, appId];
|
||||
cell.imageView.image = [UIImage _applicationIconImageForBundleIdentifier:appId format:10 scale:[UIScreen mainScreen].scale];
|
||||
cell.imageView.layer.borderWidth = 0.2;
|
||||
cell.imageView.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
cell.imageView.layer.cornerRadius = 13.8;
|
||||
|
||||
cell.preservesSuperviewLayoutMargins = NO;
|
||||
cell.separatorInset = UIEdgeInsetsZero;
|
||||
cell.layoutMargins = UIEdgeInsetsZero;
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,15 @@
|
|||
|
||||
- (NSString*)versionStringForAppPath:(NSString*)appPath
|
||||
{
|
||||
return [self infoDictionaryForAppPath:appPath][@"CFBundleShortVersionString"];
|
||||
NSDictionary* infoDict = [self infoDictionaryForAppPath:appPath];
|
||||
NSString* versionString = infoDict[@"CFBundleShortVersionString"];
|
||||
|
||||
if(!versionString)
|
||||
{
|
||||
versionString = infoDict[@"CFBundleVersion"];
|
||||
}
|
||||
|
||||
return versionString;
|
||||
}
|
||||
|
||||
- (NSError*)errorForCode:(int)code
|
||||
|
|
Loading…
Reference in New Issue