🎮Unity
🚨 freeRASP for Unity – Early Release [6/2025]
We’re excited to introduce freeRASP for Unity as a new flavor of our runtime protection library. As it’s still fresh, you may encounter some integration issues that need to be ironed out.
We’d love to hear about your experience—good or bad. Please open an issue on GitHub or write us directly at support@talsec.app. Your feedback helps us make it better!
📝 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
Download the Plugin
Download the latest freeRASP.unitypackage file from the GitHub Release page.
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
truefor production builds andfalsefor development builds.
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,onObfuscationIssuesiOS-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.
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
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
Download the Talsec Framework
Download the native TalsecRuntime.xcframework asset from the freeRASP iOS GitHub Releases page.
🖥️ 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.
You have to use the same email for the Portal as you used for the watcherMail parameter.
Last updated

