Created
November 11, 2012 21:28
-
-
Save raek/4056327 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void zipDex(File dexFile, File zippedDexFile) throws IOException | |
{ | |
InputStream in = new FileInputStream(dexFile); | |
OutputStream out = new FileOutputStream(zippedDexFile); | |
ZipOutputStream zipOut = new ZipOutputStream(new BufferedOutputStream(out)); | |
ZipEntry classesEntry = new ZipEntry("classes.dex"); | |
zipOut.putNextEntry(classesEntry); | |
byte[] buffer = new byte[1024]; | |
while (true) { | |
int read = in.read(buffer); | |
if (read == -1) break; | |
zipOut.write(buffer, 0, read); | |
} | |
in.close(); | |
zipOut.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment