fix(gui): reset disk cache on new jadx version
This commit is contained in:
@@ -128,7 +128,7 @@ public class JadxArgs {
|
||||
|
||||
public void close() {
|
||||
try {
|
||||
inputFiles.clear();
|
||||
inputFiles = null;
|
||||
if (codeCache != null) {
|
||||
codeCache.close();
|
||||
}
|
||||
|
||||
@@ -238,9 +238,13 @@ public class Jadx {
|
||||
private static String version;
|
||||
|
||||
public static String getVersion() {
|
||||
if (version != null) {
|
||||
return version;
|
||||
if (version == null) {
|
||||
version = searchJadxVersion();
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
private static String searchJadxVersion() {
|
||||
try {
|
||||
ClassLoader classLoader = Jadx.class.getClassLoader();
|
||||
if (classLoader != null) {
|
||||
@@ -250,7 +254,6 @@ public class Jadx {
|
||||
Manifest manifest = new Manifest(is);
|
||||
String ver = manifest.getMainAttributes().getValue("jadx-version");
|
||||
if (ver != null) {
|
||||
version = ver;
|
||||
return ver;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory;
|
||||
import jadx.api.ICodeCache;
|
||||
import jadx.api.ICodeInfo;
|
||||
import jadx.api.JadxArgs;
|
||||
import jadx.core.Jadx;
|
||||
import jadx.core.dex.nodes.RootNode;
|
||||
import jadx.core.utils.Utils;
|
||||
import jadx.core.utils.exceptions.JadxRuntimeException;
|
||||
@@ -190,6 +191,7 @@ public class DiskCodeCache implements ICodeCache {
|
||||
|
||||
private String buildCodeVersion(JadxArgs args) {
|
||||
return DATA_FORMAT_VERSION
|
||||
+ ":" + Jadx.getVersion()
|
||||
+ ":" + args.makeCodeArgsHash()
|
||||
+ ":" + buildInputsHash(args.getInputFiles());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user