JesusFreke / smali

smali/baksmali
6.33k stars 1.07k forks source link

dexlib2: expose methodIndex in DexBackedMethodReference #784

Open koenyskout opened 4 years ago

koenyskout commented 4 years ago

DexBackedMethodReference contains a field to hold the methodIndex of the referenced method, but does not expose it. I think the field should be public, like the other DexBacked*Reference classes.

(Use case: I want to obtain the offset for a method based on the DexBackedMethodReference; right now, I can only do that by using indexOf on the dex file's MethodSection, which has terrible performance.)

The same issue exists in DexBackedFieldReference.

neomafo88 commented 1 year ago

Probably can just simply use Java Reflection to invoke it.