Hook SpringBoard无效,没有Alert弹框。求路过大神指点下小白!!!

环境:6P 9.3.2
我的Tweak.xm的代码如下:
%hook SpringBoard

  • (void)applicationDidFinishLaunching:(id)arg1
    {
    %orig;
    UIAlertView *alertView=[[UIAlertView alloc] initWithTitle:@“提示” message:@“test” delegate:self cancelButtonTitle:@“ok” otherButtonTitles:nil, nil];
    [alertView show];
    [alertView release];
    }
    %end
    网上看到帖子说,要用新的接口,我换成下面这个:
    %hook SBLockScreenManager

  • (void)lockUIFromSource:(NSUInteger)source withOptions:(id)options {
    %orig;

    UIAlertController* alerView = [UIAlertController alertControllerWithTitle:@“Toast” message:@“hahahaha” preferredStyle:UIAlertControllerStyleAlert];
    [self presentViewController:alerView animated:YES completion:nil];
    }

%end
可是依旧没有出现这个弹窗。

你这个两个接口现在来说没什么区别吧,这只是新API和老API的区别,和IOS版本有关系,具体为什么没执行代码还需另外查原因

刚发现我的lib文件目录损坏了,应该是这个导致的,可是一下子也找不到lib

你好,请问你解决了没有 我也是这个问题 。两种方法都没弹框

请问有解决方案吗?我也遇到一样的问题,打包安装都ok,就是没有任何效果

我的问题解决了,解决方案分享给大家,仅供参考
环境:iOS9.2.1
1>确保app安装成功,可以到 “cydia - 已安装” 查看
2>确保filter没有写错
3>在/etc/profile里增加了两行,然后重装你的app
export SDKVERSION=9.3
export ARCHS=armv7 armv7s arm64

1 个赞