@regulaforensics/react-native-document-reader-api 5.7.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +2 -2
  2. package/RNDocumentReaderApi.podspec +2 -2
  3. package/android/build.gradle +4 -6
  4. package/android/src/main/java/com/regula/documentreader/Helpers.java +8 -3
  5. package/android/src/main/java/com/regula/documentreader/JSONConstructor.java +110 -10
  6. package/android/src/main/java/com/regula/documentreader/RNRegulaDocumentReaderModule.java +58 -26
  7. package/android/src/main/java/com/regula/documentreader/RegulaConfig.java +72 -9
  8. package/example/.editorconfig +3 -0
  9. package/example/.flowconfig +4 -13
  10. package/example/.gitattributes +3 -1
  11. package/example/.prettierrc.js +1 -0
  12. package/example/App.js +30 -18
  13. package/example/android/app/BUCK +55 -0
  14. package/example/android/app/build.gradle +35 -17
  15. package/example/android/app/debug.keystore +0 -0
  16. package/example/android/app/src/debug/AndroidManifest.xml +6 -1
  17. package/example/android/app/src/main/AndroidManifest.xml +21 -22
  18. package/example/android/app/src/main/assets/index.android.bundle +636 -0
  19. package/example/android/app/src/main/java/com/regula/dr/fullrfid/MainApplication.java +1 -2
  20. package/example/android/app/src/main/res/drawable-mdpi/images_id.png +0 -0
  21. package/example/android/app/src/main/res/drawable-mdpi/images_portrait.png +0 -0
  22. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  23. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  24. package/example/android/app/src/main/res/drawable-mdpi/node_modules_reactnativecheckbox_img_ic_indeterminate_check_box.png +0 -0
  25. package/example/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  26. package/example/android/app/src/main/res/drawable-xhdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  27. package/example/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecheckbox_img_ic_check_box.png +0 -0
  28. package/example/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnativecheckbox_img_ic_check_box_outline_blank.png +0 -0
  29. package/example/android/build.gradle +12 -6
  30. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  31. package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  32. package/example/android/gradle.properties +2 -1
  33. package/example/android/gradlew +14 -17
  34. package/example/android/gradlew.bat +7 -18
  35. package/example/android/settings.gradle +0 -2
  36. package/example/ios/DocumentReader/AppDelegate.m +7 -3
  37. package/example/ios/DocumentReader/Info.plist +8 -10
  38. package/example/ios/DocumentReader/LaunchScreen.storyboard +47 -0
  39. package/example/ios/DocumentReader.xcodeproj/project.pbxproj +257 -96
  40. package/example/ios/DocumentReader.xcodeproj/xcshareddata/xcschemes/DocumentReader.xcscheme +1 -1
  41. package/example/ios/DocumentReaderTests/DocumentReaderTests.m +65 -0
  42. package/example/ios/DocumentReaderTests/Info.plist +24 -0
  43. package/example/ios/Podfile +13 -4
  44. package/example/metro.config.js +1 -1
  45. package/example/package.json +17 -18
  46. package/index.d.ts +724 -514
  47. package/index.js +672 -510
  48. package/ios/RGLWJSONConstructor.h +6 -0
  49. package/ios/RGLWJSONConstructor.m +92 -0
  50. package/ios/RNRegulaDocumentReader.m +28 -8
  51. package/ios/RegulaConfig.h +2 -0
  52. package/ios/RegulaConfig.m +119 -31
  53. package/package.json +1 -1
  54. package/example/ios/DocumentReader.xcodeproj/xcshareddata/xcschemes/DocumentReader-tvOS.xcscheme +0 -88
@@ -5,6 +5,7 @@ import org.json.JSONObject;
5
5
  import org.json.JSONException;
6
6
 
7
7
  import com.regula.documentreader.api.DocumentReader;
8
+ import com.regula.documentreader.api.params.ImageQA;
8
9
  import com.regula.documentreader.api.params.ParamsCustomization;
9
10
  import com.regula.documentreader.api.params.Functionality;
10
11
  import com.regula.documentreader.api.params.ProcessParam;
