From 3dea76705832a9d3dfcab0b2021a7fe23c470be4 Mon Sep 17 00:00:00 2001 From: Enginex0 Date: Tue, 19 May 2026 05:17:40 +0100 Subject: [PATCH] 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. --- .../java/org/matrix/TEESimulator/util/AndroidDeviceUtils.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/matrix/TEESimulator/util/AndroidDeviceUtils.kt b/app/src/main/java/org/matrix/TEESimulator/util/AndroidDeviceUtils.kt index ad7a2d1..17ec99a 100644 --- a/app/src/main/java/org/matrix/TEESimulator/util/AndroidDeviceUtils.kt +++ b/app/src/main/java/org/matrix/TEESimulator/util/AndroidDeviceUtils.kt @@ -346,7 +346,9 @@ object AndroidDeviceUtils { 6 -> { // YYYYMM val year = normalized.substring(0, 4).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 }