[Q] How to edit the source of an Apk file? - General Questions and Answers

I do these works :
1-unzip the apk file
2-convert classes.dex to classes.jar with dex2jar
3-read source of jar file with java De compiler
Now I want to edit the .class file.
Can anyone help me ?

resettailor said:
I do these works :
1-unzip the apk file
2-convert classes.dex to classes.jar with dex2jar
3-read source of jar file with java De compiler
Now I want to edit the .class file.
Can anyone help me ?
Click to expand...
Click to collapse
Better use apktool or apk multi tool it's amazing in terms for apk decompiliation and compilation.
Try you can find most of it
Press thanks button if Helped!

It really helped!
Thanks!
nightwalker said:
Better use apktool or apk multi tool it's amazing in terms for apk decompiliation and compilation.
Try you can find most of it
Press thanks button if Helped!
Click to expand...
Click to collapse

resettailor said:
It really helped!
Thanks!
Click to expand...
Click to collapse
Really happy to know that

Related

[Q][OffTopic] Basic requirements for decompiling and recompiling apks

Hey guys what are the basic things we need to decompile and recompile apk? And which is the best tool for this task?
Please tell in detain
Thanks annoying bee
Sent from my HTC powered with Minimilised ROM
Annoying Bee said:
Hey guys what are the basic things we need to decompile and recompile apk? And which is the best tool for this task?
Please tell in detain
Thanks annoying bee
Sent from my HTC powered with Minimilised ROM
Click to expand...
Click to collapse
Hi..
Best tool will be apktool.. on windows or on linux..
Apktool for it.. Check details on the original thread for it..
Its pretty simple..
with latest apktool you can not only decompile and recompile apks but also jar files using apktool ... by
Code:
apktool d <nameofile>
or
Code:
apktool b <nameoffile>
Annoying Bee said:
Hey guys what are the basic things we need to decompile and recompile apk? And which is the best tool for this task?
Please tell in detain
Thanks annoying bee
Sent from my HTC powered with Minimilised ROM
Click to expand...
Click to collapse
Check this:
http://stackoverflow.com/questions/1249973/decompiling-dex-into-java-sourcecode
akshat.shenoy said:
Hi..
Best tool will be apktool.. on windows or on linux..
Apktool for it.. Check details on the original thread for it..
Its pretty simple..
with latest apktool you can not only decompile and recompile apks but also jar files using apktool ... by
Code:
apktool d <nameofile>
or
Code:
apktool b <nameoffile>
Click to expand...
Click to collapse
Yeah i used it but problems in recompiling apks! So i modded apktool on my own.

smali help

hello everyone
i searched a lot but couldnt find anything so postiong here
i was trying to add some featues to home.apk and i got some errors while recompiling
so i tried decompile and recompile without editing anything...i didnt even open the decompiled home apk folder LOL
but i am getting lots of smali errors only in styles.xml
i think that apktool removes some templates from styles.xml i dont know what it means i just got it from my search
so can someone help me in fixing that error....
@serajr
 @SpaceCaker
 @marcussmith2626
 @iSiddharth
