IOS逆向伪装定位开发

本文通过编写一个免越狱插件实现伪装定位
1.终端输入nic.pl新建tweak文件
2.在makefile文件中写入
(1) THEOS_DEVICE_IP = 你的ip地址
(2) location_FRAMEWORKS = UIkit CoreLocation
3.在tweak文件下写入

import

%hook CLLocationManager

  • (void)startUpdatingLocation {
    CGFloat lat = 经度;
    CGFloat lng = 纬度;
    CLLocation *location = [[CLLocation alloc] initWithLatitude:lat longitude:lng ];

pragma clang diagnostic push

pragma clang diagnostic ignored "-Wdeprecated-declarations"

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
    [self.delegate locationManager:self didUpdateToLocation:location fromLocation:location];
});

pragma clang diagnostic pop

}
%end
4.在终端输入make编译动态库文件生产xxx.dylib
5.修改xxxx.dylib文件依赖
install_name_tool -change /Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate @loader_path/libsubstrate.dylib xxxx.dylib
6.移动libsubstrate.dylib(越狱手机库)、xxxx.dylib文件到xxx.app中
7.使用optool工具将xxx.dylib注入到二进制文件中
./optool install -c load -p "@executable_path/xxx.dylib" -t /xxx.app/xxx
8.使用App Signer重签名安装即可

你可能感兴趣的:(IOS逆向伪装定位开发)