@regulaforensics/document-reader 9.9.1155-beta → 9.9.1162-rc

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/README.md +1 -3
  2. package/RNDocumentReader.podspec +21 -0
  3. package/android/CVDDocumentReader.kt +3 -4
  4. package/android/build.gradle +36 -0
  5. package/android/cordova.gradle +12 -0
  6. package/android/src/main/kotlin/com/regula/plugin/{document/reader → documentreader}/BluetoothUtil.kt +1 -1
  7. package/android/src/main/kotlin/com/regula/plugin/{document/reader → documentreader}/Config.kt +3 -3
  8. package/android/src/main/kotlin/com/regula/plugin/{document/reader → documentreader}/JSONConstructor.kt +4 -4
  9. package/android/src/main/kotlin/com/regula/plugin/{document/reader → documentreader}/Main.kt +3 -3
  10. package/android/src/main/kotlin/com/regula/plugin/{document/reader → documentreader}/RNDocumentReaderModule.kt +3 -4
  11. package/android/src/main/kotlin/com/regula/plugin/{document/reader → documentreader}/Utils.kt +1 -1
  12. package/app.plugin.js +7 -10
  13. package/examples/capacitor/README.md +0 -2
  14. package/examples/capacitor/android/app/build.gradle +10 -1
  15. package/examples/capacitor/android/app/src/main/AndroidManifest.xml +0 -9
  16. package/examples/capacitor/android/build.gradle +3 -12
  17. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  18. package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  19. package/examples/capacitor/android/gradle.properties +0 -4
  20. package/examples/capacitor/android/gradlew +7 -4
  21. package/examples/capacitor/android/gradlew.bat +24 -12
  22. package/examples/capacitor/android/variables.gradle +9 -13
  23. package/examples/capacitor/index.tsx +23 -15
  24. package/examples/capacitor/ios/App/App/AppDelegate.swift +40 -5
  25. package/examples/capacitor/ios/App/App/Info.plist +2 -19
  26. package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +86 -30
  27. package/examples/capacitor/package.json +18 -13
  28. package/examples/capacitor/scripts/android.sh +8 -5
  29. package/examples/capacitor/scripts/ios.sh +7 -5
  30. package/examples/capacitor/scripts/setup.sh +7 -2
  31. package/examples/capacitor/src/main.css +0 -5
  32. package/examples/capacitor/vite.config.ts +12 -0
  33. package/examples/ionic/README.md +0 -2
  34. package/examples/ionic/config.xml +1 -1
  35. package/examples/ionic/index.tsx +3 -8
  36. package/examples/ionic/package-lock.json +7536 -6029
  37. package/examples/ionic/package.json +33 -24
  38. package/examples/ionic/scripts/android.sh +2 -0
  39. package/examples/ionic/scripts/ios.sh +2 -0
  40. package/examples/ionic/scripts/setup.sh +2 -0
  41. package/examples/ionic/tsconfig.json +1 -0
  42. package/examples/react_native/README.md +0 -2
  43. package/examples/react_native/app.config.ts +2 -1
  44. package/examples/react_native/package-lock.json +4015 -2002
  45. package/examples/react_native/package.json +19 -14
  46. package/examples/react_native/scripts/android.sh +3 -3
  47. package/examples/react_native/scripts/ios.sh +3 -3
  48. package/examples/react_native/scripts/setup.sh +3 -4
  49. package/examples/react_native/vendor/image-size-metro-compat/index.cjs +16 -0
  50. package/examples/react_native/vendor/image-size-metro-compat/package.json +8 -0
  51. package/package.json +1 -1
  52. package/plugin.xml +12 -12
  53. package/test/package-lock.json +1 -1
  54. package/Package.swift +0 -28
  55. package/android/build.gradle.kts +0 -37
  56. package/android/cordova.gradle.kts +0 -13
  57. package/examples/capacitor/android/app/src/main/res/xml/file_paths.xml +0 -5
  58. package/examples/capacitor/capacitor.config.json +0 -15
  59. package/examples/capacitor/ios/App/App/SceneDelegate.swift +0 -23
  60. package/examples/capacitor/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift +0 -1
  61. package/examples/capacitor-cocoapods/README.md +0 -22
  62. package/examples/capacitor-cocoapods/android/app/build.gradle +0 -50
  63. package/examples/capacitor-cocoapods/android/app/proguard-rules.pro +0 -21
  64. package/examples/capacitor-cocoapods/android/app/src/main/AndroidManifest.xml +0 -27
  65. package/examples/capacitor-cocoapods/android/app/src/main/assets/Regula/.gitkeep +0 -0
  66. package/examples/capacitor-cocoapods/android/app/src/main/java/com/regula/example/dr/capacitor/MainActivity.java +0 -5
  67. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/ic_launcher.png +0 -0
  68. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/ic_launcher_foreground.png +0 -0
  69. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/ic_launcher_round.png +0 -0
  70. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/launcher.xml +0 -4
  71. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/launcher_round.xml +0 -4
  72. package/examples/capacitor-cocoapods/android/app/src/main/res/drawable/splash.png +0 -0
  73. package/examples/capacitor-cocoapods/android/app/src/main/res/layout/activity_main.xml +0 -12
  74. package/examples/capacitor-cocoapods/android/app/src/main/res/values/styles.xml +0 -22
  75. package/examples/capacitor-cocoapods/android/build.gradle +0 -30
  76. package/examples/capacitor-cocoapods/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  77. package/examples/capacitor-cocoapods/android/gradle/wrapper/gradle-wrapper.properties +0 -7
  78. package/examples/capacitor-cocoapods/android/gradle.properties +0 -22
  79. package/examples/capacitor-cocoapods/android/gradlew +0 -251
  80. package/examples/capacitor-cocoapods/android/gradlew.bat +0 -94
  81. package/examples/capacitor-cocoapods/android/settings.gradle +0 -5
  82. package/examples/capacitor-cocoapods/android/variables.gradle +0 -16
  83. package/examples/capacitor-cocoapods/index.html +0 -5
  84. package/examples/capacitor-cocoapods/index.tsx +0 -39
  85. package/examples/capacitor-cocoapods/ios/App/App/App.entitlements +0 -10
  86. package/examples/capacitor-cocoapods/ios/App/App/AppDelegate.swift +0 -49
  87. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
  88. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -14
  89. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/Contents.json +0 -6
  90. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +0 -23
  91. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
  92. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
  93. package/examples/capacitor-cocoapods/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
  94. package/examples/capacitor-cocoapods/ios/App/App/Base.lproj/LaunchScreen.storyboard +0 -32
  95. package/examples/capacitor-cocoapods/ios/App/App/Info.plist +0 -69
  96. package/examples/capacitor-cocoapods/ios/App/App.xcodeproj/project.pbxproj +0 -430
  97. package/examples/capacitor-cocoapods/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  98. package/examples/capacitor-cocoapods/package.json +0 -30
  99. package/examples/capacitor-cocoapods/public/assets/.gitkeep +0 -0
  100. package/examples/capacitor-cocoapods/public/images/document.png +0 -0
  101. package/examples/capacitor-cocoapods/public/images/portrait.png +0 -0
  102. package/examples/capacitor-cocoapods/scripts/android.sh +0 -11
  103. package/examples/capacitor-cocoapods/scripts/ios.sh +0 -10
  104. package/examples/capacitor-cocoapods/scripts/setup.sh +0 -14
  105. package/examples/capacitor-cocoapods/src/extra/bt_device.tsx +0 -33
  106. package/examples/capacitor-cocoapods/src/extra/custom_rfid.tsx +0 -61
  107. package/examples/capacitor-cocoapods/src/main.css +0 -148
  108. package/examples/capacitor-cocoapods/src/main.html +0 -38
  109. package/examples/capacitor-cocoapods/src/main.tsx +0 -172
  110. package/examples/capacitor-cocoapods/tsconfig.json +0 -5
  111. package/examples/capacitor-cocoapods/vite.config.ts +0 -17
  112. package/examples/ionic-cocoapods/README.md +0 -22
  113. package/examples/ionic-cocoapods/angular.json +0 -39
  114. package/examples/ionic-cocoapods/assets/.gitkeep +0 -0
  115. package/examples/ionic-cocoapods/config.xml +0 -63
  116. package/examples/ionic-cocoapods/images/document.png +0 -0
  117. package/examples/ionic-cocoapods/images/icon.png +0 -0
  118. package/examples/ionic-cocoapods/images/portrait.png +0 -0
  119. package/examples/ionic-cocoapods/index.html +0 -19
  120. package/examples/ionic-cocoapods/index.tsx +0 -58
  121. package/examples/ionic-cocoapods/ionic.config.json +0 -7
  122. package/examples/ionic-cocoapods/package-lock.json +0 -16579
  123. package/examples/ionic-cocoapods/package.json +0 -58
  124. package/examples/ionic-cocoapods/scripts/android.sh +0 -8
  125. package/examples/ionic-cocoapods/scripts/ios.sh +0 -8
  126. package/examples/ionic-cocoapods/scripts/setup.sh +0 -8
  127. package/examples/ionic-cocoapods/src/extra/bt_device.tsx +0 -33
  128. package/examples/ionic-cocoapods/src/extra/custom_rfid.tsx +0 -61
  129. package/examples/ionic-cocoapods/src/main.css +0 -148
  130. package/examples/ionic-cocoapods/src/main.html +0 -38
  131. package/examples/ionic-cocoapods/src/main.tsx +0 -172
  132. package/examples/ionic-cocoapods/tsconfig.json +0 -14
  133. package/ios/module.modulemap +0 -7
  134. package/react-native-document-reader.podspec +0 -14
  135. /package/examples/{capacitor-cocoapods → capacitor}/android/app/capacitor.build.gradle +0 -0
  136. /package/examples/{capacitor-cocoapods → capacitor}/android/capacitor.settings.gradle +0 -0
  137. /package/examples/{capacitor-cocoapods → capacitor}/ionic.config.json +0 -0
  138. /package/examples/{capacitor-cocoapods → capacitor}/ios/App/App/Base.lproj/Main.storyboard +0 -0
  139. /package/examples/{capacitor-cocoapods → capacitor}/ios/App/App.xcworkspace/contents.xcworkspacedata +0 -0
  140. /package/examples/{capacitor-cocoapods → capacitor}/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -0
  141. /package/examples/{capacitor-cocoapods → capacitor}/ios/App/Podfile +0 -0
  142. /package/examples/{capacitor-cocoapods → capacitor}/ios/App/Podfile.lock +0 -0
  143. /package/examples/{capacitor-cocoapods → capacitor}/package-lock.json +0 -0
