A Hybrid Information Flow Analysis Framework for Android Hybrid Apps

Read full text Summarise with VIRAT
Authors: Anonymous, Anonymous
Cited by: 0

Summary

No summary yet. VIRAT can read this paper and write a plain-language summary of its aim, methods, key findings and limitations.

Summarise with VIRAT Free to try with your Science Catalogs account.

Abstract

# ASE Artifacts This directory contains the runnable artifacts for MifDroid together with the static and dynamic analysis phases described in the paper. The main binaries are: - `bin/MifDroid-jar-with-dependencies.jar`: MifDroid analyzer for one APK, one JavaScript bridge file, and one `Intent.sqlite` database- `bin/HybridAppAnalysis-1.0-SNAPSHOT-static.jar`: static analysis phase- `bin/HybridAppAnalysis-1.0-SNAPSHOT-dynamic.jar`: guided dynamic analysis and runtime enrichment phase The bundle also includes helper scripts used to run the analyses at scale and manage the dynamic-analysis environment. Run the commands below from this directory: ```bashcd /Users/jyp/Artifacts/MifDroid/ASEArtifacts``` ## Layout - `bin/` - `MifDroid-jar-with-dependencies.jar` - `HybridAppAnalysis-1.0-SNAPSHOT-static.jar` - `HybridAppAnalysis-1.0-SNAPSHOT-dynamic.jar`- `scripts/` - `run-app-dataflow.sh` - `run_static_multiprocess.sh` - `re_enrich_dynamic.sh` - `collect_dynamic_stats.sh` - `cleanup_emulator_storage.sh` - `resize_avd_and_wipe.sh` - `cleanup_tmp_analysis.sh` - `dedupe_jscode.sh` - `summarize_static_runtime.sh`- `README.pdf`- `SHA256SUMS.txt` ## What Each Binary Does ### MifDroid `MifDroid-jar-with-dependencies.jar` instruments a JavaScript bridge file, analyzes it against an APK and an `Intent.sqlite` database, and can dump: - call graph JSON- type-check JSON- source-to-sink dataflow JSON- optional CodeQL findings- optional LLM-based findings The jar entry point is `dk.sdu.workflow.MifDroid`. ### Static Analysis The static phase scans a directory of APKs and produces: - `jsdetails` table entries in an SQLite database- `webview_prime` table entries in the same database- extracted JavaScript files in `JSCode/` The executable entry point is: ```bashjava -jar bin/HybridAppAnalysis-1.0-SNAPSHOT-static.jar``` ### Dynamic Analysis The dynamic phase: - decodes an APK with `apktool`- patches the manifest- instruments communication-relevant WebView calls in smali- rebuilds, aligns, signs, and installs the APK- drives the app through guided launches and UI interactions- collects runtime WebView events- enriches the SQLite database with runtime-backed values The executable entry point is: ```bashjava -jar bin/HybridAppAnalysis-1.0-SNAPSHOT-dynamic.jar``` This jar is not standalone. It must be given the SQLite database produced by the static phase through `--db `. ## Prerequisites ### Required For MifDroid - Java installed and available in `PATH`- an Android APK to analyze- a JavaScript bridge file to instrument- an `Intent.sqlite` database Optional: - `codeql` in `PATH` if you want CodeQL-based analysis- OpenAI API credentials if you want LLM-based analysis ### Required For Static And Dynamic Phases - macOS or Linux shell environment- Java 8 or newer - the bundled static and dynamic jars are compiled to Java class major version `52`- enough local disk space for decoded APKs and databases ### Required For Dynamic Analysis - `apktool` in `PATH`, or pass `--apktool `- Android SDK `adb` in `PATH`, or pass `--adb `- Android SDK `apksigner` in `PATH`, or pass `--apksigner `- Android SDK `zipalign` in `PATH`, or pass `--zipalign `- `keytool` in `PATH`, or pass `--keytool `- one connected Android device or emulator- the device or emulator ABI must match the native libraries inside the APK Recommended: - use an x86_64 emulator with enough data-partition space- keep at least several GB free on both the host machine and the emulator ## Verify The Bundle To verify the copied files: ```bashshasum -a 256 -c SHA256SUMS.txt``` ## Static Analysis ### Single-Process Run The static jar accepts a directory of APK files: ```bashjava -jar bin/HybridAppAnalysis-1.0-SNAPSHOT-static.jar \ --log-dir output/logs \ --console-log output/logs/console.log \ /path/to/apk_dir``` Useful options: - `--log-dir `: per-app log directory- `--console-log `: stdout and stderr capture- `--no-js-dir `: move APKs without `addJavascriptInterface` into a separate directory- `--quiet`: suppress verbose debug output The static phase also reads the following JVM properties: - `-Diifa.db.path=`: output SQLite database- `-Diifa.apktool.output.dir= `: intermediate decoded APK directory- `-Diifa.jscode.output.dir= `: JavaScript output directory- `-Diifa.apktool.jobs=`: parallelism for `apktool`- `-Diifa.quiet=true`: quiet mode Example: ```bashjava -Xmx12g \ -Diifa.db.path=Database/Intent.sqlite \ -Diifa.apktool.output.dir=output/intermediate \ -Diifa.jscode.output.dir=JSCode \ -Diifa.apktool.jobs=6 \ -jar bin/HybridAppAnalysis-1.0-SNAPSHOT-static.jar \ --log-dir output/logs \ --console-log output/logs/console.log \ --quiet \ /path/to/apk_dir``` ### Multiprocess Static Run For larger datasets, use the provided runner: ```bashscripts/run_static_multiprocess.sh \ --apps-dir /path/to/apk_dir \ --workers 4 \ --heap 12g \ --apktool-jobs 6 \ --run-root /tmp/static-multiprocess/run1 \ --final-db Database/Intent_merged.sqlite \ --overwrite-final \ --quiet``` What this script does: - shards APKs across workers using greedy size-aware balancing- runs one static-analysis worker per shard- writes one SQLite database per worker- merges worker databases into one final database- consolidates JavaScript output into one `JSCode/` directory- optionally deduplicates extracted JavaScript files Main outputs: - merged database: `Database/Intent_merged.sqlite`- worker logs: `/logs/w*/console.log`- worker databases: `/db/Intent_w*.sqlite`- worker intermediates: `/intermediate/w*`- worker JS output: `/jscode/w*` ### Merge Worker Databases Manually If needed, the merger can be invoked directly: ```bashjava -cp bin/HybridAppAnalysis-1.0-SNAPSHOT-static.jar \ mmmi.se.sdu.db.IntentDbMergerCLI \ --input-dir /path/to/db_dir \ --glob 'Intent_w*.sqlite' \ --out Database/Intent_merged.sqlite \ --overwrite``` ## Dynamic Analysis ### Single APK ```bashjava -jar bin/HybridAppAnalysis-1.0-SNAPSHOT-dynamic.jar \ --apk /path/to/app.apk \ --db Database/Intent.sqlite \ --out output/dynamic \ --zipalign /Users/USER/Library/Android/sdk/build-tools/35.0.1/zipalign \ --apksigner /Users/USER/Library/Android/sdk/build-tools/35.0.1/apksigner``` ### Batch Directory ```bashjava -jar bin/HybridAppAnalysis-1.0-SNAPSHOT-dynamic.jar \ --apk-dir /path/to/apk_dir \ --db Database/Intent.sqlite \ --out output/dynamic \ --zipalign /Users/USER/Library/Android/sdk/build-tools/35.0.1/zipalign \ --apksigner /Users/USER/Library/Android/sdk/build-tools/35.0.1/apksigner``` Useful options: - `--apk `: analyze a single APK- `--apk-dir `: analyze all APKs in a directory- `--db `: static-analysis SQLite database to enrich- `--out `: dynamic output directory- `--apktool `: custom `apktool`- `--adb `: custom `adb`- `--apksigner `: custom `apksigner`- `--zipalign `: custom `zipalign`- `--device `: explicit device or emulator serial- `--activity-delay `: delay between activity launches- `--log-seconds `: logcat capture duration- `--console-log `: stdout and stderr capture- `--stats-json `: write dynamic-resolution statistics JSON Dynamic outputs: - shared decoded APKtool directory: `output/dynamic/decoded`- per-app output directories: `output/dynamic/_/`- runtime logcat: `webview-logcat.txt`- filtered runtime events: `webview-filtered.txt`- correlation report: `webview-correlation.txt`- per-app dynamic stats: `dynamic-resolution-stats.json` The dynamic phase also creates and reuses a debug keystore by default: - `output/dynamic/debug.keystore` ## Re-enrich Existing Dynamic Logs If the database-matching logic changes and you want to re-apply enrichment from existing `webview-filtered.txt` files: ```bashscripts/re_enrich_dynamic.sh \ --db Database/Intent.sqlite \ --src output/dynamic \ --out output/DynamicStats``` This does not rerun instrumentation or device execution. It only reruns the database enrichment step. ## Helper Scripts ### Collect Per-App Dynamic Stats ```bashscripts/collect_dynamic_stats.sh --src output/dynamic --dest output/DynamicStats --apply``` ### Summarize Static Multiprocess Runtime ```bashscripts/summarize_static_runtime.sh --root /tmp/static-multiprocess/run1 --latest-only``` ### Remove Duplicate Extracted JavaScript ```bashscripts/dedupe_jscode.sh --dir JSCode --mode normalized --apply``` Modes: - `exact`: byte-for-byte duplicates- `normalized`: removes extractor metadata preamble before comparison ### Clean Old Temporary Static Runs ```bashscripts/cleanup_tmp_analysis.sh --base-dir /tmp/static-multiprocess --older-than-days 2 --apply``` ### Free Emulator Space Remove user-installed packages: ```bashscripts/cleanup_emulator_storage.sh --serial emulator-5554``` Also remove large sdcard directories: ```bashscripts/cleanup_emulator_storage.sh --serial emulator-5554 --sdcard``` ### Resize And Wipe An Android Emulator ```bashscripts/resize_avd_and_wipe.sh --avd pixel_api_34 --wipe``` Defaults: - internal data partition: `16G`- SD card: `8G` ## Expected Workflow 1. Run the static phase on an APK corpus and produce `Database/Intent.sqlite` or a merged equivalent.2. Inspect or merge static outputs if running in parallel.3. Run MifDroid on selected app inputs, or run the dynamic phase on the same APK corpus.4. If using the dynamic phase, pass the static database with `--db` so runtime results can enrich existing entries.5. Collect or re-enrich dynamic statistics if needed. ## Common Failure Modes ### MifDroid Reports Missing Required Options Provide all of: - `--db`- `--script`- `--bridge`- `--apk` ### Helper Script Cannot Find Inputs Likely causes: - no `.apk` file under the app directory- no `.js` file under the app directory- wrong jar path Fix by passing `--apk`, `--script`, or `--jar` explic

Fields of Study & Subjects

Advanced Malware Detection Techniques Security and Verification in Computing Mobile and Web Applications

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
27 March 2026
Language
EN