• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

I Like Kill Nerds

The blog of Australian Front End / Aurelia Javascript Developer & brewing aficionado Dwayne Charrington // Aurelia.io Core Team member.

  • Home
  • Aurelia 2
  • Aurelia 1
  • About
  • Aurelia 2 Consulting/Freelance Work

How To Decompile And Compile Android APK's On A Mac Using Apktool

General · September 22, 2014

Most instructions around on the web for decompiling and compiling Android APK files are for Windows PC users, but what about Mac users who have a native command line yo?

The steps are pretty much the same, except you need to do one more thing.

Requirements
– A Mac
– An internet connection
– Java SDK and JRE
– Android SDK
– Apktool

Step 1 – Install Java SDK and JRE

You can download Java from this link. The Apktool will mostly use the SDK libraries, but JRE will be required for some tasks, so we install both just in-case.

Step 2 – Install the Android SDK

Working with APK files, naturally we will require the Android SDK. You can download the Android SDK from this link.

Step 3 – Download the Apktool

Download the Android Apktool from this link. This is a Java application that we will run from the command line and includes everything necessary to decompile and compile Android APK files.

Step 4 – Root permissions

These instructions will assume Mac OS Mavericks, but they’re largely the same for other versions as well. Root permission is required for the breadth of tasks we will be performing and the permissions the Apktool requires to compile and decompile.

  • Open “System Preferences”
  • Click “Users & Groups”
  • Click “Login Options” shown in the left hand pane at the bottom
  • Click the padlock at the bottom left to make changes
  • Click “Join” next to the text “Network Account Server”
  • Click “Open Directory Utility” in the dialog that pops up
  • In the popup, click the padlock in the bottom left again to make changes
  • In the top menu bar of the screen, click “Edit” and then click “Enable Root Mode” if you haven’t already set a password, it will ask you to do so.

Step 5 – Open up a terminal window

Now that we’ve got our stuff in order, lets open up a terminal window and prepare for compiling and decompiling.

Elevate the current terminal to super user status by typing:

su

(Enter your root password when asked)

Decompiling using Apktool

Now we’ve got everything installed and root permissions, lets decompile an APK file.

apktool d someapk.apk

Compiling an APK from a previously decompiled APK

If you want to compile an APK you have decompiled, it looks the same as above with exception of one argument.

Please note you do not need to use quotation marks below when referencing the folder (as with the previous example).

apktool b "decompiled APK folder"

This post does not cover signing the APK file, which will need to be done before a compiled app will work. This guide assumes you already know how to use Apktool and aware of the fact you need to sign the app, a simple Google search will yield instructions for signing your compiled APK file.

Dwayne

Leave a Reply Cancel reply

6 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Andrew
Andrew
6 years ago

Hi,
There is also new alternative: open-source APK and DEX decompiler called Jadx: https://sourceforge.net/projects/jadx/files/

It has also online version here: http://www.javadecompilers.com/apk/

1
Medi
Medi
5 years ago

Thanks Andrew it’s easier like that ๐Ÿ™‚

0
Jonas
Jonas
5 years ago

Thanks Andrew! ๐Ÿ™‚

0
Andrew
Andrew
4 years ago

The same website I mentioned earlier just put apltool online here:
http://www.javadecompilers.com/apktool

I do not see big difference, however. It just works faster, that’s all.

0
Anonymous
Anonymous
1 year ago

NOT AT ALL USEFUL ARTICLE

0
Dwayne
Dwayne
Author
1 year ago

@Anonymous look at the date this was published, seven years ago. What do you expect?

0

Primary Sidebar

Popular

  • How To Get The Hash of A File In Node.js
  • Testing Event Listeners In Jest (Without Using A Library)
  • Which Neural DSP Archetype Plugins Should You Buy?
  • NBN Box Installed Inside of Garage, Where Do You Put The Modem?
  • Smoke Detector Randomly Goes Off Early Hours of The Morning
  • How to Use Neural DSP Archetype Plugins With the Quad Cortex
  • Wild Natural Deodorant Review
  • How to Fast Launch Microsoft Flight Simulator 2020 (decrease game loading time)
  • How To Install Eufy Security Cameras Without Drilling or Using Screws
  • Perfectly Smoked Steak On A Charcoal BBQ Using Indirect Heat

Recent Comments

  • Thebe on How to Remove the My Sites Menu From the WordPress Admin Bar
  • Maccas worker jn the 2000s on Dear McDonald’s: bring back the Warm Cookie Sundae, you cowards
  • Anamika Singh on Testing Event Listeners In Jest (Without Using A Library)
  • Stefan on A List of WordPress Gutenberg Core Blocks
  • pandammonium on A List of WordPress Gutenberg Core Blocks

Copyright © 2022 ยท Dwayne Charrington ยท Log in

wpDiscuz