diff --git a/README.md b/README.md index dc66018b0..db578c51c 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ Different features are supported by this app, a brief overview you'll find here. - [Mike](https://github.com/mike1808) - For supporting Acaia Scales & DIY Pressure Sensor - [Myles](https://github.com/mylesagray) - For supporting Thermo Bluetooth Devices - [Herman](https://github.com/hermanmak) - For supporting Felicita Arc -- [Yannick](https://github.com/randomcoffeesnob) - For supporting DiFluid Microbalance & Smart Chef Scale +- [Yannick](https://github.com/randomcoffeesnob) - For supporting DiFluid Microbalance & Smart Chef Scale, BlackCoffee.IO. Also for adding Lokalise ## Getting the App @@ -177,6 +177,10 @@ Thats why just Android is support by now. You can backup Beanconqueror via iCloud, with this you can transfer all data to another device without any loss. +### Android - Backup & Restore + +Have a look here: [FAQ](https://beanconqueror.com/faq) + ### Analytics All tracked data/analytics are visible here: ![Website](https://beanconqueror.com/data-tracking.html) @@ -185,7 +189,7 @@ All tracked data/analytics are visible here: ![Website](https://beanconqueror.co The app needs access to your filesystem aswell as the camera -- _Filesytem_: Needed to save images which you took on beans/brews etc or exporting your settings. +- _Filesytem_: Needed to save images which you took on beans/brews etc or exporting your settings. - Outdated after Android 13 changes. - _Camera_: Needed to take picures or access the photo library to set images for your beans/brews - _Internet_: NOT NEEDED! But needed if you want to send me some analytics information to make the app better :) - _GPS_: NOT NEEDED! Activated through settings, saves the brew location @@ -206,12 +210,14 @@ https://sonarcloud.io/dashboard?id=graphefruit_Beanconqueror ## Get Started -npm install -g cordova@11.0.0 +npm install -g cordova@12.0.0 npm install -g @ionic/cli npm run prepare ## Build iOS +Always use the .workspace-File to open in Xcode + ``` ionic cordova build ios ``` @@ -236,19 +242,19 @@ cordova-check-plugins ### NPM-Version -npm-v -> 9.4.0 - works +npm -v -> 9.6.4 - works ### NodeJS-Version -node -v -> v16.15.0 -> works +node -v -> v18.15.0 -> works ### iOS-Version: -`ionic cordova platform add ios@6.2.0` +`ionic cordova platform add ios@7.0.1` ### Android-Version: -`ionic cordova platform add android@10.1.2` +`ionic cordova platform add android@12.0.0` ### Github Page Hosting @@ -266,39 +272,6 @@ brew install bundletool bundletool build-apks --bundle=./app.aab --output=./app.apks bundletool install-apks --apks=app.apks -#Overwrite plugin.xmls -After SDK Target 31 needs to be supported, and older plugins doesn't have the android-export flag, we need to add them ourself... - -Cordova-plugin-x-socialsharing -`` - -Fixing SocialSharing.java -` int flag = PendingIntent.FLAG_MUTABLE; -if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.S) { -flag = PendingIntent.FLAG_UPDATE_CURRENT; -} -final PendingIntent pendingIntent = PendingIntent.getBroadcast(cordova.getActivity().getApplicationContext(), 0, receiverIntent, flag);` --> https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/pull/1202/commits - -cordova-plugin-telerik-imagepicker - -1. `` -2. ` - -` -> change edit-config to config-file - fttx-phonegap-plugin-barcodescanner - `` - -cordova-plugin-file/src/android -ContentFileSystem.java --> Temp fix for import -` String encodedPath = inputURL.uri.getEncodedPath(); -String authorityAndPath = encodedPath.substring(encodedPath.indexOf(this.name) + 1 + this.name.length() + 2);` - Compile deson't work on android? Try: `cordova build android -- --jvmargs='-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED'` - -iOS: -Always check -That ` wkWebView.inspectable = YES;` is never be in the code, else it wont work on older iOS devices diff --git a/config.xml b/config.xml index dee420862..09d2d9f9a 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + Beanconqueror Lars Saalbach @@ -15,8 +15,9 @@ - + + @@ -26,8 +27,20 @@ + + + + + @@ -37,6 +50,7 @@ + @@ -71,18 +85,6 @@ - - - - - - - - - - - - @@ -92,7 +94,6 @@ - @@ -199,6 +200,18 @@ + + App needs access to Health to read, write and update the amount of caffeine by each coffee brew, which was recorded with this app. + + + App needs access to Health to read, write and update the amount of caffeine by each coffee brew, which was recorded with this app. + + + Blutooth access needed to connect smartscales, pressure devices, thermo devices or refractometer. With this these data to each coffee brew can be logged. + + + Blutooth access needed to connect smartscales, pressure devices, thermo devices or refractometer. With this these data to each coffee brew can be logged. + App needs read access to see the caffeinate amount which was tracked with this coffee app @@ -305,14 +318,7 @@ - - - - - - - diff --git a/install.md b/install.md index 1fec87042..3882c58ad 100755 --- a/install.md +++ b/install.md @@ -8,7 +8,8 @@ ionic cordova plugin add cordova-plugin-inappbrowser npm install @ionic-native/in-app-browser #Image picker -ionic cordova plugin add cordova-plugin-telerik-imagepicker +//ionic cordova plugin add cordova-plugin-telerik-imagepicker +ionic cordova plugin add spoonconsulting/cordova-plugin-telerik-imagepicker npm install @ionic-native/image-picker #Camera @@ -66,9 +67,6 @@ npm install @ionic-native/three-dee-touch #ChartJS npm install chart.js --save -##Support grade release -ionic cordova plugin add cordova-android-support-gradle-release - ##Globalization ionic cordova plugin add cordova-plugin-globalization npm install @ionic-native/globalization @@ -77,9 +75,6 @@ npm install @ionic-native/globalization ionic cordova plugin add cordova-plugin-app-version npm install @ionic-native/app-version -##MultiDex support on Android -ionic cordova plugin add cordova-plugin-enable-multidex - ###https://github.com/hughjdavey/ngx-stars npm install --save ngx-stars @@ -104,7 +99,7 @@ npm install -g cordova-check-plugins ##Healthkit https://github.com/dariosalvi78/cordova-plugin-health -cordova plugin add cordova-plugin-health --variable HEALTH_READ_PERMISSION='App needs read access to see the caffeinate amount which was tracked with this coffee app' --variable HEALTH_WRITE_PERMISSION='App needs write access to add the drunken caffeinate amount with the tracked brews' +ionic cordova plugin add cordova-plugin-health --variable HEALTH_READ_PERMISSION='App needs read access to see the caffeinate amount which was tracked with this coffee app' --variable HEALTH_WRITE_PERMISSION='App needs write access to add the drunken caffeinate amount with the tracked brews' ##https://ionicframework.com/docs/native/insomnia ionic cordova plugin add cordova-plugin-insomnia @@ -117,6 +112,9 @@ npm install @ionic-native/insomnia npm install ag-virtual-scroll@1.3.0 ##QRCode Scanner +New plugin 09/23:ionic cordova plugin add @red-mobile/cordova-plugin-barcodescanner + +This plugin crashed on android, so we removed it. Prio 1: https://github.com/fttx/phonegap-plugin-barcodescanner ionic cordova plugin add https://github.com/fttx/phonegap-plugin-barcodescanner.git --save-dev (Next possible fallback: https://openbase.com/js/@red-mobile/cordova-plugin-barcodescanner) @@ -129,10 +127,6 @@ npm install @ionic-native/deeplinks https://search.google.com/search-console/not-verified?original_url=/search-console/ownership&original_resource_id -##Ionic Cordova Plugin Adapter X -ionic cordova plugin add cordova-plugin-androidx-adapter -ionic cordova plugin add cordova-plugin-androidx - ##Bluetooth We combine both plugins, because the other plugins asks all of the permissions. @@ -156,3 +150,17 @@ npm install @ionic-native/screen-orientation ## Gauge https://ashish-chopra.github.io/ngx-gauge/#demos + +## Diagnostics + +ionic cordova plugin add cordova.plugins.diagnostic + +##MultiDex support on Android +ionic cordova plugin add cordova-plugin-enable-multidex) + +##Ionic Cordova Plugin Adapter X +ionic cordova plugin add cordova-plugin-androidx-adapter +ionic cordova plugin add cordova-plugin-androidx + +##Support grade release +ionic cordova plugin add cordova-android-support-gradle-release diff --git a/package-lock.json b/package-lock.json index ab73b4211..1563f5b80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "@ionic-native/deeplinks": "^5.33.1", "@ionic-native/device": "^5.33.1", "@ionic-native/file": "^5.33.1", - "@ionic-native/file-chooser": "^5.33.1", + "@ionic-native/file-chooser": "^5.36.0", "@ionic-native/file-path": "^5.33.1", "@ionic-native/file-picker": "^5.33.1", "@ionic-native/file-transfer": "^5.34.0", @@ -50,12 +50,9 @@ "chartjs-plugin-annotation": "^1.3.0", "chartjs-plugin-streaming": "^2.0.0", "chartjs-plugin-zoom": "^1.2.0", - "cordova-android-support-gradle-release": "^3.0.1", "cordova-plugin-3dtouch": "^1.3.8", - "cordova-plugin-android-permissions": "1.1.2", "cordova-plugin-appminimize": "^1.0.1", "cordova-plugin-device": "^2.0.3", - "cordova-plugin-enable-multidex": "^0.2.0", "cordova-plugin-filechooser": "^1.2.0", "cordova-plugin-filepicker": "^1.1.6", "cordova-plugin-globalization": "^1.11.0", @@ -88,42 +85,44 @@ "@angular/compiler-cli": "^15.2.3", "@angular/language-service": "^15.2.3", "@ionic/angular-toolkit": "^8.0.0", + "@red-mobile/cordova-plugin-barcodescanner": "^9.1.0", + "@spoonconsulting/cordova-plugin-telerik-imagepicker": "github:spoonconsulting/cordova-plugin-telerik-imagepicker", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.8", "@types/lodash": "^4.14.178", "@types/node": "^12.20.5", "@wisdomgarden/cordova-plugin-filepath": "git+https://github.com/wisdom-garden/cordova-plugin-filepath.git", - "cordova-android": "^10.1.2", + "cordova-android": "^12.0.1", + "cordova-android-support-gradle-release": "^3.0.1", "cordova-clipboard": "^1.3.0", - "cordova-ios": "^6.3.0", + "cordova-ios": "^7.0.1", "cordova-plugin-add-swift-support": "^2.0.2", "cordova-plugin-advanced-http": "^3.3.1", + "cordova-plugin-android-permissions": "^1.1.5", "cordova-plugin-androidx": "^3.0.0", "cordova-plugin-androidx-adapter": "^1.1.3", - "cordova-plugin-app-version": "^0.1.12", + "cordova-plugin-app-version": "^0.1.14", "cordova-plugin-apprate": "^1.7.2", "cordova-plugin-ble-central": "^1.7.0", - "cordova-plugin-camera": "^6.0.0", + "cordova-plugin-camera": "^7.0.0", "cordova-plugin-customurlscheme-ng": "^10.0.0", "cordova-plugin-dialogs": "^2.0.2", - "cordova-plugin-file": "^7.0.0", + "cordova-plugin-enable-multidex": "^0.2.0", + "cordova-plugin-file": "^8.0.0", "cordova-plugin-file-transfer": "github:dpa99c/cordova-plugin-file-transfer", "cordova-plugin-filepath": "^1.6.0", "cordova-plugin-geolocation": "^4.1.0", - "cordova-plugin-health": "^2.0.0", + "cordova-plugin-health": "^2.1.0", "cordova-plugin-inappbrowser": "^5.0.0", "cordova-plugin-insomnia": "^4.3.0", - "cordova-plugin-ionic-webview": "^5.0.0", + "cordova-plugin-ionic-webview": "^5.0.1", "cordova-plugin-nativestorage": "^2.3.2", "cordova-plugin-screen-orientation": "^3.0.2", - "cordova-plugin-simple-file-chooser": "^2.2.1", - "cordova-plugin-splashscreen": "^6.0.0", - "cordova-plugin-telerik-imagepicker": "^2.3.3", - "cordova-plugin-x-socialsharing": "^6.0.3", + "cordova-plugin-splashscreen": "^6.0.1", + "cordova-plugin-x-socialsharing": "^6.0.4", "cordova-sqlite-storage": "^5.1.0", "elliptic": ">=6.5.4", "es6-promise-plugin": "^4.2.2", - "fttx-phonegap-plugin-barcodescanner": "github:fttx/phonegap-plugin-barcodescanner", "husky": "^8.0.1", "ionic-plugin-deeplinks": "^1.0.22", "jasmine-core": "~3.8.0", @@ -136,7 +135,7 @@ "lint-staged": "^13.0.3", "prettier": "^2.7.1", "protractor": "^7.0.0", - "skwas-cordova-plugin-datetimepicker": "^2.1.2", + "skwas-cordova-plugin-datetimepicker": "^3.0.2", "stylelint": "^13.12.0", "stylelint-config-standard": "^20.0.0", "ts-node": "~8.3.0", @@ -3969,6 +3968,16 @@ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", "dev": true }, + "node_modules/@red-mobile/cordova-plugin-barcodescanner": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@red-mobile/cordova-plugin-barcodescanner/-/cordova-plugin-barcodescanner-9.1.0.tgz", + "integrity": "sha512-H0RNoqiWgGLnfdgO1CgeruJ0+eRIQnaYtdZ+gDN7xLi3CzRooJUVLAwt5rekBqI2iSLMFp9qqfGGyRKRUcC7Uw==", + "dev": true, + "dependencies": { + "nopt": "^7.2.0", + "shelljs": "^0.8.3" + } + }, "node_modules/@schematics/angular": { "version": "15.2.4", "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-15.2.4.tgz", @@ -3999,6 +4008,16 @@ "integrity": "sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==", "devOptional": true }, + "node_modules/@spoonconsulting/cordova-plugin-telerik-imagepicker": { + "version": "2.0.4", + "resolved": "git+ssh://git@github.com/spoonconsulting/cordova-plugin-telerik-imagepicker.git#86f002be301c3806963a5113a2c8eb2761702656", + "dev": true, + "license": "MIT", + "engines": { + "name": "cordova", + "version": ">=3.5.0" + } + }, "node_modules/@stencil/core": { "version": "2.22.3", "resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.22.3.tgz", @@ -5189,12 +5208,12 @@ } }, "node_modules/bplist-parser": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", - "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.2.tgz", + "integrity": "sha512-apC2+fspHGI3mMKj+dGevkGo/tCqVB8jMb6i+OX+E29p0Iposz07fABkRIfVUPNd5A5VbuOz1bZbnmkKLYF+wQ==", "dev": true, "dependencies": { - "big-integer": "^1.6.44" + "big-integer": "1.6.x" }, "engines": { "node": ">= 5.10.0" @@ -6146,31 +6165,34 @@ } }, "node_modules/cordova-android": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-10.1.2.tgz", - "integrity": "sha512-F28+NvgKO4ZhKFkqctCOh62mhVoNyUuRQh/F/nqp+Sti4ODv2rUa6UeW18khhdYTjlDeihHQsPqxvB7mI6fVYA==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-12.0.1.tgz", + "integrity": "sha512-6fXWoYb/X5AJlluhBg5RvOaX6iRxsvNH7yEOiXzUmLIflf5Ho7LtYCSKZaWMHh3f5cJe/sPCBKmFFBS+EWepVg==", "dev": true, "dependencies": { - "android-versions": "^1.7.0", - "cordova-common": "^4.0.2", + "android-versions": "^1.8.1", + "cordova-common": "^5.0.0", + "dedent": "^1.0.1", "execa": "^5.1.1", - "fast-glob": "^3.2.7", - "fs-extra": "^10.0.0", + "fast-glob": "^3.2.12", + "fs-extra": "^11.1.1", "is-path-inside": "^3.0.3", - "nopt": "^5.0.0", + "nopt": "^7.1.0", "properties-parser": "^0.3.1", - "semver": "^7.3.5", + "semver": "^7.3.8", + "string-argv": "^0.3.1", "untildify": "^4.0.0", - "which": "^2.0.2" + "which": "^3.0.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=16.13.0" } }, "node_modules/cordova-android-support-gradle-release": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/cordova-android-support-gradle-release/-/cordova-android-support-gradle-release-3.0.1.tgz", "integrity": "sha512-RSW55DkSckmqhX/kjj+a1YeVdy7s/AtlZn6Qa5XMQmmA4Iogq+IF2jvInZqzCF19DbI5YE95AP7VDbRk+DdDRw==", + "dev": true, "dependencies": { "q": "^1.4.1", "semver": "5.6.0" @@ -6180,14 +6202,29 @@ "version": "5.6.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true, "bin": { "semver": "bin/semver" } }, + "node_modules/cordova-android/node_modules/dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, "node_modules/cordova-android/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", + "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", "dev": true, "dependencies": { "graceful-fs": "^4.2.0", @@ -6195,7 +6232,22 @@ "universalify": "^2.0.0" }, "engines": { - "node": ">=12" + "node": ">=14.14" + } + }, + "node_modules/cordova-android/node_modules/which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", + "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/cordova-clipboard": { @@ -6205,28 +6257,31 @@ "dev": true }, "node_modules/cordova-common": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-4.1.0.tgz", - "integrity": "sha512-sYfOSfpYGQOmUDlsARUbpT/EvVKT/E+GI3zwTXt+C6DjZ7xs6ZQVHs3umHKSidjf9yVM2LLmvGFpGrGX7aGxug==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-5.0.0.tgz", + "integrity": "sha512-6Aa7o52/iEvsKx6K94ijzFel5acCULR49KL27OUVhEpJ4oS7Dc3y2eOP1Eu0P4Wmiw/eLEDQjGXGiAa2D5zFZA==", "dev": true, "dependencies": { "@netflix/nerror": "^1.1.3", "ansi": "^0.3.1", - "bplist-parser": "^0.2.0", - "cross-spawn": "^7.0.1", + "bplist-parser": "^0.3.2", + "cross-spawn": "^7.0.3", "elementtree": "^0.1.7", - "endent": "^1.4.1", - "fast-glob": "^3.2.2", - "fs-extra": "^9.0.0", + "endent": "^2.1.0", + "fast-glob": "^3.2.12", + "fs-extra": "^11.1.0", "glob": "^7.1.6", - "plist": "^3.0.1", + "lodash.assign": "^4.2.0", + "lodash.isdate": "^4.0.1", + "lodash.isobject": "^3.0.2", + "lodash.zip": "^4.2.0", + "plist": "^3.0.6", "q": "^1.5.1", "read-chunk": "^3.2.0", - "strip-bom": "^4.0.0", - "underscore": "^1.9.2" + "strip-bom": "^4.0.0" }, "engines": { - "node": ">=10.0.0" + "node": ">=16.0.0" } }, "node_modules/cordova-common/node_modules/brace-expansion": { @@ -6239,6 +6294,20 @@ "concat-map": "0.0.1" } }, + "node_modules/cordova-common/node_modules/fs-extra": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", + "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, "node_modules/cordova-common/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -6259,6 +6328,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/cordova-common/node_modules/lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==", + "dev": true + }, "node_modules/cordova-common/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -6272,26 +6347,89 @@ } }, "node_modules/cordova-ios": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-6.3.0.tgz", - "integrity": "sha512-BZybgFzc7D0HmhkTYurFrRXiWgvYohmT7bwQsLPhf+VdiDjwGXbiSWgg3uP9MChvacCNcGXXUl2NhOaNC9UVaA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.0.1.tgz", + "integrity": "sha512-WaG3bgOlIQukY8rOhTuA0p2PckBxogSCSOGfWamp4BnaWFoiVm65r4kFqr7PsPguVMbe0t4h4nQTpopxB2LTEQ==", "dev": true, "dependencies": { - "cordova-common": "^4.0.2", - "fs-extra": "^9.1.0", + "cordova-common": "^5.0.0", + "execa": "^5.1.1", + "fs-extra": "^11.1.1", "ios-sim": "^8.0.2", - "nopt": "^5.0.0", - "plist": "^3.0.1", - "semver": "^7.3.4", + "nopt": "^7.1.0", + "plist": "^3.0.6", + "semver": "^7.4.0", "unorm": "^1.6.0", - "which": "^2.0.2", + "which": "^3.0.0", "xcode": "^3.0.1", "xml-escape": "^1.1.0" }, + "engines": { + "node": ">=16.13.0" + } + }, + "node_modules/cordova-ios/node_modules/fs-extra": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", + "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/cordova-ios/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, "engines": { "node": ">=10" } }, + "node_modules/cordova-ios/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cordova-ios/node_modules/which": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", + "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/cordova-ios/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/cordova-plugin-3dtouch": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/cordova-plugin-3dtouch/-/cordova-plugin-3dtouch-1.3.8.tgz", @@ -6391,9 +6529,10 @@ ] }, "node_modules/cordova-plugin-android-permissions": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cordova-plugin-android-permissions/-/cordova-plugin-android-permissions-1.1.2.tgz", - "integrity": "sha512-vJd56gLaSgQnB/4+uUjyVwVAii5TszBPAgjVkGvM8658cP5rjiNFAWmoOYkjeSe1I6dJk+MGrh/GbPkn0a+2OA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/cordova-plugin-android-permissions/-/cordova-plugin-android-permissions-1.1.5.tgz", + "integrity": "sha512-oTTV9cCMBqXTCmU+nYRebsP2IQfrtdvl2vYXHjoJgv5NHCIDgY4KFg6kJTcwXQOiymeGXuw0+MTvJJOueAdleA==", + "dev": true, "engines": [ { "name": "cordova", @@ -6441,9 +6580,9 @@ "dev": true }, "node_modules/cordova-plugin-camera": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cordova-plugin-camera/-/cordova-plugin-camera-6.0.0.tgz", - "integrity": "sha512-FTFKep8HZI/2HkX+Gc/dUACfZGV9+k9waXlgoEOKXOiPPR/1zBw29Mw+adcz4FQUpdWyAgYDxNiaPUnP0P+H2Q==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cordova-plugin-camera/-/cordova-plugin-camera-7.0.0.tgz", + "integrity": "sha512-OVQWZTBb18Y6e5c+bbXt3E4Z1yGnYqaywh2h5vVr/+nxMcdMIE+lm527bRK5vLN/RUqhGYP/Z+5n+O7Fk7fVNw==", "dev": true, "engines": { "cordovaDependencies": { @@ -6470,6 +6609,11 @@ "cordova-ios": ">=5.1.0" }, "7.0.0": { + "cordova": ">=9.0.0", + "cordova-android": ">=12.0.0", + "cordova-ios": ">=5.1.0" + }, + "8.0.0": { "cordova": ">100" } } @@ -6516,12 +6660,13 @@ "node_modules/cordova-plugin-enable-multidex": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/cordova-plugin-enable-multidex/-/cordova-plugin-enable-multidex-0.2.0.tgz", - "integrity": "sha512-W/s8FpRdi3kTLtePdvauqKj1qqoxZDJWmEphvAmSmPwNTtfv3CxgnwFYc9aNmR9iDiJk3E0ME+9BRkbyz/4rXw==" + "integrity": "sha512-W/s8FpRdi3kTLtePdvauqKj1qqoxZDJWmEphvAmSmPwNTtfv3CxgnwFYc9aNmR9iDiJk3E0ME+9BRkbyz/4rXw==", + "dev": true }, "node_modules/cordova-plugin-file": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-7.0.0.tgz", - "integrity": "sha512-mSwy9GE5pHq2ZHhu/wYk/VhrwR5VLk+XQsk3+IiiFmDgcPsrVIyELkM2FZKX09cC6i+bJVTFVKUlwteSStj3ow==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-8.0.0.tgz", + "integrity": "sha512-pgxCJtDjDKzyeqvrn0KnDubf9b1VLv+OyWTXjUR7T52o7oGDUkR3ubT89i/1ugHtRU6mY7XIGHD4drUByDQClw==", "dev": true, "engines": { "cordovaDependencies": { @@ -6532,6 +6677,9 @@ "cordova-android": ">=10.0.0" }, "8.0.0": { + "cordova-android": ">=12.0.0" + }, + "9.0.0": { "cordova": ">100" } } @@ -6539,7 +6687,7 @@ }, "node_modules/cordova-plugin-file-transfer": { "version": "2.0.0-dev", - "resolved": "git+ssh://git@github.com/dpa99c/cordova-plugin-file-transfer.git#2465f508adfadd5be4a8ea9ecd1ca01779164ea2", + "resolved": "git+ssh://git@github.com/dpa99c/cordova-plugin-file-transfer.git#c8620014e176f6f495b8ffb25736751605a138b5", "dev": true, "license": "Apache-2.0", "engines": { @@ -6673,9 +6821,9 @@ "integrity": "sha512-yDUG+9ieKVRitq5mGlNxjaZh/MgEhFFIgTIPhqSbUaQ8UuZbawy5mhJAVClqY97q8/rcQtL6dCDa7x2sEtCLcA==" }, "node_modules/cordova-plugin-ionic-webview": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cordova-plugin-ionic-webview/-/cordova-plugin-ionic-webview-5.0.0.tgz", - "integrity": "sha512-Wq0kCanxubK/JroTW4Mp5soayScnRyiY1eCkbwiz1Dyt1xHOiOW/v+1miqtBHtnZhcXw25TulCKAVJzkNBdmyg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/cordova-plugin-ionic-webview/-/cordova-plugin-ionic-webview-5.0.1.tgz", + "integrity": "sha512-dF3x7ee8s7ITPImz8WG5HFMnzMW1LaCve+Pdm5WzonKxcwkmMsPrW2zoWuIFBTWjXvFyNoxprzRn6aq/WotvKg==", "dev": true, "engines": { "cordovaDependencies": { @@ -6710,16 +6858,10 @@ } } }, - "node_modules/cordova-plugin-simple-file-chooser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cordova-plugin-simple-file-chooser/-/cordova-plugin-simple-file-chooser-2.2.1.tgz", - "integrity": "sha512-uiDt8ynX6s/GInaZg4mi/gDgk0OLK//5lT/gunP5LHi898LOH0c5y6qnD0IS5ued5AYuETFRs63X2be3+3d5Wg==", - "dev": true - }, "node_modules/cordova-plugin-splashscreen": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-6.0.2.tgz", - "integrity": "sha512-7JiUfnInir+SCOEgTJ+5/cHF3UFl69jp6cAQfHtJaaQt9Pli8D8yTJjU0HGlJCvryvsVs4Xlc7/sEJM7vLJgvg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-6.0.1.tgz", + "integrity": "sha512-olJPBFRUuzunzeuB76TOBoq3yYlnhpWDk/S7ErR6MdqPz1KuK36omB9u4o//SdgfBbxHz+SsUtyvst68NrU3pA==", "dev": true, "engines": { "cordovaDependencies": { @@ -6730,10 +6872,6 @@ "2.0.0": { "cordova-android": ">=3.6.0" }, - "6.0.2": { - "cordova-android": ">=3.6.0 <11.0.0", - "cordova-windows": ">=4.4.0" - }, "7.0.0": { "cordova": ">100" } @@ -6755,16 +6893,6 @@ } } }, - "node_modules/cordova-plugin-telerik-imagepicker": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/cordova-plugin-telerik-imagepicker/-/cordova-plugin-telerik-imagepicker-2.3.6.tgz", - "integrity": "sha512-guf+BHB7O3g1ll3++d+aOvTGHXwBmqdxBFJTCKKMIGqazlf+Sq3Bsd1tRRswPRxy1MZRlJIe6Arz4pdCCmOigA==", - "dev": true, - "engines": { - "name": "cordova", - "version": ">=3.5.0" - } - }, "node_modules/cordova-plugin-x-socialsharing": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-6.0.4.tgz", @@ -7664,14 +7792,14 @@ } }, "node_modules/endent": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/endent/-/endent-1.4.1.tgz", - "integrity": "sha512-buHTb5c8AC9NshtP6dgmNLYkiT+olskbq1z6cEGvfGCF3Qphbu/1zz5Xu+yjTDln8RbxNhPoUyJ5H8MSrp1olQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/endent/-/endent-2.1.0.tgz", + "integrity": "sha512-r8VyPX7XL8U01Xgnb1CjZ3XV+z90cXIJ9JPE/R9SEC9vpw2P6CfsRPJmp20DppC5N7ZAMCmjYkJIa744Iyg96w==", "dev": true, "dependencies": { "dedent": "^0.7.0", "fast-json-parse": "^1.0.3", - "objectorarray": "^1.0.4" + "objectorarray": "^1.0.5" } }, "node_modules/engine.io": { @@ -8580,47 +8708,6 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" }, - "node_modules/fttx-phonegap-plugin-barcodescanner": { - "version": "9.4.4", - "resolved": "git+ssh://git@github.com/fttx/phonegap-plugin-barcodescanner.git#d2448e31dda0240d6a8a4d305ca3d9ac8dbae0ae", - "dev": true, - "license": "MIT", - "dependencies": { - "nopt": "^4.0.1", - "shelljs": "^0.8.3" - }, - "engines": { - "cordovaDependencies": { - "<7.0.0": { - "cordova-android": "<6.3.0" - }, - "7.0.0": { - "cordova-android": ">=6.3.0" - }, - "7.1.0": { - "cordova": ">=7.1.0", - "cordova-android": ">=6.3.0" - }, - "8.0.0": { - "cordova": ">=7.1.0", - "cordova-android": ">=6.3.0" - } - } - } - }, - "node_modules/fttx-phonegap-plugin-barcodescanner/node_modules/nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "dev": true, - "dependencies": { - "abbrev": "1", - "osenv": "^0.1.4" - }, - "bin": { - "nopt": "bin/nopt.js" - } - }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -11237,6 +11324,18 @@ "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", "integrity": "sha512-JwObCrNJuT0Nnbuecmqr5DgtuBppuCvGD9lxjFpAzwnVtdGoDQ1zig+5W8k5/6Gcn0gZ3936HDAlGd28i7sOGQ==" }, + "node_modules/lodash.isdate": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isdate/-/lodash.isdate-4.0.1.tgz", + "integrity": "sha512-hg5B1GD+R9egsBgMwmAhk+V53Us03TVvXT4dnyKugEfsD4QKuG9Wlyvxq8OGy2nu7qVGsh4DRSnMk33hoWBq/Q==", + "dev": true + }, + "node_modules/lodash.isobject": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-3.0.2.tgz", + "integrity": "sha512-3/Qptq2vr7WeJbB4KHUSKlq8Pl7ASXi3UG6CMbBm8WRtXi8+GHm7mKaU3urfpSEzWe2wCIChs6/sdocUsTKJiA==", + "dev": true + }, "node_modules/lodash.keys": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", @@ -11258,6 +11357,12 @@ "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", "dev": true }, + "node_modules/lodash.zip": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.zip/-/lodash.zip-4.2.0.tgz", + "integrity": "sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==", + "dev": true + }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -12489,18 +12594,27 @@ "dev": true }, "node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.0.tgz", + "integrity": "sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==", "dev": true, "dependencies": { - "abbrev": "1" + "abbrev": "^2.0.0" }, "bin": { "nopt": "bin/nopt.js" }, "engines": { - "node": ">=6" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/nopt/node_modules/abbrev": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", + "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==", + "dev": true, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/normalize-package-data": { @@ -12933,15 +13047,6 @@ "node": ">=8" } }, - "node_modules/os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/os-name": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/os-name/-/os-name-4.0.1.tgz", @@ -12965,16 +13070,6 @@ "node": ">=0.10.0" } }, - "node_modules/osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "dependencies": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, "node_modules/p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", @@ -15706,10 +15801,13 @@ } }, "node_modules/skwas-cordova-plugin-datetimepicker": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/skwas-cordova-plugin-datetimepicker/-/skwas-cordova-plugin-datetimepicker-2.1.2.tgz", - "integrity": "sha512-0j/tDjheurvNIg26MVFFbi4RMK2jipYmX6nUq3AOcNtENY1hhLaLUsUM633bJgQmCJGM//gbQWmQX2eaCHK34A==", - "dev": true + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/skwas-cordova-plugin-datetimepicker/-/skwas-cordova-plugin-datetimepicker-3.0.2.tgz", + "integrity": "sha512-7Y+syErTw1CHmfuLLWOewLOrf6e9WC8E2VEMJQb51icJTIypzlRuXnbmRk0p8es0OrZYFgXZv9xOOQoI1ZC//w==", + "dev": true, + "engines": { + "node": ">=10" + } }, "node_modules/slash": { "version": "3.0.0", @@ -17292,12 +17390,6 @@ "node": "*" } }, - "node_modules/underscore": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", - "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==", - "dev": true - }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", diff --git a/package.json b/package.json index c6853ba32..ef3594eff 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@ionic-native/deeplinks": "^5.33.1", "@ionic-native/device": "^5.33.1", "@ionic-native/file": "^5.33.1", - "@ionic-native/file-chooser": "^5.33.1", + "@ionic-native/file-chooser": "^5.36.0", "@ionic-native/file-path": "^5.33.1", "@ionic-native/file-picker": "^5.33.1", "@ionic-native/file-transfer": "^5.34.0", @@ -57,12 +57,9 @@ "chartjs-plugin-annotation": "^1.3.0", "chartjs-plugin-streaming": "^2.0.0", "chartjs-plugin-zoom": "^1.2.0", - "cordova-android-support-gradle-release": "^3.0.1", "cordova-plugin-3dtouch": "^1.3.8", - "cordova-plugin-android-permissions": "1.1.2", "cordova-plugin-appminimize": "^1.0.1", "cordova-plugin-device": "^2.0.3", - "cordova-plugin-enable-multidex": "^0.2.0", "cordova-plugin-filechooser": "^1.2.0", "cordova-plugin-filepicker": "^1.1.6", "cordova-plugin-globalization": "^1.11.0", @@ -95,42 +92,44 @@ "@angular/compiler-cli": "^15.2.3", "@angular/language-service": "^15.2.3", "@ionic/angular-toolkit": "^8.0.0", + "@red-mobile/cordova-plugin-barcodescanner": "^9.1.0", + "@spoonconsulting/cordova-plugin-telerik-imagepicker": "github:spoonconsulting/cordova-plugin-telerik-imagepicker", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.8", "@types/lodash": "^4.14.178", "@types/node": "^12.20.5", "@wisdomgarden/cordova-plugin-filepath": "git+https://github.com/wisdom-garden/cordova-plugin-filepath.git", - "cordova-android": "^10.1.2", + "cordova-android": "^12.0.1", + "cordova-android-support-gradle-release": "^3.0.1", "cordova-clipboard": "^1.3.0", - "cordova-ios": "^6.3.0", + "cordova-ios": "^7.0.1", "cordova-plugin-add-swift-support": "^2.0.2", "cordova-plugin-advanced-http": "^3.3.1", + "cordova-plugin-android-permissions": "^1.1.5", "cordova-plugin-androidx": "^3.0.0", "cordova-plugin-androidx-adapter": "^1.1.3", - "cordova-plugin-app-version": "^0.1.12", + "cordova-plugin-app-version": "^0.1.14", "cordova-plugin-apprate": "^1.7.2", "cordova-plugin-ble-central": "^1.7.0", - "cordova-plugin-camera": "^6.0.0", + "cordova-plugin-camera": "^7.0.0", "cordova-plugin-customurlscheme-ng": "^10.0.0", "cordova-plugin-dialogs": "^2.0.2", - "cordova-plugin-file": "^7.0.0", + "cordova-plugin-enable-multidex": "^0.2.0", + "cordova-plugin-file": "^8.0.0", "cordova-plugin-file-transfer": "github:dpa99c/cordova-plugin-file-transfer", "cordova-plugin-filepath": "^1.6.0", "cordova-plugin-geolocation": "^4.1.0", - "cordova-plugin-health": "^2.0.0", + "cordova-plugin-health": "^2.1.0", "cordova-plugin-inappbrowser": "^5.0.0", "cordova-plugin-insomnia": "^4.3.0", - "cordova-plugin-ionic-webview": "^5.0.0", + "cordova-plugin-ionic-webview": "^5.0.1", "cordova-plugin-nativestorage": "^2.3.2", "cordova-plugin-screen-orientation": "^3.0.2", - "cordova-plugin-simple-file-chooser": "^2.2.1", - "cordova-plugin-splashscreen": "^6.0.0", - "cordova-plugin-telerik-imagepicker": "^2.3.3", - "cordova-plugin-x-socialsharing": "^6.0.3", + "cordova-plugin-splashscreen": "^6.0.1", + "cordova-plugin-x-socialsharing": "^6.0.4", "cordova-sqlite-storage": "^5.1.0", "elliptic": ">=6.5.4", "es6-promise-plugin": "^4.2.2", - "fttx-phonegap-plugin-barcodescanner": "github:fttx/phonegap-plugin-barcodescanner", "husky": "^8.0.1", "ionic-plugin-deeplinks": "^1.0.22", "jasmine-core": "~3.8.0", @@ -143,7 +142,7 @@ "lint-staged": "^13.0.3", "prettier": "^2.7.1", "protractor": "^7.0.0", - "skwas-cordova-plugin-datetimepicker": "^2.1.2", + "skwas-cordova-plugin-datetimepicker": "^3.0.2", "stylelint": "^13.12.0", "stylelint-config-standard": "^20.0.0", "ts-node": "~8.3.0", @@ -159,42 +158,16 @@ "cordova-plugin-device": {}, "cordova-plugin-filechooser": {}, "cordova-plugin-filepicker": {}, - "cordova-plugin-telerik-imagepicker": { - "PHOTO_LIBRARY_USAGE_DESCRIPTION": "The app needs photo library access, so that you can choose from already taken pictures from coffee beans, coffee bags, your own coffee brews etc. This pictures are stored inside the app." - }, "cordova-plugin-appminimize": {}, - "cordova-android-support-gradle-release": { - "ANDROID_SUPPORT_VERSION": "27.+" - }, "cordova-plugin-3dtouch": {}, "cordova-plugin-globalization": {}, - "cordova-plugin-enable-multidex": {}, "cordova-plugin-ionic-keyboard": {}, - "cordova-plugin-app-version": {}, - "cordova-plugin-android-permissions": {}, - "cordova-plugin-splashscreen": {}, "cordova-sqlite-storage": {}, - "cordova-plugin-ionic-webview": {}, "cordova-plugin-inappbrowser": {}, "cordova-plugin-geolocation": { "GPS_REQUIRED": "true" }, - "skwas-cordova-plugin-datetimepicker": {}, - "cordova-plugin-health": { - "HEALTH_READ_PERMISSION": "App needs read access to see the caffeinate amount which was tracked with this coffee app", - "HEALTH_WRITE_PERMISSION": "App needs write access to add the drunken caffeinate amount with the tracked brews", - "FIT_API_VERSION": "19.0.0", - "PLAY_AUTH_VERSION": "18.1.0" - }, "cordova-plugin-insomnia": {}, - "cordova-plugin-apprate": { - "PLAY_CORE_VERSION": "1.+" - }, - "cordova-plugin-androidx-adapter": {}, - "cordova-plugin-androidx": {}, - "fttx-phonegap-plugin-barcodescanner": { - "ANDROID_SUPPORT_V4_VERSION": "27.+" - }, "ionic-plugin-deeplinks": { "URL_SCHEME": "beanconqueror", "DEEPLINK_SCHEME": "https", @@ -214,19 +187,8 @@ "DEEPLINK_5_HOST": " " }, "cordova-plugin-file-transfer": {}, - "cordova-plugin-simple-file-chooser": {}, - "cordova-plugin-x-socialsharing": { - "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.", - "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly." - }, "cordova-plugin-screen-orientation": {}, "cordova-plugin-filepath": {}, - "cordova-plugin-camera": { - "ANDROIDX_CORE_VERSION": "1.6.+" - }, - "cordova-plugin-file": { - "ANDROIDX_WEBKIT_VERSION": "1.4.0" - }, "cordova-plugin-advanced-http": { "ANDROIDBLACKLISTSECURESOCKETPROTOCOLS": "SSLv3,TLSv1" }, @@ -236,11 +198,47 @@ "ACCESS_BACKGROUND_LOCATION": "false", "BLUETOOTH_RESTORE_STATE": "false" }, - "cordova-clipboard": {} + "cordova-clipboard": {}, + "cordova-plugin-apprate": { + "PLAY_CORE_VERSION": "1.+" + }, + "cordova-plugin-android-permissions": {}, + "cordova-plugin-file": { + "ANDROIDX_WEBKIT_VERSION": "1.4.0" + }, + "cordova-android-support-gradle-release": { + "ANDROID_SUPPORT_VERSION": "27.+" + }, + "cordova-plugin-enable-multidex": {}, + "cordova-plugin-androidx-adapter": {}, + "cordova-plugin-androidx": {}, + "@spoonconsulting/cordova-plugin-telerik-imagepicker": { + "PHOTO_LIBRARY_USAGE_DESCRIPTION": "The app needs photo library access, so that you can choose from already taken pictures from coffee beans, coffee bags, your own coffee brews etc. This pictures are stored inside the app." + }, + "cordova-plugin-camera": { + "ANDROIDX_CORE_VERSION": "1.6.+" + }, + "cordova-plugin-x-socialsharing": { + "PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.", + "PHOTO_LIBRARY_USAGE_DESCRIPTION": "This app requires photo library access to function properly." + }, + "@red-mobile/cordova-plugin-barcodescanner": { + "ANDROIDX_LEGACY_SUPPORT_V4_VERSION": "1.0.0" + }, + "cordova-plugin-splashscreen": {}, + "cordova-plugin-app-version": {}, + "cordova-plugin-health": { + "FIT_API_VERSION": "21.1.0", + "PLAY_AUTH_VERSION": "20.2.0", + "HEALTH_READ_PERMISSION": " ", + "HEALTH_WRITE_PERMISSION": " " + }, + "skwas-cordova-plugin-datetimepicker": {}, + "cordova-plugin-ionic-webview": {} }, "platforms": [ - "ios", - "android" + "android", + "ios" ] }, "platforms": [ @@ -255,4 +253,4 @@ "*.css": "stylelint --fix", "*.{ts,js,css,md}": "prettier --write" } -} +} \ No newline at end of file diff --git a/resources/android/icon/drawable-hdpi-icon.png b/resources/android/icon/drawable-hdpi-icon.png index 6193ae18a..50d075960 100644 Binary files a/resources/android/icon/drawable-hdpi-icon.png and b/resources/android/icon/drawable-hdpi-icon.png differ diff --git a/resources/android/icon/drawable-ldpi-icon.png b/resources/android/icon/drawable-ldpi-icon.png index d66fff193..720808c1c 100644 Binary files a/resources/android/icon/drawable-ldpi-icon.png and b/resources/android/icon/drawable-ldpi-icon.png differ diff --git a/resources/android/icon/drawable-mdpi-icon.png b/resources/android/icon/drawable-mdpi-icon.png index e51d32000..5326b57db 100644 Binary files a/resources/android/icon/drawable-mdpi-icon.png and b/resources/android/icon/drawable-mdpi-icon.png differ diff --git a/resources/android/icon/drawable-xhdpi-icon.png b/resources/android/icon/drawable-xhdpi-icon.png index e9d1738fa..dd7357428 100644 Binary files a/resources/android/icon/drawable-xhdpi-icon.png and b/resources/android/icon/drawable-xhdpi-icon.png differ diff --git a/resources/android/icon/drawable-xxhdpi-icon.png b/resources/android/icon/drawable-xxhdpi-icon.png index 8fc870795..b79f3d2b9 100644 Binary files a/resources/android/icon/drawable-xxhdpi-icon.png and b/resources/android/icon/drawable-xxhdpi-icon.png differ diff --git a/resources/android/icon/drawable-xxxhdpi-icon.png b/resources/android/icon/drawable-xxxhdpi-icon.png index ce7006268..98afec8b7 100644 Binary files a/resources/android/icon/drawable-xxxhdpi-icon.png and b/resources/android/icon/drawable-xxxhdpi-icon.png differ diff --git a/resources/android/splash/drawable-land-hdpi-screen.png b/resources/android/splash/drawable-land-hdpi-screen.png index e49a61f88..2078c68b7 100644 Binary files a/resources/android/splash/drawable-land-hdpi-screen.png and b/resources/android/splash/drawable-land-hdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-ldpi-screen.png b/resources/android/splash/drawable-land-ldpi-screen.png index d373d1b4f..62ead4ec4 100644 Binary files a/resources/android/splash/drawable-land-ldpi-screen.png and b/resources/android/splash/drawable-land-ldpi-screen.png differ diff --git a/resources/android/splash/drawable-land-mdpi-screen.png b/resources/android/splash/drawable-land-mdpi-screen.png index 819d2a724..5fce0e3bf 100644 Binary files a/resources/android/splash/drawable-land-mdpi-screen.png and b/resources/android/splash/drawable-land-mdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-xhdpi-screen.png b/resources/android/splash/drawable-land-xhdpi-screen.png index 4e847c4fa..6c151ba9d 100644 Binary files a/resources/android/splash/drawable-land-xhdpi-screen.png and b/resources/android/splash/drawable-land-xhdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-xxhdpi-screen.png b/resources/android/splash/drawable-land-xxhdpi-screen.png index b122b8612..bb471f86b 100644 Binary files a/resources/android/splash/drawable-land-xxhdpi-screen.png and b/resources/android/splash/drawable-land-xxhdpi-screen.png differ diff --git a/resources/android/splash/drawable-land-xxxhdpi-screen.png b/resources/android/splash/drawable-land-xxxhdpi-screen.png index c2c4450ed..7b9b2d2ee 100644 Binary files a/resources/android/splash/drawable-land-xxxhdpi-screen.png and b/resources/android/splash/drawable-land-xxxhdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-hdpi-screen.png b/resources/android/splash/drawable-port-hdpi-screen.png index b0d66c294..6bec36aba 100644 Binary files a/resources/android/splash/drawable-port-hdpi-screen.png and b/resources/android/splash/drawable-port-hdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-ldpi-screen.png b/resources/android/splash/drawable-port-ldpi-screen.png index 2ec2aa56a..aa6fd4955 100644 Binary files a/resources/android/splash/drawable-port-ldpi-screen.png and b/resources/android/splash/drawable-port-ldpi-screen.png differ diff --git a/resources/android/splash/drawable-port-mdpi-screen.png b/resources/android/splash/drawable-port-mdpi-screen.png index 754b9b1c1..308ba2961 100644 Binary files a/resources/android/splash/drawable-port-mdpi-screen.png and b/resources/android/splash/drawable-port-mdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-xhdpi-screen.png b/resources/android/splash/drawable-port-xhdpi-screen.png index f1c0c8fbc..48192263f 100644 Binary files a/resources/android/splash/drawable-port-xhdpi-screen.png and b/resources/android/splash/drawable-port-xhdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-xxhdpi-screen.png b/resources/android/splash/drawable-port-xxhdpi-screen.png index c905993e5..5ec099ec2 100644 Binary files a/resources/android/splash/drawable-port-xxhdpi-screen.png and b/resources/android/splash/drawable-port-xxhdpi-screen.png differ diff --git a/resources/android/splash/drawable-port-xxxhdpi-screen.png b/resources/android/splash/drawable-port-xxxhdpi-screen.png index 27ec904f4..d392d9fe2 100644 Binary files a/resources/android/splash/drawable-port-xxxhdpi-screen.png and b/resources/android/splash/drawable-port-xxxhdpi-screen.png differ diff --git a/resources/android/xml/colors.xml b/resources/android/xml/colors.xml index 4426c93e0..a67da15c9 100644 --- a/resources/android/xml/colors.xml +++ b/resources/android/xml/colors.xml @@ -1,4 +1,5 @@ #F0DECB + #FFFFFF diff --git a/resources/logo_and_slogan.svg b/resources/logo_and_slogan.svg new file mode 100644 index 000000000..aadb99c64 --- /dev/null +++ b/resources/logo_and_slogan.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/slogan.svg b/resources/slogan.svg new file mode 100644 index 000000000..06af58e5b --- /dev/null +++ b/resources/slogan.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/splashscreen_transparent.png b/resources/splashscreen_transparent.png new file mode 100644 index 000000000..affc81abf Binary files /dev/null and b/resources/splashscreen_transparent.png differ diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 9d91ec429..ae9e247ff 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -67,7 +67,12 @@ import { CoffeeBluetoothDevicesService, CoffeeBluetoothServiceEvent, } from '../services/coffeeBluetoothDevices/coffee-bluetooth-devices.service'; -import { PressureType, ScaleType, TemperatureType, RefractometerType } from '../classes/devices'; +import { + PressureType, + ScaleType, + TemperatureType, + RefractometerType, +} from '../classes/devices'; import { Logger } from '../classes/devices/common/logger'; import { UIExportImportHelper } from '../services/uiExportImportHelper'; @@ -319,7 +324,10 @@ export class AppComponent implements AfterViewInit { // #7 this.statusBar.show(); this.statusBar.styleDefault(); - this.splashScreen.hide(); + try { + this.splashScreen.hide(); + } catch (ex) {} + this.keyboard.hideFormAccessoryBar(false); if (environment.production === true) { // When we're in cordova, disable the log messages @@ -583,7 +591,7 @@ export class AppComponent implements AfterViewInit { // After we set the right device language, we check now if we can request external storage if (this.platform.is('cordova') && this.platform.is('android')) { try { - await this.androidPlatformService.checkHasExternalStorage(); + //TODO - await this.androidPlatformService.checkHasExternalStorage(); } catch (ex) {} } diff --git a/src/app/settings/settings.page.spec.ts b/src/app/settings/settings.page.spec.ts index baf9ca184..f7a68d16d 100644 --- a/src/app/settings/settings.page.spec.ts +++ b/src/app/settings/settings.page.spec.ts @@ -1,24 +1,23 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import {SettingsPage} from './settings.page'; -import {TranslateModule} from '@ngx-translate/core'; -import {FormsModule} from '@angular/forms'; -import {IonicStorageModule} from '@ionic/storage'; -import {CommonModule} from '@angular/common'; -import {IonicModule, ModalController, NavParams} from '@ionic/angular'; -import {KeysPipe} from '../../pipes/keys'; -import {InAppBrowser} from '@ionic-native/in-app-browser/ngx'; -import {NavParamsMock} from '../../classes/mock/NavParamsMock'; -import {File} from '@ionic-native/file/ngx'; -import {Camera} from '@ionic-native/camera/ngx'; -import {ImagePicker} from '@ionic-native/image-picker/ngx'; -import {AndroidPermissions} from '@ionic-native/android-permissions/ngx'; -; -import {Router} from '@angular/router'; -import {FileChooser} from '@ionic-native/file-chooser/ngx'; -import {FilePath} from '@ionic-native/file-path/ngx'; -import {IOSFilePicker} from '@ionic-native/file-picker/ngx'; -import {SocialSharing} from '@ionic-native/social-sharing/ngx'; +import { SettingsPage } from './settings.page'; +import { TranslateModule } from '@ngx-translate/core'; +import { FormsModule } from '@angular/forms'; +import { IonicStorageModule } from '@ionic/storage'; +import { CommonModule } from '@angular/common'; +import { IonicModule, ModalController, NavParams } from '@ionic/angular'; +import { KeysPipe } from '../../pipes/keys'; +import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; +import { NavParamsMock } from '../../classes/mock/NavParamsMock'; +import { File } from '@ionic-native/file/ngx'; +import { Camera } from '@ionic-native/camera/ngx'; +import { ImagePicker } from '@ionic-native/image-picker/ngx'; +import { AndroidPermissions } from '@ionic-native/android-permissions/ngx'; +import { Router } from '@angular/router'; +import { FileChooser } from '@ionic-native/file-chooser/ngx'; +import { FilePath } from '@ionic-native/file-path/ngx'; +import { IOSFilePicker } from '@ionic-native/file-picker/ngx'; +import { SocialSharing } from '@ionic-native/social-sharing/ngx'; describe('SettingsPage', () => { let component: SettingsPage; @@ -26,26 +25,31 @@ describe('SettingsPage', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), FormsModule, IonicStorageModule.forRoot(), CommonModule, IonicModule], + imports: [ + TranslateModule.forRoot(), + FormsModule, + IonicStorageModule.forRoot(), + CommonModule, + IonicModule, + ], declarations: [SettingsPage, KeysPipe], providers: [ - {provide: InAppBrowser}, - {provide: ModalController}, - {provide: NavParams, useClass: NavParamsMock}, - {provide: Storage}, - {provide: File}, - {provide: Camera}, - {provide: ImagePicker}, - {provide: AndroidPermissions}, + { provide: InAppBrowser }, + { provide: ModalController }, + { provide: NavParams, useClass: NavParamsMock }, + { provide: Storage }, + { provide: File }, + { provide: Camera }, + { provide: ImagePicker }, + { provide: AndroidPermissions }, - {provide: Router}, - {provide: FileChooser}, - {provide: FilePath}, - {provide: IOSFilePicker}, - {provide: SocialSharing}, + { provide: Router }, + { provide: FileChooser }, + { provide: FilePath }, + { provide: IOSFilePicker }, + { provide: SocialSharing }, ], - }) - .compileComponents(); + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/settings/settings.page.ts b/src/app/settings/settings.page.ts index 4897e7999..a5af17aa4 100644 --- a/src/app/settings/settings.page.ts +++ b/src/app/settings/settings.page.ts @@ -817,31 +817,11 @@ export class SettingsPage implements OnInit { async (resolve) => await window.resolveLocalFileSystemURL(uri, resolve, () => {}) ); - const newPath: string = await this.filePath.resolveNativePath( - fileEntry.nativeURL - ); - let importPath: string = ''; - if (newPath.lastIndexOf('/Download/') > -1) { - let pathFromDownload = newPath.substr( - 0, - newPath.lastIndexOf('/Download/') - ); - const decodedURI = decodeURIComponent(uri); - pathFromDownload = - pathFromDownload + - decodedURI.substring(decodedURI.lastIndexOf('/Download/')); - importPath = pathFromDownload; - importPath = importPath.substring( - 0, - importPath.lastIndexOf('/') + 1 - ); - } else { - // After the new API-Changes we just can support this download path - importPath = - this.file.externalRootDirectory + - 'Download/Beanconqueror_export/'; - } + // After the new API-Changes we just can support this download path + const importPath = + this.file.externalDataDirectory + + 'Download/Beanconqueror_export/'; this.__readZipFile(fileEntry).then( (_importData) => { this.__importJSON(_importData, importPath); @@ -950,23 +930,54 @@ export class SettingsPage implements OnInit { SETTINGS_TRACKING.ACTIONS.EXPORT ); + if (this.platform.is('cordova')) { + if (this.platform.is('android')) { + const storageLocation = cordova.file.externalDataDirectory; + if (storageLocation === null || storageLocation === undefined) { + await this.uiAlert.hideLoadingSpinner(); + await this.uiAlert.showMessage( + 'ANDROID_EXTERNAL_FILE_ACCESS_NEEDED_DESCRIPTION', + 'ANDROID_EXTERNAL_FILE_ACCESS_NOT_POSSIBLE_TITLE', + undefined, + true + ); + //We cant export because no file system existing, so break. + this.uiExportImportHelper.buildExportZIP().then(async (_blob) => { + const reader = new FileReader(); + reader.readAsDataURL(_blob); + reader.onloadend = () => { + let base64data = reader.result.toString(); + console.log(base64data); + base64data = base64data.replace( + 'data:application/octet-stream;', + 'data:application/zip;' + ); + this.socialSharing.share(undefined, 'Beanconqueror', base64data); + }; + }); + + return; + } + } + } + this.uiExportImportHelper.buildExportZIP().then( async (_blob) => { this.uiLog.log('New zip-export way'); const isIOS = this.platform.is('ios'); - const file: FileEntry = await this.uiFileHelper.downloadFile( - 'Beanconqueror.zip', - _blob, - isIOS - ); if (this.platform.is('cordova')) { if (this.platform.is('android')) { await this.exportAttachments(); await this.exportFlowProfiles(); - await this.uiAlert.hideLoadingSpinner(); } } + const file: FileEntry = await this.uiFileHelper.downloadFile( + 'Beanconqueror.zip', + _blob, + true + ); + await this.uiAlert.hideLoadingSpinner(); }, () => { @@ -1121,7 +1132,7 @@ export class SettingsPage implements OnInit { switch (device.platform) { case 'Android': - storageLocation = cordova.file.externalRootDirectory; + storageLocation = cordova.file.externalDataDirectory; break; case 'iOS': storageLocation = cordova.file.documentsDirectory; @@ -1185,7 +1196,7 @@ export class SettingsPage implements OnInit { path, exportingFilename, exportDirectory.nativeURL, - exportingFilename.replace('.json', '.png') + exportingFilename ); } catch (ex) {} } @@ -1202,7 +1213,7 @@ export class SettingsPage implements OnInit { switch (device.platform) { case 'Android': - storageLocation = cordova.file.externalRootDirectory; + storageLocation = cordova.file.externalDataDirectory; break; case 'iOS': storageLocation = cordova.file.documentsDirectory; @@ -1295,10 +1306,7 @@ export class SettingsPage implements OnInit { ) { for (const entry of _storedData) { if (entry.flow_profile) { - await this._importFileFlowProfile( - entry.flow_profile.replace('.json', '.png'), - _importPath - ); + await this._importFileFlowProfile(entry.flow_profile, _importPath); } } } @@ -1369,7 +1377,7 @@ export class SettingsPage implements OnInit { storageLocation, fileName, path + addSubFolder, - fileName.replace('.png', '.json') + fileName ); } else { this.uiLog.log( diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json index b1473dc62..238a8009e 100644 --- a/src/assets/i18n/de.json +++ b/src/assets/i18n/de.json @@ -946,6 +946,18 @@ "Sonstiges:<\/b>", "Kleinere Fehlerbehebungen" ] + }, + "6.6.2": { + "TITLE": "Version 6.6.2: Das ist neu", + "DESCRIPTION": [ + "[ANDROID]Android 13 - Dateisystem Veränderungen:<\/b>", + "[ANDROID]Durch die Veränderungen der Dateisystemrechte in Android, mussten die Zugriffswege, wie Dateien gesichert und Importiert werden überarbeitet werden. Weiterhin hatten Kamera sowie Bildzugriffe nicht mehr funktioniert bei Android 13 Geräten und wurden mit diesem Update nun behoben.", + "[ANDROID]Die Mindestanforderung für diese App musste ebenfalls auf Android 7.0 angehoben werden, durch diese Veränderungen.", + "[ANDROID]Wie der Import/Export nun Funktioniert findest du hier:https://beanconqueror.com/faq", + "", + "[IOS]iOS - Aktualisierung Bibliotheken<\/b>", + "[IOS]Aktualisierung der Cordova-Bibliotheken, die mit diesem Release aktualisiert wurden :)" + ] } }, "CUSTOM_PARAMETERS": "Parameter individualisieren", @@ -1320,7 +1332,7 @@ "LOCATION": "Um Bluetooth-Waagen zu finden, muss der Standort freigegeben werden", "BLUETOOTH": "Um Bluetooth-Waagen zu finden, muss Bluetooth freigegeben werden" }, - "INFORMATION_DESCRIPTION": "Unterstütze Waagen sind: Decent Scale sowie Acaia Scales, Felicita Scales, Hiroia Jimmy, Skale 2, DiFluid Microbalance, Smartchef Scale, Blackcoffee.io und Eureka Precisa. Achtung: Falls die Eureka Precisa einen negativen Wert bekommt, stoppt der Timer automatisch" + "INFORMATION_DESCRIPTION": "Unterstütze Waagen sind: Decent Scale sowie Acaia Scales, Felicita Scales, Hiroia Jimmy, Skale 2, DiFluid Microbalance, Smartchef Scale (V1), Blackcoffee.io und Eureka Precisa. Achtung: Falls die Eureka Precisa einen negativen Wert bekommt, stoppt der Timer automatisch" }, "QR": { "WRONG_QRCODE_DESCRIPTION": "Falscher QR-Code oder falscher Inhalt", @@ -1578,5 +1590,7 @@ "READ_END": "Test wurde abgeschlossen, Wert wurde übertragen" }, "COPIED_TO_CLIPBOARD_SUCCESSFULLY": "Zum Clipboard hinzugefügt", - "COPIED_TO_CLIPBOARD_UNSUCCESSFULLY": "Konnte nicht zum Clipboard hinzugefügt werden" + "COPIED_TO_CLIPBOARD_UNSUCCESSFULLY": "Konnte nicht zum Clipboard hinzugefügt werden", + "ANDROID_EXTERNAL_FILE_ACCESS_NOT_POSSIBLE_TITLE": "Daten können nicht extern gespeichert werden", + "ANDROID_EXTERNAL_FILE_ACCESS_NEEDED_DESCRIPTION": "Leider unterstützt dein Android-Handy keine externen Dateisysteme zum abspeichern, daher wird dir im nachfolgenden Schritt die ZIP-Datei ohne Media-Dateien zum herunterladen angeboten. Bitte schaue unter https://beanconqueror.com/faq für mehr Infromationen" } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 3c3f0a98b..5afccf3e7 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -946,6 +946,18 @@ "Others:<\/b>", "Small bug fixes" ] + }, + "6.6.2": { + "TITLE": "Version 6.6.2: What's new", + "DESCRIPTION": [ + "[ANDROID]Android 13 - Filestorage permissions<\/b>", + "[ANDROID]Due to changes in the file system permissions in Android, the access paths for how files are backed up and imported had to be revised. In addition, camera and image access no longer worked on Android 13 devices and got fixed with this update.", + "[ANDROID]Due to these changes, the minimum requirement for this app also had to be raised to Android 7.0.", + "[ANDROID]You can find out how Import/Export works now here: https://beanconqueror.com/faq", + "", + "[IOS]iOS - Updated libraries<\/b>", + "[IOS]Due to library changes in cordova, this is a release to match all these :)" + ] } }, "CUSTOM_PARAMETERS": "Customize parameters", @@ -1320,7 +1332,7 @@ "LOCATION": "To find bluetooth scales, the app needs access to the location.", "BLUETOOTH": "To find bluetooth scales, the app needs access to bluetooth" }, - "INFORMATION_DESCRIPTION": "Supported scales are: Decent Scale, Acaia, Felicita, Hiroia Jimmy, Skale 2, DiFluid Microbalance, Smartchef Scale, Blackcoffee.io and Eureka Precisa. Note: If the Eureka Precisa recieves a negative value, the timer stops" + "INFORMATION_DESCRIPTION": "Supported scales are: Decent Scale, Acaia, Felicita, Hiroia Jimmy, Skale 2, DiFluid Microbalance, Smartchef Scale (V1), Blackcoffee.io and Eureka Precisa. Note: If the Eureka Precisa recieves a negative value, the timer stops" }, "QR": { "WRONG_QRCODE_DESCRIPTION": "Invalid QR code or unrecognised content", @@ -1578,5 +1590,7 @@ "READ_END": "Test finished - result received" }, "COPIED_TO_CLIPBOARD_SUCCESSFULLY": "Added to clipboard", - "COPIED_TO_CLIPBOARD_UNSUCCESSFULLY": "Could not be added to clipboard" + "COPIED_TO_CLIPBOARD_UNSUCCESSFULLY": "Could not be added to clipboard", + "ANDROID_EXTERNAL_FILE_ACCESS_NOT_POSSIBLE_TITLE": "Data can't be saved due to Android restrictions", + "ANDROID_EXTERNAL_FILE_ACCESS_NEEDED_DESCRIPTION": "Your Android phone doesn't support external file systems, so you'll need to download the ZIP file without media files. For more information, please visit https://beanconqueror.com/faq." } diff --git a/src/assets/i18n/es.json b/src/assets/i18n/es.json index dd04d736c..49eacc43a 100644 --- a/src/assets/i18n/es.json +++ b/src/assets/i18n/es.json @@ -946,6 +946,18 @@ "Otros<\/b>", "Corrección de errores menores" ] + }, + "6.6.2": { + "TITLE": "Version 6.6.2: What's new", + "DESCRIPTION": [ + "[ANDROID]Android 13 - Filestorage permissions<\/b>", + "[ANDROID]Due to changes in the file system permissions in Android, the access paths for how files are backed up and imported had to be revised. In addition, camera and image access no longer worked on Android 13 devices and got fixed with this update.", + "[ANDROID]Due to these changes, the minimum requirement for this app also had to be raised to Android 7.0.", + "[ANDROID]You can find out how Import/Export works now here: https://beanconqueror.com/faq", + "", + "[IOS]iOS - Updated libraries<\/b>", + "[IOS]Due to library changes in cordova, this is a release to match all these :)" + ] } }, "CUSTOM_PARAMETERS": "Personalizar parámetros", @@ -1320,7 +1332,7 @@ "LOCATION": "Para encontrar básculas bluetooth, la aplicación necesita acceder a la ubicación.", "BLUETOOTH": "Para encontrar básculas bluetooth, la aplicación necesita acceso al bluetooth" }, - "INFORMATION_DESCRIPTION": "Básculas compatibles: Decent, Acaia, Felicita, Hiroia Jimmy, Skale 2, DiFluid Microbalance, Smartchef Scale, Blackcoffee.io y Eureka Precise. Atención: Si la báscula Eureka Precise recibe un valor negativo, el temporizador se detiene" + "INFORMATION_DESCRIPTION": "Básculas compatibles: Decent, Acaia, Felicita, Hiroia Jimmy, Skale 2, DiFluid Microbalance, Smartchef Scale (V1), Blackcoffee.io y Eureka Precise. Atención: Si la báscula Eureka Precise recibe un valor negativo, el temporizador se detiene" }, "QR": { "WRONG_QRCODE_DESCRIPTION": "Código QR incorrecto o contenido incorrecto", @@ -1578,5 +1590,7 @@ "READ_END": "Prueba finalizada - resultado recibido" }, "COPIED_TO_CLIPBOARD_SUCCESSFULLY": "Copiado al portapapeles", - "COPIED_TO_CLIPBOARD_UNSUCCESSFULLY": "No se ha podido copiar al portapeles" + "COPIED_TO_CLIPBOARD_UNSUCCESSFULLY": "No se ha podido copiar al portapeles", + "ANDROID_EXTERNAL_FILE_ACCESS_NOT_POSSIBLE_TITLE": "Data can't be saved due to Android restrictions", + "ANDROID_EXTERNAL_FILE_ACCESS_NEEDED_DESCRIPTION": "Your Android phone doesn't support external file systems, so you'll need to download the ZIP file without media files. For more information, please visit https://beanconqueror.com/faq." } diff --git a/src/assets/i18n/tr.json b/src/assets/i18n/tr.json index ac39016e7..6fca10b3e 100644 --- a/src/assets/i18n/tr.json +++ b/src/assets/i18n/tr.json @@ -946,6 +946,18 @@ "Diğerleri:<\/b>", "Daha küçük hata düzeltmeleri" ] + }, + "6.6.2": { + "TITLE": "Version 6.6.2: What's new", + "DESCRIPTION": [ + "[ANDROID]Android 13 - Filestorage permissions<\/b>", + "[ANDROID]Due to changes in the file system permissions in Android, the access paths for how files are backed up and imported had to be revised. In addition, camera and image access no longer worked on Android 13 devices and got fixed with this update.", + "[ANDROID]Due to these changes, the minimum requirement for this app also had to be raised to Android 7.0.", + "[ANDROID]You can find out how Import/Export works now here: https://beanconqueror.com/faq", + "", + "[IOS]iOS - Updated libraries<\/b>", + "[IOS]Due to library changes in cordova, this is a release to match all these :)" + ] } }, "CUSTOM_PARAMETERS": "Parametreyi özelleştir", @@ -1320,7 +1332,7 @@ "LOCATION": "Bluetooth ile terazisiyi bulmak için uygulamanın konuma erişmesi gerekiyor.", "BLUETOOTH": "Bluetooth ile terazisiyi bulmak için uygulamanın bluetooth erişimi gerekiyor." }, - "INFORMATION_DESCRIPTION": "Desteklenen tartılar: Decent Tartı, Acaia Tartı, Felicita Tartı, Hiroia Jimmy, Skale 2, DiFluid Microbalance, Smartchef Scale, Blackcoffee.io and Eureka Precisa. Care: If the Eureka Precisa recieves a negative value, the timer stops" + "INFORMATION_DESCRIPTION": "Desteklenen tartılar: Decent Tartı, Acaia Tartı, Felicita Tartı, Hiroia Jimmy, Skale 2, DiFluid Microbalance, Smartchef Scale (V1), Blackcoffee.io and Eureka Precisa. Care: If the Eureka Precisa recieves a negative value, the timer stops" }, "QR": { "WRONG_QRCODE_DESCRIPTION": "Yanlış qr kodu veya yanlış içerik", @@ -1578,5 +1590,7 @@ "READ_END": "Test tamamlandı - sonuç alındı" }, "COPIED_TO_CLIPBOARD_SUCCESSFULLY": "Panoya eklendi", - "COPIED_TO_CLIPBOARD_UNSUCCESSFULLY": "Panoya eklenemedi" + "COPIED_TO_CLIPBOARD_UNSUCCESSFULLY": "Panoya eklenemedi", + "ANDROID_EXTERNAL_FILE_ACCESS_NOT_POSSIBLE_TITLE": "Data can't be saved due to Android restrictions", + "ANDROID_EXTERNAL_FILE_ACCESS_NEEDED_DESCRIPTION": "Your Android phone doesn't support external file systems, so you'll need to download the ZIP file without media files. For more information, please visit https://beanconqueror.com/faq." } diff --git a/src/assets/i18n/zh.json b/src/assets/i18n/zh.json index 934b1ff6f..0d5f56feb 100644 --- a/src/assets/i18n/zh.json +++ b/src/assets/i18n/zh.json @@ -946,6 +946,18 @@ "其他:<\/b>", "修复了一些小错误" ] + }, + "6.6.2": { + "TITLE": "Version 6.6.2: What's new", + "DESCRIPTION": [ + "[ANDROID]Android 13 - Filestorage permissions<\/b>", + "[ANDROID]Due to changes in the file system permissions in Android, the access paths for how files are backed up and imported had to be revised. In addition, camera and image access no longer worked on Android 13 devices and got fixed with this update.", + "[ANDROID]Due to these changes, the minimum requirement for this app also had to be raised to Android 7.0.", + "[ANDROID]You can find out how Import/Export works now here: https://beanconqueror.com/faq", + "", + "[IOS]iOS - Updated libraries<\/b>", + "[IOS]Due to library changes in cordova, this is a release to match all these :)" + ] } }, "CUSTOM_PARAMETERS": "自定义参数", @@ -1320,7 +1332,7 @@ "LOCATION": "软件需要位置权限来搜索电子秤", "BLUETOOTH": "软件需要蓝牙权限来搜索电子秤" }, - "INFORMATION_DESCRIPTION": "支持的电子秤: Decent 电子秤, Acaia 电子秤, Felicita 电子秤以及 Hiroia Jimmy, Skale 2, DiFluid Microbalance, Smartchef Scale, Blackcoffee.io and Eureka Precisa. Care: If the Eureka Precisa recieves a negative value, the timer stops" + "INFORMATION_DESCRIPTION": "支持的电子秤: Decent 电子秤, Acaia 电子秤, Felicita 电子秤以及 Hiroia Jimmy, Skale 2, DiFluid Microbalance, Smartchef Scale (V1), Blackcoffee.io and Eureka Precisa. Care: If the Eureka Precisa recieves a negative value, the timer stops" }, "QR": { "WRONG_QRCODE_DESCRIPTION": "错误的二维码或错误的内容", @@ -1578,5 +1590,7 @@ "READ_END": "测试完成 - 收到结果" }, "COPIED_TO_CLIPBOARD_SUCCESSFULLY": "已复制到剪贴板", - "COPIED_TO_CLIPBOARD_UNSUCCESSFULLY": "无法复制到剪贴板" + "COPIED_TO_CLIPBOARD_UNSUCCESSFULLY": "无法复制到剪贴板", + "ANDROID_EXTERNAL_FILE_ACCESS_NOT_POSSIBLE_TITLE": "Data can't be saved due to Android restrictions", + "ANDROID_EXTERNAL_FILE_ACCESS_NEEDED_DESCRIPTION": "Your Android phone doesn't support external file systems, so you'll need to download the ZIP file without media files. For more information, please visit https://beanconqueror.com/faq." } diff --git a/src/classes/devices/etiTemperature.ts b/src/classes/devices/etiTemperature.ts index 9e56c02ed..75b799ab2 100644 --- a/src/classes/devices/etiTemperature.ts +++ b/src/classes/devices/etiTemperature.ts @@ -12,6 +12,7 @@ declare var ble: any; export class ETITemperature extends TemperatureDevice { public static DEVICE_NAME = 'THERMAQBLUE'; + public static DEVICE_NAME_SECOND = 'THERMAQ BLUE'; public static TEMPERATURE_SERVICE_UUID = '45544942-4c55-4554-4845-524db87ad700'; public static TEMPERATURE_CHANNEL_1_TEMP_CHAR_UUID = @@ -39,7 +40,8 @@ export class ETITemperature extends TemperatureDevice { return ( device && device.name && - device.name.toUpperCase().includes(ETITemperature.DEVICE_NAME) + (device.name.toUpperCase().includes(ETITemperature.DEVICE_NAME) || + device.name.toUpperCase().includes(ETITemperature.DEVICE_NAME_SECOND)) ); } diff --git a/src/classes/version/iVersion.ts b/src/classes/version/iVersion.ts index 98c45e42c..9016a831a 100755 --- a/src/classes/version/iVersion.ts +++ b/src/classes/version/iVersion.ts @@ -78,6 +78,7 @@ export class Version implements IVersion { '6.5.1', '6.6.0', '6.6.1', + '6.6.2', ]; } diff --git a/src/popover/update-popover/update-popover.component.html b/src/popover/update-popover/update-popover.component.html index 119c74bc6..a61c880f2 100644 --- a/src/popover/update-popover/update-popover.component.html +++ b/src/popover/update-popover/update-popover.component.html @@ -10,8 +10,8 @@
    -
  • -
  • +
  • +
  •  
diff --git a/src/popover/update-popover/update-popover.component.ts b/src/popover/update-popover/update-popover.component.ts index 4aa39737c..a414cf881 100644 --- a/src/popover/update-popover/update-popover.component.ts +++ b/src/popover/update-popover/update-popover.component.ts @@ -1,6 +1,11 @@ -import {Component, Input, OnInit, ViewChild} from '@angular/core'; -import {IonContent, IonSlides, ModalController} from '@ionic/angular'; -import {TranslateService} from '@ngx-translate/core'; +import { Component, Input, OnInit, ViewChild } from '@angular/core'; +import { + IonContent, + IonSlides, + ModalController, + Platform, +} from '@ionic/angular'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-update-popover', @@ -8,25 +13,38 @@ import {TranslateService} from '@ngx-translate/core'; styleUrls: ['./update-popover.component.scss'], }) export class UpdatePopoverComponent implements OnInit { - @Input() public versions: Array; public slideOpts = { allowTouchMove: false, - speed: 400 + speed: 400, }; public slide: number = 1; - @ViewChild('slider', {static: false}) public updateSlider: IonSlides; - @ViewChild('updateContent', {static: false}) public updateContentElement: IonContent; + @ViewChild('slider', { static: false }) public updateSlider: IonSlides; + @ViewChild('updateContent', { static: false }) + public updateContentElement: IonContent; - constructor(private readonly modalController: ModalController, - private translate: TranslateService) { + constructor( + private readonly modalController: ModalController, + private translate: TranslateService, + private readonly platform: Platform + ) {} + public isAndroid() { + if (this.platform.is('android')) { + return true; + } + return false; + } + public isIOS() { + if (this.platform.is('ios')) { + return true; + } + return false; } - public nextSlide() { this.updateSlider.slideNext(); this.updateContentElement.scrollToTop(250); - this.slide ++; + this.slide++; this.__triggerUpdate(); } public finish() { @@ -34,7 +52,7 @@ export class UpdatePopoverComponent implements OnInit { } public ngOnInit() { - this.__triggerUpdate(); + this.__triggerUpdate(); } private __triggerUpdate() { @@ -45,14 +63,53 @@ export class UpdatePopoverComponent implements OnInit { } public dismiss() { - this.modalController.dismiss({ - dismissed: true - }, undefined, 'update-popover'); + this.modalController.dismiss( + { + dismissed: true, + }, + undefined, + 'update-popover' + ); } public getDescription(_version: string): Array { - const translatedStr: any = this.translate.instant( 'UPDATE_TEXT_TITLE_TITLE.' + _version + '.DESCRIPTION' ); + const translatedStr: any = this.translate.instant( + 'UPDATE_TEXT_TITLE_TITLE.' + _version + '.DESCRIPTION' + ); return [...translatedStr]; + } + + public getDesc(_description: string) { + if (_description.startsWith('[ANDROID]')) { + if (this.isAndroid()) { + return _description.replace('[ANDROID]', ''); + } else { + return ''; + } + } else if (_description.startsWith('[IOS]')) { + if (this.isIOS()) { + return _description.replace('[IOS]', ''); + } else { + return ''; + } + } + return _description; + } + public canRenderDesc(_description: string): boolean { + if (_description.startsWith('[ANDROID]')) { + if (this.isAndroid()) { + return true; + } else { + return false; + } + } else if (_description.startsWith('[IOS]')) { + if (this.isIOS()) { + return true; + } else { + return false; + } + } + return true; } } diff --git a/src/services/androidPlatform/android-platform.service.ts b/src/services/androidPlatform/android-platform.service.ts index 6112011aa..396993846 100644 --- a/src/services/androidPlatform/android-platform.service.ts +++ b/src/services/androidPlatform/android-platform.service.ts @@ -57,7 +57,7 @@ export class AndroidPlatformService { } } - private requestExternalStorageAccess() { + /* private requestExternalStorageAccess() { const promise = new Promise((resolve, reject) => { this.androidPermissions .requestPermission( @@ -112,5 +112,5 @@ export class AndroidPlatformService { ); }); return promise; - } + }*/ } diff --git a/src/services/intentHandler/intent-handler.service.ts b/src/services/intentHandler/intent-handler.service.ts index 88f206f15..ed7a4dc84 100644 --- a/src/services/intentHandler/intent-handler.service.ts +++ b/src/services/intentHandler/intent-handler.service.ts @@ -31,19 +31,21 @@ export class IntentHandlerService { ) {} public attachOnHandleOpenUrl() { - IonicDeeplink.route( - { - '/NO_LINK_EVER_WILL_WORK_HERE/': '/NO_LINK_EVER_WILL_WORK_HERE/', - }, - (match) => { - this.uiLog.log('Deeplink matched ' + JSON.stringify(match)); - this.handleDeepLink(match.$link); - }, - (nomatch) => { - this.uiLog.log('Deeplink not matched ' + JSON.stringify(nomatch)); - this.handleDeepLink(nomatch.$link); - } - ); + if (typeof IonicDeeplink !== 'undefined') { + IonicDeeplink.route( + { + '/NO_LINK_EVER_WILL_WORK_HERE/': '/NO_LINK_EVER_WILL_WORK_HERE/', + }, + (match) => { + this.uiLog.log('Deeplink matched ' + JSON.stringify(match)); + this.handleDeepLink(match.$link); + }, + (nomatch) => { + this.uiLog.log('Deeplink not matched ' + JSON.stringify(nomatch)); + this.handleDeepLink(nomatch.$link); + } + ); + } } private findGetParameter(_url: string, _parameterName: string) { let result = null, diff --git a/src/services/uiExcel.ts b/src/services/uiExcel.ts index 554f853c9..f6293e374 100755 --- a/src/services/uiExcel.ts +++ b/src/services/uiExcel.ts @@ -527,19 +527,10 @@ export class UIExcel { try { const downloadFile: FileEntry = await this.uiFileHelper.downloadFile( filename, - blob + blob, + true ); await this.uiAlert.hideLoadingSpinner(); - if (this.platform.is('android')) { - const alert = await this.alertCtrl.create({ - header: this.translate.instant('DOWNLOADED'), - subHeader: this.translate.instant('FILE_DOWNLOADED_SUCCESSFULLY', { - fileName: filename, - }), - buttons: ['OK'], - }); - await alert.present(); - } } catch (ex) {} } catch (e) { if (e.message.match(/It was determined/)) { diff --git a/src/services/uiFileHelper.ts b/src/services/uiFileHelper.ts index 01db5db07..e53dc770c 100644 --- a/src/services/uiFileHelper.ts +++ b/src/services/uiFileHelper.ts @@ -142,7 +142,7 @@ export class UIFileHelper extends InstanceClass { reject(); } }, - () => { + (ex) => { reject(); } ); @@ -231,6 +231,35 @@ export class UIFileHelper extends InstanceClass { } }); } + public async readFileAsBinaryString(_filePath: string): Promise { + return new Promise(async (resolve, reject) => { + if (this.platform.is('cordova')) { + let path: string; + let fileName: string; + path = this.getFileDirectory(); + fileName = _filePath; + if (fileName.startsWith('/')) { + fileName = fileName.slice(1); + } + + this.file.readAsBinaryString(path, fileName).then( + (result) => { + try { + resolve(result as any); + } catch (ex) { + this.uiLog.error('We could not read file ' + ex.message); + reject(); + } + }, + (ex) => { + reject(); + } + ); + } else { + reject(); + } + }); + } public async getZIPFileByPathAndFile( _path: string, _fileName: string @@ -325,86 +354,95 @@ export class UIFileHelper extends InstanceClass { if (this.platform.is('cordova')) { let storageLocation: string = ''; if (this.platform.is('android')) { - storageLocation = this.file.externalRootDirectory; + storageLocation = this.file.externalDataDirectory; } else { storageLocation = this.file.documentsDirectory; } - const lastSevenDays: Array = []; - for (let i = 0; i < 8; i++) { - const day: string = moment().subtract(i, 'days').format('DD_MM_YYYY'); - const automatedBackupFileName: string = - 'Beanconqueror_automatic_export_' + day + '.zip'; - lastSevenDays.push(automatedBackupFileName); - } + if (storageLocation !== null && storageLocation !== undefined) { + const lastSevenDays: Array = []; + for (let i = 0; i < 8; i++) { + const day: string = moment() + .subtract(i, 'days') + .format('DD_MM_YYYY'); + const automatedBackupFileName: string = + 'Beanconqueror_automatic_export_' + day + '.zip'; + lastSevenDays.push(automatedBackupFileName); + } - window.resolveLocalFileSystemURL( - storageLocation, - (fileSystem) => { - fileSystem.getDirectory( - 'Download', - { - create: true, - exclusive: false, - }, - (directory) => { - directory.getDirectory( - 'Beanconqueror_export', - { - create: true, - exclusive: false, - }, - (directory_export: DirectoryEntry) => { - const directoryReader = directory_export.createReader(); - directoryReader.readEntries( - (entries: Entry[]) => { - for (const entry of entries) { - if (entry.isFile) { - if ( - lastSevenDays.indexOf(entry.name) === -1 && - entry.name.indexOf( - 'Beanconqueror_automatic_export_' - ) === 0 - ) { - const filename: string = entry.name; - entry.remove( - () => { - this.uiLog.log( - 'Removed automated backup file ' + filename - ); - }, - () => { - this.uiLog.log( - 'Could not remove automated backup file ' + - filename - ); - } - ); - } else if (lastSevenDays.indexOf(entry.name) > -1) { - this.uiLog.log( - 'We found a backup file not older then 7 days, so dont delete it' - ); + window.resolveLocalFileSystemURL( + storageLocation, + (fileSystem) => { + fileSystem.getDirectory( + 'Download', + { + create: true, + exclusive: false, + }, + (directory) => { + directory.getDirectory( + 'Beanconqueror_export', + { + create: true, + exclusive: false, + }, + (directory_export: DirectoryEntry) => { + const directoryReader = directory_export.createReader(); + directoryReader.readEntries( + (entries: Entry[]) => { + for (const entry of entries) { + if (entry.isFile) { + if ( + lastSevenDays.indexOf(entry.name) === -1 && + entry.name.indexOf( + 'Beanconqueror_automatic_export_' + ) === 0 + ) { + const filename: string = entry.name; + entry.remove( + () => { + this.uiLog.log( + 'Removed automated backup file ' + + filename + ); + }, + () => { + this.uiLog.log( + 'Could not remove automated backup file ' + + filename + ); + } + ); + } else if ( + lastSevenDays.indexOf(entry.name) > -1 + ) { + this.uiLog.log( + 'We found a backup file not older then 7 days, so dont delete it' + ); + } } } - } - }, - () => {} - ); - }, - () => { - reject(); - } - ); - }, - () => { - reject(); - } - ); - }, - () => { - reject(); - } - ); + }, + () => {} + ); + }, + () => { + reject(); + } + ); + }, + () => { + reject(); + } + ); + }, + () => { + reject(); + } + ); + } else { + reject(); + } } else { reject(undefined); } @@ -449,76 +487,79 @@ export class UIFileHelper extends InstanceClass { if (this.platform.is('cordova')) { let storageLocation: string = ''; if (this.platform.is('android')) { - storageLocation = this.file.externalRootDirectory; + storageLocation = this.file.externalDataDirectory; } else { storageLocation = this.file.documentsDirectory; } - - window.resolveLocalFileSystemURL( - storageLocation, - (fileSystem) => { - fileSystem.getDirectory( - 'Download', - { - create: true, - exclusive: false, - }, - (directory) => { - directory.getDirectory( - 'Beanconqueror_export', - { - create: true, - exclusive: false, - }, - (directory_export) => { - // You need to put the name you would like to use for the file here. - directory_export.getFile( - _filename, - { - create: true, - exclusive: false, - }, - (fileEntry: FileEntry) => { - fileEntry.createWriter( - (writer) => { - writer.onwriteend = () => { - if (_share === true) { - this.socialSharing.share( - undefined, - undefined, - fileEntry.nativeURL - ); - } - resolve(fileEntry); - }; - - writer.seek(0); - writer.write(_blob); // You need to put the file, blob or base64 representation here. - }, - () => { - reject(); - } - ); - }, - () => { - reject(); - } - ); - }, - () => { - reject(); - } - ); - }, - () => { - reject(); - } - ); - }, - () => { - reject(); - } - ); + if (storageLocation !== null && storageLocation !== undefined) { + window.resolveLocalFileSystemURL( + storageLocation, + (fileSystem) => { + fileSystem.getDirectory( + 'Download', + { + create: true, + exclusive: false, + }, + (directory) => { + directory.getDirectory( + 'Beanconqueror_export', + { + create: true, + exclusive: false, + }, + (directory_export) => { + // You need to put the name you would like to use for the file here. + directory_export.getFile( + _filename, + { + create: true, + exclusive: false, + }, + (fileEntry: FileEntry) => { + fileEntry.createWriter( + (writer) => { + writer.onwriteend = () => { + if (_share === true) { + this.socialSharing.share( + undefined, + undefined, + fileEntry.nativeURL + ); + } + resolve(fileEntry); + }; + + writer.seek(0); + writer.write(_blob); // You need to put the file, blob or base64 representation here. + }, + () => { + reject(); + } + ); + }, + () => { + reject(); + } + ); + }, + () => { + reject(); + } + ); + }, + () => { + reject(); + } + ); + }, + () => { + reject(); + } + ); + } else { + reject(); + } } else { resolve(undefined); setTimeout(() => { diff --git a/src/services/uiImage.ts b/src/services/uiImage.ts index 8e6352445..d461a6af4 100755 --- a/src/services/uiImage.ts +++ b/src/services/uiImage.ts @@ -1,57 +1,54 @@ /** Core */ -import {Injectable} from '@angular/core'; -import {AndroidPermissions} from '@ionic-native/android-permissions/ngx'; +import { Injectable } from '@angular/core'; +import { AndroidPermissions } from '@ionic-native/android-permissions/ngx'; /** Ionic native */ -import {Camera, CameraOptions} from '@ionic-native/camera/ngx'; -import {ImagePicker} from '@ionic-native/image-picker/ngx'; +import { Camera, CameraOptions } from '@ionic-native/camera/ngx'; +import { ImagePicker } from '@ionic-native/image-picker/ngx'; /** Ionic */ -import {AlertController, ModalController, Platform} from '@ionic/angular'; -import {UIHelper} from './uiHelper'; -import {UIFileHelper} from './uiFileHelper'; -import {TranslateService} from '@ngx-translate/core'; -import {FileChooser} from '@ionic-native/file-chooser/ngx'; -import {FilePath} from '@ionic-native/file-path/ngx'; -import {UIAlert} from './uiAlert'; -import {PhotoPopoverComponent} from '../popover/photo-popover/photo-popover.component'; -import {Brew} from '../classes/brew/brew'; -import {GreenBean} from '../classes/green-bean/green-bean'; -import {Bean} from '../classes/bean/bean'; -import {RoastingMachine} from '../classes/roasting-machine/roasting-machine'; -import {UISettingsStorage} from './uiSettingsStorage'; -import {Settings} from '../classes/settings/settings'; -import {Water} from '../classes/water/water'; -import {Mill} from '../classes/mill/mill'; -import {Preparation} from '../classes/preparation/preparation'; -import {UILog} from './uiLog'; +import { AlertController, ModalController, Platform } from '@ionic/angular'; +import { UIHelper } from './uiHelper'; +import { UIFileHelper } from './uiFileHelper'; +import { TranslateService } from '@ngx-translate/core'; +import { FilePath } from '@ionic-native/file-path/ngx'; +import { UIAlert } from './uiAlert'; +import { PhotoPopoverComponent } from '../popover/photo-popover/photo-popover.component'; +import { Brew } from '../classes/brew/brew'; +import { GreenBean } from '../classes/green-bean/green-bean'; +import { Bean } from '../classes/bean/bean'; +import { RoastingMachine } from '../classes/roasting-machine/roasting-machine'; +import { UISettingsStorage } from './uiSettingsStorage'; +import { Settings } from '../classes/settings/settings'; +import { Water } from '../classes/water/water'; +import { Mill } from '../classes/mill/mill'; +import { Preparation } from '../classes/preparation/preparation'; +import { UILog } from './uiLog'; -declare var chooser; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class UIImage { - - constructor (private readonly camera: Camera, - private readonly imagePicker: ImagePicker, - private readonly alertController: AlertController, - private readonly platform: Platform, - private readonly androidPermissions: AndroidPermissions, - private readonly uiHelper: UIHelper, - private readonly uiFileHelper: UIFileHelper, - private readonly translate: TranslateService, - private readonly fileChooser: FileChooser, - private readonly filePath: FilePath, - private readonly uiAlert: UIAlert, - private readonly modalCtrl: ModalController, - private readonly uiSettingsStorage: UISettingsStorage, - private readonly uiLog: UILog) { - } + constructor( + private readonly camera: Camera, + private readonly imagePicker: ImagePicker, + private readonly alertController: AlertController, + private readonly platform: Platform, + private readonly androidPermissions: AndroidPermissions, + private readonly uiHelper: UIHelper, + private readonly uiFileHelper: UIFileHelper, + private readonly translate: TranslateService, + private readonly filePath: FilePath, + private readonly uiAlert: UIAlert, + private readonly modalCtrl: ModalController, + private readonly uiSettingsStorage: UISettingsStorage, + private readonly uiLog: UILog + ) {} private getImageQuality() { const settings: Settings = this.uiSettingsStorage.getSettings(); return settings.image_quality; } - public async takePhoto (): Promise { + public async takePhoto(): Promise { const promise = new Promise((resolve, reject) => { // const isIos: boolean = this.platform.is('ios'); const options: CameraOptions = { @@ -62,26 +59,29 @@ export class UIImage { sourceType: this.camera.PictureSourceType.CAMERA, saveToPhotoAlbum: false, correctOrientation: true, - cameraDirection: this.camera.Direction.BACK + cameraDirection: this.camera.Direction.BACK, }; this.camera.getPicture(options).then( - (imageData) => { - - const imageStr: string = `data:image/jpeg;base64,${imageData}`; - this.uiFileHelper.saveBase64File('beanconqueror_image', '.jpg', imageStr).then((_newURL) => { - // const filePath = _newURL.replace(/^file:\/\//, ''); - resolve(_newURL); - // this.__cleanupCamera(); - },(_error) => { - reject(_error); - }); - }, - (_error: any) => { - reject(_error); - - } - ); + (imageData) => { + const imageStr: string = `data:image/jpeg;base64,${imageData}`; + this.uiFileHelper + .saveBase64File('beanconqueror_image', '.jpg', imageStr) + .then( + (_newURL) => { + // const filePath = _newURL.replace(/^file:\/\//, ''); + resolve(_newURL); + // this.__cleanupCamera(); + }, + (_error) => { + reject(_error); + } + ); + }, + (_error: any) => { + reject(_error); + } + ); }); return promise; @@ -93,141 +93,146 @@ export class UIImage { const isIOS: boolean = this.platform.is('ios'); if (isCordova && isIOS) { this.uiLog.log('Cleanup camera'); - this.camera.cleanup().then(() => { - this.uiLog.log('Cleanup camera - sucessfully'); - }, () => { - this.uiLog.error('Cleanup camera - error'); - }); + this.camera.cleanup().then( + () => { + this.uiLog.log('Cleanup camera - sucessfully'); + }, + () => { + this.uiLog.error('Cleanup camera - error'); + } + ); } - - } catch( ex) { - - } - - - + } catch (ex) {} } public async choosePhoto(): Promise { const promise = new Promise(async (resolve, reject) => { - this.__checkPermission(async () => { - + this.__checkPermission( + async () => { setTimeout(async () => { - const isCordova: boolean = this.platform.is('cordova'); const isAndroid: boolean = this.platform.is('android'); const fileurls: Array = []; if (!(isCordova && isAndroid)) { if (isCordova) { // https://github.com/Telerik-Verified-Plugins/ImagePicker/issues/173#issuecomment-559096572 - this.imagePicker.getPictures({ + this.imagePicker + .getPictures({ + maximumImagesCount: 5, + outputType: 1, + disable_popover: true, + quality: this.getImageQuality(), + }) + .then( + async (results) => { + await this.uiAlert.showLoadingSpinner(); + for (const result of results) { + if ( + result && + result.length > 0 && + result !== 0 && + result !== '' && + result !== 'OK' && + result.length > 5 + ) { + try { + const imageStr: string = `data:image/jpeg;base64,${result}`; + await this.uiFileHelper + .saveBase64File( + 'beanconqueror_image', + '.jpg', + imageStr + ) + .then( + (_newURL) => { + fileurls.push(_newURL); + }, + () => {} + ); + } catch (ex) {} + } else { + } + } + setTimeout(() => { + this.uiAlert.hideLoadingSpinner(); + }, 50); + + // this.__cleanupCamera(); + if (fileurls.length > 0) { + resolve(fileurls); + } else { + reject('We found no file urls'); + } + }, + (err) => { + setTimeout(() => { + this.uiAlert.hideLoadingSpinner(); + }, 50); + reject(err); + } + ); + } + } else { + this.imagePicker + .getPictures({ maximumImagesCount: 5, outputType: 1, disable_popover: true, - quality: this.getImageQuality() - }).then(async (results) => { - await this.uiAlert.showLoadingSpinner(); - for (const result of results) { - if (result && result.length > 0 && result !== 0 && result !== '' - && result !== 'OK' && result.length > 5) { + quality: this.getImageQuality(), + }) + .then( + async (_files) => { + await this.uiAlert.showLoadingSpinner(); + for (let file of _files) { try { - const imageStr: string = `data:image/jpeg;base64,${result}`; - await this.uiFileHelper.saveBase64File('beanconqueror_image', '.jpg', imageStr).then((_newURL) => { - fileurls.push(_newURL); - }, () => { - }); + // We cant copy the file if it doesn't start with file:///, + if (file.indexOf('file:') <= -1) { + if (file.indexOf('/') === 0) { + file = 'file://' + file; + } else { + file = 'file:///' + file; + } + } + await this.uiFileHelper + .copyFileWithSpecificName(file) + .then( + async (_fullPath) => { + fileurls.push(_fullPath); + }, + () => {} + ); } catch (ex) { - + setTimeout(() => { + this.uiAlert.hideLoadingSpinner(); + }, 50); + reject(ex); } + } + setTimeout(() => { + this.uiAlert.hideLoadingSpinner(); + }, 50); + // this.__cleanupCamera(); - + if (fileurls.length > 0) { + resolve(fileurls); } else { + reject('We found no file urls'); } - - } - setTimeout(() => { - this.uiAlert.hideLoadingSpinner(); - },50); - - // this.__cleanupCamera(); - if (fileurls.length > 0) { - resolve(fileurls); - } else { - reject('We found no file urls'); - } - - }, (err) => { - setTimeout(() => { - this.uiAlert.hideLoadingSpinner(); - },50); - reject(err); - }); - } - } else { - chooser.getFile().then(async (_files) => { - await this.uiAlert.showLoadingSpinner(); - - for (const file of _files) { - try { - await this.filePath.resolveNativePath(file.uri).then(async (path) => { - if (path && (path.toLowerCase().endsWith('.png') || path.toLowerCase().endsWith('.jpg') || - path.toLowerCase().endsWith('.jpeg') || path.toLowerCase().endsWith('.gif')) && - path.toLowerCase().indexOf('sdcard') === -1) { - - const newPath: string = path; - let importPath: string = ''; - if (newPath.lastIndexOf('/Download/') > -1) { - let pathFromDownload = newPath.substr(0, newPath.lastIndexOf('/Download/')); - const decodedURI = decodeURIComponent(file.uri); - pathFromDownload = pathFromDownload + decodedURI.substring(decodedURI.lastIndexOf('/Download/')); - importPath = pathFromDownload; - } else { - importPath = newPath; - } - await this.uiFileHelper.copyFileWithSpecificName(importPath).then(async (_fullPath) => { - fileurls.push(_fullPath); - }, () => { - - }); - - } - }, (_error) => { - setTimeout(() => { - this.uiAlert.hideLoadingSpinner(); - },50); - reject(_error); - }); - } catch (ex) { + }, + (_err) => { setTimeout(() => { this.uiAlert.hideLoadingSpinner(); - },50); - reject(ex); + }, 50); + reject(_err); } - } - setTimeout(() => { - this.uiAlert.hideLoadingSpinner(); - },50); - // this.__cleanupCamera(); - - if (fileurls.length > 0) { - resolve(fileurls); - } else { - reject('We found no file urls'); - } - },(_err)=> { - setTimeout(() => { - this.uiAlert.hideLoadingSpinner(); - },50); - reject(_err); - }); - + ); } }); - - }, (_err) => { + }, + (_err) => { setTimeout(() => { this.uiAlert.hideLoadingSpinner(); - },50); + }, 50); reject(_err); } ); @@ -236,7 +241,7 @@ export class UIImage { return promise; } - public async showOptionChooser (): Promise { + public async showOptionChooser(): Promise { const promise = new Promise(async (resolve, reject) => { const alert = await this.alertController.create({ header: this.translate.instant('CHOOSE'), @@ -246,15 +251,15 @@ export class UIImage { text: this.translate.instant('RECORD'), handler: () => { resolve('TAKE'); - } + }, }, { text: this.translate.instant('CHOOSE'), - handler: () => { - resolve('CHOOSE'); - } - } - ] + handler: () => { + resolve('CHOOSE'); + }, + }, + ], }); await alert.present(); }); @@ -263,39 +268,51 @@ export class UIImage { } private __requestGaleryPermission(_success: any, _error: any): void { - this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.READ_EXTERNAL_STORAGE).then((_status) => { - if (_status.hasPermission) { - _success(); - } else { - _error(); - } - }, () => { - _error(); - }); + this.androidPermissions + .requestPermissions([ + this.androidPermissions.PERMISSION.READ_MEDIA_IMAGES, + ]) + .then( + (_status) => { + if (_status.hasPermission) { + _success(); + } else { + _error(); + } + }, + () => { + _error(); + } + ); } private __checkPermission(_success: any, _error: any): void { - this.platform.ready().then( - () => { - - const isCordova: boolean = this.platform.is('cordova'); - const isAndroid: boolean = this.platform.is('android'); - if (isCordova && isAndroid) { - this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.READ_EXTERNAL_STORAGE).then((_status) => { - if (_status.hasPermission === false) { + this.platform.ready().then(() => { + _success(); + return; + const isCordova: boolean = this.platform.is('cordova'); + const isAndroid: boolean = this.platform.is('android'); + if (isCordova && isAndroid) { + this.androidPermissions + .checkPermission(this.androidPermissions.PERMISSION.READ_MEDIA_IMAGES) + .then( + (_status) => { + if (_status.hasPermission === false) { + this.__requestGaleryPermission(_success, _error); + } else { + // We already have permission + _success(); + } + }, + () => { this.__requestGaleryPermission(_success, _error); - } else { - // We already have permission - _success(); } - }, () => { - this.__requestGaleryPermission(_success, _error); - }); - } else { - // No need to check for validations - _success(); - } - }); + ); + } else { + // No need to check for validations + _success(); + } + }); /** * Check if we have permission to read images @@ -307,20 +324,24 @@ export class UIImage { * @returns {Promise} */ // requestReadPermission(): Promise; - } - public async viewPhotos (_data: Bean | GreenBean | Brew |RoastingMachine | Water | Mill | Preparation) { - + public async viewPhotos( + _data: + | Bean + | GreenBean + | Brew + | RoastingMachine + | Water + | Mill + | Preparation + ) { const modal = await this.modalCtrl.create({ component: PhotoPopoverComponent, id: PhotoPopoverComponent.COMPONENT_ID, - componentProps: {data: _data} + componentProps: { data: _data }, }); await modal.present(); await modal.onWillDismiss(); } - - - } diff --git a/src/services/uiUpdate.ts b/src/services/uiUpdate.ts index fe2f5c431..7d441a7d3 100755 --- a/src/services/uiUpdate.ts +++ b/src/services/uiUpdate.ts @@ -578,7 +578,7 @@ export class UIUpdate { versionCode = await this.appVersion.getVersionNumber(); } else { // Hardcored for testing - versionCode = '6.6.1'; + versionCode = '6.6.2'; } const version: Version = this.uiVersionStorage.getVersion(); const displayingVersions =