Skip to content
KitploitKITPLOIT
ツールエクスプロイトブログ
Log in
提出
ツールエクスプロイトブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
apk-reverse — Android APKリバースエンジニアリング用のAgentスキル:dexパッチング、アンパック、再パック、広告とペイウォールの削除、ネイティブ.so解析、Fridaによるランタイムインストルメンテーション。 | Kitploit
ツール/GitHubGitHub/newliver666/apk-reverse
Androidセキュリティ静的分析動的分析 (サンドボックス)コード分析モバイルアプリペンテストリバースエンジニアリングスクリプトと自動化マルウェア分析モバイルセキュリティバイナリ解析学習と教育
1.4k37921日前未レビュー

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有
GitHub
newliver666/apk-reverse

apk-reverse

Android APKリバースエンジニアリング用のAgentスキル:dexパッチング、アンパック、再パック、広告とペイウォールの削除、ネイティブ.so解析、Fridaによるランタイムインストルメンテーション。

リポジトリを見る

apk-reverse

English · 简体中文

stars forks license python android ci

機能 · 構成 · インストール · 要件 · 失敗カタログ · スコープ · メンテナンス · 免責事項

apk-reverse

Android APK のリバースエンジニアリング、デブロート、広告除去、外科的な dex パッチ、再パッケージ、およびランタイム/サーバー解析のための Agent Skill。

これはスキルであり、チュートリアルではない。エージェント(Claude Code、 Codex、または Agent Skills 形式をサポートする任意のハーネス)が作業中に読み込むことを前提に書かれており、 段階的開示のために構成されている — 意思決定指向の短い SKILL.md、あるステップが必要としたときにのみ読み込まれる詳細なリファレンス、そして直接実行できるパラメータ化されたスクリプト。

エージェントがこれをどう消費することが期待されているか

SKILL.md は助言としてではなく、意図的にゲート付きの手順として書かれている。なぜなら、 観察される失敗モードは無知ではなく — モデルが全体を読み、それに同意し、 それでもなお第一原理から推論してしまうことだからである。

したがって、本文中には読むのではなく行動することが意図された4つの要素がある:

  • 4つのオーバーライドルール(R1–R4)。 これらが現在の計画と衝突する場合、証拠が それらを覆すまで、これらが優先される。
  • 症状インデックス。 各行はすでに代償を払った失敗である。一致する行は停止信号である: さらにコマンドをいくつか実行した後ではなく、別のコマンドを実行する前にそのファイルを読み込む。 既知の症状を推論で乗り越えることが、同じ時間を二度費やす方法である。
  • 4つのゲート(G1–G4)、 それぞれが合格基準を伴うアクションである。「考えは理解した」では ゲートは通過できない。これらは、分類、環境の真実、および対照ビルドが、最初のパッチの前に 行われるように存在しており、3度目の失敗の後ではない。
  • ツーストライクルールと停止条件。 同じ形の失敗が2回あれば、モデルが間違っているのであり、 パラメータが間違っているのではない。すでに2回失敗した仮説の3番目の変種は、ラウンドが 死にゆく場所である。

そして最後に保留されることが意図された1つのこと:**「完了」**には定義がある(6項目)。クリーンな ログはそのうちの1つではない。6項目すべてに満たないものはチェックポイントであり、残っているものとともに チェックポイントとして報告されるべきである。

もしあなたがこれを読んでいるエージェントなら:最も安価な最初のコマンドは python skills/apk-reverse/scripts/doctor.py である。これは、ここにこれらのツールのどれが存在するか、どの スクリプトが実際に実行できるか、そして環境内の何かがすでにあなたの 測定を汚染していないかを教えてくれる。

