[Q] ApkTool Problem, while trying to decompile apk!! - Android Q&A, Help & Troubleshooting

ok heres my problem, i downloaded apk multi-tool, and everything was working right, but after few days, i tried to modified this app, but whenever i apply the option "decompile" the cmd window close by itself, without saying theres an error... do you guys have any idea about whats going on???

I'm no expert, but this is how I used to decompile APKs:
1) Rename the file "ABC.apk" to "ABC.zip"
2) Open the zip file
3) Copy out the file "classes.dex"
4) Use dex2jar (search Google for some tutorials) to convert it into a jar file
5) Use jd-gui (search Google for some tutorials) to decompile the jar file

the apk tool from Google or apkmulti which one did u use sir ..??

i fixed my problem, one of them was the system variables path "C\\windows\system32" the 2nd was because there was an space in the name of the apk i was trying to decompile.. thank you for taking your time to answer...

Related

[Q] Decoding and re-encoding apks with APKTOOL

So I've decoded a launcherpro apk and gotten all the files inside.
I've edited them changing only some images(not .9.pngs) and some text strings for a translation.
I don't really know how to re-encode the file and sign it.
I tried using APKtools to repack but ASTRO won't let me install it saying it can't open it as an apk file.
Any help is appreciated
i cant get apktools to do anything other than decompile...
if you got it to compile your apk but dont know how to sign it, use this: http://androidforums.com/developer-101/8665-how-signing-roms.html
its what i use to sign zips and apks and it works very well and is easy. the "auto sign" or qwhatever opetion doesnt ever work for me, but option 4, manual, works fine
if you havent installed the framework-res.apk that may be why you cant compile
what you need to do is pull out the framework-res.apk and put it in you root directory then in terminal use this.
code: apktool if framework-res.apk

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] Editing an APK, any APK.

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

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] Apk Edit

Hello ,
I want to install this mod -- > http://forum.xda-developers.com/showthread.php?t=1695202
I decompiled SystemUI.apk and changed bools.xml by Notepad. And I returned script.bat and I selected Compile apk. But error. I tried lots of apk manager but error.
On Notepad , need changed Coding / Character Group ??
If I open apk manager and I saw ADB not found. But apk manager is working , I selected decompile apk , Apk manager decompiled systemUI.apk but I can't compile apk. Thank you..
Ok if i remember correctly, you can open the apk with 7zip, modify the files you want to and they should work. I tried this with systemui.apk before and it worked..
NightWatch71 said:
Ok if i remember correctly, you can open the apk with 7zip, modify the files you want to and they should work. I tried this with systemui.apk before and it worked..
Click to expand...
Click to collapse
I can't arrived values files by 7zip. Need Decompile apk by apk manager..
Arnadel said:
Hello ,
I want to install this mod -- > http://forum.xda-developers.com/showthread.php?t=1695202
I decompiled SystemUI.apk and changed bools.xml by Notepad. And I returned script.bat and I selected Compile apk. But error. I tried lots of apk manager but error.
On Notepad , need changed Coding / Character Group ??
If I open apk manager and I saw ADB not found. But apk manager is working , I selected decompile apk , Apk manager decompiled systemUI.apk but I can't compile apk. Thank you..
Click to expand...
Click to collapse
I have had issues in the past using notepad to edit apk files. I suggest that you use notepad++ for editing xml and smali files. It can be easily found with a Google search. Using notepad will probably give you formatting issues.
Sent from my SGH-I777 using xda premium

Categories

Resources