comtex
(Yilun)
2015 年12 月 24 日 03:13
1
今天尝试hook CLLocationManager,编写好后,运行没有效果,后多方调研发现plist文件不能写成{Filter = {};} 而是{Filter = {Bundles = {“com.apple.corelocation”,};};}
在编译CocoaHttpServer为libCocoaHttpServer.a时,使用控制台make && make headers报错libxml2/parser.h file not found.。原因是mac没有安装command line tool。 在终端输入"xcode-select --install"安装command line tool之后,问题解决。
我是一个初学者,你是怎么弄的,能不能发个实例代码看看,我怎么弄都不行,想hook CLLocationManager的- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations得到位置,然后弹框显示。
comtex
(Yilun)
2016 年3 月 9 日 12:52
6
1.plist文件:
{
Filter = {
Bundles = (
“com.apple.Security”,
);
};
}
2.makefile文件:
THEOS_DEVICE_IP = 192.168.1.125
ARCHS = armv7 arm64
TARGET = iPhone:latest:8.0
include theos/makefiles/common.mk
TWEAK_NAME = HookLocation
HookLocation_FILES = Tweak.xm
HookLocation_FRAMEWORKS = Foundation UIKit CoreLocation
include $(THEOS_MAKE_PATH)/tweak.mk
3.这是我的TWeak文件,只是一个小demo,证明运行成功了
#import
#import
#import
#import
%hook CLLocationManager
- (id)init
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"程序初始化了CLLocationManager" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alertView show];
[alertView release];
return %orig;
}
%end
用markdown里的
Code
语法把你的代码段包起来,就不会影响了
comtex
(Yilun)
2016 年4 月 2 日 13:17
10