[Q] Editing an APK, any APK. - Android Q&A, Help & Troubleshooting

EDIT: Figured it out.

Care to share?

Yeah, will be nice if you could share this information with others

aitorTheRed said:
Yeah, will be nice if you could share this information with others
Click to expand...
Click to collapse
Man, I hate it when people do that...
1. Search for APK Manager in XDA and install it on your PC
2. Download and Install the Android SDK kit on your PC
3. Follow the instructions for APK Manager and place the APK file in the modding folder
4. Open APK Manager and select Decompile APK (Your APK file will be placed in a separate folder for you to work on)
5. Change what you want to change in the APK
6. Recompile the APK and sign it (unless it's a system file like framework, those are not signed)
A lot more is involved in modding an APK file and you really should know something about how the files inside the APK work before you go changing things, but in a nutshell, that's the basics.
Hope that helps!

What I have learned.
I had a specific question, but here is what I can tell you.
1. Setup APK Manager, it saves a lot of command line typing.
2. Pretty much always use option 9 and 11, never 1 or 3.
3. If you are simply changing graphics and not smali or XML files, don't use this, open it in 7zip and drag the files. Decompiling changes the image darkness sometimes.
4. Unless you are working on your own apk file, always say yes to 'is it a system apk', when it asks you to keep existing files, say yes. Delete from the 'keep' folder what you edited.
5. If you edit XLM files, delete resources.arsc from the file, this is where they all get compiled to.
6. You can use this for jar files, just rename to apk then back to jar when finished.
7. If you get an error try using option 20 to increase the memory to 1024.
8. If you edit jar files, delete classes.dex in the 'keep' folder when compiling.
9. Treat all files as signed system files (as noted above) and you will be much safer. If the file has a signature on it, this will save it.

Thanks for the info

Is there anything that can install system files. They won't install with ap manager so does it have to be pushed?
Sent from my Desire HD using XDA Premium App

Related

Edit Apk files

anyone can tell me how to edit apk files and change the name of applications.
and how to use apkedit application.
To start with APK files are just zip files. Rename the extension from .APK to .zip and u would b able extract it. I will post more as soon as get on a PC.
Sent from my LG-P500 using XDA Premium App
hey still i want more information about how to edit apk files and change the name of the application
Never done it, but this might me helpful: http://code.google.com/p/android-apktool/
Doesn't get much easier than Apk Edit
thanks for the help everyone but still anyone can give more information then please post
Download
http://code.google.com/p/android-ap...ame=apktool-install-windows-2.2_r01-3.tar.bz2
Extract it using your favoirate zip application.
Requirements:
* JRE 1.6 (Java Runtime Environment)
Get the apk file which u wanna hack in the folder where you have extracted the apktool. (Like c:\apktool)
Rename the .apk to .zip and extract it. (talk.apk is now talk.zip and after extraction we have folder talk)
You will find AndroidManifest.xml in that folder.
Open it with Notepad++ (I prefer Notepad++)
You will find android:label and the name of app and icon details and many more thing change all you want but dont mess up the structure.
open command prompt then cd to the folder where you have extracted apktool. then type .
apktool.bat b "folder name" "APK name" . (Eg. apktool.bat b talk notalk.apk)
Tip: If you are not getting me i think you shouldnt do it......

[Q] Recompiling an apk correctly

I've made some aesthetic changes i like to my GO Launcher EX apk, which is a non system apk. The change I made was to some dock images, which did not have the .9 extension. Everything goes smoothly until I try to install my compiled .apk. If i leave it unsigned, it won't install, but if i sign it, it will. However, when i open it, the screen flickers constantly and will not respond. I'm out of ideas.
FYI, I compile/decompile with Apkmanager and edit with Gimp.
If you're not doing any thing with 9 patch images than there is no need to decompile in the first place. Get 7zip on computer. Right click apk/7zip/open archive and you can navigate to Res/drawable-hdpi and you can extract the drawable-hdpi folder to desktop and do what you need to with the images (non 9's) and drag new edited images into the open 7zip window in the proper place close 7zip window. Once done you only need to use apk mananger to sign the apk and push back to device.
good day. using xda premium.

[Q] theme skinning help???

