@regulaforensics/document-reader 9.9.1147-nightly → 9.9.1155-beta

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 (143) hide show
  1. package/Package.swift +28 -0
  2. package/README.md +3 -1
  3. package/android/CVDDocumentReader.kt +4 -3
  4. package/android/build.gradle.kts +37 -0
  5. package/android/cordova.gradle.kts +13 -0
  6. package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/BluetoothUtil.kt +1 -1
  7. package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/Config.kt +3 -3
  8. package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/JSONConstructor.kt +4 -4
  9. package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/Main.kt +3 -3
  10. package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/RNDocumentReaderModule.kt +4 -3
  11. package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/Utils.kt +1 -1
  12. package/app.plugin.js +10 -7
  13. package/examples/capacitor/README.md +2 -0
  14. package/examples/capacitor/android/app/build.gradle +1 -10
  15. package/examples/capacitor/android/app/src/main/AndroidManifest.xml +9 -0
  16. package/examples/capacitor/android/app/src/main/res/xml/file_paths.xml +5 -0
  17. package/examples/capacitor/android/build.gradle +12 -3
  18. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  19. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  20. package/examples/capacitor/android/gradle.properties +4 -0
  21. package/examples/capacitor/android/gradlew +4 -7
  22. package/examples/capacitor/android/gradlew.bat +12 -24
  23. package/examples/capacitor/android/variables.gradle +13 -9
  24. package/examples/capacitor/capacitor.config.json +15 -0
  25. package/examples/capacitor/index.tsx +15 -23
  26. package/examples/capacitor/ios/App/App/AppDelegate.swift +5 -40
  27. package/examples/capacitor/ios/App/App/Info.plist +19 -2
  28. package/examples/capacitor/ios/App/App/SceneDelegate.swift +23 -0
  29. package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +30 -86
  30. package/examples/capacitor/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift +1 -0
  31. package/examples/capacitor/package.json +13 -18
  32. package/examples/capacitor/scripts/android.sh +5 -8
  33. package/examples/capacitor/scripts/ios.sh +5 -7
  34. package/examples/capacitor/scripts/setup.sh +2 -7
  35. package/examples/capacitor/src/main.css +5 -0
  36. package/examples/capacitor/vite.config.ts +0 -12
  37. package/examples/capacitor-cocoapods/README.md +22 -0
  38. package/examples/capacitor-cocoapods/android/app/build.gradle +50 -0
  39. package/examples/capacitor-cocoapods/android/app/proguard-rules.pro +21 -0
  40. package/examples/capacitor-cocoapods/android/app/src/main/AndroidManifest.xml +27 -0
  41. package/examples/capacitor-cocoapods/android/app/src/main/assets/Regula/.gitkeep +0 -0
  42. package/examples/capacitor-cocoapods/android/app/src/main/java/com/regula/example/dr/capacitor/MainActivity.java +5 -0
  43. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/ic_launcher.png +0 -0
  44. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/ic_launcher_foreground.png +0 -0
  45. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/ic_launcher_round.png +0 -0
  46. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/launcher.xml +4 -0
  47. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/launcher_round.xml +4 -0
  48. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/splash.png +0 -0
  49. package/examples/capacitor-cocoapods/android/app/src/main/res/layout/activity_main.xml +12 -0
  50. package/examples/capacitor-cocoapods/android/app/src/main/res/values/styles.xml +22 -0
  51. package/examples/capacitor-cocoapods/android/build.gradle +30 -0
  52. package/examples/capacitor-cocoapods/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  53. package/examples/capacitor-cocoapods/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  54. package/examples/capacitor-cocoapods/android/gradle.properties +22 -0
  55. package/examples/capacitor-cocoapods/android/gradlew +251 -0
  56. package/examples/capacitor-cocoapods/android/gradlew.bat +94 -0
  57. package/examples/capacitor-cocoapods/android/settings.gradle +5 -0
  58. package/examples/capacitor-cocoapods/android/variables.gradle +16 -0
  59. package/examples/capacitor-cocoapods/index.html +5 -0
  60. package/examples/capacitor-cocoapods/index.tsx +39 -0
  61. package/examples/capacitor-cocoapods/ios/App/App/App.entitlements +10 -0
  62. package/examples/capacitor-cocoapods/ios/App/App/AppDelegate.swift +49 -0
  63. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
  64. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
  65. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/Contents.json +6 -0
  66. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
  67. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  68. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  69. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  70. package/examples/capacitor-cocoapods/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
  71. package/examples/capacitor-cocoapods/ios/App/App/Info.plist +69 -0
  72. package/examples/capacitor-cocoapods/ios/App/App.xcodeproj/project.pbxproj +430 -0
  73. package/examples/capacitor-cocoapods/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  74. package/examples/capacitor-cocoapods/package.json +30 -0
  75. package/examples/capacitor-cocoapods/public/assets/.gitkeep +0 -0
  76. package/examples/capacitor-cocoapods/public/images/document.png +0 -0
  77. package/examples/capacitor-cocoapods/public/images/portrait.png +0 -0
  78. package/examples/capacitor-cocoapods/scripts/android.sh +11 -0
  79. package/examples/capacitor-cocoapods/scripts/ios.sh +10 -0
  80. package/examples/capacitor-cocoapods/scripts/setup.sh +14 -0
  81. package/examples/capacitor-cocoapods/src/extra/bt_device.tsx +33 -0
  82. package/examples/capacitor-cocoapods/src/extra/custom_rfid.tsx +61 -0
  83. package/examples/capacitor-cocoapods/src/main.css +148 -0
  84. package/examples/capacitor-cocoapods/src/main.html +38 -0
  85. package/examples/capacitor-cocoapods/src/main.tsx +172 -0
  86. package/examples/capacitor-cocoapods/tsconfig.json +5 -0
  87. package/examples/capacitor-cocoapods/vite.config.ts +17 -0
  88. package/examples/ionic/README.md +2 -0
  89. package/examples/ionic/config.xml +1 -1
  90. package/examples/ionic/index.tsx +8 -3
  91. package/examples/ionic/package-lock.json +6014 -7521
  92. package/examples/ionic/package.json +24 -33
  93. package/examples/ionic/scripts/android.sh +0 -2
  94. package/examples/ionic/scripts/ios.sh +0 -2
  95. package/examples/ionic/scripts/setup.sh +0 -2
  96. package/examples/ionic/tsconfig.json +0 -1
  97. package/examples/ionic-cocoapods/README.md +22 -0
  98. package/examples/ionic-cocoapods/angular.json +39 -0
  99. package/examples/ionic-cocoapods/assets/.gitkeep +0 -0
  100. package/examples/ionic-cocoapods/config.xml +63 -0
  101. package/examples/ionic-cocoapods/images/document.png +0 -0
  102. package/examples/ionic-cocoapods/images/icon.png +0 -0
  103. package/examples/ionic-cocoapods/images/portrait.png +0 -0
  104. package/examples/ionic-cocoapods/index.html +19 -0
  105. package/examples/ionic-cocoapods/index.tsx +58 -0
  106. package/examples/ionic-cocoapods/ionic.config.json +7 -0
  107. package/examples/ionic-cocoapods/package-lock.json +16579 -0
  108. package/examples/ionic-cocoapods/package.json +58 -0
  109. package/examples/ionic-cocoapods/scripts/android.sh +8 -0
  110. package/examples/ionic-cocoapods/scripts/ios.sh +8 -0
  111. package/examples/ionic-cocoapods/scripts/setup.sh +8 -0
  112. package/examples/ionic-cocoapods/src/extra/bt_device.tsx +33 -0
  113. package/examples/ionic-cocoapods/src/extra/custom_rfid.tsx +61 -0
  114. package/examples/ionic-cocoapods/src/main.css +148 -0
  115. package/examples/ionic-cocoapods/src/main.html +38 -0
  116. package/examples/ionic-cocoapods/src/main.tsx +172 -0
  117. package/examples/ionic-cocoapods/tsconfig.json +14 -0
  118. package/examples/react_native/README.md +2 -0
  119. package/examples/react_native/app.config.ts +1 -2
  120. package/examples/react_native/package-lock.json +2018 -4031
  121. package/examples/react_native/package.json +14 -19
  122. package/examples/react_native/scripts/android.sh +3 -3
  123. package/examples/react_native/scripts/ios.sh +3 -3
  124. package/examples/react_native/scripts/setup.sh +4 -3
  125. package/ios/module.modulemap +7 -0
  126. package/package.json +1 -1
  127. package/plugin.xml +12 -12
  128. package/react-native-document-reader.podspec +14 -0
  129. package/test/package-lock.json +5 -2
  130. package/RNDocumentReader.podspec +0 -21
  131. package/android/build.gradle +0 -36
  132. package/android/cordova.gradle +0 -12
  133. package/examples/react_native/vendor/image-size-metro-compat/index.cjs +0 -16
  134. package/examples/react_native/vendor/image-size-metro-compat/package.json +0 -8
  135. /package/examples/{capacitor → capacitor-cocoapods}/android/app/capacitor.build.gradle +0 -0
  136. /package/examples/{capacitor → capacitor-cocoapods}/android/capacitor.settings.gradle +0 -0
  137. /package/examples/{capacitor → capacitor-cocoapods}/ionic.config.json +0 -0
  138. /package/examples/{capacitor → capacitor-cocoapods}/ios/App/App/Base.lproj/Main.storyboard +0 -0
  139. /package/examples/{capacitor → capacitor-cocoapods}/ios/App/App.xcworkspace/contents.xcworkspacedata +0 -0
  140. /package/examples/{capacitor → capacitor-cocoapods}/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  141. /package/examples/{capacitor → capacitor-cocoapods}/ios/App/Podfile +0 -0
  142. /package/examples/{capacitor → capacitor-cocoapods}/ios/App/Podfile.lock +0 -0
  143. /package/examples/{capacitor → capacitor-cocoapods}/package-lock.json +0 -0
