iOS - Installation Source - Monitor (Pro)
A player can take your app, sign it again, and install that copy outside the App Store. Since iOS 17.4, an app can also come from an alternative app marketplace or straight from a website in the European Union. This monitor finds which channel installed the app.
It only reports the channel. The install source detector decides if that channel is allowed.
This monitor needs the Pro version.
Walkthrough: Protecting an iOS build.
Do you need to add it?
Most of the time, no. The Install Source Detector prefab already includes this monitor, together with the Android and desktop source monitors. That prefab is part of the predefined Anti-Cheat-Monitor prefab.
Add the IOSPackageSourceMonitor component (namespace GUPS.AntiCheat.Monitor.IOS) 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.
What it reports
The monitor checks once, when it starts. The answer arrives a moment later. It then sends one IOSSourceStatus:
public struct IOSSourceStatus : IIOSStatus
{
// True if the source could not be read.
public bool FailedToRetrieveData { get; }
// The source, or EIOSAppStore.Unknown.
public EIOSAppStore AppStoreSource { get; }
// A short name for the source, or the bundle identifier of the marketplace app.
public string AppStoreSourceIdentifier { get; }
}
- FailedToRetrieveData: The source could not be read, or no answer came in time. The other values are not valid.
- AppStoreSource: A known source, or
Unknown. See the table below. - AppStoreSourceIdentifier: A short name such as
appstoreortestflight. For an alternative marketplace it is the bundle identifier of the marketplace app. A bundle identifier is the id of an app, such ascom.company.app. Useful when the source isUnknown.
Known sources
These sources are recognized. Anything else is Unknown.
| Source | Identifier | What it is |
|---|---|---|
| App Store | appstore |
Apple's App Store |
| TestFlight | testflight |
Apple's beta testing service |
| AltStore PAL | io.altstore.AltStore |
Alternative marketplace (EU) |
| Aptoide | com.aptoide.ios.store |
Alternative marketplace (EU) |
| Epic Games Store | com.epicgames.store or com.epicgames.egs |
Alternative marketplace (EU) |
| Web | web |
Installed from the developer's website (EU, iOS 17.5 and newer) |
| Enterprise | enterprise |
Signed for use inside one company |
| Ad Hoc | adhoc |
Signed for a fixed list of test devices |
| Xcode | xcode |
A development build, installed from Xcode or a sideloading tool |
| Simulator | simulator |
Running in the iOS Simulator |
| Other | other |
A channel the system reports that is none of the above |
| Unknown | unknown or a bundle identifier |
None of the sources above, for example a marketplace that is not in the list |
What each iOS version reports
A Simulator build always reports Simulator. On a device:
- iOS 13.0 and newer:
AppStore,TestFlight,Enterprise,AdHoc, andXcode. An install from an alternative marketplace or a website is reported asUnknownorAppStore. - iOS 17.4 and newer: Also alternative marketplaces. A website install is reported as
Other. - iOS 17.5 and newer: Also
Web.
Settings
The monitor has one field in the Inspector:
- Is Active (
isActive, bool, default true): Turns the monitor on or off.
The allowed sources are set in the project settings. The detector uses that list. Open Edit > Project Settings > GuardingPearSoftware > AntiCheat, select the iOS tab and go to iOS - App Store - Settings.
- Allow all installation sources: Off by default.
- Allow following sources: The sources you trust. App Store, TestFlight, Xcode, and Simulator are allowed by default.
- Allow custom sources: Bundle identifiers of marketplaces that are not in the list above.
Good to know
- Not in the Editor: The monitor only reads the source on an iOS device or in the Simulator. 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.
- While you test: A build started from Xcode reports
Xcode. A Simulator run reportsSimulator.
Platforms and requirements
iOS only. iOS 13.0 or newer.
The iOS plugin com.gups.anticheat ships with the package in Assets/GUPS/AntiCheat/Plugins/iOS/.
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.IOS;
using UnityEngine;
public class IOSSourceStatusLogger : MonoBehaviour, IObserver<IWatchedSubject>
{
private void Start()
{
var monitor = GetComponentInChildren<IOSPackageSourceMonitor>();
monitor.Subscribe(this);
}
public void OnNext(IWatchedSubject subject)
{
if (subject is IOSSourceStatus status)
{
if (status.FailedToRetrieveData)
{
Debug.LogWarning("Could not resolve the installation source.");
return;
}
Debug.Log($"Installed from: {status.AppStoreSource} ({status.AppStoreSourceIdentifier})");
}
}
public void OnError(Exception error) { }
public void OnCompleted() { }
}
Detect a source you do not allow
To decide if the source is allowed, use the install source detector.
Back to the Monitor overview.