Repository navigation
Conversation
The GKI KMI version embedded in uname -r (e.g. "android11" in Samsung's 5.4 kernels) reflects the kernel interface version, not the running OS. Devices that received major OS updates without a new kernel — common on Samsung and MediaTek — would report the wrong Android version, causing the wrong KO to be selected or a spurious "unsupported" error even on a supported OS version. Read ro.build.version.release via getprop first; fall back to parsing the kernel string only when getprop returns nothing useful. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
was it not working as-is? |
Author
It was detecting the kernel version properly but the android version didnt work, this is after failing to root btw, so a fail error shows kernel 5.4 android 11 failed, but at the start of the log it showed properly, this is due to it picking up the android version from GKI KMI tag embedded in uname -r, my phone started on android 11 and got updates till 15 but that tag didnt change, kernel stayed same. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
read_device_versions()reads the Android version from the GKI KMI tag embedded inuname -r(e.g.5.4.218-android11-9-...). On devices that received major Android OS upgrades without a new kernel — common on Samsung and MediaTek — this tag reflects the kernel interface version frozen at build time, not the running OS version.Example: Galaxy S21 Ultra Snapdragon, kernel 5.4, running Android 15.
uname -rcontainsandroid11, so the app reports "Unsupported kernel 5.4 android 11" instead of the accurate "android 15".The existing getprop fallback only fires when
"android"is absent from the kernel string, so it never helped these devices.Fix
Read
ro.build.version.releasevia getprop first, which always returns the actual running OS version. Fall back to parsing the kernel string only if getprop returns nothing useful.Testing
Verified on Android 15 device with a 5.4 Samsung kernel — now correctly detects Android 15 instead of Android 11.
🤖 Generated with Claude Code