OZero Security
API Reference

API Reference

Complete reference for all public classes and methods in the OZeroSecurity SDK. All classes live in the OZeroSDK.Security namespace unless otherwise noted.

OZeroSecurityManager OZeroSDK.Security

The global manager that handles all active security modules and security events. Survives scene transitions and can be accessed via the Instance property. The SDK creates it automatically at app startup, so you do not need to instantiate it manually.

Properties

Name Type Description
Instance OZeroSecurityManager Static singleton accessor. Returns the active instance.

Methods

void RegisterUserCallback(DelegateSecurityViolation callback)

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.

void UnregisterUserCallback(DelegateSecurityViolation callback)

Removes a previously registered user callback. Always call this in OnDisable or OnDestroy to prevent memory leaks.

void RegisterSecurityTerminationNoticeCallback(Action<OZeroSecurityTerminationNoticeEvent> callback)

Registers the project callback used by CustomCallbackOnly. It runs only after native code has armed an irreversible fatal-exit deadline. The callback may show a notice or perform brief cleanup, but cannot cancel or extend that deadline.

void UnregisterSecurityTerminationNoticeCallback(Action<OZeroSecurityTerminationNoticeEvent> callback)

Removes a previously registered security termination notice callback.

static void ExitNow()

Immediately completes an already-pending fatal security exit, typically from a notice dialog's OK button. It does nothing when no fatal exit is pending.

void RegisterUserPolicyActionCallback(Action<OZeroPolicyActionEvent> callback)

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.

void UnregisterUserPolicyActionCallback(Action<OZeroPolicyActionEvent> callback)

Removes a previously registered policy action callback. Register in OnEnable and unregister in OnDisable when using a scene object.

void RegisterUserActivationStateCallback(Action<OZeroUserActivationStateEvent> callback)

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.

void UnregisterUserActivationStateCallback(Action<OZeroUserActivationStateEvent> callback)

Removes a previously registered activation state callback. Register in OnEnable and unregister in OnDisable when using a scene object.

void RegisterUserManagedVerificationStateCallback(Action<OZeroUserManagedVerificationStateEvent> callback)

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.

void UnregisterUserManagedVerificationStateCallback(Action<OZeroUserManagedVerificationStateEvent> callback)

Removes a previously registered managed verification state callback. Register in OnEnable and unregister in OnDisable when using a scene object.

void RegisterUserManagedVerificationTextProvider(IOZeroUserManagedVerificationTextProvider provider)

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.

void UnregisterUserManagedVerificationTextProvider(IOZeroUserManagedVerificationTextProvider provider)

Removes a previously registered managed verification text provider.

bool RequestBuildAttestationRetry()

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.

bool RequestSteamActivationRetry()

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

delegate void DelegateSecurityViolation(OZeroSecurityEvent evt)

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}");
}

OZeroSecurityTerminationNoticeEvent class

User-facing payload emitted only after the native fatal-exit deadline is armed. It wraps the original safe security event and a stable support code suitable for a dialog or customer-support report.

Name Type Description
SecurityEventOZeroSecurityEventThe original safe event. WillAbort is true; use AbortCode and MessageKey for logs and localization.
SupportCodestringStable, non-sensitive code that the player can report to customer support.
Important
Showing UI or invoking a callback does not pause, cancel, or extend the native fatal-exit deadline. Keep all work bounded and call OZeroSecurityManager.ExitNow() only to exit earlier.

OZeroSecurityEvent class

Customer-facing violation event passed to RegisterUserCallback. It intentionally exposes only stable, safe diagnostic info rather than internal detection details.