package/README.md CHANGED
@@ -1,13 +1,11 @@
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
-
6
4
  ## Demo applications
7
5
  In the [examples](examples/) folder you can find 3 demo applications:
8
6
  * [React-native](examples/react_native)
9
- * [Capacitor](examples/capacitor)
10
7
  * [Ionic(ionic app with cordova, angular)](examples/ionic)
8
+ * [Capacitor(ionic app with capacitor, react)](examples/capacitor)
11
9
 
12
10
  Each demo app has its own readme file with instructions on building and installation.
13
11
 
@@ -0,0 +1,21 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+ source = File.join(__dir__, 'ios')
5
+
6
+ Pod::Spec.new do |s|
7
+ s.name = 'RNDocumentReader'
8
+ s.version = '9.9.1162-rc'
9
+ s.summary = package['description']
10
+ s.license = package['license']
11
+
12
+ s.authors = { 'RegulaForensics' => 'support@regulaforensics.com' }
13
+ s.homepage = 'https://regulaforensics.com'
14
+
15
+ s.source = { http: "file:#{source}" }
16
+ s.ios.deployment_target = '13.0'
17
+ s.source_files = 'ios/**/*.{h,m}'
18
+ s.exclude_files = [ 'ios/CVDDocumentReader.h', 'ios/CVDDocumentReader.m' ]
19
+ s.dependency 'DocumentReaderStage', '9.9.7050'
20
+ s.dependency 'React'
21
+ end
@@ -1,4 +1,4 @@
1
- package com.regula.plugin.document.reader
1
+ package com.regula.plugin.documentreader
2
2
 
3
3
  import android.app.Activity
4
4
  import android.content.Context
@@ -66,9 +66,8 @@ 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: Throwable) {
70
- Log.e("REGULA", "Caught an exception in \"$method\" function:", error)
71
- sendEvent(callbackContext.callbackId, "Unexpected error, check logs for details")
69
+ } catch (error: Exception) {
70
+ Log.e("REGULA", "Caught exception in \"$method\" function:", error)
72
71
  }
73
72
  return true
74
73
  }
@@ -0,0 +1,36 @@
1
+ apply plugin: 'com.android.library'
2
+ apply plugin: 'kotlin-android'
3
+
4
+ android {
5
+ // Conditional for compatibility with AGP <4.2.
6
+ if (project.android.hasProperty("namespace")) {
7
+ namespace 'com.regula.plugin.documentreader'
8
+ }
9
+
10
+ compileSdk 36
11
+
12
+ defaultConfig {
13
+ minSdkVersion 24
14
+ targetSdk 36
15
+ versionCode 1
16
+ versionName "1.0"
17
+ }
18
+ }
19
+
20
+ rootProject.allprojects {
21
+ repositories {
22
+ maven {
23
+ url "https://maven.regulaforensics.com/RegulaDocumentReader/Stage"
24
+ }
25
+ }
26
+ }
27
+
28
+ dependencies {
29
+ //noinspection GradleDynamicVersion
30
+ implementation 'com.facebook.react:react-native:+'
31
+ //noinspection GradleDependency
32
+ implementation('com.regula.documentreader:api:9.9.13436'){
33
+ transitive = true
34
+ }
35
+ }
36
+
@@ -0,0 +1,12 @@
1
+ repositories {
2
+ maven {
3
+ url "https://maven.regulaforensics.com/RegulaDocumentReader/Stage"
4
+ }
5
+ }
6
+
7
+ dependencies {
8
+ //noinspection GradleDependency
9
+ implementation('com.regula.documentreader:api:9.9.13436'){
10
+ transitive = true
11
+ }
12
+ }
@@ -1,4 +1,4 @@
1
- package com.regula.plugin.document.reader
1
+ package com.regula.plugin.documentreader
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.document.reader
3
+ package com.regula.plugin.documentreader
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.document.reader.Convert.toBase64
31
- import com.regula.plugin.document.reader.Convert.toDrawable
30
+ import com.regula.plugin.documentreader.Convert.toBase64
31
+ import com.regula.plugin.documentreader.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.document.reader
4
+ package com.regula.plugin.documentreader
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.document.reader.Convert.toBase64
119
- import com.regula.plugin.document.reader.Convert.toBitmap
120
- import com.regula.plugin.document.reader.Convert.toByteArray
118
+ import com.regula.plugin.documentreader.Convert.toBase64
119
+ import com.regula.plugin.documentreader.Convert.toBitmap
120
+ import com.regula.plugin.documentreader.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.document.reader
4
+ package com.regula.plugin.documentreader
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.document.reader.Convert.toBase64
51
- import com.regula.plugin.document.reader.Convert.toByteArray
50
+ import com.regula.plugin.documentreader.Convert.toBase64
51
+ import com.regula.plugin.documentreader.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.document.reader
3
+ package com.regula.plugin.documentreader
4
4
 
