Flutter
Last updated
Was this helpful?
Last updated
Was this helpful?
The freeRASP has the following prerequisites that must be met before starting.
freeRASP requires a minimum SDK level of 23. Some versions of Flutter projects, by default, support even lower levels of minimum SDK. This creates an inconsistency we must solve by updating the minimum SDK level of the application:
From the root of your project, go to android
> app
> build.gradle
.
In defaultConfig,
update minSdkVersion
property to at least 23 (Android 6.0) or higher.
To detect screenshots and screen recordings , add the following permissions to your AndroidManifest.xml
file:
Screenshot Detection is supported on Android 14 (API level 34) and higher. Screen Recording Detection is supported on Android 15 (API level 35) and higher.
Xcode 15 is required to be able to build the application
Run the following command inside the project directory to add the freeRASP dependency:
To ensure freeRASP functions correctly, you need to provide the necessary configuration and initialize it. All required values must be filled in for the plugin to operate properly. Detailed descriptions of the configuration options are provided on the API page.
For Android apps, you must get your expected signing certificate hashes in Base64 form. You can go through this manual to learn how to sign your app in more detail, including manual signing and using Google's Play app signing.
In the entry point to your app, import freeRASP and add the following code:
It is necessary that Flutter Bindings are initialized. This can be satisfied by calling WidgetsFlutterBinding.ensureInitialized()
, as shown in the code snippet above.
freeRASP executes periodical checks when the application is running. You can handle the detected threats using listeners. For example, you can log the event, show a window to the user or kill the application. See the Threat detection in the wiki to learn more details about the performed checks and their importance for app security.
freeRASP reacts to threats using ThreatCallback
. Internally, each threat has its own callback (of VoidCallback
type), which is called when a threat is detected.
Start freeRASP to detect threats just by adding this line below the created config and the callback handler:
For the version youβre integrating, you can find the specific dSYMs for debugging in Releases.
In order to provide as much protection as possible, freeRASP enhances security measures by implementing ProGuard consumer rules, which obfuscate specific sections of the SDK. However, these rules are applied to your Android app code as well due to inheritance.
In certain cases, you may prefer to exclude this rule.
To remove the rule, you need to find freerasp
in your cache folder. More about where to find the cache folder here. Then navigate to the freerasp-X.Y.Z/android/build.gradle
file and delete the line:
Read more about why obfuscation is important in the wiki.
freeMalwareDetection is a powerful feature designed to enhance the security of your Android application by quickly and efficiently scanning for malicious or suspicious applications (e.g. Android malware) based on various blacklists and security policies.
It helps to detect apps with suspicious package names, hashes, or potentially dangerous permissions.
Visit the freeMalwareDetection repository to learn more about this feature! For the integration, refer to the integration guide for the Flutter platform.
isProd
is a boolean flag that determines whether the freeRASP integration is in the Dev or Release version. If you want to learn more about isProd
, visit this wiki section.