freerasp-react-native 4.0.0 → 4.2.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 +77 -3
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt +15 -0
- package/android/src/main/java/com/freeraspreactnative/FreeraspThreatHandler.kt +4 -0
- package/android/src/main/java/com/freeraspreactnative/Threat.kt +3 -1
- package/example/package.json +3 -1
- package/example/src/App.tsx +10 -0
- package/example/src/DemoApp.tsx +180 -70
- package/example/src/checks.ts +1 -0
- package/example/yarn.lock +10 -0
- package/ios/FreeraspReactNative.m +8 -0
- package/ios/FreeraspReactNative.swift +46 -0
- package/ios/TalsecRuntime.xcframework/Info.plist +5 -5
- package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeResources +78 -78
- 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 +1 -1
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +7 -7
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +4 -4
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +1 -1
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +1 -1
- 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 +323 -207
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +3 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +3 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- 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 +2 -2
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +7 -7
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +4 -4
- 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/urlapi.h +1 -1
- 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 +323 -207
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +3 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +323 -207
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +3 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +3 -0
- 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 +29 -29
- package/lib/commonjs/index.js +11 -9
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/threat.js +2 -1
- package/lib/commonjs/threat.js.map +1 -1
- package/lib/module/index.js +7 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/threat.js +2 -1
- package/lib/module/threat.js.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/threat.d.ts +1 -0
- package/lib/typescript/src/threat.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +1 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +7 -10
- package/src/threat.ts +2 -0
- package/src/types.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,80 @@ 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
|
-
## [4.
|
|
8
|
+
## [4.2.0] - 2025-07-16
|
|
9
|
+
|
|
10
|
+
- iOS SDK version: 6.12.1
|
|
11
|
+
- Android SDK version: 16.0.1
|
|
12
|
+
|
|
13
|
+
### Android
|
|
14
|
+
|
|
15
|
+
#### Added
|
|
16
|
+
|
|
17
|
+
- Added support for 16 KB memory page sizes
|
|
18
|
+
- Added `multiInstance` callback
|
|
19
|
+
- Detecting whether the application is installed/running in various multi-instancing environments (e.g. Parallel Space)
|
|
20
|
+
|
|
21
|
+
#### Changed
|
|
22
|
+
|
|
23
|
+
- The ADB service running as a root is a signal for root detection
|
|
24
|
+
- Improved emulator detection
|
|
25
|
+
- Internal security improvements
|
|
26
|
+
|
|
27
|
+
#### Fixed
|
|
28
|
+
|
|
29
|
+
- Removed malware report duplicates
|
|
30
|
+
|
|
31
|
+
### iOS
|
|
32
|
+
|
|
33
|
+
#### Added
|
|
34
|
+
|
|
35
|
+
- Added palera1n jailbreak detection
|
|
36
|
+
|
|
37
|
+
#### Changed
|
|
38
|
+
|
|
39
|
+
- Improved Dopamine jailbreak detection
|
|
40
|
+
|
|
41
|
+
#### Fixed
|
|
42
|
+
|
|
43
|
+
- Resolved memory-related stability issues.
|
|
44
|
+
|
|
45
|
+
## [4.1.0] - 2025-05-15
|
|
46
|
+
|
|
47
|
+
- iOS SDK version: 6.11.0
|
|
48
|
+
- Android SDK version: 15.1.0
|
|
49
|
+
|
|
50
|
+
### React Native
|
|
51
|
+
|
|
52
|
+
#### Added
|
|
53
|
+
|
|
54
|
+
- Added interface for screenshot / screen recording blocking on iOS
|
|
55
|
+
- Added interface for external ID storage
|
|
56
|
+
|
|
57
|
+
### Android
|
|
58
|
+
|
|
59
|
+
#### Added
|
|
60
|
+
|
|
61
|
+
- Added externalId to put an integrator-specified custom identifier into the logs.
|
|
62
|
+
- Added eventId to the logs, which is unique per each log. It allows traceability of the same log across various systems.
|
|
63
|
+
|
|
64
|
+
#### Changed
|
|
65
|
+
|
|
66
|
+
- New root detection checks added
|
|
67
|
+
|
|
68
|
+
### iOS
|
|
69
|
+
|
|
70
|
+
#### Added
|
|
71
|
+
|
|
72
|
+
- Added externalId to put an integrator-specified custom identifier into the logs.
|
|
73
|
+
- Added eventId to the logs, which is unique per each log. It allows traceability of the same log across various systems.
|
|
74
|
+
- Screen capture protection obscuring app content in screenshots and screen recordings preventing unauthorized content capture. Refer to the freeRASP integration documentation.
|
|
75
|
+
|
|
76
|
+
#### Fixed
|
|
77
|
+
|
|
78
|
+
- Resolved an issue with the screen recording detection.
|
|
79
|
+
- Resolved an issue that prevented Xcode tests from running correctly.
|
|
80
|
+
|
|
81
|
+
## [4.0.0] - 2025-03-25
|
|
9
82
|
|
|
10
83
|
- iOS SDK version: 6.9.0
|
|
11
84
|
- Android SDK version: 15.0.0
|
|
@@ -28,6 +101,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
28
101
|
#### Fixed
|
|
29
102
|
|
|
30
103
|
- ANR issues bug-fixing
|
|
104
|
+
|
|
31
105
|
### iOS
|
|
32
106
|
|
|
33
107
|
#### Added
|
|
@@ -38,7 +112,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
38
112
|
|
|
39
113
|
- Deep signing of the OpenSSL binaries.
|
|
40
114
|
|
|
41
|
-
## [3.14.1] -
|
|
115
|
+
## [3.14.1] - 2025-03-10
|
|
42
116
|
|
|
43
117
|
- iOS SDK version: 6.8.0
|
|
44
118
|
- Android SDK version: 14.0.1
|
|
@@ -49,7 +123,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
49
123
|
|
|
50
124
|
- Take Android targetSdkVersion, compileSdkVersion from plugin only
|
|
51
125
|
|
|
52
|
-
## [3.14.0] -
|
|
126
|
+
## [3.14.0] - 2025-03-05
|
|
53
127
|
|
|
54
128
|
- iOS SDK version: 6.8.0
|
|
55
129
|
- Android SDK version: 14.0.1
|
package/android/build.gradle
CHANGED
|
@@ -99,7 +99,7 @@ dependencies {
|
|
|
99
99
|
implementation "com.facebook.react:react-native:$react_native_version"
|
|
100
100
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
101
101
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
|
|
102
|
-
implementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:
|
|
102
|
+
implementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:16.0.1"
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
if (isNewArchitectureEnabled()) {
|
|
@@ -185,6 +185,21 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
@ReactMethod
|
|
189
|
+
fun storeExternalId(
|
|
190
|
+
externalId: String, promise: Promise
|
|
191
|
+
) {
|
|
192
|
+
try {
|
|
193
|
+
Talsec.storeExternalId(reactContext, externalId)
|
|
194
|
+
promise.resolve("OK - Store external ID")
|
|
195
|
+
} catch (e: Exception) {
|
|
196
|
+
promise.reject(
|
|
197
|
+
"NativePluginError",
|
|
198
|
+
"Error during storeExternalId operation in Talsec Native Plugin"
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
188
203
|
private fun buildTalsecConfig(config: ReadableMap): TalsecConfig {
|
|
189
204
|
val androidConfig = config.getMapThrowing("androidConfig")
|
|
190
205
|
val packageName = androidConfig.getStringThrowing("packageName")
|
|
@@ -71,6 +71,10 @@ internal object FreeraspThreatHandler : ThreatListener.ThreatDetected, ThreatLis
|
|
|
71
71
|
listener?.threatDetected(Threat.ScreenRecording)
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
override fun onMultiInstanceDetected() {
|
|
75
|
+
listener?.threatDetected(Threat.MultiInstance)
|
|
76
|
+
}
|
|
77
|
+
|
|
74
78
|
internal interface TalsecReactNative {
|
|
75
79
|
fun threatDetected(threatType: Threat)
|
|
76
80
|
|
|
@@ -27,6 +27,7 @@ internal sealed class Threat(val value: Int) {
|
|
|
27
27
|
object ADBEnabled : Threat((10000..999999999).random())
|
|
28
28
|
object Screenshot : Threat((10000..999999999).random())
|
|
29
29
|
object ScreenRecording : Threat((10000..999999999).random())
|
|
30
|
+
object MultiInstance : Threat((10000..999999999).random())
|
|
30
31
|
|
|
31
32
|
companion object {
|
|
32
33
|
internal fun getThreatValues(): WritableArray {
|
|
@@ -47,7 +48,8 @@ internal sealed class Threat(val value: Int) {
|
|
|
47
48
|
Malware.value,
|
|
48
49
|
ADBEnabled.value,
|
|
49
50
|
Screenshot.value,
|
|
50
|
-
ScreenRecording.value
|
|
51
|
+
ScreenRecording.value,
|
|
52
|
+
MultiInstance.value
|
|
51
53
|
)
|
|
52
54
|
)
|
|
53
55
|
}
|
package/example/package.json
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"@react-native-material/core": "^1.3.7",
|
|
15
15
|
"react": "19.0.0",
|
|
16
16
|
"react-native": "0.78.0",
|
|
17
|
+
"react-native-alert-notification": "^0.4.2",
|
|
18
|
+
"react-native-safe-area-context": "^5.4.0",
|
|
17
19
|
"react-native-svg": "^15.11.1"
|
|
18
20
|
},
|
|
19
21
|
"devDependencies": {
|
|
@@ -27,8 +29,8 @@
|
|
|
27
29
|
"@react-native/eslint-config": "0.78.0",
|
|
28
30
|
"@react-native/metro-config": "0.78.0",
|
|
29
31
|
"@react-native/typescript-config": "0.78.0",
|
|
30
|
-
"babel-plugin-module-resolver": "^5.0.2",
|
|
31
32
|
"@types/react": "^19.0.0",
|
|
33
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
32
34
|
"eslint-config-prettier": "^10.0.1",
|
|
33
35
|
"eslint-plugin-prettier": "^5.2.3",
|
|
34
36
|
"metro-react-native-babel-preset": "^0.77.0",
|
package/example/src/App.tsx
CHANGED
|
@@ -206,6 +206,16 @@ const App = () => {
|
|
|
206
206
|
)
|
|
207
207
|
);
|
|
208
208
|
},
|
|
209
|
+
// Android only
|
|
210
|
+
multiInstance: () => {
|
|
211
|
+
setAppChecks((currentState) =>
|
|
212
|
+
currentState.map((threat) =>
|
|
213
|
+
threat.name === 'Multi Instance'
|
|
214
|
+
? { ...threat, status: 'nok' }
|
|
215
|
+
: threat
|
|
216
|
+
)
|
|
217
|
+
);
|
|
218
|
+
},
|
|
209
219
|
};
|
|
210
220
|
|
|
211
221
|
const addItemsToMalwareWhitelist = async () => {
|
package/example/src/DemoApp.tsx
CHANGED
|
@@ -9,7 +9,9 @@ import {
|
|
|
9
9
|
Image,
|
|
10
10
|
TouchableOpacity,
|
|
11
11
|
StyleSheet,
|
|
12
|
-
|
|
12
|
+
TextInput,
|
|
13
|
+
View,
|
|
14
|
+
Modal,
|
|
13
15
|
} from 'react-native';
|
|
14
16
|
import { Colors } from './styles';
|
|
15
17
|
import { MalwareModal } from './MalwareModal';
|
|
@@ -17,7 +19,13 @@ import {
|
|
|
17
19
|
isScreenCaptureBlocked,
|
|
18
20
|
blockScreenCapture,
|
|
19
21
|
type SuspiciousAppInfo,
|
|
22
|
+
storeExternalId,
|
|
20
23
|
} from 'freerasp-react-native';
|
|
24
|
+
import {
|
|
25
|
+
ALERT_TYPE,
|
|
26
|
+
AlertNotificationRoot,
|
|
27
|
+
Toast,
|
|
28
|
+
} from 'react-native-alert-notification';
|
|
21
29
|
|
|
22
30
|
export const DemoApp: React.FC<{
|
|
23
31
|
checks: {
|
|
@@ -28,10 +36,12 @@ export const DemoApp: React.FC<{
|
|
|
28
36
|
}> = ({ checks, suspiciousApps }) => {
|
|
29
37
|
const [hasScreenCaptureBlocked, setHasScreenCaptureBlocked] =
|
|
30
38
|
React.useState(false);
|
|
39
|
+
const [externalIdValue, setExternalIdValue] = React.useState('');
|
|
40
|
+
const [modalVisible, setModalVisible] = React.useState(false);
|
|
31
41
|
|
|
32
42
|
React.useEffect(() => {
|
|
33
43
|
(async () => {
|
|
34
|
-
|
|
44
|
+
await updateScreenCaptureStatus();
|
|
35
45
|
})();
|
|
36
46
|
}, []);
|
|
37
47
|
|
|
@@ -54,89 +64,144 @@ export const DemoApp: React.FC<{
|
|
|
54
64
|
}
|
|
55
65
|
};
|
|
56
66
|
|
|
67
|
+
const handleModalSend = async () => {
|
|
68
|
+
setModalVisible(false);
|
|
69
|
+
try {
|
|
70
|
+
await storeExternalId(externalIdValue);
|
|
71
|
+
Toast.show({
|
|
72
|
+
type: ALERT_TYPE.SUCCESS,
|
|
73
|
+
title: 'Success',
|
|
74
|
+
textBody: 'External ID stored',
|
|
75
|
+
});
|
|
76
|
+
} catch (error: any) {
|
|
77
|
+
Toast.show({
|
|
78
|
+
type: ALERT_TYPE.WARNING,
|
|
79
|
+
title: 'Warning',
|
|
80
|
+
textBody: 'External ID not stored',
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const handleModalDismiss = () => {
|
|
86
|
+
setModalVisible(false);
|
|
87
|
+
};
|
|
88
|
+
|
|
57
89
|
return (
|
|
58
90
|
<>
|
|
59
|
-
<
|
|
60
|
-
<
|
|
61
|
-
<
|
|
62
|
-
<
|
|
63
|
-
|
|
91
|
+
<AlertNotificationRoot>
|
|
92
|
+
<Flex fill style={styles.flex}>
|
|
93
|
+
<ScrollView>
|
|
94
|
+
<VStack>
|
|
95
|
+
<Image source={TalsecLogo} style={{ alignSelf: 'center' }} />;
|
|
64
96
|
<HStack
|
|
65
97
|
style={{ justifyContent: 'space-evenly', paddingTop: 10 }}>
|
|
66
98
|
<TouchableOpacity
|
|
67
99
|
onPress={toggleScreenCaptureBlock}
|
|
68
100
|
style={[
|
|
69
101
|
styles.button,
|
|
70
|
-
hasScreenCaptureBlocked
|
|
71
|
-
? styles.unblockedButton
|
|
72
|
-
: styles.blockedButton,
|
|
102
|
+
hasScreenCaptureBlocked && styles.blockedButton,
|
|
73
103
|
]}>
|
|
74
104
|
<Text
|
|
75
105
|
style={[
|
|
76
106
|
styles.buttonText,
|
|
77
|
-
hasScreenCaptureBlocked
|
|
78
|
-
? styles.colorCheckNok
|
|
79
|
-
: styles.colorCheckOk,
|
|
107
|
+
{ color: hasScreenCaptureBlocked ? 'white' : 'black' },
|
|
80
108
|
]}>
|
|
81
109
|
{hasScreenCaptureBlocked
|
|
82
110
|
? 'Enable Screen Capture'
|
|
83
111
|
: 'Block Screen Capture'}
|
|
84
112
|
</Text>
|
|
85
113
|
</TouchableOpacity>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
key={idx}
|
|
92
|
-
style={[
|
|
93
|
-
styles.box,
|
|
94
|
-
check.status === 'ok'
|
|
95
|
-
? styles.boxCheckOk
|
|
96
|
-
: styles.boxCheckNok,
|
|
97
|
-
]}>
|
|
98
|
-
<HStack style={{ justifyContent: 'space-between' }}>
|
|
99
|
-
<Text
|
|
100
|
-
style={{
|
|
101
|
-
color: check.status === 'ok' ? 'green' : 'rgb(200, 0, 0)',
|
|
102
|
-
fontWeight: 'bold',
|
|
103
|
-
alignSelf: 'center',
|
|
104
|
-
}}>
|
|
105
|
-
{check.name}
|
|
114
|
+
<TouchableOpacity
|
|
115
|
+
onPress={() => setModalVisible(true)}
|
|
116
|
+
style={[styles.button]}>
|
|
117
|
+
<Text style={[styles.buttonText, { color: 'black' }]}>
|
|
118
|
+
Set External ID
|
|
106
119
|
</Text>
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
{
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
styles.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
120
|
+
</TouchableOpacity>
|
|
121
|
+
<Modal
|
|
122
|
+
transparent
|
|
123
|
+
visible={modalVisible}
|
|
124
|
+
animationType="fade"
|
|
125
|
+
onRequestClose={handleModalDismiss}>
|
|
126
|
+
<View style={styles.modalOverlay}>
|
|
127
|
+
<View style={styles.modalContent}>
|
|
128
|
+
<Text style={styles.title}>Set External ID</Text>
|
|
129
|
+
<TextInput
|
|
130
|
+
style={styles.input}
|
|
131
|
+
placeholder="Type something..."
|
|
132
|
+
value={externalIdValue}
|
|
133
|
+
onChangeText={setExternalIdValue}
|
|
134
|
+
/>
|
|
135
|
+
<View style={styles.buttonRow}>
|
|
136
|
+
<TouchableOpacity
|
|
137
|
+
style={styles.sendButton}
|
|
138
|
+
onPress={handleModalSend}>
|
|
139
|
+
<Text style={styles.modalText}>Send</Text>
|
|
140
|
+
</TouchableOpacity>
|
|
141
|
+
<TouchableOpacity
|
|
142
|
+
style={styles.dismissButton}
|
|
143
|
+
onPress={handleModalDismiss}>
|
|
144
|
+
<Text style={styles.modalText}>Dismiss</Text>
|
|
145
|
+
</TouchableOpacity>
|
|
146
|
+
</View>
|
|
147
|
+
</View>
|
|
148
|
+
</View>
|
|
149
|
+
</Modal>
|
|
150
|
+
</HStack>
|
|
151
|
+
<Text style={styles.titleText}>freeRASP checks:</Text>
|
|
152
|
+
{checks.map((check: any, idx: number) => (
|
|
153
|
+
<Box
|
|
154
|
+
key={idx}
|
|
155
|
+
style={[
|
|
156
|
+
styles.box,
|
|
157
|
+
check.status === 'ok'
|
|
158
|
+
? styles.boxCheckOk
|
|
159
|
+
: styles.boxCheckNok,
|
|
160
|
+
]}>
|
|
161
|
+
<HStack style={{ justifyContent: 'space-between' }}>
|
|
162
|
+
<Text
|
|
163
|
+
style={{
|
|
164
|
+
color:
|
|
165
|
+
check.status === 'ok' ? 'green' : 'rgb(200, 0, 0)',
|
|
166
|
+
fontWeight: 'bold',
|
|
167
|
+
alignSelf: 'center',
|
|
168
|
+
}}>
|
|
169
|
+
{check.name}
|
|
170
|
+
</Text>
|
|
171
|
+
{check.name === 'Malware' && (
|
|
172
|
+
<MalwareModal
|
|
173
|
+
isDisabled={check.status === 'ok'}
|
|
174
|
+
suspiciousApps={suspiciousApps}
|
|
175
|
+
/>
|
|
176
|
+
)}
|
|
177
|
+
{check.status === 'ok' ? (
|
|
178
|
+
<Image
|
|
179
|
+
source={CheckmarkCircle}
|
|
180
|
+
style={[
|
|
181
|
+
styles.checkIcon,
|
|
182
|
+
{
|
|
183
|
+
tintColor: Colors.checkOkDark,
|
|
184
|
+
},
|
|
185
|
+
]}
|
|
186
|
+
/>
|
|
187
|
+
) : (
|
|
188
|
+
<Image
|
|
189
|
+
source={CloseCircle}
|
|
190
|
+
style={[
|
|
191
|
+
styles.checkIcon,
|
|
192
|
+
{
|
|
193
|
+
tintColor: Colors.checkNokDark,
|
|
194
|
+
},
|
|
195
|
+
]}
|
|
196
|
+
/>
|
|
197
|
+
)}
|
|
198
|
+
</HStack>
|
|
199
|
+
</Box>
|
|
200
|
+
))}
|
|
201
|
+
</VStack>
|
|
202
|
+
</ScrollView>
|
|
203
|
+
</Flex>
|
|
204
|
+
</AlertNotificationRoot>
|
|
140
205
|
</>
|
|
141
206
|
);
|
|
142
207
|
};
|
|
@@ -164,10 +229,7 @@ const styles = StyleSheet.create({
|
|
|
164
229
|
marginTop: 20,
|
|
165
230
|
},
|
|
166
231
|
blockedButton: {
|
|
167
|
-
backgroundColor: Colors.
|
|
168
|
-
},
|
|
169
|
-
unblockedButton: {
|
|
170
|
-
backgroundColor: Colors.checkNokLight,
|
|
232
|
+
backgroundColor: Colors.checkNokDark,
|
|
171
233
|
},
|
|
172
234
|
colorCheckNok: {
|
|
173
235
|
color: Colors.checkNokDark,
|
|
@@ -202,4 +264,52 @@ const styles = StyleSheet.create({
|
|
|
202
264
|
color: 'white',
|
|
203
265
|
paddingTop: 15,
|
|
204
266
|
},
|
|
267
|
+
modalOverlay: {
|
|
268
|
+
flex: 1,
|
|
269
|
+
height: 10,
|
|
270
|
+
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
271
|
+
justifyContent: 'center',
|
|
272
|
+
alignItems: 'center',
|
|
273
|
+
},
|
|
274
|
+
modalContent: {
|
|
275
|
+
width: '80%',
|
|
276
|
+
backgroundColor: 'white',
|
|
277
|
+
padding: 20,
|
|
278
|
+
borderRadius: 10,
|
|
279
|
+
},
|
|
280
|
+
title: {
|
|
281
|
+
fontSize: 18,
|
|
282
|
+
fontWeight: 'bold',
|
|
283
|
+
marginBottom: 10,
|
|
284
|
+
},
|
|
285
|
+
input: {
|
|
286
|
+
borderWidth: 1,
|
|
287
|
+
borderColor: '#ccc',
|
|
288
|
+
borderRadius: 5,
|
|
289
|
+
padding: 10,
|
|
290
|
+
marginBottom: 20,
|
|
291
|
+
},
|
|
292
|
+
buttonRow: {
|
|
293
|
+
flexDirection: 'row',
|
|
294
|
+
justifyContent: 'space-between',
|
|
295
|
+
},
|
|
296
|
+
sendButton: {
|
|
297
|
+
backgroundColor: '#4CAF50',
|
|
298
|
+
padding: 10,
|
|
299
|
+
borderRadius: 5,
|
|
300
|
+
flex: 1,
|
|
301
|
+
marginRight: 10,
|
|
302
|
+
alignItems: 'center',
|
|
303
|
+
},
|
|
304
|
+
dismissButton: {
|
|
305
|
+
backgroundColor: '#f44336',
|
|
306
|
+
padding: 10,
|
|
307
|
+
borderRadius: 5,
|
|
308
|
+
flex: 1,
|
|
309
|
+
alignItems: 'center',
|
|
310
|
+
},
|
|
311
|
+
modalText: {
|
|
312
|
+
color: '#fff',
|
|
313
|
+
fontWeight: 'bold',
|
|
314
|
+
},
|
|
205
315
|
});
|
package/example/src/checks.ts
CHANGED
package/example/yarn.lock
CHANGED
|
@@ -5133,11 +5133,21 @@ react-is@^18.0.0:
|
|
|
5133
5133
|
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e"
|
|
5134
5134
|
integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==
|
|
5135
5135
|
|
|
5136
|
+
react-native-alert-notification@^0.4.2:
|
|
5137
|
+
version "0.4.2"
|
|
5138
|
+
resolved "https://registry.yarnpkg.com/react-native-alert-notification/-/react-native-alert-notification-0.4.2.tgz#fabb1bc94e4f7d459dd8e47e8aed03a93651b8c7"
|
|
5139
|
+
integrity sha512-98EQ+DtI7thEAHzoXMbN8dZRCFcoGXMRYYIKvooPPdASuuZIuON4oxCbJNDb6r6lebnPc/25JCD1tJPaoPNWnw==
|
|
5140
|
+
|
|
5136
5141
|
react-native-flex-layout@^0.1.5:
|
|
5137
5142
|
version "0.1.5"
|
|
5138
5143
|
resolved "https://registry.yarnpkg.com/react-native-flex-layout/-/react-native-flex-layout-0.1.5.tgz#147379c9286a6d6999cd942dc9f4bdec75514ddd"
|
|
5139
5144
|
integrity sha512-DrLir5Wl0RhgJXHeDBSaa1Y1LdpNuoz0PEe5E1T1+xVWt2DAz/r+1N8bnhtVkTKJE6WrH6jIH2hoe8kogR0X+w==
|
|
5140
5145
|
|
|
5146
|
+
react-native-safe-area-context@^5.4.0:
|
|
5147
|
+
version "5.4.0"
|
|
5148
|
+
resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-5.4.0.tgz#04b51940408c114f75628a12a93569d30c525454"
|
|
5149
|
+
integrity sha512-JaEThVyJcLhA+vU0NU8bZ0a1ih6GiF4faZ+ArZLqpYbL6j7R3caRqj+mE3lEtKCuHgwjLg3bCxLL1GPUJZVqUA==
|
|
5150
|
+
|
|
5141
5151
|
react-native-svg-transformer@^1.5.0:
|
|
5142
5152
|
version "1.5.0"
|
|
5143
5153
|
resolved "https://registry.yarnpkg.com/react-native-svg-transformer/-/react-native-svg-transformer-1.5.0.tgz#75ae4dbdc4b1a1508e75282d54d66900ee5fe3c2"
|
|
@@ -11,6 +11,14 @@ RCT_EXTERN_METHOD(getThreatChannelData:(RCTPromiseResolveBlock)resolve
|
|
|
11
11
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
12
12
|
RCT_EXTERN_METHOD(getThreatIdentifiers:(RCTPromiseResolveBlock)resolve
|
|
13
13
|
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
14
|
+
RCT_EXTERN_METHOD(blockScreenCapture:(BOOL)enable
|
|
15
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
16
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
17
|
+
RCT_EXTERN_METHOD(isScreenCaptureBlocked:(RCTPromiseResolveBlock)resolve
|
|
18
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
19
|
+
RCT_EXTERN_METHOD(storeExternalId:(NSString *)externalId
|
|
20
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
21
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
14
22
|
RCT_EXTERN_METHOD(onInvalidCallback)
|
|
15
23
|
|
|
16
24
|
+ (BOOL)requiresMainQueueSetup
|
|
@@ -45,6 +45,52 @@ class FreeraspReactNative: RCTEventEmitter {
|
|
|
45
45
|
Talsec.start(config: config)
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
@objc(blockScreenCapture:withResolver:withRejecter:)
|
|
49
|
+
private func blockScreenCapture(enable: Bool, resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
50
|
+
getProtectedWindow { window in
|
|
51
|
+
if let window = window {
|
|
52
|
+
Talsec.blockScreenCapture(enable: enable, window: window)
|
|
53
|
+
resolve("Screen capture is now \((enable) ? "Blocked" : "Enabled").")
|
|
54
|
+
} else {
|
|
55
|
+
reject("BlockScreenCaptureError", "No windows found to block screen capture", nil)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@objc(isScreenCaptureBlocked:withRejecter:)
|
|
61
|
+
private func isScreenCaptureBlocked(resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
62
|
+
getProtectedWindow { window in
|
|
63
|
+
if let window = window {
|
|
64
|
+
let isBlocked = Talsec.isScreenCaptureBlocked(in: window)
|
|
65
|
+
resolve(isBlocked)
|
|
66
|
+
} else {
|
|
67
|
+
reject("IsScreenCaptureBlockedError", "Error while checking if screen capture is blocked", nil)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@objc(storeExternalId:withResolver:withRejecter:)
|
|
73
|
+
private func storeExternalId(externalId: String, resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) -> Void {
|
|
74
|
+
UserDefaults.standard.set(externalId, forKey: "app.talsec.externalid")
|
|
75
|
+
resolve("OK - Store external ID")
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private func getProtectedWindow(completion: @escaping (UIWindow?) -> Void) {
|
|
79
|
+
DispatchQueue.main.async {
|
|
80
|
+
if #available(iOS 13.0, *) {
|
|
81
|
+
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
|
|
82
|
+
if let window = windowScene.windows.first {
|
|
83
|
+
completion(window)
|
|
84
|
+
} else {
|
|
85
|
+
completion(nil)
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
completion(nil)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
48
94
|
/**
|
|
49
95
|
* Method to setup the message passing between native and React Native
|
|
50
96
|
*/
|
|
@@ -8,32 +8,32 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>TalsecRuntime.framework/TalsecRuntime</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>ios-
|
|
11
|
+
<string>ios-arm64</string>
|
|
12
12
|
<key>LibraryPath</key>
|
|
13
13
|
<string>TalsecRuntime.framework</string>
|
|
14
14
|
<key>SupportedArchitectures</key>
|
|
15
15
|
<array>
|
|
16
16
|
<string>arm64</string>
|
|
17
|
-
<string>x86_64</string>
|
|
18
17
|
</array>
|
|
19
18
|
<key>SupportedPlatform</key>
|
|
20
19
|
<string>ios</string>
|
|
21
|
-
<key>SupportedPlatformVariant</key>
|
|
22
|
-
<string>simulator</string>
|
|
23
20
|
</dict>
|
|
24
21
|
<dict>
|
|
25
22
|
<key>BinaryPath</key>
|
|
26
23
|
<string>TalsecRuntime.framework/TalsecRuntime</string>
|
|
27
24
|
<key>LibraryIdentifier</key>
|
|
28
|
-
<string>ios-
|
|
25
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
29
26
|
<key>LibraryPath</key>
|
|
30
27
|
<string>TalsecRuntime.framework</string>
|
|
31
28
|
<key>SupportedArchitectures</key>
|
|
32
29
|
<array>
|
|
33
30
|
<string>arm64</string>
|
|
31
|
+
<string>x86_64</string>
|
|
34
32
|
</array>
|
|
35
33
|
<key>SupportedPlatform</key>
|
|
36
34
|
<string>ios</string>
|
|
35
|
+
<key>SupportedPlatformVariant</key>
|
|
36
|
+
<string>simulator</string>
|
|
37
37
|
</dict>
|
|
38
38
|
</array>
|
|
39
39
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|