From c661798cd14128a2266acb36786bd285685a6506 Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Sat, 22 Sep 2018 17:45:19 -0700 Subject: [PATCH 1/5] Android Debug and release builds work when Gradle 3.3 is in PATH. --- Gruntfile.js | 2 +- app-template/config-template.xml | 2 +- src/android/build-extras.gradle | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 7968f2510..4ac23e47a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -71,7 +71,7 @@ module.exports = function(grunt) { sign_android: { // When the build log outputs "Built the following apk(s):", it seems to need the filename to start with "android-release". // It looks like it simply lists all apk files starting with "android-release" - command: 'rm -f platforms/android/build/outputs/apk/android-release-signed-*.apk; jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../bitcoin-com-release-key.jks -signedjar platforms/android/build/outputs/apk/android-release-signed.apk platforms/android/build/outputs/apk/android-release-unsigned.apk bitcoin-com && zipalign -v 4 platforms/android/build/outputs/apk/android-release-signed.apk platforms/android/build/outputs/apk/bitcoin-com-wallet-<%= pkg.fullVersion %>-android-signed-aligned.apk', + command: 'rm -f platforms/android/build/outputs/apk/release/*-android-signed-aligned.apk; jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../bitcoin-com-release-key.jks -signedjar platforms/android/build/outputs/apk/release/android-release-signed.apk platforms/android/build/outputs/apk/release/android-release-unsigned.apk bitcoin-com && zipalign -v 4 platforms/android/build/outputs/apk/release/android-release-signed.apk platforms/android/build/outputs/apk/release/bitcoin-com-wallet-<%= pkg.fullVersion %>-android-signed-aligned.apk', stdin: true, }, sign_desktop_dist: { diff --git a/app-template/config-template.xml b/app-template/config-template.xml index 8686b7b36..b24b86fae 100644 --- a/app-template/config-template.xml +++ b/app-template/config-template.xml @@ -77,7 +77,7 @@ - + diff --git a/src/android/build-extras.gradle b/src/android/build-extras.gradle index e7dd50572..c90145418 100644 --- a/src/android/build-extras.gradle +++ b/src/android/build-extras.gradle @@ -1,5 +1,6 @@ ext { ANDROID_SUPPORT_V4_VERSION = '26.1.0' + ANDROID_SUPPORT_ANNOTATIONS_VERSION = '26.1.0' } configurations.all { From 1b0541a7b5746c0ef2eae602695bc816cab1b0dc Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Sat, 22 Sep 2018 22:22:06 -0700 Subject: [PATCH 2/5] Return error from Shapeshift when pairs are unavailable. --- src/js/services/shapeShiftApiService.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/js/services/shapeShiftApiService.js b/src/js/services/shapeShiftApiService.js index cc5fb0792..92564464a 100644 --- a/src/js/services/shapeShiftApiService.js +++ b/src/js/services/shapeShiftApiService.js @@ -23,6 +23,13 @@ var ShapeShift = (function() { if (xmlhttp.status == 200) { var parsedResponse = JP(xmlhttp.responseText); cb.apply(null, [parsedResponse]); + } else if (xmlhttp.status === 500) { + var parsedResponse = JP(xmlhttp.responseText); + if (typeof parsedResponse.error === 'string') { + cb.apply(null, [parsedResponse]); + } else { + cb.apply(null, [new Error('Request Failed')]); + } } else { cb.apply(null, [new Error('Request Failed')]) } From 6452a0c7f4797a7321b58f4bff2ef72a54c01dda Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Sun, 23 Sep 2018 13:06:36 -0700 Subject: [PATCH 3/5] Handling JSON exception. --- src/js/services/shapeShiftApiService.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/js/services/shapeShiftApiService.js b/src/js/services/shapeShiftApiService.js index 92564464a..67e6f23de 100644 --- a/src/js/services/shapeShiftApiService.js +++ b/src/js/services/shapeShiftApiService.js @@ -23,15 +23,17 @@ var ShapeShift = (function() { if (xmlhttp.status == 200) { var parsedResponse = JP(xmlhttp.responseText); cb.apply(null, [parsedResponse]); - } else if (xmlhttp.status === 500) { - var parsedResponse = JP(xmlhttp.responseText); - if (typeof parsedResponse.error === 'string') { - cb.apply(null, [parsedResponse]); - } else { - cb.apply(null, [new Error('Request Failed')]); - } } else { - cb.apply(null, [new Error('Request Failed')]) + var cbResponse = new Error('Request Failed'); + if (xmlhttp.status === 500) { + try { + var errorResponse = JSON.parse(xmlhttp.responseText); + if (typeof errorResponse.error === 'string') { + cbResponse = errorResponse; + } + } catch (e) { /* nop */ } + } + cb.apply(null, [cbResponse]); } } }; From 8f8027d573832c100e4293f9166bdd8a1cbb290a Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Sun, 23 Sep 2018 20:56:15 -0700 Subject: [PATCH 4/5] Reverse out bugfix. --- src/js/services/shapeShiftApiService.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/js/services/shapeShiftApiService.js b/src/js/services/shapeShiftApiService.js index 67e6f23de..a90e587d4 100644 --- a/src/js/services/shapeShiftApiService.js +++ b/src/js/services/shapeShiftApiService.js @@ -24,16 +24,7 @@ var ShapeShift = (function() { var parsedResponse = JP(xmlhttp.responseText); cb.apply(null, [parsedResponse]); } else { - var cbResponse = new Error('Request Failed'); - if (xmlhttp.status === 500) { - try { - var errorResponse = JSON.parse(xmlhttp.responseText); - if (typeof errorResponse.error === 'string') { - cbResponse = errorResponse; - } - } catch (e) { /* nop */ } - } - cb.apply(null, [cbResponse]); + cb.apply(null, [new Error('Request Failed')]); } } }; From d2178d670f2949f8c89164bdc7e94ed44ce31ecf Mon Sep 17 00:00:00 2001 From: Brendon Duncan Date: Sun, 23 Sep 2018 21:05:26 -0700 Subject: [PATCH 5/5] Fix identification of BitPay. --- src/js/services/send-flow.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/services/send-flow.service.js b/src/js/services/send-flow.service.js index e8be2e487..babf5096a 100644 --- a/src/js/services/send-flow.service.js +++ b/src/js/services/send-flow.service.js @@ -52,7 +52,7 @@ angular // Detect some merchant that we know if (payProData.memo.indexOf('eGifter') > -1) { name = 'eGifter' - } else if (paymentUrl.indexOf('https://bitpay.com') > -1) { + } else if (payProData.url.indexOf('https://bitpay.com') > -1) { name = 'BitPay'; }