12

I try to get source code from an .apk

I followed the steps from right here Is there a way to get the source code from an APK file? but on Step 2.4 when I wrote on my cmd dex2jar path> d2j-dex2jar classes.dex I get

"'d2j-dex2jar' is not recognized as an internal or external command, operable program or batch files."

any solutions ?

Community
  • 1
  • 1
ghita
  • 2,746
  • 7
  • 30
  • 54

7 Answers7

27

for dex2jar 2.0 version please follow below steps to generate jar

  1. download dex2jar (https://sourceforge.net/projects/dex2jar/files/)
  2. extract folder
  3. goto folder in command prompt
  4. chmod u+x d2j_invoke.sh
  5. chmod u+x d2j-dex2jar.sh
  6. put desired apk to decompile in dex2jar folder
  7. sh d2j-dex2jar.sh -f -o output_jar.jar my_app.apk
  8. This will generate output_jar.jar in same folder
vikoo
  • 2,451
  • 20
  • 27
20

Use dex2jar classes.dex instead of d2j-dex2jar classes.dex And please check which version of dex2jar is with you. if it is dex2jar-2.x jar file then , please try to download dex2jar-0.0.9.15 jar file.

Muhammed Refaat
  • 8,914
  • 14
  • 83
  • 118
Tara
  • 2,598
  • 1
  • 21
  • 30
5

Add permission with: chmod +x d2j-dex2jar.sh Then run it with: ./d2j-dex2jar.sh app.apk

DoronK
  • 4,837
  • 2
  • 32
  • 37
1

place all the apk file, coverted zip, apktool, apktool install, dex2jar, jd-gui folders under a single folder... open command prompt(admin).. then goto the directory of your newly created folder.. then type... d2j-dex2jar classes.dex , press enter... thats it ur problem is solved...cheezzz

no need to add any xtra permissions...it workwed for me..it'll work for you too...

Darshu
  • 11
  • 1
1

If you have downloaded the d2j-dex2jar-2.x then it would not contain the d2j-dex2jar.sh file

so, try to download the dex2jar-0.0.9.15 from the link dex2jar-0.0.9.15

Finally extract this zip file and you will find the d2j-dex2jar.sh file.

Hopefully this will help you!

Aman Kumar Gupta
  • 2,640
  • 20
  • 18
0

Just goto the folder where you put your classes.dex file then just run the command in command prompt https://i.stack.imgur.com/8X3aP.png

-Make sure you have downloaded the dex2jar latest version which is dex2jar-2.0. download it with this link

https://sourceforge.net/projects/dex2jar/

-It will then make your classes.dex file to executable jar 'classes-dex2jar.jar'

0

you must use dex2jar-0.0.9.15 to decompile apk older version dos'nt work correctly because missing some files via extension bat