This project involved decoding an APK file, analyzing its source code, fixing bugs, and completing a game to display the final FinishGame Toast message.
-
Decompiled the APK:
- Used http://www.javadecompilers.com/apk to decode the APK file.
- Extracted the
/sources
and/resources
folders. - Created a new Android Studio project and copied the Activities, layouts, and other required files.
-
Modified the AndroidManifest.xml:
- Added the necessary permissions, such as
<uses-permission android:name="android.permission.INTERNET" />
, to ensure proper functionality.
- Added the necessary permissions, such as
-
Identified and Fixed Bugs:
- Encountered a
NullPointerException
due to missing or incorrect views in the layout file. - Resolved an
ArrayIndexOutOfBoundsException
caused by accessing invalid indices in the sequence validation logic. - Debugged and ensured the
arrowClicked()
andfinishGame()
methods worked as expected.
- Encountered a
-
Played the Game to Find the Sequence:
- The game's goal was to input the correct sequence using the arrow buttons (up, down, left, right).
- The sequence was derived by taking my ID and applying
mod 4
to each digit to generate a sequence of numbers (0, 1, 2, 3).
-
Completed the Game:
- Input the correct sequence and fixed bugs until the game displayed the FinishGame Toast message.
- The final message was: "Survived in <state>" (screenshot attached below).
To pass the game, you need to determine the correct sequence of moves based on your ID. For example, using the ID 123456789
:
- Take each digit in the ID and calculate
digit % 4
to get the sequence: - 1 % 4 = 1 → Right
- 2 % 4 = 2 → Up
- 3 % 4 = 3 → Left
- 4 % 4 = 0 → Down
- 5 % 4 = 1 → Right
- 6 % 4 = 2 → Up
- 7 % 4 = 3 → Left
- 8 % 4 = 0 → Down
- 9 % 4 = 1 → Right
- The final sequence for the ID
123456789
is: - Right, Up, Left, Down, Right, Up, Left, Down, Right
- Use the arrow buttons to input this sequence into the game to pass!
-
Update Toast Messages:
Change:
Toast.makeText(this, "Survived in " + state, 1).show(); } else { Toast.makeText(this, "You Failed ", 1).show();
To:
Toast.makeText(this, "Survived in " + state, Toast.LENGTH_LONG).show(); } else { Toast.makeText(this, "You Failed ", Toast.LENGTH_LONG).show();
-
Fix URL Change:
<string name="url">https://pastebin.com/raw/ZWNJZWNJZWNJT67TVJG9</string>
To:
<string name="url">https://pastebin.com/raw/T67TVJG9</string>
A screenshot of the FinishGame Toast message:
Here is a video demonstration of the game:
apkDecodingVideo.mp4
This project was a comprehensive exercise in APK decoding, Android development, and debugging. It tested my ability to decompile and understand existing code, modify and fix bugs, and successfully interact with the app's logic to complete the challenge.