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.
This commit is contained in:
JingMatrix
2025-11-28 19:45:53 +01:00
committed by GitHub
parent 78e80391d3
commit 6a58f804d7
2 changed files with 5 additions and 5 deletions
@@ -81,7 +81,7 @@ object AttestationBuilder {
DERTaggedObject( DERTaggedObject(
true, true,
AttestationConstants.TAG_VENDOR_PATCHLEVEL, AttestationConstants.TAG_VENDOR_PATCHLEVEL,
ASN1Integer(AndroidDeviceUtils.vendorPatchLevel.toLong()), ASN1Integer(AndroidDeviceUtils.vendorPatchLevelLong.toLong()),
) )
) )
vector.add( vector.add(
@@ -165,7 +165,7 @@ object AttestationBuilder {
DERTaggedObject( DERTaggedObject(
true, true,
AttestationConstants.TAG_VENDOR_PATCHLEVEL, AttestationConstants.TAG_VENDOR_PATCHLEVEL,
ASN1Integer(AndroidDeviceUtils.vendorPatchLevel.toLong()), ASN1Integer(AndroidDeviceUtils.vendorPatchLevelLong.toLong()),
), ),
DERTaggedObject( DERTaggedObject(
true, true,
@@ -110,10 +110,10 @@ object AndroidDeviceUtils {
getCustomPatchLevelFor("system", isLong = false) getCustomPatchLevelFor("system", isLong = false)
?: Build.VERSION.SECURITY_PATCH.toPatchLevelInt(isLong = false) ?: Build.VERSION.SECURITY_PATCH.toPatchLevelInt(isLong = false)
val vendorPatchLevel: Int val vendorPatchLevelLong: Int
get() = get() =
getCustomPatchLevelFor("vendor", isLong = false) getCustomPatchLevelFor("vendor", isLong = true)
?: Build.VERSION.SECURITY_PATCH.toPatchLevelInt(isLong = false) ?: Build.VERSION.SECURITY_PATCH.toPatchLevelInt(isLong = true)
val bootPatchLevelLong: Int val bootPatchLevelLong: Int
get() = get() =