Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert .apk files to java

Tags:

java

android

apk

How to convert .apk files to java in android.

like image 982
user555910 Avatar asked Jan 01 '11 10:01

user555910


People also ask

Can you convert APK to jar?

Yes, MConverter supports batch converting of multiple APKs to JARs simultaneously. You can even drag and drop folders containing APKs to convert to JAR. Pasting APK files and folders copied in the clipboard also works: use Ctrl+V.

Are APK files Java?

It's the Android operating system's version of a . zip file. It contains all the resources an app needs to run, including its Java code, native libraries, assets, manifest file, resource files, etc. The APK file format was created, so developers could deliver software to devices in a single compressed file.

Can we convert APK to code?

We use reverse engineering process to get the source code. There are several tools available on the internet like dex2jar, apktool, etc. that will help you to convert apk to soruce code. But for that you have to run several commands and follow lengthy process.


1 Answers

The extension Google uses for Android Applications (APK) may seem a bit complicated at first, but it really isn’t. In fact, an .apk is nothing else than a .zip file disguised as an .apk. That’s dumbing it down, but you get it. Essentially, if one wanted to see what’s inside an app, they would just change the extension of application-name.apk to application-name.zip, unzip it. And there you have it: The contents of the .apk! We aren’t done yet, read more after the break. Here is where it gets tricky. Inside the folder where you unzipped the contents of the application, you’ll find a file named classes.dex. That’s the most important file of the whole application, containing all the java files, but it’s encrypted! No worries, that can easily be solved. You’ll need two things:

  1. Dex2Jar from http://code.google.com/p/dex2jar/
  2. A regular Java decompiler, such as JD from http://java.decompiler.free.fr

Copy classes.dex to the folder where you unzipped Dex2Jar, and run from the command line: “dex2jar.bat classes.dex” This will produce a file, strangely named something like: “classes.dex.dex2jar.jar” If you have WinRAR installed, you can just unpack the files. If you don’t, install it. Now go ahead and adjust it to your liking!

like image 118
sajjad ali Avatar answered Nov 07 '22 05:11

sajjad ali