package/Package.swift ADDED
@@ -0,0 +1,28 @@
1
+ // swift-tools-version: 5.9
2
+
3
+ import PackageDescription
4
+
5
+ let package = Package(
6
+ name: "@regulaforensics/document-reader",
7
+ platforms: [.iOS(.v15)],
8
+ products: [.library(name: "@regulaforensics/document-reader", targets: ["@regulaforensics/document-reader"])],
9
+ dependencies: [
10
+ .package(url: "https://github.com/apache/cordova-ios.git", branch: "master"),
11
+ .package(
12
+ url: "https://github.com/regulaforensics/DocumentReader-Swift-Package",
13
+ exact: "9.8.6944"
14
+ )
15
+ ],
16
+ targets: [
17
+ .target(
18
+ name: "@regulaforensics/document-reader",
19
+ dependencies: [
20
+ .product(name: "Cordova", package: "cordova-ios"),
21
+ .product(name: "DocumentReader", package: "DocumentReader-Swift-Package")
22
+ ],
23
+ path: "ios",
24
+ exclude: ["RNDocumentReader.h", "RNDocumentReader.m"],
25
+ publicHeadersPath: "."
26
+ )
27
+ ]
28
+ )
package/README.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # Regula Document Reader plugin
2
2
  Document Reader allows you to read various kinds of identification documents, passports, driving licenses, ID cards, etc. All processing is performed completely offline on your device. This plugin makes possible to use it with react-native, cordova and capacitor applications.