@@ -100,6 +101,8 @@ class RegulaConfig {
100
101
  editor.setDoRecordProcessingVideo(opts.getBoolean("recordScanningProcess"));
101
102
  if (opts.has("manualMultipageMode"))
102
103
  editor.setManualMultipageMode(opts.getBoolean("manualMultipageMode"));
104
+ if (opts.has("exposure"))
105
+ editor.setExposure(BigDecimal.valueOf(opts.getDouble("exposure")).floatValue());
103
106
 
104
107
  editor.apply();
105
108
  }
@@ -165,6 +168,49 @@ class RegulaConfig {
165
168
  processParams.checkHologram = opts.getBoolean("checkHologram");
166
169
  if (opts.has("checkRequiredTextFields"))
167
170
  processParams.checkRequiredTextFields = opts.getBoolean("checkRequiredTextFields");
171
+ if (opts.has("depersonalizeLog"))
172
+ processParams.depersonalizeLog = opts.getBoolean("depersonalizeLog");
173
+ if (opts.has("resultTypeOutput"))
174
+ processParams.resultTypeOutput = intArrayFromJson(opts.getJSONArray("resultTypeOutput"));
175
+ if (opts.has("generateDoublePageSpreadImage"))
176
+ processParams.generateDoublePageSpreadImage = opts.getBoolean("generateDoublePageSpreadImage");
177
+ if (opts.has("imageDpiOutMax"))
178
+ processParams.imageDpiOutMax = opts.getInt("imageDpiOutMax");
179
+ if (opts.has("alreadyCropped"))
180
+ processParams.alreadyCropped = opts.getBoolean("alreadyCropped");
181
+ if (opts.has("forceDocID"))
182
+ processParams.forceDocID = opts.getInt("forceDocID");
183
+ if (opts.has("matchTextFieldMask"))
184
+ processParams.matchTextFieldMask = opts.getBoolean("matchTextFieldMask");
185
+ if (opts.has("fastDocDetect"))
186
+ processParams.fastDocDetect = opts.getBoolean("fastDocDetect");
187
+ if (opts.has("updateOCRValidityByGlare"))
188
+ processParams.updateOCRValidityByGlare = opts.getBoolean("updateOCRValidityByGlare");
189
+ if (opts.has("imageQA")) {
190
+ ImageQA img = new ImageQA();
191
+ img.fromJson(opts.getJSONObject("imageQA"));
192
+ processParams.imageQA = img;
193
+ }
194
+ if (opts.has("forceDocFormat"))
195
+ processParams.forceDocFormat = opts.getInt("forceDocFormat");
196
+ if (opts.has("noGraphics"))
197
+ processParams.noGraphics = opts.getBoolean("noGraphics");
198
+ if (opts.has("documentAreaMin"))
199
+ processParams.documentAreaMin = opts.getDouble("documentAreaMin");
200
+ if (opts.has("multiDocOnImage"))
201
+ processParams.multiDocOnImage = opts.getBoolean("multiDocOnImage");
202
+ if (opts.has("shiftExpiryDate"))
203
+ processParams.shiftExpiryDate = opts.getInt("shiftExpiryDate");
204
+ if (opts.has("minimalHolderAge"))
205
+ processParams.minimalHolderAge = opts.getInt("minimalHolderAge");
206
+ if (opts.has("mrzFormatsFilter"))
207
+ processParams.mrzFormatsFilter = stringArrayFromJson(opts.getJSONArray("mrzFormatsFilter"));
208
+ if (opts.has("forceReadMrzBeforeLocate"))
209
+ processParams.forceReadMrzBeforeLocate = opts.getBoolean("forceReadMrzBeforeLocate");
210
+ if (opts.has("parseBarcodes"))
211
+ processParams.parseBarcodes = opts.getBoolean("parseBarcodes");
212
+ if (opts.has("shouldReturnPackageForReprocess"))
213
+ processParams.shouldReturnPackageForReprocess = opts.getBoolean("shouldReturnPackageForReprocess");
168
214
  }
169
215
 
