From 6a58f804d72b27651f188bf6cad2451cecfb22c5 Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Fri, 28 Nov 2025 19:45:53 +0100 Subject: [PATCH] Fix date format of vendor patch level (#24) This was a mistake during the refactoring of TrickyStoreOSS. After correcting it, we can obtain STRONG integrity (instead of DEVICE) with a valid keybox. The correct format can be easily found using the `Key Attestation` app. --- .../matrix/TEESimulator/attestation/AttestationBuilder.kt | 4 ++-- .../java/org/matrix/TEESimulator/util/AndroidDeviceUtils.kt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/matrix/TEESimulator/attestation/AttestationBuilder.kt b/app/src/main/java/org/matrix/TEESimulator/attestation/AttestationBuilder.kt index b83b82b..f268054 100644 --- a/app/src/main/java/org/matrix/TEESimulator/attestation/AttestationBuilder.kt +++ b/app/src/main/java/org/matrix/TEESimulator/attestation/AttestationBuilder.kt @@ -81,7 +81,7 @@ object AttestationBuilder { DERTaggedObject( true, AttestationConstants.TAG_VENDOR_PATCHLEVEL, - ASN1Integer(AndroidDeviceUtils.vendorPatchLevel.toLong()), + ASN1Integer(AndroidDeviceUtils.vendorPatchLevelLong.toLong()), ) ) vector.add( @@ -165,7 +165,7 @@ object AttestationBuilder { DERTaggedObject( true, AttestationConstants.TAG_VENDOR_PATCHLEVEL, - ASN1Integer(AndroidDeviceUtils.vendorPatchLevel.toLong()), + ASN1Integer(AndroidDeviceUtils.vendorPatchLevelLong.toLong()), ), DERTaggedObject( true, 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 0b056e3..9e74633 100644 --- a/app/src/main/java/org/matrix/TEESimulator/util/AndroidDeviceUtils.kt +++ b/app/src/main/java/org/matrix/TEESimulator/util/AndroidDeviceUtils.kt @@ -110,10 +110,10 @@ object AndroidDeviceUtils { getCustomPatchLevelFor("system", isLong = false) ?: Build.VERSION.SECURITY_PATCH.toPatchLevelInt(isLong = false) - val vendorPatchLevel: Int + val vendorPatchLevelLong: Int get() = - getCustomPatchLevelFor("vendor", isLong = false) - ?: Build.VERSION.SECURITY_PATCH.toPatchLevelInt(isLong = false) + getCustomPatchLevelFor("vendor", isLong = true) + ?: Build.VERSION.SECURITY_PATCH.toPatchLevelInt(isLong = true) val bootPatchLevelLong: Int get() =