Android Ninja - Reverse Engineer SO Library?

Posted at


For minor modifications, use XVI32 (or any Hex-Editor, really... ☕)


You can change text (ASCII/Unicode), search&&replace, etc...

☞ for best results make sure to work in override-mode, pay close attention on \\0 (string-ends).


A Real Binary Modifying Scenario (..tried to made it more generic but...)


ⓐ given game.apk

ⓑ extract it using: java -jar apktool_2.0.2.jar --verbose d "game.apk" (it will generate a folder under your base folder, let's say it's D:\\).

ⓒ you want to add a language resource (for example Hebrew) to current list:

ⓓ you copy one of the plist files, for example: en.plist to he.plist in same directory, and translate the values to your language.

ⓔ trying to locate where the resource is being used (the i18 hook..) you look around either manually or using Locate32's File contains text feature (yes it works in binary files too) for one of the lanugages for example de.plist

  • you found that two files having that value: the so binary files..




ⓕ you... (starting to feel like d&d master, dropping scenarios..) ..open up XVI32 and and opens the binary libgame.so file w/it
CTRL+F is your friend, look for combinations that might help you locate blocks of related resource-names (for example "en." "english" - also Unicode and Hex variations)





in-order to avoid large modification I'm going to look for language I do not use, and replace the description with my own. this is to avoid insert mode which rarely succeed ☁☔ :/

ⓖ start looking for a language you want to replace with your language (for example de.plist)

  • there is the beauty:


ⓗ change the d in de.plist to h, and continue searching around..

(easy! right?)

ⓘ taddamm.. your resource is now """officially""" binary'tise (is that even a word?)

ⓙ as an alternative go back to ....\\localizations remove the it.plist and duplicate he.plist renaming the duplicated to it.plist so either way you'll have your content in the game.apk
ⓘ shows the binary way, while ⓙ uses a resource modification, when used together you can be sure your language is in there :]

ⓚ build your APK back using java -jar apktool_2.0.2.jar --verbose b "D:\\game\\"

ⓛ get your APK from D:\\game\\dist

ⓜ generate keystore: keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 (use any password for example 111111, answer the rest with [Enter] and "yes" at the end.)

ⓜ sign your apk: jarsigner.exe -verbose -keystore my-release-key.keystore -storepass 111111 -signedjar "game_signed.apk" "game.apk" alias_name

ⓝ align your apk: zipalign -v 4 "game_signed.apk" "game_signed_and_aligned.apk"

ⓞ install your apk to your phone: apk install "game_signed_and_aligned.apk" your new resource will be shown now, if it isn't just switch to "Italian" which has being modified to be Hebrew...

ⓟ go outside and play ⚽

ⓠ ???

ⓅⓇⓄⒻⒾⓉ!