MCPcopy Index your code
hub / github.com/alexzaitsev/apk-dependency-graph

github.com/alexzaitsev/apk-dependency-graph @0.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.3.1 ↗ · + Follow
128 symbols 341 edges 27 files 29 documented · 23% updated 5y ago0.3.1 · 2019-11-26★ 7616 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Apk Dependency Graph (ADG)

Build Status version Android Arsenal

Class dependency visualizer. Only apk file is needed.
Class coupling is one of the significant code metrics that shows how easy is to change, maintain and test the code. This tool helps to view whole picture of the project.

Table of contents * Usage * Compile * Examples * Demo * Contributors * Credits

Usage

Some helpful scripts are prepared for you. All you need to do is to download and unpack the latest release and type the next command in your command line:

For Windows:

run.bat full\path\to\the\apk\app-release.apk full\path\to\the\filterset.json

Where: * run.bat is a path to script in your local repository * full\path\to\the\apk\app-release.apk is a full path to the apk file you want to analize * full\path\to\the\filterset.json is a full path to the filterset file

The tool is provided with the default filterset. However, you're highly encouraged to customize it. Read filter instructions for the details.

For Unix:

./run.sh full/path/to/the/apk/app-release.apk full/path/to/the/filterset.json

Wait until the command finishes:

Baksmaling classes.dex...
Analyzing dependencies...
Success! Now open index.html in your browser.

It will decompile your apk and create output/apk-file-name folder in the same folder where the script is. After this it will analyze the smali code and generate gui/analyzed.js file which contains all dependencies.
Now open gui/index.html in your browser and enjoy!

Compile

At least Java 8 is needed to compile and run the jar file.

Ways to compile build/jar/apk-dependency-graph.jar:

>> gradle build (Gradle 5.0 or newer)
>> gradlew build (Gradle Wrapper)
>> ant (Ant)

Classes will be generated to build/classes folder and jar file will appear onto build/jar folder.

To get more information please check our wiki page.

Examples

Here is the sample of good architecture with low class coupling:
Good sample

And this one looks like a spaghetti:
Good sample

Does your project look like the first or the second picture? :)

Demo

Watch demo video.

Contributors

I want to say thank you to all the people who made even tiny pull request. This project is intended to improve current state of Android architecture all over the world so each detail is important. In the contributors page you can find a list of people who have found some time to improve this tool.

Credits

There is the same tool for iOS: https://github.com/PaulTaykalo/objc-dependency-visualizer
I have used gui/index.html of that project. Thanks Paul for the great tool.

Core symbols most depended-on inside this repo

Shape

Method 100
Class 22
Function 6

Languages

Java95%
TypeScript5%

Modules by API surface

src/main/java/com/alex_zaitsev/adg/SmaliAnalyzer.java12 symbols
src/test/java/FiltersReaderTests.java10 symbols
src/main/java/com/alex_zaitsev/adg/util/CodeUtils.java10 symbols
src/main/java/com/alex_zaitsev/adg/io/Arguments.java10 symbols
src/main/java/com/alex_zaitsev/adg/decode/ApkSmaliDecoder.java9 symbols
src/test/java/FilterProviderTests.java8 symbols
src/test/java/ArgumentReaderTests.java8 symbols
src/main/java/com/alex_zaitsev/adg/io/Filters.java8 symbols
src/test/java/SmaliAnalyzerTests.java7 symbols
src/main/java/com/alex_zaitsev/adg/filter/AndFilter.java5 symbols
gui/scripts/d3-setup-custom.js5 symbols
src/main/java/com/alex_zaitsev/adg/io/ArgumentReader.java4 symbols

For agents

$ claude mcp add apk-dependency-graph \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page