@regulaforensics/react-native-document-reader-api 6.8.0 → 6.9.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 (75) hide show
  1. package/RNDocumentReaderApi.podspec +1 -1
  2. package/android/build.gradle +18 -1
  3. package/android/src/main/java/com/regula/documentreader/BluetoothUtil.kt +6 -6
  4. package/android/src/main/java/com/regula/documentreader/Helpers.java +117 -3
  5. package/android/src/main/java/com/regula/documentreader/JSONConstructor.java +182 -261
  6. package/android/src/main/java/com/regula/documentreader/RNRegulaDocumentReaderModule.java +142 -125
  7. package/android/src/main/java/com/regula/documentreader/RegulaConfig.java +114 -26
  8. package/example/.bundle/config +2 -0
  9. package/example/.eslintrc.js +1 -1
  10. package/example/.prettierrc.js +2 -2
  11. package/example/.watchmanconfig +1 -1
  12. package/example/App.tsx +358 -0
  13. package/example/Gemfile +6 -0
  14. package/example/Gemfile.lock +98 -0
  15. package/example/__tests__/{App-test.js → App.test.tsx} +3 -0
  16. package/example/android/app/build.gradle +77 -59
  17. package/example/android/app/src/debug/AndroidManifest.xml +1 -1
  18. package/example/android/app/src/debug/java/com/regula/dr/fullrfid/ReactNativeFlipper.java +7 -4
  19. package/example/android/app/src/main/AndroidManifest.xml +4 -9
  20. package/example/android/app/src/main/java/com/regula/dr/fullrfid/MainActivity.java +17 -0
  21. package/example/android/app/src/main/java/com/regula/dr/fullrfid/MainApplication.java +17 -36
  22. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  23. package/example/android/app/src/main/res/values/styles.xml +2 -2
  24. package/example/android/app/src/release/java/com/regula/dr/fullrfid/ReactNativeFlipper.java +20 -0
  25. package/example/android/build.gradle +7 -18
  26. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  27. package/example/android/gradle/wrapper/gradle-wrapper.properties +2 -1
  28. package/example/android/gradle.properties +42 -2
  29. package/example/android/gradlew +164 -105
  30. package/example/android/gradlew.bat +92 -89
  31. package/example/android/settings.gradle +2 -1
  32. package/example/app.json +1 -1
  33. package/example/ios/.xcode.env +11 -0
  34. package/example/ios/DocumentReader/AppDelegate.h +2 -4
  35. package/example/ios/DocumentReader/AppDelegate.mm +26 -0
  36. package/example/ios/DocumentReader/DocumentReader.entitlements +0 -1
  37. package/example/ios/DocumentReader/Images.xcassets/AppIcon.appiconset/Contents.json +30 -15
  38. package/example/ios/DocumentReader/Info.plist +8 -4
  39. package/example/ios/DocumentReader/main.m +2 -1
  40. package/example/ios/DocumentReader.xcodeproj/project.pbxproj +134 -96
  41. package/example/ios/DocumentReaderTests/DocumentReaderTests.m +14 -13
  42. package/example/ios/Podfile +45 -15
  43. package/example/jest.config.js +3 -0
  44. package/example/metro.config.js +18 -15
  45. package/example/package-lock.json +13091 -0
  46. package/example/package.json +32 -22
  47. package/example/tsconfig.json +3 -0
  48. package/index.d.ts +426 -3015
  49. package/index.js +253 -2954
  50. package/ios/RGLWJSONConstructor.h +8 -6
  51. package/ios/RGLWJSONConstructor.m +109 -92
  52. package/ios/RGLWRegulaConfig.h +2 -1
  53. package/ios/RGLWRegulaConfig.m +139 -41
  54. package/ios/RNRegulaDocumentReader.m +55 -42
  55. package/package.json +1 -1
  56. package/example/.buckconfig +0 -6
  57. package/example/.editorconfig +0 -3
  58. package/example/.flowconfig +0 -65
  59. package/example/.gitattributes +0 -3
  60. package/example/App.js +0 -399
  61. package/example/android/app/BUCK +0 -55
  62. package/example/android/app/_BUCK +0 -55
  63. package/example/android/app/build_defs.bzl +0 -19
  64. package/example/android/app/src/main/assets/index.android.bundle +0 -636
  65. package/example/android/app/src/main/res/drawable-mdpi/images_id.png +0 -0
  66. package/example/android/app/src/main/res/drawable-mdpi/images_portrait.png +0 -0
  67. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  68. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  69. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_indeterminate_check_box.png +0 -0
  70. package/example/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  71. package/example/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  72. package/example/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  73. package/example/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  74. package/example/ios/DocumentReader/AppDelegate.m +0 -62
  75. package/example/ios/DocumentReader/Base.lproj/LaunchScreen.xib +0 -42
