Skip to content

Configuration

Sam MG Harish edited this page Oct 30, 2026 · 3 revisions

Configuration

Configuration lives in three places: a JSON settings file, the OS credential store, and the scan output directory. Nothing is read from environment variables.

Project identity (name, version, description, author, homepage) comes from pyproject.toml through _metadata.py and is not configurable at runtime. The name doubles as the config-directory name, the keyring service and the scan-folder prefix. See Project identity.

Locations

Paths come from platformdirs (config/paths.py).

What macOS Linux Windows
Config dir ~/Library/Application Support/lu77U-MobileSec ~/.config/lu77U-MobileSec %LOCALAPPDATA%\lu77U-MobileSec
Settings <config dir>/settings.json same same
User skills <config dir>/skills/ same same
Encrypted secrets fallback <config dir>/.secrets.enc and .fernet_key same same
Frida binary cache <cache dir>/lu77U-MobileSec/frida/ same same
Scan output (default) ~/Documents/lu77U-MobileSec same same

Scan output defaults to a visible, user-owned folder so artifacts are easy to find and delete.

settings.json

{
  "active_provider": "ollama",
  "providers": {
    "ollama": {"mode": "cloud", "model": "", "cheap_model": "", "cloud_host": "https://api.ollama.com",
               "local_host": "http://localhost:11434", "max_concurrent_requests": 2},
    "claude": {"model": "", "cheap_model": "", "max_concurrent_requests": 2},
    "openai": {"model": "", "cheap_model": "", "max_concurrent_requests": 2},
    "gemini": {"model": "", "cheap_model": "", "max_concurrent_requests": 2},
    "custom":  {"model": "", "cheap_model": "", "base_url": "", "max_concurrent_requests": 2},
    "claude_cli": {"model": "", "binary_path": "", "max_concurrent_requests": 1}
  },
  "jadx_path": "",
  "blutter_path": "",
  "hermes_decomp_path": "",
  "rn_decompiler_path": "",
  "xamarin_decompiler_path": "",
  "ghidra_path": "",
  "output_dir": "",
  "pdf_generation": true,
  "dynamic_verification": true,
  "agent_memory": true,
  "auto_resume": true,
  "agent_budget": {"max_steps_per_region": 40, "max_minutes": 45, "max_review_parts": 40},
  "prompt_overrides": {}
}
Key Effect
active_provider Which provider the pipeline builds: ollama, claude, openai, gemini, custom, or one of the five subscription-CLI providers below
providers.<name>.model Model id. Empty means the provider's default
providers.<name>.cheap_model Substituted for model on high-volume grading/triage calls (build_provider(..., cheap=True)), for the five API-key providers only. Empty transparently falls back to model — nothing is skipped or degraded, the call just runs on the main model. Not surfaced by GET /api/settings or PUT /api/settings today: set it by editing settings.json directly
providers.<name>.max_concurrent_requests In-flight calls allowed against that provider, across every thread. Default 2, range 1–20. There is no "0 = unbounded" here: unbounded concurrency against one account is what the setting prevents. CLI providers default to 1 (one subscription login, one process at a time)
providers.ollama.mode cloud or local, selecting which host field applies
providers.custom.base_url OpenAI-compatible endpoint. Validated against private and loopback ranges when saved
providers.<claude|copilot|kimi|codex|antigravity>_cli.binary_path Override for resolving the CLI's binary, when it isn't on the PATH a subprocess inherits (e.g. Kimi's default install at ~/.kimi-code/bin/kimi). Empty resolves from PATH
jadx_path Absolute path to the JADX executable. Checked for existence; required for ready_for_analysis
blutter_path Absolute path to blutter.py, for Flutter scans. Optional
hermes_decomp_path Absolute path to hermes-decomp, for Hermes-compiled React Native bundles. Optional
rn_decompiler_path Absolute path to react-native-decompiler, for plain-JS bundles. Optional
xamarin_decompiler_path Absolute path to ilspycmd. Optional in a stronger sense: without it a Xamarin scan still runs, on the assembly strings
ghidra_path Ghidra's install directory, ghidraRun, or support/analyzeHeadless, for decompiling native .so libraries to C in any framework's scan. Optional; without it inspect_native shows symbols and signals only
output_dir Base directory for scan folders. Empty means the default
pdf_generation Whether PDF export is offered. When off, reports.pdf is false on new scans and /report/pdf returns 400
dynamic_verification Whether phase 2 runs when a device is available
agent_memory Whether phase 2 receives phase 1's transcript as extra context
auto_resume After a restart, re-queue scans that were mid-run when the previous process died and left a checkpoint. Off = left paused for the user
agent_budget.max_steps_per_region Ceiling on turns per code region. Default 40, range 0–500, 0 = unbounded
agent_budget.max_minutes Wall clock across the whole fan-out (regions run in parallel, so they share the clock). Default 45, range 0–480, 0 = unbounded
agent_budget.max_review_parts Requests the file review may make after the agents, each covering one or more flagged files (file review). Default 40, range 0–400, 0 = unbounded. Not shown in the Settings page; set it in settings.json or through PUT /api/settings
prompt_overrides Per-prompt replacement text, keyed by prompt id

The five _cli providers (claude_cli, copilot_cli, kimi_cli, codex_cli, antigravity_cli) shell out to an already-installed, already-signed-in subscription CLI instead of a metered API key; see AI providers. The Settings page presents Claude, OpenAI and Google as one vendor each with an API-key/CLI toggle, since e.g. codex_cli and claude are the same vendor reached two ways; see Web UI. The example above shows claude_cli; the other four have the same three fields.

Loaded once and cached. On load, defaults are deep-merged under whatever is on disk, so keys added in a newer version appear automatically with no migration step. On first run, the legacy constants in config/settings.py seed jadx_path, the Ollama model and the Ollama cloud host; secrets are never seeded from there.

Edit through the UI or PUT /api/settings. Hand-editing works, but the running server keeps its cache until restart.

Why the budget exists

The agent loop was unbounded by default, so the only thing ending a large scan was the provider's own account limit: a spent cloud quota and no report from any region. Both fields accept 0 to restore that behaviour.

Range bounds are enforced wherever a user can set them (AGENT_BUDGET_LIMITS, MAX_CONCURRENT_REQUESTS_RANGE) and exposed in the settings snapshot as agent_budget_limits and max_concurrent_requests_range so the UI can render the right inputs.

Framework decompiler tools

JADX is required. ready_for_analysis is jadx_configured AND ollama_configured (the name is historical; it covers whichever AI provider is active), and POST /api/scans refuses until both are true.

blutter_path, hermes_decomp_path, rn_decompiler_path, xamarin_decompiler_path and ghidra_path factor into none of that and block no scan. A machine that only scans Java/Kotlin apps never needs the framework tools.

xamarin_decompiler_path and ghidra_path change a scan's quality rather than its existence. Blutter and hermes-decomp are the only route to their apps' code, so a release Flutter scan without Blutter, or a Hermes React Native scan without hermes-decomp, is detection-only. Xamarin assemblies are recovered in pure Python either way and ilspycmd adds decompiled C# on top; Ghidra adds decompiled C to native libraries the agent and the file review would otherwise see only as symbols.

xamarin_decompiler_path differs from the other tool paths in two ways. It is the only one resolved from PATH when unset, since ilspycmd installs as a dotnet global tool. And it has no PUT /api/settings field and no Settings-page control: it has get/set accessors in user_settings.py and is read by the decompiler itself, but is set by editing settings.json directly.

GET /api/status reports each as blutter_configured / hermes_decomp_configured / rn_decompiler_configured / ghidra_configured so the Settings page can show detection state, and the two optional pip extras as semgrep_available / mitmproxy_available. Advisory, not a checklist.

Enforcement is per scan, in BaseAnalyzer.preflight(), and reads the APK so it asks for the tool this app actually needs:

  • Flutter. A debug build (it ships kernel_blob.bin) is ready with no tool: its original Dart source is recovered from the kernel. A release build needs blutter_configured.
  • React Native. A plain-JavaScript bundle is ready with no tool: the built-in Metro splitter recovers it. A Hermes bundle needs hermes_decomp_configured. Only when the bundle cannot be read from the APK does the old rule apply, accepting either RN tool.

A missing tool degrades that scan to a detection-only report naming the missing setting in analysis.error.

ghidra_path may name the install directory, ghidraRun (a package manager's bin entry is usually a link to it), or analyzeHeadless itself; the checker follows symlinks and finds support/analyzeHeadless, and reports ready only when that launcher exists and is executable. Ghidra needs a JDK.

Install notes: Blutter (https://github.com/worawit/blutter) compiles a Dart-version-specific executable on its first run against an unseen Dart version and only supports arm64-v8a. hermes-decomp (https://github.com/SymbioticSec/hermes-decomp) supports Hermes bytecode versions 40–99; the analyzer uses its extract command (one file per module) and falls back to decompile on builds without it. react-native-decompiler is only a fallback for plain bundles the built-in splitter does not recognise (Webpack, Haul); it cannot read Hermes bytecode or Webpack v5 bundles. Ghidra: https://ghidra-sre.org, or brew install ghidra.

Credentials

API keys never go in settings.json. This section doesn't apply to the five _cli providers: they take a one-time interactive subscription sign-in run outside this tool, not a stored key; see binary_path above and AI providers.

The key pool

Each provider holds a list of keys, tried in order. When one is exhausted mid-scan the provider rotates to the next rather than failing the scan. config/credentials.py:

Function Behaviour
get_api_keys(provider) The pool, as plain keys. Installs predating the pool hold a bare string; that is read as a one-key pool
get_api_key_entries(provider) The pool with each key's label, as {"key", "label"} entries
set_api_keys(provider, keys) Replace the whole pool, from bare keys or {"key", "label"} entries; an empty list clears the store
add_api_key(provider, value, label="") Append one, optionally labelled. Blanks and exact duplicates ignored; re-adding a stored key with a label labels it
set_api_key_label(provider, index, label) Set, change or clear one key's label by index
remove_api_key(provider, index) Delete one by index; the others keep their labels
set_api_key / get_api_key Single-key views: replace the pool with one key / return the first
has_api_key(provider) Whether the pool is non-empty
mask_key(value) Preview shown in the settings snapshot

A key can carry an optional label saying what it is for, such as the account it belongs to (abc@gmail.com), so a pool of several keys can be told apart. It is free text, at most 80 characters, with whitespace collapsed to single spaces; control characters and invisible formatting characters such as bidirectional overrides are refused (clean_label), so a label always reads as what it holds. The label is stored in the same keychain entry as its key: a labelled key is {"key": ..., "label": ...} in the stored list and an unlabelled one stays a bare string, so a pool with no labels is stored exactly as before. Only the settings page shows labels. Providers read plain keys, and no scan log, report or transcript carries a label, since a label is often an email address and a scan folder can end up shared, as the published demo scans are.

Storage

Keys are stored in the OS keychain under service lu77U-MobileSec, username <provider>_api_key, via keyring: Keychain on macOS, Credential Manager on Windows, Secret Service on Linux.

Where no backend exists (typically a headless Linux host) the tool falls back to a Fernet-encrypted file:

  • <config dir>/.secrets.enc, mode 0600
  • <config dir>/.fernet_key, mode 0600, generated on first use

A one-time warning says this is not hardware-backed and the directory needs protecting. The key sits next to the ciphertext, so it protects against casual reads, not against an attacker with filesystem access.

Reads try the keychain first and fall back to the file. Deletes clear both.

GET /api/settings returns only masked previews, their labels and a count. A full key is fetched one at a time through POST /api/settings/credentials/{provider}/reveal. POST, not GET, so the key is never in a URL.

Prompt overrides

Seven prompts are editable at GET/PUT/DELETE /api/settings/prompts:

Id Drives
static_agent_system Phase 1 agent loop, Java/Kotlin
flutter_agent_system Phase 1 agent loop, Flutter (Blutter disassembly or recovered Dart source, plus the platform layer)
react_native_agent_system Phase 1 agent loop, React Native (Metro module tree, plus the platform layer and native modules)
cordova_agent_system Phase 1 agent loop, Cordova (extracted assets/www)
xamarin_agent_system Phase 1 agent loop, Xamarin/.NET (recovered assemblies + optional C#)
java_kotlin_legacy The full-dump fallback for providers that cannot drive the loop. Java/Kotlin only
dynamic_verification_system The phase 2 loop

Constraints the code depends on, returned as each prompt's help text by GET /api/settings/prompts (there is no prompt editor on the Settings page):

  • Every agent-system prompt must keep the action names its loop expects (list_files, read_file, search_code, inspect_native, find_method, callers, callees, call_path, entry_points, add_finding, report) and the cvss_vector field.
  • java_kotlin_legacy must keep its trailing ANDROID SOURCE CODE TO ANALYZE: line, because the analyzer appends source directly after it.
  • dynamic_verification_system uses {package} as a literal placeholder. Substitution is a plain string replace, not str.format, so braces elsewhere in a pasted JSON example cannot break it.

An override replaces the default in full; delete it to revert. Each framework's prompt resolves fresh at the start of every scan (VulnerabilityPrompts.get_agent_system(profile_key)), so a saved override applies on the next scan with no restart.

Skills

Skills are markdown files injected into agent system prompts, loaded from two directories:

Directory Contents
<config dir>/skills/ Skills uploaded by the user. Searched first
lu77U_MobileSec/skills/ Skills bundled with the package

A user file shadows a bundled file of the same name rather than overwriting it, so uploading manifest_review.md replaces the shipped guidance while it exists and deleting it restores the original. Uploads live outside the package, so a reinstall leaves them alone.

Thirty skills ship:

File Loaded
java_kotlin_security.md Core skill, every Java/Kotlin phase 1 scan
flutter_dart_security.md Core skill, Flutter; also on dart/ffi/.asm keywords
react_native_security.md Core skill, React Native; also on hermes/bundle/asyncstorage keywords
flutter_reverse_engineering.md Profile skill, every Flutter region (PROFILE_SKILLS); also on blutter/libapp/kernel_blob/pp.txt keywords. Reading Blutter output and kernel source, joining Dart to Java through platform channels, Frida for Dart
react_native_reverse_engineering.md Profile skill, every React Native region; also on hermes/app_modules/nativemodules/reactmethod keywords. Reading plain and Hermes modules, native modules, WebView bridges, Frida for the JS runtime, patching
cordova_hybrid_security.md Core skill, Cordova; also on cordova/config.xml/innerhtml keywords
xamarin_dotnet_security.md Core skill, Xamarin/.NET MAUI
vulnerability_classes.md Always loaded (_ALWAYS_LOADED); defines the catalogue codes
finding_quality.md Always loaded; the bar a finding has to clear
chain_building.md Region guidance, and on exported-component / deep-link / bridge keywords
manifest_review.md On a manifest path or keyword
android_analysis.md With manifest_review. Covers the SDK-level rules
network_security.md On TLS, HTTP, certificate, hostname, socket, pinning keywords
offensive_android.md On inspect_native, .so, jni, native; also always loaded in phase 2
sdk_analysis.md On buildconfig, sdk, gradle, firebase, flipper, stetho keywords
reading_obfuscated_code.md On reflective/dynamic-loading calls, or a path of one/two-letter segments
native_library_analysis.md With offensive_android on inspect_native, .so, jni, native; also region guidance for the native/crypto surface
packed_app_triage.md On packer markers: jiagu, stubapp, dexhelper, secneo, nesec, stubshell, libshell, apkwrapper, packer, loadlibrary, attachbasecontext
frida_hook_recipes.md On cipher, secretkeyspec, messagedigest, mac, frida, hook, sharedpreferences, okhttp keywords
objection_runtime_toolkit.md On objection, sslpinning, keystore, sqlite, root-detection keywords
evidence_discipline.md On inspect_native, or intent-launch / reachability / SBOM-and-advisory keywords
authorized_dynamic_testing.md On inspect_native, or frida/mitmproxy/logcat/scope keywords
false_positive_patterns.md On exported, md5/sha1, getinstance, allowbackup, placeholder-credential keywords
taint_source_to_sink.md On intent-extra / URI / rawquery/execsql/loadurl / processbuilder keywords
oauth_oidc_mobile.md On OAuth/OIDC keywords (redirect_uri, code_challenge, grant_type, appauth, id_token). Grant types, PKCE, redirect URIs, embedded login pages, state/nonce, the callback handler, client secrets
deeplink_clipboard_trust.md Profile skill for Flutter and React Native; region guidance for the deep-link surface; on clipboard and deep-link keywords. Links that act on arrival, host-check bypasses, secrets on the clipboard
deeplink_endpoint_analysis.md Region guidance for the deep-link surface; on deep-link, intent://, router, shouldOverrideUrlLoading, evaluateJavascript and onNewIntent keywords. Enumerating every link endpoint (one per behaviour, not per string), following public routers to internal screens, four lenses per endpoint - WebView injection and bridges that hand out the session, Intent redirection, intent:// parsing, parameter and logic forgery - reading smali when JADX drops a handler, and the full link-to-token path a finding has to show
business_logic_abuse.md Profile skill for Flutter and React Native; on entitlement, purchase and promo keywords. Client-side gates, purchase verification, race conditions, recovery flows
storage_crypto_review.md Region guidance for the storage surface; on crypto and storage keywords. Where data lands, key provenance, modes, IVs, randomness, fail-open handling
android_ipc_ui_attacks.md Region guidance for the component surface; on IPC and UI keywords. Intent redirection, intent://, PendingIntent, providers, fragment injection, Zip Slip, tapjacking, task hijacking

Which skill is the always-loaded core one is keyed by framework (skills_loader.CORE_SKILLS), so a Flutter scan never gets Java-specific guidance. Region skills come from surfaces.guidance_for_families and are decided before the first call, which is what keeps the system prompt stable enough for provider-side caching. Full routing: Static analysis.

Upload with POST /api/settings/skills. The filename stem becomes the skill id. GET /api/settings/skills reports each skill's source as user or builtin.

Scan storage layout

<output base>/
└── lu77U-MobileSec-<apk-stem>-<YYYYmmdd_HHMMSS>[-<scan id>]/
    ├── meta.json                              status, timings, summary
    ├── result.json                            the result DTO
    ├── scan.log                               the log feed, <timestamp>TAB<message> (verbose runs only)
    ├── checkpoint/                            only while a scan is running or paused
    │   ├── progress.json                      stage marker + resume facts
    │   └── agent-<region>.json                one per fan-out region
    ├── <apk-stem>_analysis-<timestamp>.json   engine export
    ├── <apk-stem>.apk                         verbose runs only
    ├── <apk-stem>_jadx_output_<timestamp>/    verbose Java/Kotlin runs only
    ├── <apk-stem>_flutter_libs_<timestamp>/   verbose Flutter runs only (extracted lib/<abi>)
    ├── <apk-stem>_flutter_output_<timestamp>/ verbose Flutter runs only (Blutter output, dart_source/
    │                                          or snapshot_strings/; platform/, flutter_scan_overview.txt)
    ├── <apk-stem>_rn_bundle_<timestamp>/      verbose React Native runs only (extracted bundle)
    ├── <apk-stem>_rn_output_<timestamp>/      verbose React Native runs only (app_modules/,
    │                                          framework_modules/, platform/, rn_scan_overview.txt)
    ├── <apk-stem>_llm_calls.jsonl             verbose runs only: one line per model call
    │                                          (region, model, tokens, timing, done reason)
    └── <apk-stem>_<provider>_Request_Response_<timestamp>_<thread>.md
                                               verbose runs only: one file per request, with
                                               the system message, prompt, response and thinking;
                                               <thread> names the region, file-review_<n>,
                                               validation, chains or the verifier

Scan ids are 12 hex characters, validated against ^[0-9a-f]{12}$ before any folder operation. A scan id resolves to its folder through the dir in meta.json, an in-process cache, or a glob over lu77U-MobileSec-*/meta.json, in that order. A timestamp collision appends the scan id.

After a normal run the decompiled/extracted tree, the copied APK and provider logs are deleted and the JSON files stay. checkpoint/ is removed when a scan completes, fails or is cancelled; it exists only while there is something to resume. -V keeps everything else, including scan.log.

Clone this wiki locally