Skip to content

Android 7 compatibility - #1045

Open
guobao2333 wants to merge 30 commits into
LSPosed:mainfrom
guobao2333:main
Open

guobao2333 wants to merge 30 commits into
LSPosed:mainfrom
guobao2333:main

Conversation

@guobao2333

Copy link
Copy Markdown

Summary

Lower the application's minimum supported Android version from API 31 to API 24 (Android 7.0), while preserving the existing behavior on newer Android versions.

The change targets the existing arm64-v8a ABI only.

Changes

  • Lower minSdk from 31 to 24.
  • Lower the Android API target used by the native C++ build and Rust Android extractor to API 24.
  • Replace direct usage of the API 30 WindowInsetsController with AndroidX compatibility APIs.
  • Move the adaptive launcher icon into mipmap-anydpi-v26/ and provide a legacy layer-list fallback for Android 7.
  • Preserve the existing MediaStore implementation on API 29 and newer.
  • Add an API 24–28 storage fallback:
    • Store debug logs and sidecar files in app-specific external storage.
    • Export profile files through AndroidX FileProvider, with internal storage as a fallback when external storage is unavailable.
  • Add legacy SoC property detection for older Android versions. Standard ro.soc.* properties remain preferred, with MediaTek property fallbacks used when they are unavailable.
  • Add unit and Robolectric tests for SoC identification and legacy storage behavior.

Compatibility scope

  • The application minimum SDK is now API 24.
  • The existing arm64-v8a ABI restriction is unchanged. 32-bit ARM devices are not covered by this change.
  • No changes are made to the native exploit implementation, built-in kernel profiles, or Shizuku service protocol.
  • compileSdk, targetSdk, application versioning, and signing configuration remain unchanged.

32-bit ARM support would require a separate end-to-end compatibility effort covering the native build pipeline and architecture-dependent code. It is intentionally outside the scope of this change.

Verification

  • Basic installation, launch, and UI usage have been checked on an Android 7 virtual rom.
  • Actual kernel exploitation and privilege-escalation operations have not yet been verified on Android 7.
  • GitHub Actions:
    • APK build: passed.
    • Linux extractor tests and build: passed.
    • Windows extractor build: passed.
    • macOS extractor job: cancelled before any build step started, so its build result remains unverified.
  • New Kotlin unit and Robolectric tests have been added. The current workflow run did not execute :app:testDebugUnitTest.

This change focuses on Android platform compatibility and does not claim expanded kernel or device support.

By ChatGPT and me.
Please revise any dissatisfaction!

* docs(android): plan Android 7 compatibility

* docs(android7): align compatibility plan with CI target

* feat(android7): add API 24 application compatibility

* docs(android7): record implementation and pending verification

* fix(android7): provide legacy launcher icon resources

* ci(android7): build compatibility branch on push

* fix(android): resolve legacy MediaTek SoC properties
@guobao2333

Copy link
Copy Markdown
Author

Since the vulnerability can cover systems below Android12, I think these compatibility changes are necessary, and I am testing devices below Android12 (kernel 4.14.186+). Not all supported kernel systems can reach Android12, so this is the basic work for adaptation.

@NickJi2019
NickJi2019 requested a balanced review from Copilot December 2, 2026 13:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

4 open issues
What changed in this PR

This PR lowers the app’s minimum supported Android version to API 24 (Android 7.0) while keeping behavior consistent on newer Android versions, adding compatibility shims for system UI, storage/export flows, and legacy SoC detection.

Changes:

  • Lowered Android API level used across Gradle, native builds, and CI to target API 24.
  • Introduced legacy-compatible storage/export paths (app-specific external storage + FileProvider) and SoC name resolution for older property layouts.
  • Updated resources/UI compatibility (AndroidX insets controller, launcher icon fallback) and added unit/Robolectric tests.
File Description
src/​Makefile Lowers native build API default to 24.
build.gradle.kts Switches NDK clang tool selection to API 24.
app/​build.gradle.kts Lowers app minSdk to 24.
.github/​workflows/​build.yml Updates Rust/NDK linker tool to API 24.
app/​src/​main/​kotlin/​org/​lsposed/​lsprivilege/​ui/​MainActivity.kt Replaces framework insets controller usage with AndroidX compat.
app/​src/​main/​kotlin/​org/​lsposed/​lsprivilege/​data/​DebugAttackLog.kt Adds pre-API29 storage fallback and controls native dump availability.
app/​src/​main/​kotlin/​org/​lsposed/​lsprivilege/​data/​AndroidLSPrivilegeRepository.kt Adds API24–28 export via FileProvider and plugs in SoC resolver.
app/​src/​main/​kotlin/​org/​lsposed/​lsprivilege/​data/​MediaStoreCompat.kt Encapsulates API29+ MediaStore Downloads insertion.
app/​src/​main/​kotlin/​org/​lsposed/​lsprivilege/​data/​SocNameResolver.kt Adds legacy SoC property detection/normalization.
app/​src/​main/​AndroidManifest.xml Adds FileProvider for profile exports.
app/​src/​main/​res/​xml/​file_paths.xml Defines external/internal export roots for FileProvider.
app/​src/​main/​res/​values/​themes.xml Removes navigation bar light attribute to avoid direct API coupling.
app/​src/​main/​res/​mipmap-anydpi/​ic_launcher.xml Adds pre-v26 launcher icon fallback (layer-list).
app/​src/​main/​res/​mipmap-anydpi-v26/​ic_launcher.xml Adds adaptive icon for v26+.
app/​src/​test/​kotlin/​.../​SocNameResolverTest.kt Adds unit tests for SoC name resolution.
app/​src/​test/​kotlin/​.../​Android7StorageCompatTest.kt Adds Robolectric tests for legacy storage/export behavior.

Review effort: Lite

import java.io.File

@RunWith(RobolectricTestRunner::class)
@Config(sdk = [24])
@guobao2333
guobao2333 marked this pull request as draft December 2, 2026 19:40
@guobao2333
guobao2333 marked this pull request as ready for review December 2, 2026 22:03
@guobao2333

Copy link
Copy Markdown
Author

The known issues have been fixed and the status bar has been compatible with it.
Checked on real and virtual devices, both work fine.

@NickJi2019 NickJi2019 self-assigned this Dec 3, 2026
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.

3 participants