This commit is contained in:
opa334 2022-11-20 15:33:54 +01:00
parent fa41de23b5
commit 374d6245c5
9 changed files with 26 additions and 11 deletions

View File

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

View File

@ -20,6 +20,8 @@
#define MAIN_NAME main
#endif
void cleanRestrictions(void);
extern mach_msg_return_t SBReloadIconForIdentifier(mach_port_t machport, const char* identifier);
@interface SBSHomeScreenService : NSObject
- (void)reloadIcons;
@ -717,6 +719,7 @@ int uninstallApp(NSString* appPath, NSString* appId)
// (Hopefully this never happens)
deleteSuc = [[NSFileManager defaultManager] removeItemAtPath:[appPath stringByDeletingLastPathComponent] error:nil];
registerPath((char*)appPath.fileSystemRepresentation, 1, YES);
return 0;
}
if(appId)
@ -726,6 +729,7 @@ int uninstallApp(NSString* appPath, NSString* appId)
if(deleteSuc)
{
cleanRestrictions();
return 0;
}
else
@ -762,6 +766,8 @@ int uninstallAppById(NSString* appId)
int installIpa(NSString* ipaPath, BOOL force)
{
cleanRestrictions();
if(![[NSFileManager defaultManager] fileExistsAtPath:ipaPath]) return 166;
BOOL suc = NO;
@ -1055,6 +1061,8 @@ void cleanRestrictions(void)
clientTruthDictionaryM[@"com.apple.lsd.appremoval"][@"clientRestrictions"][@"union"][@"removedSystemAppBundleIDs"][@"values"] = valuesArrM;
[clientTruthDictionaryM writeToURL:clientTruthURL error:nil];
killall(@"profiled", NO); // profiled needs to restart for the changes to apply
}
int MAIN_NAME(int argc, char *argv[], char *envp[])
@ -1116,7 +1124,7 @@ int MAIN_NAME(int argc, char *argv[], char *envp[])
cleanRestrictions();
[[LSApplicationWorkspace defaultWorkspace] _LSPrivateRebuildApplicationDatabasesForSystemApps:YES internal:YES user:YES];
refreshAppRegistrations();
killall(@"backboardd");
killall(@"backboardd", YES);
} else if([cmd isEqualToString:@"install-persistence-helper"])
{
if(argc <= 2) return -3;

View File

@ -138,7 +138,7 @@ void registerPath(char* cPath, int unregister, BOOL system)
dictToRegister[@"Container"] = containerPath;
dictToRegister[@"EnvironmentVariables"] = constructEnvironmentVariablesForContainerPath(containerPath);
}
dictToRegister[@"IsDeletable"] = @(![appBundleID isEqualToString:@"com.opa334.TrollStore"]);
dictToRegister[@"IsDeletable"] = @NO;
dictToRegister[@"Path"] = path;
dictToRegister[@"IsContainerized"] = @(constructContainerizationForEntitlements(entitlements));
dictToRegister[@"SignerOrganization"] = @"Apple Inc.";

View File

@ -10,7 +10,7 @@ extern NSString* rootHelperPath(void);
extern NSString* getNSStringFromFile(int fd);
extern void printMultilineNSString(NSString* stringToPrint);
extern int spawnRoot(NSString* path, NSArray* args, NSString** stdOut, NSString** stdErr);
extern void killall(NSString* processName);
extern void killall(NSString* processName, BOOL softly);
extern void respring(void);
extern void fetchLatestTrollStoreVersion(void (^completionHandler)(NSString* latestVersion));

View File

@ -204,20 +204,27 @@ void enumerateProcessesUsingBlock(void (^enumerator)(pid_t pid, NSString* execut
free(info);
}
void killall(NSString* processName)
void killall(NSString* processName, BOOL softly)
{
enumerateProcessesUsingBlock(^(pid_t pid, NSString* executablePath, BOOL* stop)
{
if([executablePath.lastPathComponent isEqualToString:processName])
{
kill(pid, SIGTERM);
if(softly)
{
kill(pid, SIGTERM);
}
else
{
kill(pid, SIGKILL);
}
}
});
}
void respring(void)
{
killall(@"SpringBoard");
killall(@"SpringBoard", YES);
exit(0);
}

View File

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

View File

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

View File

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

View File

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