hw-1

IPA 使用自己的Apple帐号签名安装 -- Cydia impactor

不知从什么时候起,apple 不用99美玩也可以玩XCODE 连真机调试了,只需要XCODE里面登录自己的Apple帐号就可以了,
今天要介绍的这款神器就是把Xcode的签名 和安装的这部部功能提出来了,
做成一个工具,,非常的方便。。
大家可以到官方网站下载对系统对应版本,
http://www.cydiaimpactor.com

怎么使用
1 打开App 把要签名的IPA拖到APP上面
2 按提示输入APPLE帐号 密码
3 什么都不用做,静静的看他忙就好了,((
4 不出什么问题,IPA已经安装到你手机上了,

iDevice istall tool

1
2
apt-get update
apt-get install top tcpdump network-cmds adv-cmds coreutils cycript diskdev-cmds diffutils file file-cmds findutils iphone-python ruby rubygems vim wget

ubuntu install squid3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
ubuntu install squid3

sudo apt-get install python-setuptools

sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev

sudo apt install squid3 imagemagick

sudo easy_install twisted

sudo apt install openssl php


sudo mkdir -p /var/www/tmp
sudo chown -R proxy:proxy /var/www/tmp
sudo twistd web --path=/var/www --port=8080


sudo perl -MCPAN -e'install "LWP::Simple"'

sudo iptables -L --line-number -t nat
sudo iptables -t nat -A PREROUTING -s 172.26.0.0/255.255.255.0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 172.26.1.1
sudo iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 80 -j REDIRECT --to-port 3128
sudo iptables -t nat -D PREROUTING 2

//DEBUG

sudo vim /etc/squid3/squid.conf
sudo squid -k reconfigure
netstat -na|grep 3128
sudo /etc/init.d/squid3 restart

sudo chown -R root:root flip.pl

sudo tail -F /tmp/flipImages_debug.log
sudo tail -F /var/log/squid3/access.log
sudo tail -F /var/log/squid3/cache.log


OSX
sudo sysctl -w net.inet.ip.forwarding=1
sudo pfctl -f pf.conf
sudo pfctl -e
sudo /sbin/pfctl -s state


Ubuntu
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 3128

install_name_change

1
2
3
4
5
6
7
Using otool -D lib.dylib returns the path that is presented by that library to the compiler. To change it you can use install_name_change with the argument -id.

install_name_tool -id “@executable_path/../Plugins/lib.dylib” lib.dylib

This alters the relative path of lib.dylib to the plugins folder of your bundle. Next you need to change each path in the main executable. You can find out the dependencies and their expected path of the executable using otool -L. For each dependency that needs changing use install_name_tool again with the argument -change.

install_name_tool -change “/usr/lib/lib.dylib” “@executable_path/../Plugins/lib.dylib” applicationname

怎么在没越狱的iPhone手机上安装插件,怎么在没越狱的iPhone手机上安装(WeChat)微信抢红包插件,手机没越狱也能抢红包了,App dylib inject

怎么在没越狱的iPhone手机上安装插件,怎么在没越狱的iPhone手机上安装(WeChat)微信抢红包插件,手机没越狱也能抢红包了,App dylib inject

需要准备:
没越狱的iPhone手机一部
越狱的iPhone手机一部(用于解密App)
苹果开发证书一个

1,使用dumpdecrypted得到解密后的WeChat

1
2
3
4
#get WeChat path
ps aux|grep WeChat
#dumpdecrypted
DYLD_INSERT_LIBRARIES=dumpdecrypted.dylib WeChat_path

可得到解密后的可执行文件,最后解密后的App打包成Wechat-6.3.13.ipa

2,编译抢红包插件wctw.dylib
使用theos-jailed创建 tweak wctw
借用一下WeChatRedEnvelop里面的代码
把代码整合到新建的工程里面
编译后就可得到 wctw.dylib CydiaSubstrate

3,Inject wctw.dylib
解压Wechat-6.3.13.ipa 得到 WeChat.app
复制wctw.dylib CydiaSubstrate 到 WeChat.app

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cd WeChat.app
yololib WeChat wctw.dylib```


4,签名打包
用keychain 找到你的开发证书的名字

```bash
codesign -f -s "iPhone Developer: XXXX (XXXX)" "WeChat.app/CydiaSubstrate"
codesign -f -s "iPhone Developer: XXXX (XXXX)" "WeChat.app/wctw.dylib"

#--entitlements Entitlements.plist
codesign -f -s "iPhone Developer: XXXX (XXXX)" --entitlements Entitlements.plist "WeChat.app"

#create ipa
xcrun -sdk iphoneos PackageApplication -v "WeChat.app" -o "pathtosave/WeChat.ipa"

5,使用Xcode安装
窗口-》设备-》选中要安装的手机-》已经安装的应用
点击下面的加号 选择刚才生成WeChat.ipa
几分钟就可以安装成功啦

可能遇到的问题:
1,安装时提示“已经有一个相同的ID,不能替换”,因为已经是可以替换,后来苹果改不能替换了
2,打包成功了,安装时提示“证书不匹配”,要先你的开发证书中*号描述文件安装到你手机中
3,成功安装到手机中,可是一点开就挂了,可能是dylib 的版本不匹配选成的,yololib 默认是按1.0.0加的,theos 生成的是0.0.0 在make 文件中加上版本设置就可以了

bash LOCAL_INSTALL_PATH = /usr/lib #指定版本 _THEOS_TARGET_LDFLAGS += -current_version 1.0.0 _THEOS_TARGET_LDFLAGS += -compatibility_version 1.0.0

4,安装时提示有一个plugin签名不对,删除WeChat.app 目录下Plugins 文件来
文章中提到的工具和源码下载
https://github.com/hw-1/wctw.git

convert PKCS#1 to PKCS#8

BEGIN RSA PRIVATE KEY is PKCS#1 and is just an RSA key.
BEGIN PRIVATE KEY is PKCS#8 and indicates that the key type is included in the key data itself.

openssl pkcs8 -topk8 -inform pem -in servername.key -outform pem -nocrypt -out servername.key.1```