parent
e1d2196977
commit
7ba9e03cb0
1 changed files with 6 additions and 10 deletions
|
@ -1,5 +1,7 @@
|
||||||
package the.bytecode.club.bytecodeviewer.util;
|
package the.bytecode.club.bytecodeviewer.util;
|
||||||
|
|
||||||
|
import com.googlecode.d2j.dex.Dex2jar;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
@ -37,16 +39,10 @@ public class Dex2Jar {
|
||||||
*/
|
*/
|
||||||
public static synchronized void dex2Jar(File input, File output) {
|
public static synchronized void dex2Jar(File input, File output) {
|
||||||
try {
|
try {
|
||||||
com.googlecode.dex2jar.tools.Dex2jarCmd cmd = new com.googlecode.dex2jar.tools.Dex2jarCmd();
|
Dex2jar d2Jar = Dex2jar.from(input);
|
||||||
applyErrorFix(cmd);
|
d2Jar.to(output.toPath());
|
||||||
cmd.doMain(input.getAbsolutePath());
|
} catch (com.googlecode.d2j.DexException e) {
|
||||||
String realOutput = input.getName().replaceAll("\\.dex", "-dex2jar.jar").replaceAll("\\.apk", "-dex2jar"
|
e.printStackTrace();
|
||||||
+ ".jar");
|
|
||||||
File realOutputF = new File(realOutput);
|
|
||||||
realOutputF.renameTo(output);
|
|
||||||
File realOutputF2 = new File(realOutput);
|
|
||||||
while (realOutputF2.exists())
|
|
||||||
realOutputF2.delete();
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue