我正在尝试对 MIUI Android 2.3.5 ROM (Mms.apk) 附带的键盘应用程序的布局进行一些小改动。将文件重新编译回 apk(并使用 jarsigner 对其进行签名)并使用 重新部署后adb push
,应用程序始终会强制关闭。
检查 logcat 表明 XML 文件存在错误(它说它缺少一个android:layout_width
属性 - 它是......但添加它没有区别,因为另一个错误会在其他地方弹出。问题似乎在于重新编译过程,因为该应用程序(以其原始形式)在没有这些属性的情况下工作得很好,这些属性会导致编辑后的 apk 出现 RuntimeException ..
仅作记录,即使我不做任何更改 - 只需反编译原始 apk 然后立即再次编译,问题仍然存在。
如果我不签署 apk,那么它根本不会安装。也许我的签名导致了问题?这就是我所做的:
apktool d Mms.apk //decompile the original apk (Mms.apk)
apktool b Mms //make no alterations and recompile it again
cd Mms/dist //change into the directory where the new apk is generated
jarsigner -verbose -keystore jspapps.keystore Mms.apk jspapps.keystore //sign the apk with keystore (jspapps.keystore)
adb remount //connect to phone..
adb push Mms.apk /system/app //push the apk
adb reboot //reboot.....
每次强制关闭!
任何帮助将非常感激。我已经在这几个小时了!