mirror of https://github.com/BTCPrivate/copay.git
fix key derivation cache in IOS
This commit is contained in:
parent
a0c64ea88d
commit
005c7a2664
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('disclaimerController',
|
angular.module('copayApp.controllers').controller('disclaimerController',
|
||||||
function($scope, $timeout, $log, $ionicSideMenuDelegate, profileService, applicationService, gettextCatalog, uxLanguage, go) {
|
function($scope, $timeout, $log, $ionicSideMenuDelegate, profileService, applicationService, gettextCatalog, uxLanguage, go, storageService) {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.tries = 0;
|
self.tries = 0;
|
||||||
self.creatingProfile = true;
|
self.creatingProfile = true;
|
||||||
|
@ -38,7 +38,7 @@ angular.module('copayApp.controllers').controller('disclaimerController',
|
||||||
$ionicSideMenuDelegate.canDragContent(false);
|
$ionicSideMenuDelegate.canDragContent(false);
|
||||||
self.lang = uxLanguage.currentLanguage;
|
self.lang = uxLanguage.currentLanguage;
|
||||||
|
|
||||||
profileService.getProfile(function(err, profile) {
|
storageService.getProfile(function(err, profile) {
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
create(opts);
|
create(opts);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -5,10 +5,13 @@ angular.module('copayApp.services').factory('platformInfo', function($window) {
|
||||||
var ua = navigator ? navigator.userAgent : null;
|
var ua = navigator ? navigator.userAgent : null;
|
||||||
|
|
||||||
if (!ua) {
|
if (!ua) {
|
||||||
console.log('Could not determine navigator. Using a random string');
|
console.log('Could not determine navigator. Using fixed string');
|
||||||
ua = Math.floor(Math.random() * 100000);
|
ua = 'dummy user-agent';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fixes IOS WebKit UA
|
||||||
|
ua = ua.replace(/\(\d+\)$/, '');
|
||||||
|
|
||||||
var isNodeWebkit = function() {
|
var isNodeWebkit = function() {
|
||||||
var isNode = (typeof process !== "undefined" && typeof require !== "undefined");
|
var isNode = (typeof process !== "undefined" && typeof require !== "undefined");
|
||||||
if (isNode) {
|
if (isNode) {
|
||||||
|
|
|
@ -127,7 +127,6 @@ angular.module('copayApp.services')
|
||||||
if (!credentials.walletId)
|
if (!credentials.walletId)
|
||||||
throw 'bindWallet should receive credentials JSON';
|
throw 'bindWallet should receive credentials JSON';
|
||||||
|
|
||||||
$log.debug('Bind wallet:' + credentials.walletId);
|
|
||||||
|
|
||||||
// Create the client
|
// Create the client
|
||||||
var getBWSURL = function(walletId) {
|
var getBWSURL = function(walletId) {
|
||||||
|
@ -137,6 +136,7 @@ angular.module('copayApp.services')
|
||||||
};
|
};
|
||||||
|
|
||||||
var skipKeyValidation = root.profile.isChecked(platformInfo.ua, credentials.walletId);
|
var skipKeyValidation = root.profile.isChecked(platformInfo.ua, credentials.walletId);
|
||||||
|
$log.info('Binding wallet:' + credentials.walletId + ' Validating?:' + !skipKeyValidation);
|
||||||
var client = bwcService.getClient(JSON.stringify(credentials), {
|
var client = bwcService.getClient(JSON.stringify(credentials), {
|
||||||
bwsurl: getBWSURL(credentials.walletId),
|
bwsurl: getBWSURL(credentials.walletId),
|
||||||
skipKeyValidation: skipKeyValidation,
|
skipKeyValidation: skipKeyValidation,
|
||||||
|
|
Loading…
Reference in New Issue