diff --git a/ethereumj-core/build.gradle b/ethereumj-core/build.gradle index ae5d1f17..728d73c2 100644 --- a/ethereumj-core/build.gradle +++ b/ethereumj-core/build.gradle @@ -120,6 +120,7 @@ dependencies { compile 'com.google.code.findbugs:jsr305:3.0.0' compile 'com.fasterxml.jackson.core:jackson-databind:2.2.0' compile 'org.apache.commons:commons-collections4:4.0' + compile "commons-codec:commons-codec:1.10" compile 'org.hsqldb:hsqldb:1.8.0.10' // best performance - do not upgrade! compile 'javax.persistence:persistence-api:1.0.2' diff --git a/ethereumj-core/src/main/java/org/ethereum/vm/VMUtils.java b/ethereumj-core/src/main/java/org/ethereum/vm/VMUtils.java index 0517bdb1..3d1bcb9a 100644 --- a/ethereumj-core/src/main/java/org/ethereum/vm/VMUtils.java +++ b/ethereumj-core/src/main/java/org/ethereum/vm/VMUtils.java @@ -15,7 +15,8 @@ import static java.lang.System.getProperty; //import static java.util.Base64.getDecoder; //import static java.util.Base64.getEncoder; //import static org.springframework.util.StringUtils.isEmpty; -import static android.util.Base64.*; +import static org.apache.commons.codec.binary.Base64.decodeBase64; +import static org.apache.commons.codec.binary.Base64.encodeBase64String; public final class VMUtils { @@ -120,7 +121,7 @@ public final class VMUtils { public static String zipAndEncode(String content) { try { - return encodeToString(compress(content), DEFAULT);//getEncoder().encodeToString(compress(content)); + return encodeBase64String(compress(content)); } catch (Exception e) { LOGGER.error("Cannot zip or encode: ", e); return content; @@ -129,7 +130,7 @@ public final class VMUtils { public static String unzipAndDecode(String content) { try { - return decompress(decode(content, DEFAULT));//decompress(getDecoder().decode(content)); + return decompress(decodeBase64(content)); } catch (Exception e) { LOGGER.error("Cannot unzip or decode: ", e); return content;