iOS逆向工程thoes报错处理方案总结

http://www.jianshu.com/p/6a872dea187e

打开.xm文件,目前没有发现啥编辑器可以打开,命令行是万能的

open -e /Users/wanggang/Downloads/nixianggongchenggood/iosregreetings/Tweak.xm

.xm文件中输入汉字报错,汉字在xcode中写好黏贴进.xm文件

==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (armv7)…
Tweak.xm:3:24: error: non-ASCII characters are not allowed outside of literals
      and identifiers
      NSString *str = @“看专”;
                       ^
Tweak.xm:3:33: error: non-ASCII characters are not allowed outside of literals
      and identifiers
      NSString *str = @“看专”;
                            ^
Tweak.xm:3:23: error: unexpected '@' in program
      NSString *str = @“看专”;
                      ^

报错:/makefiles/common.mk: No such file or directory
Makefile:11: /tweak.mk: No such file or directory

解决办法:include /opt/theos/makefiles/common.mkinclude /opt/theos/makefiles/tweak.mk,虽说这样写不是很好,但是没有找到其他的方法,其他的按照文档一步步的来,傻瓜式的

THEOS_DEVICE_IP = 192.168.1.100
ARCHS = armv7 arm64
TARGET = iphone:latest:8.0
include /opt/theos/makefiles/common.mk
TWEAK_NAME = iOSREGreetings
iOSREGreetings_FILES = Tweak.xm
iOSREGreetings_FRAMEWORKS = UIKit
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
    install.exec "killall -9 SpringBoard"

报错: Preprocessing Tweak.xm…
Tweak.xm:2: error: Tweak.xm…的问题重新写

==> Preprocessing Tweak.xm…
Tweak.xm:2: error: %end does not make sense inside a block
make[3]: *** [/Users/wanggang/Downloads/nixianggongchenggood/iosregreetings/.theos/obj/debug/armv7/Tweak.xm.07780871.o] Error 22
make[2]: *** [/Users/wanggang/Downloads/nixianggongchenggood/iosregreetings/.theos/obj/debug/armv7/iOSREGreetings.dylib] Error 2
make[1]: *** [internal-library-all_] Error 2
make: *** [iOSREGreetings.all.tweak.variables] Error 2
wanggangdeMacBook-Pro:iosregreetings wanggang$ make package install

报错Error: The vendor/include and/or vendor/lib directories are missing. Please run git submodule update --init --recursive in your Theos directory.* 按照这个文档 https://github.com/theos/theos/wiki/Installation,一步步的配置,重点说说文档这一句add to your ~/.bash_profile or equivalent:export PATH=/usr/local/opt/gnu-sed/bin/:$PATHIn order to use make troubleshoot,需要用命令行打开open ~/.bash_profile

1240

打开和添加示意图

==> Error: The vendor/include and/or vendor/lib directories are missing. 
Please run `git submodule update --init --recursive` in your Theos directory. 
More information: https://github.com/theos/theos/wiki/Installation.

control文件

Package: com.iosre.iosregreetings
Name: iOSREGreetings
Depends: mobilesubstrate
Version: 0.0.1
Architecture: iphoneos-arm
Description: An awesome MobileSubstrate tweak!
Maintainer: snakeninny
Author: snakeninny
Section: Tweaks

makefile文件

THEOS_DEVICE_IP = 192.168.1.100
ARCHS = armv7 arm64
TARGET = iphone:latest:8.0
include /opt/theos/makefiles/common.mk
TWEAK_NAME = iOSREGreetings
iOSREGreetings_FILES = Tweak.xm
iOSREGreetings_FRAMEWORKS = UIKit
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
    install.exec "killall -9 SpringBoard"

tream.xm文件

%hook SBLockScreenDateViewController
- (void)setCustomSubtitleText:(id)arg1 withColor:(id)arg2
{
    NSString *str = @"主人翁健康专注小儿推拿!";
    %orig(str, arg2);
}
%end

%hook SpringBoard
 - (void)applicationDidFinishLaunching:(id)application
    {
        %orig;
        UIAlertView *alert = [[UIAlertView alloc]
                              initWithTitle:@"Come to http://bbs.iosre.com for more fun!" message:nil delegate:self cancelButtonTitle:@"OK"
                              otherButtonTitles:nil];
        [alert show];
        [alert release];
 }
%end

最后编译运行

这么问题解决了展示下最后做的效果

1240

Snip20160702_11.png



作者:wg689
链接:http://www.jianshu.com/p/6a872dea187e
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

转载于:https://my.oschina.net/huqiji/blog/1490537

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值