Google Play Integrity API result UNEVALUATED after mobile restart - android

I have released my app with google play integrity api.
App works after device integrity check success
"deviceIntegrity": {
"deviceRecognitionVerdict": ["MEETS_BASIC_INTEGRITY", "MEETS_DEVICE_INTEGRITY"]
},
I found issue with some user facing the issue that device passes device integrity at the time of install
but after restart device, deviceIntegrity check failed
here is response what i found during debugging after restart
{
"requestDetails": {
"requestPackageName": "com.my.package",
"timestampMillis": "1674455009345",
"nonce": "Y29tLm1hbnRyYS5yZHNlcnZpY2UyMDIzMDEyMzExNTIzMjajHDrnJ9vtl2AfC1fUdEDJmD_HfvFtcpc\u003d"
},
"appIntegrity": {
"appRecognitionVerdict": "UNEVALUATED"
},
"deviceIntegrity": {
},
"accountDetails": {
"appLicensingVerdict": "UNEVALUATED"
}
}
I have search about UNEVALUATED result
"Application integrity was not evaluated. A necessary requirement was missed, such as the device not being trustworthy enough."
But the issue accures only after restarting the android device
I Hope some one can help us on this issue.

Related

Play Integrity test cases failed

Below are the test cases that we created on Play Console for Play Integrity:
We have created combinations of different verdicts that can be received by Play Integrity API. All below test cases work when we remove all google accounts from a device and keep only that email ID with which the test case is created. But these test cases don't seem to work when a device has multiple google accounts.
Test case 1 - device 1:
As per the test case, the verdict returned should be "Basic device integrity met, running unlicensed Play-recognised app" but received below verdict:
`"appIntegrity": {
"appRecognitionVerdict": "UNRECOGNIZED_VERSION",
"certificateSha256Digest": ["KrKTIuq1ehCAmzZmpBnECGnylNUIhJNKmG3cIYU-xU8"],
"packageName": "mypackagename",
"versionCode": "228"
},
"deviceIntegrity": {
"deviceRecognitionVerdict": ["MEETS_BASIC_INTEGRITY", "MEETS_DEVICE_INTEGRITY"]
},
"accountDetails": {
"appLicensingVerdict": "LICENSED"
}`
With this verdict, the message displayed on mobile app is - "App is not google play recognized"
When we removed all accounts and kept only device 1 test case email account in the same device, we got the expected result.:
`"appIntegrity": {
"appRecognitionVerdict": "PLAY_RECOGNIZED",
"certificateSha256Digest": ["ki_C3iCaCK58mqf7FNrVH6KsPa8wDxBPsx_NQ37Qslw"],
"packageName": "mypackagename",
"versionCode": "228"
},
"deviceIntegrity": {
"deviceRecognitionVerdict": ["MEETS_BASIC_INTEGRITY"]
},
"accountDetails": {
"appLicensingVerdict": "UNLICENSED"
}`
With this verdict, the message displayed on mobile app is - "Integrity check fail"
Test case 2 - device 2:
The only exception is this device where all test cases work in spite of the device having multiple google accounts.
As per the test case, the verdict returned should be "Strong device integrity met, running licensed Play-recognised app" which is correctly returned:
`"appIntegrity": {
"appRecognitionVerdict": "PLAY_RECOGNIZED",
"certificateSha256Digest": ["ki_C3iCaCK58mqf7FNrVH6KsPa8wDxBPsx_NQ37Qslw"],
"packageName": "mypackagename",
"versionCode": "228"
},
"deviceIntegrity": {
"deviceRecognitionVerdict": ["MEETS_BASIC_INTEGRITY", "MEETS_DEVICE_INTEGRITY", "MEETS_STRONG_INTEGRITY"]
},
"accountDetails": {
"appLicensingVerdict": "LICENSED"
}`
With above verdict, no error message is displayed on mobile app and user successfully proceeds to next screen.
Tested same cases on few devices it's not working properly.

Google Billing payment request inside TWA returning error Unable to download payment manifest "https://play.google.com/billing" on older Androids

I use Bubblewrap to turn my PWA into a TWA app on Android and have Google Billing properly enabled. Everything works fine on my Android 11 device, but when I open my app on devices that run Android 6, the PaymentRequest.canMakePayment() method returns false with the error message:
Unable to download payment manifest "https://play.google.com/billing".
Since I can't find any documentation online about how Google Play Billing works with the web Payment Request API, I have no information about the requirements to make it work. I'm also pretty sure that it used to work and I managed to make payments on older Android devices.
Any help would be appreciated!
This is my code:
const getBillingService = async () => {
if (window.PaymentRequest !== undefined) {
const dummyMethods = [
{
supportedMethods: "https://play.google.com/billing",
},
];
const dummyDetails = {
total: {
label: `Total`,
amount: { currency: `USD`, value: `0` },
},
};
const dummyRequest = new PaymentRequest(dummyMethods, dummyDetails);
const possible = await dummyRequest.canMakePayment();
//true inside my app on newer Android versions, false in older ones
//with the error Unable to download payment manifest "https://play.google.com/billing".
}
};
All the requirements to make the Google Play Billing API work are satisfied as far as I know: https context, app downloaded from the Play Store... and it does work on newer devices.

