• 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 apply to all macOS versions but may differ slightly depending on the version. 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 dialogue 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, let’s 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 that everything is installed and root permissions, let’s 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 must 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
7 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
6 years ago

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

0
Jonas
Jonas
6 years ago

Thanks Andrew! ๐Ÿ™‚

0
Andrew
Andrew
5 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
2 years ago

NOT AT ALL USEFUL ARTICLE

0
Dwayne
Dwayne
Author
2 years ago

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

0

Primary Sidebar

Popular

  • The Quad Cortex Desktop Editor is Finally Announced
  • Thoughts on the Flipper Zero
  • NBN Box Installed Inside of Garage, Where Do You Put The Modem?
  • How To Install Eufy Security Cameras Without Drilling or Using Screws
  • Wild Natural Deodorant Review

Copyright © 2023 ยท Dwayne Charrington ยท Log in

wpDiscuz