5
5
  import android.app.Activity
6
6
  import android.content.Context
@@ -91,9 +91,8 @@ 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: Throwable) {
95
- Log.e("REGULA", "Caught an exception in \"$method\" function:", error)
96
- promise.reject(Throwable("Unexpected error, check logs for details"))
94
+ } catch (error: Exception) {
95
+ Log.e("REGULA", "Caught exception in \"$method\" function:", error)
97
96
  }
98
97
  }
99
98
 
@@ -1,6 +1,6 @@
1
1
  @file:SuppressLint("UseKtx")
2
2
 
3
- package com.regula.plugin.document.reader
3
+ package com.regula.plugin.documentreader
4
4
 
5
5
  import android.annotation.SuppressLint
6
6
  import android.graphics.Bitmap
package/app.plugin.js CHANGED
@@ -1,15 +1,12 @@
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');
1
+ const { createRequire } = require('module'); // passing vulnerability checks
2
+ const { withPodfile } = createRequire(process.cwd() + '/package.json')('@expo/config-plugins');
7
3
 
8
- const SOURCES = [
9
- 'https://github.com/CocoaPods/Specs.git',
10
- 'https://github.com/regulaforensics/podspecs.git',
11
- ];
4
+ const SOURCES = [
5
+ 'https://github.com/CocoaPods/Specs.git',
6
+ 'https://github.com/regulaforensics/podspecs.git',
7
+ ];
12
8
 
