Skip to content

Commit de12a24

Browse files
committed
feat: add permissions, killOnBypass
1 parent 7817025 commit de12a24

File tree

9 files changed

+68
-4
lines changed

9 files changed

+68
-4
lines changed

CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,55 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [4.3.0] - 2025-10-31
9+
10+
- Android SDK version: 17.0.0
11+
- iOS SDK version: 6.13.0
12+
13+
### React Native
14+
15+
#### Added
16+
17+
- Added `killOnBypass` to `TalsecConfig` that configures if the app should be terminated when the threat callbacks are suppressed/hooked by an attacker (Android only) ([Issue 65](https://github.com/talsec/Free-RASP-Android/issues/65))
18+
- Added API for `timeSpoofing` callback into `ThreatEventActions` (Android only)
19+
- Added API for `unsecureWifi` callback into `ThreatEventActions` (Android only)
20+
- Added API for `allChecksFinished` callback into new `RaspExecutionStateEventActions` object
21+
- Added matched permissions to `SuspiciousAppInfo` object when malware detection reason is `suspiciousPermission`
22+
23+
### Android
24+
25+
#### Added
26+
27+
- Added `killOnBypass` method to the `TalsecConfig.Builder` that configures if the app should be terminated when the threat callbacks are suppressed/hooked by an attacker [Issue 65](https://github.com/talsec/Free-RASP-Android/issues/65)
28+
- We are introducing a new capability, detecting whether the device time has been tampered with (`timeSpoofing`)
29+
- We are introducing a new capability, detecting whether the location is being spoofed on the device (`locationSpoofing`)
30+
- We are introducing a new capability, detection of unsecure WiFi (`unecureWifi`)
31+
- Removed deprecated functionality `Pbkdf2Native` and both related native libraries (`libpbkdf2_native.so` and `libpolarssl.so`)
32+
- Added new `RaspExecutionState` which contains `onAllChecksFinished()` method, which is triggered after all checks are completed.
33+
- Added matched permissions to `SuspiciousAppInfo` object when malware detection reason is `suspiciousPermission`
34+
- New option to start Talsec, `Talsec.start()` takes new parameter `TalsecMode` that determines the dispatcher thread of initialization and sync checks (uses background thread by default)
35+
- Capability to check if another app has an option `REQUEST_INSTALL_PACKAGES` enabled in the system settings to malware detection
36+
37+
#### Fixed
38+
39+
- ANR issue caused by `registerScreenCaptureCallback()` method on the main thread
40+
- `NullPointerException` when checking key alias in Keystore on Android 7
41+
- `JaCoCo` issue causing `MethodTooLargeException` during instrumentation
42+
- `DeadApplicationException` when calling `Settings.Global.getInt` or `Settings.Secure.getInt` on invalid context
43+
- `AndroidKeyStore` crashes causing `java.util.concurrent.TimeoutException` when calling `finalize()` method on `Cipher` (GC issues)
44+
45+
#### Changed
46+
47+
- Shortened the value of threat detection interval
48+
- Refactoring of internal architecture of SDK that newly uses Coroutines to manage threading
49+
- Update of internal dependencies and security libraries
50+
51+
### iOS
52+
53+
#### Changed
54+
55+
- Updated internal dependencies
56+
857
## [4.2.4] - 2025-09-17
958

1059
- iOS SDK version: 6.12.1

android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import android.util.Log
88
import com.aheaditec.talsec_security.security.api.SuspiciousAppInfo
99
import com.aheaditec.talsec_security.security.api.Talsec
1010
import com.aheaditec.talsec_security.security.api.TalsecConfig
11+
import com.aheaditec.talsec_security.security.api.TalsecMode
1112
import com.aheaditec.talsec_security.security.api.ThreatListener
1213
import com.facebook.react.bridge.Arguments
1314
import com.facebook.react.bridge.LifecycleEventListener
@@ -71,7 +72,7 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
7172
FreeraspThreatHandler.listener = ThreatListener
7273
listener.registerListener(reactContext)
7374
runOnUiThread {
74-
Talsec.start(reactContext, config)
75+
Talsec.start(reactContext, config, TalsecMode.BACKGROUND)
7576
mainHandler.post {
7677
talsecStarted = true
7778
// This code must be called only AFTER Talsec.start
@@ -231,8 +232,9 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
231232

232233
val talsecBuilder = TalsecConfig.Builder(packageName, certificateHashes)
233234
.watcherMail(config.getString("watcherMail"))
234-
.supportedAlternativeStores(androidConfig.getArraySafe("supportedAlternativeStores"))
235235
.prod(config.getBooleanSafe("isProd"))
236+
.killOnBypass(config.getBooleanSafe("killOnBypass", false))
237+
.supportedAlternativeStores(androidConfig.getArraySafe("supportedAlternativeStores"))
236238

237239
if (androidConfig.hasKey("malwareConfig")) {
238240
val malwareConfig = androidConfig.getMapThrowing("malwareConfig")

android/src/main/java/com/freeraspreactnative/models/RNSuspiciousAppInfo.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import kotlinx.serialization.Serializable
1010
data class RNSuspiciousAppInfo(
1111
val packageInfo: RNPackageInfo,
1212
val reason: String,
13+
val permissions: Set<String>?
1314
)
1415

1516
/**

android/src/main/java/com/freeraspreactnative/utils/Extensions.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ internal fun SuspiciousAppInfo.toRNSuspiciousAppInfo(context: ReactContext): RNS
7575
return RNSuspiciousAppInfo(
7676
packageInfo = this.packageInfo.toRNPackageInfo(context),
7777
reason = this.reason,
78+
permissions = this.permissions
7879
)
7980
}
8081

example/src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const App = () => {
5454
},
5555
watcherMail: 'your_email_address@example.com',
5656
isProd: true,
57+
killOnBypass: true,
5758
};
5859

5960
const actions = {

example/src/MalwareItem.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ export const MalwareItem: React.FC<{ app: SuspiciousAppInfo }> = ({ app }) => {
9292
</Text>
9393
<Text style={styles.listItemTitle}>Detection reason:</Text>
9494
<Text style={styles.listItem}>{app.reason}</Text>
95+
<Text style={styles.listItemTitle}>Granted permissions:</Text>
96+
<Text style={styles.listItem}>
97+
{app.permissions?.join(', ') ?? 'Not specified'}
98+
</Text>
9599
<HStack style={styles.buttonGroup}>
96100
<Button
97101
title={'Add to whitelist'}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "freerasp-react-native",
3-
"version": "4.2.4",
3+
"version": "4.3.0",
44
"description": "React Native plugin for improving app security and threat monitoring on Android and iOS mobile devices.",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

src/types/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export type TalsecConfig = {
33
iosConfig?: TalsecIosConfig;
44
watcherMail: string;
55
isProd?: boolean;
6+
killOnBypass?: boolean;
67
};
78

89
export type TalsecAndroidConfig = {
@@ -27,6 +28,7 @@ export type TalsecMalwareConfig = {
2728
export type SuspiciousAppInfo = {
2829
packageInfo: PackageInfo;
2930
reason: string;
31+
permissions?: string[];
3032
};
3133

3234
export type PackageInfo = {

src/utils/malware.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ export const parseMalwareData = async (
1616
export const toSuspiciousAppInfo = (base64Value: string): SuspiciousAppInfo => {
1717
const data = JSON.parse(Buffer.from(base64Value, 'base64').toString('utf8'));
1818
const packageInfo = data.packageInfo as PackageInfo;
19-
return { packageInfo, reason: data.reason } as SuspiciousAppInfo;
19+
return {
20+
packageInfo,
21+
reason: data.reason,
22+
permissions: data.permissions,
23+
} as SuspiciousAppInfo;
2024
};

0 commit comments

Comments
 (0)