fix(util): skip day synthesis for YYYY-MM input
parsePatchLevelValue silently synthesized day=01 when input was 6 chars (YYYY-MM) and caller wanted 8-digit YYYYMMDD. If ro.vendor.build.security_patch ever returns YYYY-MM on a target device (older Samsung firmware does), the synthesized day disagrees with the real bulletin day -- a detection fingerprint. Return null so getRealDevicePatchLevelInt falls through to Build.VERSION.SECURITY_PATCH, which is always YYYY-MM-DD.
This commit is contained in:
@@ -346,7 +346,9 @@ object AndroidDeviceUtils {
|
|||||||
6 -> { // YYYYMM
|
6 -> { // YYYYMM
|
||||||
val year = normalized.substring(0, 4).toInt()
|
val year = normalized.substring(0, 4).toInt()
|
||||||
val month = normalized.substring(4, 6).toInt()
|
val month = normalized.substring(4, 6).toInt()
|
||||||
if (isLong) year * 10000 + month * 100 + 1 else year * 100 + month
|
// Synthesizing day=01 from YYYY-MM disagrees with real device bulletins;
|
||||||
|
// propagate null so callers fall back to a YYYY-MM-DD source.
|
||||||
|
if (isLong) null else year * 100 + month
|
||||||
}
|
}
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user