1.找到Packages文件
通过上次的讨论,我们已经明确了如何去创建一个cydia源,我们一般从cydia里面去设置源下载插件,其实也是一样的。同样也有Packages打包文件。
大家可以随便找一个源尝试去分析下,这里我用的雷锋源,这个源速度比较快,用来测试很合适。
下面我们来一起简单看下。
cydia设置的源一般会在以下目录中有一个Packages文件,也就是压缩的Packages.bz2的解压缩文件。我们可以来看看:
/var/mobile/Library/Caches/com.saurik.Cydia/lists
iPhone:/var/mobile/Library/Caches/com.saurik.Cydia/lists root# ls -ltr
total 41716
-rw-r--r-- 1 mobile mobile 290 May 13 2017 repo.nesolabs.de_._Release
-rw-r--r-- 1 mobile mobile 432 May 13 2017 repo.nesolabs.de_._Packages
-rw-r--r-- 1 mobile mobile 15040211 Nov 17 2017 apt.modmyi.com_dists_stable_main_binary-iphoneos-arm_Packages
-rw-r--r-- 1 mobile mobile 181 Nov 17 2017 apt.modmyi.com_dists_stable_Release.gpg
-rw-r--r-- 1 mobile mobile 385 Nov 17 2017 apt.modmyi.com_dists_stable_Release
-rw-r--r-- 1 mobile mobile 10495757 Nov 17 2017 cydia.zodttd.com_repo_cydia_dists_stable_main_binary-iphoneos-arm_Packages
-rw-r--r-- 1 mobile mobile 181 Nov 18 2017 cydia.zodttd.com_repo_cydia_dists_stable_Release.gpg
-rw-r--r-- 1 mobile mobile 556 Nov 18 2017 cydia.zodttd.com_repo_cydia_dists_stable_Release
-rw-r--r-- 1 mobile mobile 174237 Feb 19 2019 apt.saurik.com_cydia_._Packages
-rw-r--r-- 1 mobile mobile 159 Mar 1 2019 mrmadtw.github.io_repo_._Release
-rw-r--r-- 1 mobile mobile 55204 Mar 1 2019 mrmadtw.github.io_repo_._Packages
-rw-r--r-- 1 mobile mobile 200 May 24 2019 cydia.angelxwind.net_._Release
-rw-r--r-- 1 mobile mobile 180 Nov 11 02:15 checkra.in_assets_mobilesubstrate_._Release
-rw-r--r-- 1 mobile mobile 881 Nov 11 02:15 checkra.in_assets_mobilesubstrate_._Packages
-rw-r----- 1 mobile mobile 0 Dec 12 23:38 lock
-rw-r--r-- 1 mobile mobile 214 Mar 2 02:15 apt.abcydia.com_._Release
-rw-r--r-- 1 mobile mobile 7848516 Mar 6 22:15 apt.thebigboss.org_repofiles_cydia_dists_stable_main_binary-iphoneos-arm_Packages
-rw-r--r-- 1 mobile mobile 176 Mar 7 18:14 lingo.bichonfrise.cn_cydia_._Release
-rw-r--r-- 1 mobile mobile 209 Mar 8 18:28 repo.packix.com_._Release
-rw-r--r-- 1 mobile mobile 214 Mar 8 18:28 repo.dynastic.co_._Release
-rw-r--r-- 1 mobile mobile 245062 Mar 11 05:50 apt.bingner.com_._Packages
-rw-r--r-- 1 mobile mobile 707 Mar 11 07:00 apt.bingner.com_._InRelease
-rw-r--r-- 1 mobile mobile 41884 Mar 20 13:42 cydia.angelxwind.net_._Packages
-rw-r--r-- 1 mobile mobile 337123 Mar 22 16:54 www.tateu.net_repo_._Packages
-rw-r--r-- 1 mobile mobile 783 Mar 22 16:54 www.tateu.net_repo_._Release
-rw-r--r-- 1 mobile mobile 2007 Mar 27 03:25 build.frida.re_._Packages
-rw-r--r-- 1 mobile mobile 708 Mar 29 06:51 repo.chariz.com_._Release
-rw-r--r-- 1 mobile mobile 38540 Mar 29 06:51 repo.chariz.com_._Packages
-rw-r--r-- 1 mobile mobile 833 Mar 29 08:13 repo.chariz.com_._Release.gpg
-rw-r--r-- 1 mobile mobile 660835 Mar 29 14:29 apt.abcydia.com_._Packages
-rw-r--r-- 1 mobile mobile 410 Mar 29 18:09 lingo.bichonfrise.cn_cydia_._Packages
2.理解下一个源的文件
上面可以看到我已经杂七杂八添加了很多源。上面以_Release
结尾的就是我们打包发布的Release文件了。而Packages.bz2就是这里的_Packages
文件了。
一个源对应有两个文件:
iPhone:/var/mobile/Library/Caches/com.saurik.Cydia/lists root# ls -ltr | grep "abcydia"
-rw-r--r-- 1 mobile mobile 214 Mar 2 02:15 apt.abcydia.com_._Release
-rw-r--r-- 1 mobile mobile 660835 Mar 29 14:29 apt.abcydia.com_._Packages
_Release文件内容(源的描述文件):
1 Origin: ABCydia/雷锋源™
2 Label: ABCydia/雷锋源™
3 Suite: stable
4 Version: 1.1
5 Codename: com.abcydia
6 Architectures: iphoneos-arm
7 Components: main
8 Description: 分享iPhone实用插件 做最清爽的中文源
_Packages包描述汇总:
1 Package: applist
2 Version: 1.5.15~beta1
3 Section: Development
4 Maintainer: Ryan Petrich <rpetrich@gmail.com>
5 Depends: mobilesubstrate (>= 0.9.5000), firmware (>= 3.0), com.rpetrich.rocketbootstrap (>= 1.0.7~beta3) | firmware (<< 7. 0)
6 Conflicts: com.a3tweaks.polus (<< 2.0.7)
7 Architecture: iphoneos-arm
8 Filename: ./debs/1815.deb
9 Size: 104656
10 Installed-Size: 780
11 Description: Allow extensions to read the list of installed apps
12 Name: AppList
13 Author: Ryan Petrich <rpetrich@gmail.com>
14 Website: http://moreinfo.thebigboss.org/moreinfo/depiction.php?file=AppListDp
15 Depiction: https://apt.abcydia.com/index.php?pid=1815
16 SileoDepiction: https://apt.abcydia.com/sileo.php?pid=1815
17 MD5sum: 4f3d76273d8e428ef48c89c4cdedb2d9
18 SHA1: bcc7bf0f3da9b80d8ebb65d34017c0dac7c02759
19 SHA256: 2742a2ce769194b37c3a2ca470b5558072a4d30079f53f557bee3c5806f5b833
20
21 Package: ch.ringwald.hidsupport
22 Version: 1.3.0-1
23 Section: Development
24 Maintainer: WZteam <admin@abcydia.com>
25 Depends: mobilesubstrate (>= 0.9.5101), firmware (>= 3.0), com.rpetrich.rocketbootstrap (>= 1.0.2) | firmware (<< 7.0)
26 Architecture: iphoneos-arm
27 Filename: ./debs/1496.deb
28 Size: 19070
29 Installed-Size: 345
30 Description: support for HID on iOS & Apple TV
31 Name: hid-support
32 Author: Matthias Ringwald <tickets@btstack.uservoice.com>
3.怎么搞deb?
上面可以看到是一个一个的包,也就是插件。
那么现在问题就来了。插件如何搞下来?
网上有一些现成的方法大家可以参考下。
4.上面的方法太麻烦了
,再深入一点点?
上面的文章没有解决的是400的问题,以至于一个一个搞下来把人累死了。那么又有另外一个问题?为什么cydia访问的时候是200也就是ok的。浏览器就400了呢?肯定是server做了一些判断或处理,将非cydia请求给了个400就和客户端say goodbye了,那么就要抓包分析了。
其实出现这种鬼,原因就是在于服务端做了ua或者其他信息的检测,一般这种也就是检测了ua和httpheader。那就简单了,用我们的大花瓶charles来抓个包,找一个头不就完事了么。
抓到的头:
GET /./Packages.bz2 HTTP/1.1
Host: apt.abcydia.com
X-Machine: iPhone8,4
X-Firmware: 13.2.3
Cache-Control: max-age=0
User-Agent: Telesphoreo APT-HTTP/1.0.592
X-Unique-ID: 7273c225581ebb766a8ffbe6f00acc19cb4ee1c8
Connection: keep-alive
为什么我抓的是bz2而不是deb?因为我没抓到deb呀。不过服务端检测规则应该都是统一的。所以强行安装试试。
接下来就好搞了,嘿嘿嘿
写个bash直接跑curl拉下来就完事了。
单个测试命令:
curl -X GET -H"GET ./debs/1612.deb HTTP/1.1" -H "Host: apt.abcydia.com" -H"X-Machine: iPhone8,4" -H"X-Firmware: 13.2.3" -H"Connection: keep-alive" -H"If-Modified-Since: Sun, 01 Mar 2020 18:15:35 +0000" -H"User-Agent: Telesphoreo APT-HTTP/1.0.592" -H"X-Unique-ID: 7273c225581ebb766a8ffbe6f00acc19cb4ee1c8" -H"Cache-Control: no-cache" "https://apt.abcydia.com/debs/1612.deb" -o ./debs/1612.deb
批量跑命令:
#########################################################################
# File Name: get_debs.sh
# Author: YourName
# mail: YourEmail
# Created Time: 2020-03-30
#########################################################################
#!/bin/bash
deb_lists=`cat apt.abcydia.com_._Packages | grep Filename | awk '{print $2}'`
for deb in $deb_lists
do
curl -i -X GET -H"GET ${deb} HTTP/1.1" -H "Host: apt.abcydia.com" -H"X-Machine: iPhone8,4" -H"X-Firmware: 13.2.3" -H"Connection: keep-alive" -H"If-Modified-Since: Sun, 01 Mar 2020 18:15:35 +0000" -H"User-Agent: Telesphoreo APT-HTTP/1.0.592" -H"X-Unique-ID: 7273c225581ebb766a8ffbe6f00acc19cb4ee1c8" -H"Cache-Control: no-cache" "https://apt.abcydia.com/{$deb}" -o ${deb}
done
跑下来就这种效果:
结束了。
同理可以下载所有其他源的deb,这样每次越狱就不用重新下载等那么久了,然后你也可以自己写一个cydia。