Android Reverse Engineering - Beginners Guide To Smali Coding

Presenting to you a beginners guide to reverse engineer an Android applications. Please use this for learning purposes only. Do not break intellectual properties.

Disclaimer: This guide is provided "as is" with no warranties with regard to the accuracy and completeness of the information provided herein. I am not responsible for any bad outcomes you or anyone may have because you followed this guide. When I say beginners, I expect you to have knowledge of some programming language (Java, Kotlin, C#), an inquisitive mind to try things out, and the patience to first google and try to find answers to simple questions.


What is Reverse Engineering?

Reverse engineering is a process is breaking something down to understand it, build a copy or improve it. This process can be applied to hardware, software, databases or even human DNA.

Reverse engineering can be used for many purposes such as a learning tool or to expose security flaws and bad practices.

Reverse engineering of a software, hardware or database are legal unless the EULA prohibits it, then it is prohibited no matter what. Also beware of Digital Millennium Copyright Act (DMCA) and Google Play Console Developer Program Policy.


What Is Smali?

Android programmers write programs using one or combination of these programming / scripting languages:
  • Java
  • Kotlin
  • C/C++
  • C#
  • JavaScript
  • Lua
The IDE like Android Studio, IntelliJ are then used to build apks from these codes by converting the source code into ART executables (.dex files). The ART in Android can then run these executables. The dex files are totally unreadable. We need tools to convert this dex files to a more readable form so we can edit it. This is where smali comes in.

.dex <----> .smali <---- Java, Kotlin source code

The .dex files can be disassembled to .smali files and smali files can be assembled to .dex files again. So to modify Android apps without source codes, you gonna need to edit this .smali files.

Smali is not an easy programming language to master. You can get info about almost all smali commands here.


Modifying Android Apps Without Source Code

The best way to learn Android reverse engineering is via hands-on assignments.

Requirements:
Now let's get into action. I created an Android applications here https://bitbucket.org/ron_ang/hack-one/src/master/ and I want you to break it. That's your assignment.

Comments

Popular posts from this blog

How To Check If Your Android Phone Is Official Or Rooted

Conquering macOS Upgrades: A Guide for iOS App Developers