Welcome back, guys.
After those righteousness, we need to talk about types.
But this is not a very complicated topic.
We just have to memorize or mesmerize this list.
What list?
This one over here.
I also attach this in the cheat sheet and these are the types we have in our smiley code.
So we have seen this strange i.e. let us in our source code and this means we've got an integer value.
We means void set is boolean.
And beside all these basic types we've also got to a little bit strange looking types.
The first one is regarding to the class name and this one starts with a capital L.
We have seen this a lot in the past and we will also take a look onto this later on when we go through
the space paying application and make ourselves a little bit more familiar with the smiley.
So classes start with this Capital L letter, all right?
The other type starts with the square bracket.
And then we have this descriptor which describes what type this array is of.
So in this case, if we've got a square bracket and then in capital B, we've gotten byte array and
we can have all types of arrays.
All right.
Okay.
So keep this list close to you.
When you start reverse engineering smiley code, because this comes super handy, you will understand
a lot of more of this code by having this list, those types definition over there.
Let's do this for our application code we've analyzed before.
So by having this list compared to us, we can now also determine those types.
We've got, for example, add some power and then we've got three times the supply, which means we've
got three parameters from the type integer.
And after those brackets we've got another I in green and this one is the return value.
So now we know three integer values are going to be passed into our function and this function is also
returning an integer value back.
All right.
We can also see those capital I's after those parameters.
And here at the Sum and Factor, we also got this type definition.
But that's all in this function they are only integers available.
Alrighty.
Here we are now at our Ubuntu VM and let's do some practicing within our space paying application and
therefore we go into our apps directory.
Space playing day compiled because this has been compiled with the APK tool.
And here we've got our Smiley Directory eye opening with the studio code.
And then I tracked this whole directory into this edit on.
Yes, it's working already.
I go back and we open this application also with Shadi excuse me to have the travel source code next
to us.
Let's find some types within our Somali code.
We start with the Somali code and then we check if our assumption is correct or not.
So I opening this one.
Let's see what we've got here.
Yeah, those components.
Maybe this one is good enough.
Let's see.
So good balance.
Yes.
So I'm also opening or changing the syntax to Java.
Get out my graphic template and now let's do some practical analysis.
Okay.
And this one over here.
I guess it's not that hard.
We've got an instance field.
This means this is some class field, but we do not know about this right now.
What we are interested in is this f over here and this colon and this F means we've got an variable
from the type float.
Correct.
So here we have an class name.
We can find this over here.
Circle bounce.
And as classmen got some type radios and this type is float a variable named radius and the type is
float this way.
All right, let's have a look into our Java code.
So.
Yeah, we can keep this over here.
I guess it's fair enough to see if we were correct.
So we were in components.
Collision circle bones.
Components, collision circle bones.
There we go.
Maybe I have to clean it up.
Circuit boards float radios.
Correct.
Next one.
What do we have here?
All right.
Let's see what we've got here.
We've gotten heat and we've gotten both.
And both are from type F.
F is correct.
Float.
So we've got float hate and we've got float with.
Okay.
Let's check also this one out.
We've gotten we over here and this is the return value because it's after those brackets, the V as
in return value is also correct.
Great.
It's void.
So this function is returning a void.
And we can also find this over here.
All right, next or let's prove this first.
So, Chad.
Rectangle.
Yes.
Float height and width.
But where's our function regarding to the void.
And let's have a look back.
And this one isn't in it.
And this means this is in constructor, but this constructor is not directly written in this Java code
over there.
So we will learn about this later on.
I just wanted to point you out that we can also get this function return value over here.
All right, power up.
What do we have here?
Coin.
Smiley Let's take a look into this one.
All right.
We skip this for now because there's something interested in there.
Let's move on.
On the alien.
Yes, let's move on with Alien first.
Enabled travel once again.
Enabled my pen and let's go.
So here we've got our label.
And in front of this label, we've got this public static final.
And this is exactly the same text that's written in this class name.
So just to show you this, we've got an.
Public static.
Final.
Whoops.
Final.
And then we've got the Sprite name over here.
Alright.
But something is missing.
What is missing?
The type of the sprite name.
Let's have a look.
We've got this colon, we've got this capital L so this is our type definition.
And this type definition ends at the same e colon, their capital l means.
We've got a class reference.
Which class?
Let's take a look.
We've got Java Lang string.
So this one is from the type string.
So we can clear this one and we can adjust string and we can also see that this string or this variable
name is going to be initialized directly afterwards over here.
So this string is here.
And then we've got also this one alien.
And the same for this one underneath.
So this one over here, we've got also Sprite named Boss in this case.
And then we've got also this colon l we've got our class reference travelling string and also our initialization.
Let's do this.
So we've got a Sprite name.
Sprite name
underscore boss.
And this is from the type Java lang string.
So we've got a string over here and this one is being initialized with alien boss.
So this one over here.
All righty.
Let's have a look.
I mean, this was a little bit more than we did learn right now.
But I want to provide you more and more information that we get familiar with the Smileys slowly.
Okay.
So let's have a look.
Let me yeah.
Let me open this one and let's see.
Where was it?
In components.
In Somali components.
Components.
And in Somalia.
This one.
All right.
We can see public static, final string sprite name.
Public static, final string sprite name.
Alien and alien boss.
Nice.
I was just too lazy to write this blueprint over here.
What we've got also here.
Alrighty.
Next, let's take a look into this one.
And this one is super nice.
Yes.
Okay.
Here we have a lot of nice stuff.
So let's have a look into this.
We've got a lot of instance fields.
And instance fields are just member variables of this class.
We will talk about this file format more in detail in a separate section.
But let me point this out real quick.
We can find this class name over here.
So we've got a class.
And this class is named color animation.
In this case.
It also extends this one over here.
But we do not care about this one right now.
I just right extents but we do not care.
In this class has now these members for example alpha animate.
What is this type of this alpha animate?
Let's have a look.
We've got this colon, and afterwards we've got the set.
What is the set?
Correct.
A boolean.
So we know this one is a boolean.
Hmm.
I guess I have to write this more clean, Julia.
Okay.
Next we've got Alpha Marks, so I'm not writing this down, but here we would have this one Alpha Max.
We've gotten colon f, we have seen this F before.
F is correct float.
This one is from type float.
All right.
Oh, we do not have more about we just have f and set.
So these are these are all float, float, boolean, float, float, float, boolean, float, float
and so on.
So you can see it's not that hard and we can already reconstruct some parts of the source code.
Let's have a look into this, how it looks like.
So we are in color animation for the animation.
Yeah.
So our estimation was correct.
We've got this class and extending and component, but we do not care about this part here.
And then we've got all those members and we also have seen those types over here.
All right.
Finally, let's do some more interesting.
Let's see we go back and then.
And this one?
Yeah, this one looks good.
Enable travel once again.
Get out the pencil.
Let's go.
So here we have our instance fields.
And here we have frame, duration, colon.
F we know this type float.
We also know this one type float.
But what is this one over here?
We've got now a label named Play Mode.
Play mode.
But what is this type of this label?
Let's see.
We've gotten cologne and this means we've got a class reference.
Let's see how far this class reference goes up to this one over here.
Okay, so we've got this animation and afterwards we've got a dollar sign and then we've got this play
mode.
So what is this?
This dollar sign is just a signal to us.
This animation has an inner class, and this inner class is named play mode.
This is most of the time the case for enemies.
Or, for example, if you extend a sum task or things like this.
So if you have a class name and within this class name you have an inner class, then these two classes
get separated with this dollar sign.
All right, let's take this topic real quick to the slides and discuss it over here.
I guess that's a way more easier.
So on the left, we've got a public class animation, and this public class can now have an inherited
class, which is play mode or also an enum type, which is play mode.
Both of them will be addressed by the main class, by the animation class, followed by a dollar sign
and then D type, for example, the enum type or the play mode class.
So let's play this up over here.
We've got our main class, the animation, then we've got a subclass or for example, an enum type which
is play mode.
Now if you want to address this play mode, we have to address the main class, which is animation followed
by a dollar sign, and then we go into play mode.
So then we can address the play mode class or the play mode enum type in total.
It looks like this one.
Animation dollar play mode.
So this is the magic behind this dollar sign.
This is just a reference to an inherited class, one enum type, for example.
In this case, it doesn't has to be in class.
It can also be, for example, an enum type.
So we have to go into the Java source code to figure this out right now.
Later on, we will learn how to deal with this.
So let's have a look.
Oops.
Okay.
Where we are, we are in animation parameters.
So animation parameters.
Okay we can see animation parameters has now this class animation play mode.
We can double click on this and change the excuse.
And then we end up here.
All right.
We've got now a class named animation, and this animation has now an enum type play mode.
And this is what we've got.
So we've got animation.
Dollar.
And then we've got this play mode.
So in our case we are having an enum type within our class name and those get separated in this way.
In the next section we have some kind of quiz.
So I prepared some examples and then we have to figure out what are the parameters, what are the local
variables, what are the types and what is the return value?
And by training this in this kind of quiz, we are getting better and better.
And this is what is also important in Somali that you practice this stuff.
Okay, feel free to browse around in this code and yeah, exercise a little bit with the type definitions
and also with this parameters.
Local variable stuff do not get distracted by all the other smiley parts and then I see you in the next
section.