Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Note: All of the following instructions apply universally (aka to all OSes) unless otherwise specified.</strong></p> <hr> <h1>Prerequsites</h1> <p>You will need:</p> <ul> <li>A working <a href="https://java.com/en/download" rel="nofollow noreferrer" title="Download Java">Java installation</a></li> <li>A working terminal/command prompt</li> <li>A computer</li> <li>An APK file</li> </ul> <h1>Steps</h1> <h2>Step 1: Changing the file extension of the APK file</h2> <ol> <li><p>Change the file extension of the <code>.apk</code> file by either adding a <code>.zip</code> extension to the filename, or to change <code>.apk</code> to <code>.zip</code>.</p> <p>For example, <code>com.example.apk</code> becomes <code>com.example.zip</code>, or <code>com.example.apk.zip</code>. Note that on Windows and macOS, it may prompt you whether you are sure you want to change the file extension. Click <kbd>OK</kbd> or <kbd>Add</kbd> if you're using macOS:</p></li> </ol> <p><a href="https://i.stack.imgur.com/54mAy.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/54mAy.jpg" alt="macOS add extension confirm dialog"></a></p> <h2>Step 2: Extracting Java files from APK</h2> <ol> <li><p>Extract the renamed APK file in a specific folder. For example, let that folder be <code>demofolder</code>.</p> <ul> <li><p>If it didn't work, try opening the file in another application such as WinZip or 7-Zip.</p></li> <li><p>For macOS, you can try running <code>unzip</code> in Terminal (available at <code>/Applications/Terminal.app</code>), where it takes one or more arguments: the file to unzip + optional arguments. See <code>man unzip</code> for documentation and arguments.</p></li> </ul></li> <li><p>Download <a href="https://github.com/pxb1988/dex2jar/releases/download/2.0/dex-tools-2.0.zip" rel="nofollow noreferrer"><code>dex2jar</code></a> <a href="https://github.com/pxb1988/dex2jar/releases" rel="nofollow noreferrer">(see all releases on GitHub)</a> and extract that zip file in the same folder as stated in the previous point.</p></li> <li><p>Open command prompt (or a terminal) and change your current directory to the folder created in the previous point and type the command <code>d2j-jar2dex.bat classes.dex</code> and press enter. This will generate <code>classes-dex2jar.jar</code> file in the same folder.</p> <ul> <li><strong>macOS/Linux users:</strong> Replace <code>d2j-jar2dex.bat</code> with <code>d2j-jar2dex.sh</code>. In other words, run <code>d2j-jar2dex.sh classes.dex</code> in the terminal and press enter.</li> </ul></li> <li><p>Download <a href="http://jd.benow.ca" rel="nofollow noreferrer"><em>Java Decompiler</em></a> <a href="https://github.com/java-decompiler/jd-gui/releases" rel="nofollow noreferrer">(see all releases on Github)</a> and extract it and start (aka double click) the executable/application.</p></li> <li><p>From the JD-GUI window, either drag and drop the generated <code>classes-dex2jar.jar</code> file into it, or go to <code>File &gt; Open File...</code> and browse for the jar.</p></li> <li><p>Next, in the menu, go to <code>File &gt; Save All Sources</code> (Windows: <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>S</kbd>, macOS: <kbd>⌘</kbd>+<kbd>⌥</kbd>+<kbd>S</kbd>). This should open a dialog asking you where to save a zip file named `classes-dex2jar.jar.src.zip" consisting of all packages and java files. (You can rename the zip file to be saved)</p></li> <li><p>Extract that zip file (<code>classes-dex2jar.jar.src.zip</code>) and you should get all java files of the application.</p></li> </ol> <h2>Step 3: Getting <code>xml</code> files from APK</h2> <ul> <li>For more info, see the <a href="https://ibotpeaches.github.io/Apktool/install/" rel="nofollow noreferrer"><code>apktool</code> website</a> for installation instructions and more</li> <li><p>Windows:</p> <ol> <li>Download the <a href="https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/windows/apktool.bat" rel="nofollow noreferrer">wrapper script (optional)</a> and the <a href="https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.3.1.jar" rel="nofollow noreferrer">apktool jar (required)</a> and place it in the same folder (for example, <code>myxmlfolder</code>).</li> <li>Change your current directory to the <code>myxmlfolder</code> folder and rename the apktool jar file to <code>apktool.jar</code>.</li> <li>Place the <code>.apk</code> file in the same folder (i.e <code>myxmlfolder</code>).</li> <li><p>Open the command prompt (or terminal) and change your current directory to the folder where <code>apktool</code> is stored (in this case, <code>myxmlfolder</code>). Next, type the command <code>apktool if framework-res.apk</code>.</p> <p>What we're doing here is that we are installing a framework. For more info, see the <a href="https://ibotpeaches.github.io/Apktool/documentation/#frameworks" rel="nofollow noreferrer">docs</a>.</p></li> <li>The above command should result in "Framework installed ..."</li> <li><p>In the command prompt, type the command <code>apktool d filename.apk</code> (where <code>filename</code> is the name of apk file). This should decode the file. For more info, see the <a href="https://ibotpeaches.github.io/Apktool/documentation/#decoding" rel="nofollow noreferrer">docs</a>.</p> <p>This should result in a folder <code>filename.out</code> being outputted, where <code>filename</code> is the original name of the apk file without the <code>.apk</code> file extension. In this folder are all the XML files such as layout, drawables etc.</p></li> </ol></li> </ul> <p><em>Source: <a href="http://comptech-blogger.blogspot.in/2012/09/how-to-get-source-code-from-apk-file.html" rel="nofollow noreferrer">How to get source code from APK file - Comptech Blogspot</a></em></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload