summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2018-10-04 16:00:06 -1000
committerSam Bingner <sam@bingner.com>2018-10-04 16:00:06 -1000
commit333fb40d2d52c32959badba1fa855c1c831f058a (patch)
tree5ae84bf94bda75887881eebca6e5829c56078794
parent68d2b30b8a240347caa0937c75cfbf0079b7a3a5 (diff)
Add entitlements and calls necessary for jbd/kppless
-rw-r--r--extrainst_.xml4
-rw-r--r--ldrestart.cpp21
-rw-r--r--sbreload.c22
-rw-r--r--uicache.xml6
-rw-r--r--uiopen.xml4
5 files changed, 57 insertions, 0 deletions
diff --git a/extrainst_.xml b/extrainst_.xml
index 0829339..b5d56f1 100644
--- a/extrainst_.xml
+++ b/extrainst_.xml
@@ -6,5 +6,9 @@
<array>
<string>RebuildMaps</string>
</array>
+ <key>platform-application</key>
+ <true/>
+ <key>com.apple.private.skip-library-validation</key>
+ <true/>
</dict>
</plist>
diff --git a/ldrestart.cpp b/ldrestart.cpp
index 04f7a8b..a6d6cb6 100644
--- a/ldrestart.cpp
+++ b/ldrestart.cpp
@@ -30,6 +30,26 @@
#include <launch.h>
#include <sys/stat.h>
+/* Set platform binary flag */
+#define FLAG_PLATFORMIZE (1 << 1)
+#include <dlfcn.h>
+
+void platformizeme() {
+ void* handle = dlopen("/usr/lib/libjailbreak.dylib", RTLD_LAZY);
+ if (!handle) return;
+
+ // Reset errors
+ dlerror();
+ typedef void (*fix_entitle_prt_t)(pid_t pid, uint32_t what);
+ fix_entitle_prt_t ptr = (fix_entitle_prt_t)dlsym(handle, "jb_oneshot_entitle_now");
+
+ const char *dlsym_error = dlerror();
+ if (dlsym_error) {
+ return;
+ }
+
+ ptr(getpid(), FLAG_PLATFORMIZE);
+}
void process(launch_data_t value, const char *name, void *baton) {
if (launch_data_get_type(value) != LAUNCH_DATA_DICTIONARY)
@@ -65,6 +85,7 @@ void process(launch_data_t value, const char *name, void *baton) {
}
int main(int argc, char *argv[]) {
+ platformizeme();
auto request(launch_data_new_string(LAUNCH_KEY_GETJOBS));
auto response(launch_msg(request));
launch_data_free(request);
diff --git a/sbreload.c b/sbreload.c
index 3db5a68..42da2a8 100644
--- a/sbreload.c
+++ b/sbreload.c
@@ -45,6 +45,27 @@
#include <CoreFoundation/CoreFoundation.h>
+/* Set platform binary flag */
+#define FLAG_PLATFORMIZE (1 << 1)
+#include <dlfcn.h>
+
+void platformizeme() {
+ void* handle = dlopen("/usr/lib/libjailbreak.dylib", RTLD_LAZY);
+ if (!handle) return;
+
+ // Reset errors
+ dlerror();
+ typedef void (*fix_entitle_prt_t)(pid_t pid, uint32_t what);
+ fix_entitle_prt_t ptr = (fix_entitle_prt_t)dlsym(handle, "jb_oneshot_entitle_now");
+
+ const char *dlsym_error = dlerror();
+ if (dlsym_error) {
+ return;
+ }
+
+ ptr(getpid(), FLAG_PLATFORMIZE);
+}
+
launch_data_t
CF2launch_data(CFTypeRef cfr);
@@ -163,6 +184,7 @@ void stop() {
#define SpringBoard_plist "/System/Library/LaunchDaemons/com.apple.SpringBoard.plist"
int main(int argc, const char *argv[]) {
+ platformizeme();
_assert(argc == 1, "usage: sbreload");
CFDictionaryRef plist = CreateMyPropertyListFromFile(SpringBoard_plist);
diff --git a/uicache.xml b/uicache.xml
index 9a34f2b..898d3be 100644
--- a/uicache.xml
+++ b/uicache.xml
@@ -17,5 +17,11 @@
<key>com.apple.vpn.installer_events</key>
<true/>
+
+ <key>platform-application</key>
+ <true/>
+
+ <key>com.apple.private.skip-library-validation</key>
+ <true/>
</dict>
</plist>
diff --git a/uiopen.xml b/uiopen.xml
index 5fa1d07..4584f24 100644
--- a/uiopen.xml
+++ b/uiopen.xml
@@ -3,5 +3,9 @@
<dict>
<key>com.apple.springboard.opensensitiveurl</key>
<true/>
+ <key>platform-application</key>
+ <true/>
+ <key>com.apple.private.skip-library-validation</key>
+ <true/>
</dict>
</plist>