# Android dependency visualizer

## General

Category
Free
Tag
APK
Registered
Sep 28, 2016
Favorites
7
https://github.com/alexzaitsev/apk-dependency-graph
apkdetails
APK patch size estimator
ApkToolPlus
DecompileApk
apk-method-count

Language
JavaScript
Version
0.1.5 (Jan 10, 2019)
Created
Sep 8, 2016
Updated
Feb 4, 2019
Owner
Alex Zaitsev (alexzaitsev)
Contributors
3
Activity
Generate
Source code

## Show card

Android dependency visualizer. It's a tool that helps to visualize current state of your project. It's really easy to see how tight your classes are coupled.

## Theory

Class coupling is one of the significant code metrics which shows how easy is to change your code. Actually the architecture of microservices is based on the idea that the modules should be low-coupled so you are able to easily replace one module with another one with the same interface. This tool helps to view whole picture of your project. Check yourself!

## Project structure

This project consists of the several parts:

• lib (baksmali)
• src, build (apk-dependency-graph)
• gui (d3)
• run scripts

## Compile

To compile build/jar/apk-dependency-graph.jar you need:

• at least Java 5 From terminal just move to the parent folder of the project and run ant command. Classes will be generated to build/classes folder and jar file will appear onto build/jar folder.

## Run

You need at least Java 7 to run apk-dependency-graph jar file.

## Usage

### Fast way

I've prepared helpful scripts 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 com.example.test true


or

run.bat full\path\to\the\apk\app-release.apk nofilter false


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, com.example.test is a filter. We recommend to use your package name as a filter so you will avoid unnecessary dependencies in your graph. If you don't want to filter just pass nofilter. The last argument defines whether you want to skip inner classes on your graph (true to skip, false otherwise).

For Unix:

./run.sh full/path/to/the/apk/app-release.apk com.example.test true


or

./run.sh full/path/to/the/apk/app-release.apk nofilter false


Wait until the command finishes:

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


It will decompile your apk and create 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!

## Examples

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

And this one looks like a spaghetti:

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

## Demo

Watch demo video.

## Hashtag

Share your awesome architecture using #apkdependencyvizualizer hashtag!