freerasp-react-native 3.7.2 → 3.8.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 +19 -0
- package/README.md +10 -0
- package/android/build.gradle +2 -1
- package/android/proguard-rules.pro +1 -0
- package/android/src/main/java/com/freeraspreactnative/FreeraspThreatHandler.kt +8 -0
- package/android/src/main/java/com/freeraspreactnative/Threat.kt +5 -2
- package/example/index.d.ts +1 -0
- package/example/ios/FreeraspReactNativeExample.xcodeproj/project.pbxproj +15 -0
- package/example/package.json +8 -3
- package/example/src/App.tsx +18 -0
- package/example/src/checks.ts +10 -6
- package/example/yarn.lock +1167 -1770
- package/ios/FreeraspReactNative.swift +23 -18
- 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 +93 -93
- 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 +214 -77
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +1 -0
- 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 +1 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +909 -464
- 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 +214 -77
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1 -0
- 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 +1 -0
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +214 -77
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1 -0
- 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 +1 -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 +35 -35
- package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +909 -464
- package/lib/commonjs/definitions.js +3 -1
- package/lib/commonjs/definitions.js.map +1 -1
- package/lib/commonjs/index.js +7 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/definitions.js +3 -1
- package/lib/module/definitions.js.map +1 -1
- package/lib/module/index.js +7 -1
- package/lib/module/index.js.map +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/definitions.d.ts +4 -0
- package/lib/typescript/src/definitions.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +8 -17
- package/plugin/build/index.d.ts +1 -1
- package/src/definitions.ts +7 -0
- package/src/index.tsx +8 -2
|
@@ -5,10 +5,9 @@ import TalsecRuntime
|
|
|
5
5
|
class FreeraspReactNative: RCTEventEmitter {
|
|
6
6
|
|
|
7
7
|
public static var shared:FreeraspReactNative?
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
let threatChannelKey = String(Int.random(in: 100_000..<999_999_999)) // key of the argument map under which threats are expected
|
|
10
10
|
let threatChannelName = String(Int.random(in: 100_000..<999_999_999)) // name of the channel over which threat callbacks are sent
|
|
11
|
-
let threatIdentifierList = (1...12).map { _ in Int.random(in: 100_000..<999_999_999) }
|
|
12
11
|
|
|
13
12
|
override init() {
|
|
14
13
|
super.init()
|
|
@@ -45,7 +44,7 @@ class FreeraspReactNative: RCTEventEmitter {
|
|
|
45
44
|
let config = TalsecConfig(appBundleIds: [appBundleIds], appTeamId: appTeamId, watcherMailAddress: watcherMailAddress, isProd: isProd)
|
|
46
45
|
Talsec.start(config: config)
|
|
47
46
|
}
|
|
48
|
-
|
|
47
|
+
|
|
49
48
|
/**
|
|
50
49
|
* Method to setup the message passing between native and React Native
|
|
51
50
|
*/
|
|
@@ -53,11 +52,11 @@ class FreeraspReactNative: RCTEventEmitter {
|
|
|
53
52
|
private func getThreatChannelData(resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) -> Void {
|
|
54
53
|
resolve([threatChannelName, threatChannelKey])
|
|
55
54
|
}
|
|
56
|
-
|
|
55
|
+
|
|
57
56
|
func dispatchEvent(securityThreat: SecurityThreat) -> Void {
|
|
58
57
|
FreeraspReactNative.shared!.sendEvent(withName: threatChannelName, body: [threatChannelKey: securityThreat.callbackIdentifier])
|
|
59
58
|
}
|
|
60
|
-
|
|
59
|
+
|
|
61
60
|
/**
|
|
62
61
|
* Method to get the random identifiers of callbacks
|
|
63
62
|
*/
|
|
@@ -65,7 +64,7 @@ class FreeraspReactNative: RCTEventEmitter {
|
|
|
65
64
|
private func getThreatIdentifiers(resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) -> Void {
|
|
66
65
|
resolve(getThreatIdentifiers())
|
|
67
66
|
}
|
|
68
|
-
|
|
67
|
+
|
|
69
68
|
/**
|
|
70
69
|
* We never send an invalid callback over our channel.
|
|
71
70
|
* Therefore, if this happens, we want to kill the app.
|
|
@@ -74,7 +73,7 @@ class FreeraspReactNative: RCTEventEmitter {
|
|
|
74
73
|
private func onInvalidCallback() -> Void {
|
|
75
74
|
abort()
|
|
76
75
|
}
|
|
77
|
-
|
|
76
|
+
|
|
78
77
|
private func getThreatIdentifiers() -> [Int] {
|
|
79
78
|
return SecurityThreat.allCases
|
|
80
79
|
.filter {
|
|
@@ -90,33 +89,39 @@ class FreeraspReactNative: RCTEventEmitter {
|
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
91
|
|
|
92
|
+
struct ThreatIdentifiers {
|
|
93
|
+
static let threatIdentifierList: [Int] = (1...12).map { _ in Int.random(in: 100_000..<999_999_999) }
|
|
94
|
+
}
|
|
95
|
+
|
|
93
96
|
/// An extension to unify callback names with RN ones.
|
|
94
97
|
extension SecurityThreat {
|
|
95
98
|
|
|
96
99
|
var callbackIdentifier: Int {
|
|
97
100
|
switch self {
|
|
98
101
|
case .signature:
|
|
99
|
-
|
|
102
|
+
return ThreatIdentifiers.threatIdentifierList[0]
|
|
100
103
|
case .jailbreak:
|
|
101
|
-
return
|
|
104
|
+
return ThreatIdentifiers.threatIdentifierList[1]
|
|
102
105
|
case .debugger:
|
|
103
|
-
return
|
|
106
|
+
return ThreatIdentifiers.threatIdentifierList[2]
|
|
104
107
|
case .runtimeManipulation:
|
|
105
|
-
return
|
|
108
|
+
return ThreatIdentifiers.threatIdentifierList[3]
|
|
106
109
|
case .passcode:
|
|
107
|
-
return
|
|
110
|
+
return ThreatIdentifiers.threatIdentifierList[4]
|
|
108
111
|
case .passcodeChange:
|
|
109
|
-
return
|
|
112
|
+
return ThreatIdentifiers.threatIdentifierList[5]
|
|
110
113
|
case .simulator:
|
|
111
|
-
return
|
|
114
|
+
return ThreatIdentifiers.threatIdentifierList[6]
|
|
112
115
|
case .missingSecureEnclave:
|
|
113
|
-
return
|
|
116
|
+
return ThreatIdentifiers.threatIdentifierList[7]
|
|
117
|
+
case .systemVPN:
|
|
118
|
+
return ThreatIdentifiers.threatIdentifierList[8]
|
|
114
119
|
case .deviceChange:
|
|
115
|
-
return
|
|
120
|
+
return ThreatIdentifiers.threatIdentifierList[9]
|
|
116
121
|
case .deviceID:
|
|
117
|
-
return
|
|
122
|
+
return ThreatIdentifiers.threatIdentifierList[10]
|
|
118
123
|
case .unofficialStore:
|
|
119
|
-
|
|
124
|
+
return ThreatIdentifiers.threatIdentifierList[11]
|
|
120
125
|
@unknown default:
|
|
121
126
|
abort()
|
|
122
127
|
}
|
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
<array>
|
|
7
7
|
<dict>
|
|
8
8
|
<key>LibraryIdentifier</key>
|
|
9
|
-
<string>ios-
|
|
9
|
+
<string>ios-arm64</string>
|
|
10
10
|
<key>LibraryPath</key>
|
|
11
11
|
<string>TalsecRuntime.framework</string>
|
|
12
12
|
<key>SupportedArchitectures</key>
|
|
13
13
|
<array>
|
|
14
14
|
<string>arm64</string>
|
|
15
|
-
<string>x86_64</string>
|
|
16
15
|
</array>
|
|
17
16
|
<key>SupportedPlatform</key>
|
|
18
17
|
<string>ios</string>
|
|
19
|
-
<key>SupportedPlatformVariant</key>
|
|
20
|
-
<string>simulator</string>
|
|
21
18
|
</dict>
|
|
22
19
|
<dict>
|
|
23
20
|
<key>LibraryIdentifier</key>
|
|
24
|
-
<string>ios-
|
|
21
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
25
22
|
<key>LibraryPath</key>
|
|
26
23
|
<string>TalsecRuntime.framework</string>
|
|
27
24
|
<key>SupportedArchitectures</key>
|
|
28
25
|
<array>
|
|
29
26
|
<string>arm64</string>
|
|
27
|
+
<string>x86_64</string>
|
|
30
28
|
</array>
|
|
31
29
|
<key>SupportedPlatform</key>
|
|
32
30
|
<string>ios</string>
|
|
31
|
+
<key>SupportedPlatformVariant</key>
|
|
32
|
+
<string>simulator</string>
|
|
33
33
|
</dict>
|
|
34
34
|
</array>
|
|
35
35
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|