summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2020-12-11 10:05:03 -1000
committerSam Bingner <sam@bingner.com>2020-12-11 10:05:03 -1000
commitf091820b7e6402ddc5688ecba521059e2ca4029d (patch)
tree269c2c5d16db90a6ffd9d10e0c40d8ae5acaa641
parentf39460120a166d4916001005a3348fbc5dff1b61 (diff)
Userspace reboot supportuserspacereboot
-rw-r--r--MobileCydia.app/en.lproj/Localizable.strings1
-rw-r--r--MobileCydia.mm14
-rw-r--r--entitlements.xml4
3 files changed, 17 insertions, 2 deletions
diff --git a/MobileCydia.app/en.lproj/Localizable.strings b/MobileCydia.app/en.lproj/Localizable.strings
index 9baea5e..7234d7f 100644
--- a/MobileCydia.app/en.lproj/Localizable.strings
+++ b/MobileCydia.app/en.lproj/Localizable.strings
@@ -144,6 +144,7 @@
"QUEUED_FOR" = "Queued for %@";
"Q_D" = "Q'd";
"REBOOT_DEVICE" = "Reboot Device";
+"REBOOT_USERSPACE" = "Reboot Userspace";
"RECENT" = "Recent";
"RECENT_CHANGES_UPDATES" = "Recent Changes/Updates";
"RECOMMENDED_BOOKS" = "Recommended Books";
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 1e9e4fa..9237ea6 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -91,6 +91,10 @@
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/reboot.h>
+extern "C" {
+// Missing from header
+int reboot3(uint64_t howto, ...);
+}
#include <dirent.h>
#include <fcntl.h>
@@ -5232,6 +5236,11 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
case 4:
_trace();
+ reboot3(0x2000000000000000);
+ // Fall back to full reboot if userspace reboot unsupported
+
+ case 5:
+ _trace();
if (void (*SBReboot)(mach_port_t) = reinterpret_cast<void (*)(mach_port_t)>(dlsym(RTLD_DEFAULT, "SBReboot")))
SBReboot(SBSSpringBoardServerPort());
else
@@ -5330,7 +5339,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
case 1: [progress_ setFinish:UCLocalize("CLOSE_CYDIA")]; break;
case 2: [progress_ setFinish:UCLocalize("RESTART_SPRINGBOARD")]; break;
case 3: [progress_ setFinish:UCLocalize("RELOAD_SPRINGBOARD")]; break;
- case 4: [progress_ setFinish:UCLocalize("REBOOT_DEVICE")]; break;
+ case 4: [progress_ setFinish:UCLocalize("REBOOT_USERSPACE")]; break;
+ case 5: [progress_ setFinish:UCLocalize("REBOOT_DEVICE")]; break;
}
UpdateExternalStatus(Finish_ == 0 ? 0 : 2);
@@ -9585,7 +9595,7 @@ int main(int argc, char *argv[]) {
system("/usr/libexec/cydia/cydo /bin/rm -f /var/lib/cydia/metadata.plist");
/* }}} */
- Finishes_ = [NSArray arrayWithObjects:@"return", @"reopen", @"restart", @"reload", @"reboot", nil];
+ Finishes_ = [NSArray arrayWithObjects:@"return", @"reopen", @"restart", @"reload", @"rebootuserspace", @"reboot", nil];
if (kCFCoreFoundationVersionNumber > 1000)
system("/usr/libexec/cydia/cydo /usr/libexec/cydia/setnsfpn /var/lib");
diff --git a/entitlements.xml b/entitlements.xml
index e07f924..e7adee2 100644
--- a/entitlements.xml
+++ b/entitlements.xml
@@ -16,6 +16,10 @@
<true/>
<key>com.apple.private.skip-library-validation</key>
<true/>
+ <key>com.apple.private.xpc.launchd.reboot</key>
+ <true/>
+ <key>com.apple.private.xpc.launchd.userspace-reboot</key>
+ <true/>
<key>com.apple.frontboard.launchapplications</key>
<true/>
<key>com.apple.frontboard.shutdown</key>