Make sure to truncate the output file before writing the new dex file

This commit is contained in:
Ben Gruver 2013-04-18 21:18:49 -07:00
parent 2fe6041fa9
commit 231034cf95

View File

@ -195,6 +195,7 @@ public class DexFile {
private void writeTo(@Nonnull String path) throws IOException {
RandomAccessFile raf = new RandomAccessFile(path, "rw");
raf.setLength(0);
try {
int dataSectionOffset = getDataSectionOffset();
DexWriter headerWriter = outputAt(raf, 0);