* Only show updates for devices that has atleast one matching certificate * On Android 9.0+ devices, purchase apps with latest certificate's hash while updating to support key rotations Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
13 lines
401 B
Kotlin
13 lines
401 B
Kotlin
package com.aurora.extensions
|
|
|
|
import android.content.pm.Signature
|
|
import java.security.cert.CertificateFactory
|
|
import java.security.cert.X509Certificate
|
|
|
|
fun Signature.generateX509Certificate(): X509Certificate {
|
|
val certificateFactory = CertificateFactory.getInstance("X509")
|
|
return certificateFactory.generateCertificate(
|
|
this.toByteArray().inputStream()
|
|
) as X509Certificate
|
|
}
|