freerasp-react-native 3.7.1-1 → 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.
Files changed (71) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +26 -3
  3. package/android/build.gradle +2 -1
  4. package/android/proguard-rules.pro +1 -0
  5. package/android/src/main/java/com/freeraspreactnative/FreeraspThreatHandler.kt +8 -0
  6. package/android/src/main/java/com/freeraspreactnative/Threat.kt +5 -2
  7. package/example/index.d.ts +1 -0
  8. package/example/ios/FreeraspReactNativeExample.xcodeproj/project.pbxproj +15 -0
  9. package/example/package.json +8 -3
  10. package/example/src/App.tsx +18 -0
  11. package/example/src/checks.ts +10 -6
  12. package/example/yarn.lock +1167 -1770
  13. package/ios/FreeraspReactNative.swift +23 -18
  14. package/ios/TalsecRuntime.xcframework/Info.plist +5 -5
  15. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeDirectory +0 -0
  16. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
  17. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeResources +93 -93
  18. package/ios/TalsecRuntime.xcframework/_CodeSignature/CodeSignature +0 -0
  19. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  20. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +1 -1
  21. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/curl.h +7 -7
  22. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/multi.h +4 -4
  23. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/options.h +1 -1
  24. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/urlapi.h +1 -1
  25. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Info.plist +0 -0
  26. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.abi.json +214 -77
  27. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.private.swiftinterface +1 -0
  28. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  29. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios.swiftinterface +1 -0
  30. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/TalsecRuntime +0 -0
  31. package/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/cacert.pem +909 -464
  32. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/CurlWrapper.h +1 -1
  33. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h +2 -2
  34. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/curl.h +7 -7
  35. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/multi.h +4 -4
  36. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/options.h +1 -1
  37. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Headers/urlapi.h +1 -1
  38. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Info.plist +0 -0
  39. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.abi.json +214 -77
  40. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +1 -0
  41. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  42. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
  43. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.abi.json +214 -77
  44. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +1 -0
  45. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  46. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/Modules/TalsecRuntime.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +1 -0
  47. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/TalsecRuntime +0 -0
  48. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/_CodeSignature/CodeResources +35 -35
  49. package/ios/TalsecRuntime.xcframework/ios-arm64_x86_64-simulator/TalsecRuntime.framework/cacert.pem +909 -464
  50. package/lib/commonjs/definitions.js +3 -1
  51. package/lib/commonjs/definitions.js.map +1 -1
  52. package/lib/commonjs/index.js +7 -1
  53. package/lib/commonjs/index.js.map +1 -1
  54. package/lib/module/definitions.js +3 -1
  55. package/lib/module/definitions.js.map +1 -1
  56. package/lib/module/index.js +7 -1
  57. package/lib/module/index.js.map +1 -1
  58. package/lib/typescript/plugin/src/index.d.ts +2 -8
  59. package/lib/typescript/plugin/src/index.d.ts.map +1 -1
  60. package/lib/typescript/plugin/src/pluginConfig.d.ts +1 -0
  61. package/lib/typescript/plugin/src/pluginConfig.d.ts.map +1 -1
  62. package/lib/typescript/src/definitions.d.ts +4 -0
  63. package/lib/typescript/src/definitions.d.ts.map +1 -1
  64. package/lib/typescript/src/index.d.ts +1 -1
  65. package/lib/typescript/src/index.d.ts.map +1 -1
  66. package/package.json +8 -18
  67. package/plugin/build/index.d.ts +2 -8
  68. package/plugin/build/index.js +39 -14
  69. package/plugin/build/pluginConfig.d.ts +1 -0
  70. package/src/definitions.ts +7 -0
  71. package/src/index.tsx +8 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ # freeRASP 3.8.0
2
+
3
+ - ⚡ Added new threat `systemVPN` for VPN detection
4
+ - 📄 Documentation updates
5
+
6
+ ### Android
7
+
8
+ - ⚡ Added new threat `devMode` for Developer mode detection
9
+ - ⚡ Enhanced and accelerated the data collection logic
10
+ - ⚡ Fixed proguard warning in specific versions of RN
11
+ - ⚡ Fixed issue with Arabic alphabet in logs caused by the device’s default system locale
12
+ - ✔️ Increased the version of the GMS dependency
13
+ - ✔️ Updated CA bundle
14
+
15
+ ### iOS
16
+ - ⚡ Fixed issue with Arabic alphabet in logs caused by the device’s default system locale
17
+ - ⚡ Passcode check is now periodical
18
+ - ✔️ Updated CA bundle
19
+
20
+ # freeRASP 3.7.2
21
+
22
+ - ⚡ Update expo config plugin to fix release build issue in RN 0.73
23
+
1
24
  # freeRASP 3.7.1
