Android - Installed Apps - Monitor (Pro)
Locally installed cheating or hacking apps are frequently used to gain advantages, whether it's to modify an app or manipulate its memory for some kind of benefit. Because these types of apps are typically installed on a user's device their installation cannot be prevented. However, it is possible to identify which apps a user has installed and respond accordingly.
Monitor
To monitor the installed apps on the users device, AntiCheat has introduced the 'AndroidInstalledApplicationMonitor', which can be found in the 'GUPS.AntiCheat.Monitor.Android' namespace. The monitor reads and provides information about the apps installed on the device (system apps are ignored) and passes the package name of the apps found to oberservers via the 'AndroidInstalledApplicationStatus'.
Monitor Status
The monitor returns the installed apps on the device in its Start callback. After finding the apps the observers will be notified with the 'AndroidInstalledApplicationStatus'. The status contains the following properties:
- FailedToRetrieveData: Represents if the apps on the device could not be retrieved or an exception occurred. And no valid value is returned.
- Applications: The list of installed applications on the device.
Supported Platforms
The monitor is only available on Android platforms.
Requirements
Requires an Android build with at least Android 4.4 (API level 19) (December 2013).
How To Use
The usage is quite simple, attach the 'AndroidInstalledApplicationMonitor' to a child GameObject of the 'AntiCheat-Monitor' and setup the 'AndroidDeviceCheatingDetector'.
Add Monitor Component
Add the 'AndroidInstalledApplicationMonitor' MonoBehavior from the 'GUPS.AntiCheat.Monitor.Android' namespace to your 'AntiCheat-Monitor' GameObject or better to a child GameObject.
Add the 'AndroidInstalledApplicationMonitor' as Component.
When running on an Android device, the installed apps are read in the 'Start' method of the 'AndroidInstalledApplicationMonitor' MonoBehaviour. As soon as the installed apps are found, an 'AndroidInstalledApplicationStatus', containing a list of package names of the found apps, is sent to the observers (usually detectors next to the monitor). If the installed apps could not be read, a status containing the error is also sent.
Detect Unallowed Apps
To react to the sent status and so validate the installed apps, you need a detector. To do this, use the 'AndroidDeviceCheatingDetector', a detector designed to analyse the status send by the 'AndroidInstalledApplicationMonitor' and validate it for unallowed installed apps.