How to find decryption key for cocos2djs
Rarely seen games based on cocos2djs, the game is compiled and encrypted to .jsc files. I think Cocos2d would come out encrypted by default with it’s hardcoded key. Finding decryption key is pretty easy
This is not for all cocos2djs games. Some games may hide the decryption key, making it hard to find, so you would need to reverse deeper and debug it
Let’s get started!
In this tutorial, I use this game Download LifeSimulator - Chinese Life APK for Android (Free)
Extract jsc files from assets folder of APK file
Now we gonna look after the key
Method 1: Hex editor
Use any hex eidtor that support string search. I use 010 editor
Search for jsb-adapter, jsb-builtin.js or main.js
The key should be located between Game. and .jsb-adapter . In my case the key is e07a4d47-b82e-4f
If it’s blank like this, or you can’t find the key, it must have been encoded or encrypted. Use IDA Pro instead
Method 2: IDA Pro
It is highly recommended to use IDA Pro 7.5 and later which can display string correctly. Older version may not be able to display string correctly
I WILL NOT SHARE LINK TO IDA PRO. HOWEVER IT IS EASIER TO FIND IF YOU USE BRAVE OR DUCKDUCKGO SEARCH
Load the libcoco2djs.so to IDA Pro
Search for AppDelegate::applicationDidFinishLaunching
Press F5 to view pseduocode, and tada!, here is the decryption key
Tools to decrypt and encrypt
You can use any xxtea tools to decrypt and encrypt, like Mika’s Tool Encryption & Decryption JSC Files to Modded Games Based Cocos2djs - Platinmods.com - Android & iOS MODs, Mobile Games & Apps
I successfully decrypted .jsc to .js