Skip to content

fix: use ro.build.version.release for Android version detection - #186

Open
HarshalR8 wants to merge 1 commit into
diabl0w:masterfrom
HarshalR8:master
Open

HarshalR8 wants to merge 1 commit into
diabl0w:masterfrom
HarshalR8:master

Conversation

@HarshalR8

Copy link
Copy Markdown

Problem

read_device_versions() reads the Android version from the GKI KMI tag embedded in uname -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 -r contains android11, 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.release via 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

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>
@diabl0w diabl0w closed this Nov 6, 2026
@diabl0w

diabl0w commented Nov 6, 2026

Copy link
Copy Markdown
Owner

was it not working as-is?

@diabl0w diabl0w reopened this Nov 6, 2026
@HarshalR8

Copy link
Copy Markdown
Author

was it not working as-is?

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.

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.

2 participants