何が得意か

  • リクエストがクライアント側でそもそも達成可能かどうかを迅速に判断する。サーバーによって 強制されているペイウォールに何時間も費やす代わりに。
  • 作業を始める前に成果物が取るべき形態を判断する — ルート化されていない、 自己完結型の成果物は「このマシンで動かす」とは別の問題であり、この2つを混同することが この領域で最も高くつくドリフトである。
  • 与えられた変更に対して最も安全なパッチ層を選び、アプリを 壊す層を避ける。
  • 成功に見える再パッケージ失敗を捕まえる:アプリがインストールされ、起動し、 完璧に描画される一方で、すべての署名付きリクエストが拒否される。なぜならクライアントは 自身の署名証明書からリクエスト署名鍵を導出しているからである。
  • 自分自身のミスをアプリやサーバーの問題から分離する — 機能スコープの失敗(ログイン、登録、支払い)は、 しばしば1つのコードパス上の TLS/証明書の問題であり、あなたが今ビルドしたパッチの 結果ではない。デバイスの状態、死んだデバイスサーバー、クロックドリフトも同じように 偽装する。
  • マニフェストが同梱しているものやデバイスが主張するものを信頼するのではなく、 どのアーキテクチャとどのライブラリが実際に実行されているかを確定する。
  • パック/ハードニングされたターゲットを攻略する:パッカーを特定し、アンパックし、 メモリダンプをパッチ済みのインストール可能な APK に戻す。
  • 意図的にプロセスを終了させるハードニングされたライブラリを扱う — 通常のヌル参照 バグにそっくりに見える意図的なクラッシュ形状(fault addr 0x4)や、 修正が機能するか、原因とはまったく似ていない形でアプリ全体をフリーズさせるかを決める 「無効化するが、決してリターンしないようにしてはならない」ルールを含む。
  • どのツールに手を伸ばすべきか、そしてそれぞれがどこで嘘をつくかを知る — GUI としてしか 存在しないものも含むため、より弱い方法を黙って代用するのではなく、人間に依頼する。
  • パッチ済みビルドをパッチ済みのまま維持させる:バージョンチェック、強制アップグレードダイアログ、 自己更新インストーラーを無効化し、作業がリモートでオフにできないようにする — そして、バージョン変更なしに それを静かに元に戻しうるホットアップデート/リモート設定チャネルを認識する。
  • クライアント側のサインインゲート(パッチ可能)とアカウントスコープのリソース(サーバーが 答えるものを持たないため空)を分離し、セッションを偽造するとサインアウトよりも悪い状態を 生み出すことを知る。
  • 長時間のタスクを誠実に保つ:ライブ記録、格付けされた結論、較正されたタイムアウト、および 有界の待機により、進捗が失われず、同じミスが二度行われないようにする。
  • 完璧にビルドされ、ランタイムで死ぬ APK を生み出す特定のミスを 避ける。
  • APK が選択肢にならない場合に成果物がどうあるべきかを判断する — 複数の独立したチェックによって 拒否された再パッケージは高コストではなくブロックであり、フォールバックのはしごはシステムレベルの モジュール、ローカル RPC サービス、または境界を明示した正直なレポートである。
  • 本物のメモリダンプと抽出シェルの骨組みを見分け、どの復旧経路が 適用されるかを知る — frida 自体が拒否された場合の root 側ダンプを含む。測定が何を見ることができ、 何を見ることができないかは skills/apk-reverse/references/advanced-unpacking.md にある。
  • リバースするよりも呼び出す方がコストが高い場合に、リバースするのではなくルーチンを呼び出す: ホスト上でのエミュレート実行、または Frida RPC を介してサービス化されたライブ関数。
  • ネイティブ関数が OLLVM によってステートマシンに平坦化された場合に、を 読む — 実機で Stalker が噛みつき返すと測定された2つの方法を含む。

構成

