diff --git a/dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2Asm.java b/dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2Asm.java index 003c61a02..ea95142f1 100644 --- a/dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2Asm.java +++ b/dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2Asm.java @@ -529,8 +529,17 @@ public void convertClass(int dexVersion, DexClassNode classNode, ClassVisitorFac private static final Set HEX_DECODE_METHODS = new HashSet<>(Arrays.asList("decode_J", "decode_I", "decode_S", "decode_B")); + protected InputStream getHexClassAsStream() { + return Dex2Asm.class.getResourceAsStream("/" + HEX_CLASS_LOCATION + ".class"); + } + private void addHexDecodeMethod(ClassVisitor outCV, String className, String hexDecodeMethodNameBase) { - try (InputStream is = Dex2Asm.class.getResourceAsStream("/" + HEX_CLASS_LOCATION + ".class")) { + InputStream hexClassStream = getHexClassAsStream(); + if (hexClassStream == null) { + return; + } + + try (InputStream is = hexClassStream) { ClassReader cr = new ClassReader(is); cr.accept(new ClassVisitor(Opcodes.ASM9) { @Override