API Reference
Complete reference for all public classes and methods in OZeroSecurity SDK. All classes live in the OZeroSDK.Security namespace unless otherwise noted.
OZeroSecurityManager OZeroSDK.Security
The central singleton that manages all active security modules. Survives scene transitions via DontDestroyOnLoad. Access it through the static Instance property. Created automatically by OZeroBootstrapper at one of three [RuntimeInitializeOnLoadMethod] hooks before the first scene loads — do not instantiate it manually.
Properties
| Name | Type | Description |
|---|---|---|
| Instance | OZeroSecurityManager | Static singleton accessor. Returns the active instance. |
Methods
Registers a callback so your project can react to security events. OZero's built-in response still runs separately, so registering or removing this callback does not turn protection off. The callback receives an OZeroSecurityEvent with the detected area, public abort code, message key, diagnostic message, and whether the app is scheduled to close.
Removes a previously registered user callback. Always call this in OnDisable or OnDestroy to prevent memory leaks.
Registers a callback for server-issued policy actions delivered by the Pro device policy heartbeat. Use this for portal policies such as Callback responses. It is separate from local security detection callbacks.
Removes a previously registered policy action callback. Register in OnEnable and unregister in OnDisable when using a scene object.
Registers a callback for user-facing activation or DRM state changes. With OZero-managed Steam DRM and the default Managed Verification UI, the SDK already shows the online-required, retry, timeout, and blocked states; register this only for custom UI, telemetry, or a game-specific session gate.
Removes a previously registered activation state callback. Register in OnEnable and unregister in OnDisable when using a scene object.
Registers a callback for the shared OZero Managed Verification state used by Pro Build Integrity and Steam DRM. The default SDK UI handles these states automatically when enabled; use this callback only for custom UI, custom telemetry, or game-specific session gates.
Removes a previously registered managed verification state callback. Register in OnEnable and unregister in OnDisable when using a scene object.
Replaces individual built-in verification UI strings at runtime. Use JSON files under Assets/OZeroSDK/Resources/OZeroLocalization for normal localization, and use this provider only when text must be supplied dynamically.
Removes a previously registered managed verification text provider.
Retries SDK-managed Build Integrity attestation after an online-required or retry-timeout state. The default Managed Verification UI calls this automatically. If your own game server validates OZA tokens, retry your own login or session-refresh request instead.
Retries OZero-server-managed Steam Activation / DRM verification. The default Managed Verification UI calls the matching retry flow for you. Call this from game code only when you intentionally replace the default UI; if your own game server performs Steam verification, retry your own login or session request instead.
Delegate
The callback signature used by RegisterUserCallback. Use evt.Type, evt.AbortCodeHex, evt.MessageKey, evt.Message, and evt.WillAbort when you need a warning UI, your own server log, or a short save step. If evt.WillAbort is true, keep the work brief because the app is already scheduled to close.
Example
using OZeroSDK.Security;
using UnityEngine;
public class MySecurityListener : MonoBehaviour
{
void OnEnable()
=> OZeroSecurityManager.Instance.RegisterUserCallback(OnThreat);
void OnDisable()
=> OZeroSecurityManager.Instance.UnregisterUserCallback(OnThreat);
void OnThreat(OZeroSecurityEvent evt)
=> Debug.Log(
$"Threat={evt.Type}, Code={evt.AbortCodeHex}, Message={evt.Message}");
}
OZeroSecurityEvent class
Customer-facing violation payload passed to RegisterUserCallback. It intentionally exposes stable, safe diagnostics rather than internal detection details.
| Name | Type | Description |
|---|---|---|
| Type | ModulationType | Security module that raised the violation. |
| AbortCode | OZeroAbortCode | Stable public abort code category. |
| AbortCodeValue | int | Numeric code value, useful for server logs. |
| AbortCodeHex | string | Hex string such as 0x0C. |
| MessageKey | string | Stable English message key for localization and analytics grouping. |
| Message | string | Safe customer-facing English diagnostic message. |
| WillAbort | bool | True when the current response policy will terminate the app after callbacks return or the grace timer expires. |
OZeroPolicyActionEvent class
Server policy callback payload passed to RegisterUserPolicyActionCallback. These events are issued by the customer portal policy system and delivered on the Unity main thread through the Pro device policy heartbeat.
| Name | Type | Description |
|---|---|---|
| Module | string | Policy module such as variant, injection, or physics. |
| ActionId | string | Unique delivery id. The SDK uses it to avoid duplicate dispatch and acknowledge delivery. |
| PolicyId | string | Customer portal policy id when available. |
| Reason | string | Reason configured by the policy or generated from the matched evidence. |
| Score | int | Risk score at the time the policy matched. |
| EventCount | int | Number of events that contributed to the policy match. |
| WindowMinutes | int | Policy evaluation window in minutes. |
| IssuedAtUnixMs | long | Server UTC epoch milliseconds when the action was issued. |
| ExpiresAtUnixMs | long | Server UTC epoch milliseconds when the pending action expires if it is not acknowledged. |
Policy callback example
Use this when a Customer Portal security policy is configured as Callback. The SDK delivers the policy action to the game, and your game decides how to notify, restrict, or move the user.
using OZeroSDK.Security;
using UnityEngine;
public sealed class OZeroPolicyListener : MonoBehaviour
{
private void OnEnable()
=> OZeroSecurityManager.Instance.RegisterUserPolicyActionCallback(OnPolicyAction);
private void OnDisable()
=> OZeroSecurityManager.Instance.UnregisterUserPolicyActionCallback(OnPolicyAction);
private void OnPolicyAction(OZeroPolicyActionEvent evt)
{
Debug.LogWarning($"Policy={evt.PolicyId}, Module={evt.Module}, Score={evt.Score}, Reason={evt.Reason}");
if (evt.Score >= 80)
{
ShowSecurityNotice(evt.Reason);
DisableRankedMatchmaking();
}
}
}
OZeroUserActivationStateEvent class
User-facing activation or DRM state payload passed to RegisterUserActivationStateCallback. Steam Activation / DRM uses it to tell the game whether cached offline play is still allowed or online revalidation is required.
| Name | Type | Description |
|---|---|---|
| Provider | string | Activation provider such as steam. |
| State | string | Stable state such as valid, revalidated, online_required, outage_fail_open, or rejected. |
| Reason | string | Reason code such as steam_activation_revalidate_unavailable or steam_activation_cache_expired. |
| Action | string | Portal policy action value associated with this state when available. |
| OfflineAllowed | bool | True when the current cached token or grace policy allows offline play. |
| OnlineRequired | bool | True when the game should ask the user to reconnect before allowing the protected session. |
| ExpiresAtUnixMs | long | UTC epoch milliseconds when the activation token expires. |
| GraceUntilUnixMs | long | UTC epoch milliseconds when the offline grace window ends. |
| OutageFailOpenUntilUnixMs | long | UTC epoch milliseconds for temporary server-outage fail-open handling. |
Activation state callback usage
For OZero-managed Steam DRM with the default Managed Verification UI, no activation callback code is required; the SDK shows online-required, retry, timeout, and blocked states for the player. Register this callback only when you intentionally replace the default UI, add your own session gate, or operate a customer game-server verification flow. Do not put Steam Web API keys or OZero server API keys in the client.
OZeroUserManagedVerificationStateEvent class
User-facing managed verification payload passed to RegisterUserManagedVerificationStateCallback. Build Integrity and Steam DRM both use this event, but the default Managed Verification UI consumes it automatically. Handle it in game code only for custom UI, custom telemetry, or a game-specific session gate.
| Name | Type | Description |
|---|---|---|
| Provider | OZeroManagedVerificationProvider | Source module: BuildIntegrity or SteamDrm. |
| State | OZeroUserManagedVerificationState | Current state such as Checking, Allowed, Warning, OnlineRequired, RetryTimedOut, Blocked, or StandardFallback. |
| Reason | string | Stable reason code suitable for custom UI text, analytics, or customer support logs. |
| Verdict | string | Server verdict when available, such as allow, warn, block, or fallback. |
| CanRetry | bool | True when a Retry action is meaningful for the current provider and state. |
| TimestampUnixMs | long | UTC epoch milliseconds when the state was raised. |
Managed verification callback usage
When managedVerificationUiPolicy uses an OZero built-in dialog, the SDK already handles Build Integrity and Steam DRM managed-verification UI, retry, and timeout states. Register RegisterUserManagedVerificationStateCallback only for Custom UI / Callback Only, additional telemetry, or a game-specific session gate. In custom UI mode, call the retry method that matches Provider; in customer game-server mode, retry your own login or session request instead.
OZeroManagedVerificationUiPolicy enum
Controls how the SDK presents managed verification states from Build Integrity and Steam DRM to the player. Both built-in policies require TextMeshPro, TMP Essential Resources, and the optional OZero Built-In TMP Dialog package. Build preflight stops the player build when a built-in policy is selected without those prerequisites; use Window > OZero Security > Check Setup and its Import Package action to fix the project.
| Value | Description |
|---|---|
| CustomCallbackOnly | The SDK raises RegisterUserManagedVerificationStateCallback states only. Use this when the game implements its own UI, retry buttons, timeout handling, and session gate. |
| BuiltInBlockingDialog | Uses the OZero built-in blocking dialog. This is the recommended default for release builds that should pause or block the protected session while online revalidation is required. |
| BuiltInNonBlockingDialog | Uses the OZero built-in non-blocking notice. Use this only when gameplay can continue safely while the player is guided through retry or warning states. |
OZeroManagedVerificationTimeoutAction enum
Controls what the built-in managed verification UI does when online-required or retry states are not resolved within the configured timeout.
| Value | Description |
|---|---|
| KeepDialog | Keeps the dialog visible after timeout. Choose this only when the game wants the player to keep retrying manually. |
| BlockSession | Blocks the protected session after timeout. This is the recommended default when online verification is mandatory but the application should remain open. |
| AbortApplication | Terminates the application after timeout. Use only when your release policy requires immediate exit on unresolved verification. |
| InvokeCallbackOnly | Raises callbacks without built-in blocking or exit behavior. Use this for fully custom session control. |
ModulationType enum
Identifies which security module raised an alert. Available as OZeroSecurityEvent.Type.
| Value | When fired |
|---|---|
| MemoryModulation | A Secure Type variable is accessed in a suspicious way |
| SpeedHack | Speed hack or time manipulation detected |
| TimeHack | System clock anomaly detected (backward jump, NTP mismatch) |
| Injection | Memory injection tool (e.g. Frida) or illegal DLL detected |
| PhysicsHack | Impossible position delta detected (fired by OZeroPhysicsHackDetector — attach to individual player objects; not auto-spawned by Bootstrapper) |
| DeviceBindingModulation | Save data loaded on a device that doesn't match the binding |
| InstallSource | App was not installed from an authorized store |
| BuildIntegrity | Assembly hash mismatch, debugger attached, or platform check failed |
| EnvironmentModulation | Emulator or non-standard runtime environment detected |
| SteamAntiPiracy | Steam ownership or ticket validation failed. |
OZeroBootstrapper OZeroSDK.Security
Zero-wiring auto-bootstrap entry point. You do not call anything on this class directly. It connects the SDK to Unity startup, loads the verified security configuration, and prepares enabled detectors automatically before gameplay starts. Native runtime protection is also initialized here when available.
OZeroSecurityConfig asset.
OZeroSecurityConfigRuntime OZeroSDK.Security
Runtime loader for the protected build-time security configuration. It validates the packaged configuration, prepares an in-memory OZeroSecurityConfig snapshot, and applies the configured threat-response policy if validation fails.
Properties
| Name | Type | Description |
|---|---|---|
| Current | OZeroSecurityConfig | The blob-hydrated config snapshot. Calls EnsureLoaded() on first access. In player builds, OZeroSecurityConfig.Instance proxies through this property. |
Methods
Idempotent loader — safe to call repeatedly. First access validates and loads the packaged configuration; later calls reuse the same snapshot. Failure handling follows the configured global threat-response policy.
OZeroSecurityConfig and the Unity editor window as the supported integration surface.
OZero Secure Variables OZeroSDK.Security
Encrypted drop-in replacements for primitive types. Values are stored exclusively in the Native C++ heap and encrypted with OZero proprietary cipher. A per-frame per-frame masking layer is applied on top, so memory scanners see only noise. All arithmetic operators and implicit conversions are supported — existing code requires only a type name change.
Available types
| Class | Replaces |
|---|---|
| OZeroSV_Int | int |
| OZeroSV_Int64 | long |
| OZeroSV_UInt | uint |
| OZeroSV_UInt64 | ulong |
| OZeroSV_Short | short |
| OZeroSV_UShort | ushort |
| OZeroSV_Byte | byte |
| OZeroSV_Float | float |
| OZeroSV_Double | double |
| OZeroSV_Decimal | decimal |
| OZeroSV_Bool | bool |
| OZeroSV_String | string |
| OZeroSV_Vector2 | Vector2 |
| OZeroSV_Vector3 | Vector3 |
| OZeroSV_Buffer | byte[] |
Supported operators
Numeric types (Int, Int64, UInt, UInt64, Short, UShort, Byte, Float, Double, Decimal) support all arithmetic (+ - * / %), comparison (== != < > <= >=), compound assignment (+= -= *= /=), and increment/decrement (++ --) operators, plus implicit conversions to/from their primitive equivalent. Vector2 and Vector3 support arithmetic and equality operators. Bool supports equality operators only. String supports ==, !=, and +. Buffer provides raw byte-array access with index operators.
stackalloc and native atomic counters, making them safe to use even in hot paths called thousands of times per frame.
OZeroSafePlayerPrefs OZeroSDK.Security
An encrypted drop-in replacement for Unity's PlayerPrefs. Key names are hashed with message authentication and values are encrypted with OZero proprietary cipher using a device-bound encryption key. The stored data cannot be read by browsing the device's registry (Windows) or preference plist (iOS).
Methods
The common PlayerPrefs-style methods are available, plus Int64, Double, Bool, and IncrementInt helpers. Existing plain PlayerPrefs values are not migrated automatically; start using OZeroSafePlayerPrefs for keys you want protected going forward.
OZeroSafePlayerPrefs is not compatible with standard PlayerPrefs. If you switch between the two, existing data will not be readable by the other.
OZeroSV_File OZeroSDK.Security
Encrypts and decrypts files with built-in integrity verification. Keys live at the app level (not device-bound), making the format compatible with Steam Cloud Save. On read, the integrity check runs before the data is returned; tampering causes an exception rather than silently returning corrupted data.
OZeroSV_File API.
Methods
Encrypts contents and stores it at path. Parent folders are not created automatically, so call Directory.CreateDirectory first when needed.
Reads the file at path, verifies its integrity, and returns the decrypted string. Throws InvalidDataException if the file has been tampered with.
Encrypts a raw byte array and writes it to path.
Reads and decrypts a file written by WriteAllBytes. Verifies the integrity tag before returning.
Decrypts an encrypted byte buffer already loaded from another source, such as a remote download or custom storage backend. Use this when you cannot pass a filesystem path to ReadAllText.
Example
using OZeroSDK.Security;
string path = Application.persistentDataPath + "/save.json";
string json = JsonUtility.ToJson(saveData);
// Write (encrypts automatically)
OZeroSV_File.WriteAllText(path, json);
// Read (decrypts + integrity check)
try
{
string loaded = OZeroSV_File.ReadAllText(path);
saveData = JsonUtility.FromJson<SaveData>(loaded);
}
catch (System.IO.InvalidDataException)
{
// File was tampered — handle accordingly
Debug.LogError("Save file integrity check failed.");
}
OZeroBuildIntegrityValidator OZeroSDK.Security
Runtime validator for build tampering, debugger/timing anomalies, platform-native integrity checks, and optional Pro server attestation. The component is created automatically by OZeroBootstrapper when Build Integrity is enabled in OZeroSecurityConfig.
What it checks
| Check | Description |
|---|---|
| Assembly / Manifest | Verifies the generated integrity manifest and managed assembly state on supported build targets. |
| Debugger / Timing | Detects attached debuggers, abnormal timing gaps, and breakpoint-like pauses while suppressing common focus-loss false positives. |
| Platform Native | Runs platform-specific integrity checks such as Android package/signature checks, iOS jailbreak checks, and desktop runtime checks when enabled. |
| Pro Attestation | When Pro server attestation is enabled, requests a server-issued attestation token after local checks pass. |
Public properties
| Name | Type | Description |
|---|---|---|
| Instance | OZeroBuildIntegrityValidator | Current validator instance, if the module has been created. |
| LastValidationResult | bool? | Most recent local validation result. null before the first validation run. |
| IsValidating | bool | True while a validation run is in progress. |
| IsIntegrityVerified | bool | True after the latest enabled local checks pass. |
| AttestationToken | OZeroBuildAttestationToken | Most recent Pro attestation token. Null until server attestation succeeds or fails. |
Events and methods
Invoked when all enabled local checks pass.
Invoked when an enabled local check or Pro attestation rejects the build.
Invoked after Pro server attestation succeeds and AttestationToken contains a valid token.
Starts a manual validation run. Normal projects usually rely on the dashboard's startup and periodic validation settings instead.
OZeroBuildAttestationToken
Pro attestation result returned through AttestationToken. Send AttestToken to your game server and call IsValid(nowMillis) before using it for login, PvP, ranking, or currency flows.
Returns true after the server-issued expiry time.
Returns true when the token was issued successfully and has not expired.
OZeroSpeedHackDetector OZeroSDK.Security
Detects speed hacks and time manipulation using five independent detection signals. A threat is reported only when signals confirm each other, reducing false positives.
Detection signals
| Signal | Description |
|---|---|
| TimeScale | Monitors Unity's Time.timeScale for unauthorized changes |
| API Clock | Compares OS time API against native background timer |
| Thread Drift | Measures drift between Unity runtime timing and an independent native timing source |
| Time Backward | Detects backward jumps in system time |
| NTP | Optional — cross-checks with an NTP server for absolute time verification (requires network) |
Detection fires via OZeroSecurityManager callbacks with ModulationType.SpeedHack or ModulationType.TimeHack. Configured in OZeroSecurityConfig.
OZeroWatchdog OZeroSDK.Security
Public helper for trusted long-running loading work. It temporarily defers the native Watchdog heartbeat deadline around synchronous work that can legitimately block Unity's main thread longer than the release deadline.
Methods
Starts a bounded loading grace scope. Call End() or dispose the returned scope as soon as trusted loading work finishes. Nested scopes are supported; normal Watchdog timing resumes when the last scope ends.
Ends this loading grace scope manually. Dispose() calls the same logic, so using blocks and explicit End() are equivalent.
Convenience wrapper for synchronous loading work. It creates a loading grace scope, runs work, and ends the scope in a finally-safe using block.
Example
using OZeroSDK.Security;
using UnityEngine.SceneManagement;
public void LoadLargeScene()
{
using (OZeroWatchdog.BeginLoadingGrace(60000))
{
SceneManager.LoadScene("Battle", LoadSceneMode.Single);
}
}
OZeroInjectionDetector OZeroSDK.Security
Observes abnormal runtime module, hook, debugger, and trusted-module policy signals. Periodic checks use jittered scheduling where applicable to reduce predictable scan timing.
What it detects
| Runtime module | Unexpected module or hook-related runtime signal |
| Debugger | Debugger or tracer attachment signal |
| Memory map | Suspicious runtime memory or module layout signal |
| Illegal DLL | Unauthorized managed assemblies loaded into the process (Windows/Unity Editor) |
Detection fires via OZeroSecurityManager callbacks with ModulationType.Injection.
OZeroSteamAntiPiracy OZeroSDK.Security
Runtime controls for Steam Anti-Piracy. Most projects configure Steam protection in the Config Dashboard, but games that expose their own policy UI can temporarily override the local detection action through this static API.
OZeroSteamDetectionAction
| Value | Description |
|---|---|
| Off | Do not apply local Steam anti-piracy response. Use only for controlled troubleshooting. |
| Observe | Record diagnostics and allow the game to continue. |
| Callback | Raise OZeroSecurityManager callbacks so the game can show UI, log, or handle the event. |
| Block | Treat the violation as blocking. The global threat response settings decide whether the app exits. |
Methods
Overrides the local Steam Anti-Piracy detection action at runtime. This is useful when your game offers a QA/admin switch or when you need to temporarily move Steam protection to observe mode while investigating a customer environment.
Clears the runtime override and returns to the action configured in OZeroSecurityConfig or the current Pro server policy.
Example
using OZeroSDK.Security;
// QA session: observe Steam violations without blocking gameplay.
OZeroSteamAntiPiracy.SetDetectionActionOverride(
OZeroSteamDetectionAction.Observe);
// Restore the dashboard/server policy.
OZeroSteamAntiPiracy.ClearDetectionActionOverride();
Last result
Returns the most recent Steam validation snapshot, including reported AppID, BuildID, SteamID, server verification state, soft-signal details, and native score fields. Read this for debug UI or QA reports; do not use it as the only gameplay authorization gate.
OZeroInstallSourceValidator OZeroSDK.Security
Android install-source validator. The component is created automatically when Install Source is enabled. Customer code usually reads the last result for support UI, diagnostics, or store-specific flows.
Methods and event
Raised after the install source is resolved.
Returns the cached result from the most recent check.
Forces initialization if needed, then returns the Android installation source result.
InstallSourceResult
| DetectedSource | Resolved source as an AndroidInstallSource enum value. |
| RawInstallerPackage | Raw Android installer package name returned by PackageManager. |
| IsAuthorized | True when the local config and, if enabled, Pro server policy allow this install source. |
| ServerVerified | Pro only. True when the server verification call completed. |
| ServerAuthorized | Pro only. Server-side authorization decision when ServerVerified is true. |
AndroidInstallSource
Exact enum values returned by InstallSourceResult.DetectedSource. Store names in the manual are friendly labels; code should compare against these enum names.
| Value | Description |
|---|---|
| GooglePlayStore | Installed from Google Play Store. |
| SamsungGalaxyStore | Installed from Samsung Galaxy Store. |
| AmazonAppstore | Installed from Amazon Appstore. |
| HuaweiAppGallery | Installed from Huawei AppGallery. |
| OneStore | Installed from ONE Store. |
| XiaomiGetApps | Installed from Xiaomi GetApps. |
| OppoAppMarket | Installed from OPPO App Market. |
| VivoAppStore | Installed from Vivo App Store. |
| Custom | Raw installer package matched customAuthorizedPackages. |
| ADB | Android returned an empty installer package, usually from ADB or sideload-style installation. |
| DetectionFailed | The installer query itself failed because JNI or the platform API was unavailable. This is different from ADB. |
| Unknown | Android returned a package name that is neither built-in nor custom-authorized. |
| Editor | Returned while running inside the Unity Editor. |
| NotApplicable | Returned on platforms where Android installer source does not apply. |
OZeroDeviceBindingDetector OZeroSDK.Security
Helper API for device-bound save slots and support reset flows. The detector starts automatically when Device Binding is enabled. Call these token methods only when your game wants to bind a cloud save, account save slot, or similar data to the current device.
Methods
Prepares the local device fingerprint, then registers or validates it. In normal projects this is called automatically during SDK startup.
Creates a token that links a save-slot key to the current device. Store the token with your save metadata or server record, not inside a player-editable save body.
Checks whether the stored save-slot token matches the current device. If it does not match, the SDK raises the configured Device Binding violation response.
Debug/demo helper that returns the current device fingerprint hash. Do not show, upload, or store this value from production gameplay code.
Clears the fingerprint stored on this device. In non-Editor builds, pass a server-issued Reset Token and use it only for legitimate support reset flows.
Example
using OZeroSDK.Security;
var detector = OZeroDeviceBindingDetector.Instance;
string slotKey = "account:1234:slot:main";
string token = detector.BindToSaveSlot(slotKey);
// Store token next to your save metadata.
bool ok = detector.ValidateSaveSlot(slotKey, token);
OZeroSecurityConfig ScriptableObject
A ScriptableObject asset that stores global security settings. Author it in the Editor, then let the build pipeline package a protected runtime configuration for player builds. Access the effective settings through OZeroSecurityConfig.Instance.
Fields
Fields are grouped into nested settings classes such as Response and Integrity. This table lists the fields most often used from code or changed during integration; the full Inspector table is in the manual. Defaults below mean the serialized asset default. If release builds force a different runtime value, the row marks it with *.
| Field | Type | Default | Description |
|---|---|---|---|
| — Top-level — | |||
| developerSecret | string | "" | Project-specific secret used to protect OZeroSV_File and OZeroSafePlayerPrefs data. Generate it with Generate Secure Secret in the Config Dashboard before the first release, and do not change it after launch. If it changes, existing protected data cannot be decrypted by newer builds. |
| enableLog | bool | true | Enable debug logs from the SDK (always stripped from release builds via OZeroSecLog). |
| enableFailureDiagnostics | bool | false | Write local security failure diagnostic files to Application.persistentDataPath. Enable only for QA or customer-support investigation, then turn it off again. |
| — Response — | |||
| response.forceQuitOnDetection | bool | true | Decides whether the app should close automatically when a threat is confirmed. During QA you can turn this off and observe events only, but choose a clear policy for release builds. |
| response.fatalCallbackGraceSeconds | float | 10 | Maximum seconds allowed for your security callback UI to notify the player before the SDK exits automatically. Set to 0 only when immediate exit is intended. |
| — Managed Verification UI — | |||
| managedVerificationUiPolicy (Pro) | OZeroManagedVerificationUiPolicy | BuiltInBlockingDialog | Chooses the user-facing flow for OZero Managed Build Integrity and Steam DRM states. Built-in modes let the SDK handle nonce/attest, managed session verification, online-required notices, retry, and timeout UI. Use Custom UI / Callback Only only when replacing the SDK dialog. |
| managedVerificationDialogPrefabResourcePath (Pro) | string | "" | Optional Resources path for a copied/customized OZero Managed Verification UI prefab. Leave empty to use the SDK default prefab. |
| managedVerificationRetryTimeoutSeconds (Pro) | int | 15 | Maximum seconds to wait after the player presses Retry before reporting a retry timeout. |
| managedVerificationOnlineRequiredTimeoutSeconds (Pro) | int | 120 | Maximum seconds to keep the online-required state waiting before applying the configured timeout action. |
| managedVerificationTimeoutAction (Pro) | OZeroManagedVerificationTimeoutAction | BlockSession | Chooses whether a timeout keeps the dialog open, blocks the protected session, aborts the app, or only invokes callbacks. |
| autoRetryManagedVerificationWhenNetworkRestored (Pro) | bool | false | Automatically retries managed verification when network connectivity is restored. Enable only when the game can safely retry without an explicit player action. |
| managedVerificationLanguageCode (Pro) | string | auto | Language code for built-in UI strings. auto follows Application.systemLanguage. |
| managedVerificationFallbackLanguageCode (Pro) | string | en | Fallback language when the selected JSON resource is missing. Custom resources use ozero_ui_text_{code}.json. |
| — Integrity — | |||
| integrity.useIntegrity | bool | true | Master switch for the build integrity module. |
| integrity.validateOnStartup | bool | true | Run the full integrity check at Start(). |
| integrity.periodicCheckInterval | float | 300 | Seconds between recurring re-validation runs. Set ≤ 0 to disable periodic checks. |
| integrity.checkAssemblyHash | bool | true | SHA-256 / public-key-token verification of compiled assemblies against the OZeroAssemblyManifest. |
| integrity.checkDebugger | bool | true | Detect attached managed debuggers, Unity debug-build flags, and CPU timing anomalies. |
| integrity.checkPlatformNative | bool | true | Run platform-specific native checks (Root, Jailbreak, APK signature, Authenticode, etc.). |
| integrity.failIfManifestMissing | bool | false* | Treat a missing or unloadable assembly manifest as a violation. *Forced to true in non-development player builds regardless of the serialised value. |
| integrity.failIfAssemblyHashBlobMissing | bool | false* | Treat a missing generated assembly-hash blob as a violation. *Forced to true in non-development player builds. |
| integrity.requireManifestSignature | bool | false* | Require a valid signature on the assembly manifest. Generate keys from Window → OZero Security → Config & Dashboard with Generate Key Pair. *Forced to true in release player builds. |
| integrity.il2cppHashGlobalGameManagers | bool | false | Include globalgamemanagers in Windows IL2CPP file hashing. Standard and Strict presets turn this on. |
| integrity.il2cppHashSharedAssets | bool | false | Include sharedassets* files in Windows IL2CPP file hashing. Standard and Strict presets turn this on. |
| integrity.il2cppHashSceneFiles | bool | false | Include Unity scene files such as level* in Windows IL2CPP file hashing. Standard and Strict presets turn this on. |
| integrity.blockEmulator | bool | true | (Android) Treat emulator detection as an integrity violation. |
| integrity.checkIntegrityWithServer (Pro) | bool | false | Enables the Pro nonce -> attest flow. With OZero Managed and a built-in Managed Verification UI, the SDK submits build integrity evidence, requests the managed session verdict, and handles player-facing retry/timeout states without game code. |
| integrity.attestationVerificationMode (Pro) | enum | CustomerGameServer | Choose whether your game server validates the OZA token, or OZero Managed verification returns the verdict through the SDK-managed session flow. |
| integrity.attestationNetworkPolicy (Pro) | enum | BestEffort | Choose whether offline or failed revalidation can continue as local protection, or must surface an online-required retry state. Built-in Managed Verification UI modes show this state automatically. |
| — InstallSource (Android) — | |||
| installSource.useInstallSource | bool | true | Master switch for the install-source validator. |
| installSource.allowGooglePlayStore | bool | true | Allow installs from Google Play (toggle individual store flags for Galaxy Store, Amazon Appstore, AppGallery, OneStore, etc.). |
| installSource.enableServerSync (Pro) | bool | false | Calls /v1/install-source/verify after local detection so the Pro server can apply a managed allowlist and record audit data. |
| installSource.allowDetectionFailed | bool | false | Allows startup when the Android installer query itself fails. Keep disabled for release unless you have a tested device-specific reason. |
| installSource.allowUnknownSources | bool | false | Allows installer package names that are not built-in and not listed in customAuthorizedPackages. |
| — Steam Anti-Piracy — | |||
| steamAntiPiracy.useSteamAntiPiracy | bool | false | Master switch for Steam launch, entitlement, DLC, and release-hygiene checks. |
| steamAntiPiracy.detectionAction | OZeroSteamDetectionAction | Callback | Local response used when Steam validation fails. Pro policies may override this value. |
| steamAntiPiracy.checkSteamDrmWithServer (Pro) | bool | false | Enables server-backed Steam DRM verification. With OZero Managed and a built-in Managed Verification UI, the SDK handles Steam ticket submission, activation token cache, online-required UI, retry, and timeout states. |
| steamAntiPiracy.steamDrmVerificationMode (Pro) | enum | OZero Managed | Chooses OZero-managed verification or customer game-server verification. OZero Managed is the no-backend path when paired with the default Managed Verification UI. |
| steamAntiPiracy.steamDrmNetworkPolicy (Pro) | enum | Best Effort | Controls how the client behaves when required Steam DRM revalidation cannot reach the server. Built-in Managed Verification UI modes show the online-required and retry flow automatically. |
| — DeviceBinding — | |||
| deviceBinding.useDeviceBinding | bool | true | Turns on Device Binding validation during SDK startup. |
| deviceBinding.hardwareChangeTolerance | int (0–3) | 1 | How many fingerprint components may change while still treating the device as the same device. |
| deviceBinding.enableServerSync (Pro) | bool | false | Pro only. Registers and verifies the device fingerprint through /v1/device/register and /v1/device/verify. Network failures are fail-open, while explicit server rejections become Device Binding violations. |
| deviceBinding.maxDevices (Pro) | int | 0 | Reference value for how many devices may register for one license. The actual production limit comes from the server license record or customer portal policy. |
| — SpeedHack — | |||
| speedHack.useSpeedHack | bool | true | Master switch for the speed-hack detector. |
| speedHack.checkInterval | float | 1.0 | Polling interval in seconds (clamped to 0.05–5). |
| speedHack.requiredDetections | int | 3 | Consecutive suspicious samples required before firing a violation (clamped to 1–10). |
| speedHack.detectSlowHack | bool | false | Also detect slow-motion time manipulation. Disabled by default to reduce false positives in games with intentional slow-motion effects. |
| speedHack.useWebTimeValidation | bool | true | Enable HTTPS HEAD-based cross-validation of game time against external endpoints. |
| speedHack.webTimeUrls[] | string[] | [] | List of integrator-controlled HTTPS endpoints used for round-robin time cross-validation. Configure two or more entries you control; if the list is empty, web-time validation has no endpoint to use. |
| speedHack.minSuccessfulEndpoints | int | 2 | Minimum number of webTimeUrls endpoints that must return a valid Date header before one web-time round is trusted. |
| speedHack.maxConsecutiveFailures | int | 6 | Number of consecutive failed web-time rounds allowed before the onWebTimeUnavailable policy runs. |
| speedHack.onWebTimeUnavailable | WebTimeUnavailablePolicy | WarnOnly | Policy used when web/server time cannot be checked for several rounds. WarnOnly logs and continues, Strict raises a SpeedHack callback after repeated failure, and Silent should be reserved for special tests. |
| speedHack.enableRemoteSpeedHackConfig | bool | false | Pro server feature. When enabled, /v1/speedhack-config can override selected Speed & Time Hack thresholds without a client rebuild. Requires an active Pro license and server URL. |
| speedHack.remoteSpeedHackConfigInterval | float | 300 | Polling interval in seconds for /v1/speedhack-config. Set 0 to fetch once at boot only. |
| speedHack.remoteSpeedHackConfigJitterPercent | float | 20 | Percentage used to spread Pro remote-config refresh timing around the configured interval. Clamped from 0 to 75. |
| speedHack.enableSignedServerTime | bool | false | Pro server feature. Uses signed /v1/time as the preferred trusted time source when activation is available. Falls back to configured web-time endpoints after repeated failures. |
| — PhysicsHack — | |||
| physicsHack.useGlobalPhysicsHack | bool | true | Global on/off switch for all OZeroPhysicsHackDetector components. Per-object movement thresholds remain on each component in the Inspector. |
| physicsHack.enableServerTelemetry (Pro) | bool | false | Pro only and disabled by default. This explicit project opt-in controls both general security-event telemetry and the detailed PhysicsHack stream when the active license grants the capabilities. Turning it off stops new telemetry events; server policy cannot enable transmission without local consent. |
| physicsHack.telemetryThrottlePerMinute (Pro) | int | 30 | Maximum number of PhysicsHack telemetry events this client can send per minute. 0 means unlimited, so it is not recommended because a badly tuned detector can over-call the server. |
| — Injection — | |||
| injection.useInjection | bool | true | Master switch for Injection & Hooking. Player builds follow the configured response policy, development builds use warning-focused diagnostics, and the Editor generally skips this detector. |
| injection.injectionWhitelistEntries | OZeroInjectionWhitelistEntry[] | empty | Local trusted module entries for the Injection Detector. This is available in every tier, not only Pro. Add only modules shipped with the game or verified through QA, diagnostics, Pro telemetry, or OZero support guidance. |
WebTimeUnavailablePolicy
Policy used after configured web-time endpoints fail for maxConsecutiveFailures rounds in a row. Use this to decide whether a temporary network problem should only be logged or should become a security callback.
| Value | Description |
|---|---|
| WarnOnly | Default. Leave a warning log and keep the game running. This is the safest choice for games that must also work offline. |
| Strict | After repeated failure, raise a SpeedHack callback. Use only after testing real network conditions, because poor connectivity can also cause web-time failure. |
| Silent | Do not log and do not raise a callback. Keep this for short compatibility tests; it is not recommended for release builds. |
OZeroLicenseConfig OZeroSDK.Security.License
ScriptableObject loaded from Resources/OZeroLicenseConfig. It selects the license tier, stores the Plus/Pro license key, and configures Pro runtime server settings. Missing or empty config behaves as Standard/serverless mode.
Fields
| Field | Type | Description |
|---|---|---|
| tier | OZeroLicenseTier | Standard runs fully offline. Plus enables project-bound native variants. Pro includes Plus and enables server-backed runtime features. |
| licenseKey | string | Plus/Pro license key issued for the project. Plus uses it for project-bound native Variant checks; Pro also uses it for runtime activation and server features. Empty key falls back to Standard/serverless behavior. |
| serverBaseUrl | string | Pro runtime server Base URL. Used for activation, telemetry, signed time, attestation, and server policy calls. Standard and Plus runtime do not call it. |
| serverPublicKeyHex | string | Pro-only signing public key copied from Customer Portal > Server Key. Pro runtime uses it to verify signed activation, time, attestation, and offline policy tokens. Plus Variant manifests use the SDK-embedded OZero Variant signing key, not this field. |
| previousServerPublicKeyHex | string | Pro-only previous signing public key used during an OZero-managed server key rotation grace window. |
| tokenTtlSeconds | int | Pro runtime offline cache duration. After expiry, Pro server features stay disabled until activation succeeds again. |
| offlineProPolicyMode | OZeroOfflineProPolicyMode | Controls how signed Pro portal block policies are used while the device is offline. |
| activationTimeoutSeconds | float | Pro runtime activation timeout. If activation does not finish in time, the game continues with valid cached Pro info or Standard/serverless behavior. |
| enableLog | bool | Enables license-flow diagnostics through OZeroSecLog. Useful while setting up Plus/Pro. |
| enableDevicePolicyHeartbeat | bool | Pro only. Periodically checks whether the current device is still allowed. |
| devicePolicyHeartbeatInterval | float | Base interval in seconds for Pro device policy checks. Default 300; 0 disables periodic checks. |
| devicePolicyHeartbeatJitterPercent | float | Percentage used to spread Pro device-policy heartbeat timing around the configured interval so many devices do not call at once. Clamped from 0 to 75. |
| enableSecurityLevelCheck | bool | Pro only. Lets the server verify that the build declares the expected security level. |
| declaredSecurityLevel | OZeroDeclaredSecurityLevel | Security level this build declares to the server. |
| failOnSecurityLevelReject | bool | If true, an explicit server rejection of the declared security level or config hash triggers the configured hard response. |
| securityLevelCheckInterval | float | Periodic server re-check interval in seconds. 0 means boot-time check only. |
| securityLevelCheckJitterPercent | float | Percentage used to spread periodic security-level checks around the configured interval so many devices do not call at once. Clamped from 0 to 75. |
OZeroDeclaredSecurityLevel
Enum sent to the Pro server when security-level validation is enabled. The server compares this value with the minimum level configured for the license.
| Value | Description |
|---|---|
| Low | Prototype or development build level. Use only when the server policy intentionally allows a low protection declaration. |
| Standard | Default and recommended live-game declaration for normal protected builds. |
| Strict | Maximum protection declaration. Use only after QA confirms the project can run with the strict policy set. |
OZeroOfflineProPolicyMode
Controls how the SDK handles signed Pro portal block policies when the device cannot reach the server.
| Value | Description |
|---|---|
| ApplyCachedBlockPolicies | Recommended for most Pro games. While the signed policy is still valid, explicitly blocked build hashes, SDK versions, and app versions remain blocked offline. |
| RequireFreshPolicy | Strict mode for online-only games. If a fresh signed policy is not available, Build Integrity fails instead of trusting old policy data. |
| IgnoreCachedBlockPolicies | Ignores cached Pro block policy during offline downgrade. Use only for special tests or legacy compatibility; not recommended for live builds. |
Useful properties
Loads the runtime config from Resources. Treat null as Standard/serverless mode.
True for Standard, Plus, or an empty license key. False only when Pro activation should run.
True for Plus and Pro. Used by the build preflight and native Variant binding.
OZeroLicenseRuntime OZeroSDK.Security.License
Runtime facade for the current license state. It is initialized automatically at app startup, so most projects only read its state or call HasCapability.
Properties
| Name | Type | Description |
|---|---|---|
| Entitlement | OZeroLicenseEntitlement | Current activated entitlement. Null in Standard/serverless mode. |
| HasEntitlement | bool | True when an entitlement is currently available. |
| IsServerless | bool | True when the SDK is running without Pro server features. |
| Initialized | bool | True after the license runtime has completed its first startup pass. |
| IsProDowngraded | bool | True when Pro activation failed or expired and the SDK gracefully continued as Standard. |
| DowngradeReason | string | Diagnostic reason for the most recent graceful downgrade. |
| DeviceIdProvider | Func<string> | Optional override for the device id used by activation. Set before initialization if your project needs a custom identifier. |
Methods
Idempotent startup method. Usually called automatically by the SDK; custom bootstraps may await it before reading license state.
Returns whether the active entitlement includes a capability such as telemetry, signed_time, or attestation_v1. Returns false in Standard/serverless mode.
License Server Runtime Calls
Pro features use HTTPS JSON calls under /v1. These calls are issued by the SDK automatically; game code normally interacts through OZeroLicenseRuntime and module settings instead of calling the endpoints directly.
| Endpoint | Purpose |
|---|---|
| POST /v1/activate | Activates a Pro license for the current device and refreshes the local entitlement. |
| GET /v1/time | Provides signed server time for Speed & Time Hack validation when enabled. |
| POST /v1/attest | Issues a Pro build attestation token after enabled integrity checks pass. |
| POST /v1/validate | Validates an OZA token from your game server. Set consumeToken=true for one-time high-value actions. |
| POST /v1/managed-session | Validates a Pro OZA token through OZero Managed Verification and returns an allow/warn/block verdict plus a short managed session for teams without their own backend. |
| POST /v1/telemetry | Sends Pro telemetry for security events when the telemetry capability is active. |
POST /v1/activate contract
This is the basic request contract sent by the Unity SDK when it activates a Pro license. The server schema can accept additional native verification fields, but the current SDK activation request sends the fields below.
| Field | Type | Required | Description |
|---|---|---|---|
| licenseKey | string | yes | Pro license key used by /v1/activate. The server validates key format, status, tier, expiry, and device capacity. |
| deviceId | string | yes | Device identifier from OZeroLicenseRuntime.DeviceIdProvider. Used for activation count, cache binding, and device policy. |
| sdkVersion | string | yes | SDK version string. The server validates a semver-like format and writes it to activation records. |
| platform | enum string | yes | One of windows, windows_server, macos, linux, linux_server, ios, android, webgl, or unknown. |
| appIdentifier | string | optional | Unity Application.identifier when available. Compared with the license identity policy. |
| companyName | string | optional | Unity Application.companyName when available. |
| productName | string | optional | Unity Application.productName when available. |
| webglOrigin | string | optional | HTTP(S) origin for WebGL builds when Unity provides Application.absoluteURL. |
| Field | Type | Description |
|---|---|---|
| activated | bool | True when activation was accepted. |
| tier | string | Resolved license tier returned by the server. |
| capabilities | string[] | Capability list used by OZeroLicenseRuntime.HasCapability. |
| serverFeaturesEnabled | bool | True for Pro server-backed features. |
| signedToken | string | Signed activation token. The SDK verifies this token before trusting the entitlement. |
| keyId | string | Signing key id used for server key rotation diagnostics. |
| expiresAt | number | Unix milliseconds when the activation token expires. |
| serverUnreachablePosture | string | Policy returned by the server for temporary unreachable states. |
code and message. Common codes include BAD_JSON, BAD_REQUEST, LICENSE_NOT_FOUND, LICENSE_PENDING, LICENSE_SUSPENDED, LICENSE_REVOKED, LICENSE_EXPIRED, DEVICE_BLOCKED, ACTIVATION_LIMIT, SERVER_NOT_CONFIGURED, and SIGN_FAILED. The SDK treats explicit license or identity denials differently from temporary network failures.
OZeroAbortCode & Event Messages
When OZero confirms a security threat, it creates an OZeroSecurityEvent and passes it to the built-in response flow and any project callbacks. The event contains ModulationType, a stable public OZeroAbortCode, MessageKey, a safe English Message, and WillAbort.
Abort code and message table
| Code | OZeroAbortCode | ModulationType | MessageKey | Message |
|---|---|---|---|---|
| 0x01 | MemoryModulation | MemoryModulation | memory_modulation | Protected memory value changed unexpectedly. |
| 0x02 | Injection | Injection | injection | Unexpected module, hook, or runtime injection signal detected. |
| 0x0A | BuildIntegrity | BuildIntegrity | build_integrity | Build integrity validation failed. |
| 0x0C | SpeedOrTimeHack | SpeedHack | speed_hack | Suspicious time scale or execution speed change detected. |
| 0x0C | SpeedOrTimeHack | TimeHack | time_hack | System clock or trusted time anomaly detected. |
| 0x0E | DeviceOrInstallPolicy | DeviceBindingModulation | device_binding | Device binding policy rejected the current device. |
| 0x0E | DeviceOrInstallPolicy | InstallSource | install_source | Application install source is not trusted. |
| 0x0F | PhysicsHack | PhysicsHack | physics_hack | Abnormal physics behavior exceeded the configured policy. |
| 0x10 | EnvironmentModulation | EnvironmentModulation | environment_modulation | Unsupported or unsafe runtime environment detected. |
| 0x13 | SteamAntiPiracy | SteamAntiPiracy | steam_antipiracy | Steam ownership or ticket validation failed. |
Treat OZeroAbortCode and MessageKey as stable public values for logs and localization. The human-readable Message is intentionally safe and may be shown in developer UI.
Handling security events at runtime
By default, OZero either closes the app or leaves a log according to the Response settings in the Config Dashboard. Register a handler with OZeroSecurityManager.RegisterUserCallback when you need to show your own warning screen, send a server log, or save a small amount of data just before the app closes.
If evt.WillAbort is true, the current response policy will close the app after the callback flow. Use that time only for short work such as analytics flush or a final save. The callback is a reporting and cleanup hook; it is not a way to cancel OZero's security response.
using OZeroSDK.Security;
void OnEnable()
{
OZeroSecurityManager.Instance.RegisterUserCallback(OnHack);
}
void OnHack(OZeroSecurityEvent evt)
{
Debug.LogWarning(
$"OZero: {evt.Type} {evt.AbortCodeHex} {evt.MessageKey} - {evt.Message}");
if (evt.WillAbort)
{
// Last chance to flush your own analytics or save state.
}
Analytics.FlushSync();
}
Injection Detector API OZeroSDK.Security
API for registering modules that should be treated as trusted by the Injection scan. Use it for overlays, recorders, operations plugins, or partner modules that ship with your game and are known to be safe but may be detected. HashHex is the SHA-256 hash of the module file, and SignerHex is the SHA-256 hash of the module signing certificate. Do not guess these values; register only values confirmed from the actual distributed file or diagnostic output.
DTO — OZeroInjectionWhitelistEntry
[Serializable]
public class OZeroInjectionWhitelistEntry
{
// SHA-256 of the matched module file. Lowercase 64-char hex. Required.
public string HashHex { get; set; }
// SHA-256 of the module's signing certificate. Lowercase 64-char hex.
// Empty ("") means "match by hash only" (only mode for Android .so / Linux ELF).
public string SignerHex { get; set; }
// Module file format hint — "pe" | "macho" | "so". Defaults to "so".
public string Type { get; set; }
// Optional human-readable note (UI / audit only — never sent to native).
public string Comment { get; set; }
}
Data structure for local trusted module entries in Unity. HashHex is the required 64-character SHA-256 file hash, and SignerHex is an optional 64-character signer fingerprint. Type is one of pe, macho, or so, and Comment is a human-readable note.
Runtime API — OZeroDispatch
// Returns true when trusted-module policy support is available.
public static bool HasInjectionV3 { get; }
// Replace trusted module entries atomically. Pass null/empty to clear.
// Returns false when the runtime support is unavailable.
public static bool RegisterInjectionWhitelistHash(OZeroInjectionWhitelistEntry[] entries);
// Trusted-module aware scan. Returns true when a relevant runtime signal is observed.
// Output fields are diagnostic context for your review and may be empty.
public static bool DetectAssemblyInjectionV3(
out bool silencedByWhitelist,
out string hashHex,
out string signerHex,
out string matchedModulePath);
Used at runtime to pass the trusted module list to the native scanner, or to check whether this feature is available on the current platform. Most projects only need the Injection settings in the Config Dashboard. If you call this API directly, register only the required entries after distribution files are finalized and verify the result in QA logs.
Config — OZeroSecurityConfig.InjectionSettings
// Preferred local trusted-module surface in the Injection settings.
public OZeroInjectionWhitelistEntry[] InjectionWhitelistEntries { get; }
InjectionWhitelistEntries is the local trusted module list inside the Injection settings. It is not meant to broadly allow programs randomly installed on a customer's PC, but only to register modules distributed alongside the game whose normal behavior has been confirmed by the developer. Pro customers can update the same kind of policy during live operations through the customer portal server-managed whitelist.