-2

I was trying to get the number of methods in a jar file. I used "meterics" plugin of eclipse and cyvis script.
But both of them gave different answers.
Then I converted the jar file to its dex equivalent and extracted the number of methods from it.
The answer was totally different and much more than what meterics and cyvis gave. Can anyone explain why that difference might be ??

Mragank
  • 1
  • 1

1 Answers1

0

I'm not familiar with the meterics plugin, or the cyvis script. As far as the dex method count is concerned, it is a count of the number of unique methods referenced in the dex file.

A little background:

Methods are generally referenced in a dex file using a 16-bit unsigned integer, hence the 64k limit. This value is an index into a sorted list of unique method ids. A method id consists of a class, method name, argument types and return type. Multiple references to the same method id will use the same index.

The two main places where a method is referenced are when a method is declared within the class, and when a method is referenced within the bytecode of a method (e.g. a method call).

JesusFreke
  • 19,784
  • 5
  • 65
  • 68