2
25
 
3
26
  ### Android
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  ![FreeRasp](https://raw.githubusercontent.com/talsec/Free-RASP-Community/master/visuals/freeRASPforRN.png)
2
2
 
3
- ![GitHub Repo stars](https://img.shields.io/github/stars/talsec/Free-RASP-Community?color=green) ![GitHub](https://img.shields.io/github/license/talsec/Free-RASP-Community) ![GitHub](https://img.shields.io/github/last-commit/talsec/Free-RASP-Community) ![Publisher](https://img.shields.io/pub/publisher/freerasp) [![42matters](https://42matters.com/badges/sdk-installations/freerasp)](https://42matters.com/sdks/android/freerasp)
3
+ ![GitHub Repo stars](https://img.shields.io/github/stars/talsec/Free-RASP-Community?color=green) ![GitHub](https://img.shields.io/github/license/talsec/Free-RASP-Community) ![GitHub](https://img.shields.io/github/last-commit/talsec/Free-RASP-Community) ![Publisher](https://img.shields.io/pub/publisher/freerasp) [![42matters](https://42matters.com/badges/sdk-installations/talsec)](https://42matters.com/sdks/android/talsec)
4
+
5
+ [<img src="https://assets.42matters.com/badges/2024/04/rising-star.svg?m=04" width="100"/>](https://42matters.com/sdks/android/talsec)
4
6
 
5
7
  # freeRASP for React Native
6
8
 
@@ -220,6 +222,10 @@ const actions = {
220
222
  console.log('secureHardwareNotAvailable');
221
223
  },
222
224
  // Android & iOS
225
+ systemVPN: () => {
226
+ console.log('systemVPN');
227
+ },
228
+ // Android & iOS
223
229
  passcode: () => {
224
230
  console.log('passcode');
225
231
  },
@@ -231,6 +237,10 @@ const actions = {
231
237
  obfuscationIssues: () => {
232
238
  console.log('obfuscationIssues');
233
239
  },
240
+ // Android only
241
+ devMode: () => {
242
+ console.log('devMode');
243
+ },
234
244
  };
235
245
 
236
246
  useFreeRasp(config, actions);
@@ -322,14 +332,16 @@ If you encounter any other issues, you can see the list of solved issues [here](
322
332
  freeRASP for React Native is bare React Native plugin. When installing freeRASP into a project that uses Expo SDK, there may be extra configuration needed. We provide plugin config that sets the dependencies automatically. It is recommended to use the plugin config. However, manual setup is also possible.
323
333
 
324
334
  ## Plugin config setup
325
- Add the plugin config into your `app.json` and specify the `minSdkVersion` (use at least 23):
335
+ Add the plugin config into your `app.json` and specify the `minSdkVersion` (use at least 23).
336
+ Additionally, if you are using Expo 50, increase version of R8 above 8.2 with the `R8Version` property [(to support sealed classes on Android)](https://github.com/talsec/Free-RASP-ReactNative/issues/60).
326
337
  ```json
327
338
  "plugins": [
328
339
  [
329
340
  "freerasp-react-native/app.plugin.js",
330
341
  {
331
342
  "android": {
332
- "minSdkVersion": "23"
343
+ "minSdkVersion": "23",
344
+ "R8Version": "8.3.37" // optional for Expo 50
333
345
  }
334
346
  }
335
347
  ]
@@ -403,6 +415,15 @@ Go to `<your_project>/node_modules/freerasp-react-native/ios/TalsecRuntime.xcfra
403
415
  #define TALSECRUNTIME_SWIFT_H
404
416
  ```
405
417
 
418
+ ### Execution failed for task ':freerasp-react-native:minifyReleaseWithR8'.
419
+ `Sealed classes are not supported as program classes when generating class files.`
420
+
421
+ **Reason:**
422
+ Kotlin sealed classes are not supported in AGP 8.1 used by some versions of RN (currently 0.73.x)
423
+
424
+ **Solution:**
425
+ Follow [this comment on Google Issue Tracker](https://issuetracker.google.com/issues/227160052#comment37), which contains also additional information about the issue.
426
+
406
427
  # Security Report
407
428
 
408
429
  The Security Report is a weekly summary describing the application's security state and characteristics of the devices it runs on in a practical and easy-to-understand way.
@@ -494,6 +515,8 @@ freeRASP is freemium software i.e. there is a Fair Usage Policy (FUP) that impos
494
515
  <li>Screen lock control</li>
495
516
  <li>Google Play Services enabled/disabled</li>
496
517
  <li>Last security patch update</li>
518
+ <li>System VPN control</li>
519
+ <li>Developer mode control</li>
497
520
  </ul>
498
521
  </td>
499
522
  <td>yes</td>
@@ -48,6 +48,7 @@ android {
48
48
  buildTypes {
49
49
  release {
50
50
  minifyEnabled true
51
+ proguardFiles "proguard-rules.pro"
51
52
  }
52
53
  }
53
54
 
@@ -86,7 +87,7 @@ dependencies {
86
87
  //noinspection GradleDynamicVersion
87
88
  implementation "com.facebook.react:react-native:$react_native_version"
88
89
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
89
- implementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:9.1.0"
90
+ implementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:9.6.0"
90
91
  }
91
92
 
92
93
  if (isNewArchitectureEnabled()) {
@@ -0,0 +1 @@
1
+ -dontwarn java.lang.invoke.StringConcatFactory
@@ -46,6 +46,14 @@ internal object FreeraspThreatHandler : ThreatListener.ThreatDetected, ThreatLis
46
46
  listener?.threatDetected(Threat.SecureHardwareNotAvailable)
47
47
  }
48
48
 
49
+ override fun onDeveloperModeDetected() {
50
+ listener?.threatDetected(Threat.DevMode)
51
+ }
52
+
53
+ override fun onSystemVPNDetected() {
54
+ listener?.threatDetected(Threat.SystemVPN)
55
+ }
56
+
49
57
  internal interface TalsecReactNative {
50
58
  fun threatDetected(threatType: Threat)
51
59
  }
@@ -21,6 +21,8 @@ internal sealed class Threat(val value: Int) {
21
21
  object DeviceBinding : Threat((10000..999999999).random())
22
22
  object UnofficialStore : Threat((10000..999999999).random())
23
23
  object ObfuscationIssues : Threat((10000..999999999).random())
24
+ object SystemVPN : Threat((10000..999999999).random())
25
+ object DevMode : Threat((10000..999999999).random())
24
26
 
25
27
  companion object {
26
28
  internal fun getThreatValues(): WritableArray {
@@ -33,12 +35,13 @@ internal sealed class Threat(val value: Int) {
33
35
  Passcode.value,
34
36
  Simulator.value,
35
37
  SecureHardwareNotAvailable.value,
38
+ SystemVPN.value,
36
39
  DeviceBinding.value,
37
40
  UnofficialStore.value,
38
- ObfuscationIssues.value
41
+ ObfuscationIssues.value,
42
+ DevMode.value
39
43
  )
40
44
  )
41
-
42
45
  }
43
46
  }
44
47
  }
@@ -0,0 +1 @@
1
+ declare module '*.png';
@@ -582,6 +582,7 @@
582
582
  GCC_PREPROCESSOR_DEFINITIONS = (
583
583
  "DEBUG=1",
584
584
  "$(inherited)",
585
+ _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
585
586
  );
586
587
  GCC_SYMBOLS_PRIVATE_EXTERN = NO;
587
588
  GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -608,6 +609,11 @@
608
609
  "-DFOLLY_MOBILE=1",
609
610
  "-DFOLLY_USE_LIBCPP=1",
610
611
  );
612
+ OTHER_LDFLAGS = (
613
+ "$(inherited)",
614
+ "-Wl",
615
+ "-ld_classic",
616
+ );
611
617
  REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
612
618
  SDKROOT = iphoneos;
613
619
  };
@@ -649,6 +655,10 @@
649
655
  "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
650
656
  GCC_C_LANGUAGE_STANDARD = gnu99;
651
657
  GCC_NO_COMMON_BLOCKS = YES;
658
+ GCC_PREPROCESSOR_DEFINITIONS = (
659
+ "$(inherited)",
660
+ _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
661
+ );
652
662
  GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
653
663
  GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
654
664
  GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -672,6 +682,11 @@
672
682
  "-DFOLLY_MOBILE=1",
673
683
  "-DFOLLY_USE_LIBCPP=1",
674
684
  );
685
+ OTHER_LDFLAGS = (
686
+ "$(inherited)",
687
+ "-Wl",
688
+ "-ld_classic",
689
+ );
675
690
  REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
676
691
  SDKROOT = iphoneos;
677
692
  VALIDATE_PRODUCT = YES;
@@ -6,7 +6,9 @@
6
6
  "android": "react-native run-android",
7
7
  "ios": "react-native run-ios",
8
8
  "start": "react-native start",
9
- "pods": "pod-install --quiet"
9
+ "pods": "pod-install --quiet",
10
+ "build:android": "cd android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
11
+ "build:ios": "cd ios && xcodebuild -workspace FreeraspReactNativeExample.xcworkspace -scheme FreeraspReactNativeExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO"
10
12
  },
11
13
  "dependencies": {
12
14
  "@react-native-material/core": "^1.3.7",
@@ -15,10 +17,13 @@
15
17
  "react-native-svg": "^13.8.0"
16
18
  },
17
19
  "devDependencies": {
18
- "@babel/core": "^7.12.9",
20
+ "@babel/core": "^7.24.4",
19
21
  "@babel/runtime": "^7.24.1",
20
- "babel-plugin-module-resolver": "^4.1.0",
22
+ "babel-plugin-module-resolver": "^5.0.0",
21
23
  "metro-react-native-babel-preset": "0.72.3",
22
24
  "react-native-svg-transformer": "^1.0.0"
25
+ },
26
+ "resolutions": {
27
+ "react-devtools-core": "^4.28.4"
23
28
  }
24
29
  }
@@ -101,6 +101,14 @@ const App = () => {
101
101
  );
102
102
  },
103
103
  // Android & iOS
104
+ systemVPN: () => {
105
+ setAppChecks((currentState) =>
106
+ currentState.map((threat) =>
107
+ threat.name === 'System VPN' ? { ...threat, status: 'nok' } : threat
108
+ )
109
+ );
110
+ },
111
+ // Android & iOS
104
112
  passcode: () => {
105
113
  setAppChecks((currentState) =>
106
114
  currentState.map((threat) =>
@@ -126,6 +134,16 @@ const App = () => {
126
134
  )
127
135
  );
128
136
  },
137
+ // Android only
138
+ devMode: () => {
139
+ setAppChecks((currentState) =>
140
+ currentState.map((threat) =>
141
+ threat.name === 'Developer Mode'
142
+ ? { ...threat, status: 'nok' }
143
+ : threat
144
+ )
145
+ );
146
+ },
129
147
  };
130
148
 
131
149
  useFreeRasp(config, actions);
@@ -1,15 +1,19 @@
1
1
  export const commonChecks = [
2
+ { name: 'App Integrity', status: 'ok' },
2
3
  { name: 'Privileged Access', status: 'ok' },
3
4
  { name: 'Debug', status: 'ok' },
4
- { name: 'Simulator', status: 'ok' },
5
- { name: 'App Integrity', status: 'ok' },
6
- { name: 'Unofficial Store', status: 'ok' },
7
5
  { name: 'Hooks', status: 'ok' },
8
- { name: 'Device Binding', status: 'ok' },
9
- { name: 'Secure Hardware Not Available', status: 'ok' },
10
6
  { name: 'Passcode', status: 'ok' },
7
+ { name: 'Simulator', status: 'ok' },
8
+ { name: 'Secure Hardware Not Available', status: 'ok' },
9
+ { name: 'System VPN', status: 'ok' },
10
+ { name: 'Device Binding', status: 'ok' },
11
+ { name: 'Unofficial Store', status: 'ok' },
11
12
  ];
12
13
 
13
14
  export const iosChecks = [{ name: 'Device ID', status: 'ok' }];
14
15
 
15
- export const androidChecks = [{ name: 'Obfuscation Issues', status: 'ok' }];
16
+ export const androidChecks = [
17
+ { name: 'Obfuscation Issues', status: 'ok' },
18
+ { name: 'Developer Mode', status: 'ok' },
19
+ ];