Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mihaip/dex-method-counts
Command-line tool to count per-package methods in Android .dex files
https://github.com/mihaip/dex-method-counts
Last synced: about 1 month ago
JSON representation
Command-line tool to count per-package methods in Android .dex files
- Host: GitHub
- URL: https://github.com/mihaip/dex-method-counts
- Owner: mihaip
- License: apache-2.0
- Created: 2014-05-04T07:22:05.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-03-27T04:20:44.000Z (almost 5 years ago)
- Last Synced: 2024-11-30T04:03:16.213Z (about 2 months ago)
- Language: Java
- Size: 190 KB
- Stars: 2,604
- Watchers: 104
- Forks: 378
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-android-tools - dex-method-counts - Command-line tool to count per-package methods in Android .dex files. (CLI Tool)
README
# dex-method-counts
Simple tool to output per-package method counts in an Android DEX executable grouped by package, to aid in getting under the 65,536 referenced method limit. More details are [in this blog post](http://blog.persistent.info/2014/05/per-package-method-counts-for-androids.html).
To run it with Ant:
$ ant jar
$ ./dex-method-counts path/to/App.apk # or .zip or .dex or directoryor with Gradle:
$ ./gradlew assemble
$ ./dex-method-counts path/to/App.apk # or .zip or .dex or directoryon Windows:
$ gradlew assemble
$ dex-method-counts.bat path\to\App.apkYou'll see output of the form:
Read in 65490 method IDs.
: 65490
: 3
android: 6837
accessibilityservice: 6
bluetooth: 2
content: 248
pm: 22
res: 45
...
com: 53881
adjust: 283
sdk: 283
codebutler: 65
android_websockets: 65
...
Overall method count: 65490Supported options are:
* `--count-fields`: Provide the field count instead of the method count.
* `--include-classes`: Treat classes as packages and provide per-class method counts. One use-case is for protocol buffers where all generated code in a package ends up in a single class.
* `--package-filter=...`: Only consider methods whose fully qualified name starts with this prefix.
* `--max-depth=...`: Limit how far into package paths (or inner classes, with `--include-classes`) counts should be reported for.
* `--filter=[all|defined_only|referenced_only]`: Whether to count all methods (the default), just those defined in the input file, or just those that are referenced in it. Note that referenced methods count against the 64K method limit too.
* `--output-style=[flat|tree]`: Print the output as a list or as an indented tree.The DEX file parsing is based on the `dexdeps` tool from
[the Android source tree](https://android.googlesource.com/platform/dalvik.git/+/master/tools/dexdeps/).