‫-: Hi.
‫Within this lecture, we are going to create an Android app,
‫which is a very basic app actually;
‫it's a Hello World App.
‫And then we're going to reverse engineer it,
‫or change or manipulate it
‫in a way that we
‫are going to leverage APK tool or JDX
‫to see what we are actually going to do,
‫how we are actually going to hack
‫into mobile applications in real world.
‫So this is going to be a practice,
‫a very basic fundamentals
‫of reverse engineering lesson for us.
‫So make sure you open your Android Studio,
‫and create a new project.
‫Okay.
‫Or you know already how to do that.
‫So I'm gonna start with empty project, empty activity.
‫I mean we are going to only need one activity,
‫and actually we are going to just display a few views
‫and with a simple,
‫few lines of code.
‫So I'm going to call this MyReverseApp, okay.
‫I'm not gonna change package name, I'm just,
‫I'm gonna go for Java here,
‫and for...
‫it really doesn't matter right now
‫if I choose Java or Kotlin at this point,
‫because we are going to reverse engineer it anyway,
‫but since we have learned Java,
‫I'm going to continue within Java.
‫A minimum API level is not important at this point.
‫You're more than welcome to continue with 23, for example.
‫Okay, make sure you open your project like this,
‫and make sure you wait
‫until it's finished building,
‫and then you can continue on editing your layout
‫and Java file as well.
‫So what we are gonna do,
‫we're going to create a very basic project as I said before,
‫and we're going to start learning
‫about fundamentals of reverse engineering,
‫and have a take a look at Dalvik bytecodes.
‫For example, we have seen the theory,
‫but we haven't seen even at
‫single Dalvik bytecode yet.
‫We don't know how it looks.
‫We're going to see a lot of those
‫in upcoming lectures.
‫So let me open my Java file over here.
‫So this is my Java file,
‫this is my activity.
‫If you have skipped android development section
‫for some reason,
‫I suggest you go back and watch that
‫if you don't know how to code in Java or in Kotlin,
‫if you don't know how to develop Android applications.
‫Okay.
‫So over here,
‫we are going to
‫not do anything right now,
‫because first of all we are going to have to
‫open our layout,
‫which is our...
‫main activity...
‫XML,
‫as you might remember.
‫And I'm going to say show layout decorations
‫to have our title bar,
‫and we're just going to start working on our layout.
‫So first, you can just get rid of this text view,
‫okay,
‫and bring in new wheels.
‫So all I want to do is display some TextViews
‫over here like Hello world or Hello Java
‫or Hello Reverse-Engineering,
‫okay.
‫So I'm going to bring in new TextViews,
‫maybe bring two so that we can see multiple
‫TextViews at one time, and we can see multiple views
‫and we can see actually
‫how it looks on Dalvik bytecode as well.
‫So as you can see we have TextView ID
‫on one of them,
‫and the other one should be named TextView two.
‫Of course, we can change the IDs
‫if we want like we did before
‫in the calculator lectures, for example.
‫And, we can actually connect those IDs
‫with our Java coding section,
‫by using FindView by Id comment,
‫maybe you remember that, right?
‫So this ID is very important,
‫and we can actually find these IDs in Dalvik bytecodes
‫or in reverse engineering as general.
‫So yeah, make sure your view has one of the IDs.
‫This is one of the reasons I deleted the default text
‫because it doesn't have an ID,
‫and people sometimes forget about adding IDs,
‫and they actually experience some problems.
‫As you can see,
‫we have this text over here which is TextView
‫right now what we can change it anytime we want,
‫like this, Hello Java.
‫Okay, we can make this bigger like that,
‫and we can move this around
‫anywhere we want on our screen.
‫We can come over here and we can make this
‫like central,
‫we can increase
‫the font size like that.
‫We can just choose
‫18 or 20,
‫whatever we want from here.
‫And...
‫yeah, you can make this bold,
‫you can make this italic,
‫you can make this anything you want.
‫I'm gonna leave it as it is,
‫and move on to the next one.
‫So let me bring this into center as well,
‫like that,
‫and let me just change this text
‫to Hello World,
‫or Hello reverse-engineering,
‫Hello Android,
‫whatever you want, okay.
‫Just make it into central,
‫and just change the text.
‫So here you go.
‫We have Hello Java and we have a Hello Android.
‫Great.
‫Once you are done over here,
‫you can just come over here to
‫hit on infer constraints buttons;
‫It adds some constraints, remember these are for locating
‫the views in a proper way,
‫on our activity.
‫If we don't do that,
‫it will be concentrated
‫on the left, upper side of our activity,
‫which is not what we want,
‫so make sure you hit the Infer Constraints,
‫but after you're done
‫with your design.
‫Of course you're more than welcome
‫to change the other attributes,
‫like you can change the text color,
‫you can change whatever you want from the attributes pane,
‫but I'm not gonna do that, okay.
‫We're not here for that.
‫But rather I'm just gonna go for this
‫main activity Java section.
‫So over here, what do we do?
‫So we can actually connect
‫our TextViews,
‫our main activity.Java, right?
‫So that we can change the attributes
‫like change the text,
‫change the text color,
‫change the font size from there as well.
‫Even though I hit the round button,
‫it isn't open yet.
‫And this is one of the app's
‫that we're going to work on later on.
‫It's a three door app and we're going to hack it.
‫So...
‫let's wait until it's finished.
‫Yeah, I believe now it's finished.
‫And let's open our emulator and see how it looks.
‫Yeah, it looks great.
‫Hello Java, Hello Andre.
‫This is exactly what we want.
‫Now for just example, let's try to connect all these views
‫into our Java coding section,
‫and then change the text using our
‫code methods like set text like we have seen before, right?
‫So you know how to do that.
‫I suggest you pause the video,
‫and close this down,
‫and try to define
‫TextViews on your onCreate,
‫and then just change the TextView to whatever you want
‫like hello, your name for example, okay.
‫I hope you managed to do that.
‫It's really easy.
‫Again, if you skip the under development section,
‫I suggest you go back and watch it,
‫because we have already covered this.
‫So in order to do that,
‫we start with
‫the class type,
‫like the type of the object that we are going to define,
‫like TextView.
‫Okay.
‫And if you get an error like this,
‫all you have to do is just hit Alt + Enter on your keyboard,
‫and it will import the class over here.
‫As you can see we now have import
‫under it's widget TextView.
‫So it's recognized by our activity,
‫and then you can give it a name
‫like TextView or you can call it
‫Jack or Brian, whatever your name is.
‫Okay.
‫But it's not very conventional,
‫it's not how we do that.
‫The developers generally gives some real names
‫like a reasonable name,
‫like a TextView.
‫They don't give up names like this text we want,
‫but something like result text
‫or name displaying text or something,
‫you have to understand what it does, okay.
‫But in our case, it's very easy to name a text we want,
‫because we will only have two views in this activity
‫and I believe we won't confuse them later on.
‫So TextView is the type and text we want,
‫is the name of the object that we are going to create
‫from TextView class.
‫So after doing that, we can actually connect it
‫with the layout that we have.
‫And we use FindView by ID method in order to do that.
‫And it will ask for an ID as a parameter.
‫So this is the ID that I was talking about.
‫So I'm going to say are that R.id.textView,
‫as you can see, we can see the both of the text
‫over here like textView, textView two.
‫So first one will be textView,
‫and we are gonna do that from scratch.
‫TextView,
‫and I'm gonna call this textView two,
‫and just say findViewById R.id.textView two.
‫So this is how we connect TextViews
‫or any views to our coding section.
‫And then we can actually use this variables:
‫textView one and textView two like this.
‫In order to change the attributes,
‫like, I can just say texView one dot setText, for example.
‫And it will change the text
‫of the text views
‫once this activity is created.
‫So we can reach all the attributes that we see from here,
‫from there as well like this.
‫So if you hit that,
‫you can see all the attributes here as well.
‫So you can get the attributes
‫or you can set the attributes from this page here right now.
‫So I'm going to say textView one dot setText.
‫And over here, I'm going to open double quotation marks
‫because this is a strength, remember.
‫We've talked about strengths.
‫So I'm going to say Hello World rather than Hello Java.
‫And for textView two, I'm going to say again
‫one more time something like Hello World two.
‫So this is great.
‫Now rather than seeing Hello Java or Hello World,
‫we are going to say Hello World and Hello World two
‫because it's called in onCreate.
‫Remember, onCreate is the first method
‫to be called when an activity
‫is actually fired up and when an activity started.
‫So user will see Hello World and Hello World two,
‫rather than Hello Java or other thing,
‫because this is called even before user sees
‫the activity itself like this.
‫Here you go, Hello World and Hello World two.
‫I believe I hit the uppercase button in the attribute,
‫so it's all in uppercase right now.
‫Hello Java, Hello World.
‫It really doesn't matter,
‫it's an attribute for TextViews.
‫So if you want to display them in lower case,
‫you can just undo it,
‫but it doesn't matter in our case.
‫So we have built our Hello World application.
‫Now it's time to manipulate it
‫or it's time to reverse engineer it
‫to see what we have learned
‫in the previous section to practice what we have learned
‫in the previous section to learn the details
‫of JDX and a APK tool as well.
‫So let's stop here and meet me in the near lecture.