I'm trying to make a small change to the layout of the keyboard app which comes with the MIUI Android 2.3.5 ROM (Mms.apk). Upon recompiling the files back into an apk (and signing them with jarsigner) and redeploying it with adb push
, the app always force closes.
Checking logcat indicates that there's an error with an XML file (it says it's missing an android:layout_width
attribute - which it is.. but adding it makes no difference, as another error will pop up elsewhere. The problem seems to lie with the recompilation process, as the app (in its original form) works just fine without these attributes which are causing a RuntimeException with the edited apk..
Just for the record, even if I make no changes - merely decompile the original apk and then compile it again straight away, the problem remains.
If I don't sign the apk, then it doesn't install at all. Perhaps my signing is causing the problem? Here's what I do:
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.....
Force close everytime!
Any help would be much appreciated. I've been at this for hours now!
I've worked it out. Looks like it's a bug in the current build of apktool (1.41). It's been resolved in a new build which isn't available from the Google Code site directly - the dev uploaded it here: http://www.multiupload.com/BPJW0WGTBG
Extracting the jar file to your APKTool directory and renaming it "apktool.jar" solves the problem.