freerasp-react-native 1.0.0 → 2.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.
Files changed (170) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +423 -413
  3. package/android/build.gradle +90 -87
  4. package/android/gradle.properties +4 -4
  5. package/android/src/main/AndroidManifest.xml +4 -4
  6. package/android/src/main/java/com/freeraspreactnative/FreeraspDeviceStateListener.kt +25 -0
  7. package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt +125 -108
  8. package/android/src/main/java/com/freeraspreactnative/FreeraspReactNativePackage.kt +17 -17
  9. package/example/Gemfile +6 -6
  10. package/example/android/app/_BUCK +55 -55
  11. package/example/android/app/build.gradle +313 -313
  12. package/example/android/app/build_defs.bzl +19 -19
  13. package/example/android/app/proguard-rules.pro +10 -10
  14. package/example/android/app/src/debug/AndroidManifest.xml +13 -13
  15. package/example/android/app/src/debug/java/com/freeraspreactnativeexample/ReactNativeFlipper.java +73 -73
  16. package/example/android/app/src/main/AndroidManifest.xml +26 -26
  17. package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainActivity.java +48 -48
  18. package/example/android/app/src/main/java/com/freeraspreactnativeexample/MainApplication.java +91 -91
  19. package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/MainApplicationReactNativeHost.java +116 -116
  20. package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/components/MainComponentsRegistry.java +36 -36
  21. package/example/android/app/src/main/java/com/freeraspreactnativeexample/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -48
  22. package/example/android/app/src/main/jni/CMakeLists.txt +7 -7
  23. package/example/android/app/src/main/jni/MainApplicationModuleProvider.cpp +32 -32
  24. package/example/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -16
  25. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -45
  26. package/example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -38
  27. package/example/android/app/src/main/jni/MainComponentsRegistry.cpp +65 -65
  28. package/example/android/app/src/main/jni/MainComponentsRegistry.h +32 -32
  29. package/example/android/app/src/main/jni/OnLoad.cpp +11 -11
  30. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -36
  31. package/example/android/app/src/main/res/values/strings.xml +3 -3
  32. package/example/android/app/src/main/res/values/styles.xml +9 -9
  33. package/example/android/build.gradle +50 -53
  34. package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -5
  35. package/example/android/gradle.properties +40 -40
  36. package/example/android/gradlew +234 -234
  37. package/example/android/settings.gradle +11 -11
  38. package/example/app.json +3 -3
  39. package/example/assets/checkmark-circle-outline.png +0 -0
  40. package/example/assets/checkmark-circle-outline.svg +1 -0
  41. package/example/assets/close-circle-outline.png +0 -0
  42. package/example/assets/close-circle-outline.svg +1 -0
  43. package/example/assets/talsec-logo.png +0 -0
  44. package/example/babel.config.js +17 -17
  45. package/example/index.js +5 -5
  46. package/example/ios/File.swift +6 -6
  47. package/example/ios/FreeraspReactNativeExample/AppDelegate.h +8 -8
  48. package/example/ios/FreeraspReactNativeExample/AppDelegate.mm +133 -133
  49. package/example/ios/FreeraspReactNativeExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -53
  50. package/example/ios/FreeraspReactNativeExample/Images.xcassets/Contents.json +6 -6
  51. package/example/ios/FreeraspReactNativeExample/Info.plist +55 -55
  52. package/example/ios/FreeraspReactNativeExample/LaunchScreen.storyboard +47 -47
  53. package/example/ios/FreeraspReactNativeExample/main.m +10 -10
  54. package/example/ios/FreeraspReactNativeExample-Bridging-Header.h +3 -3
  55. package/example/ios/FreeraspReactNativeExample.xcodeproj/project.pbxproj +4 -2
  56. package/example/ios/FreeraspReactNativeExample.xcodeproj/xcshareddata/xcschemes/FreeraspReactNativeExample.xcscheme +88 -106
  57. package/example/ios/FreeraspReactNativeExample.xcworkspace/contents.xcworkspacedata +10 -10
  58. package/example/ios/FreeraspReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  59. package/example/ios/FreeraspReactNativeExampleTests/FreeraspReactNativeExampleTests.m +66 -66
  60. package/example/ios/FreeraspReactNativeExampleTests/Info.plist +24 -24
  61. package/example/ios/Podfile +43 -43
  62. package/example/ios/Podfile.lock +590 -584
  63. package/example/metro.config.js +40 -40
  64. package/example/package.json +24 -21
  65. package/example/react-native.config.js +10 -10
  66. package/example/src/App.tsx +136 -89
  67. package/example/src/DemoApp.tsx +89 -0
  68. package/example/src/checks.ts +16 -0
  69. package/example/src/styles.ts +7 -0
  70. package/example/yarn.lock +4644 -4154
  71. package/freerasp-react-native.podspec +36 -36
  72. package/ios/FreeraspReactNative-Bridging-Header.h +3 -3
  73. package/ios/FreeraspReactNative.m +14 -14
  74. package/ios/FreeraspReactNative.swift +62 -53
  75. package/ios/FreeraspReactNative.xcodeproj/xcshareddata/xcschemes/FreeraspReactNative.xcscheme +67 -67
  76. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/Info.plist +40 -40
  77. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
  78. package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator → TalsecRuntime.xcframework/ios-arm64}/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
  79. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -222
  80. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
  81. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -3029
  82. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -77
  83. package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator → TalsecRuntime.xcframework/ios-arm64}/TalsecRuntime.framework/Headers/easy.h +123 -123
  84. package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator → TalsecRuntime.xcframework/ios-arm64}/TalsecRuntime.framework/Headers/mprintf.h +50 -50
  85. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -456
  86. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -68
  87. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
  88. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -504
  89. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -125
  90. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
  91. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +52 -51
  92. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -17
  93. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  94. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -3154
  95. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -12
  96. package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
  97. package/ios/{Release/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
  98. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -450
  99. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
  100. package/ios/{Release/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/curl.h +3029 -3029
  101. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -77
  102. package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/easy.h +123 -123
  103. package/ios/{Release/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/mprintf.h +50 -50
  104. package/ios/{Release/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/multi.h +456 -456
  105. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -68
  106. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
  107. package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/Headers/system.h +504 -504
  108. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -125
  109. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
  110. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +52 -51
  111. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +52 -51
  112. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -17
  113. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  114. package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +344 -344
  115. package/ios/{Debug/TalsecRuntime.xcframework/ios-arm64 → TalsecRuntime.xcframework/ios-arm64_x86_64-simulator}/TalsecRuntime.framework/cacert.pem +3154 -3154
  116. package/ios/{Release/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -12
  117. package/lib/commonjs/index.js.map +1 -1
  118. package/lib/module/index.js.map +1 -1
  119. package/lib/typescript/index.d.ts +36 -35
  120. package/lib/typescript/index.d.ts.map +1 -1
  121. package/package.json +161 -161
  122. package/src/index.tsx +91 -90
  123. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +0 -25
  124. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +0 -222
  125. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +0 -50
  126. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +0 -68
  127. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +0 -33
  128. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +0 -125
  129. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
  130. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +0 -17
  131. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  132. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +0 -12
  133. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +0 -14
  134. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +0 -450
  135. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +0 -3029
  136. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +0 -456
  137. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +0 -504
  138. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
  139. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +0 -51
  140. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  141. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +0 -3154
  142. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +0 -12
  143. package/ios/Release/TalsecRuntime.xcframework/Info.plist +0 -40
  144. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +0 -23
  145. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +0 -77
  146. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +0 -123
  147. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  148. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +0 -51
  149. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +0 -14
  150. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +0 -25
  151. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +0 -23
  152. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +0 -3029
  153. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +0 -77
  154. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +0 -123
  155. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +0 -50
  156. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +0 -456
  157. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +0 -68
  158. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +0 -33
  159. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +0 -504
  160. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +0 -125
  161. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  162. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  163. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +0 -51
  164. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +0 -17
  165. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +0 -344
  166. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +0 -3154
  167. package/ios/TalsecRuntime.xcframework +0 -1
  168. /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  169. /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  170. /package/ios/{Debug/TalsecRuntime.xcframework → TalsecRuntime.xcframework}/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
@@ -1,40 +1,40 @@
1
- const path = require('path');
2
- const escape = require('escape-string-regexp');
3
- const exclusionList = require('metro-config/src/defaults/exclusionList');
4
- const pak = require('../package.json');
5
-
6
- const root = path.resolve(__dirname, '..');
7
-
8
- const modules = Object.keys({
9
- ...pak.peerDependencies,
10
- });
11
-
12
- module.exports = {
13
- projectRoot: __dirname,
14
- watchFolders: [root],
15
-
16
- // We need to make sure that only one version is loaded for peerDependencies
17
- // So we block them at the root, and alias them to the versions in example's node_modules
18
- resolver: {
19
- blacklistRE: exclusionList(
20
- modules.map(
21
- (m) =>
22
- new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
23
- )
24
- ),
25
-
26
- extraNodeModules: modules.reduce((acc, name) => {
27
- acc[name] = path.join(__dirname, 'node_modules', name);
28
- return acc;
29
- }, {}),
30
- },
31
-
32
- transformer: {
33
- getTransformOptions: async () => ({
34
- transform: {
35
- experimentalImportSupport: false,
36
- inlineRequires: true,
37
- },
38
- }),
39
- },
40
- };
1
+ const path = require('path');
2
+ const escape = require('escape-string-regexp');
3
+ const exclusionList = require('metro-config/src/defaults/exclusionList');
4
+ const pak = require('../package.json');
5
+
6
+ const root = path.resolve(__dirname, '..');
7
+
8
+ const modules = Object.keys({
9
+ ...pak.peerDependencies,
10
+ });
11
+
12
+ module.exports = {
13
+ projectRoot: __dirname,
14
+ watchFolders: [root],
15
+
16
+ // We need to make sure that only one version is loaded for peerDependencies
17
+ // So we block them at the root, and alias them to the versions in example's node_modules
18
+ resolver: {
19
+ blacklistRE: exclusionList(
20
+ modules.map(
21
+ (m) =>
22
+ new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
23
+ )
24
+ ),
25
+
26
+ extraNodeModules: modules.reduce((acc, name) => {
27
+ acc[name] = path.join(__dirname, 'node_modules', name);
28
+ return acc;
29
+ }, {}),
30
+ },
31
+
32
+ transformer: {
33
+ getTransformOptions: async () => ({
34
+ transform: {
35
+ experimentalImportSupport: false,
36
+ inlineRequires: true,
37
+ },
38
+ }),
39
+ },
40
+ };
@@ -1,21 +1,24 @@
1
- {
2
- "name": "FreeraspReactNativeExample",
3
- "version": "0.0.1",
4
- "private": true,
5
- "scripts": {
6
- "android": "react-native run-android",
7
- "ios": "react-native run-ios",
8
- "start": "react-native start",
9
- "pods": "pod-install --quiet"
10
- },
11
- "dependencies": {
12
- "react": "18.1.0",
13
- "react-native": "^0.70.6"
14
- },
15
- "devDependencies": {
16
- "@babel/core": "^7.12.9",
17
- "@babel/runtime": "^7.12.5",
18
- "babel-plugin-module-resolver": "^4.1.0",
19
- "metro-react-native-babel-preset": "0.72.3"
20
- }
21
- }
1
+ {
2
+ "name": "FreeraspReactNativeExample",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "scripts": {
6
+ "android": "react-native run-android",
7
+ "ios": "react-native run-ios",
8
+ "start": "react-native start",
9
+ "pods": "pod-install --quiet"
10
+ },
11
+ "dependencies": {
12
+ "@react-native-material/core": "^1.3.7",
13
+ "react": "18.1.0",
14
+ "react-native": "^0.70.6",
15
+ "react-native-svg": "^13.8.0"
16
+ },
17
+ "devDependencies": {
18
+ "@babel/core": "^7.12.9",
19
+ "@babel/runtime": "^7.12.5",
20
+ "babel-plugin-module-resolver": "^4.1.0",
21
+ "metro-react-native-babel-preset": "0.72.3",
22
+ "react-native-svg-transformer": "^1.0.0"
23
+ }
24
+ }
@@ -1,10 +1,10 @@
1
- const path = require('path');
2
- const pak = require('../package.json');
3
-
4
- module.exports = {
5
- dependencies: {
6
- [pak.name]: {
7
- root: path.join(__dirname, '..'),
8
- },
9
- },
10
- };
1
+ const path = require('path');
2
+ const pak = require('../package.json');
3
+
4
+ module.exports = {
5
+ dependencies: {
6
+ [pak.name]: {
7
+ root: path.join(__dirname, '..'),
8
+ },
9
+ },
10
+ };
@@ -1,89 +1,136 @@
1
- import * as React from 'react';
2
-
3
- import { StyleSheet, View, Text } from 'react-native';
4
- import { useFreeRasp } from 'freerasp-react-native';
5
-
6
- const App = () => {
7
- const config = {
8
- androidConfig: {
9
- packageName: 'com.freeraspreactnativeexample',
10
- certificateHashes: ['your_signing_certificate_hash_base64'],
11
- // supportedAlternativeStores: ['storeOne', 'storeTwo'],
12
- },
13
- iosConfig: {
14
- appBundleId: 'com.freeraspreactnativeexample',
15
- appTeamId: 'your_team_ID',
16
- },
17
- watcherMail: 'your_email_address@example.com',
18
- };
19
-
20
- const actions = {
21
- // Android & iOS
22
- 'privilegedAccess': () => {
23
- console.log('privilegedAccess');
24
- },
25
- // Android & iOS
26
- 'debug': () => {
27
- console.log('debug');
28
- },
29
- // Android & iOS
30
- 'simulator': () => {
31
- console.log('simulator');
32
- },
33
- // Android & iOS
34
- 'appIntegrity': () => {
35
- console.log('appIntegrity');
36
- },
37
- // Android & iOS
38
- 'unofficialStore': () => {
39
- console.log('unofficialStore');
40
- },
41
- // Android & iOS
42
- 'hooks': () => {
43
- console.log('hooks');
44
- },
45
- // Android & iOS
46
- 'device binding': () => {
47
- console.log('device binding');
48
- },
49
- // iOS only
50
- 'deviceID': () => {
51
- console.log('deviceID');
52
- },
53
- // iOS only
54
- 'missingSecureEnclave': () => {
55
- console.log('missingSecureEnclave');
56
- },
57
- // iOS only
58
- 'passcodeChange': () => {
59
- console.log('passcodeChange');
60
- },
61
- // iOS only
62
- 'passcode': () => {
63
- console.log('passcode');
64
- },
65
- };
66
-
67
- useFreeRasp(config, actions);
68
-
69
- return (
70
- <View style={styles.container}>
71
- <Text>Hello from the freeRASP app!</Text>
72
- </View>
73
- );
74
- };
75
-
76
- const styles = StyleSheet.create({
77
- container: {
78
- flex: 1,
79
- alignItems: 'center',
80
- justifyContent: 'center',
81
- },
82
- box: {
83
- width: 60,
84
- height: 60,
85
- marginVertical: 20,
86
- },
87
- });
88
-
89
- export default App;
1
+ import * as React from 'react';
2
+
3
+ import { Platform } from 'react-native';
4
+ import { useFreeRasp } from 'freerasp-react-native';
5
+ import { DemoApp } from './DemoApp';
6
+ import { commonChecks, iosChecks } from './checks';
7
+
8
+ const App = () => {
9
+ const [appChecks, setAppChecks] = React.useState([
10
+ ...commonChecks,
11
+ ...(Platform.OS === 'ios' ? iosChecks : []),
12
+ ]);
13
+
14
+ const config = {
15
+ androidConfig: {
16
+ packageName: 'com.freeraspreactnativeexample',
17
+ certificateHashes: ['your_signing_certificate_hash_base64'],
18
+ // supportedAlternativeStores: ['storeOne', 'storeTwo'],
19
+ },
20
+ iosConfig: {
21
+ appBundleId: 'com.freeraspreactnativeexample',
22
+ appTeamId: 'your_team_ID',
23
+ },
24
+ watcherMail: 'your_email_address@example.com',
25
+ isProd: true,
26
+ };
27
+
28
+ const actions = {
29
+ // Android & iOS
30
+ privilegedAccess: () => {
31
+ setAppChecks((currentState) =>
32
+ currentState.map((threat) =>
33
+ threat.name === 'Privileged Access'
34
+ ? { ...threat, status: 'nok' }
35
+ : threat
36
+ )
37
+ );
38
+ },
39
+ // Android & iOS
40
+ debug: () => {
41
+ setAppChecks((currentState) =>
42
+ currentState.map((threat) =>
43
+ threat.name === 'Debug' ? { ...threat, status: 'nok' } : threat
44
+ )
45
+ );
46
+ },
47
+ // Android & iOS
48
+ simulator: () => {
49
+ setAppChecks((currentState) =>
50
+ currentState.map((threat) =>
51
+ threat.name === 'Simulator' ? { ...threat, status: 'nok' } : threat
52
+ )
53
+ );
54
+ },
55
+ // Android & iOS
56
+ appIntegrity: () => {
57
+ setAppChecks((currentState) =>
58
+ currentState.map((threat) =>
59
+ threat.name === 'App Integrity'
60
+ ? { ...threat, status: 'nok' }
61
+ : threat
62
+ )
63
+ );
64
+ },
65
+ // Android & iOS
66
+ unofficialStore: () => {
67
+ setAppChecks((currentState) =>
68
+ currentState.map((threat) =>
69
+ threat.name === 'Unofficial Store'
70
+ ? { ...threat, status: 'nok' }
71
+ : threat
72
+ )
73
+ );
74
+ },
75
+ // Android & iOS
76
+ hooks: () => {
77
+ setAppChecks((currentState) =>
78
+ currentState.map((threat) =>
79
+ threat.name === 'Hooks' ? { ...threat, status: 'nok' } : threat
80
+ )
81
+ );
82
+ },
83
+ // Android & iOS
84
+ deviceBinding: () => {
85
+ setAppChecks((currentState) =>
86
+ currentState.map((threat) =>
87
+ threat.name === 'Device Binding'
88
+ ? { ...threat, status: 'nok' }
89
+ : threat
90
+ )
91
+ );
92
+ },
93
+ // Android & iOS
94
+ secureHardwareNotAvailable: () => {
95
+ setAppChecks((currentState) =>
96
+ currentState.map((threat) =>
97
+ threat.name === 'Secure Hardware Not Available'
98
+ ? { ...threat, status: 'nok' }
99
+ : threat
100
+ )
101
+ );
102
+ },
103
+ // Android & iOS
104
+ passcode: () => {
105
+ setAppChecks((currentState) =>
106
+ currentState.map((threat) =>
107
+ threat.name === 'Passcode' ? { ...threat, status: 'nok' } : threat
108
+ )
109
+ );
110
+ },
111
+ // iOS only
112
+ deviceID: () => {
113
+ setAppChecks((currentState) =>
114
+ currentState.map((threat) =>
115
+ threat.name === 'Device ID' ? { ...threat, status: 'nok' } : threat
116
+ )
117
+ );
118
+ },
119
+ // iOS only
120
+ passcodeChange: () => {
121
+ setAppChecks((currentState) =>
122
+ currentState.map((threat) =>
123
+ threat.name === 'Passcode Change'
124
+ ? { ...threat, status: 'nok' }
125
+ : threat
126
+ )
127
+ );
128
+ },
129
+ };
130
+
131
+ useFreeRasp(config, actions);
132
+
133
+ return <DemoApp checks={appChecks} />;
134
+ };
135
+
136
+ export default App;
@@ -0,0 +1,89 @@
1
+ /* eslint-disable react-native/no-inline-styles */
2
+ import * as React from 'react';
3
+ import { Box, Flex, HStack, Text, VStack } from '@react-native-material/core';
4
+ import CheckmarkCircle from '../assets/checkmark-circle-outline.png';
5
+ import CloseCircle from '../assets/close-circle-outline.png';
6
+ import TalsecLogo from '../assets/talsec-logo.png';
7
+ import { Image } from 'react-native';
8
+ import { Colors } from './styles';
9
+
10
+ export const DemoApp = (props: any) => {
11
+ return (
12
+ <>
13
+ <Flex
14
+ fill
15
+ style={{
16
+ backgroundColor: Colors.background,
17
+ justifyContent: 'center',
18
+ }}
19
+ >
20
+ <VStack>
21
+ <Image source={TalsecLogo} style={{ alignSelf: 'center' }} />;
22
+ <Text
23
+ style={{
24
+ alignSelf: 'center',
25
+ fontWeight: 'bold',
26
+ fontSize: 25,
27
+ color: 'white',
28
+ paddingTop: 15,
29
+ }}
30
+ >
31
+ freeRASP checks:
32
+ </Text>
33
+ {props.checks.map((check: any, idx: number) => (
34
+ <Box
35
+ key={idx}
36
+ style={{
37
+ borderColor:
38
+ check.status === 'ok'
39
+ ? Colors.checkOkDark
40
+ : Colors.checkNokDark,
41
+ backgroundColor:
42
+ check.status === 'ok'
43
+ ? Colors.checkOkLight
44
+ : Colors.checkNokLight,
45
+ borderWidth: 1,
46
+ paddingHorizontal: 30,
47
+ paddingVertical: 4,
48
+ marginVertical: 8,
49
+ marginHorizontal: 20,
50
+ borderRadius: 15,
51
+ }}
52
+ >
53
+ <HStack style={{ justifyContent: 'space-between' }}>
54
+ <Text
55
+ style={{
56
+ color: check.status === 'ok' ? 'green' : 'rgb(200, 0, 0)',
57
+ fontWeight: 'bold',
58
+ alignSelf: 'center',
59
+ }}
60
+ >
61
+ {check.name}
62
+ </Text>
63
+ {check.status === 'ok' ? (
64
+ <Image
65
+ source={CheckmarkCircle}
66
+ style={{
67
+ tintColor: Colors.checkOkDark,
68
+ width: 30,
69
+ height: 30,
70
+ }}
71
+ />
72
+ ) : (
73
+ <Image
74
+ source={CloseCircle}
75
+ style={{
76
+ tintColor: Colors.checkNokDark,
77
+ width: 30,
78
+ height: 30,
79
+ }}
80
+ />
81
+ )}
82
+ </HStack>
83
+ </Box>
84
+ ))}
85
+ </VStack>
86
+ </Flex>
87
+ </>
88
+ );
89
+ };
@@ -0,0 +1,16 @@
1
+ export const commonChecks = [
2
+ { name: 'Privileged Access', status: 'ok' },
3
+ { name: 'Debug', status: 'ok' },
4
+ { name: 'Simulator', status: 'ok' },
5
+ { name: 'App Integrity', status: 'ok' },
6
+ { name: 'Unofficial Store', status: 'ok' },
7
+ { name: 'Hooks', status: 'ok' },
8
+ { name: 'Device Binding', status: 'ok' },
9
+ { name: 'Secure Hardware Not Available', status: 'ok' },
10
+ { name: 'Passcode', status: 'ok' },
11
+ ];
12
+
13
+ export const iosChecks = [
14
+ { name: 'Device ID', status: 'ok' },
15
+ { name: 'Passcode Change', status: 'ok' },
16
+ ];
@@ -0,0 +1,7 @@
1
+ export const Colors = {
2
+ background: 'rgba(26, 31, 45, 255)',
3
+ checkOkLight: 'rgba(173, 247, 187, 1)',
4
+ checkNokLight: 'rgba(247, 173, 173, 1)',
5
+ checkOkDark: 'green',
6
+ checkNokDark: 'rgb(200, 0, 0)',
7
+ };