mirror of https://github.com/opa334/TrollStore.git
Fix rebooting
reboot3 requires platformization. Use FrontBoardServices to do it instead
This commit is contained in:
parent
28aab08dec
commit
eed1d42792
|
@ -63,6 +63,8 @@ BOOL getDeveloperModeState(xpc_connection_t connection) {
|
|||
return NO;
|
||||
}
|
||||
|
||||
NSLog(@"[getDeveloperModeState] got reply %@", reply);
|
||||
|
||||
NSObject* success = reply[@"success"];
|
||||
if (!success || ![success isKindOfClass:[NSNumber class]] || ![(NSNumber*)success boolValue]) {
|
||||
NSLog(@"[getDeveloperModeState] request failed with error %@", reply[@"error"]);
|
||||
|
|
|
@ -44,5 +44,9 @@
|
|||
<string>Uninstall</string>
|
||||
<string>UpdatePlaceholderMetadata</string>
|
||||
</array>
|
||||
<key>com.apple.private.amfi.developer-mode-control</key>
|
||||
<true/>
|
||||
<key>com.apple.frontboard.shutdown</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#endif
|
||||
|
||||
#import <SpringBoardServices/SpringBoardServices.h>
|
||||
#import <FrontBoardServices/FBSSystemService.h>
|
||||
#import <Security/Security.h>
|
||||
|
||||
#ifdef EMBEDDED_ROOT_HELPER
|
||||
|
@ -50,8 +51,6 @@ typedef CFDictionaryRef (*_CFPreferencesCopyMultipleWithContainerType)(CFArrayRe
|
|||
|
||||
BOOL _installPersistenceHelper(LSApplicationProxy* appProxy, NSString* sourcePersistenceHelper, NSString* sourceRootHelper);
|
||||
|
||||
extern int reboot3(uint64_t flags, ...);
|
||||
|
||||
NSArray<LSApplicationProxy*>* applicationsWithGroupId(NSString* groupId)
|
||||
{
|
||||
LSEnumerator* enumerator = [LSEnumerator enumeratorForApplicationProxiesWithOptions:0];
|
||||
|
@ -1529,8 +1528,9 @@ int MAIN_NAME(int argc, char *argv[], char *envp[])
|
|||
}
|
||||
else if([cmd isEqualToString:@"reboot"])
|
||||
{
|
||||
sync();
|
||||
ret = reboot3(0); // do a normal reboot
|
||||
[[FBSSystemService sharedService] reboot];
|
||||
// Give the system some time to reboot
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
NSLog(@"trollstorehelper returning %d", ret);
|
||||
|
|
Loading…
Reference in New Issue