‫Instructor: Hi.
‫Within this section,
‫we're going to take a look at Android reverse engineering
‫and Android app manipulation.
‫So this is one of the hardest subjects on our course,
‫and also this is one of the most interesting
‫and most fun funnest part of our course as well.
‫So if you master reverse engineering,
‫you will have the chance to see the vulnerabilities,
‫you will have the chance to manipulate the apps
‫in a way that you want.
‫So this is very important.
‫But in order to master reverse engineering,
‫first we have to understand how an Android app
‫is actually created on background, on theory, okay?
‫Then we will learn how to reach source codes
‫or bytecodes from the latest product, final product.
‫So let me tell you all about this theory.
‫So I found a simple diagram on internet,
‫so you don't have to do that,
‫you can just follow along with me.
‫So this is Java source code to Java final product,
‫and this is Java source code to final Android product.
‫So it doesn't matter if you're writing in Java
‫or if you're writing in Kotlin.
‫Okay?
‫If you are creating an Android app,
‫then you're following a different path
‫than a simple Java application.
‫So why is that?
‫So if you can look at the chart on the right-hand side,
‫you will see it starts with source code, of course.
‫Because we're gonna write some code in Java or Kotlin.
‫Anyhow, but then it transforms
‫to something called Java bytecode,
‫and this is just byte version of Java code
‫and it's actually similar
‫to the process of Java final products as well.
‫But then it transforms to something called
‫Dalvik bytecode.
‫And this is where it gets actually interesting.
‫Why do we use Dalvik bytecode,
‫and what is that?
‫So Android operating system actually run something
‫called Dalvik virtual machine, okay?
‫And in order to run this app
‫that you have written in Java or Kotlin,
‫it uses Dalvik virtual machine,
‫and in order to run some APKs final products
‫on this Dalvik virtual machine,
‫it has to be transformed into Dalvik bytecode.
‫So by reverse engineering,
‫we mean getting Dalvik bytecodes
‫out of the final APK,
‫or getting Java source codes out of the final APK.
‫Actually, we have different products, different tools
‫for this both of this process,
‫and we're gonna see how to do that.
‫And Dalvik bytecode isn't actually
‫very easy language to learn,
‫or very easy language to master.
‫And on the contrary, of course, Java is easy to learn.
‫We write applications already in Java,
‫but sometimes we cannot get to the Java source codes.
‫Then we will have to stick with Dalvik bytecodes.
‫We're gonna see all of these things.
‫First, let me tell you about the tools
‫that we are going to see in this course.
‫We will mainly work on two tools,
‫first of which is Apktool,
‫it's spelled like this, Apktool, okay?
‫And if you search for Google
‫you will see the Apktool website,
‫which is a GitHub website.
‫Okay?
‫And as you can see, this is
‫for reverse engineering third-party closed apps.
‫So if you click on this,
‫you can see the Apktool requirements,
‫installation procedures, and everything.
‫So aside from Apktool,
‫we're going to use something called jadx.
‫Okay?
‫And this is spelled like jadx, like this.
‫So if you run this on Google,
‫if your search is on Google,
‫you can find the GitHub page, one more time,
‫for jadx as well.
‫And as you can see, it's dex to Java compiler.
‫Decompiler actually, not compiler.
‫So jadx actually gives us the source code, Java source code,
‫from Dalvik to Java.
‫And Apktool actually gives us the Dalvik bytecodes.
‫So we're gonna need both of those
‫in order to have a complete reverse engineering procedure.
‫So we're going to work with Apktool and jadx as well.
‫So if you go to GitHub page of jadx,
‫you can see the features
‫and download instructions, installation procedures,
‫and everything.
‫So the thing about jadx,
‫unfortunately it doesn't work with Windows.
‫Okay?
‫So you either will have to work on Linux or macOS.
‫In Apktool, actually you can work within Windows,
‫and work within Mac, work within Linux,
‫wherever you want.
‫But it only gives us Dalvik bytecodes.
‫So most of the time you might want to check
‫if you can reach the Java source codes first,
‫and then you go for bytecodes.
‫So we're gonna need to utilize both of them.
‫If you're thinking that,
‫"Yeah, I don't have macOS, what I'm gonna do?"
‫It's very easy actually,
‫since we have Kali Linux installed on your computers,
‫it will be an easy task.
‫We're gonna work with Kali Linux,
‫and we're going to actually start
‫we're going to install jadx and Apktool on Kali Linux.
‫We're going to do our procedures on Kali Linux as well.
‫And then finally, maybe
‫after you complete your reverse engineering
‫for the final product,
‫you may want to go from Kali Linux to your host machine,
‫from your host machine to Kali Linux.
‫So it may be a little bit hard for you,
‫but it will work.
‫And by hard, I mean just sending an email from Kali Linux
‫to your host machine, like sending the APK file
‫from your Windows to Kali Linux, or vice versa.
‫So it's not very hard,
‫but it's kind of time consuming.
‫Of course, if you have Linux running
‫on your main operating system,
‫running as your main operating system,
‫or if you have Mac running as your main operating system,
‫your job would be much more easier in this section.
‫But if you have Windows,
‫don't worry, again, you can actually
‫install Apktool and jadx on Kali Linux.
‫Just decompile the APK email,
‫the APK from Kali Linux
‫to the host machine, and vice versa.
‫So you're gonna have to spend a little bit time
‫compared to me in this lecture, in this section,
‫but again, it will work for you.
‫Okay?
‫So what we're gonna do, we're going to install jadx.
‫We're going to install Apktool first.
‫We're going to set our lab up,
‫and then we will create our first application
‫and try to reverse engineer it.
‫And then we're going to work
‫with pre-made, pre-built applications,
‫of course, the ones that I have written for this course.
‫And then we will actually manipulate.
‫For example, we will hack into a game
‫and we will actually change the game
‫in a way that we want using all of these tools
‫that we're going to master within this section.
‫So make sure you open these GitHub pages.
‫Okay?
‫For Apktool and jadx,
‫and meet me in the next lecture.