SKILL.md、references/、scripts/ はすべてスキルディレクトリ skills/apk-reverse/ の中にある。 リポジトリルートにあるものはすべて、スキル間で共有されるメンテナンスツールであり、インストールされた スキルの一部ではない。``` SKILL.md a procedure with gates, not background reading: how-to-use -> four override rules (R1-R4) symptom index (a matching row is a stop signal) four gates (G1-G4, actions with pass criteria) thirteen classification questions the workflow, with a per-step skip condition and a two-strike rule what "done" means -> stop conditions -> constraints -> indexes references/ loaded on demand, one topic each recon.md identify packer, SDKs, code location, tamper checks; unpacking server-config-and-updates.md the most common shape of "ad" and the one usually mis-diagnosed: the server supplies UI the client renders (launch screen, popup, announcement, tab set). The two-layer fetch that proves it, how to find the config DTOs by the field names data classes keep, why you patch the decision and not the data, deciding the scope of "remove", and remote re-enable / cached config durability byte-level-patching.md equal-length byte edits: why they beat method rebuilding (measured), locating an instruction's exact offset without scraping listings, the instruction width traps that desynchronise a decode, neutralise a branch vs redirect it, dex header integrity field order, and the verifier's move-result rule packers.md hardened targets: rejection signals, measuring the validation boundary with single-variable tests, choosing a native host code-virtualization-and-custom-linkers.md the layer between "packed" and "clean": whole classes turned into native declarations, a private loader whose SONAME does not match its filename, an embedded self-decrypting payload, a Java-layer "signature killer" that logs success while a native check kills you. The keep-it/drop-it deadlock, how to separate the checker from the implementation, and the string-redirect technique that ends it without neutralizing anything framework-runtimes.md Flutter / React Native / Unity: which layer owns the UI, and how to find logic when there are no symbols (string encoding traps) dart-aot.md Dart AOT in depth: version pinning and building a matching decompiler, the object pool and reference indexes, register/boolean conventions, the three signatures that identify business logic, locating, patching. Begins with the snapshot-decoding front end it depends on (aotopsy or blutter) because the pool listing is an input, not something this skill produces itself native-and-so.md .so hosts, DT_NEEDED vs JNI_OnLoad, relocation limits, relocation-free bootstrapping, replacing Java methods natively, and which ABI/library is native-tamper-and-suicide.md how a hardened library kills its own process: the visible mechanisms, how to tell which one actually fires, how to find the site, forged section headers, function boundaries from PT_GNU_EH_FRAME, scanner traps, and neutralising safely detection-and-anti-analysis.md when the app fights back or the tool cannot run here: telling detection apart from a broken environment, deciding by cost instead of escalating, recognising an environment where dynamic analysis simply does not work, and keeping the "blocks my analysis" question separate from "blocks the deliverable" toolchain.md what to install, how to invoke it non-interactively, which tools are GUI-only, version-alignment traps, working offline, , and which signer to use long-task-discipline.md live record, conclusion grading, drift control, timeout and wait calibration, deliverable-form drift, captures-you-never-looked-at, long-context decay, handover ad-removal.md ad taxonomy, wrapper mapping, callback trap, global gates, verification updates-and-forced-upgrade.md keeping a patched build alive: locating the version check, the two-layer patch (no-op the routine, neutralise the comparison), what not to touch (manifest version, installer permission, host blocking), self-update and hot-update/remote-config channels, verifying that no version request is issued at all account-gates.md sign-in walls, forced phone binding, guest mode: telling a client-side gate (patchable) apart from an account-scoped resource (not), why fabricating a session is worse than staying signed out, and the unavoidable session loss after a reinstall signature-derived-keys.md when the app's own signing certificate is used as key material: detection greps, why offline extraction is unreliable, the hardcode-then-verify procedure membership-and-limits.md server vs client authority; what is and is not patchable server-api.md probe an app's API; prove who owns the gate tls-and-cert.md feature-scoped network failures: expired certs, dual trust chains third-party-builds.md auditing a "cracked"/"modded" APK before trusting it dex-patching.md patch-layer table + dexlib2 technique in depth patch-audit.md proving a patch and is : length-vs-bytes comparison, the equal-length-replacement blind spot, verifier-level legality (move-result adjacency) checked statically, text-matching patch traps, and reporting a missing patch repack-and-sign.md repack rules, unpack-and-repack, signing, post-install hazards runtime-data.md DataStore / SharedPreferences / SQLite / protobuf; when the app rewrites your edit, and decoding a value that looks encrypted dynamic-frida.md Frida setup, version pinning, the four-layer probe, hook strategy environment.md device/emulator setup, root, ADB, offline devices, log signals, emulator console control and recovery, preflight, look-at-the-screen verification.md the claim ladder; what "done" means desensitization-and-leak-scans.md publishing discipline: what must be desensitized and what must stay, the do-not-anonymize list, the leak scanner and its exit states, and the entry-point file as a prompt surface precedents/ the positive case library: route including dead ends, a grade per assertion, measured pit-falls, and the write-back checklist routing.md the on-demand inventory: every reference with when to load it, every script with what it does, and a mirror of the symptom index rasc-and-droidsaw.md the Rust re-implementation of the ASC indexer: measured speedup and identical class sets, the enum shape where it silently drops bodies, and how to build and verify it evidence-summary.md the condensation that ships with the skill: capability, one-line conclusion, strength, and the evidence you can actually open in an installed copy

../evals/ NOT a spec directory either, but the location the Agent Skills guidance recommends: evals.json holds the with-skill / without-skill cases this skill has not run, with the method for running them written into the file ../evidence/ NOT a spec directory: the machine-readable companions to the evidence summary reference above -- capability-matrix.json (the same rows with more fields), tested-tool-versions.json (versions and the probe behind each), known-limitations.md (the installer-facing limit list). Shipped inside the skill so an installed copy can answer "was this verified, and how strongly" without the repository pitfalls.md the failure catalogue -- read before building advanced-unpacking.md the dump landed but the bodies are empty: extraction-shell diagnosis by trivial-body ratio, FART-style active invocation and why its classic hooks died on Android 12-16, code_item splicing, the root-side dump for when frida itself is refused, and the honest VMP boundary lsposed-and-modules.md the repack is refused, so deliver a system-level hook module instead: module anatomy, a gradle-free build chain, scope configuration and how to verify injection, and the layer a Java module cannot reach emulation-and-rpc.md call the routine instead of reading it: Unidbg/Unicorn emulation and its environment-filling cost, versus service-ifying a live function over Frida RPC native-dbi-and-deobfuscation.md OLLVM shapes, Frida-Stalker traces, the trace-to-CFG route, the Stalker/QBDI/emulation decision, and two measured boundaries (a follow that delivers no events, and a crash from following a hot libc export) protocol-reverse.md protobuf without a schema, schema recovery from decompiled code, gRPC frame capture, the QUIC/HTTP3 limit, and native-side certificate pinning kernel-and-environment-hardening.md userspace hooking provably cannot reach the check: raw svc, init_array-early detection, what each root scheme hides, the kernel-route map with its version gate, and when to stop escalating on-device-tooling.md working from the phone itself: MT Manager edit/repack/sign and its APK MCP, LSPosed Manager, Termux+frida, on-device data inspection java2c-and-jni-sinking.md Java2C and JNI sinking, the two hardening shapes most easily confused with an extraction shell: the table that separates landing shell / extraction shell / VMP / Java2C / JNI sinking, why the code is in the and in a dumped dex, and why a symbol search comes back empty (dynamic registration, ) split-apk.md App Bundle / split APK sets: what the set is, pulling it off a device, merging into one APK vs signing the set as a unit, the install refusals and what each means, and making an installable fixture from a pulled set vmp-differential-analysis.md the known-plaintext differential for a real Dex VMP: which links can be automated and which cannot (the upload is the bottleneck), the coverage a compiled fixture can reach, how to a derived private-opcode table, smali generation, and when the route is closed coverage-and-limits.md the claim ladder applied to the skill itself: the evidence behind each covered item, the dependencies this skill does not ship, and what was never exercised handoff-boundaries.md where this skill ends and another discipline begins: the JNI form table, the packer-versus-loader split, and what "verified" means for each of the four deliverable forms scripts/ parameterized, path-agnostic doctor.py run this first: capability report + per-script runnability, finds tools installed off-PATH or as runnable jars, and surfaces the environment facts that poison experiments (clock skew, leftover adb forward / proxy, a device-side frida process already running) dexutil.py dependency-free dex reader: structural walk + exact instruction decode, dex header recompute/verify (correct checksum/signature order), branch-target and operand helpers. Library shared by the dex scripts, also runs standalone to dump one method with offsets dex_find_insn.py locate an instruction by decoded semantics and print its exact byte offset with context and both sides of any branch -- how you find a patch site instead of guessing offsets dex_patch_bytes.py equal-length byte patches from a JSON spec: semantic match, polarity pin via expect_next, equal-length enforcement, verifier check, dex header recompute, re-decode to prove it landed (--dry-run first) dex_check_verifier.py tier-3 check: does any conditional branch target a move-result (bypassing its producer)? Compares two builds and separates pre-existing findings from regressions your patch introduced coldstart.py cold-launch capture: timed screenshot burst + logcat signals + installed-build facts + launch timing, and warns when the foreground activity is not your app so_constpatch.py same-length in-place rewrite of an isolated string constant, for redirecting a library load instead of defeating a check smtool.py baksmali/smali wrapper with a configurable classpath dexpatch/ dexlib2 method-level rewriter (for changes that need new instructions) patch_smali.py method-body replacement in a smali tree dex_strpatch.py byte-level string patch with a string_ids ordering guard dex_classdiff.py prove a dex edit was surgical dex_strings.py strings/URLs/SDK markers without a decompiler dart_pool_strings.py recover literals from a Dart AOT snapshot (framed entries, the one-byte vs UTF-16 split, file offsets, run-length noise filter) dart_pprefs.py build/query the object-pool -> code-site index for a Dart snapshot dart_disasm.py annotated windowed disassembly of Dart AOT code + B/BL caller index find_refs.py count callers of a method before patching it repack.py rebuild APK, strip only signatures, keep META-INF/services/, write a 4-byte-aligned archive (resources.arsc STORED+aligned), sign, verify; also split APK / App Bundle sets: inventory, sign every member with one keystore, or merge code/native members into a standalone APK devsh.py quoting-safe ADB shell helper usb_net_proxy.py give an offline device network over USB datastore_inject.py encode/inject AndroidX DataStore preferences safely probe_api.py probe an HTTP API with the right headers grab_crash.py recover stacks hidden by a crash-reporter SDK install_test.py install + launch health check with logcat signal scan frida_probe.js four-layer runtime probe (app net layer + OkHttp + java.net + exceptions) run_probe.py inject the probe, stream it to a log file, stay resident tls_check.py strict certificate check for one or more hosts preflight.py environment check before every experiment block (device, root, ABI/translation, clock skew, leftover proxy/forwards, dead server) lib_map.py what is into a live process: per-library path, base, architecture, and whether it came from the APK or was materialized at runtime elf_plt.py resolve a PLT stub to its imported symbol (x86_64 + aarch64) from the relocation table; list a symbol's callers; byte-diff two libraries and name the symbol each changed stub belongs to apk_diff.py entry-level diff of two builds: changed / added / removed, by content hash so same-size replacements are caught native_crash.py locate a native death from a log or tombstone: signal, fault address, registers, frames split app vs system, the faulting instruction, and a flag when the fault looks blob_decode.py search, don't guess, the framing of a stored value (base64/hex x rotation x deflate); re-encode the edited payload snap.py bounded burst screenshots + control-tree capture with a stall detector, and a verdict on whether the tree is usable at all sig_probe.py find the exact signatures[0].toCharsString() value — offline candidates from an APK, or the authoritative read from a device spawn_patch_detach.py spawn under a Frida probe, detach, then launch and capture: under spawn mode the Activity stack often never comes up, and memory writes survive detach while hooks do not hook_patch_only.js the minimal probe for spawn_patch_detach.py — neutralise one native death site by offset and report PATCHED dex_dump_validate.py dedupe, validate and rank a directory of dumped dex images: sha256 grouping, header integrity, the trivial-body ratio that separates a real dump from an extraction-shell skeleton, and a most-likely-original ranking (--trim for page-aligned /proc//mem captures) dex_mem_scan.py search memory captures for embedded dex images and extract each at the size its own header declares -- for a decrypted dex sitting in an anonymous mapping no maps entry names lsposed_scaffold.py generate a minimal LSPosed/Xposed module project (manifest with the xposed meta-data, assets/xposed_init, hook class, gradle-free build notes) frida_rpc_serve.py bridge a Frida script's rpc.exports to a local caller with reconnect handling, so a live native function can be called rather than reversed rpc_template.js the editable companion to frida_rpc_serve.py stalker_trace.js instruction-level tracing with Frida Stalker: configurable targets, trigger selection, the event stream, and output-size rules stalker_report.py reduce a stalker_trace.js log to block histograms and call sequences, with an explicit diagnostic for the measured zero-event case mt_mcp_probe.py probe MT Manager's on-device APK MCP (Streamable HTTP, port 8787): JSON-RPC handshake plus the grouped tool inventory java2c_probe.py collect the evidence that separates Java2C from an extraction shell, a VMP and ordinary JNI sinking: native density and stub ratio from the dex, JNI_OnLoad / dynamic registration / toolchain strings from the , each item labelled strong/medium/weak protobuf_decode_raw.py schema-free protobuf decode: hex / file / stdin to a JSON tree, every length-delimited field kept as a candidate set with ties labelled rather than guessed, plus a byte-exact re-encode to check a round trip vmp_diff_harness.py build a labelled opcode-coverage fixture, derive a candidate private- opcode map from an original/hardened dex pair, verify the comparison in a closed loop, and render a restored stream as a smali skeleton kernelsu_syscall_mask.py generate a KernelSU/APatch syscall-masking scaffold: an installable userspace module skeleton plus KPM/LKM/eBPF kernel-side templates, each with its version gate and an explicit unverified label rasc_build.py build and verify rasc, the Rust ASC re-implementation: --check what is present, --build clone plus cargo, --verify an APK against droidasc and fail on any class-set difference scan_leaks.py scan a repository for target identity before publishing it: bundle ids in manifest / / contexts, serial-shaped tokens, PATs, inline appkey assignments, literal endpoints, host user paths. Exemptions for everything that must stay (tools, libraries, CVEs, hardening products, public crackmes, placeholders), findings carry their context, prints why a hit was suppressed, exit 0/1/2 svc_scan.py name the syscall behind an inline and the segment it sits in, which decides whether a libc-level hook can observe the call at all; shows neighbours because a byte scan also matches data anti_detect_probe.js observer-only Frida probe (patches nothing): path/loader/thread/kill hooks with caller module + offset, an environment self-report (, frida-named mappings), and live streaming so a sub-second self-destructing target still yields evidence

root@kitploit:~
リポジトリには**実行可能な**テスト層も含まれていますが、これはエビデンス記録とは別物です。`tests/` はスクリプトの動作(ユニット、CLI コントラクト、デバイス不要の統合テスト)を検証し、`tests/benchmark.md` は実際のターゲット上でルートがどう動作したかを記録します。`tests/README.md` にこの区分が記載されており、`.github/workflows/ci.yml` がゲートとスイートを実行します。

## インストール

このリポジトリは**スキルリポジトリ**です。スキルは `skills/apk-reverse/` にあり、これは `skills` CLI が解決するレイアウトであり、ディレクトリをコピーするのではなく名前でインストールされます:```
npx skills add newliver666/apk-reverse              # install every skill in the repo
npx skills add newliver666/apk-reverse --list       # list what is here, install nothing
npx skills add newliver666/apk-reverse --skill apk-reverse -y
npx skills use  newliver666/apk-reverse@apk-reverse # use it once, without installing