Name Type Description
TypeModulationTypeSecurity module that raised the violation.
AbortCodeOZeroAbortCodeStable public abort code category.
AbortCodeValueintNumeric code value, useful for server logs.
AbortCodeHexstringHex string such as 0x0C.
MessageKeystringStable English message key for localization and analytics grouping.
MessagestringSafe customer-facing English diagnostic message.
WillAbortboolTrue 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
ModulestringPolicy module such as variant, injection, or physics.
ActionIdstringUnique delivery id. The SDK uses it to avoid duplicate dispatch and acknowledge delivery.
PolicyIdstringCustomer portal policy id when available.
ReasonstringReason configured by the policy or generated from the matched evidence.
ScoreintRisk score at the time the policy matched.
EventCountintNumber of events that contributed to the policy match.
WindowMinutesintPolicy evaluation window in minutes.
IssuedAtUnixMslongServer UTC epoch milliseconds when the action was issued.
ExpiresAtUnixMslongServer 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
ProviderstringActivation provider such as steam.
StatestringStable state such as valid, revalidated, online_required, offline_degraded, or rejected.
ReasonstringReason code such as steam_activation_revalidate_unavailable or steam_activation_cache_expired.
ActionstringPortal policy action value associated with this state when available.
OfflineAllowedboolTrue only while a verified signed token is inside its offline allowance.
OnlineRequiredboolTrue when the game should ask the user to reconnect before allowing the protected session.
RefreshAtUnixMslongUTC epoch milliseconds when online refresh is required.
OfflineUntilUnixMslongUTC epoch milliseconds when the signed offline allowance ends.

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
ProviderOZeroManagedVerificationProviderSource module: BuildIntegrity or SteamDrm.
StateOZeroUserManagedVerificationStateCurrent state such as Checking, Allowed, Warning, OnlineRequired, RetryTimedOut, Blocked, or StandardFallback.
ReasonstringStable reason code suitable for custom UI text, analytics, or customer support logs.
VerdictstringServer verdict when available, such as allow, warn, block, or fallback.
CanRetryboolTrue when a Retry action is meaningful for the current provider and state.
TimestampUnixMslongUTC 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
CustomCallbackOnlyThe SDK raises RegisterUserManagedVerificationStateCallback states only. Use this when the game implements its own UI, retry buttons, timeout handling, and session gate.
BuiltInBlockingDialogUses 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.
BuiltInNonBlockingDialogUses 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.

OZeroSecurityTerminationNoticePolicy enum

Controls the optional user-facing notice shown immediately before an already-armed fatal security exit. This common policy is available to Standard / Pro licenses.

Value Description
Disabled = 0Shows no termination notice. The native fatal-exit deadline remains authoritative.
OZeroBuiltIn = 1Shows the localized OZero built-in dialog and exits early when the player confirms.
CustomCallbackOnly = 2Invokes the registered termination notice callback so the project can show custom UI. It cannot cancel or extend termination.

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
KeepDialogKeeps the dialog visible after timeout. Choose this only when the game wants the player to keep retrying manually.
BlockSessionBlocks the protected session after timeout. This is the recommended default when online verification is mandatory but the application should remain open.
AbortApplicationTerminates the application after timeout. Use only when your release policy requires immediate exit on unresolved verification.
InvokeCallbackOnlyRaises callbacks without built-in blocking or exit behavior. Use this for fully custom session control.

ModulationType enum

Identifies which security module raised an alert. Passed via OZeroSecurityEvent.Type.

Value Description
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 — you must attach the component directly to player objects and initialize it)
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.
InjectionScannerUnavailable The native injection scanner could not run (fail-closed; abort code 0x15, not an attack detection)

OZeroBootstrapper OZeroSDK.Security

The automatic startup entry point responsible for initializing the SDK. You do not need to call this directly in your project code. It loads security settings in alignment with the Unity startup flow and prepares active detectors before the game starts.

No public API — do not instantiate, inherit from, or reference this type at call-sites. The only supported integration surface is the OZeroSecurityConfig asset.

OZeroSecurityConfigRuntime OZeroSDK.Security

A configuration loader that reads and validates protected build settings when the player runs. 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 configuration snapshot created by reading the protected settings included in the player build. Calls EnsureLoaded() on first access.

Methods

static void EnsureLoaded()

A loader that is safe to call repeatedly. First call validates and loads the packaged configuration; later calls reuse the same configuration snapshot. Failure handling follows the configured response policy.

This type is an internal loader. Treat OZeroSecurityConfig and the Unity editor window as the supported integration surface.

OZero Secure Variables OZeroSDK.Security