Anyone mind sharing a link or some directions on skinnning themes?
I've had someone give me these instructions:
1) extract/Decompile the .apk file you want to MOD or make changes to. Use m10 editor for this.Select the option "decomplie all"
2) Minimize the m10 editor, and open the folder where you m10 editor is installed. There you would find a folder with the name of the .apk file you just decomplied. Go to folder assests>"base theme name">drawble>shared folder.
3) now select the .png files you want to edit. Install Paint.net, and edit with them, it was easy process for me. Remeber to "flip image vertical" after you are done with editing.
4) now go back to m10 editor, and Save the file.
5) You should have AndroidSDK installed.If not, do it. Then go to the folder where you have installed it. open the "autosign" file. It will open command prompt. There select the option to sign the file manually. Give the path for the file. It will sign it then. Exit from that program.
6) you are done, you can install it now.
I've gotten this far, but i can't find out how to change these 3 things below:
In de-compiled files changes have to b made in three places.
1. Androidmanifest.xml (name of package). how do u change this?
2. Res\values\strings.xml (name of theme). how/where do u change this?
3. Assets\shared(change this to theme name) h0w/where do u change this?
Also everytime I replace the background images, when I recompile it, my background images don't stay.
Any help would be much appreciated...
okay so i hate to tell you to download something else but i use .apk manager and it is a lot more straight forward.
decompile the apk using that.
go into the projects folder, you will see the Androidmanifest.xml
what are you trying to change in there exactly? if its just icons things like that those are easy but if you are trying to change the packageID it will just cause FC's
strings.xml hangs out in the following
projects->*.apk(this will be the name of what you decompiled)->res->values->strings.xml
then go into the xml and it will have a line with the name of the apk that you can change
assets has it's own folder i haven't hung out in there at all i haven't really had a need but it is in the same file tree with the res folder
now the issue upon recompiling, when doing the recompile in apk manager press y and y to the 2 options, it will create a keep folder go into that and delete the classes.dex if you messed with any images in the drawable folders, and the resources.arsc if you changed any of the xmls. then go into the keep directories sub folders and delete the items you changed then finish the compiling
sorry if i am not the best at explaining this
Yes, what exactly do you want to change? Taskbar and other icons are very easy to do, however, I haven't done any M10 files, yet.
In the manifest you need to change the name of the apk to what you are naming it. you will see a line which will have package="com.htc.skin."apkname".
So for my zombie skin example my line says "com.htc.skin.zombie"
Also to that point what ever you name it you need to navigate to the foler that holds the m10 file and change the folder to the same name or the m10 file wont be used.
jkrough0728 said:
In the manifest you need to change the name of the apk to what you are naming it. you will see a line which will have package="com.htc.skin."apkname".
So for my zombie skin example my line says "com.htc.skin.zombie"
Also to that point what ever you name it you need to navigate to the foler that holds the m10 file and change the folder to the same name or the m10 file wont be used.
Click to expand...
Click to collapse
exactly the same, boy did that drive me nutty for a few days!!
jkrough0728 said:
In the manifest you need to change the name of the apk to what you are naming it. you will see a line which will have package="com.htc.skin."apkname".
So for my zombie skin example my line says "com.htc.skin.zombie"
Also to that point what ever you name it you need to navigate to the foler that holds the m10 file and change the folder to the same name or the m10 file wont be used.
Click to expand...
Click to collapse
using apk manager are u guys decompiling using option 9 or 10 and if ur using option 10 what framework are u dragging into it?
keedog said:
using apk manager are u guys decompiling using option 9 or 10 and if ur using option 10 what framework are u dragging into it?
Click to expand...
Click to collapse
I use apktool but if your using manager it would be 9.
sent from my Evo 3D from xda app

Re-compile framework-res.apk (Custom Rom)

