0

I'm trying to add instant app support to my existing app. My app has app integrity enabled and it passes when I run the full app locally. When I run the instant app locally however it fails. Are there additional steps that I need to undertake to get the Google Play app integrity API to work with an android instant app? The error I'm receiving is below:

HTTP Client: RESPONSE: 200 
METHOD: HttpMethod(value=POST)
FROM: https://mobile.test.com/attest/initiate
COMMON HEADERS
-> Connection: keep-alive
-> Content-Type: application/json
-> Date: Wed, 20 Mar 2024 17:33:04 GMT
-> Transfer-Encoding: chunked
BODY Content-Type: application/json
BODY START
{"id":"1e08f389-3fb1-41f9-89de-73a30f22627a","challenge":"080d7584-cc65-4882-9373-48f2094ff873"}
BODY END
INTEGRITY_API - key is null, getting token
UID: [11277]  PID: [998] IntegrityService : requestIntegrityToken(IntegrityTokenRequest{nonce=080d7584-cc65-4882-9373-48f2094ff873, cloudProjectNumber=null, network=null})
UID: [11277]  PID: [998] IntegrityService : Initiate binding to the service.
UID: [11277]  PID: [998] IntegrityService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.integrityservice.IntegrityService})
UID: [11277]  PID: [998] IntegrityService : linkToDeath
UID: [11277]  PID: [998] OnRequestIntegrityTokenCallback : onRequestIntegrityToken
UID: [11277]  PID: [998] IntegrityService : Unbind from service.
INTEGRITY_API - token fetched = eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2R0NNIn0.aiK93UfZDzqAyHqq0uYE0zQnYBLFCSQKLMKwBjqWdKYJxwa4evfPOg.L5XG_-SLX9K-iSJR.Wx4eHtrFS7i_8LCUOSS2stgIlMh8cYODviwWc6MPdJ8DpucONA5fcjf7P1ZM7_xZgji8Y1UIRUnx7YzGxNbxgVVOg1drQkJwcu7Qkv3EcfvTQ7I7Ih7sFSJ8LFIFqRKJ-_iCCcBW3VzcWYhAXFgG9nJCIqnkaz6ZNdAb5boq8YykRyBQnJGo1QZAqEHaCss8hBGVMCYvZGd5IyKrnQodMKpTlDnTO5Ge_pn5pW2ys4-JmkMSVpcP5ZGVg0EO93RVv1Ztzco_LRhdB5aVhRDShpmImPmEubK7BJInOpVRgxCQHwQdTfWh_EQes9WW-gCGzzYNPOPyCmBEeoPDPoo649T9Dz-Was0BZA6L6iIiUYSVH6_U_HkTDVSStdH923YRwKZ-L4MhwE2PJ8F3tsgohAmX8xoqc_vZ490sgyby63O2s08aBhqxW7QJGmaz-mGL5aUvhxIsu_Ws_LigIvlYPMykM0cukNBRz8XD19R9oTGUE2fjM_Ydo1VNZPmk4vAFc3_gDxrPlczRtd165l7mYrYhH8J-uT8kAzVrZtqChEm2QryUd98137mTVPjANKu0Ycx3aCVRwV5-xj5ye0f1DREafZtOHAfVlhiViTx3FMlsCDF-flbwlRcOEF2DivHAx870l70w9gV9Sro-QUVsmQV_NhDaXnUELTs4Og9EKoyuIJ-G0xPY2MOMT_x2_nSu79FjQIb2NFa-SSt4BjvQShVv_69LV8cq8Wi17N6_EKuuzNTZsz3sBQ_SBRIbZfI4lSWpyLlYekolyuUTN_YA4JDalg0f-ukt9_xGcAnY0rp6xcx9C-LCXPkHnGkodziAO3KPos0Uqd9MrlD4rn_m3vMg5X1Om_CdEaIH9_ECWCmRsQTcVlnklZwRaRjfHszEflKPPH41ajMoVpvwFYtZf2yVmDParsx5PBHS7sCNxKPEEb4JyUAnezIywoBwJahkKCK8GO9SWtqlicMFduFFZ1Pm0P2wotU73Qflw8b07N3lgf0IF8onzlU-AQYQpOKVwBh1vQWDyAEgqXJax7SeHQ5qtTovYYLgKhgpYq_6pHK3dLHr3N4FlV4jFjej6jirkua2Tla2Wj8w7inr3WLQsvtINC2vPsQ.rTOdQ1UXOGfj0-ObclpgIQ
HTTP Client: REQUEST: https://mobile.test.com/attest/validate/android
METHOD: HttpMethod(value=POST)
COMMON HEADERS
-> Accept: application/json
-> Accept-Charset: UTF-8
CONTENT HEADERS
-> Content-Length: 1365
-> Content-Type: application/json
BODY Content-Type: application/json
BODY START
{
    "id": "1e08f389-3fb1-41f9-89de-73a30f22627a",
    "deviceId": "54416d35432dba1d",
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ezIywoBwJahkKCK8GO9SWtqlicMFduFFZ1Pm0P2wotU73Qflw8b07N3lgf0IF8onzlU-AQYQpOKVwBh1vQWDyAEgqXJax7SeHQ5qtTovYYLgKhgpYq_6pHK3dLHr3N4FlV4jFjej6jirkua2Tla2Wj8w7inr3WLQsvtINC2vPsQ.rTOdQ1UXOGfj0-ObclpgIQ"
}
BODY END
tagSocket(129) with statsTag=0xffffffff, statsUid=-1
HTTP Client: RESPONSE: 403 
METHOD: HttpMethod(value=POST)
FROM: https://mobile.test.com/attest/validate/android
COMMON HEADERS
-> Connection: keep-alive
-> Content-Type: application/json
-> Date: Wed, 20 Mar 2024 17:33:06 GMT
-> Transfer-Encoding: chunked
BODY Content-Type: application/json
BODY START
{"message":"Validation failed app"}
BODY END
INTEGRITY_API - onFailure = io.ktor.client.plugins.ClientRequestException: Client request(POST https://mobile.test.com/attest/validate/android) invalid: 403 . Text: "{"message":"Validation failed app"}"
Value is too long; discarded. Value kind, name, value length: param, result, 133
HTTP Client: REQUEST: https://api.cove.test.com/logs/VENDORID/54416d35432dba1d
METHOD: HttpMethod(value=POST)
COMMON HEADERS
-> Accept: application/json
-> Accept-Charset: UTF-8
CONTENT HEADERS
-> Content-Length: 292
-> Content-Type: application/json
BODY Content-Type: application/json
BODY START
{
    "log": "result=Client request(POST https://mobile.test.com/attest/validate/android) invalid: 403 . Text: \"{\"message\":\"Validation failed app\"}\"\ncove_error_type=app_attestation\nversion=2.0.1.77\nbuild=77\ndevice=oriole\nos=34\nvendor_id=54416d35432dba1d\nenvironment=prod"
}
BODY END
11
  • Hello James! What is an actual error you are getting? Can you share the logcat? Commented Mar 13 at 15:35
  • I've updated the question with the relevant section of logcat. Commented Mar 15 at 18:40
  • From the updated logs it looks like the token was fetched and everything works so I suppose these are the logs for the successful scenario? Do you get API_NOT_AVAILABLE for the failed scenario? As I checked and unfortunately PIA is not available for the instant apps. I would recommend to submit the feature request from the Pay Console->App Integrity->Settings-> Get Support. Thank you! Commented Mar 18 at 11:55
  • The logs are from the failed scenario. The very last message is "Validation failed app", so the token was retrieved, but it had a failing verdict. Commented Mar 18 at 13:49
  • Oh, yes, my bad! It is enabled for the instant apps now! Could you, please, re-run the PIA in the instant app and send me more recent logs? Commented Mar 18 at 14:40

0