在Mac生成微信 APK 实现 Android 安装多个微信
下载微信apk
-
Android 手机上下载回来传到PC
网址: http://weixin.qq.com/d
-
PC上直接下载
启动 Chrome 的 Inspect Element, 点击 设备模拟器,选择个Android设备, 访问 http://weixin.qq.com/d
安装Apktool 2.x
-
网址
http://ibotpeaches.github.io/Apktool/
-
安装说明
http://ibotpeaches.github.io/Apktool/install/
-
检查Java 1.7是否安装
java -version
-
下载 wrappler script
wget -O apktool https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/osx/apktool
-
下载 apktool-2
网址: https://bitbucket.org/iBotPeaches/apktool/downloads wget -O apktool.jar https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.0.1.jar
-
复制到/usr/local/bin
cp ./apktool /usr/local/bin cp ./apktool.jar /usr/local/bin
-
设置执行权限
chmod +x /usr/local/bin/apktool*
-
测试是否能运行
apktool
Decode 微信Apk
apktool d weixin622android580.apk
修改文件
按需要更改下面命令的mm.yhz.mm1
cd weixin622android580
* 修改AndroidManifest.xml
sed -i '' 's/package="com.tencent.mm"/package="me.yhz.mm1"/g' ./AndroidManifest.xml
sed -i '' 's/com.tencent.mm/me.yhz.mm1/g' ./AndroidManifest.xml
sed -i '' 's/="\./="com\.tencent\.mm\./g' ./AndroidManifest.xml
sed -i '' 's/<action android:name="me.yhz.mm1/<action android:name="com.tencent.mm/g' ./AndroidManifest.xml
sed -i '' 's/<data android:mimeType="vnd.android.cursor.item\/vnd.me.yhz.mm1/<data android:mimeType="vnd.android.cursor.item\/vnd.com.tencent.mm/g' ./AndroidManifest.xml
sed -i '' 's/<category android:name="me.yhz.mm1/<category android:name="com.tencent.mm/g' ./AndroidManifest.xml
* 修改strings.xml
sed -i '' 's/<string name="aut">WeChat<\/string>/<string name="aut">WeChat#1<\/string>/g' ./res/values/strings.xml
sed -i '' 's/<string name="aut">微信<\/string>/<string name="aut">微信#1<\/string>/g' ./res/values-zh-rCN/strings.xml
* 修改资源文件出现的do & if关键字
find ./res -name "*.xml" | xargs -n 1 sed -i '' 's/<\(.*\)>do<\/\(.*\)/<\1>d_o<\/\2>/g; s/<\(.*\)>if<\/\(.*\)/<\1>i_f<\/\2>/g;'
find ./res -name "*.xml" | xargs -n 1 sed -i '' 's/name="do"/name="d_o"/g; s/name="if"/name="i_f"/g'
find ./res -name "*.xml" | xargs -n 1 sed -i '' 's/@\(.*\)\/if/@\1\/i_f/g; s/@\(.*\)\/do/@\1\/d_o/g'
Build 微信Apk
cd ..
apktool b weixin622android580 -o weixin580nosign.apk
Apk文件签名
-
生成密钥
keytool -genkey -alias yhz.keystore -keyalg RSA -validity 20000 -keystore yhz.keystore
-
生成带签名的Apk文件
jarsigner -verbose -keystore yhz.keystore -signedjar weixin580signed.apk weixin580nosign.apk yhz.keystore
参考网址
http://user.qzone.qq.com/273642232/blog/1437757998