Encrypted types that can be used instead of regular numeric, string, and vector types. Values are stored in a protected memory area and support most arithmetic operators and implicit conversions. You can apply them to existing code simply by changing the type name.

Available types

Class Replaces
OZeroSV_Intint
OZeroSV_Int64long
OZeroSV_UIntuint
OZeroSV_UInt64ulong
OZeroSV_Shortshort
OZeroSV_UShortushort
OZeroSV_Bytebyte
OZeroSV_Floatfloat
OZeroSV_Doubledouble
OZeroSV_Decimaldecimal
OZeroSV_Boolbool
OZeroSV_Stringstring
OZeroSV_Vector2Vector2
OZeroSV_Vector3Vector3
OZeroSV_Bufferbyte[]

Supported operators

Numeric types (Int, Int64, UInt, UInt64, Short, UShort, Byte, Float, Double, Decimal) support arithmetic (+ - * / %), comparison (== != < > <= >=), compound assignment (+= -= *= /=), increment/decrement (++ --) operators, and implicit conversions with their primitive equivalents. Vector2 and Vector3 support arithmetic and equality operators. Bool supports equality operators only. String supports ==, !=, and +. Buffer provides direct byte array access via index operators.

Secure Types are designed to reduce repeated allocations in supported primitive operations. However, GC allocations can occur depending on string/buffer conversions, logging, boxing, LINQ, and user code patterns. Profile before applying to high-frequency updates every frame.

OZeroSafePlayerPrefs OZeroSDK.Security

An encrypted storage that can be used similarly to Unity's PlayerPrefs. Key names and values are protected, making it difficult to read the original values even if you open the Windows registry or iOS settings file directly.

Methods

static void SetInt(string key, int value)
static int GetInt(string key, int defaultValue = 0)
static void SetFloat(string key, float value)
static float GetFloat(string key, float defaultValue = 0f)
static void SetString(string key, string value)
static string GetString(string key, string defaultValue = "")
static void SetInt64(string key, long value)
static long GetInt64(string key, long defaultValue = 0L)
static void SetDouble(string key, double value)
static double GetDouble(string key, double defaultValue = 0.0)
static void SetBool(string key, bool value)
static bool GetBool(string key, bool defaultValue = false)
static int IncrementInt(string key, int defaultValue = 0)
static bool HasKey(string key)
static void DeleteKey(string key)
static void DeleteAll()
static void Save()
static void Initialize(string newPassword = "", string newSalt = "") // obsolete compatibility no-op

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.

Data written by OZeroSafePlayerPrefs is not compatible with standard PlayerPrefs. If you switch between the two, existing data will not be readable.

OZeroSV_File OZeroSDK.Security

Protects file reads and writes with internal encryption logic. Because it does not use a device binding key, it can be used when the same save file needs to be read across multiple devices, like Steam Cloud Save. If a file is intentionally tampered with, the integrity check fails at read time and throws an InvalidDataException.

Encrypted files are stored in an SDK-internal format. Do not parse the file structure or specific offsets directly; always read and write through the OZeroSV_File API.

Methods

static void WriteAllText(string path, string contents)

Encrypts contents and stores it at path. Parent folders are not created automatically, so call Directory.CreateDirectory first when needed.

static string ReadAllText(string path)

Reads the file at path, verifies integrity, and returns the decrypted string. If the file was tampered with, InvalidDataException is thrown.

static void WriteAllBytes(string path, byte[] bytes)

Encrypts data and stores it safely at path.

static byte[] ReadAllBytes(string path)

Reads the file specified at path. Verifies file integrity during read and detects any tampering.

static string DecryptBytesToText(byte[] encryptedData)

Decrypts an encrypted byte buffer that is already loaded in memory instead of a file path. Use this when you cannot pass data received from a remote download or custom storage 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, optional Pro server attestation, and OZero Managed Verification. The component is created automatically by the SDK when Build Integrity is enabled in OZeroSecurityConfig.

What it checks

