From 4b8a35576735e083cc5475f5a85c4879f9869443 Mon Sep 17 00:00:00 2001 From: jjolano Date: Wed, 15 May 2019 19:04:23 -0400 Subject: [PATCH] fix dyld array generator and preference bundle --- .DS_Store | Bin 0 -> 6148 bytes .theos/last_package | 2 +- .../ipch/d5766ed4ed372fac/mmap_address.bin | Bin 0 -> 8 bytes Makefile | 2 +- {shadowprefs => ShadowPreferences}/Makefile | 2 +- .../Resources/Info.plist | 2 +- .../Resources/Root.plist | 0 .../SHDWRootListController.h | 0 .../SHDWRootListController.m | 0 .../entry.plist | 0 Tweak.xm | 25 +++++++++--------- 11 files changed, 16 insertions(+), 17 deletions(-) create mode 100644 .DS_Store create mode 100644 .vscode/ipch/d5766ed4ed372fac/mmap_address.bin rename {shadowprefs => ShadowPreferences}/Makefile (90%) rename {shadowprefs => ShadowPreferences}/Resources/Info.plist (95%) rename {shadowprefs => ShadowPreferences}/Resources/Root.plist (100%) rename {shadowprefs => ShadowPreferences}/SHDWRootListController.h (100%) rename {shadowprefs => ShadowPreferences}/SHDWRootListController.m (100%) rename {shadowprefs => ShadowPreferences}/entry.plist (100%) diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..702e6245f5cd94e6a9c63a788316d2e268ceb276 GIT binary patch literal 6148 zcmeHK!A{#i5SfJ7y%HL&@Ike{?7H8)a66lRV9 z#xQ~`EV5}Ong`w@1N81BOd)_PxW;z%{=!6u==&W`lQ_$}-A7SdtFLctO4*dnt>!m> zq6{6eF$&nUY}LR={&Rh+l}EKPJeMj!cGkii5AiaQyI3tRk{MtIUXuYj9~3H~=diSBjt*>034lnykw(y_T7q(vL(gGp5j`lv zrXt!@;Yti)({Wt6IL~2e(WZlN#fNZD7Op}O=IJ=UGT|URi`+5;%)oO7)@-*;_y6(B z_5brE?lA+*z<pZ;hPjF{magKDs77#Hk%8zr TEG^;)3jYWg8n|HwUX_6-k04=z literal 0 HcmV?d00001 diff --git a/.theos/last_package b/.theos/last_package index 1605806..3d31e0c 100644 --- a/.theos/last_package +++ b/.theos/last_package @@ -1 +1 @@ -./packages/me.jjolano.shadow_0.9-9+debug_iphoneos-arm.deb +./packages/me.jjolano.shadow_0.9-13+debug_iphoneos-arm.deb diff --git a/.vscode/ipch/d5766ed4ed372fac/mmap_address.bin b/.vscode/ipch/d5766ed4ed372fac/mmap_address.bin new file mode 100644 index 0000000000000000000000000000000000000000..71307aba69936426bbbcb4dbf2d50dfa1afc5d76 GIT binary patch literal 8 PcmZQzU|?osU|;|M02=@W literal 0 HcmV?d00001 diff --git a/Makefile b/Makefile index a3563da..dd1f52e 100644 --- a/Makefile +++ b/Makefile @@ -11,5 +11,5 @@ include $(THEOS_MAKE_PATH)/tweak.mk after-install:: install.exec "killall -9 SpringBoard" -SUBPROJECTS += shadowprefs +SUBPROJECTS += ShadowPreferences include $(THEOS_MAKE_PATH)/aggregate.mk diff --git a/shadowprefs/Makefile b/ShadowPreferences/Makefile similarity index 90% rename from shadowprefs/Makefile rename to ShadowPreferences/Makefile index d2806eb..89fb7dc 100644 --- a/shadowprefs/Makefile +++ b/ShadowPreferences/Makefile @@ -14,4 +14,4 @@ include $(THEOS_MAKE_PATH)/bundle.mk internal-stage:: $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END) - $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/shadowprefs.plist$(ECHO_END) + $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/ShadowPreferences.plist$(ECHO_END) diff --git a/shadowprefs/Resources/Info.plist b/ShadowPreferences/Resources/Info.plist similarity index 95% rename from shadowprefs/Resources/Info.plist rename to ShadowPreferences/Resources/Info.plist index d507f50..6eb3914 100644 --- a/shadowprefs/Resources/Info.plist +++ b/ShadowPreferences/Resources/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion English CFBundleExecutable - shadowprefs + ShadowPreferences CFBundleIdentifier me.jjolano.shadow CFBundleInfoDictionaryVersion diff --git a/shadowprefs/Resources/Root.plist b/ShadowPreferences/Resources/Root.plist similarity index 100% rename from shadowprefs/Resources/Root.plist rename to ShadowPreferences/Resources/Root.plist diff --git a/shadowprefs/SHDWRootListController.h b/ShadowPreferences/SHDWRootListController.h similarity index 100% rename from shadowprefs/SHDWRootListController.h rename to ShadowPreferences/SHDWRootListController.h diff --git a/shadowprefs/SHDWRootListController.m b/ShadowPreferences/SHDWRootListController.m similarity index 100% rename from shadowprefs/SHDWRootListController.m rename to ShadowPreferences/SHDWRootListController.m diff --git a/shadowprefs/entry.plist b/ShadowPreferences/entry.plist similarity index 100% rename from shadowprefs/entry.plist rename to ShadowPreferences/entry.plist diff --git a/Tweak.xm b/Tweak.xm index 804afc9..da470b4 100644 --- a/Tweak.xm +++ b/Tweak.xm @@ -18,6 +18,7 @@ NSMutableDictionary *jb_map = nil; NSMutableArray *dyld_clean_array = nil; +uint32_t dyld_clean_array_count = 0; uint32_t dyld_orig_count = 0; NSMutableArray *generate_dyld_array(uint32_t count) { @@ -37,7 +38,10 @@ NSMutableArray *generate_dyld_array(uint32_t count) { || [name containsString:@"cycript"] || [name containsString:@"SBInject"] || [name containsString:@"pspawn"] - || [name containsString:@"applist"]) { + || [name containsString:@"applist"] + || [name hasPrefix:@"/Library/Frameworks"] + || [name containsString:@"librocketbootstrap"] + || [name containsString:@"libcolorpicker"]) { // Skip adding this to clean dyld array. continue; } @@ -402,30 +406,25 @@ BOOL is_path_restricted(NSMutableDictionary *map, NSString *path) { %hookf(uint32_t, _dyld_image_count) { uint32_t ret = %orig; - if(ret != dyld_orig_count) { - // Update dyld_clean_array - if(dyld_clean_array) { - [dyld_clean_array removeAllObjects]; - } - - dyld_orig_count = ret; + if(!dyld_clean_array) { dyld_clean_array = generate_dyld_array(ret); + dyld_clean_array_count = [dyld_clean_array count]; #ifdef DEBUG - NSLog(@"[shadow] generated new clean dyld array"); + NSLog(@"[shadow] generated new clean dyld array (%d/%d)", dyld_clean_array_count, ret); #endif } - if(dyld_clean_array && [dyld_clean_array count] > 0) { - return [dyld_clean_array count]; + if(dyld_clean_array_count > 0) { + return dyld_clean_array_count; } return ret; } %hookf(const char *, _dyld_get_image_name, uint32_t image_index) { - if(dyld_clean_array && [dyld_clean_array count] > 0) { - if(image_index >= [dyld_clean_array count]) { + if(dyld_clean_array && dyld_clean_array_count > 0) { + if(image_index >= dyld_clean_array_count) { return NULL; }