@@ -0,0 +1,98 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ CFPropertyList (3.0.6)
5
+ rexml
6
+ activesupport (7.0.5.1)
7
+ concurrent-ruby (~> 1.0, >= 1.0.2)
8
+ i18n (>= 1.6, < 2)
9
+ minitest (>= 5.1)
10
+ tzinfo (~> 2.0)
11
+ addressable (2.8.4)
12
+ public_suffix (>= 2.0.2, < 6.0)
13
+ algoliasearch (1.27.5)
14
+ httpclient (~> 2.8, >= 2.8.3)
15
+ json (>= 1.5.1)
16
+ atomos (0.1.3)
17
+ claide (1.1.0)
18
+ cocoapods (1.12.1)
19
+ addressable (~> 2.8)
20
+ claide (>= 1.0.2, < 2.0)
21
+ cocoapods-core (= 1.12.1)
22
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
23
+ cocoapods-downloader (>= 1.6.0, < 2.0)
24
+ cocoapods-plugins (>= 1.0.0, < 2.0)
25
+ cocoapods-search (>= 1.0.0, < 2.0)
26
+ cocoapods-trunk (>= 1.6.0, < 2.0)
27
+ cocoapods-try (>= 1.1.0, < 2.0)
28
+ colored2 (~> 3.1)
29
+ escape (~> 0.0.4)
30
+ fourflusher (>= 2.3.0, < 3.0)
31
+ gh_inspector (~> 1.0)
32
+ molinillo (~> 0.8.0)
33
+ nap (~> 1.0)
34
+ ruby-macho (>= 2.3.0, < 3.0)
35
+ xcodeproj (>= 1.21.0, < 2.0)
36
+ cocoapods-core (1.12.1)
37
+ activesupport (>= 5.0, < 8)
38
+ addressable (~> 2.8)
39
+ algoliasearch (~> 1.0)
40
+ concurrent-ruby (~> 1.1)
41
+ fuzzy_match (~> 2.0.4)
42
+ nap (~> 1.0)
43
+ netrc (~> 0.11)
44
+ public_suffix (~> 4.0)
45
+ typhoeus (~> 1.0)
46
+ cocoapods-deintegrate (1.0.5)
47
+ cocoapods-downloader (1.6.3)
48
+ cocoapods-plugins (1.0.0)
49
+ nap
50
+ cocoapods-search (1.0.1)
51
+ cocoapods-trunk (1.6.0)
52
+ nap (>= 0.8, < 2.0)
53
+ netrc (~> 0.11)
54
+ cocoapods-try (1.2.0)
55
+ colored2 (3.1.2)
56
+ concurrent-ruby (1.2.2)
57
+ escape (0.0.4)
58
+ ethon (0.16.0)
59
+ ffi (>= 1.15.0)
60
+ ffi (1.15.5)
61
+ fourflusher (2.3.1)
62
+ fuzzy_match (2.0.4)
63
+ gh_inspector (1.1.3)
64
+ httpclient (2.8.3)
65
+ i18n (1.14.1)
66
+ concurrent-ruby (~> 1.0)
67
+ json (2.6.3)
68
+ minitest (5.18.1)
69
+ molinillo (0.8.0)
70
+ nanaimo (0.3.0)
71
+ nap (1.1.0)
72
+ netrc (0.11.0)
73
+ public_suffix (4.0.7)
74
+ rexml (3.2.5)
75
+ ruby-macho (2.5.1)
76
+ typhoeus (1.4.0)
77
+ ethon (>= 0.9.0)
78
+ tzinfo (2.0.6)
79
+ concurrent-ruby (~> 1.0)
80
+ xcodeproj (1.22.0)
81
+ CFPropertyList (>= 2.3.3, < 4.0)
82
+ atomos (~> 0.1.3)
83
+ claide (>= 1.0.2, < 2.0)
84
+ colored2 (~> 3.1)
85
+ nanaimo (~> 0.3.0)
86
+ rexml (~> 3.2.4)
87
+
88
+ PLATFORMS
89
+ ruby
90
+
91
+ DEPENDENCIES
92
+ cocoapods (~> 1.12)
93
+
94
+ RUBY VERSION
95
+ ruby 2.7.6p219
96
+
97
+ BUNDLED WITH
98
+ 2.1.4
@@ -6,6 +6,9 @@ import 'react-native';
6
6
  import React from 'react';