Check Description
Assembly / ManifestVerifies the generated integrity manifest and managed assembly state on supported build targets.
Debugger / TimingDetects attached debuggers, abnormal timing gaps, and breakpoint-like pauses while suppressing common focus-loss false positives.
Platform NativeRuns platform-specific integrity checks such as Android package/signature checks, iOS jailbreak checks, and desktop runtime checks when enabled.
Pro AttestationWhen Pro server attestation is enabled, requests a server-issued attestation token after local checks pass. If you don't have your own game server, the OZero server can also return an allow/warn/block verdict.

Public properties

Name Type Description
InstanceOZeroBuildIntegrityValidatorCurrent validator instance, if the module has been created.
LastValidationResultbool?Most recent local validation result. null before the first validation run.
IsValidatingboolTrue while a validation run is in progress.
IsIntegrityVerifiedboolTrue after the latest enabled local checks pass.
AttestationTokenOZeroBuildAttestationTokenMost recent Pro attestation token. Null until server attestation succeeds or fails. The token includes a unique token ID for replay tracking.

Events and methods

UnityEvent OnValidationPassed { get; }

Invoked when all enabled local checks pass.

UnityEvent OnValidationFailed { get; }

Invoked when an enabled local check or Pro attestation rejects the build.

UnityEvent OnAttestationPassed { get; }

Invoked after Pro server attestation succeeds and AttestationToken contains a valid token.

bool RequestGameServerAttestation(string audience, string challenge, string sessionId)

CustomerGameServer only. After local checks pass, starts attestation with a server-issued audience, 64-character challenge hex, and session ID. Send the callback's OZA token and exact binding values to the game server for /v1/validate. Returns false for invalid configuration or binding, or while validation is busy.

void Validate()

Starts a manual validation run. Normal projects should preferably rely on the dashboard's startup and periodic validation settings.

OZeroBuildAttestationToken

Pro attestation result. Send AttestToken to your game server and call IsValid(nowMillis) to check validity before using it for login, PvP, ranking, or currency flows.

bool IsExpired(long nowMillis)

Returns true after the server-issued expiry time.

bool IsValid(long nowMillis)

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 Checks if the game's time flow changes abnormally
API Clock Compares platform time against a native reference time to detect large discrepancies
Thread Drift Observes drift between Unity runtime time and a native reference time
Time Backward Detects situations where the device time abnormally goes backwards
NTP Optional — cross-checks with a reliable external time reference (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

OZeroWatchdog.OZeroLoadingGraceScope BeginLoadingGrace(int maxGraceMs = 60000)

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.

void OZeroLoadingGraceScope.End()

Ends this loading grace scope manually. Dispose() calls the same logic, so using blocks and explicit End() are equivalent.

void RunWithLoadingGrace(Action work, int maxGraceMs = 60000)

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);
    }
}
This API only defers the Watchdog deadline; it does not disable other protection modules or expose native heartbeats. Use it only for trusted loading boundaries, not as a keep-alive mechanism.

OZeroInjectionDetector OZeroSDK.Security

Checks if suspicious modules are attached to the running game, or if there are traces of hooking or debuggers. Periodic checks use slight timing variations when possible to make simple bypass attempts more difficult.

What it detects

Runtime module Unexpected runtime modules or signals suspected of hooking
Debugger Signals suspected of debugger or tracing tool attachment
Memory map Abnormal runtime memory or module state signals
Illegal DLL Unauthorized managed assembly signals loaded into the process (Windows/Unity Editor)

Detection fires via OZeroSecurityManager callbacks with ModulationType.Injection.

OZeroSteamAntiPiracy OZeroSDK.Security

Runtime API to change the post-detection action of Steam Anti-Piracy. Setting this up in the Config Dashboard is sufficient for most projects. Only use this if you provide an admin menu or QA switch directly inside the game.

This API is suitable for temporarily switching to observe mode in QA builds, or reverting to default settings via an admin menu in the game. In projects where Pro server policies apply separately, portal policies may take precedence, so always check the actual block policy alongside portal settings.

OZeroSteamDetectionAction

