Okay so I have just been informed Android has a function called "isUserAMonkey()".
Conversation
It returns true when the app is being operated by a "monkey" script that clicks buttons at random
This is a common QA term but what's odd, if you think about it is on Android it returns the opposite of truth
Literally speaking it's only true when a monkey is *not* using the app
3
60
. suggested they could disambiguate with separate "isUserAMonkey()" and "isUserAnApe()" functions
Possibly implement one in terms of the other
bool isUserAMonkey() { return !isUserAnApe(); }
3
29
developer.android.com/studio/test/mo is the monkey. It's actually a pretty smart fuzzer and if you use testing channels on the Play Store (or upload to Firebase manually) they run it against your app on a bunch of devices, check for crashes, jank, etc. and let you see the videos. It's neat.
It amuses me that it pretty much always submits attestation samples from each device they test on via the Submit sample data button in the menu for github.com/GrapheneOS/Aud. Beyond that it just gets stuck trying to scan a QR code from a virtual camera with no QR code visible.
1
7
There's also isUserAGoat in developer.android.com/reference/andr.
Sadly can't detect if the user is a goat anymore due to Android 11 privacy improvements. Not joking by the way. It would have required the QUERY_ALL_PACKAGES permission which they want to be limited in use.
1
6
27
Show replies