7
7
  import App from '../App';
8
8
 
9
+ // Note: import explicitly to use the types shiped with jest.
10
+ import {it} from '@jest/globals';
11
+
9
12
  // Note: test renderer must be required after react-native.
10
13
  import renderer from 'react-test-renderer';
11
14
 
@@ -1,22 +1,79 @@
1
1
  apply plugin: "com.android.application"
2
+ apply plugin: "com.facebook.react"
3
+
4
+ /**
5
+ * This is the configuration block to customize your React Native Android app.
6
+ * By default you don't need to apply any configuration, just uncomment the lines you need.
7
+ */
8
+ react {
9
+ /* Folders */
10
+ // The root of your project, i.e. where "package.json" lives. Default is '..'
11
+ // root = file("../")
12
+ // The folder where the react-native NPM package is. Default is ../node_modules/react-native
13
+ // reactNativeDir = file("../node_modules/react-native")
14
+ // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
15
+ // codegenDir = file("../node_modules/@react-native/codegen")
16
+ // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
17
+ // cliFile = file("../node_modules/react-native/cli.js")
18
+
19
+ /* Variants */
20
+ // The list of variants to that are debuggable. For those we're going to
21
+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
22
+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
23
+ // debuggableVariants = ["liteDebug", "prodDebug"]
24
+
25
+ /* Bundling */
26
+ // A list containing the node command and its flags. Default is just 'node'.
27
+ // nodeExecutableAndArgs = ["node"]
28
+ //
29
+ // The command to run when bundling. By default is 'bundle'
30
+ // bundleCommand = "ram-bundle"
31
+ //
32
+ // The path to the CLI configuration file. Default is empty.
33
+ // bundleConfig = file(../rn-cli.config.js)
34
+ //
35
+ // The name of the generated asset file containing your JS bundle
36
+ // bundleAssetName = "MyApplication.android.bundle"
37
+ //
38
+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
39
+ // entryFile = file("../js/MyApplication.android.js")
40
+ //
41
+ // A list of extra flags to pass to the 'bundle' commands.
42
+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
43
+ // extraPackagerArgs = []
44
+
45
+ /* Hermes Commands */
46
+ // The hermes compiler command to run. By default it is 'hermesc'
47
+ // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
48
+ //
49
+ // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
50
+ // hermesFlags = ["-O", "-output-source-map"]
51
+ }
2
52
 
3
- import com.android.build.OutputFile
4
-
5
- project.ext.react = [
6
- enableHermes: false,
7
- ]
8
-
9
- apply from: "../../node_modules/react-native/react.gradle"
10
-
11
- def enableSeparateBuildPerCPUArchitecture = false
53
+ /**
54
+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
55
+ */
12
56
  def enableProguardInReleaseBuilds = false
