Cocos2d-x and Cocos Creator Decompiler

Cocos Decompiler Online

Cocos2d-x and Cocos Creator APKs — encrypted .jsc and .luac back to readable script.

.apk .xapk .jsc .luac XXTEA
Drop your Cocos APK or XAPK here
Choose file

⚠ Drag-and-drop upload could not load — an ad blocker is most likely blocking it. Please disable your ad blocker and reload the page to upload a file.

How It Works

1

Find the key

Every printable string in the game's own native library is trial-decrypted against one small script. Nothing is executed.

2

Decrypt

The whole assets/ script tree is XXTEA-decrypted, signature prefix and all, into a cocos/ folder.

3

Decompile

JavaScript is already source. Compiled Lua chunks go through the Lua and LuaJIT decompilers.

What to Upload

Upload the game's .apk, or its .xapk if that is what you have. A normal APK decompiler shows you the Java that starts the Cocos engine — a few dozen classes of glue. The game itself is JavaScript or Lua under assets/, and in a shipped title it is almost always encrypted. This decompiler keeps the Java, resources and smali output intact and adds a cocos/ folder containing the scripts.

Prefer the XAPK. Modern store listings split a game across a base APK and per-architecture config splits. The scripts live in the base and the native library that holds their key lives in config.arm64_v8a.apk, so a base APK on its own has nothing to recover the key from. An XAPK contains both, and each split is searched.

What You Get Back

How the Key Is Recovered

Cocos protects scripts with XXTEA, a small block cipher, and the developer picks the key at build time. That key is handed to setXXTEAKey() as the engine starts, which means it is an ordinary string constant sitting in libcocos2djs.so, libcocos2dlua.so, or whatever the studio renamed that library to.

So the key is recovered by reading, not by running: every NUL-terminated printable string in the library becomes a candidate, and each one is used to decrypt the smallest script in the package. XXTEA's encoder appends the plaintext length as an extra word, so a wrong key produces a length that does not fit the file — which is what makes sweeping tens of thousands of candidates practical. The survivor is checked once more against its content, then applied to the whole tree.

Cocos2d-x also writes a signature string in front of the ciphertext, XXTEA by default and renamed as freely as the key. It is detected from the file itself rather than assumed.

Limits

Frequently Asked Questions

What is a .jsc file?

A Cocos Creator JavaScript file after the build step encrypted it with XXTEA. It is not a different language — decrypting it gives back ordinary JavaScript.

What is a .luac file in a Cocos game?

A Lua script, usually XXTEA-encrypted behind a short signature string. Underneath it is sometimes compiled Lua bytecode and surprisingly often plain Lua source.

Do I need the key?

No. Upload the APK or XAPK and the key is recovered from the game's own native library. The result page tells you which key worked.

Is Frida used?

No. Frida-based recipes hook the running game to read the key out of memory. Nothing from your upload is ever executed here; the key is read out of the library as data.

My game is not encrypted at all. Does that work?

Yes. Unencrypted assets/src/*.lua builds are common, and those scripts pass straight through into the same folder.