diff --git a/README.md b/README.md index ccca1ebe5f525bc3354695c3ea8fec47aeed83c6..e6cd240f7503d5b18fd000ca7cbe55c34e89daba 100644 --- a/README.md +++ b/README.md @@ -115,24 +115,24 @@ This software is distributed under [GNU GPLv3](https://raw.github.com/duniter/ce To build Cesium, you will have to: + - Installing build tools: +``` + sudo apt-get install build-essential +``` + - Installing [nvm](https://github.com/creationix/nvm) ``` wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash ``` - - Configure NodeJS to use a version 5: + - Configure NodeJS to use a version 8: ``` - nvm install 5 + nvm install 7 ``` - - Installing nodejs build tools: + - Installing node.js build tools: ``` - npm install -g bower gulp ionic@1.7.16 cordova -``` - - - Installing other build dependencies: -``` - sudo apt-get install build-essential + npm install -g gulp ionic@1.7.16 cordova ``` ### Source code @@ -142,13 +142,13 @@ To build Cesium, you will have to: git clone https://github.com/duniter/cesium.git cd cesium npm install - bower install ``` - - Installing Cordova plugins + - Installing Cordova plugins (need for platforms specific builds) ``` ionic state restore ``` + ### Build environment - To configure your build environment : diff --git a/bower.json b/bower.json deleted file mode 100644 index 498c7e07368e8d2d6a741b959171c81338922bb6..0000000000000000000000000000000000000000 --- a/bower.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "cesium", - "private": "true", - "devDependencies": { - "ionic": "driftyco/ionic-bower#1.3.2", - "ionic-material": "0.4.2" - }, - "dependencies": { - "angular-messages": "1.3.13", - "robotodraft": "1.1.0", - "angular-moment": "^0.10.3", - "angular-animate": "1.4.3", - "angular-sanitize": "1.5.3", - "angular": "1.5.3", - "angular-bind-notifier": "^1.1.7", - "angular-image-crop": "^2.0.0", - "ng-idle": "^1.3.2", - "chart.js": "chartjs#^2.6.0" - }, - "resolutions": { - "angular-sanitize": "1.5.3", - "angular-animate": "1.5.3", - "angular": "1.5.3", - "ionic": "1.3.2" - } -} diff --git a/config.xml b/config.xml index eb3caeb7266adda42ff33fcdcb3cec1da7196ddc..f6edef751eadb95af01bd077d82e50e3a331dda3 100644 --- a/config.xml +++ b/config.xml @@ -1,97 +1,108 @@ <?xml version='1.0' encoding='utf-8'?> -<widget - xmlns="http://www.w3.org/ns/widgets" - xmlns:cdv="http://cordova.apache.org/ns/1.0" - id="fr.duniter.cesium" - version="0.12.7" - android-versionCode="12700" - > - <name>Cesium</name> - <description> +<widget android-versionCode="12700" id="fr.duniter.cesium" version="0.12.7" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> + <name>Cesium</name> + <description> An simple App for Duniter wallet </description> - <author email="contact@e-is.pro"> + <author email="contact@e-is.pro"> E-IS PRO </author> - <content src="index.html" /> - <access origin="*" /> - <allow-intent href="http://*/*" /> - <allow-intent href="https://*/*" /> - <allow-intent href="tel:*" /> - <allow-intent href="sms:*" /> - <allow-intent href="mailto:*" /> - <allow-intent href="geo:*" /> - <allow-navigation href="http://*/*" /> - <allow-navigation href="https://*/*" /> - <allow-navigation href="data:*" /> - <icon src="www/img/logo_96px.png" /> - <preference name="webviewbounce" value="false" /> - <preference name="UIWebViewBounce" value="false" /> - <preference name="DisallowOverscroll" value="true" /> - <preference name="SplashScreen" value="screen" /> - <preference name="SplashScreenDelay" value="4000" /> - <preference name="xwalkVersion" value="19" /> - <preference name="xwalkMultipleApk" value="false"/> - <preference name="android-minSdkVersion" value="16" /> - <preference name="android-targetSdkVersion" value="23"/> - <allow-navigation href="*" /> - <feature name="StatusBar"> - <param name="ios-package" onload="true" value="CDVStatusBar" /> - </feature> - <platform name="android"> - <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" /> - <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" /> - <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" /> - <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" /> - <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" /> - <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" /> - <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" /> - <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" /> - <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" /> - <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" /> - <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" /> - <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" /> - <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" /> - <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" /> - <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" /> - <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" /> - <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" /> - <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" /> - </platform> - <platform name="ios"> - <preference name="BackupWebStorage" value="local" /> - <icon height="57" src="resources/ios/icon/icon.png" width="57" /> - <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" /> - <icon height="40" src="resources/ios/icon/icon-40.png" width="40" /> - <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" /> - <icon height="50" src="resources/ios/icon/icon-50.png" width="50" /> - <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" /> - <icon height="60" src="resources/ios/icon/icon-60.png" width="60" /> - <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" /> - <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" /> - <icon height="72" src="resources/ios/icon/icon-72.png" width="72" /> - <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" /> - <icon height="76" src="resources/ios/icon/icon-76.png" width="76" /> - <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" /> - <icon height="29" src="resources/ios/icon/icon-small.png" width="29" /> - <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" /> - <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" /> - <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" /> - <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" /> - <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" /> - <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" /> - <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" /> - <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" /> - <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" /> - <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" /> - <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" /> - <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" /> - </platform> - <platform name="firefoxos"> - <icon height="128" src="www/img/logo_128px.png" width="128" /> - <icon height="60" src="www/img/logo_60px.png" width="60" /> - </platform> - <platform name="ubuntu"> - <icon height="57" src="www/img/logo_57px.png" width="57"/> - </platform> + <content src="index.html" /> + <access origin="*" /> + <allow-intent href="http://*/*" /> + <allow-intent href="https://*/*" /> + <allow-intent href="tel:*" /> + <allow-intent href="sms:*" /> + <allow-intent href="mailto:*" /> + <allow-intent href="geo:*" /> + <allow-navigation href="http://*/*" /> + <allow-navigation href="https://*/*" /> + <allow-navigation href="data:*" /> + <icon src="www/img/logo_96px.png" /> + <preference name="webviewbounce" value="false" /> + <preference name="UIWebViewBounce" value="false" /> + <preference name="DisallowOverscroll" value="true" /> + <preference name="SplashScreen" value="screen" /> + <preference name="SplashScreenDelay" value="4000" /> + <preference name="xwalkVersion" value="19" /> + <preference name="xwalkMultipleApk" value="false" /> + <preference name="android-minSdkVersion" value="16" /> + <preference name="android-targetSdkVersion" value="25" /> + <allow-navigation href="*" /> + <feature name="StatusBar"> + <param name="ios-package" onload="true" value="CDVStatusBar" /> + </feature> + <platform name="android"> + <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" /> + <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" /> + <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" /> + <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" /> + <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" /> + <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" /> + <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" /> + <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" /> + <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" /> + <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" /> + <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" /> + <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" /> + <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" /> + <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" /> + <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" /> + <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" /> + <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" /> + <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" /> + </platform> + <platform name="ios"> + <preference name="BackupWebStorage" value="local" /> + <icon height="57" src="resources/ios/icon/icon.png" width="57" /> + <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" /> + <icon height="40" src="resources/ios/icon/icon-40.png" width="40" /> + <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" /> + <icon height="50" src="resources/ios/icon/icon-50.png" width="50" /> + <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" /> + <icon height="60" src="resources/ios/icon/icon-60.png" width="60" /> + <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" /> + <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" /> + <icon height="72" src="resources/ios/icon/icon-72.png" width="72" /> + <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" /> + <icon height="76" src="resources/ios/icon/icon-76.png" width="76" /> + <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" /> + <icon height="29" src="resources/ios/icon/icon-small.png" width="29" /> + <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" /> + <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" /> + <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" /> + <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" /> + <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" /> + <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" /> + <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" /> + <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" /> + <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" /> + <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" /> + <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" /> + <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" /> + </platform> + <platform name="firefoxos"> + <icon height="128" src="www/img/logo_128px.png" width="128" /> + <icon height="60" src="www/img/logo_60px.png" width="60" /> + </platform> + <platform name="ubuntu"> + <icon height="57" src="www/img/logo_57px.png" width="57" /> + </platform> + <plugin name="cordova-plugin-camera" spec="~2.2.0" /> + <plugin name="cordova-plugin-console" spec="~1.0.3" /> + <plugin name="cordova-plugin-device" spec="~1.1.2" /> + <plugin name="cordova-plugin-dialogs" spec="~1.2.1" /> + <plugin name="cordova-plugin-inappbrowser" spec="~1.6.1" /> + <plugin name="cordova-plugin-secure-storage" spec="~2.6.3" /> + <plugin name="cordova-plugin-splashscreen" spec="~3.2.2" /> + <plugin name="cordova-plugin-statusbar" spec="~2.1.3" /> + <plugin name="cordova-plugin-vibration" spec="~2.1.1" /> + <plugin name="cordova-plugin-websocket" spec="~0.12.0" /> + <plugin name="cordova-plugin-whitelist" spec="~1.2.2" /> + <plugin name="cordova-plugin-x-toast" spec="~2.6.0" /> + <plugin name="ionic-plugin-keyboard" spec="~2.2.1" /> + <plugin name="phonegap-plugin-barcodescanner" spec="git+https://github.com/phonegap/phonegap-plugin-barcodescanner.git"> + <variable name="CAMERA_USAGE_DESCRIPTION" value=" " /> + </plugin> + <plugin name="cordova-plugin-minisodium" spec="~1.0.0" /> </widget> diff --git a/hooks/after_prepare/060_prepare_android_manifest.js b/hooks/after_prepare/060_prepare_android_manifest.js index 2ec38cb74ca0ab8cac1f4c74dbf80135820ca24f..8b6bf478bee4462dd9b3ffca0917ffcab541b7d1 100755 --- a/hooks/after_prepare/060_prepare_android_manifest.js +++ b/hooks/after_prepare/060_prepare_android_manifest.js @@ -31,7 +31,7 @@ if (rootdir) { .pipe(replace(/(<uses-sdk [^>]+>)(:?[\n\r\s\t ]*<uses-sdk [^>]+>)+/mg, '$1')) // <uses-sdk> : Replace 'targetSdkversion' and add tools:overrideLibrary - .pipe(replace(/android:targetSdkVersion="[^"]+"\s*\/>/g, 'android:targetSdkVersion="23" tools:overrideLibrary="org.kaliumjni.lib" />')) + .pipe(replace(/android:targetSdkVersion="[^"]+"\s*\/>/g, 'android:targetSdkVersion="25" tools:overrideLibrary="org.kaliumjni.lib" />')) .pipe(gulp.dest(platformPath)); diff --git a/package.json b/package.json index 9e763084a415a5c2c455d0cc3f3797247546a000..baac0e9b1e1ba75c80deddb7dea57613286db0b8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "url": "git@github.com:duniter/cesium.git" }, "scripts": { - "postinstall": "bower install", "install-for-mobile": "ionic state restore", "start": "ionic serve" }, @@ -20,28 +19,38 @@ "crypto-currency" ], "author": "Duniter team", - "license": "GPLv3", + "license": "GPL-3.0", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/duniter/cesium/issues", "new": "https://github.com/duniter/cesium/issues/new?labels=bug" }, "dependencies": { - "delete-empty": "^0.1.3", - "gulp": "^3.9.1", - "bower": "^1.7.3", + "angular": "1.5.3", + "angular-animate": "1.4.3", + "angular-bind-notifier": "^1.1.7", + "angular-image-crop": "https://github.com/andyshora/angular-image-crop/archive/v2.0.0.tar.gz", + "angular-messages": "1.3.13", + "angular-moment": "^0.10.3", + "angular-sanitize": "1.5.3", + "chart.js": "^2.6.0", "ionic": "^1.7.16", - "gulp-bump": "^2.1.0", - "gulp-concat": "^2.2.0", - "gulp-rename": "^1.2.0", - "gulp-sass": "^2.2.0", - "node-sass": "^3.3.3" + "ionic-material": "https://github.com/zachfitz/Ionic-Material/archive/v0.4.2.tar.gz", + "moment": "^2.10.6", + "ng-idle": "^1.3.2", + "robotodraft": "https://github.com/FontFaceKit/robotodraft/tarball/gh-pages" }, "devDependencies": { "cordova-uglify": "^0.2.3", "del": "^2.2.0", - "fs": "0.0.2", "gulp": "^3.9.1", + "gulp-bump": "^2.1.0", + "gulp-concat": "^2.2.0", + "gulp-rename": "^1.2.0", + "gulp-sass": "^2.2.0", + "vinyl-fs": "^3.9.2", + "graceful-fs": "^4.0.0", + "fs": "^0.0.2", "gulp-angular-templatecache": "^1.8.0", "gulp-angular-translate": "^0.1.4", "gulp-base64": "^0.1.3", @@ -70,7 +79,10 @@ "mv": "^2.1.1", "playup": "^1.0.2", "shelljs": "^0.3.0", - "yargs": "^4.3.1" + "yargs": "^4.3.1", + "minimatch": "^3.0.2", + "delete-empty": "^0.1.3", + "node-sass": "^4.5.3" }, "cordovaPlugins": [ "cordova-plugin-whitelist", @@ -96,5 +108,26 @@ "ios", "android", "firefoxos" - ] + ], + "cordova": { + "plugins": { + "cordova-plugin-whitelist": {}, + "cordova-plugin-splashscreen": {}, + "cordova-plugin-console": {}, + "ionic-plugin-keyboard": {}, + "cordova-plugin-device": {}, + "cordova-plugin-statusbar": {}, + "cordova-plugin-camera": {}, + "cordova-plugin-websocket": {}, + "cordova-plugin-vibration": {}, + "cordova-plugin-dialogs": {}, + "cordova-plugin-minisodium": {}, + "cordova-plugin-secure-storage": {}, + "phonegap-plugin-barcodescanner": { + "CAMERA_USAGE_DESCRIPTION": " " + }, + "cordova-plugin-inappbrowser": {}, + "cordova-plugin-x-toast": {} + } + } } diff --git a/www/js/app.js b/www/js/app.js index 56616c9b87f89ae6d8d88807b2f4368c3e5712b7..253c6e44586cee5d8514be26621861186028cb2f 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -375,7 +375,7 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht IdleProvider.timeout(csConfig.logoutTimeout||15); // display warning during 15s }) -.run(function($rootScope, $translate, $state, $window, ionicReady, Device, UIUtils, $ionicConfig, PluginService, csWallet, csSettings, csConfig, csCurrency) { +.run(function($rootScope, $translate, $state, $window, ionicReady, localStorage, Device, UIUtils, $ionicConfig, PluginService, csWallet, csSettings, csConfig, csCurrency) { 'ngInject'; $rootScope.config = csConfig; @@ -485,10 +485,13 @@ angular.module('cesium', ['ionic', 'ionic-material', 'ngMessages', 'pascalprecht StatusBar.styleDefault(); } - // Force to start settings - return csSettings.ready(); + // Start local storage + return localStorage.ready(); }) + // Force to start settings + .then(csSettings.ready) + // Load currency .then(csCurrency.get) .then(function(currency){ diff --git a/www/js/services/crypto-services.js b/www/js/services/crypto-services.js index d5eda53c382c36ea84729ac6eaade093aacde464..af3291b4695ce9da147e35a05cecb25a2e9cc48d 100644 --- a/www/js/services/crypto-services.js +++ b/www/js/services/crypto-services.js @@ -630,6 +630,7 @@ angular.module('cesium.crypto.services', ['ngResource', 'cesium.device.services' // endRemoveIf(device) ionicReady().then(function() { + console.debug('[crypto] Starting...'); var now = new Date().getTime(); var serviceImpl; diff --git a/www/js/services/storage-services.js b/www/js/services/storage-services.js index a85db8b10eb1f05a8033fe4abf395b6cb91ffc26..4075118f62f023c6a07050f92defa141ea7d4ded 100644 --- a/www/js/services/storage-services.js +++ b/www/js/services/storage-services.js @@ -1,6 +1,6 @@ -angular.module('cesium.storage.services', ['ngResource', 'ngResource', 'ngApi', 'cesium.config']) +angular.module('cesium.storage.services', ['ngResource', 'ngApi', 'cesium.config']) - .factory('localStorage', function($window, $q, $rootScope, $timeout, ionicReady, csConfig, Api) { + .factory('localStorage', function($window, $q, $rootScope, $timeout, csConfig, Api) { 'ngInject'; var @@ -114,26 +114,24 @@ angular.module('cesium.storage.services', ['ngResource', 'ngResource', 'ngApi', exports[key] = exports.secure[key]; }); - var deferred = $q.defer(); - ionicReady().then(function() { - // No secure storage plugin: fall back to standard storage - if (!cordova.plugins || !cordova.plugins.SecureStorage) { - console.debug('[storage] No cordova plugin. Will use standard....'); - deferred.resolve(initStandardStorage()); - return; - } - exports.secure.storage = new cordova.plugins.SecureStorage( - function () { - deferred.resolve(); - }, - function (err) { - console.error('[storage] Could not use secure storage. Will use standard.', err); - deferred.resolve(initStandardStorage()); - }, - appName); - }); + // No secure storage plugin: fall back to standard storage + if (!cordova.plugins || !cordova.plugins.SecureStorage) { + console.debug('[storage] No cordova plugin. Will use standard....'); + return initStandardStorage(); + } + var deferred = $q.defer(); + exports.secure.storage = new cordova.plugins.SecureStorage( + function () { + deferred.resolve(); + }, + function (err) { + console.error('[storage] Could not use secure storage. Will use standard.', err); + deferred.promise.then(initStandardStorage); + deferred.resolve(); + }, + appName); return deferred.promise; } @@ -142,6 +140,7 @@ angular.module('cesium.storage.services', ['ngResource', 'ngResource', 'ngApi', }; exports.ready = function() { + console.debug("[storage] Calling ready()"); if (started) return $q.when(); return startPromise || start(); }; @@ -153,6 +152,7 @@ angular.module('cesium.storage.services', ['ngResource', 'ngResource', 'ngApi', // Use Cordova secure storage plugin if (isDevice) { + console.debug("[storage] Staring secure storage..."); startPromise = initSecureStorage(); }