57
+
58
+ /**
59
+ * The preferred build flavor of JavaScriptCore (JSC)
60
+ *
61
+ * For example, to use the international variant, you can use:
62
+ * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
63
+ *
64
+ * The international variant includes ICU i18n library and necessary data
65
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
66
+ * give correct results when using with locales other than en-US. Note that
67
+ * this variant is about 6MiB larger per architecture than default.
68
+ */
13
69
  def jscFlavor = 'org.webkit:android-jsc:+'
14
- def enableHermes = project.ext.react.get("enableHermes", false);
15
- def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
16
70
 
17
71
  android {
72
+ ndkVersion rootProject.ext.ndkVersion
73
+
18
74
  compileSdkVersion rootProject.ext.compileSdkVersion
19
75
 
76
+ namespace "com.regula.dr.fullrfid"
20
77
  defaultConfig {
21
78
  applicationId "com.regula.dr.fullrfid"
22
79
  minSdkVersion rootProject.ext.minSdkVersion
@@ -24,14 +81,6 @@ android {
24
81
  versionCode 1
25
82
  versionName "1.0"
26
83
  }
27
- splits {
28
- abi {
29
- reset()
30
- enable enableSeparateBuildPerCPUArchitecture
31
- universalApk false
32
- include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
33
- }
34
- }
35
84
  signingConfigs {
36
85
  debug {
37
86
  storeFile file('debug.keystore')
@@ -43,64 +92,33 @@ android {
43
92
  buildTypes {
44
93
  debug {
45
94
  signingConfig signingConfigs.debug
46
- if (nativeArchitectures) {
47
- ndk {
48
- abiFilters nativeArchitectures.split(',')
49
- }
50
- }
51
95
  }
52
96
  release {
97
+ // Caution! In production, you need to generate your own keystore file.
98
+ // see https://reactnative.dev/docs/signed-apk-android.
53
99
  signingConfig signingConfigs.debug
54
100
  minifyEnabled enableProguardInReleaseBuilds
55
101
  proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
56
102
  }
57
103
  }
58
-
59
- applicationVariants.all { variant ->
60
- variant.outputs.each { output ->
61
- def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
62
- def abi = output.getFilter(OutputFile.ABI)
63
- if (abi != null) {
64
- output.versionCodeOverride =
65
- defaultConfig.versionCode * 1000 + versionCodes.get(abi)
66
- }
67
-
68
- }
69
- }
70
104
  }
71
105
 
72
106
  dependencies {
73
- implementation fileTree(dir: "libs", include: ["*.jar"])
74
- //noinspection GradleDynamicVersion
75
- implementation "com.facebook.react:react-native:+"
76
-
77
- implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
78
-
79
- debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
80
- exclude group:'com.facebook.fbjni'
81
- }
107
+ // The version of react-native is set by the React Native Gradle Plugin
108
+ implementation("com.facebook.react:react-android")
82
109
 
110
+ debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
83
111
  debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
84
- exclude group:'com.facebook.flipper'
85
112
  exclude group:'com.squareup.okhttp3', module:'okhttp'
86
113
  }
87
114
 
88
- debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
89
- exclude group:'com.facebook.flipper'
90
- }
91
-
92
- if (enableHermes) {
93
- def hermesPath = "../../node_modules/hermes-engine/android/";
94
- debugImplementation files(hermesPath + "hermes-debug.aar")
95
- releaseImplementation files(hermesPath + "hermes-release.aar")
115
+ debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
116
+ if (hermesEnabled.toBoolean()) {
117
+ implementation("com.facebook.react:hermes-android")
96
118
  } else {
97
119
  implementation jscFlavor
98
120
  }
99
121
  }
100
122
 
101
- task copyDownloadableDepsToLibs(type: Copy) {
102
- from configurations.implementation
103
- into 'libs'
104
- }
105
-
106
123
  apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
124
+ apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
@@ -8,6 +8,6 @@
8
8
  android:usesCleartextTraffic="true"
9
9
  tools:targetApi="28"
10
10
  tools:ignore="GoogleAppIndexingWarning">
11
- <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
11
+ <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12
12
  </application>
13
13
  </manifest>
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
3
  *
4
4
  * <p>This source code is licensed under the MIT license found in the LICENSE file in the root
5
5
  * directory of this source tree.
@@ -17,20 +17,23 @@ import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17
17
  import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18
18
  import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19
19
  import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20
- import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21
20
  import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
21
+ import com.facebook.react.ReactInstanceEventListener;
22
22
  import com.facebook.react.ReactInstanceManager;
23
23
  import com.facebook.react.bridge.ReactContext;
24
24
  import com.facebook.react.modules.network.NetworkingModule;
25
25
  import okhttp3.OkHttpClient;
26
26
 
27
+ /**
28
+ * Class responsible of loading Flipper inside your React Native application. This is the debug
29
+ * flavor of it. Here you can add your own plugins and customize the Flipper setup.
30
+ */
27
31
  public class ReactNativeFlipper {
28
32
  public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29
33
  if (FlipperUtils.shouldEnableFlipper(context)) {
30
34
  final FlipperClient client = AndroidFlipperClient.getInstance(context);
31
35
 
32
36
  client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
33
- client.addPlugin(new ReactFlipperPlugin());
34
37
  client.addPlugin(new DatabasesFlipperPlugin(context));
35
38
  client.addPlugin(new SharedPreferencesFlipperPlugin(context));
36
39
  client.addPlugin(CrashReporterPlugin.getInstance());
@@ -51,7 +54,7 @@ public class ReactNativeFlipper {
51
54
  ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
52
55
  if (reactContext == null) {
53
56
  reactInstanceManager.addReactInstanceEventListener(
54
- new ReactInstanceManager.ReactInstanceEventListener() {
57
+ new ReactInstanceEventListener() {
55
58
  @Override
56
59
  public void onReactContextInitialized(ReactContext reactContext) {
57
60
  reactInstanceManager.removeReactInstanceEventListener(this);
@@ -1,10 +1,6 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.regula.dr.fullrfid">
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
3
2
 
4
- <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
5
- <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
6
- <uses-permission android:name="android.permission.INTERNET" />
7
- <uses-permission android:name="android.permission.NFC" />
3
+ <uses-permission android:name="android.permission.INTERNET" />
8
4
 
9
5
  <application
10
6
  android:name=".MainApplication"
@@ -12,15 +8,14 @@
12
8
  android:icon="@mipmap/ic_launcher"
13
9
  android:roundIcon="@mipmap/ic_launcher_round"
14
10
  android:allowBackup="false"
15
- android:requestLegacyExternalStorage="true"
16
11
  android:theme="@style/AppTheme">
17
12
  <activity
18
13
  android:name=".MainActivity"
19
14
  android:label="@string/app_name"
20
- android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
15
+ android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
21
16
  android:launchMode="singleTask"
22
17
  android:windowSoftInputMode="adjustResize"
23
- android:exported="true">
18
+ android:exported="true">
24
19
  <intent-filter>
25
20
  <action android:name="android.intent.action.MAIN" />
26
21
  <category android:name="android.intent.category.LAUNCHER" />
@@ -1,6 +1,9 @@
1
1
  package com.regula.dr.fullrfid;
2
2
 
3
3
  import com.facebook.react.ReactActivity;
4
+ import com.facebook.react.ReactActivityDelegate;
5
+ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
6
+ import com.facebook.react.defaults.DefaultReactActivityDelegate;
4
7
 
5
8
  public class MainActivity extends ReactActivity {
6
9
 
@@ -12,4 +15,18 @@ public class MainActivity extends ReactActivity {
12
15
  protected String getMainComponentName() {
13
16
  return "DocumentReader";
14
17
  }
18
+
19
+ /**
20
+ * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
21
+ * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
22
+ * (aka React 18) with two boolean flags.
23
+ */
24
+ @Override
25
+ protected ReactActivityDelegate createReactActivityDelegate() {
26
+ return new DefaultReactActivityDelegate(
27
+ this,
28
+ getMainComponentName(),
29
+ // If you opted-in for the New Architecture, we enable the Fabric Renderer.
30
+ DefaultNewArchitectureEntryPoint.getFabricEnabled());
31
+ }
15
32
  }
@@ -1,21 +1,19 @@
1
1
  package com.regula.dr.fullrfid;
2
2
 
3
3
  import android.app.Application;
4
- import android.content.Context;
5
-
6
4
  import com.facebook.react.PackageList;
7
5
  import com.facebook.react.ReactApplication;
8
- import com.facebook.react.ReactInstanceManager;
9
6
  import com.facebook.react.ReactNativeHost;
10
7
  import com.facebook.react.ReactPackage;
8
+ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
9
+ import com.facebook.react.defaults.DefaultReactNativeHost;
11
10
  import com.facebook.soloader.SoLoader;
12
- import java.lang.reflect.InvocationTargetException;
13
11
  import java.util.List;
14
12
 
15
13
  public class MainApplication extends Application implements ReactApplication {
16
14
 
17
15
  private final ReactNativeHost mReactNativeHost =
18
- new ReactNativeHost(this) {
16
+ new DefaultReactNativeHost(this) {
19
17
  @Override
20
18
  public boolean getUseDeveloperSupport() {
21
19
  return BuildConfig.DEBUG;
@@ -34,6 +32,16 @@ public class MainApplication extends Application implements ReactApplication {
34
32
  protected String getJSMainModuleName() {
35
33
  return "index";
36
34
  }
35
+
36
+ @Override
37
+ protected boolean isNewArchEnabled() {
38
+ return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
39
+ }
40
+
41
+ @Override
42
+ protected Boolean isHermesEnabled() {
43
+ return BuildConfig.IS_HERMES_ENABLED;
44
+ }
37
45
  };
38
46
 
39
47
  @Override
@@ -45,37 +53,10 @@ public class MainApplication extends Application implements ReactApplication {
45
53
  public void onCreate() {
46
54
  super.onCreate();
47
55
  SoLoader.init(this, /* native exopackage */ false);
48
- initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
49
- }
50
-
51
- /**
52
- * Loads Flipper in React Native templates. Call this in the onCreate method with something like
53
- * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
54
- *
55
- * @param context
56
- * @param reactInstanceManager
57
- */
58
- private static void initializeFlipper(
59
- Context context, ReactInstanceManager reactInstanceManager) {
60
- if (BuildConfig.DEBUG) {
61
- try {
62
- /*
63
- We use reflection here to pick up the class that initializes Flipper,
64
- since Flipper library is not available in release mode
65
- */
66
- Class<?> aClass = Class.forName("com.regula.dr.fullrfid.ReactNativeFlipper");
67
- aClass
68
- .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
69
- .invoke(null, context, reactInstanceManager);
70
- } catch (ClassNotFoundException e) {
71
- e.printStackTrace();
72
- } catch (NoSuchMethodException e) {
73
- e.printStackTrace();
74
- } catch (IllegalAccessException e) {
75
- e.printStackTrace();
76
- } catch (InvocationTargetException e) {
77
- e.printStackTrace();
78
- }
56
+ if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
57
+ // If you opted-in for the New Architecture, we load the native entry point for this app.
58
+ DefaultNewArchitectureEntryPoint.load();
79
59
  }
60
+ ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
80
61
  }
81
62
  }
@@ -0,0 +1,36 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Copyright (C) 2014 The Android Open Source Project
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ -->
16
+ <inset xmlns:android="http://schemas.android.com/apk/res/android"
17
+ android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
18
+ android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
19
+ android:insetTop="@dimen/abc_edit_text_inset_top_material"
20
+ android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
21
+
22
+ <selector>
23
+ <!--
24
+ This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
25
+ The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
26
+ NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
27
+
28
+ <item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
29
+
30
+ For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
31
+ -->
32
+ <item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
33
+ <item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
34
+ </selector>
35
+
36
+ </inset>
@@ -1,9 +1,9 @@
1
1
  <resources>
2
2
 
3
3
  <!-- Base application theme. -->
4
- <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
4
+ <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
5
5
  <!-- Customize your theme here. -->
6
- <item name="android:textColor">#000000</item>
6
+ <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
7
7
  </style>
8
8
 
9
9
  </resources>
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * <p>This source code is licensed under the MIT license found in the LICENSE file in the root
5
+ * directory of this source tree.
6
+ */
7
+ package com.regula.dr.fullrfid;
8
+
9
+ import android.content.Context;
10
+ import com.facebook.react.ReactInstanceManager;
11
+
12
+ /**
13
+ * Class responsible of loading Flipper inside your React Native application. This is the release
14
+ * flavor of it so it's empty as we don't want to load Flipper.
15
+ */
16
+ public class ReactNativeFlipper {
17
+ public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
18
+ // Do nothing as we don't want to initialize Flipper on Release.
19
+ }
20
+ }
@@ -1,32 +1,21 @@
1
+ // Top-level build file where you can add configuration options common to all sub-projects/modules.
2
+
1
3
  buildscript {
2
4
  ext {
3
5
  buildToolsVersion = "33.0.0"
4
6
  minSdkVersion = 21
5
7
  compileSdkVersion = 33
6
8
  targetSdkVersion = 33
9
+
10
+ // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
11
+ ndkVersion = "23.1.7779620"
7
12
  }
8
13
  repositories {
9
14
  google()
10
15
  mavenCentral()
11
16
  }
12
17
  dependencies {
13
- classpath('com.android.tools.build:gradle:7.2.2')
14
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
15
- }
16
- }
17
-
18
- allprojects {
19
- repositories {
20
- mavenCentral()
21
- mavenLocal()
22
- maven {
23
- url("$rootDir/../node_modules/react-native/android")
24
- }
25
- maven {
26
- url("$rootDir/../node_modules/jsc-android/dist")
27
- }
28
-
29
- google()
30
- maven { url 'https://www.jitpack.io' }
18
+ classpath("com.android.tools.build:gradle")
19
+ classpath("com.facebook.react:react-native-gradle-plugin")
31
20
  }
32
21
  }
@@ -1,5 +1,6 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
4
+ networkTimeout=10000
4
5
  zipStoreBase=GRADLE_USER_HOME
5
6
  zipStorePath=wrapper/dists
@@ -1,4 +1,44 @@
1
+ # Project-wide Gradle settings.
2
+
3
+ # IDE (e.g. Android Studio) users:
4
+ # Gradle settings configured through the IDE *will override*
5
+ # any settings specified in this file.
6
+
7
+ # For more details on how to configure your build environment visit
8
+ # http://www.gradle.org/docs/current/userguide/build_environment.html
9
+
10
+ # Specifies the JVM arguments used for the daemon process.
11
+ # The setting is particularly useful for tweaking memory settings.
12
+ # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13
+ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14
+
15
+ # When configured, Gradle will run in incubating parallel mode.
16
+ # This option should only be used with decoupled projects. More details, visit
17
+ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18
+ # org.gradle.parallel=true
19
+
20
+ # AndroidX package structure to make it clearer which packages are bundled with the
21
+ # Android operating system, and which are packaged with your app's APK
22
+ # https://developer.android.com/topic/libraries/support-library/androidx-rn
1
23
  android.useAndroidX=true
24
+ # Automatically convert third-party libraries to use AndroidX
2
25
  android.enableJetifier=true
3
- FLIPPER_VERSION=0.99.0
4
- org.gradle.jvmargs=-Xmx4608m
26
+
27
+ # Version of flipper SDK to use with React Native
28
+ FLIPPER_VERSION=0.182.0
29
+
30
+ # Use this property to specify which architecture you want to build.
31
+ # You can also override it from the CLI using
32
+ # ./gradlew <task> -PreactNativeArchitectures=x86_64
33
+ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
34
+
35
+ # Use this property to enable support to the new architecture.
36
+ # This will allow you to use TurboModules and the Fabric render in
37
+ # your application. You should enable this flag either if you want
38
+ # to write custom TurboModules/Fabric components OR use libraries that
39
+ # are providing them.
40
+ newArchEnabled=false
41
+
42
+ # Use this property to enable or disable the Hermes JS engine.
43
+ # If set to false, you will be using JSC instead.
44
+ hermesEnabled=true