From 9224d40a6554c70b0c500ca4e80031fb89e867e6 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Mon, 2 Jul 2018 14:06:36 +0900 Subject: [PATCH] Remove secure storage feature, postpone --- app-template/config-template.xml | 2 -- src/js/services/storageService.js | 55 +++++-------------------------- 2 files changed, 8 insertions(+), 49 deletions(-) diff --git a/app-template/config-template.xml b/app-template/config-template.xml index ed4b192ba..52a3f8860 100644 --- a/app-template/config-template.xml +++ b/app-template/config-template.xml @@ -73,8 +73,6 @@ - - diff --git a/src/js/services/storageService.js b/src/js/services/storageService.js index a2d85950b..bde3215a2 100644 --- a/src/js/services/storageService.js +++ b/src/js/services/storageService.js @@ -1,6 +1,6 @@ 'use strict'; angular.module('copayApp.services') - .factory('storageService', function(appConfigService, logHeader, fileStorageService, localStorageService, sjcl, $log, lodash, platformInfo, secureStorageService, $timeout) { + .factory('storageService', function(appConfigService, logHeader, fileStorageService, localStorageService, sjcl, $log, lodash, platformInfo, $timeout) { var root = {}; var storage; @@ -121,11 +121,7 @@ angular.module('copayApp.services') root.storeProfile = function(profile, cb) { var profileString = profile.toObj(); - if (platformInfo.isNW) { - storage.set('profile', profileString, cb); - } else { - secureStorageService.set('profile', profileString, cb); - } + storage.set('profile', profileString, cb); }; /** @@ -205,48 +201,13 @@ angular.module('copayApp.services') * @param {getProfileCallback} cb */ root.getProfile = function(cb) { - if (platformInfo.isNW) { - storage.get('profile', function(getErr, getStr) { - _onOldProfileRetrieved(getErr, getStr, cb); - }); - return - } - - secureStorageService.get('profile', function(secureErr, secureStr) { - var secureProfile; - var oldProfile; - - if (secureErr) { - return cb(secureErr, null); + storage.get('profile', function(getErr, getStr) { + if (getErr) { + cb(getErr, null); + } else { + profile = Profile.fromString(getStr); + cb(null, profile); } - - if (secureStr) { - try { - secureProfile = Profile.fromString(secureStr); - $log.debug('profile: ' + JSON.stringify(secureProfile)); - } catch (e) { - $log.error(e); - return cb(e, null); - } - } - - storage.get('profile', function(getErr, getStr) { - _onOldProfileRetrieved(getErr, getStr, function(oldErr, oldProfile){ - if (oldErr) { - return cb(oldErr, null); - } - - if (!oldProfile) { - if (secureProfile) { - return cb(null, secureProfile); - } else { - // No profiles found. No errors either. - return cb(null, null); - } - } - _migrateProfiles(oldProfile, secureProfile, cb); - }); - }); }); };