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.
Files changed (153) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +2 -0
  3. package/android/build.gradle +3 -3
  4. package/android/proguard-rules.pro +3 -3
  5. package/android/src/main/AndroidManifest.xml +1 -1
  6. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/FreeraspReactNativeModule.kt +177 -17
  7. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/FreeraspReactNativePackage.kt +1 -1
  8. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/PluginThreatHandler.kt +20 -7
  9. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/ScreenProtector.kt +1 -1
  10. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/dispatchers/ExecutionStateDispatcher.kt +3 -3
  11. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/dispatchers/ThreatDispatcher.kt +23 -3
  12. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/events/BaseRaspEvent.kt +1 -1
  13. package/android/src/main/java/app/talsec/rasp/reactnative/events/RaspExecutionStateEvent.kt +22 -0
  14. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/events/ThreatEvent.kt +6 -3
  15. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/exceptions/TalsecException.kt +1 -1
  16. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/interfaces/PluginExecutionStateListener.kt +2 -2
  17. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/interfaces/PluginThreatListener.kt +4 -2
  18. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/models/RNSuspiciousAppInfo.kt +1 -1
  19. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/Extensions.kt +4 -4
  20. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/RandomGenerator.kt +1 -1
  21. package/android/src/main/java/{com/freeraspreactnative → app/talsec/rasp/reactnative}/utils/Utils.kt +1 -1
  22. package/ios/FreeraspReactNative.swift +17 -8
  23. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeDirectory +0 -0
  24. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeResources +88 -88
  25. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeSignature +0 -0
  26. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  27. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +2 -2
  28. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +292 -265
  29. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +10 -11
  30. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +4 -6
  31. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/header.h +9 -9
  32. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +147 -112
  33. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +1 -1
  34. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +14 -23
  35. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/typecheck-gcc.h +420 -403
  36. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +29 -28
  37. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/websockets.h +10 -10
  38. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
  39. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.abi.json +563 -312
  40. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +10 -3
  41. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  42. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +10 -3
  43. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  44. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/_CodeSignature/CodeResources +35 -35
  45. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +483 -1088
  46. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  47. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +4 -4
  48. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +292 -265
  49. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +10 -11
  50. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +4 -6
  51. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/header.h +9 -9
  52. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +147 -112
  53. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +1 -1
  54. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +14 -23
  55. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/typecheck-gcc.h +420 -403
  56. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +29 -28
  57. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/websockets.h +10 -10
  58. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
  59. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.abi.json +548 -297
  60. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +10 -3
  61. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  62. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +10 -3
  63. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +548 -297
  64. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +10 -3
  65. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  66. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +10 -3
  67. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  68. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +43 -43
  69. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +483 -1088
  70. package/ios/TalsecRuntimePackage/Package.swift +2 -2
  71. package/ios/dispatchers/ExecutionStateDispatcher.swift +4 -3
  72. package/ios/models/RaspExecutionStates.swift +10 -3
  73. package/ios/utils/EventIdentifiers.swift +2 -2
  74. package/lib/commonjs/api/listeners/raspExecutionState.js +13 -7
  75. package/lib/commonjs/api/listeners/raspExecutionState.js.map +1 -1
  76. package/lib/commonjs/api/listeners/threat.js +19 -8
  77. package/lib/commonjs/api/listeners/threat.js.map +1 -1
  78. package/lib/commonjs/api/methods/internal.js +20 -0
  79. package/lib/commonjs/api/methods/internal.js.map +1 -0
  80. package/lib/commonjs/api/methods/native.js +113 -21
  81. package/lib/commonjs/api/methods/native.js.map +1 -1
  82. package/lib/commonjs/api/methods/reactNative.js +38 -10
  83. package/lib/commonjs/api/methods/reactNative.js.map +1 -1
  84. package/lib/commonjs/channels/raspExecutionState.js +3 -3
  85. package/lib/commonjs/channels/raspExecutionState.js.map +1 -1
  86. package/lib/commonjs/channels/threat.js +4 -4
  87. package/lib/commonjs/channels/threat.js.map +1 -1
  88. package/lib/commonjs/index.js +23 -0
  89. package/lib/commonjs/index.js.map +1 -1
  90. package/lib/commonjs/models/raspExecutionState.js +4 -2
  91. package/lib/commonjs/models/raspExecutionState.js.map +1 -1
  92. package/lib/commonjs/models/threat.js +2 -1
  93. package/lib/commonjs/models/threat.js.map +1 -1
  94. package/lib/commonjs/types/errors.js +50 -0
  95. package/lib/commonjs/types/errors.js.map +1 -0
  96. package/lib/commonjs/types/types.js +4 -0
  97. package/lib/module/api/listeners/raspExecutionState.js +10 -4
  98. package/lib/module/api/listeners/raspExecutionState.js.map +1 -1
  99. package/lib/module/api/listeners/threat.js +16 -5
  100. package/lib/module/api/listeners/threat.js.map +1 -1
  101. package/lib/module/api/methods/internal.js +13 -0
  102. package/lib/module/api/methods/internal.js.map +1 -0
  103. package/lib/module/api/methods/native.js +106 -17
  104. package/lib/module/api/methods/native.js.map +1 -1
  105. package/lib/module/api/methods/reactNative.js +39 -12
  106. package/lib/module/api/methods/reactNative.js.map +1 -1
  107. package/lib/module/channels/raspExecutionState.js +1 -1
  108. package/lib/module/channels/raspExecutionState.js.map +1 -1
  109. package/lib/module/channels/threat.js +2 -2
  110. package/lib/module/channels/threat.js.map +1 -1
  111. package/lib/module/index.js +2 -0
  112. package/lib/module/index.js.map +1 -1
  113. package/lib/module/models/raspExecutionState.js +4 -2
  114. package/lib/module/models/raspExecutionState.js.map +1 -1
  115. package/lib/module/models/threat.js +2 -1
  116. package/lib/module/models/threat.js.map +1 -1
  117. package/lib/module/types/errors.js +41 -0
  118. package/lib/module/types/errors.js.map +1 -0
  119. package/lib/module/types/types.js +1 -1
  120. package/lib/typescript/src/api/listeners/raspExecutionState.d.ts.map +1 -1
  121. package/lib/typescript/src/api/listeners/threat.d.ts.map +1 -1
  122. package/lib/typescript/src/api/methods/internal.d.ts +7 -0
  123. package/lib/typescript/src/api/methods/internal.d.ts.map +1 -0
  124. package/lib/typescript/src/api/methods/native.d.ts +56 -7
  125. package/lib/typescript/src/api/methods/native.d.ts.map +1 -1
  126. package/lib/typescript/src/api/methods/reactNative.d.ts +11 -2
  127. package/lib/typescript/src/api/methods/reactNative.d.ts.map +1 -1
  128. package/lib/typescript/src/channels/threat.d.ts +1 -0
  129. package/lib/typescript/src/channels/threat.d.ts.map +1 -1
  130. package/lib/typescript/src/index.d.ts +2 -0
  131. package/lib/typescript/src/index.d.ts.map +1 -1
  132. package/lib/typescript/src/models/raspExecutionState.d.ts +3 -1
  133. package/lib/typescript/src/models/raspExecutionState.d.ts.map +1 -1
  134. package/lib/typescript/src/models/threat.d.ts +1 -0
  135. package/lib/typescript/src/models/threat.d.ts.map +1 -1
  136. package/lib/typescript/src/types/errors.d.ts +26 -0
  137. package/lib/typescript/src/types/errors.d.ts.map +1 -0
  138. package/lib/typescript/src/types/types.d.ts +61 -26
  139. package/lib/typescript/src/types/types.d.ts.map +1 -1
  140. package/package.json +1 -1
  141. package/src/api/listeners/raspExecutionState.ts +9 -3
  142. package/src/api/listeners/threat.ts +29 -5
  143. package/src/api/methods/internal.ts +13 -0
  144. package/src/api/methods/native.ts +125 -21
  145. package/src/api/methods/reactNative.ts +46 -16
  146. package/src/channels/raspExecutionState.ts +1 -1
  147. package/src/channels/threat.ts +3 -3
  148. package/src/index.tsx +2 -0
  149. package/src/models/raspExecutionState.ts +8 -2
  150. package/src/models/threat.ts +2 -0
  151. package/src/types/errors.ts +57 -0
  152. package/src/types/types.ts +66 -26
  153. package/android/src/main/java/com/freeraspreactnative/events/RaspExecutionStateEvent.kt +0 -18