Value Description
OffDo not apply the local Steam Anti-Piracy response. Use only in restricted troubleshooting situations.
ObserveRecord diagnostic information only and allow the game execution to continue.
CallbackRaises OZeroSecurityManager callbacks so the game can show UI, log, or handle it independently. This option alone does not auto-terminate the app; the actual termination depends on the Global Threat Response settings and your project's callback handling.
BlockTreat the violation as a block policy. Actual app termination follows the Global Threat Response settings.

Methods

static void SetDetectionActionOverride(OZeroSteamDetectionAction action)

Overrides the local Steam Anti-Piracy detection action at runtime. Used when temporarily lowering to Observe in QA builds, or letting operators select specific actions from an admin menu.

static void ClearDetectionActionOverride()

Clears the runtime override and reverts to the default action set in OZeroSecurityConfig or the Pro portal.

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

OZeroSteamAntiPiracyValidator.Instance.GetLastResult()

Returns the most recent Steam validation snapshot. Includes reported AppID, BuildID, SteamID, server verification state, soft signal, and native score fields. Can be used for debug UI or QA reports, but do not use it as the sole criterion for gameplay authorization.

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, diagnostic logs, or store-specific branching.

Methods and event

event Action<InstallSourceResult> OnInstallSourceDetected

Invoked when the install source is resolved.

InstallSourceResult GetLastResult()

Returns the cached result from the most recent check.

InstallSourceResult GetAndroidInstallationSource()

Performs initialization if necessary, then returns the Android installation source result.

InstallSourceResult

DetectedSourceResolved source as an AndroidInstallSource enum value.
RawInstallerPackageRaw Android installer package name returned by PackageManager.
IsAuthorizedTrue when the local config and, if enabled, Pro server policy allow this install source.
ServerVerifiedPro only. True when the server verification call has completed.
ServerAuthorizedPro 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
GooglePlayStoreInstalled from Google Play Store.
SamsungGalaxyStoreInstalled from Samsung Galaxy Store.
AmazonAppstoreInstalled from Amazon Appstore.
HuaweiAppGalleryInstalled from Huawei AppGallery.
OneStoreInstalled from ONE Store.
XiaomiGetAppsInstalled from Xiaomi GetApps.
OppoAppMarketInstalled from OPPO App Market.
VivoAppStoreInstalled from Vivo App Store.
CustomRaw installer package matched customAuthorizedPackages.
ADBAndroid returned an empty installer package, usually from ADB or sideload-style installation.
DetectionFailedThe installer query itself failed because JNI or the platform API was unavailable. This is different from ADB.
UnknownAndroid returned a package name that is neither built-in nor custom-authorized.
EditorReturned while running inside the Unity Editor.
NotApplicableReturned 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

void Initialize()

Prepares the local device fingerprint, then registers or validates it. In normal projects this is called automatically during SDK startup.

string BindToSaveSlot(string saveSlotKey)

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.

bool ValidateSaveSlot(string saveSlotKey, string storedToken)

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.

string GetCurrentFingerprintHash()

Debug/demo helper that returns the current device fingerprint hash. Do not show, upload, or store this value from production gameplay code.

void ClearStoredFingerprint(string authorizationToken = "")

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 Unity ScriptableObject asset that stores the default settings for OZero security modules. Changes made in the Config Dashboard or Inspector are included as protection settings for players during build. Use OZeroSecurityConfig.Instance when you need to check the current settings in code.

Fields

