1

(NOTE: the text of this question has been updated to make it much clearer than before as to what I'm actually looking for).

I'm running stock Android 11 on one device and stock Android 13 on another device.

I'd like to write a command-line script (not a Java-implemented app) that can run on both of these systems and on many other Android devices/OS's, and which can check whether or not a given app would be prohibited from installation via the Play Store on the specific device where the script is running.

To be clear, I am not simply interested in whether the app exists in the Play Store on the web. I'm looking for something more specific:

Some apps that exist in the Play Store on the web for general installation might be prohibited for installation on a specific, particular device. This could be for security reasons (e.g., DEVICE integrity is not being reported on the device), or it could be because the device's Android version is too low, or there could possibly be other reasons. In these cases, the app does not even show up in the device's Play Store when searching for it to be installed, although the same app will indeed show up in a Play Store search on other devices that do not have these kinds of issues.

I want to be able to somehow query the current device's Play Store installation (not the generic, web-accessible Play Store pages) to see whether the given app might be prohibited for installation on the current device.

One example is the Netflix app. If the phone does not report DEVICE-level integrity, the user will not even see Netflix as existing when searching it in the Play Store on that particular device.

This is the case I'm trying to find a solution for.

For example, let's assume for the purpose of this discussion that the app happens to indeed be Netflix. That particular app's package name is "com.netflix.mediaclient". If my proposed script is named "app-in-playstore.sh", I'd like to be able to do the following, and have the script print either "false" or "true" to stdout, depending on whether or not this Netflix app is prohibited from installation via the Play Store on the device upon which the script is running, or whether its installation is indeed allowed on that particular device ...

/system/bin/sh app-in-playstore.sh com.netflix.mediaclient

(or perhaps preceded with "su -c" on a rooted device).

If the current device is reporting DEVICE integrity at the moment this script is being run, the script should print "true", because Netflix would indeed show up in the device's Play Store as installable.

If the current device is not reporting DEVICE integrity at the moment this script is being run, the script should print "false", because Netflix would not show up in the device's Play Store as installable.

To be clear, this isn't solely related to Netflix. I'm just using it as an example here, because I happen to know that it indeed will not show up in the Play Store if the phone is not reporting DEVICE integrity. I'm sure there are other apps that are treated similarly, and I want my script to be able to identify these other apps in the same way.

Is writing such a script possible? And if so, how could it be accomplished?

Thank you very much in advance.

2
  • 2
    If an app is installable or not is determined by Play Store on server side, thus it is not accessible for a script. Even for an app it is very very complicated. See Aurora Store Sources (and even Aurora Store doesn't manage to get all apps Play Store app can download). The only way I see for you is to open the Play Store app with the app to be installed in an automated way and then parse the UI elements if the install button is available. Not sure what software can be used to do so.
    – Robert
    Dec 23, 2023 at 12:55
  • Thank you, @Robert. I was afraid that this might be the case. I already do something similar with UI parsing to go to the Play Store Developer options and query the reported device integrity via a combination of Tasker and AutoInput, and I guess this would be the best that I could do in this case, also. Oh well ... (sigh) ...
    – HippoMan
    Dec 23, 2023 at 18:19

1 Answer 1

0

Based on the helpful comment by @Robert, it looks like the only way I could automate the checking of whether or not Google will prohibit the installation of a given Web-store-resident app on a given device of a given user would be to make use of "uiautomation"-based interaction with the Play Store screen on the device itself.

This could be done via the uiautomation utility itself, or also via Tasker working with AutoInput.

I was hoping to avoid that kind of solution, but perhaps I'm stuck with it.

In any case, I'll leave this question open, in case some new information might come this way in the future that could possibly help with this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .