‫Instructor: Hi! Within this lecture,
‫I'm going to take you over our game app code.
‫So if you are new to Java and under a development
‫this lecture may be good for you
‫to understand what's going on,
‫on the background of these kind of games.
‫And if you are already experienced,
‫I suggest you skip this lecture and don't look at the code
‫so that it will be much more realistic for you
‫to reverse engineer it first
‫before seeing the codes themselves.
‫Okay?
‫So here you go, here is our game manifest,
‫our main manifest, and as you can see,
‫there is not much to see over there.
‫Let's just jump into our codes.
‫So we see the game activity and in the manifest
‫it was listed as the launcher activity,
‫which is the first activity.
‫In fact, we only have this activity in our game. Okay?
‫And as you can see, there are some texts,
‫like input text, core text, category text,
‫so let me go to our XML.
‫So let me make this a little bit smaller
‫so that we can have a space.
‫If you come over here, you will see there is an input text,
‫there are two buttons, one for category,
‫and one for sending the guess. Okay?
‫And as you can see, there are some unclick methods
‫assigned to those buttons like, sendButtonClicked.
‫And for this changeCategoryClicked,
‫we will see the related methods in the JAVA section.
‫So over here we have the score text,
‫where we display the score itself.
‫So if you come over here you will see all the defined texts,
‫and also you will see the related methods, as well.
‫So after defining the texts,
‫I am creating something called score,
‫and actually I defined it as a global variable,
‫and I'm initializing it to be zero,
‫when on create is called.
‫So score starts at zero, as expected. Okay?
‫And I also have a variable called categoryCounter,
‫which is already zero at this moment.
‫And then we're creating come models, called WordModel,
‫and here you can see the WordModel on JAVA itself.
‫So if you come over here, you will see that it's a class,
‫and it already has some attributes and constructors.
‫As you can see we have this category name,
‫which is a string,
‫and gameWords, this is an array list of strings. Okay?
‫So we're going to have a look at this gameWords
‫later on in here.
‫So if you come over here, there's a ModelPopulator class,
‫which actually populates the model,
‫like, creates the array list of keywords
‫like banana, apple, watermelon, melon, grapes,
‫so you can actually see the keywords
‫in this ModelPopulator over here.
‫Of course, we are doing this only for practice.
‫In real life, you won't get these key words easily.
‫I'm just trying to make you familiarize with the codes
‫of this application,
‫then we will go onto the reverse engineering, okay?
‫So if you come over...
‫Come back to gameActivity,
‫you can see we created three models
‫for fruitModel, bandModel, and dogModel.
‫So we have three categories, as you can see,
‫one for fruit, and bands, and one for dogs, as well.
‫And we add all these models
‫to our array list containing categories,
‫like containing actually, wordModels.
‫So the category's array list, if you come over here,
‫you will see that it contains wordModels.
‫So wordModel objects that we have just created
‫go into that category array
‫and we call something called categoryRefresher.
‫If you come over here, to categoryRefresher,
‫you can see there is a current category,
‫which was set to be zero initially,
‫and it defines the category text.
‫We haven't talked about this,
‫Here is our category text right now,
‫and this is how we set the category text.
‫We get it from the array list
‫and we get the category name afterwards,
‫and we use this check key word, check guess,
‫maybe if you want to call it that way.
‫When we click on sendButton,
‫and as you can see,
‫checkWord returns 1 if the current category
‫contains user input, okay?
‫If it contains this user input then we return 1 in checkWord
‫and if it doesn't contain, we return zero.
‫And it takes that returning integer
‫from that checkWord method and adds it to score
‫and then it sets the score with the current score number.
‫So this is a very simple game, of course,
‫there can be a lot of improvements regarding to this game
‫but it works right now and it is suitable for us
‫to test our reverse engineering skills.
‫And we have changeCategory clicked over here finally,
‫where we increase categoryCounter by 1
‫every time I hit the changeCategory button
‫and it increases by 1 and we get the current number
‫with CategoryCounter integer.
‫So we have three JAVA files over here
‫and of course, I made the obfuscation enabled,
‫I made the proguard usage enabled.
‫So we won't be able to see those codes clearly
‫or here we will see them obfuscated,
‫we will see them encoded and we are going to
‫try and understand what's going on in this app
‫by looking at those codes.
‫See you in next lecture.