9
+ module.exports = function withRegulaPodSources(config) {
13
10
  return withPodfile(config, (config) => {
14
11
  let podfile = config.modResults.contents;
15
12
 
@@ -1,7 +1,5 @@
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
-
5
3
  ## How to build demo application
6
4
  1. Download or the clone current repository using the command `git clone https://github.com/regulaforensics/npm-document-reader.git`.
7
5
  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-optimize.txt'), 'proguard-rules.pro'
21
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22
22
  }
23
23
  }
24
24
  }
@@ -39,3 +39,12 @@ 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,15 +19,6 @@
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>
31
22
  </application>
32
23
 
33
24
  <uses-permission android:name="android.permission.NFC" />
@@ -7,8 +7,9 @@ buildscript {
7
7
  mavenCentral()
8
8
  }
9
9
  dependencies {
10
- classpath 'com.android.tools.build:gradle:9.4.0'
11
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.4.20"
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"
12
13
 
13
14
  // NOTE: Do not place your application dependencies here; they belong
14
15
  // in the individual module build.gradle files
@@ -27,13 +28,3 @@ allprojects {
27
28
  task clean(type: Delete) {
28
29
  delete rootProject.buildDir
29
30
  }
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-9.7.1-bin.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
4
4
  networkTimeout=10000
5
5
  validateDistributionUrl=true
6
6
  zipStoreBase=GRADLE_USER_HOME
@@ -20,7 +20,3 @@ 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 the original authors.
4
+ # Copyright © 2015-2021 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
- # gradlew start up script for POSIX generated by Gradle.
23
+ # Gradle 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 gradlew
32
+ # ksh Gradle
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/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60
+ # https://github.com/gradle/gradle/blob/HEAD/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,6 +114,7 @@ case "$( uname )" in #(
114
114
  NONSTOP* ) nonstop=true ;;
115
115
  esac
116
116
 
117
+ CLASSPATH="\\\"\\\""
117
118
 
118
119
 
119
120
  # Determine the Java command to use to start the JVM.
@@ -171,6 +172,7 @@ fi
171
172
  # For Cygwin or MSYS, switch paths to Windows format before running java
172
173
  if "$cygwin" || "$msys" ; then
173
174
  APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
174
176
 
175
177
  JAVACMD=$( cygpath --unix "$JAVACMD" )
176
178
 
@@ -210,6 +212,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
210
212
 
211
213
  set -- \
212
214
  "-Dorg.gradle.appname=$APP_BASE_NAME" \
215
+ -classpath "$CLASSPATH" \
213
216
  -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
214
217
  "$@"
215
218
 
@@ -19,12 +19,12 @@
19
19
  @if "%DEBUG%"=="" @echo off
20
20
  @rem ##########################################################################
21
21
  @rem
22
- @rem gradlew startup script for Windows
22
+ @rem Gradle startup script for Windows
23
23
  @rem
24
24
  @rem ##########################################################################
25
25
 
26
- @rem Set local scope for the variables, and ensure extensions are enabled
27
- setlocal EnableExtensions
26
+ @rem Set local scope for the variables with windows NT shell
27
+ if "%OS%"=="Windows_NT" setlocal
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
- "%COMSPEC%" /c exit 1
54
+ goto fail
55
55
 
56
56
  :findJavaFromJavaHome
57
57
  set JAVA_HOME=%JAVA_HOME:"=%
@@ -65,18 +65,30 @@ 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
- "%COMSPEC%" /c exit 1
68
+ goto fail
69
69
 
70
70
  :execute
71
71
  @rem Setup the command line
72
72
 
73
+ set CLASSPATH=
73
74
 
74
75
 
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
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" %*
79
78
 
80
- :exitWithErrorLevel
81
- @rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
82
- "%COMSPEC%" /c exit %ERRORLEVEL%
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
@@ -1,20 +1,16 @@
1
1
  ext {
2
- kotlin_version = '2.4.20'
3
- androidxCoreKTXVersion = '1.19.0'
4
- androidxExifInterfaceVersion = '1.4.2'
5
- androidxMaterialVersion = '1.14.0'
6
2
  minSdkVersion = 26
7
- compileSdkVersion = 37
8
- targetSdkVersion = 37
9
- androidxActivityVersion = '1.13.0'
10
- androidxAppCompatVersion = '1.8.0'
3
+ compileSdkVersion = 36
4
+ targetSdkVersion = 36
5
+ androidxActivityVersion = '1.11.0'
6
+ androidxAppCompatVersion = '1.7.1'
11
7
  androidxCoordinatorLayoutVersion = '1.3.0'
12
- androidxCoreVersion = '1.19.0'
13
- androidxFragmentVersion = '1.9.0'
8
+ androidxCoreVersion = '1.17.0'
9
+ androidxFragmentVersion = '1.8.9'
14
10
  coreSplashScreenVersion = '1.2.0'
15
- androidxWebkitVersion = '1.17.0'
11
+ androidxWebkitVersion = '1.14.0'
16
12
  junitVersion = '4.13.2'
17
13
  androidxJunitVersion = '1.3.0'
18
14
  androidxEspressoCoreVersion = '3.7.0'
19
- cordovaAndroidVersion = '15.1.0'
20
- }
15
+ cordovaAndroidVersion = '14.0.1'
16
+ }
@@ -1,31 +1,39 @@
1
+ import '@ionic/react/css/core.css'
1
2
  import '/src/main.css'