170
216
  private static void setCustomization(ParamsCustomization customization, JSONObject opts, Context context) throws JSONException {
@@ -278,7 +324,7 @@ class RegulaConfig {
278
324
  if (opts.has("statusBackgroundColor"))
279
325
  editor.setStatusBackgroundColor(opts.getString("statusBackgroundColor"));
280
326
 
281
- editor.apply();
327
+ editor.applyImmediately(context);
282
328
  }
283
329
 
284
330
  private static JSONObject getFunctionality(Functionality functionality) throws JSONException {
@@ -316,6 +362,7 @@ class RegulaConfig {
316
362
  object.put("isCameraTorchCheckDisabled", functionality.isCameraTorchCheckDisabled());
317
363
  object.put("recordScanningProcess", functionality.doRecordProcessingVideo());
318
364
  object.put("manualMultipageMode", functionality.isManualMultipageMode());
365
+ object.put("exposure", functionality.getExposure());
319
366
 
320
367
  return object;
321
368
  }
@@ -382,6 +429,10 @@ class RegulaConfig {
382
429
 
383
430
  private static JSONObject getProcessParams(ProcessParam processParams) throws JSONException {
384
431
  JSONObject object = new JSONObject();
432
+ object.put("documentIDList", processParams.documentIDList != null ? generateIntArray(processParams.documentIDList) : null);
433
+ object.put("barcodeTypes", processParams.doBarcodes != null ? generateArray(processParams.doBarcodes) : null);
434
+ object.put("fieldTypesFilter", processParams.fieldTypesFilter != null ? generateIntArray(processParams.fieldTypesFilter) : null);
435
+ object.put("faceMetaData", processParams.faceMetaData != null ? generateArray(processParams.faceMetaData, JSONConstructor::generateFaceMetaData) : null);
385
436
  object.put("scenario", processParams.scenario);
386
437
  object.put("measureSystem", processParams.measureSystem);
387
438
  object.put("uvTorchEnabled", processParams.uvTorchEnabled);
@@ -409,14 +460,26 @@ class RegulaConfig {
409
460
  object.put("returnCroppedBarcode", processParams.returnCroppedBarcode);
410
461
  object.put("checkHologram", processParams.checkHologram);
411
462
  object.put("checkRequiredTextFields", processParams.checkRequiredTextFields);
412
- if (processParams.documentIDList != null)
413
- object.put("documentIDList", generateIntArray(processParams.documentIDList));
414
- if (processParams.doBarcodes != null)
415
- object.put("barcodeTypes", generateArray(processParams.doBarcodes));
416
- if (processParams.fieldTypesFilter != null)
417
- object.put("fieldTypesFilter", generateIntArray(processParams.fieldTypesFilter));
418
- if (processParams.faceMetaData != null)
419
- object.put("faceMetaData", generateArray(processParams.faceMetaData, JSONConstructor::generateFaceMetaData));
463
+ object.put("depersonalizeLog", processParams.depersonalizeLog);
464
+ object.put("resultTypeOutput", processParams.resultTypeOutput);
465
+ object.put("generateDoublePageSpreadImage", processParams.generateDoublePageSpreadImage);
466
+ object.put("imageDpiOutMax", processParams.imageDpiOutMax);
467
+ object.put("alreadyCropped", processParams.alreadyCropped);
468
+ object.put("forceDocID", processParams.forceDocID);
469
+ object.put("matchTextFieldMask", processParams.matchTextFieldMask);
470
+ object.put("fastDocDetect", processParams.fastDocDetect);
471
+ object.put("updateOCRValidityByGlare", processParams.updateOCRValidityByGlare);
472
+ object.put("imageQA", processParams.imageQA != null ? processParams.imageQA.toJsonObject() : null);
473
+ object.put("forceDocFormat", processParams.forceDocFormat);
474
+ object.put("noGraphics", processParams.noGraphics);
475
+ object.put("documentAreaMin", processParams.documentAreaMin);
476
+ object.put("multiDocOnImage", processParams.multiDocOnImage);
477
+ object.put("shiftExpiryDate", processParams.shiftExpiryDate);
478
+ object.put("minimalHolderAge", processParams.minimalHolderAge);
479
+ object.put("mrzFormatsFilter", processParams.mrzFormatsFilter != null ? generateArray(processParams.mrzFormatsFilter) : null);
480
+ object.put("forceReadMrzBeforeLocate", processParams.forceReadMrzBeforeLocate);
481
+ object.put("parseBarcodes", processParams.parseBarcodes);
482
+ object.put("shouldReturnPackageForReprocess", processParams.shouldReturnPackageForReprocess);
420
483
 
421
484
  return object;
422
485
  }
@@ -0,0 +1,3 @@
1
+ # Windows files
2
+ [*.bat]
3
+ end_of_line = crlf
@@ -8,10 +8,6 @@
8
8
  ; Ignore polyfills
9
9
  node_modules/react-native/Libraries/polyfills/.*
10
10
 
11
- ; These should not be required directly
12
- ; require from fbjs/lib instead: require('fbjs/lib/warning')
13
- node_modules/warning/.*
14
-
15
11
  ; Flow doesn't support platforms
16
12
  .*/Libraries/Utilities/LoadingView.js
17
13
 
@@ -27,8 +23,9 @@ node_modules/react-native/flow/
27
23
  [options]
28
24
  emoji=true
29
25
 
30
- esproposal.optional_chaining=enable
31
- esproposal.nullish_coalescing=enable
26
+ exact_by_default=true
27
+
28
+ format.bracket_spacing=false
32
29
 
33
30
  module.file_ext=.js
34
31
  module.file_ext=.json
@@ -44,10 +41,6 @@ suppress_type=$FlowFixMe
44
41
  suppress_type=$FlowFixMeProps
45
42
  suppress_type=$FlowFixMeState
46
43
 
47
- suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
48
- suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
49
- suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
50
-
51
44
  [lints]
52
45
  sketchy-null-number=warn
53
46
  sketchy-null-mixed=warn
@@ -56,10 +49,8 @@ untyped-type-import=warn
56
49
  nonstrict-import=warn
57
50
  deprecated-type=warn
58
51
  unsafe-getters-setters=warn
59
- inexact-spread=warn
60
52
  unnecessary-invariant=warn
61
53
  signature-verification-failure=warn
62
- deprecated-utility=error
63
54
 
64
55
  [strict]
65
56
  deprecated-type
@@ -71,4 +62,4 @@ untyped-import
71
62
  untyped-type-import
72
63
 
73
64
  [version]
74
- ^0.113.0
65
+ ^0.158.0
@@ -1 +1,3 @@
1
- *.pbxproj -text
1
+ # Windows files should use crlf line endings
2
+ # https://help.github.com/articles/dealing-with-line-endings/
3
+ *.bat text eol=crlf
@@ -3,4 +3,5 @@ module.exports = {
3
3
  jsxBracketSameLine: true,
4
4
  singleQuote: true,
5
5
  trailingComma: 'all',
6
+ arrowParens: 'avoid',
6
7
  };
package/example/App.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import React, { Component } from 'react'
2
2
  import { StyleSheet, View, Button, Text, Image, ScrollView, NativeEventEmitter, Platform, TouchableOpacity } from 'react-native'
3
- import DocumentReader, { Enum, DocumentReaderCompletion, DocumentReaderScenario,RNRegulaDocumentReader } from '@regulaforensics/react-native-document-reader-api'
3
+ import DocumentReader, { Enum, DocumentReaderCompletion, DocumentReaderScenario, RNRegulaDocumentReader } from '@regulaforensics/react-native-document-reader-api'
4
4
  import * as RNFS from 'react-native-fs'
5
5
  import RadioGroup from 'react-native-radio-buttons-group'
6
- import ImagePicker from 'react-native-customized-image-picker'
6
+ import { launchCamera, launchImageLibrary } from 'react-native-image-picker';
7
7
  import * as Progress from 'react-native-progress'
8
8
  import CheckBox from 'react-native-check-box'
9
+ import { LogBox } from 'react-native';
9
10
 
11
+ LogBox.ignoreLogs(['new NativeEventEmitter']);
10
12
  const eventManager = new NativeEventEmitter(RNRegulaDocumentReader)
11
13
 
12
14
  var licPath = Platform.OS === 'ios' ? (RNFS.MainBundlePath + "/regula.license") : "regula.license"
@@ -63,14 +65,14 @@ export default class App extends Component {
63
65
  for (var i in scenariosTemp) {
64
66
  scenariosL.push({
65
67
  label: DocumentReaderScenario.fromJson(typeof scenariosTemp[i] === "string" ? JSON.parse(scenariosTemp[i]) : scenariosTemp[i]).name,
66
- value: i
68
+ id: i
67
69
  })
68
70
  }
69
71
  this.setState({ scenarios: scenariosL })
70
72
  this.setState({ selectedScenario: this.state.scenarios[0]['label'] })
71
73
  this.setState({ radio: null })
72
74
  this.setState({
73
- radio: <RadioGroup style={{ alignSelf: 'stretch' }} radioButtons={this.state.scenarios} onPress={(data) => {
75
+ radio: <RadioGroup containerStyle={styles.radio} radioButtons={this.state.scenarios} onPress={(data) => {
74
76
  var selectedItem
75
77
  for (var index in data)
76
78
  if (data[index]['selected'])
@@ -81,7 +83,7 @@ export default class App extends Component {
81
83
  DocumentReader.getDocumentReaderIsReady((isReady) => {
82
84
  if (isReady) {
83
85
  this.setState({ fullName: "Ready" })
84
- DocumentReader.setRfidDelegate(Enum.RFIDDelegate.NO_PA, (r) => {}, error => console.log(error))
86
+ DocumentReader.setRfidDelegate(Enum.RFIDDelegate.NO_PA, (r) => { }, error => console.log(error))
85
87
  // addCertificates()
86
88
  } else
87
89
  this.setState({ fullName: "Failed" })
@@ -100,7 +102,7 @@ export default class App extends Component {
100
102
  selectedScenario: "",
101
103
  portrait: require('./images/portrait.png'),
102
104
  docFront: require('./images/id.png'),
103
- radio: <RadioGroup style={{ alignSelf: 'stretch' }} radioButtons={[{ label: 'Loading', value: 0 }]} onPress={null} />
105
+ radio: <RadioGroup containerStyle={styles.radio} radioButtons={[{ label: 'Loading', id: 0 }]} onPress={null} />
104
106
  }
105
107
  }
106
108
 
@@ -221,7 +223,7 @@ export default class App extends Component {
221
223
  padding: 5,
222
224
  }}>
223
225
  Portrait
224
- </Text>
226
+ </Text>
225
227
  <Image
226
228
  style={{
227
229
  height: 150,
@@ -238,7 +240,7 @@ export default class App extends Component {
238
240
  padding: 5,
239
241
  }}>
240
242
  Document image
241
- </Text>
243
+ </Text>
242
244
  <Image
243
245
  style={{
244
246
  height: 150,
@@ -250,7 +252,7 @@ export default class App extends Component {
250
252
  </View>
251
253
  </View>
252
254
 
253
- <ScrollView style={{ padding: 5, alignSelf: 'stretch' }}>
255
+ <ScrollView style={{ padding: 5, alignSelf: 'center' }} showsVerticalScrollIndicator={false}>
254
256
  {this.state.radio}
255
257
  </ScrollView>
256
258
 
@@ -295,12 +297,21 @@ export default class App extends Component {
295
297
  <Text style={{ padding: 5 }}></Text>
296
298
  <Button color="#4285F4"
297
299
  onPress={() => {
298
- this.clearResults()
299
- this.setState({ fullName: "COPYING IMAGE..." })
300
- ImagePicker.openPicker({
301
- multiple: true,
302
- includeBase64: true
303
- }).then(response => {
300
+ launchImageLibrary({
301
+ mediaType: 'photo',
302
+ includeBase64: true,
303
+ selectionLimit: 10
304
+ }, r => {
305
+ if (r.errorCode != null) {
306
+ console.log("error code: " + r.errorCode)
307
+ console.log("error message: " + r.errorMessage)
308
+ this.setState({ fullName: r.errorMessage })
309
+ return
310
+ }
311
+ if (r.didCancel) return
312
+ this.clearResults()
313
+ this.setState({ fullName: "COPYING IMAGE..." })
314
+ var response = r.assets
304
315
  DocumentReader.setConfig({
305
316
  functionality: {
306
317
  videoCaptureMotionControl: true,
@@ -319,12 +330,10 @@ export default class App extends Component {
319
330
  var images = []
320
331
 
321
332
  for (var i = 0; i < response.length; i++) {
322
- images.push(response[i].data)
333
+ images.push(response[i].base64)
323
334
  }
324
335
  this.setState({ fullName: "PROCESSING..." })
325
336
  DocumentReader.recognizeImages(images, s => { }, e => console.log(e))
326
- }).catch(e => {
327
- console.log("ImagePicker: " + e)
328
337
  })
329
338
  }}
330
339
  title=" Scan image "
@@ -347,6 +356,9 @@ const styles = StyleSheet.create({
347
356
  backgroundColor: '#F5FCFF',
348
357
  marginBottom: 12,
349
358
  },
359
+ radio: {
360
+ alignItems: 'flex-start'
361
+ },
350
362
  welcome: {
351
363
  fontSize: 20,
352
364
  textAlign: 'center',
@@ -0,0 +1,55 @@
1
+ # To learn about Buck see [Docs](https://buckbuild.com/).
2
+ # To run your application with Buck:
3
+ # - install Buck
4
+ # - `npm start` - to start the packager
5
+ # - `cd android`
6
+ # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7
+ # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8
+ # - `buck install -r android/app` - compile, install and run application
9
+ #
10
+
11
+ load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12
+
13
+ lib_deps = []
14
+
15
+ create_aar_targets(glob(["libs/*.aar"]))
16
+
17
+ create_jar_targets(glob(["libs/*.jar"]))
18
+
19
+ android_library(
20
+ name = "all-libs",
21
+ exported_deps = lib_deps,
22
+ )
23
+
24
+ android_library(
25
+ name = "app-code",
26
+ srcs = glob([
27
+ "src/main/java/**/*.java",
28
+ ]),
29
+ deps = [
30
+ ":all-libs",
31
+ ":build_config",
32
+ ":res",
33
+ ],
34
+ )
35
+
36
+ android_build_config(
37
+ name = "build_config",
38
+ package = "com.regula.dr.fullrfid",
39
+ )
40
+
41
+ android_resource(
42
+ name = "res",
43
+ package = "com.regula.dr.fullrfid",
44
+ res = "src/main/res",
45
+ )
46
+
47
+ android_binary(
48
+ name = "app",
49
+ keystore = "//android/keystores:debug",
50
+ manifest = "src/main/AndroidManifest.xml",
51
+ package_type = "debug",
52
+ deps = [
53
+ ":app-code",
54
+ ],
55
+ )
@@ -3,7 +3,7 @@ apply plugin: "com.android.application"
3
3
  import com.android.build.OutputFile
4
4
 
5
5
  project.ext.react = [
6
- enableHermes: false,
6
+ enableHermes: false,
7
7
  ]
8
8
 
9
9
  apply from: "../../node_modules/react-native/react.gradle"
@@ -11,9 +11,12 @@ apply from: "../../node_modules/react-native/react.gradle"
11
11
  def enableSeparateBuildPerCPUArchitecture = false
12
12
  def enableProguardInReleaseBuilds = false
13
13
  def jscFlavor = 'org.webkit:android-jsc:+'
14
- def enableHermes = project.ext.react.get("enableHermes", false)
14
+ def enableHermes = project.ext.react.get("enableHermes", false);
15
+ def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")
15
16
 
16
17
  android {
18
+ ndkVersion rootProject.ext.ndkVersion
19
+
17
20
  compileSdkVersion rootProject.ext.compileSdkVersion
18
21
 
19
22
  compileOptions {
@@ -26,7 +29,6 @@ android {
26
29
  targetSdkVersion rootProject.ext.targetSdkVersion
27
30
  versionCode 1
28
31
  versionName "1.0"
29
- multiDexEnabled true
30
32
  }
31
33
  splits {
32
34
  abi {
@@ -36,27 +38,39 @@ android {
36
38
  include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
37
39
  }
38
40
  }
41
+ signingConfigs {
42
+ debug {
43
+ storeFile file('debug.keystore')
44
+ storePassword 'android'
45
+ keyAlias 'androiddebugkey'
46
+ keyPassword 'android'
47
+ }
48
+ }
39
49
  buildTypes {
50
+ debug {
51
+ signingConfig signingConfigs.debug
52
+ if (nativeArchitectures) {
53
+ ndk {
54
+ abiFilters nativeArchitectures.split(',')
55
+ }
56
+ }
57
+ }
40
58
  release {
41
59
  signingConfig signingConfigs.debug
42
60
  minifyEnabled enableProguardInReleaseBuilds
43
61
  proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
44
62
  }
45
63
  }
46
- packagingOptions {
47
- pickFirst "lib/armeabi-v7a/libc++_shared.so"
48
- pickFirst "lib/arm64-v8a/libc++_shared.so"
49
- pickFirst "lib/x86/libc++_shared.so"
50
- pickFirst "lib/x86_64/libc++_shared.so"
51
- }
64
+
52
65
  applicationVariants.all { variant ->
53
66
  variant.outputs.each { output ->
54
67
  def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
55
68
  def abi = output.getFilter(OutputFile.ABI)
56
69
  if (abi != null) {
57
70
  output.versionCodeOverride =
58
- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
71
+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)
59
72
  }
73
+
60
74
  }
61
75
  }
62
76
  }
@@ -65,20 +79,24 @@ dependencies {
65
79
  implementation fileTree(dir: "libs", include: ["*.jar"])
66
80
  //noinspection GradleDynamicVersion
67
81
  implementation "com.facebook.react:react-native:+"
68
- implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
69
- implementation "com.android.support:multidex:1.0.3"
82
+
83
+ implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
70
84
 
71
85
  debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
72
- exclude group: 'com.facebook.fbjni'
86
+ exclude group:'com.facebook.fbjni'
73
87
  }
88
+
74
89
  debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
75
- exclude group: 'com.facebook.flipper'
90
+ exclude group:'com.facebook.flipper'
91
+ exclude group:'com.squareup.okhttp3', module:'okhttp'
76
92
  }
93
+
77
94
  debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
78
- exclude group: 'com.facebook.flipper'
95
+ exclude group:'com.facebook.flipper'
79
96
  }
97
+
80
98
  if (enableHermes) {
81
- def hermesPath = "../../node_modules/hermes-engine/android/"
99
+ def hermesPath = "../../node_modules/hermes-engine/android/";
82
100
  debugImplementation files(hermesPath + "hermes-debug.aar")
83
101
  releaseImplementation files(hermesPath + "hermes-release.aar")
84
102
  } else {
@@ -87,7 +105,7 @@ dependencies {
87
105
  }
88
106
 
89
107
  task copyDownloadableDepsToLibs(type: Copy) {
90
- from configurations.compile
108
+ from configurations.implementation
91
109
  into 'libs'
92
110
  }
93
111
 
@@ -4,5 +4,10 @@
4
4
 
5
5
  <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6
6
 
7
- <application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
7
+ <application
8
+ android:usesCleartextTraffic="true"
9
+ tools:targetApi="28"
10
+ tools:ignore="GoogleAppIndexingWarning">
11
+ <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
12
+ </application>
8
13
  </manifest>
@@ -1,29 +1,28 @@
1
1
  <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.regula.dr.fullrfid">
2
+ package="com.regula.dr.fullrfid">
3
3
 
4
- <uses-permission android:name="android.permission.INTERNET" />
5
- <uses-permission android:name="android.permission.NFC" />
4
+ <uses-permission android:name="android.permission.INTERNET" />
5
+ <uses-permission android:name="android.permission.NFC" />
6
6
 
7
7
  <application
8
- android:name=".MainApplication"
9
- android:allowBackup="false"
10
- android:icon="@mipmap/ic_launcher"
8
+ android:name=".MainApplication"
9
+ android:label="@string/app_name"
10
+ android:icon="@mipmap/ic_launcher"
11
+ android:roundIcon="@mipmap/ic_launcher_round"
12
+ android:allowBackup="false"
13
+ android:requestLegacyExternalStorage="true"
14
+ android:theme="@style/AppTheme">
15
+ <activity
16
+ android:name=".MainActivity"
11
17
  android:label="@string/app_name"
12
- android:requestLegacyExternalStorage="true"
13
- android:roundIcon="@mipmap/ic_launcher_round"
14
- android:theme="@style/AppTheme">
15
- <activity
16
- android:name=".MainActivity"
17
- android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
18
- android:label="@string/app_name"
19
- android:launchMode="singleTask"
20
- android:windowSoftInputMode="adjustResize">
21
- <intent-filter>
22
- <action android:name="android.intent.action.MAIN" />
23
- <category android:name="android.intent.category.LAUNCHER" />
24
- </intent-filter>
25
- </activity>
26
- <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
18
+ android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
19
+ android:launchMode="singleTask"
20
+ android:windowSoftInputMode="adjustResize"
21
+ android:exported="true">
22
+ <intent-filter>
23
+ <action android:name="android.intent.action.MAIN" />
24
+ <category android:name="android.intent.category.LAUNCHER" />
25
+ </intent-filter>
26
+ </activity>
27
27
  </application>
28
-
29
28
  </manifest>