freerasp-react-native 5.2.3 → 6.0.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 +76 -0
- package/README.md +2 -0
- package/android/build.gradle +10 -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 +7 -5
- package/ios/models/RaspExecutionStates.swift +3 -3
- 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 +5 -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 +5 -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/plugin/src/index.d.ts +1 -1
- package/lib/typescript/plugin/src/index.d.ts.map +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 +63 -26
- package/lib/typescript/src/types/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/plugin/build/index.d.ts +1 -1
- package/plugin/build/index.js +1 -1
- package/plugin/tests/pluginProps.test.js +15 -0
- 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 +12 -2
- package/src/models/threat.ts +2 -0
- package/src/types/errors.ts +57 -0
- package/src/types/types.ts +68 -26
- package/android/src/main/java/com/freeraspreactnative/events/RaspExecutionStateEvent.kt +0 -18
package/src/types/types.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { TalsecError } from './errors';
|
|
2
|
+
|
|
1
3
|
export type TalsecConfig = {
|
|
2
4
|
androidConfig?: TalsecAndroidConfig;
|
|
3
5
|
iosConfig?: TalsecIosConfig;
|
|
@@ -37,7 +39,7 @@ export type TalsecAndroidConfig = {
|
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
export type TalsecIosConfig = {
|
|
40
|
-
|
|
42
|
+
appBundleIds: string[];
|
|
41
43
|
appTeamId: string;
|
|
42
44
|
};
|
|
43
45
|
|
|
@@ -55,34 +57,74 @@ export type PackageInfo = {
|
|
|
55
57
|
installerStore?: string;
|
|
56
58
|
};
|
|
57
59
|
|
|
60
|
+
/**
|
|
61
|
+
* State of an ongoing call reported by the ongoing call detection.
|
|
62
|
+
*
|
|
63
|
+
* - `STARTED` - a call started while the detection was running
|
|
64
|
+
* - `ONGOING` - a call was already in progress when the detection started
|
|
65
|
+
* - `STOPPED` - a previously reported call has ended
|
|
66
|
+
*/
|
|
67
|
+
export type CallState = 'STARTED' | 'ONGOING' | 'STOPPED';
|
|
68
|
+
|
|
58
69
|
export type ThreatEventActions = {
|
|
59
|
-
privilegedAccess?: () =>
|
|
60
|
-
debug?: () =>
|
|
61
|
-
simulator?: () =>
|
|
62
|
-
appIntegrity?: () =>
|
|
63
|
-
unofficialStore?: () =>
|
|
64
|
-
hooks?: () =>
|
|
65
|
-
deviceBinding?: () =>
|
|
66
|
-
deviceID?: () =>
|
|
67
|
-
passcode?: () =>
|
|
68
|
-
secureHardwareNotAvailable?: () =>
|
|
69
|
-
obfuscationIssues?: () =>
|
|
70
|
-
devMode?: () =>
|
|
71
|
-
systemVPN?: () =>
|
|
72
|
-
malware?: (suspiciousApps: SuspiciousAppInfo[]) =>
|
|
73
|
-
adbEnabled?: () =>
|
|
74
|
-
screenshot?: () =>
|
|
75
|
-
screenRecording?: () =>
|
|
76
|
-
multiInstance?: () =>
|
|
77
|
-
timeSpoofing?: () =>
|
|
78
|
-
locationSpoofing?: () =>
|
|
79
|
-
unsecureWifi?: () =>
|
|
80
|
-
automation?: () =>
|
|
81
|
-
bootloader?: () =>
|
|
70
|
+
privilegedAccess?: () => void;
|
|
71
|
+
debug?: () => void;
|
|
72
|
+
simulator?: () => void;
|
|
73
|
+
appIntegrity?: () => void;
|
|
74
|
+
unofficialStore?: () => void;
|
|
75
|
+
hooks?: () => void;
|
|
76
|
+
deviceBinding?: () => void;
|
|
77
|
+
deviceID?: () => void;
|
|
78
|
+
passcode?: () => void;
|
|
79
|
+
secureHardwareNotAvailable?: () => void;
|
|
80
|
+
obfuscationIssues?: () => void;
|
|
81
|
+
devMode?: () => void;
|
|
82
|
+
systemVPN?: () => void;
|
|
83
|
+
malware?: (suspiciousApps: SuspiciousAppInfo[]) => void;
|
|
84
|
+
adbEnabled?: () => void;
|
|
85
|
+
screenshot?: () => void;
|
|
86
|
+
screenRecording?: () => void;
|
|
87
|
+
multiInstance?: () => void;
|
|
88
|
+
timeSpoofing?: () => void;
|
|
89
|
+
locationSpoofing?: () => void;
|
|
90
|
+
unsecureWifi?: () => void;
|
|
91
|
+
automation?: () => void;
|
|
92
|
+
bootloader?: () => void;
|
|
93
|
+
/**
|
|
94
|
+
* Android only. Requires `startOngoingCallDetection()`.
|
|
95
|
+
*/
|
|
96
|
+
ongoingCall?: (state: CallState) => void;
|
|
82
97
|
};
|
|
83
98
|
|
|
84
|
-
export type NativeEvent = {
|
|
99
|
+
export type NativeEvent = {
|
|
100
|
+
[key: string]: number | string | string[] | undefined;
|
|
101
|
+
};
|
|
85
102
|
|
|
86
103
|
export type RaspExecutionStateEventActions = {
|
|
87
|
-
|
|
104
|
+
/**
|
|
105
|
+
* The fast (standard) checks have been completed. On Android, the postponed
|
|
106
|
+
* checks may still run afterwards. On iOS, triggered when all checks have
|
|
107
|
+
* been completed.
|
|
108
|
+
*/
|
|
109
|
+
fastChecksFinished?: () => void;
|
|
110
|
+
/**
|
|
111
|
+
* Android only. The critical checks have been completed, before the
|
|
112
|
+
* non-critical checks.
|
|
113
|
+
*/
|
|
114
|
+
criticalChecksFinished?: () => void;
|
|
115
|
+
/**
|
|
116
|
+
* Android only. The postponed checks have been completed, which ends the
|
|
117
|
+
* initial evaluation.
|
|
118
|
+
*/
|
|
119
|
+
postponedChecksFinished?: () => void;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* State returned by `useFreeRasp`.
|
|
124
|
+
*/
|
|
125
|
+
export type FreeRaspStatus = {
|
|
126
|
+
/** `true` once freeRASP has been started. */
|
|
127
|
+
started: boolean;
|
|
128
|
+
/** Error that prevented the listeners from being registered or freeRASP from starting. */
|
|
129
|
+
error: TalsecError | null;
|
|
88
130
|
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
package com.freeraspreactnative.events
|
|
2
|
-
|
|
3
|
-
import com.freeraspreactnative.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 AllChecksFinished : RaspExecutionStateEvent(RandomGenerator.next())
|
|
10
|
-
|
|
11
|
-
companion object Companion {
|
|
12
|
-
internal val CHANNEL_NAME = RandomGenerator.next().toString()
|
|
13
|
-
internal val CHANNEL_KEY = RandomGenerator.next().toString()
|
|
14
|
-
internal val ALL_EVENT_IDENTIFIERS = listOf(
|
|
15
|
-
AllChecksFinished
|
|
16
|
-
).map { it.value }
|
|
17
|
-
}
|
|
18
|
-
}
|