From 784ed9ed4ef2930702f7adaa9a0130a4dfebd6d9 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Fri, 7 Oct 2016 22:08:55 +0200 Subject: [PATCH] Fixed importer exception on Android --- .../ch/dissem/bitmessage/wif/WifImporter.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/wif/src/main/java/ch/dissem/bitmessage/wif/WifImporter.java b/wif/src/main/java/ch/dissem/bitmessage/wif/WifImporter.java index f5a8ddc..0d010c9 100644 --- a/wif/src/main/java/ch/dissem/bitmessage/wif/WifImporter.java +++ b/wif/src/main/java/ch/dissem/bitmessage/wif/WifImporter.java @@ -63,15 +63,15 @@ public class WifImporter { Profile.Section section = entry.getValue(); BitmessageAddress address = Factory.createIdentityFromPrivateKey( - entry.getKey(), - getSecret(section.get("privsigningkey")), - getSecret(section.get("privencryptionkey")), - section.get("noncetrialsperbyte", long.class), - section.get("payloadlengthextrabytes", long.class), - Pubkey.Feature.bitfield(features) + entry.getKey(), + getSecret(section.get("privsigningkey")), + getSecret(section.get("privencryptionkey")), + Long.parseLong(section.get("noncetrialsperbyte")), + Long.parseLong(section.get("payloadlengthextrabytes")), + Pubkey.Feature.bitfield(features) ); if (section.containsKey("chan")) { - address.setChan(section.get("chan", boolean.class)); + address.setChan(Boolean.parseBoolean(section.get("chan"))); } address.setAlias(section.get("label")); identities.add(address); @@ -82,10 +82,10 @@ public class WifImporter { byte[] bytes = Base58.decode(walletImportFormat); if (bytes[0] != WIF_FIRST_BYTE) throw new IOException("Unknown format: 0x80 expected as first byte, but secret " + walletImportFormat + - " was " + bytes[0]); + " was " + bytes[0]); if (bytes.length != WIF_SECRET_LENGTH) throw new IOException("Unknown format: " + WIF_SECRET_LENGTH + - " bytes expected, but secret " + walletImportFormat + " was " + bytes.length + " long"); + " bytes expected, but secret " + walletImportFormat + " was " + bytes.length + " long"); byte[] hash = cryptography().doubleSha256(bytes, 33); for (int i = 0; i < 4; i++) {