đžCordova
đ Prerequisites
The freeRASP has the following prerequisites that must be met before starting.
Android
freeRASP requires minSdkVersion
level of >=23, targetSdkVersion
level of >=31 and Kotlin support. Add the following lines to the config.xml
file in your project root directory.
Then run the following command to apply the preferences:
iOS
freeRASP plugin uses Swift. Install the following plugin to support Swift in your project.
đĻ Install the plugin
Set Talsec's Artifact Registry in your project's build.gradle
(or settings.gradle
if you are using settings repositories):
Make sure that Talsec's maven dependency is at the last position.
Set dependencies in your :app module's build.gradle
:
âī¸ Setup the Configuration for your App
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. Use the following template to configure the plugin. 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 the entry point to your app, import freeRASP and add the code below.
đˇ Handle detected threats
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.
Threat reactions can be specified inside a JavaScript object, which is then passed into the initialization function:
đĄī¸ Start freeRASP
freeRASP can be started after the Cordova initialization is completed, for example, inside the onDeviceReady
function in the index.js
.
đĢŖ Enable source code obfuscation
The easiest way to obfuscate your app is via code minification, a technique that reduces the size of the compiled code by removing unnecessary characters, whitespace, and renaming variables and functions to shorter names. It can be configured for Android devices in android/app/build.gradle
like so:
Additionally, create or extend proguard-rules.pro
in android/app
folder and exclude Cordovaâs specific classes that rely on package names from being obfuscated:
Please note that some other modules in your app may rely on reflection, therefore it may be necessary to add corresponding keep rules into proguard-rules.pro file.
If there is a problem with the obfuscation, freeRASP will notify you about it via obfuscationIssues
callback.
Read more about why this is important in the wiki.
Last updated