skylot / jadx

Dex to Java decompiler
Apache License 2.0
41.96k stars 4.9k forks source link

[feature] CHA-Based Virtual Call Navigation #2311

Open konata opened 1 month ago

konata commented 1 month ago

Describe your idea

Description

Implement a feature for navigating virtual call sites using Class Hierarchy Analysis (CHA) for the following sources:

abstract class Foo {
  abstract fun foo(): String
}

class Foo1 : Foo() {
  override fun foo(): String {
    TODO("Not yet implemented")
  }
}

class Foo2 : Foo() {
  override fun foo(): String {
    TODO("Not yet implemented")
  }
}

fun foobar(foo: Foo) {
    foo.foo() // call site
}

Proposed Behavior

When navigating to the call site foo.foo(), instead of a direct jump to Foo.foo(), display a selection menu that includes:

This allows users to choose which implementation they want to navigate to, and the same functionality should apply to interface methods as well.