iOS越狱开发theOS搭建

越狱环境搭建

TheOS

Theos.最初由DHowett进行开发,由于DHwoett去了微软,不再有时间维护了,所以Adam Demasi(kirb)接手了他的工作,并且添加了很多全新的功能。所以,之前书上《iOS App Reverse Engineering》讲的安装方法已经不再适用,现在我们来讲一下最新的安装方法。

安装dpkg和ldid

Dpkg是Debian的软件包。

Ldid是越狱祖师爷Saurik开发的一款二进制授权管理软件,可以对越狱应用进行SHA1运算生成授权,让软件包可以在iPhone上执行。

在这里我们使用Homebrew来安装他们。Homebrew是一款Mac上的基于Ruby的包管理器,可以理解为与Yum、Apt、Pecman类似即可。

用Homebrew安装上述软件仅需一句话:

brew install dpkg ldid
复制代码

如果没有安装Homebrew,那么安装它也仅仅只需要一句话(可能需要VPN环境,github最近越来越不稳定也是众所周知的事情):

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
复制代码

安装Thoes

之前我们把Theos安装在/opt/theos,现在我们还是安装在这个文件夹。

sudo Git clone --recursive https://github.com/theos/theos.git /opt/theos
复制代码

然后把/opt/theos的权限改成你自己:

sudo chown $(id -u):$(id -g) /opt/theos
复制代码

最后这一步也很重要,要把theos的执行路径加入到环境变量之中,在~/.bash_profile中加上这么两句:

export THEOS=/opt/theos
export PATH=/opt/theos/bin/:$PATH
//后面可以不配置
export SDKVERSION=10.1  //iOSSDK版本
export THEOS_DEVICE_IP=127.0.0.1 THEOS_DEVICE_PORT=22复制代码

测试是否安装成功

Cd到任意可执行目录, 执行:

nic.pl
复制代码

New Instance Creator开始执行则已经安装成功。

注意事项

  1. 报错
