Skip to content

Commit

Permalink
chore: check argument before save desc cache
Browse files Browse the repository at this point in the history
  • Loading branch information
cinit committed Nov 25, 2023
1 parent a4ad03d commit 5accac0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/src/main/java/io/github/qauxv/util/dexkit/DexKitTarget.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5accac0

Please sign in to comment.