So let me explain something about repackaging and resigning so it's needed after making some changes
to the Android manifest or bytecode.
So in order to be able to modify any file that's packaged in the app, we first need to unpack the APK.
So this time, let's use the EPA tool to unpack the HBK file.
So first change directory to desktop, you can simply call the advocate tool with just the D argument.
So A decoded the files in a folder.
And let's have a look at the files.
So we'll check the Android manifest file.
OK, so it's decoded.
Well, open the smiley folder.
And here is where the decompiled source codes live.
And Smiley is basically an assembler, and this is similar for the decks format used by Dalvik or Android
runtime for that matter.
Smiley files are created by compiling the decks files, which are the executables, and as you remember,
we compile these files in the bytecode viewer and then we analyze the source code.
But I know that was all the way back in the previous lecture.
So let's go back to the insecure bank folder.
So after making a change to a file, we then need to repack the APIC, so over this weekend, again,
use the actual.
This time specifying the build or b argument.
OK, so now we'll run.
A zip aligned tool, so zip line is an archive alignment tool that provides important optimization to
Android application files or APIC files.
Four numbers find the bite alignment boundaries.
This must always be for which provides 32 bit alignment line or else it basically does nothing.
So then we'll add the existing APIC file.
We can give a full path and a name for the new APK file.
OK, so now the EPA has billed.
Now, the last step is to sign the RPK.
But before resigning, you must first get a code signing certificate.
Now, the standard Java distribution includes key tool for managing key stores and certificates, but
you can create your own signing certificate and key, then add it to a new key store that you created.
So one key tool, dash v, dash jenky, dash keester.
And here, I'll give a name for a new store ad alias.
Defined RSA as a key algorithm.
Define the key size.
And finally, add a validity option.
And it's just an expiration date, so you can give a really big number if you want.
So now create a password for the key store and now we can skip these questions.
All right, so it's created a key store in the current directory.
So now we're ready to sign the APK with this key.
You can use a B.K. Seiner or Jar's Sinor tools to sign the RPK, your choice.
Add dash ferbos parameter, a key story you created.
And the location of the new APK file and Sankei.
Enter the password of the key store.
And just like that, EPK is signed and ready to use.