• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Help Rebuilding APK File

Stoowyguy

Lurker
Oct 10, 2011
9
0
I need help rebuilding a system apk. Basically what I have been trying to do is take the Mms.apk from my system/app in sense 3.6 and put that file on my computer. Extract the apk via winrar. And then I was modding a file in the mms folder by replacing the bubbles or "messageconversation.png" so that it looked like the ones from sense 4 and then here is where my problem comes in. How DO I REBUILD this folder to be a signed apk file and replace it into my system/app.
 
An .apk file is a simple zip file with a different suffix ... one can unzip or zip the components back into a zipfile with the.apk suffix, then "adb install filename.apk" to side-load onto the device.

$ unzip -l Free42Android.apk
Archive: Free42Android.apk
Length Date Time Name
--------- ---------- ----- ----
2198 2012-07-28 14:25 META-INF/MANIFEST.MF
2319 2012-07-28 14:25 META-INF/MYKEY.SF
1414 2012-07-28 14:25 META-INF/MYKEY.RSA
1127 2012-07-28 14:25 res/drawable/copy.png
583 2012-07-28 14:25 res/drawable/document.png
332 2012-07-28 14:25 res/drawable/folder.png
3430 2012-07-28 14:25 res/drawable/icon.png
1530 2012-07-28 14:25 res/drawable/paste.png
611 2012-07-28 14:25 res/drawable/printer.png
2680 2012-07-28 14:25 res/layout/file_selection_dialog_landscape.xml
2680 2012-07-28 14:25 res/layout/file_selection_dialog_portrait.xml
1204 2012-07-28 14:25 res/layout/file_selection_dialog_row.xml
5668 2012-07-28 14:25 res/layout/preferences_dialog.xml
512 2012-07-28 14:24 res/raw/click.wav
2044 2012-07-28 14:24 res/raw/squeak.wav
4044 2012-07-28 14:24 res/raw/tone0.wav
4044 2012-07-28 14:24 res/raw/tone1.wav
4044 2012-07-28 14:24 res/raw/tone2.wav
4044 2012-07-28 14:24 res/raw/tone3.wav
4044 2012-07-28 14:24 res/raw/tone4.wav
4044 2012-07-28 14:24 res/raw/tone5.wav
4044 2012-07-28 14:24 res/raw/tone6.wav
4044 2012-07-28 14:24 res/raw/tone7.wav
4044 2012-07-28 14:24 res/raw/tone8.wav
4044 2012-07-28 14:24 res/raw/tone9.wav
2148 2012-07-28 14:25 AndroidManifest.xml
4760 2012-07-28 14:25 resources.arsc
82724 2012-07-28 14:25 classes.dex
53960 2012-07-28 14:24 com/thomasokken/free42/Standard.gif
2013 2012-07-28 14:24 com/thomasokken/free42/Standard.layout
339760 2012-07-28 14:25 lib/armeabi/libfree42.so
--------- -------
554137 31 files

$ unzip -Z
ZipInfo 3.00 of 20 April 2009, by Greg Roelofs and the Info-ZIP group.

List name, date/time, attribute, size, compression method, etc., about files
in list (excluding those in xlist) contained in the specified .zip archive(s).
"file[.zip]" may be a wildcard name containing *, ?, [] (e.g., "[a-j]*.zip").

usage: zipinfo [-12smlvChMtTz] file[.zip]
[list...] [-x xlist...]
or: unzip -Z [-12smlvChMtTz] file[.zip]
[list...] [-x xlist...]

main listing-format options: -s short Unix "ls -l" format (def.)
-1 filenames ONLY, one per line -m medium Unix "ls -l" format
-2 just filenames but allow -h/-t/-z -l long Unix "ls -l" format
-v verbose, multi-page format
miscellaneous options:
-h print header line -t print totals for listed files or for all
-z print zipfile comment -T print file times in sortable decimal format
-C be case-insensitive -M page output through built-in "more"
-x exclude filenames that follow from listing
 
Upvote 0
I tried using apkmultitool to sign my apk and its just not working and since i am unable to sign the SYSTEM apk, android refuses to read it correctly or even read it at all. I'm sure if this was not a system apk id have success right now but instead its driving me nuts!

Yeah, I never tried repacking, zipaligning, and signing a system apk.
 
Upvote 0
I tried using apkmultitool to sign my apk and its just not working and since i am unable to sign the SYSTEM apk, android refuses to read it correctly or even read it at all. I'm sure if this was not a system apk id have success right now but instead its driving me nuts!


If you just want to change a .png, the using something liek 7-zip and "drag and drop" the new png to the old apk is your best bet.

if thats not working, using apl multi-tool, you CANNOT sign a system apk with the signature from multitool. you need to choose "sign system apk", go through the normal steps and such. then take the output apk, delete the androidManifest and the ENTIRE META-INF folder, and copy the old, working manifest(from the apk you DEcomiled), AND metainf into your new recompiled apk. the Manifest and Meta-inf are the "signature". if those dont match the old apk, they wont work.

your other option, is to edit those files, and get the system keys, which is usually impossible to get. it can be done for some phones, but is usually not possible. basically you need what they used at the factory.

if using the 7-zip doesnt work, and using the copy your old sighnature doestn work, sometimes you can try to just decompile the resources(xml) and NOT the source code..... mms(as well as phone) can be an especially tricky system app to toy around with, so you may have to try all options.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones