fix(gui): reset disk cache on new jadx version

This commit is contained in:
Skylot
2022-06-04 23:26:25 +01:00
parent 49d0e76272
commit 81231206f3
3 changed files with 9 additions and 4 deletions
@@ -128,7 +128,7 @@ public class JadxArgs {
public void close() {
try {
inputFiles.clear();
inputFiles = null;
if (codeCache != null) {
codeCache.close();
}
+6 -3
View File
@@ -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());
}