From ed599f001925ecd6e02af3d0766fc0256923e0b7 Mon Sep 17 00:00:00 2001 From: Jonny Heggheim Date: Mon, 25 Apr 2016 23:54:27 +0100 Subject: [PATCH 1/2] Bumped the version of zxing from 1.7 (8 June 2011) to 3.2.1 (20 Aug 2015) --- mbhd-swing/pom.xml | 2 +- .../src/main/java/org/multibit/hd/ui/utils/QRCodes.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mbhd-swing/pom.xml b/mbhd-swing/pom.xml index 48b48cf97..ea5262433 100644 --- a/mbhd-swing/pom.xml +++ b/mbhd-swing/pom.xml @@ -296,7 +296,7 @@ com.google.zxing core - 1.7 + 3.2.1 diff --git a/mbhd-swing/src/main/java/org/multibit/hd/ui/utils/QRCodes.java b/mbhd-swing/src/main/java/org/multibit/hd/ui/utils/QRCodes.java index c4b6312c1..c1a63cd3d 100644 --- a/mbhd-swing/src/main/java/org/multibit/hd/ui/utils/QRCodes.java +++ b/mbhd-swing/src/main/java/org/multibit/hd/ui/utils/QRCodes.java @@ -39,8 +39,7 @@ public static Optional generateQRCode(String contents, int scaleF final ByteMatrix matrix; try { - QRCode code = new QRCode(); - matrix = encode(contents, code); + matrix = encode(contents); } catch (com.google.zxing.WriterException e) { return Optional.absent(); @@ -80,11 +79,11 @@ public static Optional generateQRCode(String contents, int scaleF * * @return A QR Code as a ByteMatrix 2D array of greyscale values */ - private static ByteMatrix encode(String contents, QRCode code) throws WriterException { + private static ByteMatrix encode(String contents) throws WriterException { Preconditions.checkState(!Strings.isNullOrEmpty(contents), "'contents' must be present"); - Encoder.encode(contents, ErrorCorrectionLevel.L, null, code); + QRCode code = Encoder.encode(contents, ErrorCorrectionLevel.L); // Use a multiple of 2 for desktop screen return renderResult(code, 2); From 2354871fa7e3e8b397df3b698346d9a6a75675a8 Mon Sep 17 00:00:00 2001 From: Jonny Heggheim Date: Tue, 26 Apr 2016 19:38:01 +0100 Subject: [PATCH 2/2] Updated the hash for zxing:core:3.2.1:jar --- mbhd-swing/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mbhd-swing/pom.xml b/mbhd-swing/pom.xml index ea5262433..53ad644c1 100644 --- a/mbhd-swing/pom.xml +++ b/mbhd-swing/pom.xml @@ -122,7 +122,7 @@ com.google.code.gson:gson:2.2.2:jar:null:compile:1f96456ca233dec780aa224bff076d8e8bca3908 com.google.guava:guava:16.0.1:jar:null:compile:5fa98cd1a63c99a44dd8d3b77e4762b066a5d0c5 com.google.protobuf:protobuf-java:2.5.0:jar:null:compile:a10732c76bfacdbd633a7eb0f7968b1059a65dfa - com.google.zxing:core:1.7:jar:null:compile:888814a387fc7570d50c4fbf4d20555d4fdd7646 + com.google.zxing:core:3.2.1:jar:null:compile:2287494d4f5f9f3a9a2bb6980e3f32053721b315 com.googlecode.jcsv:jcsv:1.4.0:jar:null:compile:3b2dfd1ff251cdcf4745a7643a966f14d10e2532 com.lambdaworks:scrypt:1.4.0:jar:null:compile:906506b74f30c8c20bccd9ed4a11112d8941fe87 com.madgag.spongycastle:core:1.51.0.0:jar:null:compile:0f642963312ea0e615ad65f28adc5a5b3a2a0862