3
3
 
4
+ Requires iOS 15+ & Android 7.0+ (API 24)
5
+
4
6
  ## Demo applications
5
7
  In the [examples](examples/) folder you can find 3 demo applications:
6
8
  * [React-native](examples/react_native)
9
+ * [Capacitor](examples/capacitor)
7
10
  * [Ionic(ionic app with cordova, angular)](examples/ionic)
8
- * [Capacitor(ionic app with capacitor, react)](examples/capacitor)
9
11
 
10
12
  Each demo app has its own readme file with instructions on building and installation.
11
13
 
@@ -1,4 +1,4 @@
1
- package com.regula.plugin.documentreader
1
+ package com.regula.plugin.document.reader
2
2
 
3
3
  import android.app.Activity
4
4
  import android.content.Context
@@ -66,8 +66,9 @@ class CVDDocumentReader : CordovaPlugin() {
66
66
  if (method == "setEvent") eventCallbackIds[args(0)] = callbackContext.callbackId
67
67
  try {
68
68
  methodCall(method) { data: Any? -> sendEvent(callbackContext.callbackId, data) }
69
- } catch (error: Exception) {
70
- Log.e("REGULA", "Caught exception in \"$method\" function:", error)
69
+ } catch (error: Throwable) {
70
+ Log.e("REGULA", "Caught an exception in \"$method\" function:", error)
71
+ sendEvent(callbackContext.callbackId, "Unexpected error, check logs for details")
71
72
  }
72
73
  return true
73
74
  }
