Include the first 8 bytes of the file when reporting a bad magic value

git-svn-id: https://smali.googlecode.com/svn/trunk@468 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
This commit is contained in:
JesusFreke@JesusFreke.com
2009-09-13 19:45:54 +00:00
parent 4a0d9d3fa1
commit 343848c849

View File

@ -306,7 +306,13 @@ public class DexFile
} else if (isDex) {
in = new ByteArrayInput(FileUtils.readFile(file));
} else {
throw new RuntimeException("bad magic value");
StringBuilder sb = new StringBuilder();
sb.append("bad magic value:");
for (int i=0; i<8; i++) {
sb.append(" ");
sb.append(magic[i]);
}
throw new RuntimeException(sb.toString());
}
ReadContext readContext = new ReadContext(this);