Cocos2d-x and Cocos Creator APKs — encrypted .jsc and .luac back to readable script.
Every printable string in the game's own native library is trial-decrypted against one small script. Nothing is executed.
The whole assets/ script tree is XXTEA-decrypted, signature prefix and all, into a cocos/ folder.
JavaScript is already source. Compiled Lua chunks go through the Lua and LuaJIT decompilers.
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.
cocos/js/ — every .jsc decrypted to the JavaScript the developer shipped.cocos/lua/ — Lua source: decrypted directly where the game shipped source, decompiled where it shipped compiled chunks.cocos/bytecode/ — decrypted Lua chunks that the decompiler could not convert, kept rather than discarded.cocos/README.txt records how many scripts were recovered and where the worker found key material.resources/, sources/, smali/ — the normal Android output, untouched.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.
Cocos Creator can use this extension for XXTEA-encrypted JavaScript. For a single file, use the JSC decompiler. It also recognizes V8 and SpiderMonkey bytecode.
A Lua script, usually XXTEA-encrypted behind a short signature string. Underneath it is sometimes compiled Lua bytecode and surprisingly often plain Lua source.
Upload the APK or XAPK and the worker can recover the key from the game's own native library. The result lists the recovered scripts and the library where the key was found.
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.
Yes. Unencrypted assets/src/*.lua builds are common, and those scripts pass straight through into the same folder.