Rust powered CLI apk decompiler
Roberto Huertas
Posted on April 20, 2019
Lately I've been needing to reverse engineer
some apks and I've been manually using some third-party tools to do so. But, how could we speed up the process? A little bit of Rust can be very helpful! 😉
Rust is awesome for building CLI
If you weren't aware of it, Rust is also a superb choice for building CLI tools. It even has a dedicated page for this! 😉
Take a look at this awesome tools:
Entering apk-decompiler
Let's be honest, we don't like doing repetetive boring tasks and going through dex2jar, apktool and Java Decompiler again and again would inevitably lead to everyone of us to try to automate this process.
And that's precisely why I built my own CLI utility which is unexcitingly called apk-decompiler 🎉.
How to get an apk
You have several ways to do this.
The easiest one is to browse to ApkPure and just download it to your computer.
The more convoluted one would require you to have a rooted
phone and pull the apk
from there. If you're curious about this process you can just read apk-decompiler readme, it's succintly detailed there.
How to use it
At the moment, apk-decompiler only supports MacOS
and Linux
.
You can get the software from the releases page of the project and download it right away.
Once you have downloaded it, you can add it to your path and use it like this:
apk-decompiler <name-of-your-apk>
What you'll get
You'll get a new folder called output
with the following folders in it:
- decompiled: This is the output of running dex2jar.
-
extracted: This folder contains the output of
unzipping
theapk
. - xml: This is basically the output of running apktool.
- package-name-error.zip: Optional file that you will get in case there are some errors during the decompilation process.
Known issues
If you have folders with empty spaces this may be a problem for jd-cli which is one of the dependencies of this project. So... just try to avoid them! 😜
Link to the tool
Just in case you somehow missed the link to apk-decompiler, you can find it here.
Feel free to improve it, fork it or raise issues in the Github repository.
Enjoy!
--
Originally published at robertohuertas.com on February 3, 2019.
Posted on April 20, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.