Repository navigation
Android 7 compatibility - #1045
guobao2333 wants to merge 30 commits into
Conversation
* 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
|
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. |
There was a problem hiding this comment.
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
For API 29+, sidecars are being created viaMediaStoreinsertion, which should already place them… · NewMediaStore.MediaColumns.RELATIVE_PATHis expected to be a directory path and (per Android docs)… · New This test validates the legacy (API 24) path, but the new compatibility logic explicitly targets a… · NewformatMediaTekPlatform()uppercases the input before matching, so the inline(?i)… · New
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]) |
|
The known issues have been fixed and the status bar has been compatible with it. |


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-v8aABI only.Changes
minSdkfrom 31 to 24.WindowInsetsControllerwith AndroidX compatibility APIs.mipmap-anydpi-v26/and provide a legacy layer-list fallback for Android 7.FileProvider, with internal storage as a fallback when external storage is unavailable.ro.soc.*properties remain preferred, with MediaTek property fallbacks used when they are unavailable.Compatibility scope
arm64-v8aABI restriction is unchanged. 32-bit ARM devices are not covered by this change.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
: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!