Theos下载、配置、使用

一、Theos安装

1.1、下载

sudo git clone --recursive https://github.com/theos/theos.git /opt/theosTheos下载到/opt/theos

1.2、配置环境变量

~/.bash_profile中添加 export THEOS=/opt/theos$THEOS/bin/

配置的是$THEOS/bin/,所以就可以在任意地方执行bin里面的nic.pl

二、Theos使用

1、Choose a Template (required): 10 选择 iphone/tweak 所以写10
2、Project Name (required): AliPayPwdDemo 工程名随便写,我这里写AliPayPwdDemo
3、Package Name [com.yourcompany.alipaypwddemo]: com.imefuture.alipaypwddemo 插件的bundleid,随便写,我在写的是com.imefuture.alipaypwddemo,但是不能出现大写字符
4、Author/Maintainer Name [邓亚洲]: dyz 作者的名称,我写的是dyz
5、[iphone/tweak] MobileSubstrate Bundle filter [com.apple.springboard]: com.alipay.iphoneclient 要依赖的程序的bundleid。APPID这个是自定义cy里面的,不@import dyz,是没法使用的;也可以直接[NSBundle mainBundle].bundleIdentifier
6、[iphone/tweak] List of applications to terminate upon installation (space-separated, '-' for none) [SpringBoard]: AlipayWallet 安装插件的时候重启那个应用,默认是SpringBoard,改成一般是依附那个应用改成那个应用,依附AlipayWallet,改成AlipayWallet

7、会在当前目录(在那个目录下执行的nic.pl,那个就是当前目录,这里是~,所以这里当前目录就是~)下生成一个alipaypwddemo工程
生成的工程,如果在中文目录下会出现问题,记住哦,所以一定不要放在中文目录下

8、用Sublime Text打开,把alipaypwddemo工程拖入Sublime Text

8.1、AliPayPwdDemo.plist bundleid的配置,依附的程序的bundleid

8.2、control 包的一些配置

8.3、Makefile 编译的一些配置

老版本的(演示版)

需要添加
export THEOS_DEVICE_IP=localhost
export THEOS_DEVICE_PORT=12345


如果在~/.bash_profile中配置了环境变量这里就可以不用配置

8.4、Tweak.x 给用户写Logos的。这里不需要导入UIKit,是因为Theos依赖Xcode,如果电脑的应用程序中有多个Xcode,需要指定Xcode。不然使用Theos的时候也可能有问题
xcode-select -p 查看指定的Xcode

9、make 编译
make clean 清缓存

编译,会生成.theos

10、make package 打包

打包,会生成packages

11、make install 安装到手机

Cydia 中会添加AliPayPwdDemo 插件

12、查看打印

你可能感兴趣的:(Theos下载、配置、使用)