mihaip / dex-method-counts

Command-line tool to count per-package methods in Android .dex files
Apache License 2.0
2.6k stars 376 forks source link

Allow outputting valid yaml #18

Open ndossougbe opened 8 years ago

ndossougbe commented 8 years ago

It would be nice if it was possible to easily use the output of this tool for other scripts, that would for example compare binary versions to find regressions.

Yaml seems to be a good candidate as it is already quite similar to the current output. It could be essentially changing the output from

Read in 65490 method IDs.
<root>: 65490
    <default>: 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: 65490

To something like


---
<root>: 
    <default>: 65490
    android: 
        <default>: 6837
        accessibilityservice: 6
        bluetooth: 2
        content: 
            <default>: 248
            pm: 22
            res: 45
        ...
    com:
        <default>: 53881
        adjust: 
            <default>: 283
            sdk: 283
        codebutler:
            <default>: 65
            android_websockets: 65
        ...

The totals aren't as prominent as in the current format so maybe just make it an option instead of the default format?