pedwards3x said:
Alright I am attempting to theme some system files on the D3. I cannot figure out for the life of me how to decompile Settings.apk, edit the androidmanifest.xml, recompile it, and then get it to work. I can edit just about anything else and it works fine. As soon as I touch the androidmanifest file the apk will not work. Somebody help!
Hi,
Android by default for system apk's, processes the signature to verify AndroidManifest.xml and pretty much nothing else. This is why you can edit virtually anything else in a system APK file (xml files, png images, code etc.) and not have any errors when pushing your mod, if you copy over the original META-INF folder (the signature) and AndroidManifest.xml files.
I don't know any real conclusive workaround for this, but I've tried a few things in the past that seem to work ok most of the time.
My first suggestion, compile your APK, and select no to the system APK prompt. Do not re-sign, or copy over the original signature. Launch ddms and bring up the logcat window for warnings/errors only, run adb shell stop, then adb push the modified Settings.apk to /system/app, then do adb shell start and watch the logcat for signature parse errors, if you don't see any, that means it should have been pushed fine, so try launching Settings.
Now, if that doesn't work, here's my next suggestion, like above, select no to the system APK prompt, but then manually open the original apk file and the new apk file with 7zip (or your preferred graphical zip program) and copy over the original META-INF folder and AndroidManifest.xml file into the new apk file. Next, follow the same steps above, adb shell stop, adb push, adb shell start, watch ddms for signature errors, you shouldn't get any this time. Of course, there's a possibility that your changes to AndroidManifest.xml might not take with this method, but depending on how extensive your changes were, they might be fine, since bits of every binary resource file (xml files, .9.png files, etc.) get compiled into the resources.arsc file.
I've not bothered to look into that enough to know exactly how the binary information is compiled, but I do know that this trick can be used for doing things like inverting Vending.apk, and that also requires modifying the AndroidManifest.xml file.
Anyway, hope this helps, cheers
