My come back.
I'm super excited that we have finally finished this huge theory block right now.
For now, one, we will do lots of hands on exercises and we start with our set up to reverse engineer
Android applications.
Therefore, we take this class store text file and we will reconstruct the Java source code out of this
and how this works.
I'm going to show you right now here we have our game apk and the first thing we need to do is we need
to get the class's text file to you.
Still remember if we have to use Unzip or the APK tool to get this file, I'm pretty sure you do.
In this case it's answered.
If we answer an APK, we will get this class text file.
If we use the APK tool, we take this class to text file and we will decompile this into those single
smiley class files.
Therefore, this isn't really helpful for us right now.
All right.
Now that we have this class store text file, we use a tool named text to char.
And what text to chat does is it takes the byte code which is stored in this file and it will reconstruct
the Java source code out of this.
So by providing this class store text file to text char, we will get this class as torture.
And this is an archive that contains the complete Java source code in one single char.
But thanks to just not able to get the original source code out of this, it's more like an interpretation
of the original source code, but it's so close to the original one that we can use this easily for
our reverse engineering approach.
Now we've got our char archive that contains all of our Java classes we now use.
Going to open those and trading gooey.
We can easily browse through all of them and look for interesting things.
For example, in our case of the space ping application, the player lives the shield, how was the
alien coalition working and all this kind of stuff?
On a real world application you could look for secrets certificate pinning, anti rooting detection,
IP endpoints and all this stuff.
Okay.
One last thing I want to mention right here is please stick to the exact version numbers and binaries.
I recommend you in this course because I have designed this course to work on Android applications up
to 11, which is the most up to date version right now.
And during my preparation, I faced a lot of problems with the common toolset for Android application
version 11.
So I spend a lot of time figuring out how to sign an application for Android 11, how we can decompile
and reconstruct the source code and all the other things.
Therefore, you do not have to figure it out by yourself to go all through the pain, yet to get your
tooling working back again.
I did this for you and this is why you have purchased this course.
So please stick to the recommendations and then you are fine.
So this saves a lot of time for you.
Okay, we now start with the installation of index to chart and then we will also have our first variation
regarding to the common toolset.
So let me switch to my Ubuntu VM for this.
Okay.
Here we are now at our ubuntu VM.
Let's download text to chop, but we cannot use the original repository because this one is not working
for Android eight and higher.
Therefore we have to use a fork of this one and this one is provided by lan John or lan John.
I'm not sure about the correct pronunciation, so let me show this to you.
I'm opening the web browser and I type in next to Job and land here on Land Tron.
Land Tron, I'm not sure.
And here we have the fork from the original author and also thanks to the original author for yeah,
providing this really amazing tool in this case, if you click on next to chart and if you go onto release
us, we can see this support text version 035 We have seen this in the class text file header up to
three eight, which is Android eight.
But I've also tested this for Android application 11.
I've created an own application which only works for Android 11 devices, and I tested all this tooling
against this app.
And then I figured out, wow, a lot of things has changed and therefore I provide you now everything
that works up to this version, which is the most up to date nowaday.
All right, now let's download this one right here.
Then we've got this zip archive and we say extract and we go into our tools directory.
We create a new one and we name this text to Trump
and we click extract show files and yeah, I really hate when this happens.
So I copy, paste this out and move one directory up and delete this one.
This is not a nice way, but yeah, it's.
It's fine, I guess.
All right.
By the way, if you want to download this Android 11 application, I have attached this to the files
in this section right now.
Okay, now let's open the terminal and see what we've got here.
Here.
We can see we've got a bunch of sage and bad scripts.
But as for the Windows operating system and this is for the Linux operating system, these are green
because these are being flagged as executable.
We also have a bin and lib directory and some information before we run the script.
We have a quick look into this because you should always check unknown code that you are going to run
on your operating system and therefore I cut this file out.
And here we've got a banner and we can see some badge information over there.
This looks good so far.
And here we can see afterwards it goes into the directory and executes those char files.
So let's have a quick look into the slippery lip directory.
And here we have the char files and OC.
You can do, of course, a further investigation, but for me it looks okay and I will run the script
right now.
So let's see if it's working.
Oops.
And we can see the script is working great.
Now we create an alias for the script because we do not want to provide a whole directory path all the
time when we want to start the script.
Therefore, I get the directory and I copy paste it down here and then I take the file name and check
if I provided the correct path through this.
So if you want to start the script, we have to provide the full path.
If we are not in the terminal or in the directory right here.
And yeah, this one is way too complicated.
So we create an short alias, which is a reference for this whole command.
Therefore, we just have to remember the short alias name.
And I'm doing this in my settings, HRC over there.
And here I create a new alias, and I name this index to chart, and I provide this whole path over
there.
Okay, in case if you are not familiar with them, this is absolutely no problem and I do not recommend
them if you're not familiar with this, because you will face a lot of problems.
And this is absolutely fun because everyone else also has those problems when yeah, the person did
start with them.
So one fun fact about this, I guess the most viewed or rated question on StackOverflow for a while
was how to leave them.
Therefore, you see, you are definitely not alone.
If you have struggle or if you struggle with them, okay, in case you do not want to use them, you
can use G added for example, and therefore you can simply open this file and you have a graphic text
editor over here and in case you do not use the set as a share, you have to provide this alias name
to your bash RC.
I'm going to show you this right now.
Here we create a new alias name next to Char.
And please do not use spaces.
Oops.
Sorry.
Let me fix this first.
Now I can talk.
Please do not use spaces over here because this will mess up your bash RC.
So this is unfortunately not working.
You have to remove them.
Okay.
After providing this, we can run next to Char.
Now we get a command not found.
And the reason for this is the bash, RC and etc. RC are going to be loaded when the terminal has been
started.
So only at this moment this file gets loaded or refreshed.
We can open a new one and type index to chart.
This will work, but if you do not want to create always a new terminal, you can also refresh this
environment with the source command.
So by providing source on your service HRC, you are refreshing this environment for this terminal you
are using right now.
And now we can use text to char also here.
So for example on the home directory, it's also working right now.
Great text to Chad's working.
Let's start there compiling this class to text file.
So I go into apps space ping and here we have this classes the text file.
Now I do a right click open and terminal and I say next to char classes, dot text and here we can see
it's now reconstructing this Java source code out of this classes to text file.
And here we have now our char archive that contains the whole source code of these classes.
The text in the Java code format.
Nice.
Now to view this file we have to install degree and therefore we go again into the internet and we type
in the compiler and we use this one over there.
So this is the original version.
It's absolutely fine.
Now we get the warning.
If you want to keep this fight because it's a binary and cannot end, it can damage our system.
I say keep because I trust this one.
Okay.
And if you want to start this one, we have to provide cha cha, cha cha, and then Chidgey and this
cha archive, we can see it's working.
Okay, I now put this Chidgey into an tool's directory and also provide an alias name for this like
we have done this for index to cha just to have a clean setup.
All right.
Now we are back.
So I go into the directory.
The space pane.
And now we open this file with shady gooey.
And yes, it's working here.
We have our Java source code, all those package names and we can see, for example, within services
or systems, alien behavior system here we've got now the Java code which has been recompiled.
We can also see here, for example, there has been some troubles, so it could not be decompile on
this point and therefore we can also not.
Yeah, copy paste this code into a new project because we will end up with tons of error.
But for reverse engineering this this is absolutely fine.
And this part, by the way, is some smiley part.
And later on we will be able to understand this one.
So even if you do not have the Java code over there, we can read this later on in this course, which
is super amazing.
All right.
That's all for this video right now.
We have successfully set up our check index to chart and we can now recompile this class to text file
to get our Java source code back again.
It's not the original one, but it's pretty close to this.