For the complete documentation index, see llms.txt. This page is also available as Markdown.

🎮Unity

📝 Prerequisites

Ensure your development environment meets the following requirements:

  • Unity Editor version 6 or higher.

  • Minimum Android SDK level 23 or higher.

Integration Tutorials

Note on Video Tutorials

These videos demonstrate the end-to-end integration workflow using older SDK versions. Review them to understand the core concepts, then proceed to the Installation and Initialization section below to implement the current release.

Android Workflow

iOS Workflow

Installation and Initialization

1

Download the Plugin

Download the latest freeRASP.unitypackage file from the GitHub Release page.

2

Import the Package

Open your Unity project. Right-click the Assets folder in the Project window and select Import Package -> Custom Package to import the downloaded file.

Editor - Import Package
3

Initialize the Plugin

Create an empty GameObject in your primary Scene, or select an existing one. Create a script named Game.cs and drag it from the Project window onto your GameObject in the Hierarchy or Inspector window. Unity automatically calls the Start() method when the Scene loads. Implement the TalsecConfig object and initialize the freeRASP plugin within this method.

Required Configuration Values

  • packageName: Your Android application package name (e.g., com.example.app).

  • signingCertificateHashBase64: The Base64-encoded hash of your app's signing certificate. Read the signing certificate guide for instructions on manual signing and Google Play App Signing.

  • supportedAlternativeStores: A list of alternative distribution stores (e.g., Samsung Galaxy Store). Leave empty if distributing exclusively via Google Play.

  • appBundleIds: Your iOS app bundle identifier (e.g., com.example.app).

  • appTeamId: Your Apple Developer Team ID, located in the Apple Developer Portal under Membership.

  • watcherMailAddress: The email address for receiving security reports. This must exactly match your Talsec Portal registration email.

  • isProd: Set to true for production builds and false for development builds.

4

Threat Handling

freeRASP evaluates the device environment and application binary for integrity violations. When a check detects an anomaly, the system triggers the corresponding method within the ThreatDetectedCallback interface.

Platform-Specific Callbacks

The ThreatDetectedCallback interface is shared across platforms, but certain checks evaluate OS-specific states:

  • Android-only: onMultiInstance, onUnsecureWiFi, onLocationSpoofing, onADBEnabled, onObfuscationIssues

  • iOS-only: onPasscodeChange, onDeviceID

Your application must implement these callbacks to execute security mitigations. For example, your app can:

  • Terminate the application process.

  • Restrict access to sensitive views or features.

  • Clear locally stored user session data.

  • Send a telemetry event to your backend.

5

Execution State Handling

freeRASP evaluates security checks in periodic cycles. When the system completes a full scan cycle without interruption, it triggers the onAllChecksFinished method within the RASPStatusCallback interface.

Your application can use this callback to unblock UI components or log scan completion.

Platform-Specific Setup

freeRASP utilizes native Android and iOS libraries to execute runtime security checks. You must configure platform-specific build settings to link these native dependencies correctly. Complete the Android Gradle configurations before compiling your final Android package, and complete the iOS framework setup after exporting your Unity project to Xcode.

Android Setup

1

Add Maven Repositories

Define the Talsec Maven repositories in your Gradle configuration to resolve the freeRASP Android dependencies. Add the following to your settings.gradle located in your Unity project at Assets/Plugins/Android/settings.gradle.

2

Add Permissions

Some callbacks require additional permissions to function. In your Unity project, locate or create Assets/Plugins/Android/AndroidManifest.xml and add the relevant permissions inside the <manifest> root tag.

Some permissions also require a runtime request from the user.

Screenshot and Screen Recording Detection

Screenshot detection requires Android 14 (API level 34) or higher.

Screen Recording detection requires Android 15 (API level 35) or higher. Application of FLAG_SECURE on Android Window or calling blockScreenCapture(true) disables this callback.

Location Spoofing Detection

Unsecure WiFi Detection

iOS Setup

1

Export the Project to Xcode

In Unity, navigate to File → Build Settings. Select iOS as the target platform and click Switch Platform. Then click Build to export the project as an Xcode project.

2

Download the Talsec Framework

Download the native TalsecRuntime.xcframework asset from the freeRASP iOS GitHub Releases page.

Download TalsecRuntime.xcframework

3

Add the Framework to Xcode

Copy the TalsecRuntime.xcframework into your Xcode Application folder. Drag and drop the TalsecRuntime.xcframework into your .xcworkspace tree in Xcode.

4

Navigate to Target -> Build Phases -> Link Binary With Libraries and add the TalsecRuntime framework.

5

Embed and Sign

Navigate to General -> Frameworks, Libraries, and Embedded Content and set the TalsecRuntime framework status to Embed & Sign.

🖥️ Check Talsec Portal

Check out Data Visualisation Portal and register using your watcherMail to see your data. If you integrated the SDK successfully, the application will be present after a few hours. The visualisations will be active later due to the bucketing mechanism.

Last updated