Skip to content

BGraph

Overview

BGraph (for Build-Graphs) is a project aimed at create build graphs from blueprints in AOSP and querying those graphs.

In short, this project builds/uses Unified Dependency Graph for the Android Open Source Project by parsing and linking modules defined in the Android build system Soong.

Use-cases

You should use this tool if you want to find:

  • all the dependencies of a source file in AOSP;
  • all the sources involved in the building of a target in AOSP;
  • common dependencies between two targets.

Usage (short)

% bgraph --help
Usage: bgraph [OPTIONS] COMMAND [ARGS]...

  BGraph - generate and query build dependency graphes.

  BGraph is used to manipulate build dependency graphs generated from
  blueprint files. The main commands are:

      - generate : used to generates multiples graphs

      - query: used to query a previously generated graph

  To get more help, see the online documentation.

Options:
  -v, --verbose         Activate verbose output  [default: False]
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or
                        customize the installation.

  --help                Show this message and exit.

Commands:
  generate         Generate BGraph's from a mirror dir.
  generate-single  Generate a BGraph from a branch.
  list             List the BGraph already generated.
  query            Query a BGraph.

Installation

pip install bgraph

See Installation for more detailed information or other options.

Citation

This tool is the companion of the SSTIC Presentation If you want to cite it, you may use the following bibtex.

@inproceedings{challande_exploitation_2021,
    location = {Rennes, France},
    title = {Exploitation du graphe de dépendance d'{AOSP} à des fins de sécurité},
    url = {https://www.sstic.org/2021/presentation/bgraph/},
    pages = {357--365},
    booktitle = {Symposium sur la Sécurité des Technologies de l'Information et des Communications 2021},
    author = {Challande, Alexis and Renault, Guénael and David, Robin},
    date = {2021-06},
    langid = {french}
}