@@ -0,0 +1,37 @@
1
+ import com.android.build.api.dsl.LibraryExtension
2
+
3
+ plugins {
4
+ id("com.android.library")
5
+ }
6
+
7
+ // AGP 9+ may already provide built-in Kotlin.
8
+ if (extensions.findByName("kotlin") == null) {
9
+ apply(plugin = "kotlin-android")
10
+ }
11
+
12
+ extensions.configure<LibraryExtension> {
13
+ namespace = "com.regula.plugin.document.reader"
14
+ compileSdk = 36
15
+
16
+ defaultConfig {
17
+ minSdk = 24
18
+ }
19
+ }
20
+
21
+ rootProject.allprojects {
22
+ repositories {
23
+ maven { url = uri("https://maven.regulaforensics.com/RegulaDocumentReader") }
24
+ maven { url = uri("https://maven.regulaforensics.com/RegulaDocumentReader/Beta") }
25
+ maven { url = uri("https://maven.regulaforensics.com/RegulaDocumentReader/Nightly") }
26
+ maven { url = uri("https://maven.regulaforensics.com/RegulaDocumentReader/Stage") }
27
+ }
28
+ }
29
+
30
+ dependencies {
31
+ //noinspection GradleDynamicVersion
32
+ implementation("com.facebook.react:react-native:+")
33
+ //noinspection GradleDependency
34
+ implementation("com.regula.documentreader:api:9.8.13324") {
35
+ isTransitive = true
36
+ }
37
+ }
@@ -0,0 +1,13 @@
1
+ repositories {
2
+ maven { url = uri("https://maven.regulaforensics.com/RegulaDocumentReader") }
3
+ maven { url = uri("https://maven.regulaforensics.com/RegulaDocumentReader/Beta") }
4
+ maven { url = uri("https://maven.regulaforensics.com/RegulaDocumentReader/Nightly") }
5
+ maven { url = uri("https://maven.regulaforensics.com/RegulaDocumentReader/Stage") }
6
+ }
7
+
8
+ dependencies {
9
+ //noinspection GradleDependency
10
+ add("implementation", "com.regula.documentreader:api:9.8.13324") {
11
+ isTransitive = true
12
+ }
13
+ }
@@ -1,4 +1,4 @@
1
- package com.regula.plugin.documentreader
1
+ package com.regula.plugin.document.reader
2
2
 
3
3
  import android.Manifest.permission.ACCESS_FINE_LOCATION
4
4
  import android.Manifest.permission.BLUETOOTH_CONNECT
@@ -1,6 +1,6 @@
1
1
  @file:Suppress("EnumValuesSoftDeprecate", "DEPRECATION")
2
2
 
3
- package com.regula.plugin.documentreader
3
+ package com.regula.plugin.document.reader
4
4
 
5
5
  import android.graphics.Matrix
6
6
  import android.graphics.Paint
@@ -27,8 +27,8 @@ import com.regula.documentreader.api.params.rfid.dg.DTCDataGroup
27
27
  import com.regula.documentreader.api.params.rfid.dg.DataGroups
28
28
  import com.regula.documentreader.api.params.rfid.dg.EIDDataGroups
29
29
  import com.regula.documentreader.api.params.rfid.dg.EPassportDataGroups
30
- import com.regula.plugin.documentreader.Convert.toBase64
31
- import com.regula.plugin.documentreader.Convert.toDrawable
30
+ import com.regula.plugin.document.reader.Convert.toBase64
31
+ import com.regula.plugin.document.reader.Convert.toDrawable
32
32
  import org.json.JSONArray
33
33
  import org.json.JSONObject
34
34
 
@@ -1,7 +1,7 @@
1
1
  @file:SuppressLint("MissingPermission")
2
2
  @file:Suppress("unused", "EnumValuesSoftDeprecate", "UNCHECKED_CAST")
3
3
 
4
- package com.regula.plugin.documentreader
4
+ package com.regula.plugin.document.reader
5
5
 
6
6
  import android.annotation.SuppressLint
7
7
  import android.graphics.Bitmap
@@ -115,9 +115,9 @@ import com.regula.documentreader.api.results.rfid.Validity
115
115
  import com.regula.documentreader.api.results.rfid.Value
116
116
  import org.json.JSONArray
117
117
  import org.json.JSONObject
118
- import com.regula.plugin.documentreader.Convert.toBase64
119
- import com.regula.plugin.documentreader.Convert.toBitmap
120
- import com.regula.plugin.documentreader.Convert.toByteArray
118
+ import com.regula.plugin.document.reader.Convert.toBase64
119
+ import com.regula.plugin.document.reader.Convert.toBitmap
120
+ import com.regula.plugin.document.reader.Convert.toByteArray
121
121
 
