Closed Jitendran closed 1 year ago
Hey @Jitendran ,
it doesn't look like the code that using jose-jwt
lib? Not sure what i can comment about?
Hey @dvsekhvalnov , Thanks for your reply. I am using below lib in my kotlin build.gradle file.
implementation 'com.google.android.play:integrity:1.1.0' implementation group: 'org.bitbucket.b_c', name: 'jose4j', version: '0.7.12'
@Jitendran i got it :)
I can't comment on those ones, i can comment on jose-jwt
project, but you not showing any code that using it.
On C# I managed to solve it like mentioned here : https://github.com/dvsekhvalnov/jose-jwt/issues/202
Thanks @dishanphilips for your reply.
If you guys good with your question, feel free to close ticket.
Hi @Jitendran, did u managed to fix it in ur app?
Hi @KubinkiewiczDawid , we was facing this issue before the app was not live when we live the app in Play store after that we are not facing this issue.
We follow the below google and separate 1 developer blog Google doc https://developer.android.com/google/play/integrity/verdict#decrypt-verify-locally
1 developer blog https://hoven.in/cpp-projects/play-integrity-api-2.html https://hoven.in/cpp-projects/play-integrity-api-3.html
We are getting this "org.jose4j.lang.IntegrityException: A256KW key unwrap/decrypt failed" exception in below try catch block line.
"compactJws = jwe.payload" // This is the code we are using for Play integrity
val str = "AIzaSyBPF4dLN4SLxNlraMWUD2FpUrfE39qvF_E" val strBytes = Base64.decode(str, Base64.DEFAULT) val encoded = Base64.encode( strBytes, Base64.URL_SAFE or Base64.NO_PADDING or Base64.NO_WRAP ) val nonce = String(encoded) val DECRYPTION_KEY = "xcClpnhjH0JQrwcJ…./9TPiTqr34Nmqs=" val VERIFICATION_KEY = "MFkwEwYHKoZIzj0CAQYI….AEuzmUjHs7b7Z7NUgbKmq/5AJfpeMbjh/10yNlQllYlDz1DRIisRMbLI/4yDIO95VWgcfrrnSyIPKBMRFiFEZE3Q=="
val integrityManager = IntegrityManagerFactory.create(applicationContext) val integrityTokenResponse = integrityManager.requestIntegrityToken(IntegrityTokenRequest.builder() .setNonce(nonce) .setCloudProjectNumber(70102…724) .build() ) .addOnSuccessListener( (OnSuccessListener { response: IntegrityTokenResponse ->
val integrityToken = response.token()
val decryptionKeyBytes: ByteArray =
Base64.decode(DECRYPTION_KEY, Base64.DEFAULT)