2
- import mainHtml from './src/main.html?raw'
3
- import { Camera, CameraResultType, CameraSource } from '@capacitor/camera'
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'
4
7
  import { main } from './src/main'
5
8
 
6
9
  document.addEventListener('deviceready', async () => {
7
- document.getElementById("content").innerHTML = mainHtml
10
+ document.getElementById("content").innerHTML = await fetch("main.html").then(r => r.text())
8
11
  await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)))
9
12
  document.dispatchEvent(new Event('ready'))
10
13
  })
11
14
 
12
15
  export async function loadAsset(path: string): Promise<string> {
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)
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
+ })
21
24
  })
25
+ return result
22
26
  }
23
27
 
24
28
  export async function pickImage(): Promise<string | null> {
25
- return (await Camera.getPhoto({
26
- resultType: CameraResultType.Base64,
27
- source: CameraSource.Photos
28
- })).base64String ?? null
29
+ return await Camera.getPicture({
30
+ destinationType: DestinationType.DATA_URL,
31
+ mediaType: MediaType.PICTURE,
32
+ sourceType: PictureSourceType.PHOTOLIBRARY
33
+ })
29
34
  }
30
35
 
31
36
  document.addEventListener('ready', main)
37
+
38
+ setupIonicReact()
39
+ StatusBar.setStyle({ style: Style.Light })
@@ -1,14 +1,49 @@
1
1
  import UIKit
2
+ import Capacitor
2
3
 
3
- @main
4
+ @UIApplicationMain
4
5
  class AppDelegate: UIResponder, UIApplicationDelegate {
6
+
7
+ var window: UIWindow?
8
+
5
9
  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
10
+ // Override point for customization after application launch.
6
11
  return true
7
12
  }
8
13
 
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
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.
13
30
  }
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
+
14
49
  }
@@ -2,8 +2,6 @@
2
2
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
3
  <plist version="1.0">
4
4
  <dict>
5
- <key>CAPACITOR_DEBUG</key>
6
- <string>$(CAPACITOR_DEBUG)</string>
7
5
  <key>CFBundleDevelopmentRegion</key>
8
6
  <string>en</string>
9
7
  <key>CFBundleDisplayName</key>
@@ -39,23 +37,8 @@
39
37
  <string></string>
40
38
  <key>UILaunchStoryboardName</key>
41
39
  <string>LaunchScreen</string>
42
- <key>UIApplicationSceneManifest</key>
43
- <dict>
44
- <key>UIApplicationSupportsMultipleScenes</key>
45
- <false/>
46
- <key>UISceneConfigurations</key>
47
- <dict>
48
- <key>UIWindowSceneSessionRoleApplication</key>
49
- <array>
50
- <dict>
51
- <key>UISceneConfigurationName</key>
52
- <string>Default Configuration</string>
53
- <key>UISceneDelegateClassName</key>
54
- <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
55
- </dict>
56
- </array>
57
- </dict>
58
- </dict>
40
+ <key>UIMainStoryboardFile</key>
41
+ <string>Main</string>
59
42
  <key>UIRequiredDeviceCapabilities</key>
60
43
  <array>
61
44
  <string>armv7</string>