【问题标题】:Theos/Logos hook set of ivar/propertyTheos/Logos 钩子集 ivar/property
【发布时间】:2012-05-20 15:56:01
【问题描述】:

我正在尝试使用徽标挂钩CLLocationManager's 委托属性的设置。我当前的代码如下所示:

%hook CLLocationManager
-(void)startUpdatingLocation
{
    %orig;

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"test"
        message:@"hello!"
        delegate:nil
        cancelButtonTitle:@"Bye"
        otherButtonTitles:nil];
    [alert show];
    [alert release];
}
%end

我想覆盖委托属性的设置,这样我就可以创建一个代理类来过滤发送到应用程序的位置。有没有什么漂亮的方法可以使用徽标来做到这一点?

谢谢!

【问题讨论】:

    标签: ios jailbreak


    【解决方案1】:

    是的。将属性设置器视为常规方法,您可以这样做:

    %hook CLLocationManager
    - (void) setDelegate:(id<CLLocationManagerDelegate>)delegate {
        // set up your proxy / whatever you're looking to do
    
        %orig;
    }
    %end
    

    【讨论】:

      猜你喜欢
      • 2015-05-16
      • 1970-01-01
      • 2015-03-18
      • 2011-07-18
      • 1970-01-01
      • 2012-03-22
      • 1970-01-01
      • 2013-07-04
      • 2013-04-14
      相关资源
      最近更新 更多