iOS7.1.2的ipad用theos hook FiftyThree的Paper失败

Paper版本2.0.2 ,可以用Cycript调试,但是写的测试Tweak一直不起作用,alert都没有弹出。
MakeFile文件

THEOS_DEVICE_IP = 172.16.32.171

include theos/makefiles/common.mk

ARCHS = armv7s
TARGET = iphone:7.1:4.3
TWEAK_NAME = PaperUnlockToolsTweak
PaperUnlockToolsTweak_FILES = Tweak.xm
PaperUnlockToolsTweak_FRAMEWORKS = Foundation UIKit

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
	install.exec "killall -9 Paper"

xm文件

#import <UIKit/UIKit.h>

%hook PaperViewController

- (BOOL)isTrayVisible
{
	BOOL test = %orig;
	if (test) {
		UIAlertView *alert = [UIAlertView alloc] initWithTitle:@"Test" message:@"isTrayVisible:YES" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
		[alert show];
		[alert release];
	}else{
		UIAlertView *alert = [UIAlertView alloc] initWithTitle:@"Test" message:@"isTrayVisible:NO" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
		[alert show];
		[alert release];
	}
	return test;
}

%end

%hook PaperAppDelegate

- (void)applicationDidBecomeActive:(id)application
{
	UIAlertView *alert = [UIAlertView alloc] initWithTitle:@"Test" message:@"isTrayVisible:NO" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
	[alert show];
	[alert release];
	%orig;
}

%end

make package install都成功了,就是看不到alert效果

加几个NSLog,看看有输出吗?

加了NSLog没有看到输出,但是在看syslog的时候发现了一个应该有用的信息:
Paper[417]: MS:Error: dlopen(/Library/MobileSubstrate/DynamicLibraries/PaperUnlockToolsTweak.dylib, 9):no suitable image found. Did find:
/Library/MobileSubstrate/DynamicLibraries/PaperUnlockToolsTweak.dylib: mach-o, but wrong architecture
是不是我的tweak的makefile里的配置不对?

是64位的ipad吗?

是的:shocked:makefile中改为下面这样还是不行
ARCHS = armv7 arm64
TARGET = iphone:7.1:7.0

改成这样还不行?报什么错?

make package install都没有报错,依然是在syslog报了和之前一样的错误
MS:Error: dlopen(/Library/MobileSubstrate/DynamicLibraries/PaperUnlockToolsTweak.dylib, 9):no suitable image found. Did find:
/Library/MobileSubstrate/DynamicLibraries/PaperUnlockToolsTweak.dylib: mach-o, but wrong architecture

你运行

otool -h /path/to/PaperUnlockToolsTweak.dylib

看看输出什么

/Library/MobileSubstrate/DynamicLibraries/PaperUnlockToolsTweak.dylib:
Mach header
magic cputype cpusubtype caps filetype ncmds sizeofcmds flags
0xfeedface 12 9 0x00 6 19 1844 0x00100085

这显然有问题了,如果有64位的版本,magic应该是0xfeedfacf。你先

make clean

make

试试

➜  paperunlocktoolstweak  make
/Users/shakespeare/Desktop/programe/TheosCode/paperunlocktoolstweak/theos/makefiles/targets/Darwin/iphone.mk:41: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for tweak PaperUnlockToolsTweak...
 Preprocessing Tweak.xm...
 Compiling Tweak.xm...
 Linking tweak PaperUnlockToolsTweak...
 Stripping PaperUnlockToolsTweak...
 Signing PaperUnlockToolsTweak...

这样尝试了几次magic的值结尾还是ce,然后我又改了ARCHS = arm64,效果没有变化:dizzy:
会不会是编译的配置有问题,没有按照ARCHS来进行编译?

你的target设置不对,所以只生成了armv7代码。
你的makefile到底是怎么写的?如果是应该是不会出现这个提示的

include theos/makefiles/common.mk

ARCHS = arm64
TARGET = iphone:7.1:7.0
TWEAK_NAME = PaperUnlockToolsTweak
PaperUnlockToolsTweak_FILES = Tweak.xm
PaperUnlockToolsTweak_FRAMEWORKS = Foundation UIKit

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
	install.exec "killall -9 Paper"

这是最后一次编译时的makefile文件


给放到最顶上去

抱歉,前段时间忙项目了。
我现在把ipad升级为iOS8.1越狱,这个问题自然好了……这两项放在是不是放在最顶上都可以alert出来了。实在是费解,看来很多底层的东西不知道,上层出现的问题没有思路啊。不知道狗剩兄是怎么突破这样的瓶颈,虽然知道要按图索骥,但是就目前的问题都不知道改从哪里入手,还望指点。:3_45:

多搞几个逆向工程的东西就熟悉了

好吧,好事多磨了