我的调整遇到问题。就是行不通! 我只想在按下电源按钮以替换电源菜单时打印警报。
我的Makefile:
ARCHS = armv7 arm64
THEOS_DEVICE_IP = 192.168.1.42
include $(THEOS)/makefiles/common.mk
TWEAK_NAME = PowerMenu
PowerMenu_FILES = Tweak.xm
RespringX_FRAMEWORKS = UIKit
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
install.exec "killall -9 SpringBoard"
我的Tweak.xm:
%hook SBPowerDownController
-(void)orderFront{
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"PowerMenuBlock"
message:@"PowerMenu is deactivated. Go to settings app to deactivate it."
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {}];
[alert addAction:defaultAction];
[self presentViewController:alert animated:YES completion:nil];
}
%end
我尝试了不同的%hook或函数,并且尝试了许多不同的代码,但是在我的设备上没有任何作用。但是我没有任何编译器错误。 感谢您的回答。