fix: bring back smali files support (#961)
This commit is contained in:
+4
-2
@@ -1,5 +1,6 @@
|
||||
package jadx.plugins.input.javaconvert;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
@@ -12,7 +13,7 @@ import java.util.stream.Stream;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class ConvertResult {
|
||||
public class ConvertResult implements Closeable {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ConvertResult.class);
|
||||
|
||||
private final List<Path> converted = new ArrayList<>();
|
||||
@@ -34,7 +35,8 @@ public class ConvertResult {
|
||||
return converted.isEmpty();
|
||||
}
|
||||
|
||||
public void deleteTemp() {
|
||||
@Override
|
||||
public void close() {
|
||||
for (Path tmpPath : tmpPaths) {
|
||||
try {
|
||||
delete(tmpPath);
|
||||
|
||||
+3
-13
@@ -1,6 +1,5 @@
|
||||
package jadx.plugins.input.javaconvert;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
@@ -8,9 +7,7 @@ import jadx.api.plugins.JadxPluginInfo;
|
||||
import jadx.api.plugins.input.JadxInputPlugin;
|
||||
import jadx.api.plugins.input.data.ILoadResult;
|
||||
import jadx.api.plugins.input.data.impl.EmptyLoadResult;
|
||||
import jadx.plugins.input.dex.DexFileLoader;
|
||||
import jadx.plugins.input.dex.DexLoadResult;
|
||||
import jadx.plugins.input.dex.DexReader;
|
||||
import jadx.plugins.input.dex.DexInputPlugin;
|
||||
|
||||
public class JavaConvertPlugin implements JadxInputPlugin {
|
||||
|
||||
@@ -23,16 +20,9 @@ public class JavaConvertPlugin implements JadxInputPlugin {
|
||||
public ILoadResult loadFiles(List<Path> input) {
|
||||
ConvertResult result = JavaConvertLoader.process(input);
|
||||
if (result.isEmpty()) {
|
||||
result.deleteTemp();
|
||||
result.close();
|
||||
return EmptyLoadResult.INSTANCE;
|
||||
}
|
||||
List<DexReader> dexReaders = DexFileLoader.collectDexFiles(result.getConverted());
|
||||
return new DexLoadResult(dexReaders) {
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
super.close();
|
||||
result.deleteTemp();
|
||||
}
|
||||
};
|
||||
return DexInputPlugin.loadDexFiles(result.getConverted(), result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user