diff --git a/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt b/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt index 4436160d97..94559ed215 100644 --- a/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt +++ b/app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt @@ -68,6 +68,10 @@ sealed class DexKitTarget { var descCache: String? get() = descCacheKey.value set(value) { + if (!value.isNullOrEmpty()) { + // check if the value is valid + DexMethodDescriptor(value) + } descCacheKey.value = value } diff --git a/app/src/main/java/io/github/qauxv/util/dexkit/DexMethodDescriptor.java b/app/src/main/java/io/github/qauxv/util/dexkit/DexMethodDescriptor.java index a24e2c349e..3fa6e18a80 100644 --- a/app/src/main/java/io/github/qauxv/util/dexkit/DexMethodDescriptor.java +++ b/app/src/main/java/io/github/qauxv/util/dexkit/DexMethodDescriptor.java @@ -66,6 +66,9 @@ public DexMethodDescriptor(String desc) { } int a = desc.indexOf("->"); int b = desc.indexOf('(', a); + if (a < 0 || b < 0) { + throw new IllegalArgumentException(desc); + } declaringClass = desc.substring(0, a); name = desc.substring(a + 2, b); signature = desc.substring(b);