关于SBScreenFlash

我想要截屏的时候改变闪屏的颜色。代码如下
Tweak.xm
%hook SBScreenFlash

  • (void)flashColor:(id)arg1 withCompletion:(id)arg2
    {
    %orig;
    [[SBScreenFlash mainScreenFlasher] flashColor:[UIColor magentaColor] withCompletion:nil];
    }
    %end

Makefile
THEOS_DEVICE_IP = iOSIP
ARCHS = armv7 arm64
TARGET = iphone:latest:8.0
include theos/makefiles/common.mk
TWEAK_NAME = ScreenShotColor
ScreenShotColor_FILES = Tweak.xm
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
install.exec “killall -9 SpringBoard”

提示了找不到SBScreenFlash :joy:

解决了,直接修改函数参数
%hook SBScreenFlash

  • (void)flashColor:(id)arg1 withCompletion:(id)arg2
    {
    %orig([UIColor magentaColor],arg1);
    }
    %end
    :joy:
1 个赞