Skip to content
README.md 2.68 KiB
Newer Older
Danny Lin's avatar
Danny Lin committed
# adevtool
Danny Lin's avatar
Danny Lin committed

Danny Lin's avatar
Danny Lin committed
Android ROM device support and bringup tool, designed for maximum automation and speed.
Danny Lin's avatar
Danny Lin committed

[![Demo video on asciinema](https://asciinema.org/a/kCWUN6XcyaDEU6bcoE65rVQrv.svg)](https://asciinema.org/a/kCWUN6XcyaDEU6bcoE65rVQrv)

Danny Lin's avatar
Danny Lin committed
## Features
Danny Lin's avatar
Danny Lin committed

This tool automates the following tasks for devices that mostly run AOSP out-of-the-box (e.g. Google Pixel):
Danny Lin's avatar
Danny Lin committed

Danny Lin's avatar
Danny Lin committed
- Downloading factory images and full OTA packages
- Generating a list of **proprietary files**
- Resolving overridden build rules and **building modules from source** (when possible)
- Extracting, converting, and mounting **factory images**
Danny Lin's avatar
Danny Lin committed
- Extracting proprietary files
- Extracting bootloader and radio **firmware**
- Finding and adding missing system **properties**
- Overriding build **fingerprint** to help pass SafetyNet
- Adding missing **SELinux policies**
- Adding missing HALs to **vendor interface** manifests
- Generating resource **overlays** for device configs
- Fixing privileged app signing **certificates** referenced in SELinux policies
Danny Lin's avatar
Danny Lin committed

This typically results in better device support with fewer bugs and issues, and makes it possible to quickly add support for new devices.
Danny Lin's avatar
Danny Lin committed

### Non-AOSP devices

Pixel devices will benefit from the most automation, but several features can still be used to ease manual bringup on other devices:

- **Extract** files from proprietary-files.txt **up to 10x faster than LineageOS extract-utils**
- **Compare** a built system against stock images to find missing files, properties, and vendor interface declarations
- **List** system files relevant to bringup (in all partitions)
- **Resolve overridden** build rules from build warnings
- Check SELinux policies to identify apps that should be **presigned**
Danny Lin's avatar
Danny Lin committed

Danny Lin's avatar
Danny Lin committed
## Installation
Danny Lin's avatar
Danny Lin committed

Danny Lin's avatar
Danny Lin committed
Pre-requisites:
Danny Lin's avatar
Danny Lin committed

Danny Lin's avatar
Danny Lin committed
- [Node.js](https://nodejs.org/)
- Optional:
  - For converting sparse factory images: [simg2img](https://github.com/anestisb/android-simg2img)
  - For extracting OTA packages: [payload-dumper-go](https://github.com/ssut/payload-dumper-go)
  - For extracting OTAs or factory images: `unzip`
  - For generating overlays: [AAPT2](https://developer.android.com/studio/command-line/aapt2) (included in AOSP and Android SDK)

To run adevtool without installation:

```bash
npx adevtool
Danny Lin's avatar
Danny Lin committed
```

Danny Lin's avatar
Danny Lin committed
To install adevtool globally using npm:
Danny Lin's avatar
Danny Lin committed

Danny Lin's avatar
Danny Lin committed
```bash
npm install -g adevtool
Danny Lin's avatar
Danny Lin committed
```

Danny Lin's avatar
Danny Lin committed
Using Yarn:

```bash
yarn global add adevtool
```

## Usage

- [Bringing up a new Pixel device](docs/pixel-bringup.md)
- [Generating or updating an existing device](docs/pixel-generate.md)
- [Using individual helper commands](docs/commands.md)
Danny Lin's avatar
Danny Lin committed

## License

This tool is licensed under the [MIT license](LICENSE), ensuring that anyone is free to use it for any purpose in compliance with the license. Contributions are welcome!