đ¤Android
đ Prerequisites
freeRASP requires a minimum SDK level of 23. To update the minimum SDK level of the application, follow these steps:
From the root of your project (or module level), go to the
build.gradle
.Update
minSdkVersion
to at least 23 (Android 6.0) or higher.
đĻ Add the dependency
Set Talsec's Artifact Registry in your project's settings.gradle
(or build.gradle
). You should comment out the relevant section in settings.gradle
, if you want to use build.gradle
, as settings.gradle
is preferred:
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. 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.
Create an arbitrary subclass of
Application()
, override itsonCreate()
method and implementThreatListener.ThreatDetected
interface. You can, of course, use yourApplication
subclass if you already have one in your project. If you encounter issues importingThreatListener.ThreatDetected
, please use 'Sync Project with Gradle Files' to resolve them.âTalsecApplication.ktAdd a new subclass to
AndroidManifest.xml
, inside<application>
tag:AndroidManifest.xmlSet up the Configuration for your app with your values, which are explained in more detail in API.
TalsecApplication.ktTalsecApplication.kt
đˇ Handle detected threats
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 to learn more details about the performed checks and their importance for app security.
Implement methods of
ThreatListener.ThreatDetected
interface:TalsecApplication.ktDo not implement the onMalwareDetected(p0: MutableList<SuspiciousAppInfo>?) callback yet. It will be soon introduced as a new feature of freeRASP, although, it is implemented via this SDK as well. You can use just println("onMalwareDetected") for now.
Optionally, you can use a device state listener to get additional information about the device state, like passcode lock and HW-backed Keystore state:
TalsecApplication.ktModify initialization of
ThreatListener
:TalsecApplication.kt
đĄī¸ Start freeRASP
đ Enable source code obfuscation
You can make sure that the obfuscation is enabled by checking the value of minifyEnabled
property in your module's build.gradle
file.
Read more about why this is important in the wiki.
âĸī¸ (Optionally) Integrate freeMalwareDetection
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 Android platform.
Last updated