From 333fb40d2d52c32959badba1fa855c1c831f058a Mon Sep 17 00:00:00 2001 From: Sam Bingner Date: Thu, 4 Oct 2018 16:00:06 -1000 Subject: Add entitlements and calls necessary for jbd/kppless --- extrainst_.xml | 4 ++++ ldrestart.cpp | 21 +++++++++++++++++++++ sbreload.c | 22 ++++++++++++++++++++++ uicache.xml | 6 ++++++ uiopen.xml | 4 ++++ 5 files changed, 57 insertions(+) diff --git a/extrainst_.xml b/extrainst_.xml index 0829339..b5d56f1 100644 --- a/extrainst_.xml +++ b/extrainst_.xml @@ -6,5 +6,9 @@ RebuildMaps + platform-application + + com.apple.private.skip-library-validation + diff --git a/ldrestart.cpp b/ldrestart.cpp index 04f7a8b..a6d6cb6 100644 --- a/ldrestart.cpp +++ b/ldrestart.cpp @@ -30,6 +30,26 @@ #include #include +/* Set platform binary flag */ +#define FLAG_PLATFORMIZE (1 << 1) +#include + +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 +/* Set platform binary flag */ +#define FLAG_PLATFORMIZE (1 << 1) +#include + +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 @@ com.apple.vpn.installer_events + + platform-application + + + com.apple.private.skip-library-validation + diff --git a/uiopen.xml b/uiopen.xml index 5fa1d07..4584f24 100644 --- a/uiopen.xml +++ b/uiopen.xml @@ -3,5 +3,9 @@ com.apple.springboard.opensensitiveurl + platform-application + + com.apple.private.skip-library-validation + -- cgit v1.2.3