├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── TrackingBlocker.xm └── control /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | .theos 4 | theos/ 5 | obj/ 6 | *.deb 7 | _/ 8 | 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 upbit 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TARGET = iphone::8.4 2 | ARCHS = armv7 armv7s arm64 3 | 4 | include theos/makefiles/common.mk 5 | 6 | THEOS_PACKAGE_DIR=./debs 7 | 8 | TWEAK_NAME = TrackingBlocker 9 | TrackingBlocker_FILES = TrackingBlocker.xm 10 | 11 | include $(THEOS_MAKE_PATH)/tweak.mk 12 | 13 | clean:: 14 | rm -f $(THEOS_PACKAGE_DIR)/*.deb 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | iOS 3rd Tracking Blocker 2 | ======================== 3 | 4 | 第三方SDK反跟踪插件,可以查看或屏蔽第三方SDK的上报。目前支持的SDK: 5 | 6 | 1. [v1.0] MobClick (3.1.9) 7 | 2. [v1.0] MTA (1.4.1) 8 | 3. [v1.1] MTAWXO / MTA4QC(?) 9 | 10 | 编译好的deb下载:[com.zzz.3rdtrackingblocker_1.1_iphoneos-arm.deb](http://blog.imaou.com/uploads/com.zzz.3rdtrackingblocker_1.1_iphoneos-arm.deb) 11 | 12 | ---------- 13 | 14 | 禁用后输出如下: 15 | 16 | ### MobClick (UMeng) 17 | 18 | ~~~ 19 | Umeng: analytics sdk version 3.1.9 , app version 1.1.1001 20 | Umeng: appkey can not be found or not valid. MobClick methods must be called after [MobClick startWithAppkey:]! 21 | ~~~ 22 | 23 | ### MTA (Tencent) 24 | 25 | ~~~ 26 | MTA is not enabled , because of the online config 27 | MTAWXO is not enabled , because of the online config 28 | ~~~ 29 | 30 | ---------- 31 | 32 | 如果有其他SDK需要支持,请提一个issues 33 | -------------------------------------------------------------------------------- /TrackingBlocker.xm: -------------------------------------------------------------------------------- 1 | #import "substrate.h" 2 | 3 | #pragma mark - MobClick Exports 4 | 5 | @interface MobClickApp : NSObject {} 6 | @property(assign, nonatomic) BOOL logEnabled; 7 | @end 8 | 9 | @interface MobClickSession : NSObject {} 10 | +(void)startWithAppkey:(id)appkey reportPolicy:(int)policy channelId:(id)anId; 11 | @end 12 | 13 | #pragma mark - MTA Exports 14 | 15 | @interface MTAConfig : NSObject {} 16 | @property(assign) BOOL statEnable; 17 | @property(assign) BOOL debugEnable; 18 | @end 19 | 20 | @interface MTAWXOConfig : NSObject {} 21 | @property(assign) BOOL statEnable; 22 | @property(assign) BOOL debugEnable; 23 | @end 24 | 25 | @interface MTA4QCConfig : NSObject {} 26 | @property(assign) BOOL statEnable; 27 | @property(assign) BOOL debugEnable; 28 | @end 29 | 30 | #pragma mark - MobClick Hooks 31 | 32 | %group MobClick 33 | 34 | %hook MobClickApp 35 | - (BOOL)logEnabled { return YES; } 36 | %end 37 | 38 | %hook MobClickSession 39 | + (void)startWithAppkey:(id)appkey reportPolicy:(int)policy channelId:(id)anId { %orig((id)@"", policy, anId); } // disable MobClick 40 | %end 41 | 42 | %end // end of MobClick 43 | 44 | 45 | #pragma mark - MTA Hooks 46 | 47 | %group MTA 48 | 49 | %hook MTAConfig 50 | - (BOOL)debugEnable { return YES; } 51 | - (BOOL)statEnable { return NO; } // disable MTA 52 | %end 53 | 54 | %hook MTAWXOConfig 55 | - (BOOL)debugEnable { return YES; } 56 | - (BOOL)statEnable { return NO; } // disable MTAWXO 57 | %end 58 | 59 | %hook MTA4QCConfig 60 | - (BOOL)debugEnable { return YES; } 61 | - (BOOL)statEnable { return NO; } // disable MTAWXO 62 | %end 63 | 64 | %end // end of MTA 65 | 66 | 67 | #pragma mark - %ctor 68 | 69 | %ctor { 70 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 71 | 72 | NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; 73 | if (bundleIdentifier) { 74 | NSLog(@"3rd SDK TrackingBlocker - Loaded"); 75 | 76 | %init(MobClick); 77 | %init(MTA); 78 | 79 | } 80 | 81 | [pool drain]; 82 | } 83 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: com.zzz.3rdtrackingblocker 2 | Name: 3rdTrackingBlocker 3 | Depends: mobilesubstrate 4 | Version: 1.1 5 | Architecture: iphoneos-arm 6 | Description: 3rd SDK Tracking Blocker 7 | Maintainer: upbit 8 | Author: upbit 9 | Section: Tweaks 10 | --------------------------------------------------------------------------------