3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-12 02:05:53 +00:00

Fix for Android ART vs Dalvik difference.

This commit is contained in:
Mike Hearn 2014-08-06 16:40:13 +02:00
parent e41e0c4a1d
commit 4ae6349f35

View File

@ -67,7 +67,14 @@ public class MnemonicCode {
/** Initialise from the included word list. Won't work on Android. */
public MnemonicCode() throws IOException {
this(MnemonicCode.class.getResourceAsStream("mnemonic/wordlist/english.txt"), BIP39_ENGLISH_SHA256);
this(openDefaultWords(), BIP39_ENGLISH_SHA256);
}
private static InputStream openDefaultWords() throws IOException {
InputStream stream = MnemonicCode.class.getResourceAsStream("mnemonic/wordlist/english.txt");
if (stream == null)
throw new IOException(); // Handle Dalvik vs ART divergence.
return stream;
}
/**