# HG changeset patch # User volker # Date 1301252904 -7200 # Node ID 73f2f6cbd446d581ed7014f0ef5ca0a2ffe1c813 # Parent 31ee0b85dbfc1bf3ac61368646f78b5eb1a024fb Restore the original code and and add a if then else for Windows. diff -r 31ee0b85dbfc -r 73f2f6cbd446 src/test/java/org/icedrobot/daneel/DexifyingRunner.java --- a/src/test/java/org/icedrobot/daneel/DexifyingRunner.java Sun Mar 27 19:28:40 2011 +0200 +++ b/src/test/java/org/icedrobot/daneel/DexifyingRunner.java Sun Mar 27 21:08:24 2011 +0200 @@ -114,11 +114,17 @@ throw new DaneelException("Unable to execute 'dx' tool."); // Rewrite test code from DEX back to Java using our rewriter. - byte[] data = new byte[(int)tmp.length()]; - DataInputStream dai = new DataInputStream(new FileInputStream(tmp)); - dai.readFully(data); - dai.close(); - DexFile dex = DexFile.parse(data); + DexFile dex; + if( !System.getProperty("os.name").contains("Windows") ) { + dex = DexFile.parse(tmp); + } else { + //hack for Windows Java bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4715154 + byte[] data = new byte[(int)tmp.length()]; + DataInputStream dai = new DataInputStream(new FileInputStream(tmp)); + dai.readFully(data); + dai.close(); + dex = DexFile.parse(data); + } byte[] testCode = DexRewriter.rewrite(testClass, dex); // From this point on we no longer need the DEX file