Provisioning devices as dedicated devices using Android Management API not working

I have followed Android-Management-API quick start and successfully done all steps and provision a device with work profile mode. But when I tried provisioning devices(via QR code scan) as dedicated devices after factory reset, it fails and I do not see my device in "devices-list" under my organization. I see "device-policy" in settings>Google on device but when i click on "device policy" it shows that policy not synced and clicking "sync" manually shows "error updating policy". Can you please help if i misconfigure anything?
My policy is given below:
{
"applications": [
{
"packageName": "com.google.android.gm",
"installType": "FORCE_INSTALLED"
}
],
"debuggingFeaturesAllowed": true
}
My QRcode is given below:
{
"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "com.google.android.apps.work.clouddpc/.receivers.CloudDeviceAdminReceiver",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "I5YvS0O5hXY46mb01BlRjq4oJJGs2kuUcHvVkAPEXlg",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "https://play.google.com/managed/downloadManagingApp?identifier=setup",
"android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE":{
"com.google.android.apps.work.clouddpc.EXTRA_ENROLLMENT_TOKEN": "{enrollment-token}"
}
}

Expo Local Authentication not working for non-Biometric devices

I am using expo local authentication in an expo project and it works perfectly with IOS/Android, But for older android devices that doesn't have Face/Touch ID its not possible to use local authentication and gives this error:
Object {
"error": "not_available",
"message": "Biometric hardware unavailable",
"success": false,
}
I tested in expo SDK 38 and 39, with expo-local-authentication version 9.2.0 and 9.3.0 .
Any help how can i use Pin/Pattern for older non-biometric devices?
Since the Local authentication package only does biometric, it won't just do device pin without having biometric hardware.
to guard against older devices, you simply use the following methods to disable the biometric code.
LocalAuthentication.hasHardwareAsync();
and
LocalAuthentication.isEnrolledAsync()
both return a promise, so you need to await for them.
if (await LocalAuthentication.isEnrolledAsync() && await LocalAuthentication.isEnrolledAsync()) {
//do biometric auth
} else {
// implement your own password or use another package for device pin.
}

Amazon Fire (TV) In-app Purchase: Subscription

I am currently working on a test app for Amazon's In-App Purchasing SDK for Android. Specifically, I am working on Fire TV, but the problems also seems to appear on a Fire Tablet.
I created a (currently unpublished) App on my Developer account and added a subscription with both an annual and a monthly option.
Here is the exported JSON:
{
"inapppurchasingtestabo.monthly": {
"price": 1.07,
"subscriptionParent": "inapppurchasingtestabo",
"smallIconUrl": "http://",
"title": "Subscription",
"itemType": "SUBSCRIPTION",
"description": "This is the subscription!",
"languageTitleMap": {
"DE": "Abo",
"US": "Subscription"
},
"languageDescriptionMap": {
"DE": "Das ist das Abo!",
"US": "This is the subscription!"
},
"currencyPriceMap": {
"US": 0.0
}
},
"inapppurchasingtestabo.annually": {
"price": 10.72,
"subscriptionParent": "inapppurchasingtestabo",
"smallIconUrl": "http://",
"title": "Subscription",
"itemType": "SUBSCRIPTION",
"description": "This is the subscription!",
"languageTitleMap": {
"DE": "Abo",
"US": "Subscription"
},
"languageDescriptionMap": {
"DE": "Das ist das Abo!",
"US": "This is the subscription!"
},
"currencyPriceMap": {
"US": 0.0
}
}
}
I installed the Amazon App Tester App on the device and copied the JSON to /mnt/sdcard/amazon.sdktester.json.
While everything seems to work in principle - from the app I can see the subscription along with the available prices, the descriptions, etc. and I can also make a purchase which then shows up in the App Tester App - I see no indication as to which price is for which subscription period.
Compare the following screenshots:
Can you tell which price is for the monthly and which is for the annual subscription? (Also, keep in mind, that for all the user knows, they could be bi-weekly and semi-annual, too).
So my question is: What am I doing wrong and how do I get the purchase dialog to display the period along with the price?
Amazon app tester has not been updated with the new offerings they have developed in the in app purchases. I would advice to conduct a beta test to ensure that app works. App tester is a mock app that pretends to fulfill purchases. Beta test (Live app test) would test your app against the actual amazon services that executes in app purchases in real world (production for published app).
This is likely a bug or limitation with the Amazon App Tester app. From my experience, it does not fully replicate the production environment. It's useful for testing the basic workflow locally.
I would recommend you to use Live App Testing which allows you to test in the production environment.

Categories

Resources