├── .gitignore
├── Makefile
├── README.md
├── ent.plist
├── layout
└── DEBIAN
│ ├── control
│ └── postinst
├── main.m
└── packages
├── com.rockqj.networkfixer_1.0.0-1_iphoneos-arm.deb
└── com.rockqj.networkfixer_1.0.0-2_iphoneos-arm.deb
/.gitignore:
--------------------------------------------------------------------------------
1 | .theos/
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | export TARGET=iphone:clang::13
2 | export ARCHS=arm64
3 | export DEBUG=0
4 |
5 | include $(THEOS)/makefiles/common.mk
6 |
7 | TOOL_NAME = networkfixer
8 |
9 | $(TOOL_NAME)_FILES = main.m
10 | $(TOOL_NAME)_CFLAGS = -fobjc-arc
11 | $(TOOL_NAME)_CODESIGN_FLAGS = -Sent.plist
12 |
13 | include $(THEOS_MAKE_PATH)/tool.mk
14 |
15 | after-install::
16 | install.exec "/usr/bin/networkfixer"
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Network Fixer
2 |
3 | The tool will enable network access for checkra1n and cydia in iOS 13.
4 |
5 | ## Background
6 |
7 | * Due to regional regulations, Chinese iPhones may suffer from offline of checkra1n loader and cydia app.
8 |
9 | * The idea came from @laoyur. The detail can be found at: https://github.com/pwn20wndstuff/Undecimus/issues/136
10 |
11 | * In iOS 13, the related APIs were moved from `Preferences.framework` to `SettingsCellular.framework`.
12 |
13 | ## Supported (Verified)
14 |
15 | * iPhone 7 + iOS 13.1.3
16 |
17 | ## How to Use
18 |
19 | ```bash
20 | dpkg -i com.rockqj.networkfixer_x.x.x-x_iphoneos-arm.deb
21 | ```
22 |
23 | You can find latest deb file in `packages` or you may want build it on your own.
24 |
--------------------------------------------------------------------------------
/ent.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.CommCenter.fine-grained
6 |
7 | cellular-plan
8 | data-usage
9 | data-allowed-write
10 | preferences-write
11 |
12 | platform-application
13 |
14 |
15 |
--------------------------------------------------------------------------------
/layout/DEBIAN/control:
--------------------------------------------------------------------------------
1 | Package: com.rockqj.networkfixer
2 | Name: networkfixer
3 | Version: 1.0.0
4 | Architecture: iphoneos-arm
5 | Description: Enable network access of cydia and checkra1n
6 | Maintainer: rockqj
7 | Author: rockqj
8 | Section: System
9 | Tag: role::hacker
10 |
--------------------------------------------------------------------------------
/layout/DEBIAN/postinst:
--------------------------------------------------------------------------------
1 | /usr/bin/networkfixer
--------------------------------------------------------------------------------
/main.m:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | int main(int argc, char *argv[], char *envp[]) {
5 | // iOS 13
6 | NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/SettingsCellular.framework"];
7 | if (![bundle load]) {
8 | // iOS 12
9 | bundle = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/Preferences.framework"];
10 | if (![bundle load]) {
11 | printf("Load framework failed.\n");
12 | return -1;
13 | }
14 | }
15 |
16 | Class PSAppDataUsagePolicyCacheClass = NSClassFromString(@"PSAppDataUsagePolicyCache");
17 | id cacheInstance = [PSAppDataUsagePolicyCacheClass valueForKey:@"sharedInstance"];
18 | if (!cacheInstance) {
19 | printf("Instance not found.\n");
20 | return -1;
21 | }
22 |
23 | BOOL result = ((BOOL (*)(id, SEL, NSString *, BOOL, BOOL))objc_msgSend)(
24 | cacheInstance, NSSelectorFromString(@"setUsagePoliciesForBundle:cellular:wifi:"), @"com.saurik.Cydia", true, true);
25 | if (!result) {
26 | printf("Fail to enable network for cydia.\n");
27 | } else {
28 | printf("Enable network for cydia successfully.\n");
29 | }
30 |
31 | result = ((BOOL (*)(id, SEL, NSString *, BOOL, BOOL))objc_msgSend)(
32 | cacheInstance, NSSelectorFromString(@"setUsagePoliciesForBundle:cellular:wifi:"), @"kjc.loader", true, true);
33 | if (!result) {
34 | printf("Fail to enable network for checkra1n.\n");
35 | } else {
36 | printf("Enable network for checkra1n successfully.\n");
37 | }
38 |
39 | return 0;
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/packages/com.rockqj.networkfixer_1.0.0-1_iphoneos-arm.deb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rockqj/networkfixer/dcb9d91f5090c12c73fd8509660091924d461879/packages/com.rockqj.networkfixer_1.0.0-1_iphoneos-arm.deb
--------------------------------------------------------------------------------
/packages/com.rockqj.networkfixer_1.0.0-2_iphoneos-arm.deb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rockqj/networkfixer/dcb9d91f5090c12c73fd8509660091924d461879/packages/com.rockqj.networkfixer_1.0.0-2_iphoneos-arm.deb
--------------------------------------------------------------------------------