From 8e258c5dea354c1f835ccb43a7e4fd86e38dfb16 Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Thu, 25 Dec 2025 21:27:55 +0700 Subject: [PATCH] Initial commit --- .gitignore | 3 + Makefile | 15 ++++ README.md | 13 +++ SignedPDI.h | 244 +++++++++++++++++++++++++++++++++++++++++++++++++++ Tweak.x | 68 ++++++++++++++ control | 9 ++ filter.plist | 7 ++ 7 files changed, 359 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100644 SignedPDI.h create mode 100644 Tweak.x create mode 100644 control create mode 100644 filter.plist diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..faf8687 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.theos/ +packages/ +.DS_Store diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..02cb9fa --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..ec9c36b --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# aintuitweaks +Tweaks for "AI" devices. It is mostly not for you and is unnecessary on a prod. AI here does not mean Artificial/Apple Intelligence. + +Requires [my Dopamine fork](https://github.com/khanhduytran0/Dopamine/tree/2.x-ai) to inject tweak into system processes. + +## Fixing DeveloperDiskImage mount issues +"AI" devices has an unusual 00/01 value causing TSS to refuse signing. This tweak bypasses local checks to allow mounting DDI without personalized signature. + +## 🚧 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. diff --git a/SignedPDI.h b/SignedPDI.h new file mode 100644 index 0000000..f38cf56 --- /dev/null +++ b/SignedPDI.h @@ -0,0 +1,244 @@ +unsigned char SignedPDI_im4m[] = { + 0x30, 0x82, 0x0b, 0x41, 0x16, 0x04, 0x49, 0x4d, 0x34, 0x4d, 0x02, 0x01, + 0x00, 0x31, 0x82, 0x02, 0x5d, 0xff, 0x84, 0xea, 0x85, 0x9c, 0x42, 0x82, + 0x02, 0x54, 0x30, 0x82, 0x02, 0x50, 0x16, 0x04, 0x4d, 0x41, 0x4e, 0x42, + 0x31, 0x82, 0x02, 0x46, 0xff, 0x84, 0xea, 0x85, 0x9c, 0x50, 0x82, 0x01, + 0x06, 0x30, 0x82, 0x01, 0x02, 0x16, 0x04, 0x4d, 0x41, 0x4e, 0x50, 0x31, + 0x81, 0xf9, 0xff, 0x84, 0x92, 0xb9, 0x86, 0x48, 0x11, 0x30, 0x0f, 0x16, + 0x04, 0x42, 0x4e, 0x43, 0x48, 0x04, 0x07, 0x11, 0x11, 0x11, 0x11, 0x11, + 0x11, 0x11, 0xff, 0x84, 0x92, 0xbd, 0xa4, 0x44, 0x0b, 0x30, 0x09, 0x16, + 0x04, 0x42, 0x4f, 0x52, 0x44, 0x02, 0x01, 0x10, 0xff, 0x84, 0x9a, 0x95, + 0xa0, 0x4f, 0x0b, 0x30, 0x09, 0x16, 0x04, 0x43, 0x45, 0x50, 0x4f, 0x02, + 0x01, 0x01, 0xff, 0x84, 0x9a, 0xa1, 0x92, 0x50, 0x0d, 0x30, 0x0b, 0x16, + 0x04, 0x43, 0x48, 0x49, 0x50, 0x02, 0x03, 0x00, 0x81, 0x12, 0xff, 0x84, + 0x9a, 0xc1, 0xa4, 0x4f, 0x0b, 0x30, 0x09, 0x16, 0x04, 0x43, 0x50, 0x52, + 0x4f, 0x01, 0x01, 0xff, 0xff, 0x84, 0x9a, 0xcd, 0x8a, 0x43, 0x0b, 0x30, + 0x09, 0x16, 0x04, 0x43, 0x53, 0x45, 0x43, 0x01, 0x01, 0xff, 0xff, 0x84, + 0xaa, 0x8d, 0x92, 0x44, 0x10, 0x30, 0x0e, 0x16, 0x04, 0x45, 0x43, 0x49, + 0x44, 0x02, 0x06, 0x0a, 0x1b, 0x01, 0xd4, 0xb1, 0xc7, 0xff, 0x85, 0x9a, + 0x91, 0x9e, 0x4d, 0x0b, 0x30, 0x09, 0x16, 0x04, 0x53, 0x44, 0x4f, 0x4d, + 0x02, 0x01, 0x01, 0xff, 0x87, 0x9b, 0xb9, 0xde, 0x6e, 0x1e, 0x30, 0x1c, + 0x16, 0x04, 0x73, 0x6e, 0x6f, 0x6e, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x87, 0x9b, 0xc9, 0xec, 0x6e, 0x1e, 0x30, + 0x1c, 0x16, 0x04, 0x73, 0x72, 0x76, 0x6e, 0x04, 0x14, 0x7b, 0x16, 0xa6, + 0xd1, 0x22, 0xe4, 0xe0, 0x46, 0xe0, 0xcc, 0x19, 0x45, 0x93, 0x55, 0x31, + 0xba, 0x6d, 0x7a, 0x59, 0x8c, 0xff, 0x87, 0xab, 0xa5, 0xc8, 0x6d, 0x0b, + 0x30, 0x09, 0x16, 0x04, 0x75, 0x69, 0x64, 0x6d, 0x01, 0x01, 0x00, 0xff, + 0x86, 0xe3, 0xd1, 0xe4, 0x73, 0x81, 0x81, 0x30, 0x7f, 0x16, 0x04, 0x6c, + 0x74, 0x72, 0x73, 0x31, 0x77, 0xff, 0x84, 0xa2, 0x9d, 0xa6, 0x54, 0x3a, + 0x30, 0x38, 0x16, 0x04, 0x44, 0x47, 0x53, 0x54, 0x04, 0x30, 0xc9, 0x44, + 0x38, 0x3f, 0x34, 0xf4, 0x0f, 0x85, 0xea, 0x3f, 0xc4, 0x89, 0xe9, 0x02, + 0x6e, 0x20, 0x17, 0x4d, 0xb7, 0x4a, 0xb7, 0x51, 0x1b, 0x7a, 0x10, 0x6b, + 0xd3, 0x4d, 0x0a, 0x58, 0x1d, 0x14, 0x13, 0xe6, 0xa7, 0x2f, 0x78, 0x6c, + 0x7d, 0x2b, 0x0f, 0x68, 0xac, 0x60, 0xd9, 0xd5, 0x5c, 0xa0, 0xff, 0x84, + 0xaa, 0xad, 0x8a, 0x59, 0x0b, 0x30, 0x09, 0x16, 0x04, 0x45, 0x4b, 0x45, + 0x59, 0x01, 0x01, 0xff, 0xff, 0x84, 0xaa, 0xc1, 0xa4, 0x4f, 0x0b, 0x30, + 0x09, 0x16, 0x04, 0x45, 0x50, 0x52, 0x4f, 0x01, 0x01, 0xff, 0xff, 0x84, + 0xaa, 0xcd, 0x8a, 0x43, 0x0b, 0x30, 0x09, 0x16, 0x04, 0x45, 0x53, 0x45, + 0x43, 0x01, 0x01, 0xff, 0xff, 0x87, 0x83, 0x91, 0xda, 0x67, 0x81, 0xa6, + 0x30, 0x81, 0xa3, 0x16, 0x04, 0x70, 0x64, 0x6d, 0x67, 0x31, 0x81, 0x9a, + 0xff, 0x84, 0xa2, 0x9d, 0xa6, 0x54, 0x3a, 0x30, 0x38, 0x16, 0x04, 0x44, + 0x47, 0x53, 0x54, 0x04, 0x30, 0x7c, 0xaa, 0xee, 0x1f, 0x80, 0x82, 0x49, + 0x38, 0xad, 0xbf, 0xf1, 0xe9, 0x1b, 0x83, 0x14, 0x20, 0x52, 0x06, 0xa5, + 0x7d, 0x5f, 0x67, 0xd9, 0xde, 0xaf, 0x3a, 0x22, 0x81, 0xee, 0x0b, 0x3c, + 0x0b, 0xa3, 0x5c, 0x0e, 0x74, 0x9c, 0x0b, 0xde, 0xc0, 0x88, 0x64, 0x5e, + 0xb1, 0xd5, 0x7b, 0xa9, 0x5d, 0xff, 0x84, 0xaa, 0xad, 0x8a, 0x59, 0x0b, + 0x30, 0x09, 0x16, 0x04, 0x45, 0x4b, 0x45, 0x59, 0x01, 0x01, 0xff, 0xff, + 0x84, 0xaa, 0xc1, 0xa4, 0x4f, 0x0b, 0x30, 0x09, 0x16, 0x04, 0x45, 0x50, + 0x52, 0x4f, 0x01, 0x01, 0xff, 0xff, 0x84, 0xaa, 0xcd, 0x8a, 0x43, 0x0b, + 0x30, 0x09, 0x16, 0x04, 0x45, 0x53, 0x45, 0x43, 0x01, 0x01, 0xff, 0xff, + 0x87, 0x83, 0x91, 0xdc, 0x6d, 0x1c, 0x30, 0x1a, 0x16, 0x04, 0x70, 0x64, + 0x6e, 0x6d, 0x04, 0x12, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x72, 0x44, 0x69, 0x73, 0x6b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x04, 0x82, + 0x02, 0x00, 0x65, 0xfa, 0xde, 0x8a, 0xb6, 0x14, 0x47, 0xe2, 0x32, 0xd5, + 0x32, 0xb9, 0x13, 0x69, 0x56, 0x4e, 0x3b, 0xc5, 0x48, 0x2c, 0x58, 0xe3, + 0x80, 0xc0, 0xbd, 0xa0, 0x6a, 0x08, 0xa6, 0xcf, 0x4a, 0x2b, 0xcf, 0x6a, + 0x41, 0x2e, 0xfb, 0x55, 0x07, 0xfc, 0x2b, 0x81, 0x62, 0x19, 0xbc, 0xdf, + 0xbb, 0x37, 0x06, 0xd7, 0x70, 0x70, 0x4f, 0x52, 0x82, 0xb6, 0x99, 0x72, + 0xf4, 0x1d, 0xea, 0x90, 0xdb, 0xd9, 0x59, 0x80, 0x33, 0x76, 0x36, 0xe3, + 0xc0, 0xbd, 0x43, 0xb4, 0x1b, 0x60, 0xd4, 0xf4, 0x6f, 0xca, 0xf2, 0x98, + 0xe9, 0xf9, 0x03, 0xc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 0xa8, 0x41, 0x8a, 0xc9, + 0x4a, 0xda, 0xd7, 0x70, 0xc4, 0x8c, 0x29, 0xcc, 0x7a, 0x10, 0x3b, 0xaa, + 0x67, 0xdd, 0x6a, 0x48, 0xe6, 0xe6, 0x8a, 0x39, 0xc8, 0x35, 0xd6, 0x05, + 0x1c, 0x62, 0x65, 0x9a, 0xdc, 0x19, 0xc7, 0x6f, 0xb9, 0x20, 0x52, 0xb6, + 0x80, 0x61, 0x12, 0x11, 0x55, 0x60, 0xc8, 0x9a, 0xf5, 0x77, 0x4b, 0x16, + 0x2a, 0xa2, 0x83, 0x78, 0x49, 0x0b, 0x08, 0x7e, 0x8c, 0xb6, 0x30, 0x82, + 0x06, 0xcf, 0x30, 0x82, 0x06, 0xcb, 0x30, 0x82, 0x04, 0xb3, 0xa0, 0x03, + 0x02, 0x01, 0x02, 0x02, 0x10, 0x13, 0xf1, 0x88, 0x3c, 0x4f, 0xe2, 0x7c, + 0xac, 0xc7, 0x5a, 0x37, 0x28, 0xe5, 0x0f, 0xc1, 0x55, 0x30, 0x0d, 0x06, + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0c, 0x05, 0x00, + 0x30, 0x4b, 0x31, 0x27, 0x30, 0x25, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, + 0x1e, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x65, 0x20, 0x42, 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x31, 0x13, 0x30, 0x11, 0x06, + 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x0a, 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, + 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x06, 0x13, 0x02, 0x55, 0x53, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x39, 0x31, + 0x30, 0x32, 0x33, 0x31, 0x38, 0x30, 0x36, 0x31, 0x36, 0x5a, 0x17, 0x0d, + 0x33, 0x34, 0x31, 0x32, 0x31, 0x34, 0x32, 0x30, 0x31, 0x33, 0x31, 0x30, + 0x5a, 0x30, 0x5c, 0x31, 0x38, 0x30, 0x36, 0x06, 0x03, 0x55, 0x04, 0x03, + 0x0c, 0x2f, 0x54, 0x38, 0x31, 0x31, 0x32, 0x2d, 0x53, 0x44, 0x4f, 0x4d, + 0x31, 0x2d, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x4b, 0x65, + 0x79, 0x2d, 0x54, 0x73, 0x73, 0x4c, 0x69, 0x76, 0x65, 0x2d, 0x52, 0x65, + 0x76, 0x41, 0x2d, 0x44, 0x61, 0x74, 0x61, 0x43, 0x65, 0x6e, 0x74, 0x65, + 0x72, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x0a, + 0x41, 0x70, 0x70, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x0b, + 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x30, + 0x82, 0x02, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x02, 0x0f, 0x00, 0x30, + 0x82, 0x02, 0x0a, 0x02, 0x82, 0x02, 0x01, 0x00, 0x91, 0xff, 0xe4, 0x76, + 0x72, 0x5e, 0xba, 0x17, 0xa8, 0xe0, 0x93, 0xfb, 0x66, 0x10, 0x4b, 0xc3, + 0x29, 0xaf, 0x73, 0xaf, 0x0d, 0x57, 0xbb, 0x63, 0x22, 0xe5, 0xb0, 0x13, + 0xb6, 0x8b, 0xbe, 0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0xd0, 0x71, 0x76, 0x28, 0x66, 0xbb, 0x0c, 0xde, + 0x57, 0x52, 0x4c, 0x86, 0x17, 0xeb, 0xf4, 0xc7, 0x83, 0x16, 0x8b, 0xd0, + 0x37, 0x2d, 0xc3, 0x0d, 0xae, 0x19, 0x8b, 0x57, 0x0b, 0x80, 0x70, 0x56, + 0x19, 0x63, 0xe3, 0x95, 0x9d, 0x3f, 0xf5, 0x60, 0x36, 0x5e, 0xff, 0xbc, + 0xd3, 0x9b, 0x03, 0x59, 0xdc, 0x27, 0x70, 0x15, 0x84, 0xc0, 0x2d, 0xb3, + 0xb9, 0x0e, 0x37, 0x9b, 0x7d, 0x56, 0x7d, 0x38, 0x0a, 0x58, 0x0f, 0xda, + 0x37, 0xf6, 0x04, 0x1c, 0xfc, 0x14, 0x87, 0x8d, 0x68, 0x60, 0xef, 0x55, + 0xf6, 0x4b, 0x57, 0xdb, 0xd3, 0x8b, 0xde, 0x29, 0x32, 0x51, 0x18, 0x1d, + 0xb9, 0xc4, 0x41, 0xc6, 0x34, 0x04, 0xe0, 0xbd, 0x13, 0x89, 0xb2, 0x1f, + 0xc2, 0xa1, 0x4e, 0x8f, 0x8a, 0x21, 0xb5, 0xe3, 0xa7, 0x5c, 0x91, 0xb9, + 0x3a, 0xd3, 0xe5, 0x6d, 0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x82, 0x01, + 0x98, 0x30, 0x82, 0x01, 0x94, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, + 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1f, 0x06, 0x03, 0x55, + 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x68, 0xe9, 0x59, 0x50, + 0x45, 0xf1, 0x5d, 0x07, 0xf9, 0x3f, 0xc4, 0x26, 0xfc, 0x1c, 0x27, 0x62, + 0x7d, 0x9e, 0x13, 0x94, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, + 0x16, 0x04, 0x14, 0x27, 0x67, 0x10, 0x1b, 0x4b, 0x21, 0x56, 0xce, 0xa1, + 0x72, 0x3f, 0xba, 0x5a, 0x1f, 0xd4, 0x5b, 0x99, 0xf0, 0x37, 0x9c, 0x30, + 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, + 0x02, 0x07, 0x80, 0x30, 0x82, 0x01, 0x32, 0x06, 0x0a, 0x2a, 0x86, 0x48, + 0x86, 0xf7, 0x63, 0x64, 0x06, 0x01, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x82, + 0x01, 0x1f, 0x31, 0x82, 0x01, 0x1b, 0xff, 0x84, 0xea, 0x85, 0x9c, 0x50, + 0x81, 0xb6, 0x30, 0x81, 0xb3, 0x16, 0x04, 0x4d, 0x41, 0x4e, 0x50, 0x31, + 0x81, 0xaa, 0xff, 0x84, 0x92, 0xb9, 0x86, 0x48, 0x0c, 0x30, 0x0a, 0x16, + 0x04, 0x42, 0x4e, 0x43, 0x48, 0xa0, 0x02, 0x05, 0x00, 0xff, 0x84, 0x92, + 0xbd, 0xa4, 0x44, 0x0c, 0x30, 0x0a, 0x16, 0x04, 0x42, 0x4f, 0x52, 0x44, + 0xa0, 0x02, 0x05, 0x00, 0xff, 0x84, 0x9a, 0x95, 0xa0, 0x4f, 0x0b, 0x30, + 0x09, 0x16, 0x04, 0x43, 0x45, 0x50, 0x4f, 0x02, 0x01, 0x01, 0xff, 0x84, + 0x9a, 0xa1, 0x92, 0x50, 0x0d, 0x30, 0x0b, 0x16, 0x04, 0x43, 0x48, 0x49, + 0x50, 0x02, 0x03, 0x00, 0x81, 0x12, 0xff, 0x84, 0x9a, 0xc1, 0xa4, 0x4f, + 0x0c, 0x30, 0x0a, 0x16, 0x04, 0x43, 0x50, 0x52, 0x4f, 0xa0, 0x02, 0x05, + 0x00, 0xff, 0x84, 0x9a, 0xcd, 0x8a, 0x43, 0x0c, 0x30, 0x0a, 0x16, 0x04, + 0x43, 0x53, 0x45, 0x43, 0xa0, 0x02, 0x05, 0x00, 0xff, 0x84, 0xaa, 0x8d, + 0x92, 0x44, 0x0c, 0x30, 0x0a, 0x16, 0x04, 0x45, 0x43, 0x49, 0x44, 0xa0, + 0x02, 0x05, 0x00, 0xff, 0x85, 0x9a, 0x91, 0x9e, 0x4d, 0x0b, 0x30, 0x09, + 0x16, 0x04, 0x53, 0x44, 0x4f, 0x4d, 0x02, 0x01, 0x01, 0xff, 0x87, 0x9b, + 0xb9, 0xde, 0x6e, 0x0c, 0x30, 0x0a, 0x16, 0x04, 0x73, 0x6e, 0x6f, 0x6e, + 0xa0, 0x02, 0x05, 0x00, 0xff, 0x84, 0xfa, 0x89, 0x94, 0x50, 0x56, 0x30, + 0x54, 0x16, 0x04, 0x4f, 0x42, 0x4a, 0x50, 0x31, 0x4c, 0xff, 0x84, 0xa2, + 0x9d, 0xa6, 0x54, 0x0c, 0x30, 0x0a, 0x16, 0x04, 0x44, 0x47, 0x53, 0x54, + 0xa0, 0x02, 0x05, 0x00, 0xff, 0x84, 0xaa, 0xad, 0x8a, 0x59, 0x0c, 0x30, + 0x0a, 0x16, 0x04, 0x45, 0x4b, 0x45, 0x59, 0xa0, 0x02, 0x05, 0x00, 0xff, + 0x84, 0xaa, 0xc1, 0xa4, 0x4f, 0x0c, 0x30, 0x0a, 0x16, 0x04, 0x45, 0x50, + 0x52, 0x4f, 0xa0, 0x02, 0x05, 0x00, 0xff, 0x84, 0xaa, 0xcd, 0x8a, 0x43, + 0x0c, 0x30, 0x0a, 0x16, 0x04, 0x45, 0x53, 0x45, 0x43, 0xa0, 0x02, 0x05, + 0x00, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, + 0x01, 0x0c, 0x05, 0x00, 0x03, 0x82, 0x02, 0x01, 0x00, 0xc8, 0x7f, 0x5c, + 0x3d, 0x38, 0xde, 0xaf, 0x03,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xb3, 0xac, + 0x19, 0xed, 0x90, 0xc6, 0x47, 0x62, 0x9d, 0x0d, 0x21, 0x5b, 0xf9, 0xef, + 0x6c, 0xc9, 0xbb, 0x63, 0x10, 0xea, 0xc1, 0xd3, 0x59, 0x3b, 0xa1, 0xd6, + 0xf5, 0xbe, 0x31, 0x2a, 0x93, 0xba, 0x2d, 0x7b, 0xf0, 0x61, 0xc7, 0x4b, + 0x04, 0x5a, 0xd6, 0x5e, 0xa3, 0xff, 0xd8, 0x2f, 0xfc, 0x95, 0xcf, 0x1d, + 0x2d, 0x9f, 0x58, 0xcd, 0x3e, 0x3f, 0xf1, 0x26, 0xc7, 0xb5, 0xf1, 0xfe, + 0xee, 0x74, 0xf0, 0x43, 0x3a, 0xcb, 0x05, 0x39, 0xeb, 0x90, 0x62, 0xb0, + 0x30, 0x53, 0xff, 0x29, 0x2c, 0xa5, 0xbb, 0x53, 0xa2, 0xb1, 0x93, 0x31, + 0x69, 0x16, 0xc0, 0x89, 0x24, 0xd2, 0x7b, 0xdf, 0xaf, 0x6e, 0xb7, 0x53, + 0x01, 0x32, 0x97, 0x3e, 0xd5, 0xbc, 0x1f, 0xdc, 0x4f, 0xc0, 0x72, 0x69, + 0x0f, 0x90, 0x1b, 0x78, 0x83, 0xa6, 0xb0, 0x4f, 0xd9, 0xa5, 0x5c, 0x2a, + 0x66, 0x8c, 0xf3, 0xa9, 0xe2, 0xba, 0x50, 0xd2, 0x45, 0xc3, 0x55, 0x55, + 0x36, 0x8d, 0x7f, 0x4d, 0x3b +}; +unsigned int SignedPDI_im4m_len = 2885; diff --git a/Tweak.x b/Tweak.x new file mode 100644 index 0000000..3cf11b3 --- /dev/null +++ b/Tweak.x @@ -0,0 +1,68 @@ +@import Darwin; +@import Foundation; +#import +#import "SignedPDI.h" + +struct _img4_nonce_domain { + uint64_t cryptex1, index; +}; +typedef struct _img4_nonce_domain img4_nonce_domain_t; +typedef uint16_t img4_struct_version_t; + +extern const struct _img4_nonce_domain _img4_nonce_domain_ddi; +#define IMG4_NONCE_DOMAIN_DDI (&_img4_nonce_domain_ddi) + +#define IMG4_NONCE_VERSION ((img4_struct_version_t)0) +#define IMG4_NONCE_MAX_LENGTH (48) +typedef struct _img4_nonce { + img4_struct_version_t i4n_version; + const uint8_t i4n_nonce[IMG4_NONCE_MAX_LENGTH]; + uint32_t i4n_length; +} img4_nonce_t; + +const char *container_system_group_path_for_identifier(int, const char *group, void *error); +errno_t img4_nonce_domain_copy_nonce(const img4_nonce_domain_t *nd, img4_nonce_t *n); +int img4_firmware_execute(void* fw, const void *chip, const void *nonce); + +%hookf(errno_t, img4_nonce_domain_copy_nonce, const img4_nonce_domain_t *nd, img4_nonce_t *n) { + if (nd != IMG4_NONCE_DOMAIN_DDI) { + return %orig(nd, n); + } + n->i4n_version = IMG4_NONCE_VERSION; + const char *fakeNonce = "\xAA"; + memcpy((char *)n->i4n_nonce, fakeNonce, IMG4_NONCE_MAX_LENGTH); + n->i4n_length = strlen(fakeNonce); + + // Create our fake im4m + const char *groupPath = container_system_group_path_for_identifier(0, "systemgroup.com.apple.mobilestorageproxy", NULL); + assert(groupPath != NULL); + + NSError *error = nil; + NSString *im4mPath = [NSString stringWithFormat:@"%s/backingStore/DeveloperDiskImage/AA.im4m", groupPath]; + [NSFileManager.defaultManager createDirectoryAtPath:im4mPath.stringByDeletingLastPathComponent withIntermediateDirectories:YES attributes:nil error:&error]; + if (error) { + NSLog(@"Failed to create directory: %@", error.localizedDescription); + return 1; + } + + NSData *im4mData = [NSData dataWithBytes:SignedPDI_im4m length:SignedPDI_im4m_len]; + [im4mData writeToFile:im4mPath atomically:YES]; + return 0; +} + +// Bypass im4m check +BOOL gCalledImg4Execute = NO; +%hookf(void, img4_firmware_execute, void* fw, const void *chip, const void *nonce) { + gCalledImg4Execute = YES; + // Do nothing +} + +// Bypass another check +%hookf(kern_return_t, IOConnectCallMethod, io_connect_t client, uint32_t selector, const uint64_t *in, uint32_t inCnt, const void *inStruct, size_t inStructCnt, uint64_t *out, uint32_t *outCnt, void *outStruct, size_t *outStructCnt) { + kern_return_t ret = %orig(client, selector, in, inCnt, inStruct, inStructCnt, out, outCnt, outStruct, outStructCnt); + if (ret == kIOReturnNotPermitted && gCalledImg4Execute) { + gCalledImg4Execute = NO; + return kIOReturnSuccess; + } + return ret; +} diff --git a/control b/control new file mode 100644 index 0000000..13b187a --- /dev/null +++ b/control @@ -0,0 +1,9 @@ +Package: com.kdt.aintuitweak +Name: aintuitweaks +Version: 0.0.1 +Architecture: iphoneos-arm +Description: An awesome MobileSubstrate tweak! +Maintainer: khanhduytran0 +Author: khanhduytran0 +Section: Tweaks +Depends: mobilesubstrate (>= 0.9.5000) diff --git a/filter.plist b/filter.plist new file mode 100644 index 0000000..b4e55d3 --- /dev/null +++ b/filter.plist @@ -0,0 +1,7 @@ +{ + Filter = { + Executables = ( + MobileStorageMounter, + ); + }; +} \ No newline at end of file