freerasp-react-native 5.3.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/README.md +2 -0
- package/android/build.gradle +3 -3
- package/android/proguard-rules.pro +3 -3
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/FreeraspReactNativeModule.kt +177 -17
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/FreeraspReactNativePackage.kt +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/PluginThreatHandler.kt +20 -7
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/ScreenProtector.kt +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/dispatchers/ExecutionStateDispatcher.kt +3 -3
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/dispatchers/ThreatDispatcher.kt +23 -3
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/events/BaseRaspEvent.kt +1 -1
- package/android/src/main/java/app/talsec/rasp/reactnative/events/RaspExecutionStateEvent.kt +22 -0
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/events/ThreatEvent.kt +6 -3
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/exceptions/TalsecException.kt +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/interfaces/PluginExecutionStateListener.kt +2 -2
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/interfaces/PluginThreatListener.kt +4 -2
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/models/RNSuspiciousAppInfo.kt +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/Extensions.kt +4 -4
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/RandomGenerator.kt +1 -1
- package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/Utils.kt +1 -1
- package/ios/FreeraspReactNative.swift +17 -8
- package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeResources +88 -88
- package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeSignature +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +2 -2
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +292 -265
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +10 -11
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +4 -6
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/header.h +9 -9
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +147 -112
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +1 -1
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +14 -23
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/typecheck-gcc.h +420 -403
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +29 -28
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/websockets.h +10 -10
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.abi.json +563 -312
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/_CodeSignature/CodeResources +35 -35
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +483 -1088
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +4 -4
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +292 -265
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +10 -11
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +4 -6
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/header.h +9 -9
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +147 -112
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +1 -1
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +14 -23
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/typecheck-gcc.h +420 -403
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +29 -28
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/websockets.h +10 -10
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.abi.json +548 -297
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +548 -297
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +10 -3
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +43 -43
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +483 -1088
- package/ios/TalsecRuntimePackage/Package.swift +2 -2
- package/ios/dispatchers/ExecutionStateDispatcher.swift +4 -3
- package/ios/models/RaspExecutionStates.swift +10 -3
- package/ios/utils/EventIdentifiers.swift +2 -2
- package/lib/commonjs/api/listeners/raspExecutionState.js +13 -7
- package/lib/commonjs/api/listeners/raspExecutionState.js.map +1 -1
- package/lib/commonjs/api/listeners/threat.js +19 -8
- package/lib/commonjs/api/listeners/threat.js.map +1 -1
- package/lib/commonjs/api/methods/internal.js +20 -0
- package/lib/commonjs/api/methods/internal.js.map +1 -0
- package/lib/commonjs/api/methods/native.js +113 -21
- package/lib/commonjs/api/methods/native.js.map +1 -1
- package/lib/commonjs/api/methods/reactNative.js +38 -10
- package/lib/commonjs/api/methods/reactNative.js.map +1 -1
- package/lib/commonjs/channels/raspExecutionState.js +3 -3
- package/lib/commonjs/channels/raspExecutionState.js.map +1 -1
- package/lib/commonjs/channels/threat.js +4 -4
- package/lib/commonjs/channels/threat.js.map +1 -1
- package/lib/commonjs/index.js +23 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/raspExecutionState.js +4 -2
- package/lib/commonjs/models/raspExecutionState.js.map +1 -1
- package/lib/commonjs/models/threat.js +2 -1
- package/lib/commonjs/models/threat.js.map +1 -1
- package/lib/commonjs/types/errors.js +50 -0
- package/lib/commonjs/types/errors.js.map +1 -0
- package/lib/commonjs/types/types.js +4 -0
- package/lib/module/api/listeners/raspExecutionState.js +10 -4
- package/lib/module/api/listeners/raspExecutionState.js.map +1 -1
- package/lib/module/api/listeners/threat.js +16 -5
- package/lib/module/api/listeners/threat.js.map +1 -1
- package/lib/module/api/methods/internal.js +13 -0
- package/lib/module/api/methods/internal.js.map +1 -0
- package/lib/module/api/methods/native.js +106 -17
- package/lib/module/api/methods/native.js.map +1 -1
- package/lib/module/api/methods/reactNative.js +39 -12
- package/lib/module/api/methods/reactNative.js.map +1 -1
- package/lib/module/channels/raspExecutionState.js +1 -1
- package/lib/module/channels/raspExecutionState.js.map +1 -1
- package/lib/module/channels/threat.js +2 -2
- package/lib/module/channels/threat.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/raspExecutionState.js +4 -2
- package/lib/module/models/raspExecutionState.js.map +1 -1
- package/lib/module/models/threat.js +2 -1
- package/lib/module/models/threat.js.map +1 -1
- package/lib/module/types/errors.js +41 -0
- package/lib/module/types/errors.js.map +1 -0
- package/lib/module/types/types.js +1 -1
- package/lib/typescript/src/api/listeners/raspExecutionState.d.ts.map +1 -1
- package/lib/typescript/src/api/listeners/threat.d.ts.map +1 -1
- package/lib/typescript/src/api/methods/internal.d.ts +7 -0
- package/lib/typescript/src/api/methods/internal.d.ts.map +1 -0
- package/lib/typescript/src/api/methods/native.d.ts +56 -7
- package/lib/typescript/src/api/methods/native.d.ts.map +1 -1
- package/lib/typescript/src/api/methods/reactNative.d.ts +11 -2
- package/lib/typescript/src/api/methods/reactNative.d.ts.map +1 -1
- package/lib/typescript/src/channels/threat.d.ts +1 -0
- package/lib/typescript/src/channels/threat.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/models/raspExecutionState.d.ts +3 -1
- package/lib/typescript/src/models/raspExecutionState.d.ts.map +1 -1
- package/lib/typescript/src/models/threat.d.ts +1 -0
- package/lib/typescript/src/models/threat.d.ts.map +1 -1
- package/lib/typescript/src/types/errors.d.ts +26 -0
- package/lib/typescript/src/types/errors.d.ts.map +1 -0
- package/lib/typescript/src/types/types.d.ts +61 -26
- package/lib/typescript/src/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api/listeners/raspExecutionState.ts +9 -3
- package/src/api/listeners/threat.ts +29 -5
- package/src/api/methods/internal.ts +13 -0
- package/src/api/methods/native.ts +125 -21
- package/src/api/methods/reactNative.ts +46 -16
- package/src/channels/raspExecutionState.ts +1 -1
- package/src/channels/threat.ts +3 -3
- package/src/index.tsx +2 -0
- package/src/models/raspExecutionState.ts +8 -2
- package/src/models/threat.ts +2 -0
- package/src/types/errors.ts +57 -0
- package/src/types/types.ts +66 -26
- package/android/src/main/java/com/freeraspreactnative/events/RaspExecutionStateEvent.kt +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,88 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [6.1.0] - 2026-11-20
|
|
9
|
+
|
|
10
|
+
- Android SDK version: 20.0.1
|
|
11
|
+
- iOS SDK version: 9.0.0
|
|
12
|
+
|
|
13
|
+
### React Native
|
|
14
|
+
|
|
15
|
+
#### Changed
|
|
16
|
+
|
|
17
|
+
- `criticalChecksFinished` and `postponedChecksFinished` RASP execution state actions are now also triggered on iOS
|
|
18
|
+
- On iOS, `fastChecksFinished` is triggered when the fast checks are completed, while the postponed checks may still run, the same as on Android
|
|
19
|
+
|
|
20
|
+
### iOS
|
|
21
|
+
|
|
22
|
+
#### Added
|
|
23
|
+
|
|
24
|
+
- Improved app integrity detection.
|
|
25
|
+
|
|
26
|
+
#### Changed
|
|
27
|
+
|
|
28
|
+
- Improved jailbreak detection.
|
|
29
|
+
- Updated CA bundle.
|
|
30
|
+
- Updated `OpenSSL` dependency to `3.5.8`.
|
|
31
|
+
- Updated `curl` dependency to `8.22.0`.
|
|
32
|
+
- Reduced the SDK size.
|
|
33
|
+
|
|
34
|
+
#### Fixed
|
|
35
|
+
|
|
36
|
+
- Fixed crash in frida port scanning.
|
|
37
|
+
- Fixed stack overflow crash when `blockScreenCapture` is enabled.
|
|
38
|
+
- Fixed missing app integrity detection details in logs for builds with a provisioning profile.
|
|
39
|
+
- Fixed placement of app integrity certificate details in logs.
|
|
40
|
+
|
|
41
|
+
## [6.0.0] - 2026-11-11
|
|
42
|
+
|
|
43
|
+
- Android SDK version: 20.0.1
|
|
44
|
+
- iOS SDK version: 8.0.1
|
|
45
|
+
|
|
46
|
+
### Breaking
|
|
47
|
+
|
|
48
|
+
- `allChecksFinished` RASP execution state action renamed to `fastChecksFinished`. On Android, it is triggered when the fast checks are completed, while the postponed checks may still run; on iOS, when all checks are completed
|
|
49
|
+
- `TalsecIosConfig.appBundleId` (string) replaced by `appBundleIds` (string[]), matching the iOS SDK
|
|
50
|
+
- Methods that resolved with a status string or a constant now resolve to `void`: `talsecStart`, `addToWhitelist`, `blockScreenCapture`, `blockScreenControl`, `startOngoingCallDetection`, `stopOngoingCallDetection`, `storeExternalId`, `removeExternalId`
|
|
51
|
+
- All methods now reject with `TalsecError` (`code`: `talsec-failure`, `unsupported-platform`, `configuration-exception`, `external-id-failure`, `malware-failure`) instead of native errors or plain strings
|
|
52
|
+
- `onInvalidCallback` and `removeListenerForEvent` are no longer exported; use `abortApp` to terminate the app
|
|
53
|
+
|
|
54
|
+
### React Native
|
|
55
|
+
|
|
56
|
+
#### Added
|
|
57
|
+
|
|
58
|
+
- `useFreeRasp` returns `{ started, error }`; `error` is the `TalsecError` that prevented the listeners from being registered or freeRASP from starting, which was previously only logged to the console
|
|
59
|
+
- `ongoingCall` threat action with the new `CallState` type (`'STARTED' | 'ONGOING' | 'STOPPED'`), driven by `startOngoingCallDetection()` and `stopOngoingCallDetection()` (Android only)
|
|
60
|
+
- `blockScreenControl()` and `isScreenControlBlocked()` to prevent accessibility services from reading or controlling the app screen (Android only)
|
|
61
|
+
- `blockOverlayWindows()` and `isOverlayWindowsBlocked()` to hide overlay windows of other apps (Android 12+ only, requires the `HIDE_OVERLAY_WINDOWS` permission)
|
|
62
|
+
- `criticalChecksFinished` and `postponedChecksFinished` RASP execution state actions (Android only)
|
|
63
|
+
|
|
64
|
+
#### Changed
|
|
65
|
+
|
|
66
|
+
- Android package (namespace) of the plugin renamed from `com.freeraspreactnative` to `app.talsec.rasp.reactnative`, following the Android SDK's `app.talsec.rasp` (update the import if you register `FreeraspReactNativePackage` manually)
|
|
67
|
+
- On Android, `isScreenCaptureBlocked()` reports the protection state of the current activity
|
|
68
|
+
- Threat and RASP execution state actions are typed as returning `void` instead of `any`
|
|
69
|
+
|
|
70
|
+
### Android
|
|
71
|
+
|
|
72
|
+
#### Fixed
|
|
73
|
+
|
|
74
|
+
- Improved hook detection to prevent collisions with running VPN services and to better work with the device resources (threads/RAM)
|
|
75
|
+
- Fixed a release crash during root detection when a checked package is not installed
|
|
76
|
+
- Fixed a crash in `ScreenProtector.unregisterScreenCallbacks` on Android 15+ when several activities registered screen callbacks
|
|
77
|
+
- Fixed intermittent build failures of apps using the SDK (`NullPointerException: Cannot read field "d"`, shown by Gradle as `[CIRCULAR REFERENCE]`) caused by invalid bytecode in some SDK builds
|
|
78
|
+
- Fixed `killOnBypass` closing the app when the same threat was reported twice in quick succession
|
|
79
|
+
|
|
80
|
+
#### Changed
|
|
81
|
+
|
|
82
|
+
- Deprecated the freeRASP Maven coordinates (`com.aheaditec.talsec.security:TalsecSecurity-{flavor}`)
|
|
83
|
+
- Improved Bootloader detection
|
|
84
|
+
- Extended emulator detection with additional device-property and ABI checks
|
|
85
|
+
- Improved logging structure and data enrichment for better Portal insights/reports
|
|
86
|
+
- Refactoring of the time spoofing detection which improves the performance of the freeRASP check execution
|
|
87
|
+
- Improved the performance of the App integrity check
|
|
88
|
+
- Updated CA bundle
|
|
89
|
+
|
|
8
90
|
## [5.3.0] - 2026-11-09
|
|
9
91
|
|
|
10
92
|
- Android SDK version: 19.3.1
|
package/README.md
CHANGED
|
@@ -27,6 +27,8 @@ Key features are the detection and prevention of
|
|
|
27
27
|
- Unlocked or compromised bootloader
|
|
28
28
|
- Hooking framework (e.g., Frida, LSPosed, Shadow)
|
|
29
29
|
- UI automation and driven-input attacks (e.g., Appium)
|
|
30
|
+
- Ongoing cellular and VoIP calls during sensitive flows (Android)
|
|
31
|
+
- Screen control by accessibility services and overlay windows of other apps (Android)
|
|
30
32
|
- Untrusted installation method
|
|
31
33
|
- App Data Migration protection
|
|
32
34
|
|
package/android/build.gradle
CHANGED
|
@@ -57,7 +57,7 @@ android {
|
|
|
57
57
|
compileSdk getMaxVersion("compileSdk")
|
|
58
58
|
|
|
59
59
|
talsec {
|
|
60
|
-
sdkVersion = "
|
|
60
|
+
sdkVersion = "20.0.1"
|
|
61
61
|
platform = "ReactNative"
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -87,7 +87,7 @@ android {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
if (project.android.hasProperty("namespace")) {
|
|
90
|
-
namespace("
|
|
90
|
+
namespace("app.talsec.rasp.reactnative")
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -119,6 +119,6 @@ if (isNewArchitectureEnabled()) {
|
|
|
119
119
|
react {
|
|
120
120
|
jsRootDir = file("../src/")
|
|
121
121
|
libraryName = "FreeraspReactNative"
|
|
122
|
-
codegenJavaPackageName = "
|
|
122
|
+
codegenJavaPackageName = "app.talsec.rasp.reactnative"
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
-dontwarn java.lang.invoke.StringConcatFactory
|
|
2
|
-
-keep class
|
|
2
|
+
-keep class app.talsec.rasp.reactnative.FreeraspReactNativePackage { public *; }
|
|
3
3
|
|
|
4
4
|
-if @kotlinx.serialization.Serializable class **
|
|
5
5
|
-keep class <1> {
|
|
6
6
|
*;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
-keep class
|
|
10
|
-
-keep class
|
|
9
|
+
-keep class app.talsec.rasp.reactnative.models.RNSuspiciousAppInfo$Companion
|
|
10
|
+
-keep class app.talsec.rasp.reactnative.models.RNPackageInfo$Companion
|
|
11
11
|
|
|
12
12
|
-repackageclasses 'ts'
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
package
|
|
1
|
+
package app.talsec.rasp.reactnative
|
|
2
2
|
|
|
3
|
+
import android.annotation.SuppressLint
|
|
4
|
+
import android.app.Activity
|
|
3
5
|
import android.os.Build
|
|
4
6
|
import android.os.Handler
|
|
5
7
|
import android.os.HandlerThread
|
|
@@ -9,6 +11,7 @@ import app.talsec.rasp.security.api.SuspiciousAppInfo
|
|
|
9
11
|
import app.talsec.rasp.security.api.Talsec
|
|
10
12
|
import app.talsec.rasp.security.api.TalsecConfig
|
|
11
13
|
import app.talsec.rasp.security.api.TalsecMode
|
|
14
|
+
import app.talsec.rasp.security.api.ThreatListener.CallState
|
|
12
15
|
import com.facebook.react.bridge.Arguments
|
|
13
16
|
import com.facebook.react.bridge.LifecycleEventListener
|
|
14
17
|
import com.facebook.react.bridge.Promise
|
|
@@ -20,20 +23,21 @@ import com.facebook.react.bridge.UiThreadUtil.runOnUiThread
|
|
|
20
23
|
import com.facebook.react.bridge.WritableArray
|
|
21
24
|
import com.facebook.react.bridge.WritableMap
|
|
22
25
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
26
|
+
import app.talsec.rasp.reactnative.dispatchers.ExecutionStateDispatcher
|
|
27
|
+
import app.talsec.rasp.reactnative.dispatchers.ThreatDispatcher
|
|
28
|
+
import app.talsec.rasp.reactnative.events.RaspExecutionStateEvent
|
|
29
|
+
import app.talsec.rasp.reactnative.events.ThreatEvent
|
|
30
|
+
import app.talsec.rasp.reactnative.interfaces.PluginExecutionStateListener
|
|
31
|
+
import app.talsec.rasp.reactnative.interfaces.PluginThreatListener
|
|
32
|
+
import app.talsec.rasp.reactnative.utils.Utils
|
|
33
|
+
import app.talsec.rasp.reactnative.utils.getArraySafe
|
|
34
|
+
import app.talsec.rasp.reactnative.utils.getBooleanSafe
|
|
35
|
+
import app.talsec.rasp.reactnative.utils.getMapThrowing
|
|
36
|
+
import app.talsec.rasp.reactnative.utils.getNestedArraySafe
|
|
37
|
+
import app.talsec.rasp.reactnative.utils.getStringThrowing
|
|
38
|
+
import app.talsec.rasp.reactnative.utils.toEncodedWritableArray
|
|
39
|
+
import app.talsec.rasp.reactnative.utils.toSuspiciousAppDetectionConfig
|
|
40
|
+
import java.lang.ref.WeakReference
|
|
37
41
|
|
|
38
42
|
class FreeraspReactNativeModule(private val reactContext: ReactApplicationContext) :
|
|
39
43
|
ReactContextBaseJavaModule(reactContext) {
|
|
@@ -54,6 +58,7 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
|
|
|
54
58
|
reactContext.currentActivity?.let { ScreenProtector.unregister(it) }
|
|
55
59
|
}
|
|
56
60
|
if (reactContext.currentActivity?.isFinishing == true) {
|
|
61
|
+
stopOngoingCallDetectionInternal()
|
|
57
62
|
ThreatDispatcher.unregisterListener()
|
|
58
63
|
ExecutionStateDispatcher.unregisterListener()
|
|
59
64
|
PluginThreatHandler.unregisterSDKListener(reactContext)
|
|
@@ -134,7 +139,7 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
|
|
|
134
139
|
|
|
135
140
|
/**
|
|
136
141
|
* Method to setup the threat message passing between native and React Native
|
|
137
|
-
* @return list of [THREAT_CHANNEL_NAME, THREAT_CHANNEL_KEY]
|
|
142
|
+
* @return list of [THREAT_CHANNEL_NAME, THREAT_CHANNEL_KEY, MALWARE_CHANNEL_KEY, CALL_STATE_CHANNEL_KEY]
|
|
138
143
|
*/
|
|
139
144
|
@ReactMethod
|
|
140
145
|
fun getThreatChannelData(promise: Promise) {
|
|
@@ -142,6 +147,7 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
|
|
|
142
147
|
channelData.pushString(ThreatEvent.CHANNEL_NAME)
|
|
143
148
|
channelData.pushString(ThreatEvent.CHANNEL_KEY)
|
|
144
149
|
channelData.pushString(ThreatEvent.MALWARE_CHANNEL_KEY)
|
|
150
|
+
channelData.pushString(ThreatEvent.CALL_STATE_CHANNEL_KEY)
|
|
145
151
|
promise.resolve(channelData)
|
|
146
152
|
}
|
|
147
153
|
|
|
@@ -245,14 +251,158 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
|
|
|
245
251
|
*/
|
|
246
252
|
@ReactMethod
|
|
247
253
|
fun isScreenCaptureBlocked(promise: Promise) {
|
|
254
|
+
val activity = reactContext.currentActivity ?: run {
|
|
255
|
+
promise.reject(
|
|
256
|
+
"NativePluginError", "Cannot check screen capture state, activity is null."
|
|
257
|
+
)
|
|
258
|
+
return
|
|
259
|
+
}
|
|
260
|
+
|
|
248
261
|
try {
|
|
249
|
-
val isBlocked = Talsec.isScreenCaptureBlocked()
|
|
262
|
+
val isBlocked = Talsec.isScreenCaptureBlocked(activity)
|
|
250
263
|
promise.resolve(isBlocked)
|
|
251
264
|
} catch (e: Exception) {
|
|
252
265
|
promise.reject("NativePluginError", "Error in isScreenCaptureBlocked: ${e.message}")
|
|
253
266
|
}
|
|
254
267
|
}
|
|
255
268
|
|
|
269
|
+
/**
|
|
270
|
+
* Method Block/Unblock accessibility services from reading or controlling the screen
|
|
271
|
+
* @param enable boolean for whether want to block or unblock the screen control
|
|
272
|
+
*/
|
|
273
|
+
@ReactMethod
|
|
274
|
+
fun blockScreenControl(enable: Boolean, promise: Promise) {
|
|
275
|
+
val activity = reactContext.currentActivity ?: run {
|
|
276
|
+
promise.reject(
|
|
277
|
+
"NativePluginError", "Cannot block screen control, activity is null."
|
|
278
|
+
)
|
|
279
|
+
return
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
runOnUiThread {
|
|
283
|
+
try {
|
|
284
|
+
Talsec.blockScreenControl(activity, enable)
|
|
285
|
+
promise.resolve("Screen control is now ${if (enable) "Blocked" else "Enabled"}.")
|
|
286
|
+
} catch (e: Exception) {
|
|
287
|
+
promise.reject("NativePluginError", "Error in blockScreenControl: ${e.message}")
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Method Returns whether screen control is blocked or not
|
|
294
|
+
* @return boolean for is screen control blocked or not
|
|
295
|
+
*/
|
|
296
|
+
@ReactMethod
|
|
297
|
+
fun isScreenControlBlocked(promise: Promise) {
|
|
298
|
+
val activity = reactContext.currentActivity ?: run {
|
|
299
|
+
promise.reject(
|
|
300
|
+
"NativePluginError", "Cannot check screen control state, activity is null."
|
|
301
|
+
)
|
|
302
|
+
return
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
try {
|
|
306
|
+
promise.resolve(Talsec.isScreenControlBlocked(activity))
|
|
307
|
+
} catch (e: Exception) {
|
|
308
|
+
promise.reject("NativePluginError", "Error in isScreenControlBlocked: ${e.message}")
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Method Hide/Show overlay windows of other apps over the activity.
|
|
314
|
+
* Requires Android 12+ and the HIDE_OVERLAY_WINDOWS permission.
|
|
315
|
+
* @param enable boolean for whether want to hide or show overlay windows
|
|
316
|
+
* @return boolean whether the request was applied
|
|
317
|
+
*/
|
|
318
|
+
// Missing permission is suppressed because the decision to use the overlay API is made
|
|
319
|
+
// by developer, and not enforced by the library.
|
|
320
|
+
@SuppressLint("MissingPermission")
|
|
321
|
+
@ReactMethod
|
|
322
|
+
fun blockOverlayWindows(enable: Boolean, promise: Promise) {
|
|
323
|
+
val activity = reactContext.currentActivity ?: run {
|
|
324
|
+
promise.reject(
|
|
325
|
+
"NativePluginError", "Cannot block overlay windows, activity is null."
|
|
326
|
+
)
|
|
327
|
+
return
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
|
|
331
|
+
promise.resolve(false)
|
|
332
|
+
return
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
runOnUiThread {
|
|
336
|
+
try {
|
|
337
|
+
promise.resolve(Talsec.blockOverlayWindows(activity, enable))
|
|
338
|
+
} catch (e: Exception) {
|
|
339
|
+
promise.reject("NativePluginError", "Error in blockOverlayWindows: ${e.message}")
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Method Returns whether overlay windows of other apps are hidden or not
|
|
346
|
+
* @return boolean for are overlay windows hidden or not
|
|
347
|
+
*/
|
|
348
|
+
@ReactMethod
|
|
349
|
+
fun isOverlayWindowsBlocked(promise: Promise) {
|
|
350
|
+
val activity = reactContext.currentActivity ?: run {
|
|
351
|
+
promise.reject(
|
|
352
|
+
"NativePluginError", "Cannot check overlay windows state, activity is null."
|
|
353
|
+
)
|
|
354
|
+
return
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
try {
|
|
358
|
+
promise.resolve(Talsec.isOverlayWindowsBlocked(activity))
|
|
359
|
+
} catch (e: Exception) {
|
|
360
|
+
promise.reject("NativePluginError", "Error in isOverlayWindowsBlocked: ${e.message}")
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Method starts the ongoing call (cellular and VoIP) detection for the current activity
|
|
366
|
+
*/
|
|
367
|
+
@ReactMethod
|
|
368
|
+
fun startOngoingCallDetection(promise: Promise) {
|
|
369
|
+
val activity = reactContext.currentActivity ?: run {
|
|
370
|
+
promise.reject(
|
|
371
|
+
"NativePluginError", "Cannot start ongoing call detection, activity is null."
|
|
372
|
+
)
|
|
373
|
+
return
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
try {
|
|
377
|
+
if (ongoingCallActivity?.get() !== activity) {
|
|
378
|
+
stopOngoingCallDetectionInternal()
|
|
379
|
+
Talsec.startOngoingCallDetection(activity)
|
|
380
|
+
ongoingCallActivity = WeakReference(activity)
|
|
381
|
+
}
|
|
382
|
+
promise.resolve("Ongoing call detection started.")
|
|
383
|
+
} catch (e: Exception) {
|
|
384
|
+
promise.reject("NativePluginError", "Error in startOngoingCallDetection: ${e.message}")
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Method stops the ongoing call detection
|
|
390
|
+
*/
|
|
391
|
+
@ReactMethod
|
|
392
|
+
fun stopOngoingCallDetection(promise: Promise) {
|
|
393
|
+
try {
|
|
394
|
+
stopOngoingCallDetectionInternal()
|
|
395
|
+
promise.resolve("Ongoing call detection stopped.")
|
|
396
|
+
} catch (e: Exception) {
|
|
397
|
+
promise.reject("NativePluginError", "Error in stopOngoingCallDetection: ${e.message}")
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
private fun stopOngoingCallDetectionInternal() {
|
|
402
|
+
ongoingCallActivity?.get()?.let { Talsec.stopOngoingCallDetection(it) }
|
|
403
|
+
ongoingCallActivity = null
|
|
404
|
+
}
|
|
405
|
+
|
|
256
406
|
@ReactMethod
|
|
257
407
|
fun storeExternalId(
|
|
258
408
|
externalId: String, promise: Promise
|
|
@@ -319,6 +469,9 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
|
|
|
319
469
|
private val mainHandler = Handler(Looper.getMainLooper())
|
|
320
470
|
|
|
321
471
|
internal var talsecStarted = false
|
|
472
|
+
|
|
473
|
+
// Ongoing call detection is registered per activity
|
|
474
|
+
private var ongoingCallActivity: WeakReference<Activity>? = null
|
|
322
475
|
}
|
|
323
476
|
|
|
324
477
|
internal class PluginListener(private val reactContext: ReactApplicationContext) :
|
|
@@ -344,6 +497,13 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
|
|
|
344
497
|
}
|
|
345
498
|
}
|
|
346
499
|
|
|
500
|
+
override fun ongoingCallDetected(state: CallState) {
|
|
501
|
+
val params = Arguments.createMap()
|
|
502
|
+
params.putInt(ThreatEvent.CHANNEL_KEY, ThreatEvent.OngoingCall.value)
|
|
503
|
+
params.putString(ThreatEvent.CALL_STATE_CHANNEL_KEY, state.name)
|
|
504
|
+
notifyEvent(ThreatEvent.CHANNEL_NAME, params)
|
|
505
|
+
}
|
|
506
|
+
|
|
347
507
|
override fun raspExecutionStateChanged(event: RaspExecutionStateEvent) {
|
|
348
508
|
val params = Arguments.createMap()
|
|
349
509
|
params.putInt(event.channelKey, event.value)
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
package
|
|
1
|
+
package app.talsec.rasp.reactnative
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import app.talsec.rasp.security.api.SuspiciousAppInfo
|
|
5
5
|
import app.talsec.rasp.security.api.ThreatListener
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
6
|
+
import app.talsec.rasp.security.api.ThreatListener.CallState
|
|
7
|
+
import app.talsec.rasp.reactnative.dispatchers.ExecutionStateDispatcher
|
|
8
|
+
import app.talsec.rasp.reactnative.dispatchers.ThreatDispatcher
|
|
9
|
+
import app.talsec.rasp.reactnative.events.RaspExecutionStateEvent
|
|
10
|
+
import app.talsec.rasp.reactnative.events.ThreatEvent
|
|
10
11
|
|
|
11
12
|
internal object PluginThreatHandler {
|
|
12
13
|
|
|
@@ -79,6 +80,10 @@ internal object PluginThreatHandler {
|
|
|
79
80
|
override fun onBootloader() {
|
|
80
81
|
ThreatDispatcher.dispatchThreat(ThreatEvent.Bootloader)
|
|
81
82
|
}
|
|
83
|
+
|
|
84
|
+
override fun onOngoingCall(state: CallState) {
|
|
85
|
+
ThreatDispatcher.dispatchOngoingCall(state)
|
|
86
|
+
}
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
private val deviceState = object : ThreatListener.DeviceState() {
|
|
@@ -105,8 +110,16 @@ internal object PluginThreatHandler {
|
|
|
105
110
|
}
|
|
106
111
|
|
|
107
112
|
private val raspExecutionState = object : ThreatListener.RaspExecutionState() {
|
|
108
|
-
override fun
|
|
109
|
-
ExecutionStateDispatcher.dispatch(RaspExecutionStateEvent.
|
|
113
|
+
override fun onCriticalChecksFinished() {
|
|
114
|
+
ExecutionStateDispatcher.dispatch(RaspExecutionStateEvent.CriticalChecksFinished)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
override fun onFastChecksFinished() {
|
|
118
|
+
ExecutionStateDispatcher.dispatch(RaspExecutionStateEvent.FastChecksFinished)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
override fun onPostponedChecksFinished() {
|
|
122
|
+
ExecutionStateDispatcher.dispatch(RaspExecutionStateEvent.PostponedChecksFinished)
|
|
110
123
|
}
|
|
111
124
|
}
|
|
112
125
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
package
|
|
1
|
+
package app.talsec.rasp.reactnative.dispatchers
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import app.talsec.rasp.reactnative.events.RaspExecutionStateEvent
|
|
4
|
+
import app.talsec.rasp.reactnative.interfaces.PluginExecutionStateListener
|
|
5
5
|
|
|
6
6
|
internal object ExecutionStateDispatcher {
|
|
7
7
|
private lateinit var listener: PluginExecutionStateListener
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
package
|
|
1
|
+
package app.talsec.rasp.reactnative.dispatchers
|
|
2
2
|
|
|
3
3
|
import app.talsec.rasp.security.api.SuspiciousAppInfo
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import app.talsec.rasp.security.api.ThreatListener.CallState
|
|
5
|
+
import app.talsec.rasp.reactnative.events.ThreatEvent
|
|
6
|
+
import app.talsec.rasp.reactnative.interfaces.PluginThreatListener
|
|
6
7
|
|
|
7
8
|
internal object ThreatDispatcher {
|
|
8
9
|
private lateinit var listener: PluginThreatListener
|
|
9
10
|
private val threatCache = mutableSetOf<ThreatEvent>()
|
|
10
11
|
private val malwareCache = mutableSetOf<SuspiciousAppInfo>()
|
|
12
|
+
private val callStateCache = mutableListOf<CallState>()
|
|
11
13
|
|
|
12
14
|
private var isAppInForeground = false
|
|
13
15
|
private var isListenerRegistered = false
|
|
@@ -56,6 +58,17 @@ internal object ThreatDispatcher {
|
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
|
|
61
|
+
fun dispatchOngoingCall(state: CallState) {
|
|
62
|
+
if (isAppInForeground && isListenerRegistered) {
|
|
63
|
+
listener.ongoingCallDetected(state)
|
|
64
|
+
} else {
|
|
65
|
+
// Keep the order: a call that started and stopped in background is reported as both.
|
|
66
|
+
synchronized(callStateCache) {
|
|
67
|
+
callStateCache.add(state)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
59
72
|
private fun flushCache() {
|
|
60
73
|
val threats = synchronized(threatCache) {
|
|
61
74
|
val snapshot = threatCache.toSet()
|
|
@@ -72,6 +85,13 @@ internal object ThreatDispatcher {
|
|
|
72
85
|
if (malware.isNotEmpty()) {
|
|
73
86
|
listener.malwareDetected(malware)
|
|
74
87
|
}
|
|
88
|
+
|
|
89
|
+
val callStates = synchronized(callStateCache) {
|
|
90
|
+
val snapshot = callStateCache.toList()
|
|
91
|
+
callStateCache.clear()
|
|
92
|
+
snapshot
|
|
93
|
+
}
|
|
94
|
+
callStates.forEach { listener.ongoingCallDetected(it) }
|
|
75
95
|
}
|
|
76
96
|
}
|
|
77
97
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package app.talsec.rasp.reactnative.events
|
|
2
|
+
|
|
3
|
+
import app.talsec.rasp.reactnative.utils.RandomGenerator
|
|
4
|
+
|
|
5
|
+
internal sealed class RaspExecutionStateEvent(override val value: Int) : BaseRaspEvent {
|
|
6
|
+
override val channelName: String get() = CHANNEL_NAME
|
|
7
|
+
override val channelKey: String get() = CHANNEL_KEY
|
|
8
|
+
|
|
9
|
+
data object FastChecksFinished : RaspExecutionStateEvent(RandomGenerator.next())
|
|
10
|
+
data object CriticalChecksFinished : RaspExecutionStateEvent(RandomGenerator.next())
|
|
11
|
+
data object PostponedChecksFinished : RaspExecutionStateEvent(RandomGenerator.next())
|
|
12
|
+
|
|
13
|
+
companion object Companion {
|
|
14
|
+
internal val CHANNEL_NAME = RandomGenerator.next().toString()
|
|
15
|
+
internal val CHANNEL_KEY = RandomGenerator.next().toString()
|
|
16
|
+
internal val ALL_EVENT_IDENTIFIERS = listOf(
|
|
17
|
+
FastChecksFinished,
|
|
18
|
+
CriticalChecksFinished,
|
|
19
|
+
PostponedChecksFinished
|
|
20
|
+
).map { it.value }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
package
|
|
1
|
+
package app.talsec.rasp.reactnative.events
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import app.talsec.rasp.reactnative.utils.RandomGenerator
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Sealed class to represent the error codes.
|
|
@@ -35,11 +35,13 @@ internal sealed class ThreatEvent(override val value: Int) : BaseRaspEvent {
|
|
|
35
35
|
data object UnsecureWifi : ThreatEvent(RandomGenerator.next())
|
|
36
36
|
data object Automation : ThreatEvent(RandomGenerator.next())
|
|
37
37
|
data object Bootloader : ThreatEvent(RandomGenerator.next())
|
|
38
|
+
data object OngoingCall : ThreatEvent(RandomGenerator.next())
|
|
38
39
|
|
|
39
40
|
companion object {
|
|
40
41
|
internal val CHANNEL_NAME = RandomGenerator.next().toString()
|
|
41
42
|
internal val CHANNEL_KEY = RandomGenerator.next().toString()
|
|
42
43
|
internal val MALWARE_CHANNEL_KEY = RandomGenerator.next().toString()
|
|
44
|
+
internal val CALL_STATE_CHANNEL_KEY = RandomGenerator.next().toString()
|
|
43
45
|
|
|
44
46
|
internal val ALL_EVENT_IDENTIFIERS = listOf(
|
|
45
47
|
AppIntegrity,
|
|
@@ -63,7 +65,8 @@ internal sealed class ThreatEvent(override val value: Int) : BaseRaspEvent {
|
|
|
63
65
|
LocationSpoofing,
|
|
64
66
|
UnsecureWifi,
|
|
65
67
|
Automation,
|
|
66
|
-
Bootloader
|
|
68
|
+
Bootloader,
|
|
69
|
+
OngoingCall
|
|
67
70
|
).map { it.value }
|
|
68
71
|
}
|
|
69
72
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
package
|
|
1
|
+
package app.talsec.rasp.reactnative.interfaces
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import app.talsec.rasp.reactnative.events.RaspExecutionStateEvent
|
|
4
4
|
|
|
5
5
|
internal interface PluginExecutionStateListener {
|
|
6
6
|
fun raspExecutionStateChanged(event: RaspExecutionStateEvent)
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
package
|
|
1
|
+
package app.talsec.rasp.reactnative.interfaces
|
|
2
2
|
|
|
3
3
|
import app.talsec.rasp.security.api.SuspiciousAppInfo
|
|
4
|
-
import
|
|
4
|
+
import app.talsec.rasp.security.api.ThreatListener.CallState
|
|
5
|
+
import app.talsec.rasp.reactnative.events.ThreatEvent
|
|
5
6
|
|
|
6
7
|
internal interface PluginThreatListener {
|
|
7
8
|
fun threatDetected(threatEventType: ThreatEvent)
|
|
8
9
|
fun malwareDetected(suspiciousApps: MutableList<SuspiciousAppInfo>)
|
|
10
|
+
fun ongoingCallDetected(state: CallState)
|
|
9
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
package
|
|
1
|
+
package app.talsec.rasp.reactnative.utils
|
|
2
2
|
|
|
3
3
|
import android.content.pm.PackageInfo
|
|
4
4
|
import android.util.Base64
|
|
@@ -13,9 +13,9 @@ import com.facebook.react.bridge.ReactContext
|
|
|
13
13
|
import com.facebook.react.bridge.ReadableArray
|
|
14
14
|
import com.facebook.react.bridge.ReadableMap
|
|
15
15
|
import com.facebook.react.bridge.WritableArray
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
16
|
+
import app.talsec.rasp.reactnative.exceptions.TalsecException
|
|
17
|
+
import app.talsec.rasp.reactnative.models.RNPackageInfo
|
|
18
|
+
import app.talsec.rasp.reactnative.models.RNSuspiciousAppInfo
|
|
19
19
|
import kotlinx.serialization.encodeToString
|
|
20
20
|
import kotlinx.serialization.json.Json
|
|
21
21
|
import org.json.JSONException
|