theos

1.makefile介绍

http://blog.csdn.net/haoel/article/details/2886/

2.theos的使用

* a.    安装签名工具
        brew install ldid

* b.    配置环境变量
        vim ~/.bash_profile
        export THEOS=~/theos
        export PATH=$THEOS/bin:$PATH

* c.    下载theos
        git clone --recursive https://github.com/theos/theos.git ~/theos

* d.    新建项目
        nic.pl

* e.    安装过程中遇到的问题

3.说明

  • 环境变量各个路径用:分割
  • 环境变量类似oc中的#define
  • 递归clone,会clone所有文件(包括引用) git clone --recursive [githup项目地址] [要存放的文件夹路径]
  • 如果环境变量添加完没有生效。需要执行source .bash_profile,让文件立即生效

4.创建项目 (几个命令可以一起 eg:make && make package && make install如果一个命令执行失败就不往下执行了)也可以写一个*.sh脚本。每次执行命令

  • nic.pl
  • 选择iphone/tweak 11
  • 项目包名,随便写个
  • 作者
  • 要hook的项目Bundle filter eg:(com.gemd.iting)
  • 桌面的项目Makefile中配置环境变量(也可以在.bash_profile中声明环境变量就不用每次在该文件下声明了)
    export THEOS_DEVICE_IP=[(手机ip)或127.0.0.1(如果用了usb)]
    export THEOS_DEVICE_PORT=[22或(映射的端口eg10010)]
  • Tweak.xmwen写代码
  • 进入到项目 在终端执行make ,编译 (make clean 删除之前编译的文件)(make package其实已经包含了make的操作,可以不要这一步)
  • make package打包 make package debug=0发布release版本
  • make install将插件安装到手机上 (安装的位置Device/Library/MobileSubstrate/DynamicLibraries

5. 桌面也是一个app (SpringBoard.app)

otool -l SpringBoard | grep crypt如果没任何打印,也说明没加密

6.配置环境变量无效问题

http://blog.csdn.net/hlllmr1314/article/details/52228672

7. 打包deb过车个闹钟功能遇到的问题

错误1:
  • 在make package 中可能遇到以下错误
   Can't locate IO/Compress/Lzma.pm in @INC (you may need to install the
  IO::Compress::Lzma module) (@INC contains: /Library/Perl/5.18/darwin-
  thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-
  thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2
  /System/Library/Perl/5.18/darwin-thread-multi-2level
  /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-
  multi-2level /System/Library/Perl/Extras/5.18 .) at
  /Users/mj/theos/bin/dm.pl line 12.
  BEGIN failed--compilation aborted at /Users/mj/theos/bin/dm.pl line 12.
  make: *** [internal-package] Error 2                 
  • 上面的错误是因为打包压缩方式有问题,改成gzip压缩就行
    • 修改dm.pl文件,用#号注释掉下面两句
    $ vim $THEOS/vendor/dm.pl/dm.pl
    #use IO::Compress::Lzma;
    #use IO::Compress::Xz;
    
    • 修改deb.mk文件第6行的压缩方式为gzip
    $ vim $THEOS/makefiles/package/deb.mk
    _THEOS_PLATFORM_DPKG_DEB_COMPRESSION ?= gzip
    
    
错误2:
Making stage for application jailbreak...
/Applications/Xcode.app/Contents/Developer/usr/bin/make package requires you to have a layout/ directory in the project root, containing the basic package structure, or a control file in the project root describing the package.
make: *** [internal-package] Error 1

解决方法:出现这个错误的原因是因为你的项目所在路径存在空格,只要放到没有空格的路径下即可解决

错误3:
/Applications/Xcode.app/Contents/Developer/usr/bin/make package requires dpkg-deb.
make: *** [internal-package-check] Error 1

解决方法:到https://github.com/DHowett/dm.pl/blob/master/dm.pl下载dm.pl文件,请勿直接复制网页上内容来保存,下载后并改名为dpkg-deb,放到到/opt/theos/bin目录,并修改权限sudo chmod +x /opt/theos/bin/dpkg-deb,即可解决

错误4:
make: *** [internal-package] Error 255

解决方法:这个错误最诡异,没半点错误提示,这边告诉大家为什么会出现这个错误,原因就在于我们创建项目的时候在设置Project Name(包括工程名和包名)的时候使用了大写字母或者特殊字符(下划线等)就会出现这个错误,工程名和包名只能使用小写字母,这个问题即可解决

你可能感兴趣的:(theos)