122
122
  fun generateCompletion(action: Int, results: DocumentReaderResults?, error: RegulaException?) = mapOf(
123
123
  "action" to action,
@@ -1,7 +1,7 @@
1
1
  @file:SuppressLint("MissingPermission")
2
2
  @file:Suppress("EnumValuesSoftDeprecate")
3
3
 
4
- package com.regula.plugin.documentreader
4
+ package com.regula.plugin.document.reader
5
5
 
6
6
  import android.annotation.SuppressLint
7
7
  import android.app.PendingIntent
@@ -47,8 +47,8 @@ import com.regula.documentreader.api.results.DocumentReaderResults.fromRawResult
47
47
  import com.regula.documentreader.api.results.DocumentReaderScenario
48
48
  import org.json.JSONArray
49
49
  import org.json.JSONObject
50
- import com.regula.plugin.documentreader.Convert.toBase64
51
- import com.regula.plugin.documentreader.Convert.toByteArray
50
+ import com.regula.plugin.document.reader.Convert.toBase64
51
+ import com.regula.plugin.document.reader.Convert.toByteArray
52
52
 
53
53
  fun methodCall(method: String, callback: (Any?) -> Unit): Any = when (method) {
54
54
  "getDocumentReaderIsReady" -> getDocumentReaderIsReady(callback)
@@ -1,6 +1,6 @@
1
1
  @file:Suppress("unused", "UNUSED_PARAMETER")
2
2
 
3
- package com.regula.plugin.documentreader
3
+ package com.regula.plugin.document.reader
4
4
 
5
5
  import android.app.Activity
6
6
  import android.content.Context
@@ -91,8 +91,9 @@ class RNDocumentReaderModule(reactContext: ReactApplicationContext) : ReactConte
91
91
  args = JSONArray(arguments.toArrayList())
92
92
  try {
93
93
  methodCall(method) { data -> promise.resolve(data.toSendable()) }
94
- } catch (error: Exception) {
95
- Log.e("REGULA", "Caught exception in \"$method\" function:", error)
94
+ } catch (error: Throwable) {
95
+ Log.e("REGULA", "Caught an exception in \"$method\" function:", error)
96
+ promise.reject(Throwable("Unexpected error, check logs for details"))
96
97
  }
97
98
  }
98
99
 
@@ -1,6 +1,6 @@
1
1
  @file:SuppressLint("UseKtx")
2
2
 
3
- package com.regula.plugin.documentreader
3
+ package com.regula.plugin.document.reader
4
4
 
5
5
  import android.annotation.SuppressLint
6
6
  import android.graphics.Bitmap
package/app.plugin.js CHANGED
@@ -1,12 +1,15 @@
1
- const { createRequire } = require('module'); // passing vulnerability checks
2
- const { withPodfile } = createRequire(process.cwd() + '/package.json')('@expo/config-plugins');
1
+ module.exports = function withRegulaPodSources(config) {
2
+ const { createRequire } = require('module');
3
+ const { join } = require('path');
4
+ const projectRoot = config._internal?.projectRoot ?? process.cwd();
5
+ const appRequire = createRequire(join(projectRoot, 'package.json'));
6
+ const { withPodfile } = appRequire('expo/config-plugins');
3
7
 
4
- const SOURCES = [
5
- 'https://github.com/CocoaPods/Specs.git',
6
- 'https://github.com/regulaforensics/podspecs.git',
7
- ];
8
+ const SOURCES = [
9
+ 'https://github.com/CocoaPods/Specs.git',
10
+ 'https://github.com/regulaforensics/podspecs.git',
11
+ ];
8
12
 
9
- module.exports = function withRegulaPodSources(config) {
10
13
  return withPodfile(config, (config) => {
11
14
  let podfile = config.modResults.contents;
12
15
 
@@ -1,5 +1,7 @@
1
1
  # Regula Document Reader Capacitor demo application
2
2
 
3
+ Requires Node.js 22+, Xcode 26+, Android Studio with JDK 21+ and Android SDK 37.
4
+
3
5
  ## How to build demo application
4
6
  1. Download or the clone current repository using the command `git clone https://github.com/regulaforensics/npm-document-reader.git`.
5
7
  2. Put `regula.license` file at `public/assets/` (you can get a trial license [here](https://client.regulaforensics.com)).
@@ -18,7 +18,7 @@ android {
18
18
  buildTypes {
19
19
  release {
20
20
  minifyEnabled false
21
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22
22
  }
23
23
  }
24
24
  }
@@ -39,12 +39,3 @@ dependencies {
39
39
  }
40
40
 
41
41
  apply from: 'capacitor.build.gradle'
42
-
43
- try {
44
- def servicesJSON = file('google-services.json')
45
- if (servicesJSON.text) {
46
- apply plugin: 'com.google.gms.google-services'
47
- }
48
- } catch(Exception e) {
49
- logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
50
- }
@@ -19,6 +19,15 @@
19
19
  <category android:name="android.intent.category.LAUNCHER" />
20
20
  </intent-filter>
21
21
  </activity>
22
+ <provider
23
+ android:name="androidx.core.content.FileProvider"
24
+ android:authorities="${applicationId}.fileprovider"
25
+ android:exported="false"
26
+ android:grantUriPermissions="true">
27
+ <meta-data
28
+ android:name="android.support.FILE_PROVIDER_PATHS"
29
+ android:resource="@xml/file_paths" />
30
+ </provider>
22
31
  </application>
23
32
 
24
33
  <uses-permission android:name="android.permission.NFC" />
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <paths xmlns:android="http://schemas.android.com/apk/res/android">
3
+ <external-files-path name="images" path="Pictures/" />
4
+ <cache-path name="cache_images" path="." />
5
+ </paths>
@@ -7,9 +7,8 @@ buildscript {
7
7
  mavenCentral()
8
8
  }
9
9
  dependencies {
10
- classpath 'com.android.tools.build:gradle:8.13.0'
11
- classpath 'com.google.gms:google-services:4.4.4'
12
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.20"
10
+ classpath 'com.android.tools.build:gradle:9.4.0'
11
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.4.20"
13
12
 
14
13
  // NOTE: Do not place your application dependencies here; they belong
15
14
  // in the individual module build.gradle files
@@ -28,3 +27,13 @@ allprojects {
28
27
  task clean(type: Delete) {
29
28
  delete rootProject.buildDir
30
29
  }
30
+
31
+ // Use the JDK running Gradle, while keeping Capacitor's Java 21 bytecode target.
32
+ subprojects {
33
+ afterEvaluate {
34
+ if (plugins.hasPlugin('org.jetbrains.kotlin.android')) {
35
+ kotlin.jvmToolchain(JavaVersion.current().majorVersion.toInteger())
36
+ kotlin.compilerOptions.jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_21)
37
+ }
38
+ }
39
+ }
@@ -1,6 +1,6 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
4
4
  networkTimeout=10000
5
5
  validateDistributionUrl=true
6
6
  zipStoreBase=GRADLE_USER_HOME
@@ -20,3 +20,7 @@ org.gradle.jvmargs=-Xmx1536m
20
20
  # Android operating system, and which are packaged with your app's APK
21
21
  # https://developer.android.com/topic/libraries/support-library/androidx-rn
22
22
  android.useAndroidX=true
23
+
24
+ # Required by Capacitor and its generated Cordova plugin module on AGP 9.
25
+ android.newDsl=false
26
+ android.builtInKotlin=false
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  #
4
- # Copyright © 2015-2021 the original authors.
4
+ # Copyright © 2015 the original authors.
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
20
20
 
21
21
  ##############################################################################
22
22
  #
23
- # Gradle start up script for POSIX generated by Gradle.
23
+ # gradlew start up script for POSIX generated by Gradle.
24
24
  #
25
25
  # Important for running:
26
26
  #
@@ -29,7 +29,7 @@
29
29
  # bash, then to run this script, type that shell name before the whole
30
30
  # command line, like:
31
31
  #
32
- # ksh Gradle
32
+ # ksh gradlew
33
33
  #
34
34
  # Busybox and similar reduced shells will NOT work, because this script
35
35
  # requires all of these POSIX shell features:
@@ -57,7 +57,7 @@
57
57
  # Darwin, MinGW, and NonStop.
58
58
  #
59
59
  # (3) This script is generated from the Groovy template
60
- # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60
+ # https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
61
61
  # within the Gradle project.
62
62
  #
63
63
  # You can find Gradle at https://github.com/gradle/gradle/.
@@ -114,7 +114,6 @@ case "$( uname )" in #(
114
114
  NONSTOP* ) nonstop=true ;;
115
115
  esac
116
116
 
117
- CLASSPATH="\\\"\\\""
118
117
 
119
118
 
120
119
  # Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@ fi
172
171
  # For Cygwin or MSYS, switch paths to Windows format before running java
173
172
  if "$cygwin" || "$msys" ; then
174
173
  APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
176
174
 
177
175
  JAVACMD=$( cygpath --unix "$JAVACMD" )
178
176
 
@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
212
210
 
213
211
  set -- \
214
212
  "-Dorg.gradle.appname=$APP_BASE_NAME" \
215
- -classpath "$CLASSPATH" \
216
213
  -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217
214
  "$@"
218
215
 
@@ -19,12 +19,12 @@
19
19
  @if "%DEBUG%"=="" @echo off
20
20
  @rem ##########################################################################
21
21
  @rem
22
- @rem Gradle startup script for Windows
22
+ @rem gradlew startup script for Windows
23
23
  @rem
24
24
  @rem ##########################################################################
25
25
 
26
- @rem Set local scope for the variables with windows NT shell
27
- if "%OS%"=="Windows_NT" setlocal
26
+ @rem Set local scope for the variables, and ensure extensions are enabled
27
+ setlocal EnableExtensions
28
28
 
29
29
  set DIRNAME=%~dp0
30
30
  if "%DIRNAME%"=="" set DIRNAME=.
@@ -51,7 +51,7 @@ echo. 1>&2
51
51
  echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52
52
  echo location of your Java installation. 1>&2
53
53
 
54
- goto fail
54
+ "%COMSPEC%" /c exit 1
55
55
 
56
56
  :findJavaFromJavaHome
57
57
  set JAVA_HOME=%JAVA_HOME:"=%
@@ -65,30 +65,18 @@ echo. 1>&2
65
65
  echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66
66
  echo location of your Java installation. 1>&2
67
67
 
68
- goto fail
68
+ "%COMSPEC%" /c exit 1
69
69
 
70
70
  :execute
71
71
  @rem Setup the command line
72
72
 
73
- set CLASSPATH=
74
73
 
75
74
 
76
- @rem Execute Gradle
77
- "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
75
+ @rem Execute gradlew
76
+ @rem endlocal doesn't take effect until after the line is parsed and variables are expanded
77
+ @rem which allows us to clear the local environment before executing the java command
78
+ endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
78
79
 
79
- :end
80
- @rem End local scope for the variables with windows NT shell
81
- if %ERRORLEVEL% equ 0 goto mainEnd
82
-
83
- :fail
84
- rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
85
- rem the _cmd.exe /c_ return code!
86
- set EXIT_CODE=%ERRORLEVEL%
87
- if %EXIT_CODE% equ 0 set EXIT_CODE=1
88
- if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
89
- exit /b %EXIT_CODE%
90
-
91
- :mainEnd
92
- if "%OS%"=="Windows_NT" endlocal
93
-
94
- :omega
80
+ :exitWithErrorLevel
81
+ @rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
82
+ "%COMSPEC%" /c exit %ERRORLEVEL%
@@ -1,16 +1,20 @@
1
1
  ext {
2
+ kotlin_version = '2.4.20'
3
+ androidxCoreKTXVersion = '1.19.0'
4
+ androidxExifInterfaceVersion = '1.4.2'
5
+ androidxMaterialVersion = '1.14.0'
2
6
  minSdkVersion = 26
3
- compileSdkVersion = 36
4
- targetSdkVersion = 36
5
- androidxActivityVersion = '1.11.0'
6
- androidxAppCompatVersion = '1.7.1'
7
+ compileSdkVersion = 37
8
+ targetSdkVersion = 37
9
+ androidxActivityVersion = '1.13.0'
10
+ androidxAppCompatVersion = '1.8.0'
7
11
  androidxCoordinatorLayoutVersion = '1.3.0'
8
- androidxCoreVersion = '1.17.0'
9
- androidxFragmentVersion = '1.8.9'
12
+ androidxCoreVersion = '1.19.0'
13
+ androidxFragmentVersion = '1.9.0'
10
14
  coreSplashScreenVersion = '1.2.0'
11
- androidxWebkitVersion = '1.14.0'
15
+ androidxWebkitVersion = '1.17.0'
12
16
  junitVersion = '4.13.2'
13
17
  androidxJunitVersion = '1.3.0'
14
18
  androidxEspressoCoreVersion = '3.7.0'
15
- cordovaAndroidVersion = '14.0.1'
16
- }
19
+ cordovaAndroidVersion = '15.1.0'
20
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "appId": "com.regula.example.dr.capacitor",
3
+ "appName": "Document",
4
+ "webDir": "www",
5
+ "cordova": {
6
+ "preferences": {
7
+ "GradlePluginKotlinVersion": "2.4.20"
8
+ }
9
+ },
10
+ "plugins": {
11
+ "SystemBars": {
12
+ "insetsHandling": "disable"
13
+ }
14
+ }
15
+ }
@@ -1,39 +1,31 @@
1
- import '@ionic/react/css/core.css'
2
1
  import '/src/main.css'
3
- import { setupIonicReact } from '@ionic/react'
4
- import { StatusBar, Style } from '@capacitor/status-bar'
5
- import { File } from '@awesome-cordova-plugins/file'
6
- import { Camera, DestinationType, MediaType, PictureSourceType } from '@awesome-cordova-plugins/camera'
2
+ import mainHtml from './src/main.html?raw'
3
+ import { Camera, CameraResultType, CameraSource } from '@capacitor/camera'
7
4
  import { main } from './src/main'
8
5
 
9
6
  document.addEventListener('deviceready', async () => {
10
- document.getElementById("content").innerHTML = await fetch("main.html").then(r => r.text())
7
+ document.getElementById("content").innerHTML = mainHtml
11
8
  await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))
12
9
  document.dispatchEvent(new Event('ready'))
13
10
  })
14
11
 
15
12
  export async function loadAsset(path: string): Promise<string> {
16
- var dir = await File.resolveDirectoryUrl(File.applicationDirectory + "public/assets")
17
- var fileEntry = await File.getFile(dir, path, {})
18
- var result = await new Promise<string>((resolve, _) => {
19
- fileEntry.file(file => {
20
- var reader = new FileReader()
21
- reader.onloadend = (_) => resolve(reader.result as string)
22
- reader.readAsDataURL(file)
23
- })
13
+ var response = await fetch(`assets/${path}`)
14
+ if (!response.ok) throw new Error(`Failed to load ${path}: ${response.status}`)
15
+ var blob = await response.blob()
16
+ return new Promise((resolve, reject) => {
17
+ var reader = new FileReader()
18
+ reader.onload = () => resolve(reader.result as string)
19
+ reader.onerror = () => reject(reader.error)
20
+ reader.readAsDataURL(blob)
24
21
  })
25
- return result
26
22
  }
27
23
 
28
24
  export async function pickImage(): Promise<string | null> {
29
- return await Camera.getPicture({
30
- destinationType: DestinationType.DATA_URL,
31
- mediaType: MediaType.PICTURE,
32
- sourceType: PictureSourceType.PHOTOLIBRARY
33
- })
25
+ return (await Camera.getPhoto({
26
+ resultType: CameraResultType.Base64,
27
+ source: CameraSource.Photos
28
+ })).base64String ?? null
34
29
  }
35
30
 
36
31
  document.addEventListener('ready', main)
37
-
38
- setupIonicReact()
39
- StatusBar.setStyle({ style: Style.Light })
@@ -1,49 +1,14 @@
1
1
  import UIKit
2
- import Capacitor
3
2
 
4
- @UIApplicationMain
3
+ @main
5
4
  class AppDelegate: UIResponder, UIApplicationDelegate {
6
-
7
- var window: UIWindow?
8
-
9
5
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
10
- // Override point for customization after application launch.
11
6
  return true
12
7
  }
13
8
 
14
- func applicationWillResignActive(_ application: UIApplication) {
15
- // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
16
- // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
17
- }
18
-
19
- func applicationDidEnterBackground(_ application: UIApplication) {
20
- // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
21
- // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
22
- }
23
-
24
- func applicationWillEnterForeground(_ application: UIApplication) {
25
- // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
26
- }
27
-
28
- func applicationDidBecomeActive(_ application: UIApplication) {
29
- // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
9
+ func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
10
+ let configuration = UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
11
+ configuration.delegateClass = SceneDelegate.self
12
+ return configuration
30
13
  }
31
-
32
- func applicationWillTerminate(_ application: UIApplication) {
33
- // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
34
- }
35
-
36
- func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
37
- // Called when the app was launched with a url. Feel free to add additional processing here,
38
- // but if you want the App API to support tracking app url opens, make sure to keep this call
39
- return ApplicationDelegateProxy.shared.application(app, open: url, options: options)
40
- }
41
-
42
- func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
43
- // Called when the app was launched with an activity, including Universal Links.
44
- // Feel free to add additional processing here, but if you want the App API to support
45
- // tracking app url opens, make sure to keep this call
46
- return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler)
47
- }
48
-
49
14
  }