arkdecompiler is the decompiler for HarmonyOS NEXT(纯血鸿蒙反编译器), which takes Panda Binary File as input, parses Panda Bytecode, and then translates it into Panda IR. After having IR, we can do various analyses. Based on IR, we reversely construct the native ArkTS AST tree, and then we traverse the AST tree and translate it into native ArkTS source code.
⏳ Cover sufficient corner cases in the official compiler and test262
Cross-platform GUI
Decompilation is currently Linux-only, while disassembly is supported across all platforms. Please configure your environment’s command-line tools before use; you may refer to the default parameters as a guide.
📦 Download: Get the latest pre-compiled binaries for your platform from GitHub Releases
Installation
Tested platform
Ubuntu 22.04
In the future we will adapt to other development platforms such as (Windows, macOS).
Prepare environment
./prepare.sh(It will create the root directory **harmonyos**)
Clone arkdecompiler in harmonyos
cd harmonyos && git clone https://github.com/jd-opensource/arkdecompiler.git
directory structure
➜ harmonyos ls
ark.py arkcompiler arkdecompiler build developtools docs foundation kernel out prebuilts prebuilts_download.sh third_party
Apply patches to arkcompiler and third_party
Apply patches to arkcompiler/runtime_core, arkcompiler/ets_frontend, and third_party/protobuf according to the patches.
Usage
Build the decompilation main program xabc
./build.sh
Prepare the source code file
Create demo.ts(refer tests directory)
Compilation && Decompilation
./run.sh(It will invoke genlogs.sh)
detailed description
The compilation result is:demo.abc(generated by genlogs.sh)
arkdecompiler
arkdecompiler is the decompiler for HarmonyOS NEXT(纯血鸿蒙反编译器), which takes Panda Binary File as input, parses Panda Bytecode, and then translates it into Panda IR. After having IR, we can do various analyses. Based on IR, we reversely construct the native ArkTS AST tree, and then we traverse the AST tree and translate it into native ArkTS source code.
🤝 Developer Community
🏠 QQ Group: 122560868
Schedule
Cross-platform GUI
📦 Download: Get the latest pre-compiled binaries for your platform from GitHub Releases
Installation
Tested platform
Ubuntu 22.04
In the future we will adapt to other development platforms such as (Windows, macOS).
Prepare environment
Clone
arkdecompilerinharmonyosApply patches to arkcompiler and third_party
Apply patches to
arkcompiler/runtime_core,arkcompiler/ets_frontend, andthird_party/protobufaccording to thepatches.Usage
Build the decompilation main program
xabcPrepare the source code file
Create
demo.ts(refertestsdirectory)Compilation && Decompilation
./run.sh(It will invoke
genlogs.sh)detailed description
genlogs.sh)Demo
Decompile bytecode to arkTS
AST