export THEOS_DEVICE_IP = localhost
export THEOS_DEVICE_PORT = 2222
ARCH = arm64 arm64e
TARGET := iphone:clang:latest:7.0
INSTALL_TARGET_PROCESSES = Demo
THEOS_PACKAGE_SCHEME = rootless
DemoHook_FRAMEWORKS = UIKit Foundation
include $(THEOS)/makefiles/common.mk
TWEAK_NAME = DemoHook
DemoHook_FILES = Tweak.x
DemoHook_CFLAGS = -fobjc-arc
include $(THEOS_MAKE_PATH)/tweak.mk
#import <UIKit/UIKit.h>
%hook ViewController
// Hooking a class method
// + (id)sharedInstance {
// return %orig;
// }
// Hooking an instance method with an argument.
-
(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
NSLog(@“click view”);
%log; // Write a message about this call, including its class, name and arguments, to the system log.// %orig; // Call through to the original function with its original arguments.
// %orig(nil); // Call through to the original function with a custom argument.// If you use %orig(), you MUST supply all arguments (except for self and _cmd, the automatically generated ones.)
} -
%end