Re harmonyos

From dslsdzc/rev-skills · View interactive version

Re harmonyos is an AI agent skill from the GitHub repository dslsdzc/rev-skills. 鸿蒙(HarmonyOS)应用逆向:hap/hsp/har 包结构、ArkTS 字节码(.abc、ArkCompiler)分析。 触发词:鸿蒙、HarmonyOS、hap、ArkTS、abc 字节码、方舟编译器

How to use this skill

Skill file

鸿蒙应用逆向(HarmonyOS / hap / ArkTS)

何时使用 / 何时不用

工具准备

参考 [[re-analyze/platform-tips]]——静态分析(解包、字符串、反汇编)免沙箱;动态步骤按最高原则进沙箱。

hap 解包(zip 容器,通用思路)

python3(字符串提取与脚本)

字符串/资源提取工具

ArkCompiler 反汇编器(针对 abc 的替代,泛化描述)

操作步骤

按顺序执行;每步产物(解包目录、反汇编输出 + sha256)存档(见 [[re-triage]])。

  1. 包结构识别与解包:

```sh

file app.hap

unzip -l app.hap | head -30

unzip -o app.hap -d out/

```

  1. 字节码识别(.abc):

```sh

find out/ -name "*.abc" | head

xxd out/ets/modules.abc | head -10 # 看文件头

```

  1. 业务逻辑还原(字符串 + 反汇编):

```sh

strings -n 8 out/ets/*.abc | grep -iE 'https?://|key|secret|token|sign' | head

grep -rnE 'https?://|key|secret' out/resources/ | head # 资源内字符串也是线索

```

  1. 与 Android 异同:
  1. 动态侧(沙箱):

跨域联合

常见坑与陷阱

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.