Fields are grouped into nested settings classes such as Response and Integrity. This table lists the fields most often checked from code or changed during integration; see the manual for the full Inspector table. Defaults mean the serialized values defined in code. Rows marked with * are forced to a different runtime value in release builds.

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 Enables SDK debug logs. Useful for development and QA investigation, but review your release logging policy separately.
enableFailureDiagnostics bool false Writes local security failure diagnostic files to Application.persistentDataPath. Enable only during 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 according to your project's guidelines.
response.fatalCallbackGraceSeconds float 10 Maximum seconds allowed for your security callback UI to notify the player after a threat is detected. Set to 0 only when immediate exit is intended.
securityTerminationNoticePolicy OZeroSecurityTerminationNoticePolicy Disabled Optional all-license notice policy for an already-pending fatal security exit.
securityUiDialogPrefabResourcePath string "" Optional Resources path for the shared security UI prefab. Leave empty to use the SDK default.
securityUiLanguageCode string auto Language code for shared security UI strings. auto follows Application.systemLanguage.
securityUiFallbackLanguageCode string en Fallback language when the selected shared localization JSON is missing.
— 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.
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.
— 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 Interval in seconds between recurring re-validation runs. Code default is 300. 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 manifest as a violation. *Forced to true in non-development player builds regardless of the serialized 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 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 OZero Managed returns the verdict, or your game server issues the binding and validates the OZA token after the client calls RequestGameServerAttestation(...).
integrity.attestationNetworkPolicy (Pro) enum RequireOnlineRevalidation Server verification that cannot be completed or refreshed surfaces 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 RequireOnlineRevalidation Required Steam DRM revalidation that cannot reach the server enters the online-required state. Built-in Managed Verification UI modes show the 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. Values that are too small or too large are automatically clamped within a safe range.
speedHack.requiredDetections int 3 Consecutive suspicious samples required before treating as a violation. Values that are too small or too large are automatically clamped within a safe range.
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 game time cross-validation with external endpoints.
speedHack.webTimeUrls[] string[] [] List of HTTPS addresses used for web-time cross-validation. Set two or more addresses that you manage or trust. If the list is empty, web-time validation has no address to use.
speedHack.minSuccessfulEndpoints int 2 Minimum number of webTimeUrls addresses 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 event after repeated failure. Silent leaves no log, so keep it 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.useGlobalPhysicsHackbooltrueGlobal on/off switch for all OZeroPhysicsHackDetector components. Per-object movement thresholds remain on each component in the Inspector.
physicsHack.enableServerTelemetry (Pro)boolfalsePro 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)int30Maximum 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, diagnostic files, Pro telemetry, or OZero support guidance.

WebTimeUnavailablePolicy

Policy used after configured web-time addresses 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
WarnOnlyDefault. Leave a warning log and keep the game running. This is the safest choice for games that must also work offline.
StrictAfter repeated failure, raise a SpeedHack callback. Use only after testing real network conditions, because poor connectivity can also cause web-time failure.
SilentDo not log and do not raise a callback. Keep this for short compatibility tests; it is not recommended for release builds.
developerSecret must be set before the first release and must not be changed afterward. If it changes, existing save data (PlayerPrefs and files) cannot be decrypted by newer builds.

OZeroLicenseConfig OZeroSDK.Security.License

A ScriptableObject loaded from Resources/OZeroLicenseConfig. It manages Standard/Pro settings, the project license key, and Pro server settings. A missing asset or empty key behaves as Standard/serverless mode.

Fields

Field Type Description
tierOZeroLicenseTierStandard uses the shared native module. Pro provides a project-specific native binary, server activation, telemetry, and remote security settings.
licenseKeystringThe project Pro license key in OZ-PRO-... format. It validates the project binding of the dedicated binary and is used for server activation and Pro server features.
allowStandardBuildWithPremiumLicenseboolExplicit native variant compatibility override. Pro tiers may use it to build with the Standard public native module. Standard tier may use it to build with a Pro private native variant package, but the matching license key must be entered and build/runtime validation still checks the signed manifest, license key hash, project identity, and native hashes. Standard public variant builds remain keyless even when this option is enabled.
serverBaseUrlstringThe server address for Pro activation, telemetry, signed time, attestation, and server policies. Serverless mode does not call it. Keep https://api.ozerosecurity.com unless support provides a dedicated endpoint.
serverPublicKeyHexstringThe Pro server signing public key from Customer Portal > Server Key. It verifies server response signatures. Dedicated binary manifests are verified separately with the SDK-embedded binary signing key, not this field.
previousServerPublicKeyHexstringPrevious Pro server signing public key used only during a server key rotation grace window. Leave it empty normally.
tokenTtlSecondsintPro runtime offline cache duration. After expiry, Pro server features stay disabled until activation succeeds again.
offlineProPolicyModeOZeroOfflineProPolicyModeControls how local Build Integrity applies signed Pro portal block policies while the device is offline.
activationTimeoutSecondsfloatPro runtime activation timeout. If activation does not finish in time, the game continues with valid cached Pro info or Standard/serverless behavior.
enableLogboolOutputs license-flow diagnostic logs via OZeroSecLog. Useful while setting up Pro.
enableDevicePolicyHeartbeatboolPro only. Periodically checks whether the current device is still in an allowed state.
devicePolicyHeartbeatIntervalfloatBase interval in seconds for Pro device policy checks. Default 300; 0 disables periodic checks.
devicePolicyHeartbeatJitterPercentfloatPercentage 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.
enableSecurityLevelCheckboolPro only. Lets the server verify that the build declares the expected security level.
declaredSecurityLevelOZeroDeclaredSecurityLevelSecurity level this build declares to the server.
failOnSecurityLevelRejectboolIf true, an explicit server rejection of the declared security level or config hash triggers the configured hard response.
securityLevelCheckIntervalfloatPeriodic server re-check interval in seconds. 0 means boot-time check only.
securityLevelCheckJitterPercentfloatPercentage 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
LowPrototype or development build level. Use only when the server policy intentionally allows a low protection declaration.
StandardDefault and recommended live-game declaration for normal protected builds.
StrictMaximum protection declaration. Use only after QA confirms the project can run with the strict policy set.