I got this figured out already, sorry about that.
Who ever thanked me, I wasn't posting a guide but a question.
I am trying from a fresh firmware base to learn from scratch but no idea how to get that framework to compile correctly.
did you install framework first?
Code:
apktool if framework-res.apk
Easy
I had problems with the apk tool and recompiling. The way I ended up doing it is:
I didnt decompile the framework-res.apk.
rename the file framework-res.apk.zip
open it with 7zip.
Extract the files you are wanting to work on
Do what ever work on the files you need done
Drag and drop the files back in the directories they go into while file is open in 7zip
Close 7zip
Rename file back to framework-res.apk
push to phone with adb
No decompile or recompile.
Hope this helps
Chadw1985 said:
I had problems with the apk tool and recompiling. The way I ended up doing it is:
I didnt decompile the framework-res.apk.
rename the file framework-res.apk.zip
open it with 7zip.
Extract the files you are wanting to work on
Do what ever work on the files you need done
Drag and drop the files back in the directories they go into while file is open in 7zip
Close 7zip
Rename file back to framework-res.apk
push to phone with adb
No decompile or recompile.
Hope this helps
Click to expand...
Click to collapse
If you just want to modify one of the 'normal' XML files or an image then that approach will work fine. The problem is he wants to edit the bool.xml file and that is contained in the 'resources.asrc' file and you need to decompile it first.
I am in the same situation although someone managed to edit the file for me and recompile it so I got there in the end, just not by doing it myself.
I followed the instructions you describe and the file never recompiled properly - or at least my device never booted with the one I recompiled
Try it like this:
1. Place APK in "place-apk-here-for-modding"
2. Choose "9" to Decompile
3. Grab resource "resources.arsc" from framework-res.apk
4. Do my edit in projects\framework-res.apk\res\values\bools.xml
5. Compile - Yes (system app) - Yes (copy files)
6. Go to "keep" folder and delete "resources.arsc" and the bools.xml file
7. Press any key
8. Either push by ADB or Root Explorer or Flash
nickiberli said:
Try it like this:
1. Place APK in "place-apk-here-for-modding"
2. Choose "9" to Decompile
3. Grab resource "resources.arsc" from framework-res.apk
4. Do my edit in projects\framework-res.apk\res\values\bools.xml
5. Compile - Yes (system app) - Yes (copy files)
6. Go to "keep" folder and delete "resources.arsc" and the bools.xml file
7. Press any key
8. Either push by ADB or Root Explorer or Flash
Click to expand...
Click to collapse
I have tried exactly like this and it didn't work for me. I downloaded lots of different APK tools and tried them all - there were comments about using older versions of apktool.jar etc. I kept getting different sizes of the output file depending on which one I used. I gave up in the end as someone edited the file for me and it was only one specific entry in bool.xmls I wanted changing. As far I could tell we were both doing exactly the same thing.
The last thing I said I was going to do was wipe the PC I was attempting to do this on. I never got round to doing it... I'd be interested to know why I could never get this working though
Andy
Give me the framework and tell me what u want to do.
I will do that for u
Btw is the framework ICS based?
Sent from my Micromax_A70 using Tapatalk 2 Beta-4
You have resigned?
Greets!

[Q] How should I de/recompile a system app? What did I do wrong?

Hi,
So the situations is like this:
Just got a new LG Nexus 4, NFC enabled, GREAT!!!!
But then I start using it, and the NFC sound (everytime the phone reads a nfc-tag it makes an sound) annoys me beyond belief.
So I start looking around, it seems there's no solution, except recompiling the app.
So I learn how to compile an app (noob here), using this guide: http://forum.xda-developers.com/showthread.php?t=1860115
I'm up to the point where my apk is decompiled, and I have modified the sound files, located in my decompiled files folder respectively at res/raw/start.ogg & res/raw/end.ogg.
I modded the files using audacity, lowering the volume to zero, used them to replace the original .ogg files. The file size is a bit smaller as the original ones (1Kb difference).
Next I use the recompile command: apktool b decompiled_apk_folder_with_modified_files modded_apk_file.apk
So now I have the new nfc apk file, called NfcNci.apk, with which I replace the original file in /system/app.
Next up I reboot my phone into recovery, wipe all cache and dalvik cache, and reboot again.
First thing that pops up on my screen is a force-close message, saying that the nfc-service force closed.
Anyone who can tell me what I did wrong? Or how I can fix this?
Attached are: my decompiled-files-folder (compressed to zip)
the original NfcNci.apk file
my modded NfcNci.apk file which causes the FC's.
Any help will be greatly appreciated!!!!
S.
Looks like you're still on 4.2
The latest NfcNci.apk has some more files.
And your apk is missing the META-INF folder.
I guess that this is the problem.
But you should use "adb logcat" to ensure we're on the right track.
Micky
1 thing i would recomend is not using the actual apk you just built. instead, open your new apk with a file manager such as 7zip and remove your newly compiled files out of it, then put them into the original apk from your rom using 7zip as well! thus keeping the apk's original signature
try to copy the least amount of files from one to another, so to be safe only pull out your new .ogg files, then put them into your original apk! hope this helps
ldrifta said:
1 thing i would recomend is not using the actual apk you just built. instead, open your new apk with a file manager such as 7zip and remove your newly compiled files out of it, then put them into the original apk from your rom using 7zip as well! thus keeping the apk's original signature
try to copy the least amount of files from one to another, so to be safe only pull out your new .ogg files, then put them into your original apk! hope this helps
Click to expand...
Click to collapse
Hi, I tried this, installed 7zip, and double clicked the original apk, I opende the res/raw/ directory, and only copied the files I was using: start.ogg & end.ogg. Then I close 7zip, and send the file to my phone. But as soon as I it them to /system/apps on my phone, and reboot to recovery, wiping the dalvik cache. I get FC's on reboot (NFC-service has FC'd).
Any reasons for this?
Thanks for the help, both of you!
BTW: I'm on Android 4.3 JB

Categories

Resources