# APK Manager Help



## pedwards3x (Jun 16, 2011)

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!


----------



## jocelyn (Jul 22, 2011)

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


----------



## Don Hamis (Oct 12, 2011)

Android application package file (APK) is the file format used to distribute and install application software and middleware onto the Google Android operating system. To make an APK file, a program for Android is first compiled, and then all of its parts are packaged into one file. This holds all of that program's code such as (.dex files), resources, assets, certificates, and manifest file. As is the case with many file formats, APK files can have any name needed, but must end with the four character, three letter extension, .apk.


----------

