fix logs in txservice, add logs to bwc (#4164)

* fix logs in txservice, add logs to bwc

* 1.12.8 + add test for android

* new version 1.12.11

* revert changes in index
This commit is contained in:
Matias Alejo Garcia 2016-05-03 10:42:18 -03:00 committed by Gustavo Maximiliano Cortez
commit e7f1bbba7d
16 changed files with 70 additions and 39 deletions

View file

@ -56,7 +56,8 @@ ios-debug:
open cordova/project/platforms/ios/Copay.xcodeproj open cordova/project/platforms/ios/Copay.xcodeproj
android-prod: android-prod:
cordova/build.sh ANDROID --clear cordova/build.sh ANDROID --clear
rm -f cordova/project/platforms/android/build/outputs/apk/android-release-signed-aligned.apk
cd cordova/project && cordova build android --release cd cordova/project && cordova build android --release
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../copay.keystore -signedjar cordova/project/platforms/android/build/outputs/apk/android-release-signed.apk cordova/project/platforms/android/build/outputs/apk/android-release-unsigned.apk copay_play jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../copay.keystore -signedjar cordova/project/platforms/android/build/outputs/apk/android-release-signed.apk cordova/project/platforms/android/build/outputs/apk/android-release-unsigned.apk copay_play
../android-sdk-macosx/build-tools/21.1.1/zipalign -v 4 cordova/project/platforms/android/build/outputs/apk/android-release-signed.apk cordova/project/platforms/android/build/outputs/apk/android-release-signed-aligned.apk ../android-sdk-macosx/build-tools/21.1.1/zipalign -v 4 cordova/project/platforms/android/build/outputs/apk/android-release-signed.apk cordova/project/platforms/android/build/outputs/apk/android-release-signed-aligned.apk

View file

@ -29,6 +29,8 @@
<preference name="windows-target-version" value="8.1"/> <preference name="windows-target-version" value="8.1"/>
<preference name="Orientation" value="portrait" /> <preference name="Orientation" value="portrait" />
<platform name="ios"> <platform name="ios">
<!-- iOS 8.0+ --> <!-- iOS 8.0+ -->
<!-- iPad Pro --> <!-- iPad Pro -->

View file

@ -12,6 +12,6 @@
android.library.reference.1=CordovaLib android.library.reference.1=CordovaLib
# Project target. # Project target.
target=android-21 target=android-23
key.store=../../../copay.keystore key.store=../../../copay.keystore
key.alias=copay_play key.alias=copay_play

View file

@ -58,12 +58,12 @@ if [ ! -d $PROJECT ]; then
echo "${OpenColor}${Green}* Creating project... ${CloseColor}" echo "${OpenColor}${Green}* Creating project... ${CloseColor}"
cordova create project com.bitpay.copay Copay cordova create project com.bitpay.copay Copay
checkOK checkOK
cd $PROJECT cd $PROJECT
if [ $CURRENT_OS == "ANDROID" ]; then if [ $CURRENT_OS == "ANDROID" ]; then
echo "${OpenColor}${Green}* Adding Android platform... ${CloseColor}" echo "${OpenColor}${Green}* Adding Android platform... ${CloseColor}"
cordova platforms add android echo "SSSSSSSSSSSSSSSSSSS";
cordova platforms add android@5.1.1
echo "SSSSSSSSSSSSSSSSSSS";
checkOK checkOK
fi fi

View file

@ -1,8 +1,8 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="com.bitpay.copay" <widget id="com.bitpay.copay"
version="1.12.1" version="1.12.11"
android-versionCode="90" android-versionCode="101"
ios-CFBundleVersion="1.12.1"> ios-CFBundleVersion="1.12.11">
<name>Copay</name> <name>Copay</name>
<description> <description>
A secure bitcoin wallet for friends and companies. A secure bitcoin wallet for friends and companies.
@ -29,6 +29,8 @@
<preference name="windows-target-version" value="8.1"/> <preference name="windows-target-version" value="8.1"/>
<preference name="Orientation" value="portrait" /> <preference name="Orientation" value="portrait" />
<platform name="ios"> <platform name="ios">
<!-- iOS 8.0+ --> <!-- iOS 8.0+ -->
<!-- iPad Pro --> <!-- iPad Pro -->

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"> <Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
<Identity Name="18C7659D.CopayWallet" Publisher="CN=F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" Version="1.12.1.0" /> <Identity Name="18C7659D.CopayWallet" Publisher="CN=F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" Version="1.12.11.0" />
<mp:PhoneIdentity PhoneProductId="5381aa50-9069-11e4-84cc-293caf9cbdc8" PhonePublisherId="F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" /> <mp:PhoneIdentity PhoneProductId="5381aa50-9069-11e4-84cc-293caf9cbdc8" PhonePublisherId="F89609D1-EB3E-45FD-A58A-C2E3895FCE7B" />
<Properties> <Properties>
<DisplayName>Copay Bitcoin Wallet</DisplayName> <DisplayName>Copay Bitcoin Wallet</DisplayName>

View file

@ -11,7 +11,7 @@
<Language code="pl" /> <Language code="pl" />
<Language code="cs" /> <Language code="cs" />
</Languages> </Languages>
<App Author="Bitpay Inc." BitsPerPixel="32" Description="A multisignature Bitcoin Wallet" Genre="apps.normal" ProductID="{5381aa50-9069-11e4-84cc-293caf9cbdc8}" Publisher="Copay Bitcoin Wallet" PublisherID="{31cdd08b-457c-413d-b440-f6665eec847d}" RuntimeType="Silverlight" Title="Copay Bitcoin Wallet" Version="1.12.1.0" xmlns="" NotificationService="MPN"> <App Author="Bitpay Inc." BitsPerPixel="32" Description="A multisignature Bitcoin Wallet" Genre="apps.normal" ProductID="{5381aa50-9069-11e4-84cc-293caf9cbdc8}" Publisher="Copay Bitcoin Wallet" PublisherID="{31cdd08b-457c-413d-b440-f6665eec847d}" RuntimeType="Silverlight" Title="Copay Bitcoin Wallet" Version="1.12.11.0" xmlns="" NotificationService="MPN">
<IconPath IsRelative="true" IsResource="false">Assets\icon@2.png</IconPath> <IconPath IsRelative="true" IsResource="false">Assets\icon@2.png</IconPath>
<Capabilities> <Capabilities>
<Capability Name="ID_CAP_WEBBROWSERCOMPONENT" /> <Capability Name="ID_CAP_WEBBROWSERCOMPONENT" />

View file

@ -2,8 +2,8 @@
"name": "copay", "name": "copay",
"description": "A multisignature wallet", "description": "A multisignature wallet",
"author": "BitPay", "author": "BitPay",
"version": "1.12.1", "version": "1.12.11",
"androidVersionCode": "90", "androidVersionCode": "101",
"keywords": [ "keywords": [
"wallet", "wallet",
"copay", "copay",

View file

@ -8,6 +8,15 @@
<h4 class="title m0" translate>Wallet Information</h4> <h4 class="title m0" translate>Wallet Information</h4>
<ul class="no-bullet m0 size-14"> <ul class="no-bullet m0 size-14">
<li class="line-b p20 oh " ng-if="androidTest">
<span style="color:red" translate>BETA: Android Key Derivation Test:</span>
<span class="right text-gray">
{{androidTest}}
</span>
</li>
<li class="line-b p20 oh"> <li class="line-b p20 oh">
<span translate>Wallet Name (at creation)</span> <span translate>Wallet Name (at creation)</span>
<span class="right text-gray"> <span class="right text-gray">

View file

@ -82,6 +82,7 @@ angular.module('copayApp.controllers').controller('importController',
}; };
var _importExtendedPrivateKey = function(xPrivKey, opts) { var _importExtendedPrivateKey = function(xPrivKey, opts) {
console.log('[import.js.84:xPrivKey:]',xPrivKey); //TODO
self.loading = true; self.loading = true;
$timeout(function() { $timeout(function() {

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('preferencesInformation', angular.module('copayApp.controllers').controller('preferencesInformation',
function($scope, $log, $timeout, isMobile, gettextCatalog, lodash, profileService, storageService, go) { function($scope, $log, $timeout, isMobile, gettextCatalog, lodash, profileService, storageService, go, bitcore) {
var base = 'xpub'; var base = 'xpub';
var fc = profileService.focusedClient; var fc = profileService.focusedClient;
var c = fc.credentials; var c = fc.credentials;
@ -20,6 +20,20 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
$scope.pubKeys = lodash.pluck(c.publicKeyRing, 'xPubKey'); $scope.pubKeys = lodash.pluck(c.publicKeyRing, 'xPubKey');
$scope.addrs = null; $scope.addrs = null;
if (isMobile.Android()) {
$scope.androidTest = 'testing';
var xp = bitcore.HDPrivateKey("tprv8ZgxMBicQKsPebv8CVghFoaaZ6ejmcSmSaKo99sUnswCCPeccGbLzfoksA2wd5XdHe8UHLwM2emuBWD4cBvQ7BPTJhFu75u3HcSjRVFmYM9");
var pub = xp.derive("m/44'/1'/0'").hdPublicKey.toString();
if (pub == 'tpubDCe5stHkJZhfNMpQLgqRVYjSfADoosJ7FvxukgyXf1YzrCnru2z61giPXbgJGGxnHt922CY22DDDYD6d28jnd9okctoXNW837TmbNaAEM99') {
$scope.androidTest = 'OK, TEST PASSED';
} else {
$scope.androidTest = 'FAILED!! Please report to matias@bitpay.com. Result:' + pub;
}
}
fc.getMainAddresses({ fc.getMainAddresses({
doNotVerify: true doNotVerify: true
}, function(err, addrs) { }, function(err, addrs) {

View file

@ -439,6 +439,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.setOngoingProcess(gettextCatalog.getString('Rejecting payment')); self.setOngoingProcess(gettextCatalog.getString('Rejecting payment'));
$scope.loading = true; $scope.loading = true;
$scope.error = null; $scope.error = null;
// TODO: This should be in txService
$timeout(function() { $timeout(function() {
fc.rejectTxProposal(txp, null, function(err, txpr) { fc.rejectTxProposal(txp, null, function(err, txpr) {
self.setOngoingProcess(); self.setOngoingProcess();
@ -982,7 +984,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.setOngoingProcess(); self.setOngoingProcess();
if (err) { if (err) {
self.error = err.message ? err.message : gettext('The payment was created but could not be completed. Please try again from home screen'); self.error = bwsError.msg(err, gettextCatalog.getString('The payment was created but could not be completed. Please try again from home screen'));
$scope.$emit('Local/TxProposalAction'); $scope.$emit('Local/TxProposalAction');
$timeout(function() { $timeout(function() {
$scope.$digest(); $scope.$digest();

View file

@ -76,6 +76,9 @@ angular.module('copayApp.services')
var client = bwcService.getClient(JSON.stringify(credentials)); var client = bwcService.getClient(JSON.stringify(credentials));
root.walletClients[credentials.walletId] = client; root.walletClients[credentials.walletId] = client;
client.removeAllListeners(); client.removeAllListeners();
client.on('report', function(n) {
$log.info('BWC Report:'+ n);
});
client.on('notification', function(n) { client.on('notification', function(n) {
$log.debug('BWC Notification:', n); $log.debug('BWC Notification:', n);
@ -118,6 +121,7 @@ angular.module('copayApp.services')
root.setWalletClients = function() { root.setWalletClients = function() {
var credentials = root.profile.credentials; var credentials = root.profile.credentials;
lodash.each(credentials, function(credential) { lodash.each(credentials, function(credential) {
//$log.info("Credentials:", credentials);
root.setWalletClient(credential); root.setWalletClient(credential);
}); });
$rootScope.$emit('Local/WalletListUpdated'); $rootScope.$emit('Local/WalletListUpdated');
@ -673,18 +677,18 @@ angular.module('copayApp.services')
$log.debug('Wallet is encrypted'); $log.debug('Wallet is encrypted');
$rootScope.$emit('Local/NeedsPassword', false, function(err2, password) { $rootScope.$emit('Local/NeedsPassword', false, function(err2, password) {
if (err2 || !password) {
return cb({ if (err2)
message: (err2 || gettext('Password needed')) return cb(err2);
});
} if (!password)
return cb(gettext('Password needed'));
try { try {
fc.unlock(password); fc.unlock(password);
} catch (e) { } catch (e) {
$log.debug(e); $log.warn('Error decrypting wallet:', e);
return cb({ return cb(gettext('Wrong password'));
message: gettext('Wrong password')
});
} }
return cb(); return cb();
}); });

View file

@ -75,6 +75,7 @@ angular.module('copayApp.services').factory('txService', function($rootScope, pr
$log.info("at .prepare"); $log.info("at .prepare");
opts = opts || {}; opts = opts || {};
var fc = opts.selectedClient || profileService.focusedClient; var fc = opts.selectedClient || profileService.focusedClient;
$log.info('FC Client Dump:' + fc);
if (!fc.canSign() && !fc.isPrivKeyExternal()) if (!fc.canSign() && !fc.isPrivKeyExternal())
return cb('Cannot sign'); // should never happen, no need to translate return cb('Cannot sign'); // should never happen, no need to translate
@ -198,18 +199,13 @@ angular.module('copayApp.services').factory('txService', function($rootScope, pr
txp.signatures = null; txp.signatures = null;
$log.info('at .sign: (isEncrypted):', fc.isPrivKeyEncrypted()); $log.info('at .sign: (isEncrypted):', fc.isPrivKeyEncrypted());
$log.info('txp BEFORE:', txp); $log.info('txp BEFORE .signTxProposal:', txp);
try { fc.signTxProposal(txp, function(err, signedTxp) {
fc.signTxProposal(txp, function(err, signedTxp) { $log.info('txp AFTER .signTxProposal:',err, signedTxp);
$log.info('txp AFTER:',err, signedTxp); profileService.lockFC();
profileService.lockFC(); return cb(err, signedTxp);
return cb(err, signedTxp); });
});
} catch (e) {
$log.warn('Error at signTxProposal:', e);
return cb(e);
}
} }
}; };
@ -222,7 +218,7 @@ angular.module('copayApp.services').factory('txService', function($rootScope, pr
root.sign(txp, opts, function(err, txp) { root.sign(txp, opts, function(err, txp) {
if (err) { if (err) {
stopReport(opts); stopReport(opts);
return cb(bwsError.msg(err), gettextCatalog.getString('Could not accept payment')); return bwsError.cb(err, gettextCatalog.getString('Could not accept payment'), cb);
}; };
if (txp.status != 'accepted') { if (txp.status != 'accepted') {
@ -235,7 +231,7 @@ angular.module('copayApp.services').factory('txService', function($rootScope, pr
stopReport(opts); stopReport(opts);
if (err) { if (err) {
return cb(bwsError.msg(err, gettextCatalog.getString('Could not broadcast payment'))); return bwsError.cb(err, gettextCatalog.getString('Could not broadcast payment'), cb);
}; };
$log.debug('Transaction signed and broadcasted') $log.debug('Transaction signed and broadcasted')

View file

@ -1,6 +1,6 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Version=1.12.1 Version=1.12.11
Name=Copay Name=Copay
Comment=A multisignature wallet Comment=A multisignature wallet
Exec=copay Exec=copay

View file

@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Copay" #define MyAppName "Copay"
#define MyAppVersion "1.12.1" #define MyAppVersion "1.12.11"
#define MyAppPublisher "BitPay" #define MyAppPublisher "BitPay"
#define MyAppURL "https://copay.io" #define MyAppURL "https://copay.io"
#define MyAppExeName "Copay.exe" #define MyAppExeName "Copay.exe"