freerasp-react-native 1.0.0 → 1.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 (159) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +442 -413
  3. package/android/build.gradle +87 -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 +113 -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 +53 -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/xcshareddata/xcschemes/FreeraspReactNativeExample.xcscheme +106 -106
  56. package/example/ios/FreeraspReactNativeExample.xcworkspace/contents.xcworkspacedata +10 -10
  57. package/example/ios/FreeraspReactNativeExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -8
  58. package/example/ios/FreeraspReactNativeExampleTests/FreeraspReactNativeExampleTests.m +66 -66
  59. package/example/ios/FreeraspReactNativeExampleTests/Info.plist +24 -24
  60. package/example/ios/Podfile +43 -43
  61. package/example/ios/Podfile.lock +590 -584
  62. package/example/metro.config.js +40 -40
  63. package/example/package.json +24 -21
  64. package/example/react-native.config.js +10 -10
  65. package/example/src/App.tsx +135 -89
  66. package/example/src/DemoApp.tsx +89 -0
  67. package/example/src/checks.ts +16 -0
  68. package/example/src/styles.ts +7 -0
  69. package/example/yarn.lock +4644 -4154
  70. package/freerasp-react-native.podspec +36 -36
  71. package/ios/Debug/TalsecRuntime.xcframework/Info.plist +40 -40
  72. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
  73. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
  74. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -222
  75. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
  76. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -3029
  77. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -77
  78. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +123 -123
  79. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +50 -50
  80. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -456
  81. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -68
  82. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
  83. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -504
  84. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -125
  85. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +51 -51
  86. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -17
  87. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  88. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -3154
  89. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -12
  90. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
  91. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
  92. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -450
  93. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
  94. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +3029 -3029
  95. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -77
  96. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +123 -123
  97. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +50 -50
  98. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +456 -456
  99. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -68
  100. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
  101. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +504 -504
  102. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -125
  103. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -51
  104. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +51 -51
  105. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -17
  106. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  107. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +344 -344
  108. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +3154 -3154
  109. package/ios/Debug/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -12
  110. package/ios/FreeraspReactNative-Bridging-Header.h +3 -3
  111. package/ios/FreeraspReactNative.m +14 -14
  112. package/ios/FreeraspReactNative.swift +57 -53
  113. package/ios/FreeraspReactNative.xcodeproj/xcshareddata/xcschemes/FreeraspReactNative.xcscheme +67 -67
  114. package/ios/Release/TalsecRuntime.xcframework/Info.plist +40 -40
  115. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
  116. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
  117. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +222 -222
  118. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
  119. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +3029 -3029
  120. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curlver.h +77 -77
  121. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/easy.h +123 -123
  122. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/mprintf.h +50 -50
  123. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +456 -456
  124. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +68 -68
  125. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
  126. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/system.h +504 -504
  127. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +125 -125
  128. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +51 -51
  129. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/module.modulemap +17 -17
  130. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  131. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +3154 -3154
  132. package/ios/Release/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/module.modulemap +12 -12
  133. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CryptoBridgingHeader.h +14 -14
  134. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +25 -25
  135. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +450 -450
  136. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime_iOS.h +23 -23
  137. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +3029 -3029
  138. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curlver.h +77 -77
  139. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/easy.h +123 -123
  140. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/mprintf.h +50 -50
  141. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +456 -456
  142. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +68 -68
  143. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/stdcheaders.h +33 -33
  144. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/system.h +504 -504
  145. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +125 -125
  146. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +51 -51
  147. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +51 -51
  148. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/module.modulemap +17 -17
  149. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  150. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +344 -344
  151. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +3154 -3154
  152. package/ios/Release/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/module.modulemap +12 -12
  153. package/lib/commonjs/index.js.map +1 -1
  154. package/lib/module/index.js.map +1 -1
  155. package/lib/typescript/index.d.ts +35 -35
  156. package/lib/typescript/index.d.ts.map +1 -1
  157. package/package.json +161 -161
  158. package/src/index.tsx +90 -90
  159. package/ios/TalsecRuntime.xcframework +0 -1
@@ -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,135 @@
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
+ };
26
+
27
+ const actions = {
28
+ // Android & iOS
29
+ 'privilegedAccess': () => {
30
+ setAppChecks((currentState) =>
31
+ currentState.map((threat) =>
32
+ threat.name === 'Privileged Access'
33
+ ? { ...threat, status: 'nok' }
34
+ : threat
35
+ )
36
+ );
37
+ },
38
+ // Android & iOS
39
+ 'debug': () => {
40
+ setAppChecks((currentState) =>
41
+ currentState.map((threat) =>
42
+ threat.name === 'Debug' ? { ...threat, status: 'nok' } : threat
43
+ )
44
+ );
45
+ },
46
+ // Android & iOS
47
+ 'simulator': () => {
48
+ setAppChecks((currentState) =>
49
+ currentState.map((threat) =>
50
+ threat.name === 'Simulator' ? { ...threat, status: 'nok' } : threat
51
+ )
52
+ );
53
+ },
54
+ // Android & iOS
55
+ 'appIntegrity': () => {
56
+ setAppChecks((currentState) =>
57
+ currentState.map((threat) =>
58
+ threat.name === 'App Integrity'
59
+ ? { ...threat, status: 'nok' }
60
+ : threat
61
+ )
62
+ );
63
+ },
64
+ // Android & iOS
65
+ 'unofficialStore': () => {
66
+ setAppChecks((currentState) =>
67
+ currentState.map((threat) =>
68
+ threat.name === 'Unofficial Store'
69
+ ? { ...threat, status: 'nok' }
70
+ : threat
71
+ )
72
+ );
73
+ },
74
+ // Android & iOS
75
+ 'hooks': () => {
76
+ setAppChecks((currentState) =>
77
+ currentState.map((threat) =>
78
+ threat.name === 'Hooks' ? { ...threat, status: 'nok' } : threat
79
+ )
80
+ );
81
+ },
82
+ // Android & iOS
83
+ 'device binding': () => {
84
+ setAppChecks((currentState) =>
85
+ currentState.map((threat) =>
86
+ threat.name === 'Device Binding'
87
+ ? { ...threat, status: 'nok' }
88
+ : threat
89
+ )
90
+ );
91
+ },
92
+ // Android & iOS
93
+ 'secureHardwareNotAvailable': () => {
94
+ setAppChecks((currentState) =>
95
+ currentState.map((threat) =>
96
+ threat.name === 'Secure Hardware Not Available'
97
+ ? { ...threat, status: 'nok' }
98
+ : threat
99
+ )
100
+ );
101
+ },
102
+ // Android & iOS
103
+ 'passcode': () => {
104
+ setAppChecks((currentState) =>
105
+ currentState.map((threat) =>
106
+ threat.name === 'Passcode' ? { ...threat, status: 'nok' } : threat
107
+ )
108
+ );
109
+ },
110
+ // iOS only
111
+ 'deviceID': () => {
112
+ setAppChecks((currentState) =>
113
+ currentState.map((threat) =>
114
+ threat.name === 'Device ID' ? { ...threat, status: 'nok' } : threat
115
+ )
116
+ );
117
+ },
118
+ // iOS only
119
+ 'passcodeChange': () => {
120
+ setAppChecks((currentState) =>
121
+ currentState.map((threat) =>
122
+ threat.name === 'Passcode Change'
123
+ ? { ...threat, status: 'nok' }
124
+ : threat
125
+ )
126
+ );
127
+ },
128
+ };
129
+
130
+ useFreeRasp(config, actions);
131
+
132
+ return <DemoApp checks={appChecks} />;
133
+ };
134
+
135
+ 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
+ };