I'm looking for a way to check for my device's integrity level which can be done in an automated way ... for example, within a script.

By "integrity level", I mean querying whether my device has "MEETS_BASIC_INTEGRITY" and "MEETS_DEVICE_INTEGRITY".

I know I can manually do the following to query that info:

To first enable ...

PlayStore Options=>Settings=>About ... and then click Play Store Version seven times to enable "PlayStore Developer" options

Then, after enabled, I can manually do the following any time I want to see the device's current integrity level ...

PlayStore Options=>Settings=>General=>Developer options=>Check integrity

However, I'd like to avoid this set of manual steps and instead, return this integrity info via some method which can be automatedly used within a script.

Is there any way that I can do this?

Thank you in advance.

  • 3
    Google Play Integrity API is a documented API by Google, just search for it. It can be used in apps so it should be possible to develop a command-line program that provides the result (but that would be more a topic for stackoverflow.com). Note that checking the integrity result locally on the device is a bad idea as a non compliant device may be rooted and thus your script or the result of the program to check the integrity level may be manipulated, too. Usually such check should be performed on a trusted server.
    – Robert
    Dec 9, 2023 at 15:34
  • Oh, OK, I'll check the Google Play Integrity API. As long as it's a Java interface, I could probably use it to build the CLI program that I'm looking for. If I do, and if I have any further questions, I'll go to StackOverflow. Thank you!
    – HippoMan
    Dec 9, 2023 at 15:40
  • 1
    I see that you asked this in the Pixel Flasher thread. I hope you can decode and come to a solution, which would be of use while a laptop isn't available. I would be keen to know too! +1
    – beeshyams
    Dec 9, 2023 at 16:08
  • 1
    Thank you, @beeshyams! I'll post there and here if I find an answer.
    – HippoMan
    Dec 9, 2023 at 19:50
  • 1
    Thanks @beeshyams for pointing to play integrity, section updated. And right, I don't really care about Play – same as Play doesn't really care about integrity, if you've noticed their violating their own policies, replacing apps installed from other sources by those with the same package name but a different signature on devices (KDEConnect, AnkiDroid and others reported lately). At least with that it's clear to me PlayStore is not a safe place to use. Signatures are there for a reason, not for being ignored…
    – Izzy
    Dec 15, 2023 at 12:03


You must log in to answer this question.

Browse other questions tagged .