配置 THEOS 环境变量
vim ~/.profile
输入:
export THEOS=~/theos
#如果 iOS 设备的 IP 相对固定,可以在此配置
#如果变动频繁,建议在 makefile 中配置
export THEOS_DEVICE_IP=192.168.0.114
更新配置文件:
source ~/.profile
下载 theos
git clone git://github.com/DHowett/theos.git $THEOS
下载编译 ldid 源代码
git clone git://git.saurik.com/ldid.git
cd ldid
git submodule update --init
./make.sh
cp -f ./ldid $THEOS/bin/ldid
配置 MobileSubstrate
$THEOS/bin/bootstrap.sh substrate
安装 dpkg
先安装 MacPorts:
sudo port selfupdate
使用 MacPorts 来安装 dpkg:
sudo port install dpkg
编写测试例程
%hook SpringBoard
-(void)applicationDidFinishLaunching:(id)application
{
%orig;
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"越狱开发之旅" message:@"My first iOS hacking!" delegate:self cancelButtonTitle:@"点1G赞" otherButtonTitles:nil];
[alertView show];
}
%end