├── Tweak.xm ├── ThatWebInspector.plist ├── packages └── com.evilpenguin.thatwebinspector_0.1-1+debug_iphoneos-arm.deb ├── control ├── README.md ├── Makefile ├── .gitignore └── Tweak.mm /Tweak.xm: -------------------------------------------------------------------------------- 1 | Tweak.mm -------------------------------------------------------------------------------- /ThatWebInspector.plist: -------------------------------------------------------------------------------- 1 | { 2 | Filter = { 3 | Executables = ( 4 | "webinspectord", 5 | ); 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /packages/com.evilpenguin.thatwebinspector_0.1-1+debug_iphoneos-arm.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evilpenguin/ThatWebInspector/HEAD/packages/com.evilpenguin.thatwebinspector_0.1-1+debug_iphoneos-arm.deb -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: com.evilpenguin.thatwebinspector 2 | Name: ThatWebInspector 3 | Depends: mobilesubstrate 4 | Version: 0.1 5 | Architecture: iphoneos-arm 6 | Description: ThatWebInspector enables web inspecting 7 | Maintainer: EvilPenguin 8 | Author: EvilPenguin 9 | Section: Tweaks 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ThatWebInspector 2 | - Enabled Web Inspector for all iOS apps. 3 | - No Preferences. Just loads into all apps. 4 | - Please submit PRs! Open to changes. 5 | 6 | # Usage 7 | - Install the tweak with `make package install`. 8 | - Open Safari.app on your Macbook and attach your phone via usb. 9 | - Show Develop menu (`Safari Preferences` -> `Advanced` -> `Show Develop menu in menu bar`). 10 | - Navigate to `Develop` menu and select your phone. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | THEOS_DEVICE_IP = 127.0.0.1 2 | THEOS_DEVICE_PORT = 2222 3 | 4 | include $(THEOS)/makefiles/common.mk 5 | 6 | TARGET := iphone:10.0 7 | ARCHS := armv7 arm64 arm64e 8 | TWEAK_NAME = ThatWebInspector 9 | $(TWEAK_NAME)_FILES = Tweak.xm 10 | $(TWEAK_NAME)_CFLAGS += -DTHEOS_LEAN_AND_MEAN -DDEBUG=1 11 | $(TWEAK_NAME)_FRAMEWORKS = Security 12 | 13 | include $(THEOS_MAKE_PATH)/tweak.mk 14 | 15 | after-install:: 16 | install.exec "killall -9 webinspectord" 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## VSCode 26 | .vscode 27 | 28 | ## Theos 29 | .theos 30 | 31 | # DS Files 32 | .DS_Store 33 | -------------------------------------------------------------------------------- /Tweak.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * ThatWebInspector 3 | * 4 | * Created by EvilPenguin 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #ifdef DEBUG 14 | #define DLog(FORMAT, ...) syslog(LOG_ERR, "+[ThatWebInspector] %s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]); 15 | #else 16 | #define DLog(...) (void)0 17 | #endif 18 | 19 | #pragma mark - Entitlements 20 | 21 | static CFArrayRef _web_entitlements = nil; 22 | static CFArrayRef _needed_entitlements(void) { 23 | static dispatch_once_t onceToken; 24 | static CFArrayRef entitlements = nil; 25 | 26 | dispatch_once (&onceToken, ^{ 27 | CFStringRef values[4] = { 28 | CFSTR("com.apple.security.get-task-allow"), 29 | CFSTR("com.apple.webinspector.allow"), 30 | CFSTR("com.apple.private.webinspector.allow-remote-inspection"), 31 | CFSTR("com.apple.private.webinspector.allow-carrier-remote-inspection") 32 | }; 33 | 34 | entitlements = CFArrayCreate(NULL, (const void **)values, 4, &kCFTypeArrayCallBacks); 35 | }); 36 | 37 | return entitlements; 38 | } 39 | 40 | #pragma mark - SecTaskCopySigningIdentifier 41 | 42 | typedef CFStringRef (_SecTaskCopySigningIdentifierType)(void *task, CFErrorRef _Nullable *error); 43 | static _SecTaskCopySigningIdentifierType *_SecTaskCopySigningIdentifier = nil; 44 | 45 | #pragma mark - SecTaskCopyValueForEntitlement 46 | 47 | static CFTypeRef (*original_SecTaskCopyValueForEntitlement)(void *task, CFStringRef entitlement, CFErrorRef _Nullable *error); 48 | static CFTypeRef replaced_SecTaskCopyValueForEntitlement(void *task, CFStringRef entitlement, CFErrorRef _Nullable *error) { 49 | DLog(@"Signing Identifier: %@", (__bridge NSString *)_SecTaskCopySigningIdentifier(task, NULL)); 50 | DLog(@"Value for entitlement: %@", (__bridge NSString *)entitlement); 51 | 52 | if (CFArrayContainsValue(_web_entitlements, CFRangeMake(0, CFArrayGetCount(_web_entitlements)), entitlement)) { 53 | return kCFBooleanTrue; 54 | } 55 | 56 | return original_SecTaskCopyValueForEntitlement(task, entitlement, error); 57 | } 58 | 59 | #pragma mark - Constructor 60 | 61 | %ctor { 62 | @autoreleasepool { 63 | DLog(@"Running"); 64 | 65 | // Setup globals 66 | _web_entitlements = _needed_entitlements(); 67 | DLog(@"Entitlements size: %li (%p)", CFArrayGetCount(_web_entitlements), _web_entitlements); 68 | 69 | // Load Security 70 | MSImageRef security_handle = MSGetImageByName("/System/Library/Frameworks/Security.framework/Security"); 71 | DLog(@"Security: %p", security_handle); 72 | 73 | if (security_handle) { 74 | // _SecTaskCopySigningIdentifier 75 | _SecTaskCopySigningIdentifier = (_SecTaskCopySigningIdentifierType *)MSFindSymbol(security_handle, "_SecTaskCopySigningIdentifier"); 76 | DLog(@"_SecTaskCopySigningIdentifier: %p", _SecTaskCopySigningIdentifier); 77 | 78 | // _SecTaskCopyValueForEntitlement 79 | void *_SecTaskCopyValueForEntitlement = MSFindSymbol(security_handle, "_SecTaskCopyValueForEntitlement"); 80 | DLog(@"_SecTaskCopyValueForEntitlement: %p", _SecTaskCopyValueForEntitlement); 81 | 82 | if (_SecTaskCopyValueForEntitlement) { 83 | MSHookFunction(_SecTaskCopyValueForEntitlement, (void *)replaced_SecTaskCopyValueForEntitlement, (void **)&original_SecTaskCopyValueForEntitlement); 84 | } 85 | } 86 | } 87 | } 88 | --------------------------------------------------------------------------------