From ddb5c87fce3ddc2b3aaee0ae02a3ea93d440a15b Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Sat, 27 Dec 2025 19:17:40 +0700 Subject: [PATCH] Add EU Marketplace region bypass, split tweaks to separate dylibs --- BypassMarketplace/BypassMarketplace.plist | 7 +++++++ BypassMarketplace/Makefile | 12 ++++++++++++ BypassMarketplace/Tweak.x | 24 +++++++++++++++++++++++ filter.plist => FixDDI/FixDDI.plist | 0 FixDDI/Makefile | 14 +++++++++++++ Tweak.x => FixDDI/Tweak.x | 2 +- Makefile | 12 +++--------- README.md | 4 ++-- layout/DEBIAN/postinst | 3 +++ layout/DEBIAN/postrm | 3 +++ 10 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 BypassMarketplace/BypassMarketplace.plist create mode 100644 BypassMarketplace/Makefile create mode 100644 BypassMarketplace/Tweak.x rename filter.plist => FixDDI/FixDDI.plist (100%) create mode 100644 FixDDI/Makefile rename Tweak.x => FixDDI/Tweak.x (98%) create mode 100755 layout/DEBIAN/postinst create mode 100755 layout/DEBIAN/postrm diff --git a/BypassMarketplace/BypassMarketplace.plist b/BypassMarketplace/BypassMarketplace.plist new file mode 100644 index 0000000..e421078 --- /dev/null +++ b/BypassMarketplace/BypassMarketplace.plist @@ -0,0 +1,7 @@ +{ + Filter = { + Executables = ( + "managedappdistributiond", + ); + }; +} \ No newline at end of file diff --git a/BypassMarketplace/Makefile b/BypassMarketplace/Makefile new file mode 100644 index 0000000..0f0301a --- /dev/null +++ b/BypassMarketplace/Makefile @@ -0,0 +1,12 @@ +TARGET := iphone:clang:latest:15.0 +INSTALL_TARGET_PROCESSES = managedappdistributiond + +include $(THEOS)/makefiles/common.mk + +TWEAK_NAME = BypassMarketplace + +BypassMarketplace_FILES = Tweak.x +BypassMarketplace_CFLAGS = -fobjc-arc +BypassMarketplace_CODESIGN_FLAGS = -Cadhoc -S + +include $(THEOS_MAKE_PATH)/tweak.mk diff --git a/BypassMarketplace/Tweak.x b/BypassMarketplace/Tweak.x new file mode 100644 index 0000000..f089131 --- /dev/null +++ b/BypassMarketplace/Tweak.x @@ -0,0 +1,24 @@ +// "Not bypassing eligibility for com.apple.mobilesafari:personal (isProfileValidated: false isUPPValidated:false isBeta:false" +// Used in managedappdistributiond. Pseudocode of a validate function in OSEligbility.framework: +#if 0 +LSBundleRecord *bundleRecord = ...; +BOOL isProfileValidated = bundleRecord.isProfileValidated; +BOOL isUPPValidated = bundleRecord.isUPPValidated; +BOOL isBeta = bundleRecord.isBeta; +if ( (isProfileValidated == NO) || (isUPPValidated == YES) || (isBeta == YES) ) { + log("Not bypassing eligibility for %s:%s (isProfileValidated: %{bool}d isUPPValidated:%{bool}d isBeta:%{bool}d", bundleRecord.bundleIdentifier.UTF8String, somethingThatSaysPersonal, isProfileValidated, isUPPValidated, isBeta); +} +#endif + +// So we just force the three functions to return values that will bypass eligibility +%hook LSBundleRecord +- (BOOL)isProfileValidated { + return YES; +} +- (BOOL)isUPPValidated { + return NO; +} +- (BOOL)isBeta { + return NO; +} +%end diff --git a/filter.plist b/FixDDI/FixDDI.plist similarity index 100% rename from filter.plist rename to FixDDI/FixDDI.plist diff --git a/FixDDI/Makefile b/FixDDI/Makefile new file mode 100644 index 0000000..af9ab7f --- /dev/null +++ b/FixDDI/Makefile @@ -0,0 +1,14 @@ +TARGET := iphone:clang:latest:15.0 +INSTALL_TARGET_PROCESSES = MobileStorageMounter + +include $(THEOS)/makefiles/common.mk + +TWEAK_NAME = FixDDI + +FixDDI_FILES = Tweak.x +FixDDI_CFLAGS = -fobjc-arc +FixDDI_FRAMEWORKS = IOKit +FixDDI_LIBRARIES = image4 +FixDDI_CODESIGN_FLAGS = -Cadhoc -S + +include $(THEOS_MAKE_PATH)/tweak.mk diff --git a/Tweak.x b/FixDDI/Tweak.x similarity index 98% rename from Tweak.x rename to FixDDI/Tweak.x index 3cf11b3..a9040a8 100644 --- a/Tweak.x +++ b/FixDDI/Tweak.x @@ -33,7 +33,7 @@ int img4_firmware_execute(void* fw, const void *chip, const void *nonce); memcpy((char *)n->i4n_nonce, fakeNonce, IMG4_NONCE_MAX_LENGTH); n->i4n_length = strlen(fakeNonce); - // Create our fake im4m + // Provide our pre-signed im4m const char *groupPath = container_system_group_path_for_identifier(0, "systemgroup.com.apple.mobilestorageproxy", NULL); assert(groupPath != NULL); diff --git a/Makefile b/Makefile index 02cb9fa..b736061 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,9 @@ TARGET := iphone:clang:latest:15.0 -INSTALL_TARGET_PROCESSES = SpringBoard THEOS_PACKAGE_SCHEME := rootless include $(THEOS)/makefiles/common.mk -TWEAK_NAME = aintuitweaks - -aintuitweaks_FILES = Tweak.x -aintuitweaks_CFLAGS = -fobjc-arc -aintuitweaks_FRAMEWORKS = IOKit -aintuitweaks_LIBRARIES = image4 -aintuitweaks_CODESIGN_FLAGS = -Cadhoc -S - include $(THEOS_MAKE_PATH)/tweak.mk +SUBPROJECTS += BypassMarketplace +SUBPROJECTS += FixDDI +include $(THEOS_MAKE_PATH)/aggregate.mk diff --git a/README.md b/README.md index ec9c36b..d4877b1 100644 --- a/README.md +++ b/README.md @@ -9,5 +9,5 @@ Requires [my Dopamine fork](https://github.com/khanhduytran0/Dopamine/tree/2.x-a ## 🚧 Fixing `com.apple.MobileAsset.SystemApp` server Stock apps are provided via an internal server which is inaccessible outside of *the falling fruit*. This tweak will redirect the links to use public server instead. -## 🚧 Bypassing EU/Japan Marketplace checks -The old method of using [eligibility plist](https://github.com/Lrdsnow/EUEnabler) no longer works. This tweak will bypass the checks to allow accessing EU Marketplace apps on "AI" devices. +## Bypassing EU/Japan Marketplace checks +The old method of using [eligibility plist](https://github.com/Lrdsnow/EUEnabler) no longer works. This tweak bypasses the checks to allow accessing EU Marketplace apps on "AI" devices. diff --git a/layout/DEBIAN/postinst b/layout/DEBIAN/postinst new file mode 100755 index 0000000..6393be7 --- /dev/null +++ b/layout/DEBIAN/postinst @@ -0,0 +1,3 @@ +#!/bin/sh +# managedappdistributiond does not honor SIGTERM +killall -KILL managedappdistributiond diff --git a/layout/DEBIAN/postrm b/layout/DEBIAN/postrm new file mode 100755 index 0000000..6393be7 --- /dev/null +++ b/layout/DEBIAN/postrm @@ -0,0 +1,3 @@ +#!/bin/sh +# managedappdistributiond does not honor SIGTERM +killall -KILL managedappdistributiond