LogoLogo
HomeArticlesCommunity ProductsPremium ProductsGitHubTalsec Website
  • 👋Introduction
  • đŸ› ī¸Integration
    • 🤖Android
      • API
      • Troubleshooting
    • 🍎iOS
      • API
      • Troubleshooting
    • đŸĻFlutter
      • FlutterFlow
      • API
      • Troubleshooting
    • âš›ī¸React Native
      • Expo
      • API
      • Troubleshooting
    • 👾Cordova
      • API
      • Troubleshooting
    • đŸĒŊCapacitor
      • API
      • Troubleshooting
    • 🎮Unity [NEW!]
  • 🚀Features and Pricing plans
    • The Key Differences: freeRASP vs. RASP+
  • 🎤What's New and Changelog
  • 📊Security Report
  • âš–ī¸User Data Policies
  • 📄License
  • 🤝Fair Usage Policy (FUP)
  • â„šī¸Wiki
    • Getting Signing Certificate Hash
    • Callback Delay, Telemetry Impact, and Threat Scanning Completion Status
    • Threat detection
      • Detecting rooted or jailbroken devices
      • Emulator detection
      • Hook detection
      • App tampering detection
      • Debugger detection
      • Detecting unofficial installation
      • Device binding detection
      • Missing obfuscation detection [Android devices only]
      • Secure Hardware detection (Keystore/Keychain secure storage check)
      • Passcode
      • System VPN detection
      • Developer Mode detection [Android devices only]
      • ADB enabled detection [Android devices only]
      • Screen Capture
    • Source code obfuscation
    • isProd flag
  • đŸĻ‰FAQ
  • 🧑‍đŸ’ģAbout Us
  • 🤝Contribution
Powered by GitBook
On this page
  • 📝 Prerequisites
  • Android
  • đŸ“Ļ Install Plugin
  • Set Up the Configuration for Your App
  • Handle detected threats
  • Add freeRASP Maven Repository
  • iOS

Was this helpful?

Export as PDF
  1. Integration

Unity [NEW!]

PreviousTroubleshootingNextFeatures and Pricing plans

Last updated 19 hours ago

Was this helpful?

📝 Prerequisites

The freeRASP has the following prerequisites that must be met before starting:

  • Unity Editor level: 6 or higher

  • Minimum SDK level: 23 or higher

Android

đŸ“Ļ Install Plugin

First, you'll need to install freeRASP for Unity. Head over to and download the latest plugin. The plugin file should have a .unitypackage extension.

Next, import the plugin into your Unity project: right-click on Assets → Import Package → Custom Package.

Set Up the Configuration for Your App

In your app’s entry point, import freeRASP and add the following code:

using UnityEngine;

public class Game : MonoBehaviour
{
    // Start is called once before the first execution of Update after the MonoBehaviour is created
    void Start()
    {
        bool isProd = true;
        string watcherMailAddress = "your_mail@example.com";

        // Android related configs
        string expectedPackageName = "com.unity.rasp.game";
        string[] expectedSigningCertificateHashBase64 = new string[] { "Tmac/QIomCqEGS1jYqy9cMMrqaitVoZLpjXzCMnt55Q=" };
        string[] blacklistedPackageNames = new string[] { "com.example.app" };
        string[] supportedAlternativeStores = new string[] { "com.sec.android.app.samsungapps" };

        // initialize talsec
        TalsecPlugin.Instance.initAndroidTalsec(expectedPackageName, expectedSigningCertificateHashBase64,
        blacklistedPackageNames, supportedAlternativeStores, watcherMailAddress, isProd);
        TalsecPlugin.Instance.setAndroidCallback(this); // set Android callback
    }

    // Update is called once per frame
    void Update()
    {

    }
}

Handle detected threats

To receive threat notifications, implement the AndroidThreatDetectedCallback interface. It contains multiple methods that are triggered when freeRASP periodically scans the device for security threats. Implement these methods within your game logic or main application class.

// Implementation of IAndroidCallback interface
public void onRootDetected()
{
    Debug.Log("Root detected");
}

public void onTamperDetected()
{
    Debug.Log("Tamper detected");
}

public void onDebuggerDetected()
{
    Debug.Log("Debugger detected");
}

public void onEmulatorDetected()
{
    Debug.Log("Emulator detected");
}

public void onObfuscationIssuesDetected()
{
    Debug.Log("Obfuscation issues detected");
}
public void onScreenshotDetected()
{
    Debug.Log("Screenshot detected");
}

public void onScreenRecordingDetected()
{
    Debug.Log("Screen recording detected");
}

public void onUntrustedInstallationSourceDetected()
{
    Debug.Log("Untrusted installation source detected");
}

public void onHookDetected()
{
    Debug.Log("Hook detected");
}

public void onDeviceBindingDetected()
{
    Debug.Log("Device binding detected");
}

public void onMalwareDetected(List<SuspiciousAppInfo> malwareList)
{
    Debug.Log("Malware detected " + malwareList);
}

Add freeRASP Maven Repository

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)

    repositories {
        google()
        mavenCentral()

        maven { url 'https://jitpack.io' }
        maven { url 'https://europe-west3-maven.pkg.dev/talsec-artifact-repository/freerasp' }

        flatDir {
            dirs "${project(':unityLibrary').projectDir}/libs"
        }
    }
}

iOS

To ensure freeRASP works properly, you need to configure and initialize it with the required settings. All necessary values must be provided for the plugin to function correctly. Detailed explanations of each configuration option are available on the .

The first step involves obtaining your app's signing certificate hashes in Base64 format. Refer to the provided for comprehensive guidance on app signing, which covers both manual signing methods and Google Play's app signing service.

đŸ› ī¸
🎮
Android API documentation page
manual
[Github Unity Plugin Release Link]