How to detect an CTS approved Android build? -
in documentation of android n preview mentioned:
this build not compatibility test suite (cts) approved. apps depend on cts approved builds won’t work (android pay example).
in android app want check whether device/build cts approved on first launch. possible? how android pay it?
the safetynet api allows run compatibility check which:
allows app check if device running matches profile of device has passed android compatibility testing. compatibility check creates device profile gathering information device hardware , software characteristics, including platform build.
once have connected googleapiclient
using safetynet.api
, can call
byte[] nonce = getrequestnonce(); // should @ least 16 bytes in length. safetynet.safetynetapi.attest(mgoogleapiclient, nonce) .setresultcallback(new resultcallback<safetynetapi.attestationresult>() { @override public void onresult(safetynetapi.attestationresult result) { status status = result.getstatus(); if (status.issuccess()) { // indicates communication service successful. // result.getjwsresult() contains result data } else { // error occurred while communicating service } } });
and parse response per the instructions, looking "ctsprofilematch": true
in resulting json.
Comments
Post a Comment