Skip to content

Java heap memory: Leaking #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
package com.googlecode.dex2jar.tools;

import com.googlecode.d2j.dex.Dex2jar;
import com.googlecode.d2j.reader.BaseDexFileReader;
import com.googlecode.d2j.reader.DexFileReader;
import com.googlecode.d2j.reader.MultiDexFileReader;
import com.googlecode.dex2jar.ir.ET;

import java.io.File;
import java.io.FileInputStream;
import java.nio.file.Files;
import java.nio.file.Path;

Expand Down Expand Up @@ -102,20 +101,23 @@ protected void doCommandLine() throws Exception {
Path file = output == null ? currentDir.resolve(baseName + "-dex2jar.jar") : output;
System.err.println("dex2jar " + fileName + " -> " + file);

BaseDexFileReader reader = MultiDexFileReader.open(Files.readAllBytes(new File(fileName).toPath()));
BaksmaliBaseDexExceptionHandler handler = notHandleException ? null : new BaksmaliBaseDexExceptionHandler();
Dex2jar.from(reader).withExceptionHandler(handler).reUseReg(reuseReg).topoLogicalSort()
try(FileInputStream input = new FileInputStream(new File(fileName))){
DexFileReader reader = new DexFileReader(input);
BaksmaliBaseDexExceptionHandler handler = notHandleException ? null : new BaksmaliBaseDexExceptionHandler();
Dex2jar.from(reader).withExceptionHandler(handler).reUseReg(reuseReg).topoLogicalSort()
.skipDebug(!debugInfo).optimizeSynchronized(this.optmizeSynchronized).printIR(printIR)
.noCode(noCode).to(file);

if (!notHandleException) {
if (handler.hasException()) {
Path errorFile = exceptionFile == null ? currentDir.resolve(baseName + "-error.zip")
: exceptionFile;
System.err.println("Detail Error Information in File " + errorFile);
System.err.println(BaksmaliBaseDexExceptionHandler.REPORT_MESSAGE);
System.err
.println("Please report this file to http://code.google.com/p/dex2jar/issues/entry if possible.");
handler.dump(errorFile, orginalArgs);
}
}catch(Exception e) {
throw e;
}
// long endTS = System.currentTimeMillis();
// System.err.println(String.format("%.2f", (float) (endTS - baseTS) / 1000));
Expand Down