commit
f3d12f5a14
17 changed files with 141 additions and 91 deletions
|
|
@ -14,17 +14,15 @@ angular.module('copayApp.services')
|
|||
} else {
|
||||
// Go home reloading the application
|
||||
if (isChromeApp) {
|
||||
if (nodeWebkit.isDefined()) {
|
||||
go.walletHome();
|
||||
$timeout(function() {
|
||||
var win = require('nw.gui').Window.get();
|
||||
win.reload(3);
|
||||
//or
|
||||
win.reloadDev();
|
||||
}, 100);
|
||||
} else {
|
||||
chrome.runtime.reload();
|
||||
}
|
||||
chrome.runtime.reload();
|
||||
} else if (nodeWebkit.isDefined()) {
|
||||
go.walletHome();
|
||||
$timeout(function() {
|
||||
var win = require('nw.gui').Window.get();
|
||||
win.reload(3);
|
||||
//or
|
||||
win.reloadDev();
|
||||
}, 100);
|
||||
} else {
|
||||
window.location = window.location.href.substr(0, hashIndex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,15 +41,23 @@ angular.module('copayApp.services')
|
|||
json = JSON.parse(text);
|
||||
} catch (e) {};
|
||||
|
||||
if (!json) return cb('Could not access storage')
|
||||
|
||||
if (!json.iter || !json.ct)
|
||||
return cb(null, text);
|
||||
|
||||
$log.debug('Profile is encrypted');
|
||||
getUUID(function(uuid) {
|
||||
$log.debug('Device UUID:' + uuid);
|
||||
if (!uuid)
|
||||
return cb(new Error('Could not decrypt localstorage profile'));
|
||||
return cb('Could not decrypt storage: could not get device ID');
|
||||
|
||||
text = sjcl.decrypt(uuid, text);
|
||||
try {
|
||||
text = sjcl.decrypt(uuid, text);
|
||||
} catch(e) {
|
||||
$log.warn('Decrypt error: ', e);
|
||||
return cb('Could not decrypt storage: device ID mismatch');
|
||||
};
|
||||
return cb(null, text);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue