• Hello
Search Results for

    Show / Hide Table of Contents

    Android - Installed Apps - Monitor (Pro)

    A cheat app can sit next to your game and change its memory. You cannot stop the player from installing it. You can notice that it is there.

    This monitor looks for the apps on your block list. The Android device cheating detector treats a found app as cheating.

    This monitor needs the Pro version.

    Walkthrough: Cheat apps on Android.

    Do you need to add it?

    Most of the time, no. The Android Device Cheating Detector prefab already includes this monitor. That prefab is part of the predefined Anti-Cheat-Monitor prefab.

    Add the AndroidInstalledApplicationMonitor component (namespace GUPS.AntiCheat.Monitor.Android) by hand only if you build your own setup, or if you only want the raw reading. Put it on the same GameObject as its detector. The detector looks for it there.

    Add the AndroidInstalledApplicationMonitor component.

    What it reports

    The monitor reads the apps when it starts. It then sends one AndroidInstalledApplicationStatus:

    public struct AndroidInstalledApplicationStatus : IAndroidStatus
    {
        // True if the apps could not be read.
        public bool FailedToRetrieveData { get; }
    
        // The blocked package names that are installed on the device.
        public List<string> Applications { get; }
    }
    
    • FailedToRetrieveData: The apps could not be read. The list is not valid.
    • Applications: The blocked package names that are installed. A package name is the id of an app, such as com.company.app. Only names from your list are returned, not every app on the phone.

    Settings

    The monitor has two fields in the Inspector:

    • Is Active (isActive, bool, default true): Turns the monitor on or off.
    • Recheck On Resume (recheckOnResume, bool, default false): When on, the apps are read again when the player comes back to the game, and another status is sent. While off, the apps are read only at the start.

    The blocked package names are set in the project settings. Open Edit > Project Settings > GuardingPearSoftware > AntiCheat, select the Android tab and go to Android - Device App - Settings.

    Blocked device apps.

    • Blacklist device apps: Off by default. Turn it on to use this check.
    • Blacklisted apps: The package names you do not want next to your game.

    Good to know

    • Use Recheck On Resume for long sessions: A player can install a cheat app while your game is in the background. With the option on, that is noticed when they return.
    • Not in the Editor: The monitor only reads the apps on an Android device. In the Editor it sends nothing and logs a warning.
    • Development builds: Verify development builds is off by default. While it is off, the detector does not judge development builds. Turn it on while you test.

    Turn on Verify development builds to also check development builds.

    Platforms and requirements

    Android only. Android 4.4 (API level 19) or newer.

    The Android plugin com.gups.anticheat ships with the package in Assets/GUPS/AntiCheat/Plugins/Android/.

    Read it in code

    You can listen to the monitor yourself. Subscribe returns an IDisposable. Dispose it when you want to stop.

    using System;
    using GUPS.AntiCheat.Core.Watch;
    using GUPS.AntiCheat.Monitor.Android;
    using UnityEngine;
    
    public class AndroidInstalledAppsStatusLogger : MonoBehaviour, IObserver<IWatchedSubject>
    {
        private void Start()
        {
            var monitor = GetComponentInChildren<AndroidInstalledApplicationMonitor>();
            monitor.Subscribe(this);
        }
    
        public void OnNext(IWatchedSubject subject)
        {
            if (subject is AndroidInstalledApplicationStatus status)
            {
                if (status.FailedToRetrieveData)
                {
                    Debug.LogWarning("Could not read the installed apps.");
                    return;
                }
    
                Debug.Log($"Found {status.Applications.Count} blocked apps.");
            }
        }
    
        public void OnError(Exception error) { }
        public void OnCompleted() { }
    }
    

    Detect a blocked app

    To treat a found app as cheating, use the Android device cheating detector.


    Back to the Monitor overview.

    In This Article
    Back to top GuardingPearSoftware documentation