Skip to content

Commit

Permalink
🐛 Fix compare proto
Browse files Browse the repository at this point in the history
  • Loading branch information
yhs0602 committed May 19, 2024
1 parent 3cd1df3 commit 7235fbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/kotlin/dex/ProtoId.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ data class ProtoId(

if (shorty != other.shorty) return false
if (returnType != other.returnType) return false
if (parameters != other.parameters) return false

return true
}

override fun hashCode(): Int {
var result = shorty.hashCode()
result = 31 * result + returnType.hashCode()
result = 31 * result + parameters.hashCode()
return result
}

}
4 changes: 2 additions & 2 deletions src/main/kotlin/vm/Environment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class Environment(
val triple = Triple(methodId.classId, methodId.protoId.parameters, methodId.name)
val mocked = mockedMethods[triple]
if (mocked != null) {
println("Requested: $methodId, found: $mocked, triple: $triple")
println("Requested: $methodId, found mocked: $mocked, triple: $triple")
// check if the codeitem is not null, handle inheritance
// It should find the finest method
if (direct) {
Expand Down Expand Up @@ -340,7 +340,7 @@ class Environment(
// " $classDef, $methodId:")
// " ${classData.directMethods.joinToString { it.methodId.toString() }}" +
// " ${classData.virtualMethods.joinToString { it.methodId.toString() }}")
println("Requested: $methodId, found: $method")
println("Requested: $methodId, found encoded: $method; ${method?.methodId}")
println(classData.directMethods.joinToString { it.methodId.toString() })
println(classData.virtualMethods.joinToString { it.methodId.toString() })
if (method == null) {
Expand Down

0 comments on commit 7235fbf

Please sign in to comment.