Android packaging & device checks

Android split APKs (.apks) security testing guide

Modern Android releases rarely ship as a single universal APK. Knowing how Android App Bundles (.aab), signed split archives (.apks), and multi-APK installs behave prevents blind spots in static review and broken real-device runs.

Why modern Android apps ship as AAB and Split APKs

Google Play Dynamic Delivery replaced monolithic universal APKs with the Android App Bundle (.aab). Instead of delivering every CPU architecture, screen density, and locale to every phone, Play splits a release into base.apk plus targeted configuration splits such as split_config.arm64_v8a.apk, density splits like split_config.xxhdpi.apk, language splits, and optional dynamic feature modules.

Scanning only base.apk introduces two serious blind spots in security testing:

  • Missing native libraries and ABI binaries: Compiled C/C++ and Rust .so libraries live inside ABI splits such as split_config.arm64_v8a.apk rather than base.apk. Reviewing only base.apk skips JNI crypto wrappers, native SDK binaries, embedded secrets inside native sections, and binary hardening flags under MASVS-CODE.
  • Broken real-device installs and startup crashes: When AndroidManifest.xml declares required splits (android:isSplitRequired="true"), installing base.apk alone fails with INSTALL_FAILED_MISSING_SPLIT or crashes immediately with UnsatisfiedLinkError when the runtime loads a missing native library.

AAB vs .apks split archive: what each format allows

Security teams often receive either a raw .aab from Gradle or a signed .apks archive built from it. Although both represent the same release, they support different stages of testing:

Comparison of Android build artifacts for static and real-device security testing
Artifact Primary role Static analysis Real-device installation
Universal .apk Direct sideload or legacy single-file build Full manifest, DEX, resources, and bundled .so libraries Installs directly via adb install
App Bundle (.aab) Google Play publishing upload format Publishing format; export a signed .apks split set via bundletool before AppBreach static upload Cannot install directly on a phone; must be exported into signed splits first
Split archive (.apks) Device-installable split set from bundletool or authorized acquisition Complete static review across base.apk and every ABI/config split Installs on physical hardware via adb install-multiple

In short, AppBreach does not currently ingest raw .aab uploads live: export a signed .apks split set from your .aab using bundletool so both AppBreach static release diffs and optional real-device verification inspect the exact installable splits.

Generating and verifying a complete .apks bundle from CI

Build your signed split archive directly in CI from the release .aab using Google's bundletool. Sign with your approved test or release signing key so Android's package manager accepts every split in a single atomic session, then record SHA-256 digests across the archive and every constituent split APK:

bundletool build-apks \
  --bundle=app/build/outputs/bundle/release/app-release.aab \
  --output=build/app-release.apks \
  --ks=signing-key.jks \
  --ks-pass=env:KS_PASS \
  --ks-key-alias="$KEY_ALIAS" \
  --key-pass=env:KEY_PASS

unzip -q build/app-release.apks 'splits/*.apk' -d /tmp/apks-verify
shasum -a 256 build/app-release.apks /tmp/apks-verify/splits/*.apk

Keep two packaging rules in mind before running a device check. First, every split inside the archive must be signed with the same certificate and share the same versionCode; mismatched signatures cause adb install-multiple to abort the install session. Second, pinning the SHA-256 digests of both the .apks container and every extracted split APK binds the static OWASP MASVS report cryptographically to the exact build installed on physical hardware.

What a real Android device split-APK run observes

When an authorized signed .apks archive runs on a booked physical Android device, the device stage verifies concrete runtime evidence that static analysis cannot prove on its own:

  • Multi-split installation: Confirms that Android installs all signed splits cleanly via multi-APK session installation without missing-split or ABI mismatch failures.
  • Activity launch and focus: Launches the main activity on physical hardware and verifies that the expected screen reaches foreground focus cleanly (such as NotebookActivity in our Field Notes reference build).
  • Passive window security flags: Checks window attributes on the focused screen to record whether FLAG_SECURE blocks screenshots and task-switcher previews or leaves screen capture allowed.
  • Masked log-canary checks: Inspects passive runtime log output for sensitive-data exposure patterns while masking matched values so tokens or user secrets are not copied verbatim into report text. See the Android logs security guide for remediation patterns.

Check the coverage notes to see which screens and network activity were observed.

Inspecting real evidence and CI automation

To see how split-APK evidence appears in a finished report, download the 3-page Android real-device reference PDF (field-notes-android.pdf) on our sample reports page. It records both installed signed splits, foreground activity focus, passive window-flag observations, and side-by-side static candidates with validator status clearly separated.

See scan profiles for supported builds and release integration for reporting options.

Related reading