Android - App Libraries - Monitor (Pro)
The build code for your game is stored inside the Android library files. A common target for cheaters to manipulate the code here and gain advantages. But often it is far too difficult or costly to change the actual code, so cheaters inject their own libraries instead of modifying the existing ones.
You can detect this injection by validating the libraries found within your application.
Monitor
To monitor the library files found in the app, AntiCheat has introduced the 'AndroidPackageLibraryMonitor', which can be found in the namespace 'GUPS.AntiCheat.Monitor.Android'. The monitor reads all files located in the library directory, for example '{APK}\lib\armeabi-v7a'. As soon as the libraries have been read, it notifies the observers with the 'AndroidLibraryStatus'.
Monitor Status
The monitor reads the libraries of the app in its Start callback. After finding the app's libraries the observers will be notified with the 'AndroidLibraryStatus'. The status contains the following properties:
- FailedToRetrieveData: Represents if the libraries could not be retrieved or an exception occurred. And no valid value is returned.
- Libraries: The list of libraries used by the app 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 'AndroidPackageLibraryMonitor' to a child GameObject of the 'AntiCheat-Monitor' and setup the 'AndroidPackageTamperingDetector'.
Add Monitor Component
Add the 'AndroidPackageLibraryMonitor' MonoBehavior from the 'GUPS.AntiCheat.Monitor.Android' namespace to your 'AntiCheat-Monitor' GameObject or better to a child GameObject.
Add the 'AndroidPackageLibraryMonitor' as Component.
When running on an Android device, the library file names will be read in the 'Start' method of the 'AndroidPackageLibraryMonitor' MonoBehaviour. As soon as the libraries were read, an 'AndroidLibraryStatus' is sent to observers (usually detectors next to the monitor). If the libraries could not be read, a status containing the error is also sent.
Detect Unallowed Libraries
To react to the sent status and so validate the found libraries you need a detector. To do this, use the 'AndroidPackageTamperingDetector', an aggregated detector that can react to various attempts to tamper with the Android app itself.