Skip to content

Add --coverage mode for app parsing-coverage analysis#2

Merged
abrignoni merged 2 commits into
mainfrom
coverage
Jul 8, 2026
Merged

Add --coverage mode for app parsing-coverage analysis#2
abrignoni merged 2 commits into
mainfrom
coverage

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Summary

Adds a developer-facing --coverage mode that answers "which installed apps are we not parsing?" across a batch of test images. Companion to abrignoni/iLEAPP#1680 and abrignoni/ALEAPP#938 (the App Inventory artifacts those PRs add are what this consumes).

python3 batch_leapp.py ~/test_images ~/reports --leapp ~/iLEAPP/ileapp.py --coverage

What it does

  1. Enables the App Inventory artifacts per run: iLEAPP via its existing --custom_artifacts_path option; ALEAPP (no such option) by staging the module into scripts/artifacts/ for the duration of the batch and removing it afterwards (cleanup runs in the existing finally, so interrupts don't leave it behind). RLEAPP/VLEAPP and compiled binaries log a warning and continue without inventory.
  2. Aggregates every report into batch_apps.sqlite at the output root: extractions (device/OS/tool identifiers per input zip, joined with manifest.json sha256), installed_apps, app_files (every file mapped to its owning app), artifact_files (which LEAPP modules matched which files, inventory module excluded), artifact_patterns.
  3. Coverage views: v_apps_not_parsed (per extraction), v_apps_not_parsed_rollup (ranked across extractions), v_unknown_containers (orphaned iOS app containers), v_module_app_spread (modules matching files for 10+ different apps — userDefaults, appGrouplisting, etc. — are classified generic and don't make an app count as parsed).

batch_coverage.py also works standalone to re-aggregate an existing batch output without re-running the tools:

python3 batch_coverage.py ~/reports

Testing

End-to-end with synthetic iOS and Android extractions batched into one output dir with both tools (iLEAPP/ALEAPP app-inventory branches): extractions table carries device identifiers from both platforms; v_apps_not_parsed correctly flags the Android apps including one present on disk but absent from packages.xml; the orphaned iOS container surfaces in v_unknown_containers; ALEAPP staging cleans up (git status clean after the batch); standalone re-aggregation and --dry-run (coverage disabled) verified; GUI imports unchanged (coverage defaults to False).

🤖 Generated with Claude Code

….sqlite

New batch_coverage.py plus a --coverage flag on batch_leapp.py:

- enable_coverage() turns on the developer-only App Inventory artifacts
  per tool: iLEAPP via --custom_artifacts_path, ALEAPP by staging the
  module into scripts/artifacts/ for the batch (removed afterwards,
  also on interrupt via the existing finally block)
- aggregate() merges every report's _lava_artifacts.db (inventory
  tables + the framework's artifact-match registry) and manifest.json
  into batch_apps.sqlite with coverage views: v_apps_not_parsed,
  v_apps_not_parsed_rollup, v_unknown_containers, v_module_app_spread
- modules matching files for 10+ different apps (userDefaults,
  appGrouplisting, ...) are classified generic and do not make an app
  count as parsed; the inventory module's own matches are excluded
- batch_coverage.py is also a standalone CLI to re-aggregate an
  existing batch output without re-running the tools

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
With ALEAPP PR #939 porting --custom_artifacts_path from iLEAPP, both
tools can now load the App Inventory module via the flag. Staging into
scripts/artifacts/ remains as a fallback for ALEAPP checkouts that
predate the option. Support is detected by checking the tool's source
for the option string.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@abrignoni abrignoni merged commit 6929ccd into main Jul 8, 2026
@abrignoni abrignoni deleted the coverage branch July 8, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant