In this article, we will explore how to implement freeRASP in mobile applications to enhance security. With increasing risks such as rooting, hooking, and reverse engineering, freeRASP emerges as an open-source solution that helps detect potential attacks. When implemented correctly, developers can maintain optimal app performance while adding an extra layer of protection for user data.
Table of Contents
Why Runtime Protection Matters Today
Mobile apps increasingly process sensitive data (payments, personal information, internal tools) and are a high‑value target for attackers. While secure coding, TLS, strong authentication, and server‑side validation are essential, they cannot detect certain runtime threats like dynamic instrumentation (Frida), app tampering, or a device that has been rooted or jailbroken.
Runtime Application Self‑Protection (RASP) runs inside the app to detect these conditions and lets your app react in real time, warn the user, disable risky features, or block the app when necessary. freeRASP by Talsec is an open, developer‑centric RASP toolkit that you can integrate into mobile apps. It’s not limited to Flutter. freeRASP also supports native Android and iOS, as well as popular hybrid frameworks like React Native, Cordova, Capacitor, and even the Unity game engine.
This article walks through what freeRASP is, why you’d adopt it, a practical Flutter integration, recommended policies for handling detections (including a blocking dialog for rooted/jailbroken devices), and what you’ll see in the Talsec Portal.
What Is freeRASP and What Does It Do?
At a high level, freeRASP is an in‑app protection SDK that performs periodic and event‑driven checks to detect suspicious runtime states. Key capabilities include:
- Root / Jailbreak detection (Magisk, common jailbreak indicators)
- Hooking / instrumentation detection (Frida and similar frameworks)
- Debugger detection
- Integrity / tampering checks (signature and repackaging detection)
- Emulator / simulator detection
- Screenshot and screen‑recording detection (platform dependent; newer Android and iOS APIs are used where available)
- Optional malware / installed‑app scanning via the
freeMalwareDetectionmodule (Android) - Telemetry forwarding to the Talsec Data Visualisation Portal for event analysis and trending
Why add freeRASP? Because it detects incidents that static code analysis and server checks cannot. Those that only appear while the app is running on a compromised device or in the presence of dynamic instrumentation. With freeRASP you get both in‑app callbacks to enforce defenses and telemetry for monitoring.
Important: freeRASP is defense in depth. It complements, not replaces secure architecture and server‑side enforcement.
Tutorial: How to Implement freeRASP Hands-on in Flutter
Prerequisites
Your project must has the following prerequisites to implement freeRASP:
- Minimum SDK level: 23 or higher
- Gradle version: 8.12.1 or higher
- Compile SDK version: 35
- Kotlin version: 2.1.0
- Your Android app signing certificate hash(es) (Base64 SHA256) for release integrity checks. Read more here
- iOS: correct bundle IDs and Team ID (Xcode 15 recommended)
- A
watcherMailto register in the Talsec Portal if you want telemetry
Tip: integrate in a staging build with
isProd=falsefirst so tests and callbacks don’t affect production users.
Practical Step
Install the package
From your project root run:
flutter pub add freeraspThis registers the Flutter plugin and pulls in the native SDKs.
Android manifest (optional — screenshot & screen‑record detection)
To enable screenshot or screen‑record detection on Android, add the appropriate permissions in android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.DETECT_SCREEN_CAPTURE" />
<uses-permission android:name="android.permission.DETECT_SCREEN_RECORDING" />Note: these capabilities depend on Android version (Android 14/15 behaviors). Follow platform guidance for compatibility.
Initialize freeRASP in main.dart
Below is a concise initialization example. Make sure you compute and provide your release signing certificate hashes (Android) and correct iOS identifiers.
import 'package:flutter/widgets.dart';
import 'package:freerasp/freerasp.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final config = TalsecConfig(
androidConfig: AndroidConfig(
packageName: 'com.mycompany.myapp',
signingCertHashes: ['<RELEASE_BASE64_SHA256>'],
supportedStores: ['com.android.vending'],
),
iosConfig: IOSConfig(
bundleIds: ['com.mycompany.myapp'],
teamId: 'YOUR_TEAM_ID',
),
watcherMail: '[email protected]',
isProd: false, // start in staging
);
Talsec.instance.attachListener(appThreatCallback);
await Talsec.instance.start(config);
}
// Example: central threat callback (see next section for the blocking dialog)
final appThreatCallback = ThreatCallback(
onAppIntegrity: () => print('integrity issue'),
onObfuscationIssues: () => print('obfuscation missing'),
onDebug: () => print('debugger present'),
onHooks: () => print('hooks detected'),
onScreenshot: () => print('screenshot taken'),
onRoot: () => handleRootOrJailbreak(), // More on this below
onJailbreak: () => handleRootOrJailbreak(), // More on this below
);Handle detections — blocking dialog for root / jailbreak (recommended example)
When you detect a rooted or jailbroken device, you may want to block app usage. Below is a Flutter pattern that shows a non‑dismissible blocking dialog. The dialog cannot be closed via outside taps or the back button.
Implementation notes: dispatch threat events to a component that has access to a BuildContext (for example a top‑level Navigator using a GlobalKey, a Provider/Riverpod handler, or a state manager).
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();
void handleRootOrJailbreak() {
final context = navigatorKey.currentState?.overlay?.context;
if (context == null) return; // fallback: log + report
showDialog(
context: context,
barrierDismissible: false,
builder: (context) => WillPopScope(
onWillPop: () async => false, // disables system back
child: AlertDialog(
title: const Text('Security issue detected'),
content: const Text('This device appears to be rooted/jailbroken. For your safety, the app is blocked.'),
actions: [
TextButton(
onPressed: () async {
// report to backend and exit
// await reportDetectionToServer();
SystemNavigator.pop(); // exits the app
},
child: const Text('Close app'),
),
],
),
),
);
}UX considerations:
- Use non‑dismissible blocking only for high‑severity detections (tampering, hooking, confirmed root). For lower severity, consider a soft warning + feature restrictions.
- Provide support and remediation guidance in help channels to reduce support burden (e.g., steps to remove root/jailbreak or use a trusted device).
- Log the event to analytics and the Talsec Portal for triage.
Obfuscation and ProGuard
Ensure your release build uses R8/ProGuard obfuscation. The SDK provides ProGuard consumer rules; do not remove them unless you understand the implications. Obfuscation increases the effort required to reverse‑engineer your binary.
Optional: freeMalwareDetection (Android)
If your app needs to detect suspicious installed packages or risky permissions, the optional module can augment signals. Use it thoughtfully to avoid privacy issues and comply with store policies.
What You’ll See in The Talsec Portal (Data Visualisation)
When telemetry is enabled (watcherMail), events are reported to the Talsec Portal where you can:
- See a threat overview (counts and time series for hooks, tampering, root/jailbreak, debuggers)
- Drill into individual incidents with device fingerprints, timestamps, and contextual metadata
- View device & environment analytics (OS versions, store distribution, common indicators)
- Generate reports and export CSVs for audits
- Monitor trends and benchmarks versus anonymized aggregate data

Policy, false positives, and operational tips
- Start in staging: validate signals and tune callbacks.
- Log everything: always record detection metadata so you can investigate false positives.
- Graceful UX: balance security and customer experience — for consumer apps, prefer restricting sensitive flows before a hard block; for banking or high‑risk apps, stricter blocking may be appropriate.
- Compliance: be careful when using malware detection or scanning installed packages; ensure compliance with privacy policies and store rules.
Conclusion
freeRASP provides a practical and lightweight way to add an extra layer of runtime protection to mobile applications. The Flutter plugin makes integration easier, while the native SDK and hybrid wrappers enable a consistent protection strategy across platforms.
By understanding how to implement freeRASP correctly—from server-side checks, secure storage, to strong authentication—developers can make it an essential part of a defense-in-depth strategy. Start from staging, collect telemetry, configure policies (warning vs. blocking), and then roll out to production with proper signing and obfuscation.
At LOGIQUE, we emphasize security, performance, and scalability in every Flutter application development project to ensure reliable results. If you need assistance with mobile app development, feel free to contact us. Our expert team is ready to provide comprehensive consultation to design the best development strategy for your business.
