• 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
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
5 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

  • Thoughts on the Flipper Zero
  • Testing Event Listeners In Jest (Without Using A Library)
  • How To Get The Hash of A File In Node.js
  • Waiting for an Element to Exist With JavaScript
  • How To Paginate An Array In Javascript
  • Reliably waiting for network responses in Playwright
  • How To Get Last 4 Digits of A Credit Card Number in Javascript
  • How to Use Neural DSP Archetype Plugins With the Quad Cortex
  • Neural DSP Reveal Details About the Long-Awaited Quad Cortex Desktop Editor
  • How To Install Eufy Security Cameras Without Drilling or Using Screws

Recent Comments

  • Kevmeister68 on Start-Ups and Companies That Embrace Work From Anywhere Will Be More Likely to Survive the Coming Recession in 2023
  • kevmeister68 on What Would Get People Back Into the Office?
  • Dwayne on PHP Will Not Die
  • Dwayne on How to Create a Blockchain With TypeScript
  • kevmeister68 on PHP Will Not Die

Copyright © 2023 ยท Dwayne Charrington ยท Log in

wpDiscuz