OZeroOfflineProPolicyMode

Controls how local Build Integrity handles signed Pro portal block policies when the device cannot reach the server. The values intentionally separate fail-open operation, fail-closed policy enforcement, and test bypass behavior.

Value Description
ApplyCachedBlockPoliciesRecommended fail-open default. Applies a valid cached signed policy while offline; if no usable cache exists, this policy gate passes.
RequireFreshPolicyStrict fail-closed mode. If no usable signed policy is available, Build Integrity fails when server Integrity is enabled.
IgnoreCachedBlockPoliciesBypass mode. Does not read cached Pro block policy while offline; use only for tests or migrations, not live builds.

Properties

static OZeroLicenseConfig RuntimeInstance { get; }

Loads the runtime config from Resources. If null, treat it the same as Standard.

bool IsServerlessMode { get; }

Indicates a configuration that runs without server activation. True for Standard or an empty license key; false when Pro server activation is required. Existing compatibility configurations remain supported by the SDK.

bool IsVariantTier { get; }

Indicates a configuration eligible for dedicated native binary validation, including Pro. The imported signed manifest identifies whether a private package is present. Existing compatibility configurations remain supported by the SDK.

bool AllowStandardBuildWithPremiumLicense { get; }

True only when the explicit native variant compatibility override is enabled for the current project.

OZeroLicenseRuntime OZeroSDK.Security.License

Runtime API for reading the current license state. It is initialized automatically at app startup, so most projects only need to read the state or call HasCapability.

Properties

Name Type Description
EntitlementOZeroLicenseEntitlementCurrently activated Pro authorization info. Null in Standard mode.
HasEntitlementboolTrue when there is current Pro activation info.
IsServerlessboolTrue when the SDK is running without Pro server features.
InitializedboolTrue after the license runtime has finished its first startup processing.
IsProDowngradedboolTrue when the SDK silently continues as Standard after Pro activation failure or expiry.
DowngradeReasonstringDiagnostic reason for the most recent automatic downgrade (fallback to default protection).
DeviceIdProviderFunc<string>Optionally overrides the device id used for activation. If your project needs to use a custom identifier, set this before initialization.

Methods

static Task Initialize()

Safe to call multiple times. Usually called automatically by the SDK; custom bootstraps can await it before reading license state.

static bool HasCapability(string cap)

Returns whether the current activation info includes capability permissions like telemetry, signed_time, or attestation. False in Standard.

Serverless mode does not require runtime activation. If Pro activation fails, gameplay continues with Standard features and only Pro-exclusive server features become unavailable.

License Server Runtime Calls

Pro features use HTTPS JSON APIs under /v1. OZA v2 is a one-time token bound to an audience, a 256-bit challenge, a session ID, and build evidence. Calls to /v1/validate require a License Server API Key and the same binding values; every successful token is consumed atomically. Teams without a backend use OZero Managed with a root-signed keyset and OZMS receipt.

