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,313 +1,313 @@
1
- apply plugin: "com.android.application"
2
-
3
- import com.android.build.OutputFile
4
- import org.apache.tools.ant.taskdefs.condition.Os
5
-
6
- /**
7
- * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
8
- * and bundleReleaseJsAndAssets).
9
- * These basically call `react-native bundle` with the correct arguments during the Android build
10
- * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
11
- * bundle directly from the development server. Below you can see all the possible configurations
12
- * and their defaults. If you decide to add a configuration block, make sure to add it before the
13
- * `apply from: "../../node_modules/react-native/react.gradle"` line.
14
- *
15
- * project.ext.react = [
16
- * // the name of the generated asset file containing your JS bundle
17
- * bundleAssetName: "index.android.bundle",
18
- *
19
- * // the entry file for bundle generation. If none specified and
20
- * // "index.android.js" exists, it will be used. Otherwise "index.js" is
21
- * // default. Can be overridden with ENTRY_FILE environment variable.
22
- * entryFile: "index.android.js",
23
- *
24
- * // https://reactnative.dev/docs/performance#enable-the-ram-format
25
- * bundleCommand: "ram-bundle",
26
- *
27
- * // whether to bundle JS and assets in debug mode
28
- * bundleInDebug: false,
29
- *
30
- * // whether to bundle JS and assets in release mode
31
- * bundleInRelease: true,
32
- *
33
- * // whether to bundle JS and assets in another build variant (if configured).
34
- * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
35
- * // The configuration property can be in the following formats
36
- * // 'bundleIn${productFlavor}${buildType}'
37
- * // 'bundleIn${buildType}'
38
- * // bundleInFreeDebug: true,
39
- * // bundleInPaidRelease: true,
40
- * // bundleInBeta: true,
41
- *
42
- * // whether to disable dev mode in custom build variants (by default only disabled in release)
43
- * // for example: to disable dev mode in the staging build type (if configured)
44
- * devDisabledInStaging: true,
45
- * // The configuration property can be in the following formats
46
- * // 'devDisabledIn${productFlavor}${buildType}'
47
- * // 'devDisabledIn${buildType}'
48
- *
49
- * // the root of your project, i.e. where "package.json" lives
50
- * root: "../../",
51
- *
52
- * // where to put the JS bundle asset in debug mode
53
- * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
54
- *
55
- * // where to put the JS bundle asset in release mode
56
- * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
57
- *
58
- * // where to put drawable resources / React Native assets, e.g. the ones you use via
59
- * // require('./image.png')), in debug mode
60
- * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
61
- *
62
- * // where to put drawable resources / React Native assets, e.g. the ones you use via
63
- * // require('./image.png')), in release mode
64
- * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
65
- *
66
- * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
67
- * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
68
- * // date; if you have any other folders that you want to ignore for performance reasons (gradle
69
- * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
70
- * // for example, you might want to remove it from here.
71
- * inputExcludes: ["android/**", "ios/**"],
72
- *
73
- * // override which node gets called and with what additional arguments
74
- * nodeExecutableAndArgs: ["node"],
75
- *
76
- * // supply additional arguments to the packager
77
- * extraPackagerArgs: []
78
- * ]
79
- */
80
-
81
- project.ext.react = [
82
- enableHermes: true, // clean and rebuild if changing
83
- ]
84
-
85
- apply from: "../../node_modules/react-native/react.gradle"
86
-
87
- /**
88
- * Set this to true to create two separate APKs instead of one:
89
- * - An APK that only works on ARM devices
90
- * - An APK that only works on x86 devices
91
- * The advantage is the size of the APK is reduced by about 4MB.
92
- * Upload all the APKs to the Play Store and people will download
93
- * the correct one based on the CPU architecture of their device.
94
- */
95
- def enableSeparateBuildPerCPUArchitecture = false
96
-
97
- /**
98
- * Run Proguard to shrink the Java bytecode in release builds.
99
- */
100
- def enableProguardInReleaseBuilds = false
101
-
102
- /**
103
- * The preferred build flavor of JavaScriptCore.
104
- *
105
- * For example, to use the international variant, you can use:
106
- * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
107
- *
108
- * The international variant includes ICU i18n library and necessary data
109
- * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
110
- * give correct results when using with locales other than en-US. Note that
111
- * this variant is about 6MiB larger per architecture than default.
112
- */
113
- def jscFlavor = 'org.webkit:android-jsc:+'
114
-
115
- /**
116
- * Whether to enable the Hermes VM.
117
- *
118
- * This should be set on project.ext.react and that value will be read here. If it is not set
119
- * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
120
- * and the benefits of using Hermes will therefore be sharply reduced.
121
- */
122
- def enableHermes = project.ext.react.get("enableHermes", false);
123
-
124
- /**
125
- * Architectures to build native code for.
126
- */
127
- def reactNativeArchitectures() {
128
- def value = project.getProperties().get("reactNativeArchitectures")
129
- return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
130
- }
131
-
132
- android {
133
- ndkVersion rootProject.ext.ndkVersion
134
-
135
- compileSdkVersion rootProject.ext.compileSdkVersion
136
-
137
- defaultConfig {
138
- applicationId "com.freeraspreactnativeexample"
139
- minSdkVersion rootProject.ext.minSdkVersion
140
- targetSdkVersion rootProject.ext.targetSdkVersion
141
- versionCode 1
142
- versionName "1.0"
143
- buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
144
-
145
- if (isNewArchitectureEnabled()) {
146
- // We configure the CMake build only if you decide to opt-in for the New Architecture.
147
- externalNativeBuild {
148
- cmake {
149
- arguments "-DPROJECT_BUILD_DIR=$buildDir",
150
- "-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
151
- "-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
152
- "-DNODE_MODULES_DIR=$rootDir/../node_modules",
153
- "-DANDROID_STL=c++_shared"
154
- }
155
- }
156
- if (!enableSeparateBuildPerCPUArchitecture) {
157
- ndk {
158
- abiFilters (*reactNativeArchitectures())
159
- }
160
- }
161
- }
162
- }
163
-
164
- if (isNewArchitectureEnabled()) {
165
- // We configure the NDK build only if you decide to opt-in for the New Architecture.
166
- externalNativeBuild {
167
- cmake {
168
- path "$projectDir/src/main/jni/CMakeLists.txt"
169
- }
170
- }
171
- def reactAndroidProjectDir = project(':ReactAndroid').projectDir
172
- def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
173
- dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
174
- from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
175
- into("$buildDir/react-ndk/exported")
176
- }
177
- def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
178
- dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
179
- from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
180
- into("$buildDir/react-ndk/exported")
181
- }
182
- afterEvaluate {
183
- // If you wish to add a custom TurboModule or component locally,
184
- // you should uncomment this line.
185
- // preBuild.dependsOn("generateCodegenArtifactsFromSchema")
186
- preDebugBuild.dependsOn(packageReactNdkDebugLibs)
187
- preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
188
-
189
- // Due to a bug inside AGP, we have to explicitly set a dependency
190
- // between configureCMakeDebug* tasks and the preBuild tasks.
191
- // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
192
- configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)
193
- configureCMakeDebug.dependsOn(preDebugBuild)
194
- reactNativeArchitectures().each { architecture ->
195
- tasks.findByName("configureCMakeDebug[${architecture}]")?.configure {
196
- dependsOn("preDebugBuild")
197
- }
198
- tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure {
199
- dependsOn("preReleaseBuild")
200
- }
201
- }
202
- }
203
- }
204
-
205
- splits {
206
- abi {
207
- reset()
208
- enable enableSeparateBuildPerCPUArchitecture
209
- universalApk false // If true, also generate a universal APK
210
- include (*reactNativeArchitectures())
211
- }
212
- }
213
- signingConfigs {
214
- debug {
215
- storeFile file('debug.keystore')
216
- storePassword 'android'
217
- keyAlias 'androiddebugkey'
218
- keyPassword 'android'
219
- }
220
- }
221
- buildTypes {
222
- debug {
223
- signingConfig signingConfigs.debug
224
- }
225
- release {
226
- // Caution! In production, you need to generate your own keystore file.
227
- // see https://reactnative.dev/docs/signed-apk-android.
228
- signingConfig signingConfigs.debug
229
- minifyEnabled enableProguardInReleaseBuilds
230
- proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
231
- }
232
- }
233
-
234
- // applicationVariants are e.g. debug, release
235
- applicationVariants.all { variant ->
236
- variant.outputs.each { output ->
237
- // For each separate APK per architecture, set a unique version code as described here:
238
- // https://developer.android.com/studio/build/configure-apk-splits.html
239
- // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
240
- def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
241
- def abi = output.getFilter(OutputFile.ABI)
242
- if (abi != null) { // null for the universal-debug, universal-release variants
243
- output.versionCodeOverride =
244
- defaultConfig.versionCode * 1000 + versionCodes.get(abi)
245
- }
246
-
247
- }
248
- }
249
- }
250
-
251
- dependencies {
252
- implementation fileTree(dir: "libs", include: ["*.jar"])
253
-
254
- //noinspection GradleDynamicVersion
255
- implementation "com.facebook.react:react-native:+" // From node_modules
256
-
257
- implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
258
-
259
- debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
260
- exclude group:'com.facebook.fbjni'
261
- }
262
-
263
- debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
264
- exclude group:'com.facebook.flipper'
265
- exclude group:'com.squareup.okhttp3', module:'okhttp'
266
- }
267
-
268
- debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
269
- exclude group:'com.facebook.flipper'
270
- }
271
-
272
- if (enableHermes) {
273
- //noinspection GradleDynamicVersion
274
- implementation("com.facebook.react:hermes-engine:+") { // From node_modules
275
- exclude group:'com.facebook.fbjni'
276
- }
277
- } else {
278
- implementation jscFlavor
279
- }
280
- }
281
-
282
- if (isNewArchitectureEnabled()) {
283
- // If new architecture is enabled, we let you build RN from source
284
- // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
285
- // This will be applied to all the imported transtitive dependency.
286
- configurations.all {
287
- resolutionStrategy.dependencySubstitution {
288
- substitute(module("com.facebook.react:react-native"))
289
- .using(project(":ReactAndroid"))
290
- .because("On New Architecture we're building React Native from source")
291
- substitute(module("com.facebook.react:hermes-engine"))
292
- .using(project(":ReactAndroid:hermes-engine"))
293
- .because("On New Architecture we're building Hermes from source")
294
- }
295
- }
296
- }
297
-
298
- // Run this once to be able to run the application with BUCK
299
- // puts all compile dependencies into folder libs for BUCK to use
300
- task copyDownloadableDepsToLibs(type: Copy) {
301
- from configurations.implementation
302
- into 'libs'
303
- }
304
-
305
- apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
306
-
307
- def isNewArchitectureEnabled() {
308
- // To opt-in for the New Architecture, you can either:
309
- // - Set `newArchEnabled` to true inside the `gradle.properties` file
310
- // - Invoke gradle with `-newArchEnabled=true`
311
- // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
312
- return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
313
- }
1
+ apply plugin: "com.android.application"
2
+
3
+ import com.android.build.OutputFile
4
+ import org.apache.tools.ant.taskdefs.condition.Os
5
+
6
+ /**
7
+ * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
8
+ * and bundleReleaseJsAndAssets).
9
+ * These basically call `react-native bundle` with the correct arguments during the Android build
10
+ * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
11
+ * bundle directly from the development server. Below you can see all the possible configurations
12
+ * and their defaults. If you decide to add a configuration block, make sure to add it before the
13
+ * `apply from: "../../node_modules/react-native/react.gradle"` line.
14
+ *
15
+ * project.ext.react = [
16
+ * // the name of the generated asset file containing your JS bundle
17
+ * bundleAssetName: "index.android.bundle",
18
+ *
19
+ * // the entry file for bundle generation. If none specified and
20
+ * // "index.android.js" exists, it will be used. Otherwise "index.js" is
21
+ * // default. Can be overridden with ENTRY_FILE environment variable.
22
+ * entryFile: "index.android.js",
23
+ *
24
+ * // https://reactnative.dev/docs/performance#enable-the-ram-format
25
+ * bundleCommand: "ram-bundle",
26
+ *
27
+ * // whether to bundle JS and assets in debug mode
28
+ * bundleInDebug: false,
29
+ *
30
+ * // whether to bundle JS and assets in release mode
31
+ * bundleInRelease: true,
32
+ *
33
+ * // whether to bundle JS and assets in another build variant (if configured).
34
+ * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
35
+ * // The configuration property can be in the following formats
36
+ * // 'bundleIn${productFlavor}${buildType}'
37
+ * // 'bundleIn${buildType}'
38
+ * // bundleInFreeDebug: true,
39
+ * // bundleInPaidRelease: true,
40
+ * // bundleInBeta: true,
41
+ *
42
+ * // whether to disable dev mode in custom build variants (by default only disabled in release)
43
+ * // for example: to disable dev mode in the staging build type (if configured)
44
+ * devDisabledInStaging: true,
45
+ * // The configuration property can be in the following formats
46
+ * // 'devDisabledIn${productFlavor}${buildType}'
47
+ * // 'devDisabledIn${buildType}'
48
+ *
49
+ * // the root of your project, i.e. where "package.json" lives
50
+ * root: "../../",
51
+ *
52
+ * // where to put the JS bundle asset in debug mode
53
+ * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
54
+ *
55
+ * // where to put the JS bundle asset in release mode
56
+ * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
57
+ *
58
+ * // where to put drawable resources / React Native assets, e.g. the ones you use via
59
+ * // require('./image.png')), in debug mode
60
+ * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
61
+ *
62
+ * // where to put drawable resources / React Native assets, e.g. the ones you use via
63
+ * // require('./image.png')), in release mode
64
+ * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
65
+ *
66
+ * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
67
+ * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
68
+ * // date; if you have any other folders that you want to ignore for performance reasons (gradle
69
+ * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
70
+ * // for example, you might want to remove it from here.
71
+ * inputExcludes: ["android/**", "ios/**"],
72
+ *
73
+ * // override which node gets called and with what additional arguments
74
+ * nodeExecutableAndArgs: ["node"],
75
+ *
76
+ * // supply additional arguments to the packager
77
+ * extraPackagerArgs: []
78
+ * ]
79
+ */
80
+
81
+ project.ext.react = [
82
+ enableHermes: true, // clean and rebuild if changing
83
+ ]
84
+
85
+ apply from: "../../node_modules/react-native/react.gradle"
86
+
87
+ /**
88
+ * Set this to true to create two separate APKs instead of one:
89
+ * - An APK that only works on ARM devices
90
+ * - An APK that only works on x86 devices
91
+ * The advantage is the size of the APK is reduced by about 4MB.
92
+ * Upload all the APKs to the Play Store and people will download
93
+ * the correct one based on the CPU architecture of their device.
94
+ */
95
+ def enableSeparateBuildPerCPUArchitecture = false
96
+
97
+ /**
98
+ * Run Proguard to shrink the Java bytecode in release builds.
99
+ */
100
+ def enableProguardInReleaseBuilds = false
101
+
102
+ /**
103
+ * The preferred build flavor of JavaScriptCore.
104
+ *
105
+ * For example, to use the international variant, you can use:
106
+ * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
107
+ *
108
+ * The international variant includes ICU i18n library and necessary data
109
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
110
+ * give correct results when using with locales other than en-US. Note that
111
+ * this variant is about 6MiB larger per architecture than default.
112
+ */
113
+ def jscFlavor = 'org.webkit:android-jsc:+'
114
+
115
+ /**
116
+ * Whether to enable the Hermes VM.
117
+ *
118
+ * This should be set on project.ext.react and that value will be read here. If it is not set
119
+ * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
120
+ * and the benefits of using Hermes will therefore be sharply reduced.
121
+ */
122
+ def enableHermes = project.ext.react.get("enableHermes", false);
123
+
124
+ /**
125
+ * Architectures to build native code for.
126
+ */
127
+ def reactNativeArchitectures() {
128
+ def value = project.getProperties().get("reactNativeArchitectures")
129
+ return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
130
+ }
131
+
132
+ android {
133
+ ndkVersion rootProject.ext.ndkVersion
134
+
135
+ compileSdkVersion rootProject.ext.compileSdkVersion
136
+
137
+ defaultConfig {
138
+ applicationId "com.freeraspreactnativeexample"
139
+ minSdkVersion rootProject.ext.minSdkVersion
140
+ targetSdkVersion rootProject.ext.targetSdkVersion
141
+ versionCode 1
142
+ versionName "1.0"
143
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
144
+
145
+ if (isNewArchitectureEnabled()) {
146
+ // We configure the CMake build only if you decide to opt-in for the New Architecture.
147
+ externalNativeBuild {
148
+ cmake {
149
+ arguments "-DPROJECT_BUILD_DIR=$buildDir",
150
+ "-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
151
+ "-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
152
+ "-DNODE_MODULES_DIR=$rootDir/../node_modules",
153
+ "-DANDROID_STL=c++_shared"
154
+ }
155
+ }
156
+ if (!enableSeparateBuildPerCPUArchitecture) {
157
+ ndk {
158
+ abiFilters (*reactNativeArchitectures())
159
+ }
160
+ }
161
+ }
162
+ }
163
+
164
+ if (isNewArchitectureEnabled()) {
165
+ // We configure the NDK build only if you decide to opt-in for the New Architecture.
166
+ externalNativeBuild {
167
+ cmake {
168
+ path "$projectDir/src/main/jni/CMakeLists.txt"
169
+ }
170
+ }
171
+ def reactAndroidProjectDir = project(':ReactAndroid').projectDir
172
+ def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
173
+ dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
174
+ from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
175
+ into("$buildDir/react-ndk/exported")
176
+ }
177
+ def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
178
+ dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
179
+ from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
180
+ into("$buildDir/react-ndk/exported")
181
+ }
182
+ afterEvaluate {
183
+ // If you wish to add a custom TurboModule or component locally,
184
+ // you should uncomment this line.
185
+ // preBuild.dependsOn("generateCodegenArtifactsFromSchema")
186
+ preDebugBuild.dependsOn(packageReactNdkDebugLibs)
187
+ preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
188
+
189
+ // Due to a bug inside AGP, we have to explicitly set a dependency
190
+ // between configureCMakeDebug* tasks and the preBuild tasks.
191
+ // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
192
+ configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)
193
+ configureCMakeDebug.dependsOn(preDebugBuild)
194
+ reactNativeArchitectures().each { architecture ->
195
+ tasks.findByName("configureCMakeDebug[${architecture}]")?.configure {
196
+ dependsOn("preDebugBuild")
197
+ }
198
+ tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure {
199
+ dependsOn("preReleaseBuild")
200
+ }
201
+ }
202
+ }
203
+ }
204
+
205
+ splits {
206
+ abi {
207
+ reset()
208
+ enable enableSeparateBuildPerCPUArchitecture
209
+ universalApk false // If true, also generate a universal APK
210
+ include (*reactNativeArchitectures())
211
+ }
212
+ }
213
+ signingConfigs {
214
+ debug {
215
+ storeFile file('debug.keystore')
216
+ storePassword 'android'
217
+ keyAlias 'androiddebugkey'
218
+ keyPassword 'android'
219
+ }
220
+ }
221
+ buildTypes {
222
+ debug {
223
+ signingConfig signingConfigs.debug
224
+ }
225
+ release {
226
+ // Caution! In production, you need to generate your own keystore file.
227
+ // see https://reactnative.dev/docs/signed-apk-android.
228
+ signingConfig signingConfigs.debug
229
+ minifyEnabled enableProguardInReleaseBuilds
230
+ proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
231
+ }
232
+ }
233
+
234
+ // applicationVariants are e.g. debug, release
235
+ applicationVariants.all { variant ->
236
+ variant.outputs.each { output ->
237
+ // For each separate APK per architecture, set a unique version code as described here:
238
+ // https://developer.android.com/studio/build/configure-apk-splits.html
239
+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
240
+ def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
241
+ def abi = output.getFilter(OutputFile.ABI)
242
+ if (abi != null) { // null for the universal-debug, universal-release variants
243
+ output.versionCodeOverride =
244
+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)
245
+ }
246
+
247
+ }
248
+ }
249
+ }
250
+
251
+ dependencies {
252
+ implementation fileTree(dir: "libs", include: ["*.jar"])
253
+
254
+ //noinspection GradleDynamicVersion
255
+ implementation "com.facebook.react:react-native:+" // From node_modules
256
+
257
+ implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
258
+
259
+ debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
260
+ exclude group:'com.facebook.fbjni'
261
+ }
262
+
263
+ debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
264
+ exclude group:'com.facebook.flipper'
265
+ exclude group:'com.squareup.okhttp3', module:'okhttp'
266
+ }
267
+
268
+ debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
269
+ exclude group:'com.facebook.flipper'
270
+ }
271
+
272
+ if (enableHermes) {
273
+ //noinspection GradleDynamicVersion
274
+ implementation("com.facebook.react:hermes-engine:+") { // From node_modules
275
+ exclude group:'com.facebook.fbjni'
276
+ }
277
+ } else {
278
+ implementation jscFlavor
279
+ }
280
+ }
281
+
282
+ if (isNewArchitectureEnabled()) {
283
+ // If new architecture is enabled, we let you build RN from source
284
+ // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
285
+ // This will be applied to all the imported transtitive dependency.
286
+ configurations.all {
287
+ resolutionStrategy.dependencySubstitution {
288
+ substitute(module("com.facebook.react:react-native"))
289
+ .using(project(":ReactAndroid"))
290
+ .because("On New Architecture we're building React Native from source")
291
+ substitute(module("com.facebook.react:hermes-engine"))
292
+ .using(project(":ReactAndroid:hermes-engine"))
293
+ .because("On New Architecture we're building Hermes from source")
294
+ }
295
+ }
296
+ }
297
+
298
+ // Run this once to be able to run the application with BUCK
299
+ // puts all compile dependencies into folder libs for BUCK to use
300
+ task copyDownloadableDepsToLibs(type: Copy) {
301
+ from configurations.implementation
302
+ into 'libs'
303
+ }
304
+
305
+ apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
306
+
307
+ def isNewArchitectureEnabled() {
308
+ // To opt-in for the New Architecture, you can either:
309
+ // - Set `newArchEnabled` to true inside the `gradle.properties` file
310
+ // - Invoke gradle with `-newArchEnabled=true`
311
+ // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
312
+ return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
313
+ }