Swap: detect incompatible received apps before install

Fixes #3329 (closed)

Swap currently treats received apps as compatible when presenting the post-transfer install action. This can expose Install for an APK whose ABI, SDK level, or required features are incompatible with the receiving device, leading to a later install failure.

Use the existing CompatibilityChecker with the received package manifest before publishing the Swap success UI state, propagate the result through the Swap model, and show the existing Incompatible state instead of Install or Upgrade when compatibility checks fail.

Compatible apps keep the existing install flow.

Validation:

  • ./gradlew :app:compileFullDefaultDebugKotlin
  • ./gradlew :libs:index:testAndroidHostTest --tests org.fdroid.CompatibilityCheckerTest
  • ./gradlew :app:testFullDefaultDebugUnitTest — 179 tests passed
  • ./gradlew :app:ktfmtCheck
  • independent adversarial cross-review: APPROVE_AS_IS

Merge request reports

Loading
Loading