guogh:test guogh$ make package
> Making all for tweak test…
make[2]: Nothing to be done for `internal-library-compile'.
> Making stage for tweak test…
dpkg-deb: error: obsolete compression type 'lzma'; use xz insteadType dpkg-deb --help for help about manipulating *.deb files;
Type dpkg --help for help about installing and deinstalling packages.
make: *** [internal-package] Error 2
复制代码

解决

$ brew remove dpkg  # remove latest dpkg
$ brew install --force-bottle https://raw.githubusercontent.com/Homebrew/homebrew-core/7a4dabfc1a2acd9f01a1670fde4f0094c4fb6ffa/Formula/dpkg.rb  # install dpkg as a bottle from the old commit
$ brew pin dpkg  # block homebrew from updating dpkg till you `brew unpin dpkg`
(Updated 01/03/17 using @Fr0stDev’s workaround because Debian delete old source releases. 1.18.10 is from July 2016.)
复制代码

参考自Stack Overflow

dpkg 1.18.11 finally pulled the plug on our saving grace; using -Zbzip2 or -Zlzma is now an error.

The most straightforward way to “fix” this would be to just replace it with dm.pl and add lzma support to it. (Or urge for Telesphoreo’s dpkg to be updated, but I’ve been doing that for years…)

Error output

dpkg-deb: error: obsolete compression type 'lzma'; use xz instead

Type dpkg-deb --help for help about manipulating *.deb files; Type dpkg --help for help about installing and deinstalling packages. make: *** [internal-package] Error 2 Workaround

For the moment, you’ll need to just use 1.18.10.

For Homebrew, you can downgrade like so:

$ brew remove dpkg # remove latest dpkg $ brew install --force-bottle https://raw.githubusercontent.com/Homebrew/homebrew-core/7a4dabfc1a2acd9f01a1670fde4f0094c4fb6ffa/Formula/dpkg.rb # install dpkg as a bottle from the old commit $ brew pin dpkg # block homebrew from updating dpkg till you brew unpin dpkg (Updated 01/03/17 using @Fr0stDev’s workaround because Debian delete old source releases. 1.18.10 is from July 2016.)

Fortunately, seems Debian/Ubuntu are safe for the moment: https://launchpad.net/dpkg/+packages. But I would expect them to be updating sometime soon.

Partly dupes #197.

参考链接:

  • github.com/theos/theos…

  • bbs.iosre.com/t/theos/492…

测试theOS

建立一个项目

  • 终端输入以下命令
guogh:testiOSDev guogh$ nic.pl
复制代码
  • 输出
NIC 2.0 - New Instance Creator
------------------------------[1.] iphone/activator_event[2.] iphone/application_modern[3.] iphone/cydget[4.] iphone/flipswitch_switch[5.] iphone/framework[6.] iphone/ios7_notification_center_widget[7.] iphone/library[8.] iphone/notification_center_widget[9.] iphone/preference_bundle_modern[10.] iphone/tool[11.] iphone/tweak[12.] iphone/xpc_service
Choose a Template (required):
复制代码
  • 输入 11
  • 添加代码

修改Tweak.xm文件,删除所有内容,写入以下代码:

#import <SpringBoard/SpringBoard.h>%hook SpringBoard-(void)applicationDidFinishLaunching:(id)application {%orig;UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome"message:@"Hello world,你好世界"delegate:nilcancelButtonTitle:@"确定"otherButtonTitles:nil];[alert show];[alert release];
}%end
复制代码
  • 编译
make
复制代码
  • 打包
make package
复制代码

期间会让输入iPhone的root密码 (iPhone事先需要安装ssh等服务)

后面就可以在手机端用iFile等工具安装deb包了.

转载于:https://juejin.im/post/5a432229f265da432f3163ec

iOS越狱开发theOS搭建相关推荐

  1. iOS越狱开发环境搭建 theos

    iOS越狱开发环境搭建 theos http://www.devdiv.com/home.php?mod=space&uid=54&do=blog&id=7596 前段时间在开 ...

  2. IOS越狱开发起步教程

    IOS越狱开发起步教程 IOS,Jailbroken,Programming 周六, 一 14, 2012 学习并实战开发越狱后的IOS程序已经快两个月了,中文资料除了CocoaChina上有少数资料 ...

  3. iOS越狱开发(一) ipa 安装

    原文  http://www.cnblogs.com/easonoutlook/p/3220429.html iOS越狱开发(一) 做越狱开发也有一些时间了,有很多东西想总结一下,希望给他人一些借鉴, ...

  4. iOS 越狱开发那些事儿之二

    iOS越狱篇之二:iOSOpenDev环境搭建 主要参考网站:http://iosopendev.com/ 参考地址:http://blog.csdn.net/tuluigi/article/deta ...

  5. iPhone越狱开发环境搭建

    由于越狱开发是非主流技术,所以中文资料很少,英文资料也很零散.这让很多想研究越狱开发又英语不好的开发者无所适从.所以我就在这里为大家开一个头,介绍一下如何搭建一个开发开发越狱应用的开发环境.下面介绍i ...

  6. 开篇 关于iOS越狱开发

    本文版权归扣丁书屋所有,转载请保留此说明. 越狱与开发 iPhone 在10年前问世时,并没有第三方应用,连一个游戏都没有,但是 Nicholas Allegra 等越狱开发者将苹果的智能手机推到了极 ...

  7. [iOS越狱开发]安装command line tools for Xcodew

    网上搜了篇文章,介绍iOS的越狱开发,其中提到了要给Xcode安装command line tools,以前从没听过这个工具,然后就google了下. 关于Xcode Command Line Too ...

  8. ios 越狱开发(应用安装)

    http://www.cnblogs.com/easonoutlook/p/3220429.html 做越狱开发也有一些时间了,有很多东西想总结一下,希望给他人一些借鉴,也是自己对过去开发经历的一些总 ...

  9. 最新IOS7 越狱开发环境搭建

    针对ios7.x版本,使用iOSOpenDev进行开发. 一.Mac端 基础要求: Mac OS X 10.8及以上(推荐Mac OS X 10.9): XCode5.0及以上: Command Li ...

最新文章

  1. 商贸通服装鞋帽版客户端无法连接服务器的问题(自己遇到的,已解决)
  2. 【阿里云总监课第四期】时髦的云原生应用怎么写?
  3. python天天学怎么样-Python天天学_03_基础三
  4. matlab自动给变量命名
  5. 决策树之前要不要处理缺失值_不要使用这样的决策树
  6. c语言float转换为int_C语言的隐式类型转换和显示类型转换
  7. linux下的进程间通信-管道及共享内存
  8. 高性能tornado框架简单实现restful接口及运维开发实例
  9. Mysql常用的存储引擎
  10. 【第43题】【062题库】2019年OCP认证062考试新题
  11. CentOS7 yum 安装 maven
  12. 逆水寒ol服务器维修,逆水寒OL:官方再开多个服务器玩家关心的问题却是一个字_...
  13. BUUCTF-Misc-sqltest(happyctf)
  14. Ardupilot源码框架
  15. ceph管理界面calamari(未成功)
  16. excel表格中的空白行你还在一个个删除吗?Speedoffice教你一招
  17. 中秋佳节,实现一个自定义任意路径嫦娥奔月程序:过什么节,代码走起
  18. java 飞翔小鸟源码
  19. chromedriver、geckodriver、MicrosoftWebDriver、IEDriverServer和operadriver之间的恩怨纠葛
  20. Java比较汉字字符串排序与C++比较汉字排序

热门文章

  1. 显式Intent 和隐式 Intent 的区别
  2. 自己动手实现分布式任务调度框架
  3. form表单回车提交问题,JS监听回车事件
  4. .Net Framework System.Collections 集合类
  5. java thread与runnable联系区别
  6. 网页防篡改测试报告(2008版)
  7. C#调用VB进行简繁转换
  8. Android的内容观察者
  9. textarea最大长度限制
  10. 自定义的Spinner文字居中