Skip to content

Commit 5b912aa

Browse files
authored
Free-RASP KMP: initial multi-module Android/iOS implementation
This squash commit sets up and publishes the initial multi-module Free-RASP KMP library with Android and iOS integrations, adds malware and screen-capture protections plus new detection callbacks and configuration validation, unifies naming and packaging, improves error handling and docs, and configures ProGuard and Maven publishing to a private GCP Artifact Registry.
1 parent 7293837 commit 5b912aa

File tree

75 files changed

+2901
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2901
-0
lines changed

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Talsec
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
![FreeRasp](https://raw.githubusercontent.com/talsec/Free-RASP-Community/master/visuals/freeRASP.png)
2+
3+
![GitHub Repo stars](https://img.shields.io/github/stars/talsec/Free-RASP-Community?color=green) ![GitHub](https://img.shields.io/github/license/talsec/Free-RASP-Community) ![GitHub](https://img.shields.io/github/last-commit/talsec/Free-RASP-Community) ![Publisher](https://img.shields.io/pub/publisher/freerasp) [![42matters](https://42matters.com/badges/sdk-installations/talsec)](https://42matters.com/sdks/android/talsec)
4+
5+
[<img src="https://assets.42matters.com/badges/2024/04/rising-star.svg?m=04" width="100"/>](https://42matters.com/sdks/android/talsec)
6+
7+
# freeRASP for Kotlin Multiplatform
8+
9+
freeRASP for Kotlin Multiplatform is a mobile in-app protection and security monitoring plugin. It aims to cover the main aspects of RASP (Runtime App Self Protection) and application shielding.
10+
11+
:loudspeaker: [The official documentation has been moved to a new location. You can now find it here](https://docs.talsec.app/docs-and-articles-portal?utm_source=github). :loudspeaker:
12+
13+
# Overview
14+
15+
The freeRASP is available for Flutter, Cordova, React Native, Android, iOS and Kotlin Multiplatform developers. We encourage community contributions, investigations of attack cases, joint data research, and other activities aiming to make better app security and app safety for end-users.
16+
17+
freeRASP plugin is designed to combat
18+
19+
- Reverse engineering attempts
20+
- Re-publishing or tampering with the apps
21+
- Running application in a compromised OS environment
22+
- Malware, fraudsters, and cybercriminal activities
23+
24+
Key features are the detection and prevention of
25+
26+
- Root/Jailbreak (e.g., su, Magisk, unc0ver, check1rain, Dopamine)
27+
- Hooking framework (e.g., Frida, Shadow)
28+
- Untrusted installation method
29+
- App/Device (un)binding
30+
31+
Additional freeRASP features include low latency, easy integration and a weekly [Security Report](https://docs.talsec.app/freerasp/security-report?utm_source=github) containing detailed information about detected incidents and potential threats, summarizing the state of your app security.
32+
33+
The commercial version provides a top-notch protection level, extra features, support and maintenance. One of the most valued commercial features is AppiCrypt® - App Integrity Cryptogram.
34+
35+
It allows easy to implement API protection and App Integrity verification on the backend to prevent API abuse:
36+
37+
- Bruteforce attacks
38+
- Botnets
39+
- Session-hijacking
40+
- DDoS
41+
42+
It is a unified solution that works across all mobile platforms without dependency on external web services (i.e., without extra latency, an additional point of failure, and maintenance costs).
43+
44+
Learn more about commercial features at [https://talsec.app](https://talsec.app?utm_source=github).
45+
46+
Learn more about freemium freeRASP features at [GitHub main repository](https://github.com/talsec/Free-RASP-Community).
47+
48+
## :radioactive: freeMalwareDetection
49+
**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.
50+
51+
After the integration of freeRASP, make sure you visit the [freeMalwareDetection](https://github.com/talsec/freeMalwareDetection) repository to learn more about this feature!
52+
53+
# :book: Discover the Official freeRASP Documentation
54+
55+
Visit the [GitBook page](https://docs.talsec.app/freerasp) for comprehensive and up-to-date guides, tutorials, and technical documentation specifically for freeRASP. It serves as your go-to resource, offering everything from basic instructions to advanced tips and tricks to help you get the most out of the project.
56+
57+
:loudspeaker: [The official documentation has been moved to a new location. You can now find it here](https://docs.talsec.app/docs-and-articles-portal?utm_source=github). :loudspeaker:
58+
59+
## :link: Integration Guide
60+
61+
For integrating freeRASP on the React Native platform, be sure to follow all the steps in the [Integration Guide](https://docs.talsec.app/freerasp/integration?utm_source=github). This guide provides detailed instructions to help you achieve a smooth and efficient integration.
62+
63+
Be sure to bookmark it and stay informed! :books: :sparkles:.
64+
65+
# :rocket: What's New and Changelog
66+
67+
Stay informed and make the most of freeRASP by checking out [What's New and Changelog](https://docs.talsec.app/freerasp/whats-new-and-changelog?utm_source=github)! Here, you’ll discover the latest features, enhancements, and bug fixes we’ve implemented to improve your experience across all platforms, including Android, iOS, Flutter, React Native, Capacitor, Cordova and Kotlin Multiplatform.
68+
69+
Don’t miss out on any updates and explore the changelog to see how we’re continually making freeRASP better for you!
70+
71+
# :sparkles: Enhancements
72+
73+
If you have any ideas for improvements, feel free to [raise an issue](https://github.com/talsec/Free-RASP-KMP/issues) and mark it with an **enhancement** label. We track these enhancements using [GitHub Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects) to keep tasks organized and connected to relevant issues or pull requests.
74+
75+
You can check out the project board [here](https://github.com/orgs/talsec/projects/2).
76+
77+
# :page_facing_up: License
78+
79+
This project is provided as freemium software, i.e. there is a [fair usage policy](https://docs.talsec.app/freerasp/features-and-pricing-plans#plans-comparison?utm_source=github) that imposes some limitations on the free usage. The SDK software consists of open-source and binary parts, which is the property of Talsec. The open-source part is licensed under the MIT License - see the LICENSE file for details.

build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins {
2+
alias(libs.plugins.androidLibrary) apply false
3+
alias(libs.plugins.kotlinMultiplatform) apply false
4+
alias(libs.plugins.vanniktech.mavenPublish) apply false
5+
alias(libs.plugins.kotlinCocoapods) apply false
6+
alias(libs.plugins.androidApplication) apply false
7+
alias(libs.plugins.composeMultiplatform) apply false
8+
}
9+

example/.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*.iml
2+
.kotlin
3+
.gradle
4+
**/build/
5+
xcuserdata
6+
!src/**/build/
7+
local.properties
8+
.idea
9+
.DS_Store
10+
captures
11+
.externalNativeBuild
12+
.cxx
13+
*.xcodeproj/*
14+
!*.xcodeproj/project.pbxproj
15+
!*.xcodeproj/xcshareddata/
16+
!*.xcodeproj/project.xcworkspace/
17+
!*.xcworkspace/contents.xcworkspacedata
18+
**/xcshareddata/WorkspaceSettings.xcsettings

example/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
This is a Kotlin Multiplatform project targeting Android, iOS.
2+
3+
* [/composeApp](./composeApp/src) is for code that will be shared across your Compose Multiplatform applications.
4+
It contains several subfolders:
5+
- [commonMain](./composeApp/src/commonMain/kotlin) is for code that’s common for all targets.
6+
- Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name.
7+
For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app,
8+
the [iosMain](./composeApp/src/iosMain/kotlin) folder would be the right place for such calls.
9+
Similarly, if you want to edit the Desktop (JVM) specific part, the [jvmMain](./composeApp/src/jvmMain/kotlin)
10+
folder is the appropriate location.
11+
12+
* [/iosApp](./iosApp/iosApp) contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform,
13+
you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project.
14+
15+
16+
Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html)
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
3+
plugins {
4+
alias(libs.plugins.kotlinMultiplatform)
5+
alias(libs.plugins.androidApplication)
6+
alias(libs.plugins.composeMultiplatform)
7+
alias(libs.plugins.composeCompiler)
8+
}
9+
10+
kotlin {
11+
androidTarget {
12+
compilerOptions {
13+
jvmTarget.set(JvmTarget.JVM_17)
14+
}
15+
}
16+
17+
listOf(
18+
iosX64(),
19+
iosArm64(),
20+
iosSimulatorArm64()
21+
).forEach { iosTarget ->
22+
iosTarget.binaries.framework {
23+
baseName = "ComposeApp"
24+
isStatic = true
25+
26+
freeCompilerArgs += "-Xbinary=bundleId=com.aheaditec.talsec.example"
27+
}
28+
}
29+
30+
sourceSets {
31+
androidMain.dependencies {
32+
implementation(compose.preview)
33+
implementation(libs.androidx.activity.compose)
34+
implementation(libs.androidx.lifecycle.viewmodelCompose)
35+
implementation(libs.androidx.lifecycle.runtimeCompose)
36+
}
37+
commonMain.dependencies {
38+
implementation(compose.runtime)
39+
implementation(compose.foundation)
40+
implementation(compose.material3)
41+
implementation(compose.ui)
42+
implementation(compose.components.resources)
43+
implementation(compose.components.uiToolingPreview)
44+
45+
implementation(project(":library"))
46+
}
47+
commonTest.dependencies {
48+
implementation(libs.kotlin.test)
49+
}
50+
}
51+
}
52+
53+
android {
54+
namespace = "com.jetbrains.example"
55+
compileSdk = libs.versions.android.compileSdk.get().toInt()
56+
57+
defaultConfig {
58+
applicationId = "com.jetbrains.example"
59+
minSdk = libs.versions.android.minSdk.get().toInt()
60+
targetSdk = libs.versions.android.targetSdk.get().toInt()
61+
versionCode = 1
62+
versionName = "1.0"
63+
}
64+
packaging {
65+
resources {
66+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
67+
}
68+
}
69+
buildTypes {
70+
getByName("release") {
71+
isMinifyEnabled = false
72+
}
73+
}
74+
compileOptions {
75+
sourceCompatibility = JavaVersion.VERSION_17
76+
targetCompatibility = JavaVersion.VERSION_17
77+
}
78+
}
79+
80+
dependencies {
81+
debugImplementation(compose.uiTooling)
82+
}
83+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<uses-permission android:name="android.permission.DETECT_SCREEN_CAPTURE" />
5+
<uses-permission android:name="android.permission.DETECT_SCREEN_RECORDING" />
6+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
7+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
8+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
9+
10+
<application
11+
android:allowBackup="true"
12+
android:icon="@mipmap/ic_launcher"
13+
android:label="@string/app_name"
14+
android:roundIcon="@mipmap/ic_launcher_round"
15+
android:supportsRtl="true"
16+
android:theme="@android:style/Theme.Material.Light.NoActionBar">
17+
<activity
18+
android:exported="true"
19+
android:name=".MainActivity">
20+
<intent-filter>
21+
<action android:name="android.intent.action.MAIN" />
22+
23+
<category android:name="android.intent.category.LAUNCHER" />
24+
</intent-filter>
25+
</activity>
26+
</application>
27+
28+
</manifest>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.jetbrains.example
2+
3+
import android.os.Bundle
4+
import androidx.activity.ComponentActivity
5+
import androidx.activity.compose.setContent
6+
import androidx.activity.enableEdgeToEdge
7+
import androidx.compose.runtime.Composable
8+
import androidx.compose.ui.tooling.preview.Preview
9+
10+
class MainActivity : ComponentActivity() {
11+
override fun onCreate(savedInstanceState: Bundle?) {
12+
enableEdgeToEdge()
13+
super.onCreate(savedInstanceState)
14+
15+
setContent {
16+
App()
17+
}
18+
}
19+
}
20+
21+
@Preview
22+
@Composable
23+
fun AppAndroidPreview() {
24+
App()
25+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.jetbrains.example
2+
3+
import android.os.Build
4+
5+
class AndroidPlatform : Platform {
6+
override val name: String = "Android ${Build.VERSION.SDK_INT}"
7+
}
8+
9+
actual fun getPlatform(): Platform = AndroidPlatform()
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="108dp"
4+
android:height="108dp"
5+
android:viewportWidth="108"
6+
android:viewportHeight="108">
7+
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
8+
<aapt:attr name="android:fillColor">
9+
<gradient
10+
android:endX="85.84757"
11+
android:endY="92.4963"
12+
android:startX="42.9492"
13+
android:startY="49.59793"
14+
android:type="linear">
15+
<item
16+
android:color="#44000000"
17+
android:offset="0.0" />
18+
<item
19+
android:color="#00000000"
20+
android:offset="1.0" />
21+
</gradient>
22+
</aapt:attr>
23+
</path>
24+
<path
25+
android:fillColor="#FFFFFF"
26+
android:fillType="nonZero"
27+
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
28+
android:strokeWidth="1"
29+
android:strokeColor="#00000000" />
30+
</vector>

0 commit comments

Comments
 (0)