执行make命令后出错
Making all for tweak TryHookApp…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (arm64)…
Tweak.xm:27:8: error: expected unqualified-id
static IBAction (_logos_orig$_ungrouped$ViewController$clickAction$)(_LOGOS_SELF_TYPE_NORMAL ViewController …
:24:22: note: expanded from here
#define IBAction void)attribute((ibaction)
1 error generated.
make[3]: *** [~/Desktop/hookApp/tryhookapp/.theos/obj/debug/arm64/Tweak.xm.33822de7.o] Error 1
make[2]: *** [~/Desktop/hookApp/tryhookapp/.theos/obj/debug/arm64/TryHookApp.dylib] Error 2
make[1]: *** [internal-library-all_] Error 2
make: *** [TryHookApp.all.tweak.variables] Error 2
#import <UIKit/UIKit.h>
#import “ViewController.h”
#import <substrate.h>
%hook ViewController
- (IBAction)clickButtonAction:(UIButton *)sender
{
%orig;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""
message:@“点一点”
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@“确定”, nil];
[alert show];
[alert release];
}
%end
这是昨天的写法~,报的是上面的错误~~~
自己看书、逛论坛了解一些东西,作了修改
#import <UIKit/UIKit.h>
#import “ViewController.h”
#import <substrate.h>
%hook ViewController
- (void)clickAction:(id)sender
{
%orig;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@“Welcome”
message:@“Welcome to your iPhone!”
delegate:nil
cancelButtonTitle:@“Thanks”
otherButtonTitles:nil];
[alert show];
[alert release];
%log(sender);
}
%end
Makefile
THEOS_DEVICE_IP = 192.168.xxx.xxx
ARCHS = arm64 armv7
export TARGET=iphone:latest:8.0
include $(THEOS)/makefiles/common.mk
TWEAK_NAME = HooKApp
HooKApp_FILES = Tweak.xm
iOSRE_FRAMEWORKS=UIKit
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
install.exec “killall -9 TryHookApp”
Theos
NIC 2.0 - New Instance Creator
[1.] iphone/activator_event
[2.] iphone/application_modern
[3.] iphone/cydget
[4.] iphone/flipswitch_switch
[5.] iphone/framework
[6.] iphone/ios7_notification_center_widget
[7.] iphone/library
[8.] iphone/notification_center_widget
[9.] iphone/preference_bundle_modern
[10.] iphone/tool
[11.] iphone/tweak
[12.] iphone/xpc_service
Choose a Template (required): 11
Project Name (required): HooKApp
Package Name [com.yourcompany.hookapp]: com.tomorrow.HookApp
Author/Maintainer Name [yuchunyou]: tomorrow
[iphone/tweak] MobileSubstrate Bundle filter [com.apple.springboard]: com.tomorrow.TryHookApp
[iphone/tweak] List of applications to terminate upon installation (space-separated, ‘-’ for none) [SpringBoard]: TryHookApp
Instantiating iphone/tweak in hookapp/…
Done.
自己做的demo,
- (IBAction)buttonAction:(UIButton *)sender
{
[self clickAction:sender];
} - (void)clickAction:(id)sender
{
NSLog(@“xxxxxxxxxxxxxxxx点一点xxxxxxxxxxxxxxxx”);
}
代码改成这样了,虽然功能实现了,但初衷改变了,
又出现了这样的错误。
No matching processes were found
make: *** [after-install] Error 1
,谢谢大神,我接着看书,逛论坛