Mobile - Genuine - Detector
Malicious or unauthorized distribution of applications, especially on mobile devices, often involves changing the package name for republishing. Use the 'MobileGenuineDetector' to implement a genuine validation of mobile apps.
Detector
The 'MobileGenuineDetector' does not require any kind of additional monitor. It uses the genuine validation method provided by Unity and can be used on all mobile platforms. It validates the package name of the build app against the running app. On Android, it should be combined with the AntiCheat solutions specially developed for Android apps, as the general genuine validation check does not detect all possible manipulations.
Observed Subject
The detector is not observering any kind of monitor.
Detector Status
When the detector validates the genuineness of the app, by checking the package name, it directly informs the observers about a possible threat using a 'CheatingDetectionStatus'. The status contains the following properties:
- PossibilityOfFalsePositive: A value indicating the possibility of a false positive when assessing threats for the implementing subject from 0.0 to 1.0.
- ThreatRating: The threat rating associated with the detected cheating, indicating the assessed level of a potential threat.
Supported Platforms
The detector is available on all mobile platforms.
Requirements
There are no requirements.
How To Use
The usage is quite simple, attach a 'MobileGenuineDetector' to a child GameObject of the 'AntiCheat-Monitor' and define a reaction on cheating detection.
Requirements
There are none. No additional monitor is required.
Add Detector Component
Manual
Add the 'MobileGenuineDetector' MonoBehavior from the 'GUPS.AntiCheat.Detector.Mobile' namespace to your 'AntiCheat-Monitor' GameObject or better to a child GameObject.
Add the 'MobileGenuineDetector' as Component.
Prefab
There is also a prefab, including the detector, which you can directly attach as a GameObject to the 'AntiCheat-Monitor'.
Add the 'Mobile Genuine Detector' prefab to the 'AntiCheat-Monitor'.
Settings
After attaching the 'MobileGenuineDetector' MonoBehavior to a GameObject, you will see the following in the inspector:
The settings of the 'MobileGenuineDetector' Component.
- General Settings: Define here if the detector should be active.
- Threat Rating Settings: Define here the severity of the detected cheating.
- Observable Settings: Add here callbacks invoken when a cheating got detected.
- Genuine Settings: Set here if the genuine check should be done once, or repeating every x seconds.
Runtime
The genuine check can either be done once on the Start callback or repeating every x seconds. If the genuine check failed, the detector notifies observers of the detected cheating.
React On Cheating
When the detector (data validator) is set up, you sure want to react on detected cheating.
Punisher
In general, any cheat detected is forwarded to the 'AntiCheat-Monitor', which calculates an overall threat level. Based on the threat level, you can apply punishments by using Punisher components added to a child GameObject of the 'AntiCheat-Monitor'. There are some built-in punishers that you can find here as prefabs:
The location of the built-in Punisher prefabs.
Inspector
You can set a callback in the Unity Inspector view of the detector. This callback is invoken as soon as the specific cheating is detected.
A list of callbacks invoken when cheating got detected from the detector.
Code
If you would like to write a custom listener to the detector, you can attach an observer:
// Get the detector.
var detector = AntiCheatMonitor.Instance
.GetDetector<MobileGenuineDetector>();
// Subscribe as observer and get notified on inconsistency.
detector.Subscribe(myObserver);
Also the detector has an inherited property 'PossibleCheatingDetected' which is set to true once a cheating got detected.