A Python script designed to automate Android ROM building and interaction with Telegram. It handles source syncing, compilation, progress monitoring, and file uploading.
Adapted by Frost from the original Bash script by hipexscape.
- Python 3.x
requestslibrary (pip install requests)repotool installed and in your PATHrcloneinstalled and configured
-
Clone the repository: Clone this repository to the root of your source tree (or anywhere accessible).
-
Install dependencies:
pip install requests
-
Create a Configuration File: Create a file named
config.env(or any name likeconfig.device.env) in the same directory as the script (for reference, see config.example.env). You can create multiple config files for different devices.Template:
# Device Configuration DEVICE=your_device_codename VARIANT=user OFFICIAL_FLAG=False # Telegram Configuration CHAT_ID=-100xxxxxxxx BOT_TOKEN=your_bot_token ERROR_CHAT_ID=-100xxxxxxxx # Upload Configuration RCLONE_REMOTE=drive RCLONE_FOLDER=roms/device_name # Initial install zip Configuration INITIAL_INSTALL_ZIP_DEVICES=codename|codename2 # Server Management POWEROFF=False
| Variable | Description |
|---|---|
DEVICE |
Your device codename (e.g., zircon, veux) |
VARIANT |
Build variant (user, userdebug, or eng) |
OFFICIAL_FLAG |
Set to True if this is an official build, False otherwise |
CHAT_ID |
Your Telegram Group/Channel Chat ID (e.g., -100xxxxxxx) |
BOT_TOKEN |
Your HTTP API Bot Token from BotFather |
ERROR_CHAT_ID |
Secondary Chat ID for sending error logs (can be same as CHAT_ID) |
RCLONE_REMOTE |
Your rclone remote name (e.g., drive) |
RCLONE_FOLDER |
The target folder on the rclone remote |
INITIAL_INSTALL_ZIP_DEVICES |
The devices you want the initial install zip to be flashable to. If not specified, it falls back to DEVICE |
POWEROFF |
Set to True to power off the server after completion |
The script automatically uploads the build results to two locations:
- ROM Zip: The main ROM file is uploaded to your Rclone Remote defined in the config (e.g., Google Drive, Mega, OneDrive).
- Other Files: Other files (e.g., OTA JSON, Initial Install Zip) is uploaded to GoFile.io for quick, temporary access.
Run the script using python3 ci_bot.py [options].
| Option | Flag | Description |
|---|---|---|
| Config | --config |
Path to your specific configuration file. Defaults to config.env if not specified. |
| Sync | -s, --sync |
Runs repo sync before starting the build. Useful for fetching the latest source changes. |
| Clean | -c, --clean |
Deletes the entire out/ directory. Use this for a completely fresh build (takes longer). |
| Disk Opt. | --d-o, --disk-optimization |
Runs a disk optimizing script before building. |