mirror of
https://github.com/opa334/TrollStore.git
synced 2026-07-02 03:00:39 +08:00
1.5.0~b1
This commit is contained in:
@@ -12,5 +12,6 @@
|
||||
- (void)refreshAppRegistrationsPressed;
|
||||
- (void)uninstallPersistenceHelperPressed;
|
||||
- (void)handleUninstallation;
|
||||
- (NSMutableArray*)argsForUninstallingTrollStore;
|
||||
- (void)uninstallTrollStorePressed;
|
||||
@end
|
||||
@@ -188,20 +188,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (NSMutableArray*)argsForUninstallingTrollStore
|
||||
{
|
||||
return @[@"uninstall-trollstore"].mutableCopy;
|
||||
}
|
||||
|
||||
- (void)uninstallTrollStorePressed
|
||||
{
|
||||
UIAlertController* uninstallAlert = [UIAlertController alertControllerWithTitle:@"Uninstall" message:@"You are about to uninstall TrollStore, do you want to preserve the apps installed by it?" preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
UIAlertAction* uninstallAllAction = [UIAlertAction actionWithTitle:@"Uninstall TrollStore, Uninstall Apps" style:UIAlertActionStyleDestructive handler:^(UIAlertAction* action)
|
||||
{
|
||||
spawnRoot(rootHelperPath(), @[@"uninstall-trollstore"], nil, nil);
|
||||
NSMutableArray* args = [self argsForUninstallingTrollStore];
|
||||
spawnRoot(rootHelperPath(), @[args], nil, nil);
|
||||
[self handleUninstallation];
|
||||
}];
|
||||
[uninstallAlert addAction:uninstallAllAction];
|
||||
|
||||
UIAlertAction* preserveAppsAction = [UIAlertAction actionWithTitle:@"Uninstall TrollStore, Preserve Apps" style:UIAlertActionStyleDestructive handler:^(UIAlertAction* action)
|
||||
{
|
||||
spawnRoot(rootHelperPath(), @[@"uninstall-trollstore-preserve-apps"], nil, nil);
|
||||
NSMutableArray* args = [self argsForUninstallingTrollStore];
|
||||
[args addObject:@"preserve-apps"];
|
||||
spawnRoot(rootHelperPath(), args, nil, nil);
|
||||
[self handleUninstallation];
|
||||
}];
|
||||
[uninstallAlert addAction:preserveAppsAction];
|
||||
|
||||
@@ -13,6 +13,7 @@ extern int spawnRoot(NSString* path, NSArray* args, NSString** stdOut, NSString*
|
||||
extern void killall(NSString* processName, BOOL softly);
|
||||
extern void respring(void);
|
||||
extern void fetchLatestTrollStoreVersion(void (^completionHandler)(NSString* latestVersion));
|
||||
extern void fetchLatestLdidVersion(void (^completionHandler)(NSString* latestVersion));
|
||||
|
||||
extern NSArray* trollStoreInstalledAppBundlePaths();
|
||||
extern NSArray* trollStoreInstalledAppContainerPaths();
|
||||
|
||||
+13
-2
@@ -287,9 +287,10 @@ void respring(void)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void fetchLatestTrollStoreVersion(void (^completionHandler)(NSString* latestVersion))
|
||||
void github_fetchLatestVersion(NSString* repo, void (^completionHandler)(NSString* latestVersion))
|
||||
{
|
||||
NSURL* githubLatestAPIURL = [NSURL URLWithString:@"https://api.github.com/repos/opa334/TrollStore/releases/latest"];
|
||||
NSString* urlString = [NSString stringWithFormat:@"https://api.github.com/repos/%@/releases/latest", repo];
|
||||
NSURL* githubLatestAPIURL = [NSURL URLWithString:urlString];
|
||||
|
||||
NSURLSessionDataTask* task = [NSURLSession.sharedSession dataTaskWithURL:githubLatestAPIURL completionHandler:^(NSData *data, NSURLResponse *response, NSError *error)
|
||||
{
|
||||
@@ -311,6 +312,16 @@ void fetchLatestTrollStoreVersion(void (^completionHandler)(NSString* latestVers
|
||||
[task resume];
|
||||
}
|
||||
|
||||
void fetchLatestTrollStoreVersion(void (^completionHandler)(NSString* latestVersion))
|
||||
{
|
||||
github_fetchLatestVersion(@"opa334/TrollStore", completionHandler);
|
||||
}
|
||||
|
||||
void fetchLatestLdidVersion(void (^completionHandler)(NSString* latestVersion))
|
||||
{
|
||||
github_fetchLatestVersion(@"opa334/ldid", completionHandler);
|
||||
}
|
||||
|
||||
NSArray* trollStoreInstalledAppContainerPaths()
|
||||
{
|
||||
NSMutableArray* appContainerPaths = [NSMutableArray new];
|
||||
|
||||
Reference in New Issue
Block a user