@@ -44,8 +44,6 @@ import com.credman.cmwallet.openid4vp.OpenId4VPMatchedSdJwtClaims
4444import com.credman.cmwallet.pnv.maybeHandlePnv
4545import com.credman.cmwallet.sdjwt.SdJwt
4646import com.credman.cmwallet.toBase64UrlNoPadding
47- import com.google.android.gms.identitycredentials.Credential
48- import com.google.android.gms.identitycredentials.IntentHelper
4947import org.json.JSONArray
5048import org.json.JSONObject
5149
@@ -135,10 +133,9 @@ fun createOpenID4VPResponse(
135133 val response = openId4VPRequest.generateResponse(vpToken)
136134 Log .d(TAG , " Returning $response " )
137135 return DigitalCredentialResult (
138- responseJsonLegacy = response,
139136 authenticationTitle = authenticationTitle,
140137 authenticationSubtitle = authenticationSubtitle,
141- responseJsonModern = JSONObject ().apply {
138+ responseJson = JSONObject ().apply {
142139 put(" protocol" , openId4VPRequest.protocolIdentifier)
143140 put(" data" , JSONObject (response))
144141 }.toString()
@@ -263,7 +260,7 @@ class GetCredentialActivity : FragmentActivity() {
263260 if (pnvResponse != null ) {
264261 PendingIntentHandler .setGetCredentialResponse(
265262 resultData,
266- GetCredentialResponse (DigitalCredential (pnvResponse.responseJsonModern ))
263+ GetCredentialResponse (DigitalCredential (pnvResponse.responseJson ))
267264 )
268265 setResult(RESULT_OK , resultData)
269266 finish()
@@ -292,24 +289,9 @@ class GetCredentialActivity : FragmentActivity() {
292289 override fun onAuthenticationSucceeded (result : BiometricPrompt .AuthenticationResult ) {
293290 Log .d(TAG , " onAuthenticationSucceeded" )
294291
295- // This is a temporary solution until Chrome migrate to use
296- // the top level DC DigitalCredential json structure.
297- // Long term, this should be replaced by a simple
298- // `PendingIntentHandler.setGetCredentialResponse(intent, DigitalCredential(response.responseJson))` call.
299- IntentHelper .setGetCredentialResponse(
300- resultData,
301- com.google.android.gms.identitycredentials.GetCredentialResponse (
302- Credential (
303- DigitalCredential .TYPE_DIGITAL_CREDENTIAL ,
304- Bundle ().apply {
305- putByteArray(" identityToken" , response.responseJsonLegacy.toByteArray())
306- }
307- )
308- )
309- )
310292 PendingIntentHandler .setGetCredentialResponse(
311293 resultData,
312- GetCredentialResponse (DigitalCredential (response.responseJsonModern ))
294+ GetCredentialResponse (DigitalCredential (response.responseJson ))
313295 )
314296
315297 setResult(RESULT_OK , resultData)
@@ -355,11 +337,9 @@ class GetCredentialActivity : FragmentActivity() {
355337 }
356338
357339 data class DigitalCredentialResult (
358- // New integration should no longer need this legacy setup
359- val responseJsonLegacy : String ,
360340 val authenticationTitle : CharSequence ,
361341 val authenticationSubtitle : CharSequence? ,
362- val responseJsonModern : String , // Now we need to include the full DigitalCredential (i.e. {"protocol": ..., "data": ...}
342+ val responseJson : String ,
363343 )
364344
365345 sealed class DigitalCredentialRequestOptions {
0 commit comments