Updates: Use appropriate certificate to verify and purchase apps
* 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>
This commit is contained in:
12
app/src/main/java/com/aurora/extensions/Signature.kt
Normal file
12
app/src/main/java/com/aurora/extensions/Signature.kt
Normal file
@@ -0,0 +1,12 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user