@@ -1,4 +1,4 @@
1
- package com.freeraspreactnative.utils
1
+ package app.talsec.rasp.reactnative.utils
2
2
 
3
3
  import android.content.pm.ApplicationInfo
4
4
  import android.graphics.Bitmap
@@ -51,8 +51,8 @@ class FreeraspReactNative: RCTEventEmitter {
51
51
  guard let iosConfig = talsecConfig["iosConfig"] as? NSDictionary else {
52
52
  throw NSError(domain: "Missing iosConfig parameter in Talsec Native Plugin", code: 1)
53
53
  }
54
- guard let appBundleIds = iosConfig["appBundleId"] as? String else {
55
- throw NSError(domain: "Missing appBundleId parameter in Talsec Native Plugin", code: 2)
54
+ guard let appBundleIds = iosConfig["appBundleIds"] as? [String] else {
55
+ throw NSError(domain: "Missing appBundleIds parameter in Talsec Native Plugin", code: 2)
56
56
  }
57
57
  guard let appTeamId = iosConfig["appTeamId"] as? String else {
58
58
  throw NSError(domain: "Missing appTeamId parameter in Talsec Native Plugin", code: 3)
@@ -62,7 +62,7 @@ class FreeraspReactNative: RCTEventEmitter {
62
62
  }
63
63
  let isProd = talsecConfig["isProd"] as? Bool ?? true
64
64
 
65
- let config = TalsecConfig(appBundleIds: [appBundleIds], appTeamId: appTeamId, watcherMailAddress: watcherMailAddress, isProd: isProd)
65
+ let config = TalsecConfig(appBundleIds: appBundleIds, appTeamId: appTeamId, watcherMailAddress: watcherMailAddress, isProd: isProd)
66
66
  Talsec.start(config: config)
67
67
  }
68
68
 
@@ -92,13 +92,13 @@ class FreeraspReactNative: RCTEventEmitter {
92
92
 
93
93
  @objc(storeExternalId:withResolver:withRejecter:)
94
94
  private func storeExternalId(externalId: String, resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) -> Void {
95
- UserDefaults.standard.set(externalId, forKey: "app.talsec.externalid")
95
+ Talsec.storeExternalId(externalId: externalId)
96
96
  resolve("OK - Store external ID")
97
97
  }
98
98
 
99
99
  @objc(removeExternalId:withRejecter:)
100
100
  private func removeExternalId(resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) -> Void {
101
- UserDefaults.standard.removeObject(forKey: "app.talsec.externalid")
101
+ Talsec.removeExternalId()
102
102
  resolve("OK - External ID removed")
103
103
  }
104
104
 
@@ -107,7 +107,8 @@ class FreeraspReactNative: RCTEventEmitter {
107
107
  */
108
108
  @objc(getThreatChannelData:withRejecter:)
109
109
  private func getThreatChannelData(resolve: RCTPromiseResolveBlock, rejecter reject: RCTPromiseRejectBlock) -> Void {
110
- resolve([EventIdentifiers.threatChannelName, EventIdentifiers.threatChannelKey, "0"])
110
+ // Malware and ongoing call are Android only, so iOS sends placeholders for their keys
111
+ resolve([EventIdentifiers.threatChannelName, EventIdentifiers.threatChannelKey, "0", "0"])
111
112
  }
112
113
 
113
114
  /**
@@ -172,8 +173,16 @@ extension SecurityThreatCenter: @retroactive SecurityThreatHandler, @retroactive
172
173
  ThreatDispatcher.shared.dispatch(threat: securityThreat)
173
174
  }
174
175
 
175
- public func onAllChecksFinished() {
176
- ExecutionStateDispatcher.shared.dispatch(event: RaspExecutionStates.allChecksFinished)
176
+ public func onCriticalChecksFinished() {
177
+ ExecutionStateDispatcher.shared.dispatch(event: RaspExecutionStates.criticalChecksFinished)
178
+ }
179
+
180
+ public func onFastChecksFinished() {
181
+ ExecutionStateDispatcher.shared.dispatch(event: RaspExecutionStates.fastChecksFinished)
182
+ }
183
+
184
+ public func onPostponedChecksFinished() {
185
+ ExecutionStateDispatcher.shared.dispatch(event: RaspExecutionStates.postponedChecksFinished)
177
186
  }
178
187
  }
179
188