@regulaforensics/document-reader 9.9.1162-rc → 9.9.1166-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.
- package/Package.swift +28 -0
- package/README.md +3 -1
- package/android/CVDDocumentReader.kt +6 -4
- package/android/build.gradle.kts +37 -0
- package/android/cordova.gradle.kts +13 -0
- package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/BluetoothUtil.kt +1 -1
- package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/Config.kt +3 -3
- package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/JSONConstructor.kt +4 -4
- package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/Main.kt +3 -3
- package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/RNDocumentReaderModule.kt +4 -3
- package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/Utils.kt +1 -1
- package/app.plugin.js +10 -7
- package/examples/capacitor/README.md +2 -0
- package/examples/capacitor/android/app/build.gradle +1 -10
- package/examples/capacitor/android/app/src/main/AndroidManifest.xml +9 -0
- package/examples/capacitor/android/app/src/main/res/xml/file_paths.xml +5 -0
- package/examples/capacitor/android/build.gradle +12 -3
- package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/examples/capacitor/android/gradle.properties +4 -0
- package/examples/capacitor/android/gradlew +4 -7
- package/examples/capacitor/android/gradlew.bat +12 -24
- package/examples/capacitor/android/variables.gradle +13 -9
- package/examples/capacitor/capacitor.config.json +15 -0
- package/examples/capacitor/index.tsx +15 -23
- package/examples/capacitor/ios/App/App/AppDelegate.swift +5 -40
- package/examples/capacitor/ios/App/App/Info.plist +19 -2
- package/examples/capacitor/ios/App/App/SceneDelegate.swift +23 -0
- package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +30 -86
- package/examples/capacitor/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift +1 -0
- package/examples/capacitor/package-lock.json +1082 -1942
- package/examples/capacitor/package.json +13 -18
- package/examples/capacitor/scripts/android.sh +5 -8
- package/examples/capacitor/scripts/ios.sh +5 -7
- package/examples/capacitor/scripts/setup.sh +2 -7
- package/examples/capacitor/src/main.css +5 -0
- package/examples/capacitor/vite.config.ts +0 -12
- package/examples/ionic/README.md +2 -0
- package/examples/ionic/config.xml +1 -1
- package/examples/ionic/index.tsx +8 -3
- package/examples/ionic/package-lock.json +8982 -11455
- package/examples/ionic/package.json +24 -33
- package/examples/ionic/scripts/android.sh +0 -2
- package/examples/ionic/scripts/ios.sh +0 -2
- package/examples/ionic/scripts/setup.sh +0 -2
- package/examples/ionic/tsconfig.json +0 -1
- package/examples/react_native/README.md +2 -0
- package/examples/react_native/app.config.ts +1 -2
- package/examples/react_native/package-lock.json +1994 -3893
- package/examples/react_native/package.json +19 -21
- package/examples/react_native/scripts/android.sh +8 -6
- package/examples/react_native/scripts/ios.sh +7 -5
- package/examples/react_native/scripts/setup.sh +7 -3
- package/ios/spm/module.modulemap +7 -0
- package/package.json +1 -1
- package/plugin.xml +12 -12
- package/react-native-document-reader.podspec +14 -0
- package/test/package-lock.json +1 -1
- package/www/capacitor/internal/cordova.js +2 -2
- package/www/cordova.js +2 -2
- package/RNDocumentReader.podspec +0 -21
- package/android/build.gradle +0 -36
- package/android/cordova.gradle +0 -12
- package/examples/capacitor/android/app/capacitor.build.gradle +0 -20
- package/examples/capacitor/android/capacitor.settings.gradle +0 -9
- package/examples/capacitor/ionic.config.json +0 -7
- package/examples/capacitor/ios/App/App/Base.lproj/Main.storyboard +0 -19
- package/examples/capacitor/ios/App/App.xcworkspace/contents.xcworkspacedata +0 -10
- package/examples/capacitor/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/examples/capacitor/ios/App/Podfile +0 -30
- package/examples/capacitor/ios/App/Podfile.lock +0 -52
- package/examples/react_native/vendor/image-size-metro-compat/index.cjs +0 -16
- package/examples/react_native/vendor/image-size-metro-compat/package.json +0 -8
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: "spm"
|
|
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.
|
|
1
|
+
package com.regula.plugin.document.reader
|
|
2
2
|
|
|
3
3
|
import android.app.Activity
|
|
4
4
|
import android.content.Context
|
|
@@ -26,9 +26,10 @@ fun sendEvent(callbackId: String, data: Any? = "") {
|
|
|
26
26
|
val pluginResult = when (data) {
|
|
27
27
|
is Int -> PluginResult(PluginResult.Status.OK, data)
|
|
28
28
|
is Boolean -> PluginResult(PluginResult.Status.OK, data)
|
|
29
|
+
is Throwable -> PluginResult(PluginResult.Status.ERROR, data.message)
|
|
29
30
|
else -> PluginResult(PluginResult.Status.OK, data.toSendable() as String?)
|
|
30
31
|
}
|
|
31
|
-
pluginResult.keepCallback =
|
|
32
|
+
pluginResult.keepCallback = data !is Throwable
|
|
32
33
|
binding.webView.sendPluginResult(pluginResult, eventCallbackIds[callbackId] ?: callbackId)
|
|
33
34
|
}
|
|
34
35
|
|
|
@@ -66,8 +67,9 @@ class CVDDocumentReader : CordovaPlugin() {
|
|
|
66
67
|
if (method == "setEvent") eventCallbackIds[args(0)] = callbackContext.callbackId
|
|
67
68
|
try {
|
|
68
69
|
methodCall(method) { data: Any? -> sendEvent(callbackContext.callbackId, data) }
|
|
69
|
-
} catch (error:
|
|
70
|
-
Log.e("REGULA", "Caught exception in \"$method\" function:", error)
|
|
70
|
+
} catch (error: Throwable) {
|
|
71
|
+
Log.e("REGULA", "Caught an exception in \"$method\" function:", error)
|
|
72
|
+
sendEvent(callbackContext.callbackId, Throwable("Unexpected error, check logs for details"))
|
|
71
73
|
}
|
|
72
74
|
return true
|
|
73
75
|
}
|
|
@@ -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
|
+
}
|
package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/Config.kt
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@file:Suppress("EnumValuesSoftDeprecate", "DEPRECATION")
|
|
2
2
|
|
|
3
|
-
package com.regula.plugin.
|
|
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.
|
|
31
|
-
import com.regula.plugin.
|
|
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.
|
|
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.
|
|
119
|
-
import com.regula.plugin.
|
|
120
|
-
import com.regula.plugin.
|
|
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,
|
package/android/src/main/kotlin/com/regula/plugin/{documentreader → document/reader}/Main.kt
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@file:SuppressLint("MissingPermission")
|
|
2
2
|
@file:Suppress("EnumValuesSoftDeprecate")
|
|
3
3
|
|
|
4
|
-
package com.regula.plugin.
|
|
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.
|
|
51
|
-
import com.regula.plugin.
|
|
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.
|
|
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:
|
|
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
|
|
package/app.plugin.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
const {
|
|
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
|
-
|
|
6
|
-
|
|
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" />
|
|
@@ -7,9 +7,8 @@ buildscript {
|
|
|
7
7
|
mavenCentral()
|
|
8
8
|
}
|
|
9
9
|
dependencies {
|
|
10
|
-
classpath 'com.android.tools.build:gradle:
|
|
11
|
-
classpath
|
|
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
|
+
}
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
distributionBase=GRADLE_USER_HOME
|
|
2
2
|
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-
|
|
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
|
|
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
|
-
#
|
|
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
|
|
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/
|
|
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
|
|
22
|
+
@rem gradlew startup script for Windows
|
|
23
23
|
@rem
|
|
24
24
|
@rem ##########################################################################
|
|
25
25
|
|
|
26
|
-
@rem Set local scope for the variables
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
77
|
-
|
|
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
|
-
:
|
|
80
|
-
@rem
|
|
81
|
-
|
|
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 =
|
|
4
|
-
targetSdkVersion =
|
|
5
|
-
androidxActivityVersion = '1.
|
|
6
|
-
androidxAppCompatVersion = '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.
|
|
9
|
-
androidxFragmentVersion = '1.
|
|
12
|
+
androidxCoreVersion = '1.19.0'
|
|
13
|
+
androidxFragmentVersion = '1.9.0'
|
|
10
14
|
coreSplashScreenVersion = '1.2.0'
|
|
11
|
-
androidxWebkitVersion = '1.
|
|
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 = '
|
|
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
|
|
4
|
-
import {
|
|
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 =
|
|
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
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
@
|
|
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
|
|
15
|
-
|
|
16
|
-
|
|
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
|
}
|