mirror of https://github.com/opa334/TrollStore.git
Add enable-jit URL scheme endpoint
This commit is contained in:
parent
4bfc994f70
commit
b83c53cb46
|
@ -32,9 +32,10 @@ On jailbroken iOS 14 when TrollHelper is used for installation, it is located in
|
||||||
|
|
||||||
## URL Scheme
|
## URL Scheme
|
||||||
|
|
||||||
As of version 1.3, TrollStore replaces the system URL scheme "apple-magnifier" (this is done so "jailbreak" detections can't detect TrollStore like they could if TrollStore had a unique URL scheme). This URL scheme can be used to install applications right from the browser, the format goes as follows:
|
As of version 1.3, TrollStore replaces the system URL scheme "apple-magnifier" (this is done so "jailbreak" detections can't detect TrollStore like they could if TrollStore had a unique URL scheme). This URL scheme can be used to install applications right from the browser, or to enable JIT from the app itself, the format goes as follows:
|
||||||
|
|
||||||
`apple-magnifier://install?url=<URL_to_IPA>`
|
- `apple-magnifier://install?url=<URL_to_IPA>`
|
||||||
|
- `apple-magnifier://enable-jit?bundle-id=<Bundle_ID>`
|
||||||
|
|
||||||
On devices that don't have TrollStore (1.3+) installed, this will just open the magnifier app.
|
On devices that don't have TrollStore (1.3+) installed, this will just open the magnifier app.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#import "TSSceneDelegate.h"
|
#import "TSSceneDelegate.h"
|
||||||
#import "TSRootViewController.h"
|
#import "TSRootViewController.h"
|
||||||
#import "TSUtil.h"
|
#import "TSUtil.h"
|
||||||
|
#import "TSApplicationsManager.h"
|
||||||
#import "TSInstallationController.h"
|
#import "TSInstallationController.h"
|
||||||
#import <TSPresentationDelegate.h>
|
#import <TSPresentationDelegate.h>
|
||||||
|
|
||||||
|
@ -67,11 +68,64 @@
|
||||||
[TSInstallationController handleAppInstallFromRemoteURL:URLToInstall completion:nil];
|
[TSInstallationController handleAppInstallFromRemoteURL:URLToInstall completion:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if([components.host isEqualToString:@"enable-jit"])
|
||||||
|
{
|
||||||
|
NSString* BundleIDToEnableJIT;
|
||||||
|
|
||||||
|
for(NSURLQueryItem* queryItem in components.queryItems)
|
||||||
|
{
|
||||||
|
if([queryItem.name isEqualToString:@"bundle-id"])
|
||||||
|
{
|
||||||
|
BundleIDToEnableJIT = queryItem.value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(BundleIDToEnableJIT && [BundleIDToEnableJIT isKindOfClass:NSString.class])
|
||||||
|
{
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^
|
||||||
|
{
|
||||||
|
[self handleEnableJITForBundleID:BundleIDToEnableJIT];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)handleEnableJITForBundleID:(NSString *)appId
|
||||||
|
{
|
||||||
|
TSApplicationsManager* appsManager = [TSApplicationsManager sharedInstance];
|
||||||
|
|
||||||
|
BOOL didOpen = [appsManager openApplicationWithBundleID:appId];
|
||||||
|
|
||||||
|
// if we failed to open the app, show an alert
|
||||||
|
if(!didOpen)
|
||||||
|
{
|
||||||
|
NSString* failMessage = @"";
|
||||||
|
// we don't have TSAppInfo here so we cannot check the registration state
|
||||||
|
|
||||||
|
NSString* failTitle = [NSString stringWithFormat:@"Failed to open %@", appId];
|
||||||
|
UIAlertController* didFailController = [UIAlertController alertControllerWithTitle:failTitle message:failMessage preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
|
||||||
|
|
||||||
|
[didFailController addAction:cancelAction];
|
||||||
|
[TSPresentationDelegate presentViewController:didFailController animated:YES completion:nil];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int ret = [appsManager enableJITForBundleID:appId];
|
||||||
|
if (ret != 0)
|
||||||
|
{
|
||||||
|
UIAlertController* errorAlert = [UIAlertController alertControllerWithTitle:@"Error" message:[NSString stringWithFormat:@"Error enabling JIT: trollstorehelper returned %d", ret] preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
UIAlertAction* closeAction = [UIAlertAction actionWithTitle:@"Close" style:UIAlertActionStyleDefault handler:nil];
|
||||||
|
[errorAlert addAction:closeAction];
|
||||||
|
[TSPresentationDelegate presentViewController:errorAlert animated:YES completion:nil];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// We want to auto install ldid if either it doesn't exist
|
// We want to auto install ldid if either it doesn't exist
|
||||||
// or if it's the one from an old TrollStore version that's no longer supported
|
// or if it's the one from an old TrollStore version that's no longer supported
|
||||||
- (void)handleLdidCheck
|
- (void)handleLdidCheck
|
||||||
|
|
|
@ -291,7 +291,7 @@ extern NSUserDefaults* trollStoreUserDefaults(void);
|
||||||
|
|
||||||
PSSpecifier* installationSettingsGroupSpecifier = [PSSpecifier emptyGroupSpecifier];
|
PSSpecifier* installationSettingsGroupSpecifier = [PSSpecifier emptyGroupSpecifier];
|
||||||
installationSettingsGroupSpecifier.name = @"Security";
|
installationSettingsGroupSpecifier.name = @"Security";
|
||||||
[installationSettingsGroupSpecifier setProperty:@"The URL Scheme, when enabled, will allow apps and websites to trigger TrollStore installations through the apple-magnifier://install?url=<IPA_URL> URL scheme." forKey:@"footerText"];
|
[installationSettingsGroupSpecifier setProperty:@"The URL Scheme, when enabled, will allow apps and websites to trigger TrollStore installations through the apple-magnifier://install?url=<IPA_URL> URL scheme and enable JIT through the apple-magnifier://enable-jit?bundle-id=<BUNDLE_ID> URL scheme." forKey:@"footerText"];
|
||||||
|
|
||||||
[_specifiers addObject:installationSettingsGroupSpecifier];
|
[_specifiers addObject:installationSettingsGroupSpecifier];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue