Merge branch 'opa334:main' into main

This commit is contained in:
BigBoiMan123 2022-10-19 17:08:01 -07:00 committed by GitHub
commit 105d96de6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 47 additions and 15 deletions

View File

@ -39,7 +39,7 @@ build_installer15:
@unzip ./Victim/InstallerVictim.ipa -d ./_build/tmp15 @unzip ./Victim/InstallerVictim.ipa -d ./_build/tmp15
@cp ./TrollHelper/.theos/obj/TrollStorePersistenceHelper.app/TrollStorePersistenceHelper ./_build/TrollStorePersistenceHelperToInject @cp ./TrollHelper/.theos/obj/TrollStorePersistenceHelper.app/TrollStorePersistenceHelper ./_build/TrollStorePersistenceHelperToInject
@pwnify set-cpusubtype ./_build/TrollStorePersistenceHelperToInject 1 @pwnify set-cpusubtype ./_build/TrollStorePersistenceHelperToInject 1
@ldid -s -K./Victim/victim_gta.p12 ./_build/TrollStorePersistenceHelperToInject @ldid -s -K./Victim/victim.p12 ./_build/TrollStorePersistenceHelperToInject
APP_PATH=$$(find ./_build/tmp15/Payload -name "*" -depth 1) ; \ APP_PATH=$$(find ./_build/tmp15/Payload -name "*" -depth 1) ; \
APP_NAME=$$(basename $$APP_PATH) ; \ APP_NAME=$$(basename $$APP_PATH) ; \
BINARY_NAME=$$(echo "$$APP_NAME" | cut -f 1 -d '.') ; \ BINARY_NAME=$$(echo "$$APP_NAME" | cut -f 1 -d '.') ; \

View File

@ -1,6 +1,6 @@
Package: com.opa334.trollstoreroothelper Package: com.opa334.trollstoreroothelper
Name: trollstoreroothelper Name: trollstoreroothelper
Version: 1.2 Version: 1.2.2
Architecture: iphoneos-arm Architecture: iphoneos-arm
Description: An awesome tool of some sort!! Description: An awesome tool of some sort!!
Maintainer: opa334 Maintainer: opa334

View File

@ -80,6 +80,25 @@ NSSet<NSString*>* appleURLSchemes(void)
return systemURLSchemes.copy; return systemURLSchemes.copy;
} }
NSSet<NSString*>* immutableAppBundleIdentifiers(void)
{
NSMutableSet* systemAppIdentifiers = [NSMutableSet new];
LSEnumerator* enumerator = [LSEnumerator enumeratorForApplicationProxiesWithOptions:0];
LSApplicationProxy* appProxy;
while(appProxy = [enumerator nextObject])
{
if(appProxy.installed)
{
if(![appProxy.bundleURL.path hasPrefix:@"/private/var/containers"])
{
[systemAppIdentifiers addObject:appProxy.bundleIdentifier.lowercaseString];
}
}
}
return systemAppIdentifiers.copy;
}
NSDictionary* infoDictionaryForAppPath(NSString* appPath) NSDictionary* infoDictionaryForAppPath(NSString* appPath)
{ {
@ -583,8 +602,15 @@ int installApp(NSString* appPath, BOOL sign, BOOL force)
NSString* appId = appIdForAppPath(appPath); NSString* appId = appIdForAppPath(appPath);
if(!appId) return 176; if(!appId) return 176;
if([immutableAppBundleIdentifiers() containsObject:appId.lowercaseString])
{
return 179;
}
applyPatchesToInfoDictionary(appPath); if(![appId isEqualToString:@"com.opa334.TrollStore"])
{
applyPatchesToInfoDictionary(appPath);
}
if(sign) if(sign)
{ {
@ -876,6 +902,12 @@ int installIpa(NSString* ipaPath, BOOL force)
} }
if(!tmpAppPath) return 167; if(!tmpAppPath) return 167;
NSString* appId = appIdForAppPath(tmpAppPath);
if([appId.lowercaseString isEqualToString:@"com.opa334.trollstore"])
{
return 179;
}
int ret = installApp(tmpAppPath, YES, force); int ret = installApp(tmpAppPath, YES, force);
[[NSFileManager defaultManager] removeItemAtPath:tmpAppPath error:nil]; [[NSFileManager defaultManager] removeItemAtPath:tmpAppPath error:nil];

View File

@ -6,6 +6,7 @@
// uicache on steroids // uicache on steroids
extern NSSet<NSString*>* immutableAppBundleIdentifiers(void);
extern NSDictionary* dumpEntitlementsFromBinaryAtPath(NSString* binaryPath); extern NSDictionary* dumpEntitlementsFromBinaryAtPath(NSString* binaryPath);
NSDictionary* constructGroupsContainersForEntitlements(NSDictionary* entitlements, BOOL systemGroups) NSDictionary* constructGroupsContainersForEntitlements(NSDictionary* entitlements, BOOL systemGroups)
@ -108,6 +109,8 @@ void registerPath(char* cPath, int unregister)
NSDictionary* appInfoPlist = [NSDictionary dictionaryWithContentsOfFile:[path stringByAppendingPathComponent:@"Info.plist"]]; NSDictionary* appInfoPlist = [NSDictionary dictionaryWithContentsOfFile:[path stringByAppendingPathComponent:@"Info.plist"]];
NSString* appBundleID = [appInfoPlist objectForKey:@"CFBundleIdentifier"]; NSString* appBundleID = [appInfoPlist objectForKey:@"CFBundleIdentifier"];
if([immutableAppBundleIdentifiers() containsObject:appBundleID.lowercaseString]) return;
if(appBundleID && !unregister) if(appBundleID && !unregister)
{ {
MCMContainer* appContainer = [NSClassFromString(@"MCMAppDataContainer") containerWithIdentifier:appBundleID createIfNecessary:YES existed:nil error:nil]; MCMContainer* appContainer = [NSClassFromString(@"MCMAppDataContainer") containerWithIdentifier:appBundleID createIfNecessary:YES existed:nil error:nil];

View File

@ -52,7 +52,7 @@
<string>iPhoneOS</string> <string>iPhoneOS</string>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.2</string> <string>1.2.2</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>UIDeviceFamily</key> <key>UIDeviceFamily</key>

View File

@ -1,6 +1,6 @@
Package: com.opa334.trollstorehelper Package: com.opa334.trollstorehelper
Name: TrollStore Helper Name: TrollStore Helper
Version: 1.2 Version: 1.2.2
Architecture: iphoneos-arm Architecture: iphoneos-arm
Description: Helper utility to install and manage TrollStore! Description: Helper utility to install and manage TrollStore!
Maintainer: opa334 Maintainer: opa334

View File

@ -50,7 +50,7 @@
<string>iPhoneOS</string> <string>iPhoneOS</string>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.2</string> <string>1.2.2</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>UIDeviceFamily</key> <key>UIDeviceFamily</key>

View File

@ -109,6 +109,9 @@
case 178: case 178:
errorDescription = @"Failed to copy app bundle."; errorDescription = @"Failed to copy app bundle.";
break; break;
case 179:
errorDescription = @"The app you tried to install has the same identifier as a system app already installed on the device. The installation has been prevented to protect you from possible bootloops or other issues.";
break;
// App detach errors // App detach errors
/*case 184: /*case 184:
errorDescription = @"Refusing to detach, the app is still signed with a fake root certificate. The detach option is only for when you have installed an App Store app on top of a TrollStore app."; errorDescription = @"Refusing to detach, the app is still signed with a fake root certificate. The detach option is only for when you have installed an App Store app on top of a TrollStore app.";

View File

@ -1,6 +1,6 @@
Package: com.opa334.trollstore Package: com.opa334.trollstore
Name: TrollStore Name: TrollStore
Version: 1.2 Version: 1.2.2
Architecture: iphoneos-arm Architecture: iphoneos-arm
Description: An awesome application! Description: An awesome application!
Maintainer: opa334 Maintainer: opa334

View File

@ -1,13 +1,7 @@
# Victim Binary and Cert # Victim IPA and Cert
In order to support user app installations (works on anything but iOS 14 arm64), TrollStore needs a victim binary that it attaches to any binary installed by it. By default it uses the binary of "Pastebin Mobile", because the dev of that app gave me permission to use that. In order to compile a pwned TrollHelperOTA arm64 IPA, you need to provide a dev cert with the same team ID as your victim app in this directory.
In order to compile a pwned TrollInstaller2 IPA, you need to provide a dev cert with the same team ID as your target app in this directory.
```bash ```bash
./make_cert.sh <TEAM_ID> ./make_cert.sh <TEAM_ID>
``` ```
(Currently victim_gta.p12 is used by the build script, this works for GTA Car Tracker app, to use another app generate a new cert with the team ID and make sure to update the path in build script too)
((Disregard the user app stuff described above, it's not implemented yet, will be in TrollStore 2.0))

Binary file not shown.

Binary file not shown.

Binary file not shown.