Hacking Android 7's Easter Egg
Hacking the Android 7 Easter Egg
On my old phone I have one of my favorite easter eggs, the cat collecting Easter Egg.
And I was curious if I could be able to edit this little game.
I found out that the Easter Egg is just an APK (com.android.egg), you can check that with the apk extractor app.
If you want to modify an app, you can use the method I will show you here. There are five main steps:
- Transform your app to an APK file
- Decompile/disassemble the APK
- Edit the decompiled file(s)
- Rebuild the APK
- Install the new modified app
Transform your app to an APK file
I simply use Apk Extractor for that, you can download it here.
You can simply transform an app to an APK file by clicking on it. The File is then stored on your storage, in a file called ‘ExtractedApks’.
Decompile the Apk
Once you ave your APK file, we can begin to decompile/disassemble it.
I use Visual Studio Code since I discovered APKLab, which is an awesome extension to reverse engineer Android apps.
You can install VSCode here if you don’t already have it.
And install this extension.
APKLab is very easy to use.
Open the Command Palette (Ctrl+Shift+P) APKLab: Open an APK
I only use the last parameter to decompile the APK:
When the APK is decoded successfully, you should have a menu with some folders and files like this :
Go to res > drawable
to find some images and other resources.
In the res > values
folder you will find some interestinf configuration files.
Note: If you don't use the same app than me, it would probably not be the same thing
Edit the decompiled files
In my case I’m gonna edit some values in the res > values > arrays.xml
file.
I only changed the name of the food here.
We can also see that the icons used for the food are in the drawable directory. So i’m gonna edit them a little bit.
Icons are stored as a vector drawable, as an XML file. To have a better understanding of this kind of file and icons, I recommend shapeshifter.design. Import a vector drawable file, and it will display you the icon.
You can then edit the different shapes of the icon and their color. You can even import an .svg file.
Once you are finished, you can export it to a new vector drawable.
Then copy the content of that new .xml file to the old .xml file, and overwrite all its content.
Now you changed an icon !
Rebuild the APK
Once you are finished, it’s time to rebuild the APK to test it.
Do a right click on the apktool.yml file and choose “APKLAB: Rebuild the APK”
The new APK file is in the ‘dist’ folder, where your decompiled files are.
Install the new APK
Now you can put that APK file on your phone and install it.
One of my phone which isn’t rooted couldn’t install that new APK, but it works well on my rooted one.
Let’s take a look to the new app !
Before:
Yeah, sorry for that quality…
After:
Now I can feed my cats with cake-snails and some empty potatoes huhuhu
Have a nice day