EditorGUILayout.LabelField("Centralized configuration for global AntiCheat-Settings. The settings apply at runtime and in the editor.",EditorStyles.wordWrappedLabel);
EditorGUILayout.LabelField(newGUIContent("PlayerPrefs - Settings","In this section you can configure the security settings for your player preferences (PlayerPrefs)."),EditorStyles.boldLabel);
EditorGUILayout.Space(5);
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("PlayerPreferences_Hash_Key"),newGUIContent("Hash Key","Check to hash the player preference key (default or file based). Uncheck to not hash the player preference key. When enabled, the key is stored as a hash name instead of its original name. Recommended: true."));
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("PlayerPreferences_Value_Encryption_Key"),newGUIContent("Value Encryption Key","The key used to encrypt the player preference value (default or file based). If a key is not assigned (empty or null), the value will remain unencrypted. If you change the key, the already written values will not be readable anymore, keep that in mind! Recommended"));
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("PlayerPreferences_Allow_Read_Any_Owner"),newGUIContent("Allow Read Any Owner","Check to permit anybody to read the stored player preference (default or file based). So player can share their player preference. Uncheck to only allow the owner (device based) who created the player preference to access it. By default, the owner is identified using the device's unique identifier from Unity, accessed via UnityEngine.SystemInfo.deviceUniqueIdentifier. This feature is useful for sharing player preferences between different users or restricting access to them. For example if a user copy and paste it between devices. Recommended: Optional."));
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("PlayerPreferences_Verify_Integrity"),newGUIContent("Verify Integrity","Check to enable verification of the integrity of the player preferences (default or file based). Uncheck to not verify integrity. The integrity check relies on a hash that is calculated from the data type, value, and owner, and is stored in a signature beside the data. Recommended: Optional."));
}
/// <summary>
/// Display the general settings for the AntiCheat.
/// </summary>
/// <param name="_GlobalSettingsObject">The serialized object of the global settings.</param>
EditorGUILayout.LabelField(newGUIContent("Android - Settings","In this section you can configure the security settings for the Android build target."),EditorStyles.boldLabel);
EditorGUILayout.Space(5);
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_Enable_Development"),newGUIContent("Verify development builds","Check to validate (Appstore, Libraries, Applications, Signature, ...) the android app on development builds too. Uncheck to not validate the android app on development builds. Recommended: false."));
}
/// <summary>
/// Display the app store settings for the AntiCheat.
/// </summary>
/// <param name="_GlobalSettingsObject">The serialized object of the global settings.</param>
EditorGUILayout.LabelField(newGUIContent("Android - App Store - Settings","In this subsection you can configure the app installation sources."),EditorStyles.boldLabel);
EditorGUILayout.Space(5);
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_AllowAllAppStores"),newGUIContent("Allow all installation sources","Check to allow all package installation sources for your app. Uncheck to allow only the package installation sources in the list of allowed app stores."));
EditorGUILayout.LabelField(newGUIContent("Allow following sources:","A list of allowed package installation sources for the application. If the app is installed from a source not in the list, you will get a notification. You can react to those notifications and decide what you want to do from there."));
// Darken the background color for the app stores.
if(EditorGUILayout.Toggle(newGUIContent("Android Package Installer","Package Installer (com.android.packageinstaller or com.google.android.packageinstaller). The installation of apps outside of stores is done by a system app that is integrated into every Android device. This system app, known as the package installer, is responsible for installing applications that originate from apk files downloaded from various locations."),var_CheckedAppStores.Contains(EAppStore.AndroidPackageInstaller)))
if(EditorGUILayout.Toggle(newGUIContent("Amazon Appstore","Amazon's digital application distribution platform (com.amazon.venezia)."),var_CheckedAppStores.Contains(EAppStore.AmazonAppstore)))
if(EditorGUILayout.Toggle(newGUIContent("F-Droid","An open-source software repository for Android (org.fdroid.fdroid)."),var_CheckedAppStores.Contains(EAppStore.FDroid)))
{
var_NewCheckedAppStores.Add(EAppStore.FDroid);
}
// GooglePlayStore
if(EditorGUILayout.Toggle(newGUIContent("Google Play Store","Google's official app store (com.android.vending)."),var_CheckedAppStores.Contains(EAppStore.GooglePlayStore)))
if(EditorGUILayout.Toggle(newGUIContent("Huawei AppGallery","Huawei's official app distribution platform (com.huawei.appmarket)."),var_CheckedAppStores.Contains(EAppStore.HuaweiAppGallery)))
if(EditorGUILayout.Toggle(newGUIContent("Myket","A popular Android app store (ir.mservices.market)."),var_CheckedAppStores.Contains(EAppStore.Myket)))
{
var_NewCheckedAppStores.Add(EAppStore.Myket);
}
// OppoAppMarket
if(EditorGUILayout.Toggle(newGUIContent("Oppo App Market","Oppo's official app store (com.oppo.market)."),var_CheckedAppStores.Contains(EAppStore.OppoAppMarket)))
if(EditorGUILayout.Toggle(newGUIContent("Samsung Galaxy Store","Samsung's official app store (com.sec.android.app.samsungapps)."),var_CheckedAppStores.Contains(EAppStore.SamsungGalaxyStore)))
if(EditorGUILayout.Toggle(newGUIContent("TapTap","A Chinese app store for mobile games (com.taptap)."),var_CheckedAppStores.Contains(EAppStore.TapTap)))
{
var_NewCheckedAppStores.Add(EAppStore.TapTap);
}
// VivoAppStore
if(EditorGUILayout.Toggle(newGUIContent("Vivo App Store","Vivo's official app distribution platform (com.bbk.appstore)."),var_CheckedAppStores.Contains(EAppStore.VivoAppStore)))
if(EditorGUILayout.Toggle(newGUIContent("Xiaomi Mi GetApps","Xiaomi's official app store (com.xiaomi.market)."),var_CheckedAppStores.Contains(EAppStore.XiaomiMiGetApps)))
if(EditorGUILayout.Toggle(newGUIContent("XDA Labs","A platform for mobile development projects (com.xda.labs.play)."),var_CheckedAppStores.Contains(EAppStore.XDALabs)))
if(EditorGUILayout.Toggle(newGUIContent("Meta Horizon Store","A platform for virtual reality applications and games (com.oculus.*)."),var_CheckedAppStores.Contains(EAppStore.MetaHorizonStore)))
if(EditorGUILayout.Toggle(newGUIContent("Unknown","Unknown installation source. If it is neither of the above sources."),var_CheckedAppStores.Contains(EAppStore.Unknown)))
// Display the custom package installation sources.
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_AllowedCustomAppStores"),newGUIContent("Allow custom sources","A list of allowed custom package installation sources for the application, if the store you wish to allow installation from is not in the list of allowed app stores. Enter here the package names. \n\nFor example for GooglePlayStore it is com.android.vending."));
}
}
/// <summary>
/// Display the app hash settings for the AntiCheat.
/// </summary>
/// <param name="_GlobalSettingsObject">The serialized object of the global settings.</param>
EditorGUILayout.LabelField(newGUIContent("Android - App Hash - Settings","In this subsection you can configure the validation of the app hash."),EditorStyles.boldLabel);
EditorGUILayout.Space(5);
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_VerifyAppHash"),newGUIContent("Verify app hash","Check to verify the hash of the app with a remote source. Uncheck to not verify the app hash. After you have built your app, AntiCheat calculates the hash of the enite app (apk / aab) and displays it in the log. Store this hash somewhere on a server in the web, but accessible to your app. When the app starts, it can download the hash from the server and compares it with the hash of the app. If the hashes do not match, the app is not the original app and you can react."));
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_AppHashAlgorithm"),newGUIContent("Used hash algorithm","The algorithm used to generate and validate the app hash. Recommend: SHA-256."));
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_AppHashEndpoint"),newGUIContent("Remote hash location","The server get endpoint to read the app hash from. The server should return the hash of the whole app (apk / aab) as string to verify the app's identity and ensure that it is not tampered with or shipped through an unauthorized source. The path can contain a placeholder '{version}' which will be replaced with the Application.version.\n\nFor example: https://yourserver.com/yourapp/hash/{version} or https://yourserver.com/yourapp/hash?version={version}.\n\nApplication.version returns the current version of the Application. To set the version number in Unity, go to Edit>Project Settings>Player. This is the same as PlayerSettings.bundleVersion."));
}
}
/// <summary>
/// Display the app fingerprint settings for the AntiCheat.
/// </summary>
/// <param name="_GlobalSettingsObject">The serialized object of the global settings.</param>
EditorGUILayout.LabelField(newGUIContent("Android - App Fingerprint - Settings","In this subsection you can configure the validation of the app fingerprint or signature."),EditorStyles.boldLabel);
EditorGUILayout.Space(5);
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_VerifyAppFingerprint"),newGUIContent("Verify app fingerprint","Check to verify the app fingerprint. Uncheck to not check the app fingerprint. The fingerprint or signature of the app is a unique identifier. It is used to verify the app's identity and ensure that it is not tampered with. \n\nYou can get the fingerprint directly from the app or you can use for example the following command on your keystore to get the fingerprint: keytool -list -v -keystore yourapp.keystore -alias youralias."));
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_AppFingerprintAlgorithm"),newGUIContent("Used hash algorithm","The algorithm used to generate and validate the app fingerprint. Recommend: SHA-256."));
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_AppFingerprint"),newGUIContent("Fingerprint","The actual app fingerprint used to verify the app's identity and ensure that it is not tampered with or shipped through an unauthorized source. Enter as hex-string."));
}
}
/// <summary>
/// Display the app library settings for the AntiCheat.
/// </summary>
/// <param name="_GlobalSettingsObject">The serialized object of the global settings.</param>
EditorGUILayout.LabelField(newGUIContent("Android - App Library - Settings","In this subsection you can configure the validation of the app libraries."),EditorStyles.boldLabel);
EditorGUILayout.Space(5);
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_UseWhitelistingForLibraries"),newGUIContent("White-/Blacklist libraries","Check to use whitelisting and blacklisting for libraries. Uncheck to allow all libraries to be used in the app."));
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_WhitelistedLibraries"),newGUIContent("Whitelisted libraries","A list of whitelisted libraries that are allowed to be used in the application. If the application uses a library that is not in the list, you will get a notification. You can react to those notifications and decide what you want to do from there. A very common modding process is to add libraries to the application, which contain cheats."));
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_BlacklistedLibraries"),newGUIContent("Blacklisted libraries","A list of blacklisted libraries that are not allowed to be used in the application. If the application uses a library that is in the list, you will get a notification. You can react to those notifications and decide what you want to do from there. A very common modding process is to add libraries to the application, which contain cheats."));
}
}
/// <summary>
/// Display the device app settings for the AntiCheat.
/// </summary>
/// <param name="_GlobalSettingsObject">The serialized object of the global settings.</param>
EditorGUILayout.LabelField(newGUIContent("Android - Device App - Settings","In this subsection you can configure the validation of apps on the device."),EditorStyles.boldLabel);
EditorGUILayout.Space(5);
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_UseBlacklistingforApplication"),newGUIContent("Blacklist device apps","Check to use blacklisting for apps on the device. Uncheck to allow all apps to be used on the device. If the user as an app on their device that is blacklisted, you will get a notification. You can react to those notifications and decide what you want to do from there."));
EditorGUILayout.PropertyField(_GlobalSettingsObject.FindProperty("Android_BlacklistedApplications"),newGUIContent("Blacklisted apps","A list of blacklisted applications that are not allowed to be used on the device. If the user as an app on their device that is blacklisted, you will get a notification. You can react to those notifications and decide what you want to do from there."));