Endpoint Purpose
POST /v1/activateActivates a Pro license for the current device and refreshes the local activation info.
GET /v1/timeProvides signed server time for Speed & Time Hack validation when enabled.
POST /v1/attestIssues a Pro build attestation token with a unique token ID after enabled integrity checks pass. The nonce is bound to the submitted build evidence and app identity.
POST /v1/validateValidates OZA v2 from the game server. A Server API Key and audience/challenge/sessionId are required, and every successful token is consumed exactly once.
POST /v1/managed-sessionFor teams without their own backend, OZero validates the Pro OZA token and returns an allow/warn/block verdict with a short session. The SDK attempts auto-revalidation before the session expires, and flows reusing the same token are blocked.
POST /v1/telemetrySends security events to the server when Pro 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.

FieldTypeRequiredDescription
licenseKeystringyesPro license key used by /v1/activate. The server validates key format, status, tier, expiry, and device capacity.
deviceIdstringyesDevice identifier from OZeroLicenseRuntime.DeviceIdProvider. Used for activation count, cache binding, and device policy.
sdkVersionstringyesSDK version string. The server validates a semver-like format and writes it to activation records.
platformenum stringyesOne of windows, windows_server, macos, linux, linux_server, ios, android, webgl, or unknown.
appIdentifierstringoptionalUnity Application.identifier when available. Compared with the license identity policy.
companyNamestringoptionalUnity Application.companyName when available.
productNamestringoptionalUnity Application.productName when available.
webglOriginstringoptionalHTTP(S) origin for WebGL builds when Unity provides Application.absoluteURL.
FieldTypeDescription
activatedboolTrue when activation was accepted.
tierstringResolved license tier returned by the server.
capabilitiesstring[]Capability list used by OZeroLicenseRuntime.HasCapability.
serverFeaturesEnabledboolTrue for Pro server-backed features.
signedTokenstringSigned activation token. The SDK verifies this token before trusting the entitlement.
keyIdstringSigning key id used for server key rotation diagnostics.
expiresAtnumberUnix milliseconds when the activation token expires.
Failure responses use JSON with 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.
Network failures, maintenance, or license expiry do not immediately stop gameplay. The SDK maintains default protection features and retries Pro features at the next available activation point.

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
0x01MemoryModulationMemoryModulationmemory_modulationProtected memory value changed unexpectedly.
0x02InjectionInjectioninjectionUnexpected module, hook, or runtime injection signal detected.
0x0ABuildIntegrityBuildIntegritybuild_integrityBuild integrity validation failed.
0x0CSpeedOrTimeHackSpeedHackspeed_hackSuspicious time scale or execution speed change detected.
0x0CSpeedOrTimeHackTimeHacktime_hackSystem clock or trusted time anomaly detected.
0x0EDeviceOrInstallPolicyDeviceBindingModulationdevice_bindingDevice binding policy rejected the current device.
0x0EDeviceOrInstallPolicyInstallSourceinstall_sourceApplication install source is not trusted.
0x0FPhysicsHackPhysicsHackphysics_hackAbnormal physics behavior exceeded the configured policy.
0x10EnvironmentModulationEnvironmentModulationenvironment_modulationUnsupported or unsafe runtime environment detected.
0x13SteamAntiPiracySteamAntiPiracysteam_antipiracySteam ownership or ticket validation failed.
0x15InjectionScannerUnavailableInjectionScannerUnavailableinjection_scanner_unavailableThe injection scanner could not run; the SDK closes the game rather than continue unprotected. Fires even when ForceQuitOnDetection is off.

Use OZeroAbortCode and MessageKey as the base values for logs and localized UI. Message is written in safe, developer-friendly language so it can be shown directly on developer screens or QA logs.

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

Injection Detector silenced -> Add to Whitelist workflow
Workflow: first detection -> add a trusted module entry -> later scans can be silenced for that module.

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.

Data Structure — 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. Use it only for modules distributed with the game whose normal behavior has been confirmed by the developer. This local list is available in all tiers; Pro customers can update the same kind of policy during live operations through the customer portal server-managed whitelist.