### Install Nix and enter development shell Source: https://github.com/ankorio/twinflame/blob/main/README.md Installs Nix with flakes using the Determinate Systems installer, clones the repo, and enters a development shell with twinflame, Redex, and JADX available. ```sh # Install Nix with flakes (Determinate Systems installer is easiest): curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install git clone https://github.com/ankorio/twinflame && cd twinflame nix develop # drops you in a shell with twinflame + Redex + JADX ``` -------------------------------- ### Set up development environment Source: https://github.com/ankorio/twinflame/blob/main/README.md Clones the repository, creates a virtual environment, installs test dependencies, and runs the test suite. ```sh git clone https://github.com/ankorio/twinflame && cd twinflame python -m venv .venv && . .venv/bin/activate pip install -e '.[test]' pytest tests/ ``` -------------------------------- ### Install twinflame via pip and verify CLI Source: https://github.com/ankorio/twinflame/blob/main/README.md Installs the twinflame package from PyPI with the --pre flag because the latest release is a beta. The console entry point is installed, so you can run twinflame --help to verify. ```sh pip install --pre twinflame # --pre needed while the latest release is a beta twinflame --help # console entry point is installed ``` -------------------------------- ### Example change summary output Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Sample output from the semantic diff, showing the summary and top modified entries. The report is pre-sorted so the first things you see are the developer's own (app) changes, high-confidence first. ```text change summary: modified=384 added=282 removed=135 cosmetic=414 unchanged=19649 modified confidence: high=384 low=0 (low = call-only churn in non-app code, likely cross-toolchain noise) app-only: modified=384 added=282 removed=135 cosmetic=414 unchanged=10436 top modified (app-first, high-confidence first, then by magnitude): [app] [ 134] SourceFile +47 calls, -40 calls, +6 strings, +9 types, +17 methods [anchored] - onCreate(Landroid/os/Bundle;)V: method +18 calls, -8 calls ``` -------------------------------- ### One-shot CLI via nix run Source: https://github.com/ankorio/twinflame/blob/main/README.md Builds and runs the tool on demand. First run compiles Redex from source (~5 min), then cached. Shows two examples: diffing APKs with auto-package and threshold, and a real-world vuln/patched pair with normalization and obfuscated-package fallback. ```sh # diff two APKs, scope to a vendor package, write a JSON report nix run . -- old.apk new.apk \ --auto-package \ --threshold 0.8 \ -o report.json # real-world example: vuln/patched pair, Redex-normalized to defeat # junk-instruction obfuscation, with the obfuscated-package fallback # so Proguard-renamed packages cluster together for comparison nix run . -- vuln.apk patched.apk --normalize --find-obfuscated ``` -------------------------------- ### Running twinflame CLI commands Source: https://github.com/ankorio/twinflame/wiki/How-It-Works Command-line examples for running twinflame: basic match report, no-cluster mode for obfuscated builds, ranked semantic change report with JSON output, and deobfuscation map generation. ```bash # Class/method match report twinflame old.apk new.apk # Two obfuscated builds (renamed packages won't align) → one global pool twinflame old.apk new.apk --no-cluster # Ranked semantic change report (default); machine-readable JSON written to a file twinflame old.apk new.apk --no-cluster -o changes.json # Recover original names into a ProGuard mapping.txt (feed to jadx/retrace) twinflame old.apk new.apk --deobfuscation-map recovered.txt ``` -------------------------------- ### Install twinflame with native library-dictionary store Source: https://github.com/ankorio/twinflame/blob/main/README.md Installs the optional native extra to use the prebuilt tfls-mih manylinux wheel for faster library dictionary queries. Without it, a pure-Python brute-force store is used, which is 10-100x slower on large packs. ```sh pip install --pre "twinflame[native]" ``` -------------------------------- ### Start twinflame serve with cache directory Source: https://github.com/ankorio/twinflame/blob/main/README.md Launches the plugin bridge server, keeping loaded inputs in memory and answering requests over stdin/stdout. The optional --cache-dir reuses prepared .tfr records. ```sh twinflame serve --cache-dir ~/.cache/twinflame/tfr # optional: reuse prepared .tfr records ``` -------------------------------- ### Semantic diff with app package and output file Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Main use case: get a ranked, method-localized change report. The semantic diff is the default output; a human summary prints to stdout and the machine report is written to a file automatically. Use --app-package for your app's package root(s), repeat for multi-root, and -o to specify the output file. ```sh twinflame old.apk new.apk \ --app-package com.myapp \ # your app's package root(s); repeat for multi-root -o changes.json # machine-readable (the real deliverable; JSON default) ``` -------------------------------- ### Build and match family signatures with twinflame family build/match Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Distils N samples of one family into a persistent signature pack, then scores an unknown sample against it. Requires the twinflame-libsigs package; without it, family prints an install hint. Match radius defaults to the pack's build radius; tighten -R to sharpen the family-vs-unrelated gap. ```sh # distil N samples of one family into a pack (records, APKs, .dex, or dumped-DEX dirs) twinflame family build -o evilbot.tflp --name evilbot sample1/ sample2/ sample3/ # score an unknown sample against it (match radius defaults to the pack's build radius) twinflame family match evilbot.tflp suspect_dump/ --evidence 5 # or triage one sample against a whole directory of family packs, ranked by score twinflame family match packs/ suspect_dump/ ``` -------------------------------- ### Example JSON request/response protocol for twinflame serve Source: https://github.com/ankorio/twinflame/blob/main/README.md Shows the line-delimited JSON protocol: a load request with two inputs, progress and success responses, then a describe request and its response. Errors return {"ok": false, "error": {"code", "message"}} and do not end the session. ```json -> {"v": 1, "id": 1, "op": "load", "params": {"inputs": [{"index": 0, "path": "app.apk"}, {"index": 1, "path": "dump/classes5.dex"}]}} <- {"id": 1, "event": "progress", "data": {"loaded": 0, "classes": 7}} <- {"id": 1, "ok": true, "result": {"inputs": [...], "stamp": "5086ab01a7168eac"}} -> {"v": 1, "id": 2, "op": "describe", "params": {"input_index": 1, "descriptor": "Lcom/evil/Loader;"}} <- {"id": 2, "ok": true, "result": {"signature": "…", "instructions": 182, "libsigs": null, "duplicates": [], ...}} ``` -------------------------------- ### Worked example: diffing vuln/patched APK pair Source: https://github.com/ankorio/twinflame/blob/main/README.md Real Android wallet app, ~8k classes per side, new build is Proguard'd. Uses --normalize and --find-obfuscated. The load: and diff: lines on stderr report timings and class counts. Drop --normalize to see uncleaned bytecode; if average paired similarity drops from ~0.9 to ~0.95+ everywhere, that's the fingerprint of junk-instruction obfuscation that Redex defeats. ```sh $ nix run . -- old.apk new.apk --normalize --find-obfuscated ``` -------------------------------- ### Basic twinflame invocation with different input kinds Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Shows how to run twinflame with various input types: APKs, directories of DEX files, single DEX files, or a prepared .tfr record. Input kind is auto-detected, and the two sides can be different kinds. ```sh twinflame old.apk new.apk # two APKs twinflame dump_old/ dump_new/ # two directories of dumped classes*.dex twinflame a/classes.dex b/classes.dex # single .dex each twinflame old.tfr new.apk # prepared record vs APK (see "prepare" below) ``` -------------------------------- ### Prepare a sample into a .tfr record Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Fingerprints a sample APK into a packed .tfr record, parsing and computing signatures and abstract opcodes. Defaults to '.tfr' if -o is omitted. Records are lossless for comparison and roughly 20× smaller than the old JSON format. ```sh # fingerprint a sample into a packed .tfr record (parse + signatures + abstract opcodes) twinflame prepare sample.apk -o sample.tfr # defaults to '.tfr' if -o omitted ``` -------------------------------- ### Silence androguard debug output with LOGURU_LEVEL Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Set LOGURU_LEVEL=WARNING to cap androguard's verbose DEBUG lines while loading APK/DEX files. twinflame's own diagnostics go to stderr; redirect with 2>/dev/null for machine output only. ```sh LOGURU_LEVEL=WARNING twinflame old.apk new.apk ``` -------------------------------- ### Compare records or APKs with twinflame compare Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Compares any combination of .tfr records, APKs, or .dex files, sniffed by magic byte. The compare subcommand is a discoverability alias for the default diff. Record-vs-record runs ~2× faster end-to-end. ```sh # any combination works; record-vs-record runs ~2× faster end-to-end twinflame compare old.tfr new.tfr -o changes.json twinflame old.tfr new.apk -o changes.json # bare form is identical ``` -------------------------------- ### Top-level JSON schema example Source: https://github.com/ankorio/twinflame/wiki/Change-Report-Schema Shows the top-level structure of the JSON output from `twinflame … -f json -o OUT`. The `schema_version` field is versioned by `twinflame.changes.CHANGES_SCHEMA_VERSION`; breaking changes bump it. The `changes` array contains one object per class, pre-sorted by review-worthiness. ```json { "schema_version": 3, "summary": { "modified": 384, "added": 282, "removed": 135, "cosmetic": 414, "unchanged": 10436 }, "changes": [ /* one object per class, ranked most-review-worthy first */ ] } ``` -------------------------------- ### Migrate a record corpus in place Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Refreshes records in place without original samples when the stale layer is recomputable, and re-encodes legacy .tfr.json records into packed .tfr. Scans for *.tfr and legacy *.tfr.json. Only extraction/abstract changes require a true re-prepare. ```sh twinflame migrate corpus/ --delete-original # scans for *.tfr and legacy *.tfr.json ``` -------------------------------- ### Generate deobfuscation mapping with twinflame Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Produces a ProGuard-style mapping.txt that renames the new build's obfuscated classes using names recovered from a clear-named older/donor build. Only high-confidence matches are written; tune with --map-min-confidence. Only the class simple name is recovered; the obfuscated package stays as-is. ```sh twinflame old.apk new.apk --deobfuscation-map recovered.txt ``` -------------------------------- ### Apply mapping with jadx and retrace Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Use these commands to apply the recovered mapping to the new obfuscated build and retrace a stack trace. For jadx, invert=yes is REQUIRED because jadx's PROGUARD_FILE reader expects the opposite direction from standard ProGuard mapping.txt; without it jadx silently renames nothing. The retrace command uses the recovered mapping on a crash trace. ```sh # jadx: apply the mapping while decompiling the NEW (obfuscated) build. # invert=yes is REQUIRED — jadx's PROGUARD_FILE reader expects the opposite # direction from standard ProGuard mapping.txt / retrace; without it jadx # silently renames nothing (no error). jadx --mappings-path recovered.txt \ -Prename-mappings.format=PROGUARD_FILE \ -Prename-mappings.invert=yes \ -d out_new new.apk # R8/ProGuard retrace a stack trace: retrace recovered.txt crash.txt ``` -------------------------------- ### Run twinflame score with evidence Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Computes the instruction-weighted containment of a known family in a candidate APK. The score is asymmetric and self-anchors at 1.000 for a sample against itself, but thresholds on renamed builds are experimental and uncalibrated. Use --evidence 5 to print the closest shared class pairs. ```sh twinflame score family-seed.tfr candidate.apk --evidence 5 ``` -------------------------------- ### Decompile old build with source-name aliases Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Decompiles the old (donor) build using its SourceFile attributes as class names, aligning with the names recovered for the new build. This enables diffing the two decompiled trees by class filename, not full path, since packages stay obfuscated on both sides. ```sh jadx --use-source-name-as-class-name-alias always -d out_old old.apk ``` -------------------------------- ### Run twinflame to find shared code between two APKs Source: https://github.com/ankorio/twinflame/wiki/Using-Twinflame Use this command to compare two different apps without shared package layout. It disables clustering and relies on rename-invariant anchors to match classes across package boundaries. The output pairs.json contains ranked strongly-similar class pairs, and the 'sensitive components shared by both builds' block is printed to stdout and dumped to --components-file. ```sh twinflame sample_a.apk sample_b.apk --no-cluster --find-obfuscated \ -o pairs.json --components-file shared-components.txt ``` -------------------------------- ### Build a standalone binary Source: https://github.com/ankorio/twinflame/blob/main/README.md Builds the tool and produces ./result/bin/twinflame. Then shows how to run the binary with --help. ```sh nix build # produces ./result/bin/twinflame ./result/bin/twinflame --help ``` -------------------------------- ### Prepare benchmark samples Source: https://github.com/ankorio/twinflame/blob/main/BENCHMARKS.md Runs the preparation script to generate corpus/records/*.tfr files and results.jsonl with per-sample timings. ```bash python corpus/scripts/bench_prepare.py ``` -------------------------------- ### Inputs: APK, .dex, or dumped DEX (no APK) Source: https://github.com/ankorio/twinflame/blob/main/README.md Each side accepts an APK, a single .dex, or a directory of .dex files. Input kind is detected automatically. Partial dumps are tolerated - unparseable or corrupt .dex files are skipped with a warning. DEX-only inputs have no manifest, so --auto-package is unavailable; use --app-package instead. ```sh # directory of dumped classes*.dex on each side twinflame dump_old/ dump_new/ --no-cluster # write the machine report as CSV instead of the default JSON, only the # classes that actually differ twinflame a/ b/ --no-cluster --app-package com.target.app -s changed -f csv -o changes.csv ``` -------------------------------- ### hello Source: https://github.com/ankorio/twinflame/blob/main/README.md Initial handshake operation to verify the bridge is alive and protocol version compatibility. ```APIDOC ## hello ### Description Initial handshake operation to verify the bridge is alive and protocol version compatibility. ### Request ```json {"v": 1, "id": 1, "op": "hello"} ``` ### Response ```json {"id": 1, "ok": true, "result": {}} ``` ``` -------------------------------- ### pack.build Source: https://github.com/ankorio/twinflame/blob/main/README.md Builds a curated family pack from hand-picked classes. ```APIDOC ## pack.build ### Description Builds a curated family pack from hand-picked classes. ### Request ```json {"v": 1, "id": 5, "op": "pack.build", "params": {}} ``` ### Response ```json {"id": 5, "ok": true, "result": {}} ``` ``` -------------------------------- ### Change summary output format Source: https://github.com/ankorio/twinflame/blob/main/README.md Default stdout shows a ranked change summary (modified / added / removed / cosmetic / unchanged, app code first) and any sensitive components both builds share. The full machine report is written to a file (-f json default; csv/xml also available). Pass -m/--matches for the raw per-class match list instead. ```text [+] com.acme.foo: Login - Login.java | com.acme.foo: Login - SourceFile -> 0.8523 ~ validateToken (0.6100) # method modified - legacyHash # method removed + verifyNonce # method added [-] com.acme.foo: DeletedClass - DeletedClass.java # in lhs only [*] com.acme.foo: AddedClass - SourceFile # in rhs only ``` -------------------------------- ### pack.list Source: https://github.com/ankorio/twinflame/blob/main/README.md Lists all available packs. ```APIDOC ## pack.list ### Description Lists all available packs. ### Request ```json {"v": 1, "id": 8, "op": "pack.list"} ``` ### Response ```json {"id": 8, "ok": true, "result": {}} ``` ``` -------------------------------- ### load Source: https://github.com/ankorio/twinflame/blob/main/README.md Loads input files (APK, DEX) into memory for subsequent operations. Each input is indexed and addressed by (input_index, descriptor). ```APIDOC ## load ### Description Loads input files (APK, DEX) into memory for subsequent operations. Each input is indexed and addressed by (input_index, descriptor). ### Request ```json {"v": 1, "id": 1, "op": "load", "params": {"inputs": [{"index": 0, "path": "app.apk"}, {"index": 1, "path": "dump/classes5.dex"}]}} ``` ### Response ```json {"id": 1, "ok": true, "result": {"inputs": [...], "stamp": "5086ab01a7168eac"}} ``` ``` -------------------------------- ### Run tests with nix develop Source: https://github.com/ankorio/twinflame/blob/main/README.md Runs the test suite inside the Nix development shell. Currently 265 tests, with 2 auto-skipping if Redex is not on PATH; the dev shell provides it. ```sh nix develop --command pytest tests/ ``` -------------------------------- ### Build native SimHash accelerator with maturin Source: https://github.com/ankorio/twinflame/blob/main/README.md Builds the optional Rust accelerator for ~8x faster fingerprinting. Requires cloning the repo and compiling locally with maturin; the module is imported automatically when present. ```sh git clone https://github.com/ankorio/twinflame && cd twinflame/native pip install maturin maturin develop --release # builds and installs the `twinflame_rs` module ``` -------------------------------- ### Run diff benchmarks Source: https://github.com/ankorio/twinflame/blob/main/BENCHMARKS.md Runs the diff script to compare every version pair using the prepared records, producing diff_results.jsonl. ```bash python corpus/scripts/bench_diff.py ``` -------------------------------- ### Dev shell Source: https://github.com/ankorio/twinflame/blob/main/README.md For interactive use (REPL, hacking on the code, running tests). Enters a shell with python + redex + jadx on PATH. Runs 265 tests (~5s) and shows the CLI help. ```sh nix develop # enter shell with python + redex + jadx on PATH pytest tests/ # 265 tests, ~5s python -m twinflame.cli --help ``` -------------------------------- ### describe Source: https://github.com/ankorio/twinflame/blob/main/README.md Returns detailed information about a class identified by input index and descriptor, including signature, instruction count, library signatures, and duplicates. ```APIDOC ## describe ### Description Returns detailed information about a class identified by input index and descriptor, including signature, instruction count, library signatures, and duplicates. ### Request ```json {"v": 1, "id": 2, "op": "describe", "params": {"input_index": 1, "descriptor": "Lcom/evil/Loader;"}} ``` ### Response ```json {"id": 2, "ok": true, "result": {"signature": "…", "instructions": 182, "libsigs": null, "duplicates": []}} ``` ``` -------------------------------- ### Build and match family signature with twinflame Source: https://github.com/ankorio/twinflame/blob/main/README.md Build a reusable family signature from known samples, then score unknowns against it. The match radius defaults to the pack's build radius. You can also triage against a whole directory of family packs, ranked. ```sh # build a family signature from N samples (records, APKs, .dex, or dumps) twinflame family build -o fam.tflp --name evilbot sample1/ sample2/ sample3/ # score an unknown dump against it (match radius defaults to the pack's build radius) twinflame family match fam.tflp suspect_dump/ # or triage against a whole directory of family packs, ranked twinflame family match packs/ suspect_dump/ ``` -------------------------------- ### where Source: https://github.com/ankorio/twinflame/blob/main/README.md Locates a class or pack across loaded inputs, returning which input file contains it. ```APIDOC ## where ### Description Locates a class or pack across loaded inputs, returning which input file contains it. ### Request ```json {"v": 1, "id": 4, "op": "where", "params": {"descriptor": "Lcom/evil/Loader;"}} ``` ### Response ```json {"id": 4, "ok": true, "result": {}} ``` ``` -------------------------------- ### Run evaluation harness CLI Source: https://github.com/ankorio/twinflame/blob/main/README.md Grades twinflame's class matches against ground truth from an R8 mapping.txt. Requires building an OSS Android app twice (R8 off and on) and passing the APKs plus mapping file. Prints true/false positive & negative counts and precision/recall/F1. ```sh python -m eval.cli app-r8-off.apk app-r8-on.apk app-r8-on/mapping.txt --package com.vendor.app ``` -------------------------------- ### Python API usage Source: https://github.com/ankorio/twinflame/blob/main/README.md Shows how to load, filter, and diff APKs using the Python API. The filter uses package_filtering to scope to a vendor package. The diff call uses a threshold of 0.8 and options for synthetic skipping, min instruction size, and top match threshold. Prints paired matches with distance < 1.0. ```python from twinflame import load, filter, diff lhs_app = load("app-1.6.1.apk") rhs_app = load("app-1.6.3.apk") lhs = filter(lhs_app.classes, {"package_filtering": "com.vendor.app"}) rhs = filter(rhs_app.classes, {"package_filtering": "com.vendor.app"}) matches = diff(lhs, rhs, 0.8, { "synthetic_skipping": True, "min_inst_size_threshold": 5, "top_match_threshold": 3, }) for m in matches: if m.is_paired and m.distance < 1.0: print(f"[+] {m.lhs.info} | {m.rhs.info} -> {m.distance:.4f}") ``` -------------------------------- ### Build Fossify Contacts donor and target APKs Source: https://github.com/ankorio/twinflame/wiki/Evaluation-Corpus Clones the Fossify Contacts repository, checks out a tag, sets the SDK path, and builds the Foss release and debug variants. The debug APK serves as the donor (clear names) and the release APK as the target (obfuscated), with the mapping file as the oracle. Requires JDK 17+ and Android SDK. ```bash git clone https://github.com/FossifyOrg/Contacts.git && cd Contacts git checkout # e.g. a release tag; omit for main echo "sdk.dir=$ANDROID_HOME" > local.properties ./gradlew --no-daemon :app:assembleFossRelease :app:assembleFossDebug # donor (clear): app/build/outputs/apk/foss/debug/app-foss-debug.apk # target (obf): app/build/outputs/apk/foss/release/app-foss-release-unsigned.apk # oracle: app/build/outputs/mapping/fossRelease/mapping.txt ``` -------------------------------- ### Build profile set and grade matrix Source: https://github.com/ankorio/twinflame/wiki/Obfuscation-Profiles Builds a set of obfuscation profiles for a given app version and grades them with the cross-profile matrix. Adjust the assemble task, APK glob, and package per app (e.g., Contacts uses :app:assembleFossRelease, apk/foss/release/*.apk, org.fossify). ```bash git -C corpus/Clock checkout -f 2.31 eval/corpus/build_profiles.sh corpus/Clock :app:assembleRelease \ 'app/build/outputs/apk/release/*.apk' \ app/build/outputs/mapping/release/mapping.txt \ corpus/profiles-out/clock-2.31 lax optimize strict python -m eval.matrix corpus/profiles-out/clock-2.31 --package com.best.deskclock ``` -------------------------------- ### Load mapping into JADX with invert flag Source: https://github.com/ankorio/twinflame/blob/main/README.md Load the generated mapping.txt into JADX CLI. The -Prename-mappings.invert=yes flag is required because the file follows ProGuard convention (original -> obfuscated) but jadx's PROGUARD_FILE reader expects the opposite. Without it, jadx silently renames nothing. ```sh jadx --mappings-path app-new.map -Prename-mappings.format=PROGUARD_FILE -Prename-mappings.invert=yes \ -d out_deobf app-new.apk ``` -------------------------------- ### Generate deobfuscation map with twinflame Source: https://github.com/ankorio/twinflame/blob/main/README.md Run twinflame on an older build that kept SourceFile (apk1) and the obfuscated build (apk2) to write a ProGuard-format mapping.txt. Use --find-obfuscated and set --map-min-confidence to 0.8. The map recovers class simple names; lower-confidence matches are flagged with a # low-confidence comment. ```sh # apk1 = older build that kept SourceFile; apk2 = the one you want to read twinflame app-old.apk app-new.apk \ --find-obfuscated --deobfuscation-map app-new.map --map-min-confidence 0.8 ``` -------------------------------- ### Publish to PyPI with token fallback Source: https://github.com/ankorio/twinflame/blob/main/RELEASING.md Alternative publish step for release.yml when OIDC Trusted Publishing is unavailable. Uses the PYPI_API_TOKEN repository secret as the password. Replace the existing publish step with this block. ```yaml - name: Publish to PyPI if: steps.ver.outputs.new == 'true' uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} ``` -------------------------------- ### Data flow class diagram Source: https://github.com/ankorio/twinflame/wiki/How-It-Works Mermaid class diagram showing the data model: App contains Classes, which contain Methods; Matches link two Classes, and ClassChanges classify Matches. ```mermaid classDiagram class App { +classes } class Class { +descriptor +package +source_file +methods +fields +strings +superclass +interfaces } class Method { +name +bytecode_opcodes +calls +instantiates } class Match { +lhs +rhs +distance +method_matches } class ClassChange { +kind +magnitude +delta } App "1" --> "many" Class Class "1" --> "many" Method Match --> Class : lhs and rhs ClassChange ..> Match : classifies ``` -------------------------------- ### pack.nearest Source: https://github.com/ankorio/twinflame/blob/main/README.md Finds the closest entry of one pack for a list of classes at a wide radius, including classes the pack's own radius rejects. ```APIDOC ## pack.nearest ### Description Finds the closest entry of one pack for a list of classes at a wide radius, including classes the pack's own radius rejects. ### Request ```json {"v": 1, "id": 7, "op": "pack.nearest", "params": {}} ``` ### Response ```json {"id": 7, "ok": true, "result": {}} ``` ``` -------------------------------- ### status Source: https://github.com/ankorio/twinflame/blob/main/README.md Returns the current status of the bridge, such as loaded inputs and session state. ```APIDOC ## status ### Description Returns the current status of the bridge, such as loaded inputs and session state. ### Request ```json {"v": 1, "id": 3, "op": "status"} ``` ### Response ```json {"id": 3, "ok": true, "result": {}} ``` ``` -------------------------------- ### shutdown Source: https://github.com/ankorio/twinflame/blob/main/README.md Gracefully terminates the bridge session. ```APIDOC ## shutdown ### Description Gracefully terminates the bridge session. ### Request ```json {"v": 1, "id": 9, "op": "shutdown"} ``` ### Response ```json {"id": 9, "ok": true, "result": {}} ``` ``` -------------------------------- ### pack.match Source: https://github.com/ankorio/twinflame/blob/main/README.md Checks containment of packs in every loaded input, returning per-entry hits with tier, distance, detector evidence score, and shared distinctive strings. ```APIDOC ## pack.match ### Description Checks containment of packs in every loaded input, returning per-entry hits with tier, distance, detector evidence score, and shared distinctive strings. ### Request ```json {"v": 1, "id": 6, "op": "pack.match", "params": {}} ``` ### Response ```json {"id": 6, "ok": true, "result": {}} ``` ```