quarkslab/bgraph
GitHub: quarkslab/bgraph
一款用于解析 Android.bp Soong 文件并生成、查询 AOSP 构建依赖关系图的 Python 工具。
Stars: 20 | Forks: 9
# BGraph
`BGraph` 是一款旨在从 `Android.bp` soong 文件生成依赖关系图的工具。
## 概述
`BGraph`(代表 `Build-Graphs`)是一个旨在从 AOSP 中的 _blueprints_ 创建构建图并查询这些图的项目。
简而言之,该项目通过解析和链接 [Android Open Source Project](https://source.android.com/) 中定义的构建系统 [Soong](https://source.android.com/setup/build) 的模块,来构建/使用统一依赖图。
### 用例
如果你想要查找以下内容,应该使用此工具:
* AOSP 中某个源文件的所有依赖项;
* 参与 AOSP 中某个目标构建的所有源文件;
* 两个目标之间的共同依赖项。
## 使用方法
```
% 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.
```
## 安装说明
### 使用 poetry
```
poetry install bgraph
```
### 使用 pip
```
pip install bgraph
```
### 使用 docker
```
docker build -f docker/Dockerfile -t bgraph .
```
这将创建一个包含 `git`、`repo` 和 `bgraph` 的容器,并会花费一些时间(因为它从源代码编译 git)。
有关更多说明,请参阅 [Docker](docs/docker.md)。
## 前置条件
- python3.8
### 构建器的可选依赖项:
- repo
- git (>25):由于我们使用部分检出的方式,因此需要现代版本的 git
- 至少 **1GB** 的可用磁盘空间
- (可选:AOSP 镜像)
有关更多详细信息,请参阅 [Building from AOSP](docs/building.md)。
## 文档
[Documentation](https://quarkslab.github.io/bgraph)
## 许可证
[Apache-2](https://choosealicense.com/licenses/apache-2.0)
## 贡献
我们随时欢迎贡献!
有关贡献所需了解的所有详细信息,请参阅 [Contribution](docs/contribute.md) 文档。
## 作者
- dm (achallande@quarkslab.com)
标签:Android.bp, AOSP, Mutation, Python, SOC Prime, Soong, WebSocket, 云安全监控, 云资产清单, 依赖分析, 依赖图, 可视化, 安卓, 开发工具, 数据集, 无后门, 构建系统, 网络安全研究, 蓝图文件, 请求拦截, 逆向工程, 静态分析