diff --git a/android/app/capacitor.build.gradle b/android/app/capacitor.build.gradle new file mode 100644 index 0000000..bbfb44f --- /dev/null +++ b/android/app/capacitor.build.gradle @@ -0,0 +1,19 @@ +// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN + +android { + compileOptions { + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 + } +} + +apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle" +dependencies { + + +} + + +if (hasProperty('postBuildExtras')) { + postBuildExtras() +} diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/android/app/src/main/assets/capacitor.config.json @@ -0,0 +1 @@ +{} diff --git a/android/app/src/main/assets/capacitor.plugins.json b/android/app/src/main/assets/capacitor.plugins.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/android/app/src/main/assets/capacitor.plugins.json @@ -0,0 +1 @@ +[] diff --git a/android/app/src/main/assets/public/cordova.js b/android/app/src/main/assets/public/cordova.js new file mode 100644 index 0000000..e69de29 diff --git a/android/app/src/main/assets/public/cordova_plugins.js b/android/app/src/main/assets/public/cordova_plugins.js new file mode 100644 index 0000000..e69de29 diff --git a/android/app/src/main/assets/public/index.html b/android/app/src/main/assets/public/index.html new file mode 100644 index 0000000..996946a Binary files /dev/null and b/android/app/src/main/assets/public/index.html differ diff --git a/android/app/src/main/res/xml/config.xml b/android/app/src/main/res/xml/config.xml new file mode 100644 index 0000000..1b1b0e0 --- /dev/null +++ b/android/app/src/main/res/xml/config.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/android/capacitor-cordova-android-plugins/build.gradle b/android/capacitor-cordova-android-plugins/build.gradle new file mode 100644 index 0000000..1192ef8 --- /dev/null +++ b/android/capacitor-cordova-android-plugins/build.gradle @@ -0,0 +1,59 @@ +ext { + androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0' + cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '10.1.1' +} + +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:8.7.2' + } +} + +apply plugin: 'com.android.library' + +android { + namespace "capacitor.cordova.android.plugins" + compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35 + defaultConfig { + minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35 + versionCode 1 + versionName "1.0" + } + lintOptions { + abortOnError false + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 + } +} + +repositories { + google() + mavenCentral() + flatDir{ + dirs 'src/main/libs', 'libs' + } +} + +dependencies { + implementation fileTree(dir: 'src/main/libs', include: ['*.jar']) + implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" + implementation "org.apache.cordova:framework:$cordovaAndroidVersion" + // SUB-PROJECT DEPENDENCIES START + + // SUB-PROJECT DEPENDENCIES END +} + +// PLUGIN GRADLE EXTENSIONS START +apply from: "cordova.variables.gradle" +// PLUGIN GRADLE EXTENSIONS END + +for (def func : cdvPluginPostBuildExtras) { + func() +} \ No newline at end of file diff --git a/android/capacitor-cordova-android-plugins/cordova.variables.gradle b/android/capacitor-cordova-android-plugins/cordova.variables.gradle new file mode 100644 index 0000000..c91fae7 --- /dev/null +++ b/android/capacitor-cordova-android-plugins/cordova.variables.gradle @@ -0,0 +1,7 @@ +// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN +ext { + cdvMinSdkVersion = project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23 + // Plugin gradle extensions can append to this to have code run at the end. + cdvPluginPostBuildExtras = [] + cordovaConfig = [:] +} \ No newline at end of file diff --git a/android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml b/android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml new file mode 100644 index 0000000..cb9c8aa --- /dev/null +++ b/android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/android/capacitor-cordova-android-plugins/src/main/java/.gitkeep b/android/capacitor-cordova-android-plugins/src/main/java/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/android/capacitor-cordova-android-plugins/src/main/res/.gitkeep b/android/capacitor-cordova-android-plugins/src/main/res/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/android/capacitor-cordova-android-plugins/src/main/res/.gitkeep @@ -0,0 +1 @@ + diff --git a/android/capacitor.settings.gradle b/android/capacitor.settings.gradle new file mode 100644 index 0000000..9a5fa87 --- /dev/null +++ b/android/capacitor.settings.gradle @@ -0,0 +1,3 @@ +// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN +include ':capacitor-android' +project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor') diff --git a/example/package.json b/example/package.json index 2846515..761de51 100644 --- a/example/package.json +++ b/example/package.json @@ -1,7 +1,7 @@ { "name": "capacitor-document-scanner-demo", "version": "1.0.0", - "description": "A demo showing how to use Capacitor Document Scanner", + "description": "A demo showing how to use Capacitor Document Scanner(Updated to capacitor 7.2.0)", "main": "index.js", "keywords": [ "capacitor", @@ -12,12 +12,18 @@ "build": "tsc && rollup -c rollup.config.mjs" }, "dependencies": { - "@capacitor/android": "^5.0.0", + "@capacitor/android": "^7.2.0", "@capacitor/camera": "latest", "@capacitor/core": "latest", - "@capacitor/ios": "^5.0.0", + "@capacitor/ios": "^7.2.0", "@capacitor/splash-screen": "latest", - "capacitor-document-scanner": "file:.." + "capacitor-document-scanner": "file:..", + "@capacitor/cli": "^7.2.0", + "eslint": "^9.28.0", + "prettier": "^3.5.3", + "rimraf": "^6.0.1", + "rollup": "^4.41.1", + "typescript": "^5.8.3" }, "devDependencies": { "@capacitor/cli": "latest", @@ -25,7 +31,19 @@ "@rollup/plugin-typescript": "^11.1.1", "rollup": "^3.23.0", "tslib": "^2.5.2", - "typescript": "^5.0.4" + "@capacitor/android": "^6.0.0", + "@capacitor/core": "^7.2.0", + "@capacitor/docgen": "^0.0.18", + "@capacitor/ios": "^6.0.0", + "@ionic/eslint-config": "^0.3.0", + "@ionic/prettier-config": "^1.0.1", + "@ionic/swiftlint-config": "^1.1.2", + "eslint": "^9.28.0", + "prettier": "~2.3.0", + "prettier-plugin-java": "~1.0.2", + "rimraf": "^3.0.2", + "swiftlint": "^1.0.1", + "typescript": "^5.8.3" }, "author": "David Marcus", "license": "MIT" diff --git a/example/www/main.js b/example/www/main.js index 55e4d9b..a2d6fb5 100644 --- a/example/www/main.js +++ b/example/www/main.js @@ -122,7 +122,10 @@ const createCapacitor$1 = (win) => { const defaultRegisterPlugin = (pluginName, jsImplementations = {}) => { const registeredPlugin = registeredPlugins.get(pluginName); if (registeredPlugin) { - console.warn(`Capacitor plugin "${pluginName}" already registered. Cannot register plugins twice.`); + console.warn(`Capacitor plugin "${pluginName}" + already registered. + Cannot register plugins twice.` + ); return registeredPlugin.proxy; } const platform = getPlatform(); @@ -289,7 +292,9 @@ let WebPlugin$1 = class WebPlugin { this.windowListeners = {}; if (config) { // TODO: add link to upgrade guide - console.warn(`Capacitor WebPlugin "${config.name}" config object was deprecated in v3 and will be removed in v4.`); + console.warn(`Capacitor WebPlugin "${config.name}" + config object was deprecated in + v3 and will be removed in v4.`); this.config = config; } } @@ -764,7 +769,11 @@ const createCapacitor = (win) => { const defaultRegisterPlugin = (pluginName, jsImplementations = {}) => { const registeredPlugin = registeredPlugins.get(pluginName); if (registeredPlugin) { - console.warn(`Capacitor plugin "${pluginName}" already registered. Cannot register plugins twice.`); + console.warn(`Capacitor plugin "${pluginName}" + already registered. + Cannot register plugins twice.` + ); + return registeredPlugin.proxy; } const platform = getPlatform(); @@ -830,7 +839,7 @@ const createCapacitor = (win) => { return p; }; // Some flair ✨ - wrapper.toString = () => `${prop.toString()}() { [capacitor code] }`; + wrapper.toString = () => `${prop.toString()}() {[capacitor code]}`; Object.defineProperty(wrapper, 'name', { value: prop, writable: false, @@ -931,7 +940,11 @@ class WebPlugin { this.windowListeners = {}; if (config) { // TODO: add link to upgrade guide - console.warn(`Capacitor WebPlugin "${config.name}" config object was deprecated in v3 and will be removed in v4.`); + console.warn(`Capacitor WebPlugin "${config.name}" + config object was deprecated + in v3 and will be removed in v4.` + ); + this.config = config; } } diff --git a/ios/App/App/capacitor.config.json b/ios/App/App/capacitor.config.json new file mode 100644 index 0000000..cdd5199 --- /dev/null +++ b/ios/App/App/capacitor.config.json @@ -0,0 +1,3 @@ +{ + "packageClassList": [] +} diff --git a/ios/App/App/config.xml b/ios/App/App/config.xml new file mode 100644 index 0000000..1b1b0e0 --- /dev/null +++ b/ios/App/App/config.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ios/App/App/public/cordova.js b/ios/App/App/public/cordova.js new file mode 100644 index 0000000..e69de29 diff --git a/ios/App/App/public/cordova_plugins.js b/ios/App/App/public/cordova_plugins.js new file mode 100644 index 0000000..e69de29 diff --git a/ios/App/App/public/index.html b/ios/App/App/public/index.html new file mode 100644 index 0000000..996946a Binary files /dev/null and b/ios/App/App/public/index.html differ diff --git a/ios/Plugin/Info.plist b/ios/Plugin/Info.plist index 1007fd9..13505dd 100644 --- a/ios/Plugin/Info.plist +++ b/ios/Plugin/Info.plist @@ -1,5 +1,5 @@ - + CFBundleDevelopmentRegion diff --git a/ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec b/ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec new file mode 100644 index 0000000..85e7af6 --- /dev/null +++ b/ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec @@ -0,0 +1,16 @@ + + Pod::Spec.new do |s| + s.name = 'CordovaPlugins' + s.version = '7.2.0' + s.summary = 'Autogenerated spec' + s.license = 'Unknown' + s.homepage = 'https://example.com' + s.authors = { 'Capacitor Generator' => 'hi@example.com' } + s.source = { :git => 'https://github.com/ionic-team/does-not-exist.git', :tag => '7.2.0' } + s.source_files = 'sources/**/*.{swift,h,m,c,cc,mm,cpp}' + s.ios.deployment_target = '14.0' + s.xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1 WK_WEB_VIEW_ONLY=1' } + s.dependency 'CapacitorCordova' + s.swift_version = '5.1' + + end \ No newline at end of file diff --git a/ios/capacitor-cordova-ios-plugins/CordovaPluginsResources.podspec b/ios/capacitor-cordova-ios-plugins/CordovaPluginsResources.podspec new file mode 100644 index 0000000..fa16d3c --- /dev/null +++ b/ios/capacitor-cordova-ios-plugins/CordovaPluginsResources.podspec @@ -0,0 +1,10 @@ +Pod::Spec.new do |s| + s.name = 'CordovaPluginsResources' + s.version = '0.0.105' + s.summary = 'Resources for Cordova plugins' + s.license = 'MIT' + s.homepage = 'https://capacitorjs.com/' + s.authors = { 'Ionic Team' => 'hi@ionicframework.com' } + s.source = { :git => 'https://github.com/ionic-team/capacitor.git', :tag => s.version.to_s } + s.resources = ['resources/*'] +end diff --git a/ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec b/ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec new file mode 100644 index 0000000..d6f57eb --- /dev/null +++ b/ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec @@ -0,0 +1,16 @@ + + Pod::Spec.new do |s| + s.name = 'CordovaPluginsStatic' + s.version = '7.2.0' + s.summary = 'Autogenerated spec' + s.license = 'Unknown' + s.homepage = 'https://example.com' + s.authors = { 'Capacitor Generator' => 'hi@example.com' } + s.source = { :git => 'https://github.com/ionic-team/does-not-exist.git', :tag => '7.2.0' } + s.source_files = 'sourcesstatic/**/*.{swift,h,m,c,cc,mm,cpp}' + s.ios.deployment_target = '14.0' + s.xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1 WK_WEB_VIEW_ONLY=1' } + s.dependency 'CapacitorCordova' + s.swift_version = '5.1' + s.static_framework = true + end \ No newline at end of file diff --git a/ios/capacitor-cordova-ios-plugins/resources/.gitkeep b/ios/capacitor-cordova-ios-plugins/resources/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ios/capacitor-cordova-ios-plugins/resources/.gitkeep @@ -0,0 +1 @@ + diff --git a/ios/capacitor-cordova-ios-plugins/sources/.gitkeep b/ios/capacitor-cordova-ios-plugins/sources/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ios/capacitor-cordova-ios-plugins/sources/.gitkeep @@ -0,0 +1 @@ + diff --git a/package-lock.json b/package-lock.json index 19d5c75..52fd744 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "capacitor-document-scanner", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "capacitor-document-scanner", - "version": "2.0.0", + "version": "2.1.0", "license": "MIT", "devDependencies": { - "@capacitor/android": "^5.0.0", - "@capacitor/core": "^5.0.0", + "@capacitor/android": "^7.2.0", + "@capacitor/core": "^7.2.0", "@capacitor/docgen": "^0.0.18", - "@capacitor/ios": "^5.0.0", + "@capacitor/ios": "^7.2.0", "@ionic/eslint-config": "^0.3.0", "@ionic/prettier-config": "^1.0.1", "@ionic/swiftlint-config": "^1.1.2", @@ -25,7 +25,7 @@ "typescript": "~4.1.5" }, "peerDependencies": { - "@capacitor/core": "^5.0.0" + "@capacitor/core": "^7.2.0" } }, "node_modules/@babel/code-frame": { @@ -132,19 +132,21 @@ } }, "node_modules/@capacitor/android": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-5.0.4.tgz", - "integrity": "sha512-WtXmjRQ0bCtFkwBID/jVEPbqnh0uR9wTSgkW7QNzogDuA0iyJJI2nxDfT9knUmg6mne/CnfTXg093zzdc13C0w==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-6.2.1.tgz", + "integrity": "sha512-8gd4CIiQO5LAIlPIfd5mCuodBRxMMdZZEdj8qG8m+dQ1sQ2xyemVpzHmRK8qSCHorsBUCg3D62j2cp6bEBAkdw==", "dev": true, + "license": "MIT", "peerDependencies": { - "@capacitor/core": "^5.0.0" + "@capacitor/core": "^7.2.0" } }, "node_modules/@capacitor/core": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-5.0.4.tgz", - "integrity": "sha512-BFvziz9jM87pLHW2sXPNIzwrdmI5mAP0tBsBHgXoCO2+wVdpvIMYCpcst5BuTULaMz5JBFZZ6g6nqwgfs+SMCA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-6.2.1.tgz", + "integrity": "sha512-urZwxa7hVE/BnA18oCFAdizXPse6fCKanQyEqpmz6cBJ2vObwMpyJDG5jBeoSsgocS9+Ax+9vb4ducWJn0y2qQ==", "dev": true, + "license": "MIT", "dependencies": { "tslib": "^2.1.0" } @@ -182,12 +184,13 @@ } }, "node_modules/@capacitor/ios": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-5.0.4.tgz", - "integrity": "sha512-JVyggBTbHR1OWqxTRysgGKhZHDuM0AQwCIbylvEpza5X0zmaltbQxVC83abcwOKsgNJnrcuv+HUgV+LXg8Dk4Q==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-6.2.1.tgz", + "integrity": "sha512-tbMlQdQjxe1wyaBvYVU1yTojKJjgluZQsJkALuJxv/6F8QTw5b6vd7X785O/O7cMpIAZfUWo/vtAHzFkRV+kXw==", "dev": true, + "license": "MIT", "peerDependencies": { - "@capacitor/core": "^5.0.0" + "@capacitor/core": "^7.2.0" } }, "node_modules/@eslint/eslintrc": { @@ -3340,16 +3343,16 @@ } }, "@capacitor/android": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-5.0.4.tgz", - "integrity": "sha512-WtXmjRQ0bCtFkwBID/jVEPbqnh0uR9wTSgkW7QNzogDuA0iyJJI2nxDfT9knUmg6mne/CnfTXg093zzdc13C0w==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-6.2.1.tgz", + "integrity": "sha512-8gd4CIiQO5LAIlPIfd5mCuodBRxMMdZZEdj8qG8m+dQ1sQ2xyemVpzHmRK8qSCHorsBUCg3D62j2cp6bEBAkdw==", "dev": true, "requires": {} }, "@capacitor/core": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-5.0.4.tgz", - "integrity": "sha512-BFvziz9jM87pLHW2sXPNIzwrdmI5mAP0tBsBHgXoCO2+wVdpvIMYCpcst5BuTULaMz5JBFZZ6g6nqwgfs+SMCA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-6.2.1.tgz", + "integrity": "sha512-urZwxa7hVE/BnA18oCFAdizXPse6fCKanQyEqpmz6cBJ2vObwMpyJDG5jBeoSsgocS9+Ax+9vb4ducWJn0y2qQ==", "dev": true, "requires": { "tslib": "^2.1.0" @@ -3377,9 +3380,9 @@ } }, "@capacitor/ios": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-5.0.4.tgz", - "integrity": "sha512-JVyggBTbHR1OWqxTRysgGKhZHDuM0AQwCIbylvEpza5X0zmaltbQxVC83abcwOKsgNJnrcuv+HUgV+LXg8Dk4Q==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@capacitor/ios/-/ios-6.2.1.tgz", + "integrity": "sha512-tbMlQdQjxe1wyaBvYVU1yTojKJjgluZQsJkALuJxv/6F8QTw5b6vd7X785O/O7cMpIAZfUWo/vtAHzFkRV+kXw==", "dev": true, "requires": {} }, diff --git a/package.json b/package.json index 250c3ea..9fb1b4c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "capacitor-document-scanner", - "version": "2.0.0", - "description": "A Capacitor plugin that lets you scan documents using Android and iOS", + "version": "2.1.0", + "description": "A Capacitor plugin that lets you scan documents using Android and iOS (Updated to capacitor 7.2.0)", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", "types": "dist/esm/index.d.ts", @@ -44,23 +44,24 @@ "prepublishOnly": "npm run build" }, "devDependencies": { - "@capacitor/android": "^5.0.0", - "@capacitor/core": "^5.0.0", + "@capacitor/cli": "^7.2.0", + "@capacitor/android": "^6.0.0", + "@capacitor/core": "^7.2.0", "@capacitor/docgen": "^0.0.18", - "@capacitor/ios": "^5.0.0", + "@capacitor/ios": "^6.0.0", "@ionic/eslint-config": "^0.3.0", "@ionic/prettier-config": "^1.0.1", "@ionic/swiftlint-config": "^1.1.2", - "eslint": "^7.11.0", + "eslint": "^9.28.0", "prettier": "~2.3.0", "prettier-plugin-java": "~1.0.2", "rimraf": "^3.0.2", "rollup": "^2.32.0", "swiftlint": "^1.0.1", - "typescript": "~4.1.5" + "typescript": "^5.8.3" }, "peerDependencies": { - "@capacitor/core": "^5.0.0" + "@capacitor/core": "^7.2.0" }, "prettier": "@ionic/prettier-config", "swiftlint": "@ionic/swiftlint-config", diff --git a/www/index.html b/www/index.html new file mode 100644 index 0000000..996946a Binary files /dev/null and b/www/index.html differ