Either wrong framework loaded or using wrong apktool version
And please stop abusing the mention system - I won't reply to anymore mentions
marcussmith2626 said:
Either wrong framework loaded or using wrong apktool version
And please stop abusing the mention system - I won't reply to anymore mentions
Click to expand...
Click to collapse
Ah sorry
But what do u mean by WRONG apktool version??
abhishekr700 said:
Ah sorry
But what do u mean by WRONG apktool version??
Click to expand...
Click to collapse
use
gingerbread/ics/jb 1.5.2
https://code.google.com/p/android-apktool/downloads/list
jb/kitkat/lolipop apktool rc3
https://bitbucket.org/iBotPeaches/apktool/downloads
use correct framework-res
plus any other framework eg tw-framework
Use Advanced APK Tools for decompiling the APK files and you can also use the Attached Dex Editor to edit classes.dex files.....
Advanced APK tools is specially made for Xperia devicex. (use your "framework-res.apk" to install firmware in Advanced APK Tools)
(Drag and drop classes.dex in "Quick-Baksmali.cmd" to decompile and drag and drop the output folder is "Quick-Smali.cmd" to recompile.
Advanced APK Tools : http://forum.xda-developers.com/showthread.php?t=2639400

[Guide] How To Deodex Jar Files Without Deodexing Rom

Note:- Select aapt version same as your android version
like for jb 4.1.2 aapt = 4.1
for jb 4.2 aapt = 4.2
Requirements:-
Apktool 1.5.2 (mobile apktool)
Busybox installed
framework.jar
framework.odex
Patience.apk
Brain.jar
Procedure:-
1) Create A folder named Deodex in your sdcard.
2) Copy framework.jar and framework.odex to it.
3) Now using apktool decompile framework.odex
4) When it gets decompiled recompile it again.
5) When it gets recompiled , it will either form framework.dex or classes.dex ,,,, click on it and select add to the jar of same name.
6) Now your jar file is completely deodexed.
I have taken the example of framework.jar but you can do it with other jars also with same procedure.
Dont forget to hit thanks
Credits:- Apktool Developer and Apps Developer
eboybasit said:
Note:- Select aapt version same as your androidversion
like for jb 4.1.2 aapt = 4.1
for jb 4.2 aapt = 4.2
Requirements:-
Apktool 1.5.2 (mobile apktool)
SystemUI.apk
SystemUI.odex
Patience.apk
Brain.jar
Procedure:-
1) Create A folder named Deodex in your sdcard.
2) Copy SystemUI.apk and SystemUI.odex to it.
3) Now using apktool decompile SystemUI.odex
4) When it gets decompiled recompile it again.
5) When it gets recompiled , it will either form SystemUI.dex or classes.dex ,,,, click on it and select add to the apk of same name.
6) Now your apk is completely deodexed.
I have taken the example of systemui.apk but you can do it with other apks also with same procedure.
Dont forget to hit thanks
Credits:- Apktool Developer and Apps Developer
Click to expand...
Click to collapse
http://forum.xda-developers.com/android/development/guide-how-to-deodex-app-pcfully-t2979042
For your information I already posted this guide here..... That also around 5 months ago
sdeepb said:
http://forum.xda-developers.com/android/development/guide-how-to-deodex-app-pcfully-t2979042
For your information I already posted this guide here..... That also around 5 months ago
Click to expand...
Click to collapse
oh sorry i didn't it saw
sdeepb said:
http://forum.xda-developers.com/android/development/guide-how-to-deodex-app-pcfully-t2979042
For your information I already posted this guide here..... That also around 5 months ago
Click to expand...
Click to collapse
I changed my guide now its for jar files
eboybasit said:
oh sorry i didn't it saw
Click to expand...
Click to collapse
It's okay..... So what you'll do now
sdeepb said:
It's okay..... So what you'll do now
Click to expand...
Click to collapse
My thread applicable to jar files now ,,,, so no issues with your thread
Okay....
sdeepb said:
Okay....
Click to expand...
Click to collapse
Okay
Thread closed.
We already have an apk tool thread
http://forum.xda-developers.com/android/development/guide-how-to-deodex-app-pcfully-t2979042

compile source code

Hey Guys I need to compile source code of a app and it is in java so apktool will not work and also don't advice eclipse if you can provide how to convert .java to smali that will also help
Noobdead said:
Hey Guys I need to compile source code of a app and it is in java so apktool will not work and also don't advice eclipse if you can provide how to convert .java to smali that will also help
Click to expand...
Click to collapse
Use the compiled bytecode .class file with dx
Then use baksmali to get .smali from .dex files
Code:
dx --dex --output=filename.dex compiled_file.class
baksmali filename.dex

[HELP] JAVA problem

Hello everyone,
I have some problems with the tool to decompile the apk. I wanted to apply these two guides:
http://forum.xda-developers.com/goo.../how-to-add-ambient-display-settings-t2942838
http://forum.xda-developers.com/goo.../mod-3-power-menu-stock-5-0-1-deodex-t2997128
But I get this when I start decompilation:
http://pastebin.com/eNrejMCh
Some help / suggestions?
Which apk decompiler do you use ? The output said the decompiler could not read / decompile the arsc file from your apk
F4uzan said:
Which apk decompiler do you use ? The output said the decompiler could not read / decompile the arsc file from your apk
Click to expand...
Click to collapse
I use apkstudio-2.0.3b-windows, systemUI.apk and framework-res.apk come from Android M
ZenPluS said:
I use apkstudio-2.0.3b-windows, systemUI.apk and framework-res.apk come from Android M
Click to expand...
Click to collapse
As far as I know, Android M is still unsupported for such operation (decompiling apk, etc) so you might want to wait until the decompiler become compatible with M releases
F4uzan said:
As far as I know, Android M is still unsupported for such operation (decompiling apk, etc) so you might want to wait until the decompiler become compatible with M releases
Click to expand...
Click to collapse
uhh okay, thanks for your help! :good:
ZenPluS said:
uhh okay, thanks for your help!
Click to expand...
Click to collapse
Happy to help ! Do post again if you encounter another issue

Categories

Resources