Skip to content

feat(lsposed): experimentally lower minSdk to 28 for Android 9#48

Open
okhsunrog wants to merge 1 commit intomainfrom
feat/lsposed-android-9-support
Open

feat(lsposed): experimentally lower minSdk to 28 for Android 9#48
okhsunrog wants to merge 1 commit intomainfrom
feat/lsposed-android-9-support

Conversation

@okhsunrog
Copy link
Copy Markdown
Owner

Users on older devices have been asking for Android 9 support. The lsposed APK code had no fundamental dependency on API 29+, so this lowers minSdk to 28 and fixes the handful of call sites Android Lint flagged. Marked experimental — only Android 10+ builds have been verified locally, Android 9 behaviour depends on private system_server field layouts that may differ and needs confirmation from users on real devices. The kmod component still requires GKI 5.10+ (Android 12+); this PR only affects the lsposed path.

  • minSdk = 29minSdk = 28 in lsposed/app/build.gradle.kts
  • HookEntry.kt, HookLog.kt, PackageVisibilityHooks.kt: switch from FileObserver(File, Int) (API 29+) to FileObserver(String, Int). Without this, hook installation throws NoSuchMethodError on Android 9.
  • DashboardData.kt, DiagnosticsScreen.kt: gate NetworkCapabilities.getTransportInfo() (API 29+) behind Build.VERSION.SDK_INT >= Q. The VpnTransportInfo leak path does not exist pre-Android 10, so the self-check reports PASS / skipped there.
  • Changelog entry under unreleased (changed, bilingual).

Testing

  • ./gradlew :app:lint — 0 errors (was 4 after the initial minSdk drop).
  • ktlint "**/*.kt" — clean.
  • ./gradlew :app:assembleDebug — builds.
  • Runtime verification on Android 9: not done, relies on community testers. Android 10+ paths unchanged behaviourally.

@okhsunrog okhsunrog force-pushed the feat/lsposed-android-9-support branch from aa486f6 to 0228df0 Compare April 20, 2026 00:10
Users on older devices asked for Android 9 support. The APK code had no
hard dependency on API 29+ beyond a handful of specific call sites; the
kmod (GKI 5.10+) still requires Android 12+, but the lsposed path can
cover Android 9 if the hooks hold. This ships a build users can test.

- minSdk 29 -> 28
- Switch FileObserver(File, Int) to FileObserver(String, Int) in three
  places (HookEntry, HookLog, PackageVisibilityHooks). The File-based
  ctor is API 29+ and would NoSuchMethodError on Android 9 during hook
  install.
- Guard NetworkCapabilities.getTransportInfo() (API 29+) in the two
  self-test call sites in DashboardData and DiagnosticsScreen; on API
  28 the leak path does not exist, so report PASS/skipped.
@okhsunrog okhsunrog force-pushed the feat/lsposed-android-9-support branch from 0228df0 to a85cf1f Compare April 20, 2026 01:01
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