CLI はデフォルトでスキルをエージェントのスキルディレクトリにシンボリックリンクします(--copy を使うと代わりに独立したコピーを作成します)。また -g は現在のプロジェクトではなくすべてのプロジェクトにインストールします。リポジトリにスキルが 1 つしかない場合、--skill apk-reverse は現時点では冗長です。ここに明記しているのは、2 つ目のスキルができたときに単一のスキルを選択するのがこのオプションだからです。

インストールされると、エージェントはタスクがその説明に一致したときに SKILL.md を読み込み、必要に応じてのみ references/* を参照します。グローバルな状態も、マシン固有のパスも、ビルドステップもありません。

要件

必須のものは何もありません。各スクリプトが必要なものを確認します。skills/apk-reverse/scripts/doctor.py は、ここにどれが存在するか、したがってどのスクリプトが実行できるか、そして便利なことに、どのツールが PATH 以外の場所に存在するかを報告します。

ツールチェーンが PATH の外にある場合(プロジェクトローカルの tools/ ディレクトリ、バージョン管理された SDK フォルダ、コマンドではなく実行可能な .jar など)、APKREV_TOOLS を 1 つ以上のディレクトリに設定すると、doctor.py がそれらを見つけます:``` set APKREV_TOOLS=

; # Windows, e.g. an SDK or project-local tools dir export APKREV_TOOLS=: # POSIX

root@kitploit:~
スクリプト自体はプレーンな `python3` であり、Windows、macOS、Linux で同一に動作することを意図している。POSIX 専用のスニペットにはその旨がラベル付けされている。ここでは Unix シェルを前提としていない。

| ツール | 用途 |
|---|---|
| Python 3.9+ | すべてのスクリプト |
| **`droidasc`** (ASC)(**任意だが強く推奨 — まずこれをインストールすること**) | APK 全体のクロスリファレンスインデックス: `findrefs` / `listclass` / `getclass` / `getmanifest`。`pip install droidasc` 一発で、JVM も SDK もインデックスビルドも不要。「N 千個のクラスのうちどれがこの文字列に言及しているか」をサブ秒のクエリに変え、R8 が名前を難読化したクラスに到達する唯一の経路でもある。**これはエージェントが完全なデコンパイルの前に手を伸ばすべきツールである** — `skills/apk-reverse/references/toolchain.md` §droidasc (ASC) — ask an APK "who references this?", in one query を参照 |
| `ddc`(任意だが強く推奨) | シングルバイナリの dex→Java デコンパイラで、クエリ用サブコマンド(`info`、`findrefs`、`strings --with-locations`、クラス単位のデコンパイル)を備える。JVM 不要。ASC が**特定**したものを**読み取る**。パッケージの同一性も確実に報告する — `skills/apk-reverse/references/toolchain.md` §ddc — dex-to-Java with query subcommands (worth adopting) を参照 |
| `baksmali` / `smali` + `dexlib2` jars | 逆アセンブル、アセンブル、外科的パッチ |
| JDK (`javac`, `java`) | dexlib2 パッチャーのビルド/実行。`keytool`/`jarsigner` も提供する |
| Android SDK build-tools (`aapt`, `zipalign`, `apksigner`) | マニフェスト情報、アラインメント、署名。**使用すべき署名ツールは `apksigner`** — `jarsigner` はアーカイブを書き換え、Android R+ が要求するアラインメントを壊す |
| `uber-apk-signer`(任意) | アラインメント + 署名をワンステップで |
| ADB | デバイス作業 |
| Frida(ホストパッケージ + 対応するオンデバイスサーバー) | 動的解析 |
| root 化されたデバイスまたはエミュレータ | 静的解析を超えるあらゆる作業 |

これらはいずれも `PATH` 上にある必要はない。すべてのスクリプトは、シェルアウトするツールへの明示的なパスを受け付け、`skills/apk-reverse/references/toolchain.md` は `PATH` が知らないインストール先を見つける方法(`apksigner` や `keytool` でよくあるケース)を扱っている。

## まずこれを読むこと

**本プロジェクトは学習、研究、および許可されたセキュリティテストのみを目的として公開されている。** エクスプロイトペイロード、ターゲットデータ、サードパーティバイナリは一切同梱していない — これは手法であり、スクリプト群であり、証拠記録である。解析対象に対して正当な権利を有することはあなたの責任である。本ファイル末尾の**免責事項**を参照のこと。

`skills/apk-reverse/references/pitfalls.md`。ここで最も価値のあるファイルである — すべての項目は、完全に健全に見えながら壊れた成果物を生み出した失敗である。

最も痛い 4 つ:

1. 再パッケージ時に `META-INF/` 全体を削除すると ServiceLoader の登録が消え、アプリは無関係なライブラリを名指しするエラーで起動時に死ぬ。
2. `string_ids` の順序を保たずにバイトレベルの文字列をパッチすると、チェックサムと署名は完璧に検証されるのに dex 全体が拒否される。
3. ツリー全体の smali ラウンドトリップで dex を再ビルドすると、R8 の出力を目に見えない形で損傷する — クラステーブルの比較はクリーンで、実行時に初めて破綻する。
4. ネイティブの終了パスを**リターンしない**ようにして無効化する。スピニングするスタブはチェックを抑制せず、呼び出し元とその後ろのすべてのスレッドを凍結させる。アプリは*クラッシュ記録が一切ないまま*ハングし、最終的な死は凍結したプロセスを殺した何かのせいにされる。

## スコープ

自身のアプリケーション、解析を許可されたサンプル、および CTF/競技サンドボックスでの作業向けに作られている。ベンダリングされたサードパーティバイナリやターゲット固有のデータは含まない。

何をカバーし、何を意図的にカバーしないかは `SKILL.md` の冒頭、**Coverage** の下に記載されている。短く言えば: Android のみ(iOS は対象外)で、実際にやり通された層 — dex パッチ、再パッケージ、パッカーとカスタムローダー、ネイティブの改ざん応答、Flutter/Dart AOT — を深く扱う。拡張パスでは、文書化された第二層のルートが追加された: 再パッケージがブロックされたときの**モジュール側デリバリー**、**抽出シェルのリカバリ**とその VMP 境界、読み取りではなく呼び出しのための**エミュレーションとライブ RPC**、OLLVM に対する**命令レベルのトレーシング**、REST を超えた**プロトコルリバース**、ユーザー空間フッキングが証明可能に手の届かない場合の**カーネル側ルート**マップ、そして**オンデバイスツーリング**。その後、**ベンチマークパス**で公開ターゲットをそれらのルートに載せた(`tests/benchmark.md`): **Java2C の識別**(存在しない復号済み DEX をエージェントに探させてしまう誤診)、**split APK / App Bundle の扱い**、**スキーマレス protobuf デコード**、**Dex-VMP 差分**ハーネス、そして**バージョンゲート付きカーネルモジュールテンプレート**が追加され、さらに測定結果と食い違っていた以前の 2 つの主張が訂正された。Unity/IL2CPP のロジックリカバリ、React Native/Hermes バイトコードの内部、サーバー側権限の打破は**カバーされておらず**、このスキルは、書かれていないターゲットに最も近い文書化済み手順を適用するのではなく、そう明言して止まるように書かれている。

Coverage セクションが完全に述べ、ここにも属する 4 つの但し書き:

- **Flutter/Dart AOT 解析には依存関係がある。** ワークフローはプール一覧(`pp.txt` クラスの出力)から始まる。それを生成するにはスナップショットデコード用デコンパイラ — aotopsy(静的バイナリ、ツールチェーン不要)または blutter(ソースからビルド、約 80 秒)— が必要であり、本リポジトリには含まれていない。暗黙のままにせず、前提条件として明記している。
- **本リポジトリのすべての主張に実行が伴っているわけではない。** `docs/tool-verification/` は、実際に何が測定され、どのターゲットで、どの独立したクロスチェックとともに行われたかを記録している。そこにカバーされていないものは経験から文書化されたものであり、このスキル自身の主張のはしごに従い、*推論*として読むべきである。
- **拡張パスは別途記録され、そのほとんどは*推論*である。** その証拠は `docs/tool-verification/EXTENSION-*.md` にあり、トピックごとに 1 ファイルで、それぞれに強度の注記がある。そこでの共通の形は*ツールは測定されたが、ルートは測定されていない* — したがって、新しい文書のいずれかを検証済みの経路として扱う前に、それらのファイルを読むこと。
- **ベンチマークパスは行ごとに、その行自身の強度とともに記録されている。** `tests/benchmark.md` は、各公開ターゲット、その行が実行するスクリプト、実際に何が起きたか(失敗した行や誰も実行しなかった行も含む)、そして証拠がどれほど強いかを記している。`unverified` とマークされた行は、メカニズムについてではなく、本リポジトリの証拠についての記述である。

## リポジトリのメンテナンス

ルートには 4 つのツールがあり、インストールされるスキルの一部ではない:```
check_repo.py      every skill discovered, frontmatter valid, scripts runnable,
                   documented paths resolve, README paths explicit and existing,
                   and -- on the tracked surface only -- no target identity
                   (delegates the rules to skills/apk-reverse/scripts/scan_leaks.py
                   so there is one place to argue with the exemption list)
check_refs.py      every cross-reference that names a section of another
                   document reaches a real heading in that document
check_routing.py   the on-demand inventory still matches the entry point: the
                   symptom mirror agrees with SKILL.md, every reference file is
                   named in skills/apk-reverse/references/routing.md, and every
                   script is too
check_commands.py  every command a document tells you to run is checked against
                   the script's own argparse table -- a documented flag that does
                   not exist is a drift the anchor checks cannot see
check_budget.py    keep the always-loaded part from creeping: SKILL.md's whole
                   body (index lines included, because they load too) measured in
                   lines and tokens, index-row length, long files with no
                   navigable head, and hedged rules reported as a trend
build_scripts.py   audit for machine-specific leftovers (absolute paths, credentials)

一貫性には自然な対抗圧力がある——壊れたパスは大きな音を立てて失敗し、誰かがそれを修正する。 肥大化にはそれがなく、だからこそ3番目のツールが存在する。パスごとに参照、インデックス行、 カバレッジの主張が追加され、測定がなければリポジトリ内の何も気づかない。

tests/benchmark.md は回帰マトリクスを保持している: 次元 -> 公開ターゲット -> その行が 実行するスクリプト -> 測定結果 -> 強度ラベル。これは docs/tool-verification/ 配下のあらゆる 主張を信頼する前に再実行すべきチェックリストである。サンプルは tools/_work/ にダウンロード され、決してコミットされないため、各行は公開ソースを明記し、実行対象としたハッシュを記録する。

docs/tool-verification/ もまた、インストールされるスキルの一部ではない。これは実際の ターゲットに対する1回の測定パスの証拠記録である: 各スクリプトが実際に何を行ったか、どの 独立した手法がそれを確認したか、どの欠陥が見つかったか、そしてターゲットが実行できなかった シナリオはどれか。これは、SKILL.md のカバレッジの主張が信頼されるのではなく実行結果と 照合して確認できるように、そしてギャップが次に来る人が見つけられる場所に書き留められるよう に存在する。


LINUX DO コミュニティの誇りあるサポートを受けています。

免責事項

学習、研究、および許可されたセキュリティテストのみを目的としています。 このリポジトリ内の すべてのスクリプト、参照、記録された結果は、Androidアプリケーション分析がどのように機能するかを 説明するために存在し、実務者がすでに所有しているツールについて推論できるようにするためのものです。 ここにあるものはサービスでも製品でもなく、特定の用途を推奨するものでもありません。

  • 許可されたターゲットのみ。 自分が所有するアプリケーション、または分析を明示的に許可された アプリケーション、公開CTF/チャレンジ素材、あるいは自分が管理するサンドボックスで使用してください。 分析する権利のないソフトウェアを分析することは、お住まいの地域では違法となる可能性があり、その 判断はあなた自身が行うものであり、このリポジトリのものではありません。
  • 保証なし、いかなる目的への適合性もなし。 本資料は現状のまま提供され、いかなる種類の保証も ありません。結果はある時点であるマシンで測定されたまま記録されています。ここにあるものは、ある ルートがあなたのターゲット、あなたのデバイス、あなたのツールチェーン、あるいは今日のアプリ バージョンで機能することを約束するものではありません。
  • 信頼する前に検証し、行動する前にバックアップを。 いくつかのスクリプトは成果物(dex、APK、 .so、保存されたアプリデータ)を変更し、一部はroot化されたデバイス上で動作します。自分の コピーを保持し、複製上で作業し、大切なものに対して何かを実行する前に SKILL.md のゲートを 読んでください。
  • あなたの使用はあなたの責任です。 著者および貢献者は、このリポジトリの使用または誤用から 生じるいかなる損失、損害、法的結果、サービス中断についても一切の責任を負わず、それが調査対象と する可能性のあるいかなるアプリケーション、ベンダー、プラットフォームとも提携しておらず、承認 されておらず、代理として行動していません。
  • テストデータはここでは配布されません。 サンプル、ダンプ、デバイス成果物は意図的にツリーから 除外されており(.gitignore がそれらを除外しています)、ローカルの無視されたワークスペースにのみ 存在します。フォローするために入手したものは、安全に保管し、使い終わったら削除するのはあなたの 責任です——現地のルールとサンプルに付属していた条件に従ってください。このリポジトリが公開する のは、すべてのターゲットの身元を除去した、手法と証拠です。
  • 提携関係はありません。 ツール、ライブラリ、ハードニング製品、公開チャレンジターゲットの名前は、 資料を再利用可能にするためにのみ登場します。それらはそれぞれの所有者に帰属し、このプロジェクトは それらと接続していません。
ツールをダウンロード
命令レベルの実行証拠
  • ユーザー空間フッキングがチェックにまったく到達できない場合(生の svc システムコール、 init_array による早期検出)を認識し、上下の次の層が実際に何をできるか、そしてエスカレーションが 間違った答えとなるのはいつかを知る。
  • REST ではないプロトコルを扱う — スキーマなしの protobuf、gRPC、QUIC/HTTP3 — および システムトラストストアを無視するネイティブ側の証明書ピンニング。
  • スマートフォン自体から作業する:MT Manager の編集/再パッケージ/署名フローとその APK MCP サーフェス、 LSPosed Manager、およびオンデバイスのデータ検査を、PC ツールチェーンの代わりではなく 並行して使う。
  • プロセスライフタイムのどの時点にも存在しない復号済み DEX を何時間も探し回る前に、 Java2C と抽出シェルを見分ける — コードは .so にコンパイルされていたのである。
  • split APK / App Bundle セットとして届くビルドを扱う:デバイスからセットを読み取り、 pm install-multiple のためにすべてのメンバーを1つのキーストアで署名する、またはそれが合法な場合に コード/ネイティブメンバーをスタンドアロン APK にマージする。
  • 既知平文差分を用いて本物の Dex VMP を攻略する — どのリンクが自動化でき、どれができないか、 コンパイル済みフィクスチャが何に到達でき、何に到達できないか、そして導出された プライベートオペコードテーブルを主張するのではなく証明する方法。
  • ターゲットを公開せずに学んだことを公開する — アイデンティティ形状をそのコンテキストとともに報告するスキャナー、 何を伏せてはならないか(ツール、ライブラリ、プロトコルフィールド、CVE、ハードニング製品、公開 crackme)の明示的なリスト。 これらを伏せると再利用可能な部分が破壊されるためであり、コミットをゲートする終了コード。
  • このリポジトリがすでに収束した作業を繰り返す前に前例を読む:記録の肯定的な 半分であり、行き止まりを含む経路、すべての主張に対する格付け、そしてケースが書き戻すべきと 言うファイルを伴う。
  • actually loaded and executing
    "not on PATH" is not "not installed"
    landed
    legal
    .so
    never
    Java_*
    -fvisibility=hidden
    prove
    actually mapped
    arranged
    .so
    pm
    ps
    --show-exempt
    svc
    --context
    TracerPid