# code
/**
1. 修改定位; hook 原生API,直接替换为自己的即可
*/
#import <CaptainHook/CaptainHook.h>
#import "WechatPodForm.h"
#import <UIKit/UIKit.h>
CHDeclareClass(CLLocation);
CHOptimizedMethod0(self, CLLocationCoordinate2D, CLLocation, coordinate){
CLLocationCoordinate2D coordinate = CHSuper(0, CLLocation, coordinate);
if(pluginConfig.location.longitude || pluginConfig.location.latitude ){
coordinate = pluginConfig.location;
}
return coordinate;
}
CHConstructor{
CHLoadLateClass(CLLocation);
CHClassHook(0, CLLocation, coordinate);
}
功能介绍:修改钉钉位置打卡,调用 DingtalkPod 中 -(void)setLocation:(CLLocationCoordinate2D)location即可
code: 主要还是hook原生的
CHConstructor{ CHLoadLateClass(CLLocation); CHClassHook(0, CLLocation, coordinate); }
See Also
- WeChatLocationHook.m
- https://github.com/AloneMonkey/MonkeyDevSpecs#wechatpod
- knpost
/Users/devzkn/bin//knpost Modify_positioning 修改定位 直接hook CLLocation -t tweak #原来""的参数,需要自己加上""
转载请注明:张坤楠的博客 > Modify_positioning
-
Previous
swizzle_Objective-c_instance_and_class_methods -
Next
MBExample_With_action_button_cancelationExample