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 (Optional, but recommended for ROM storage)
-
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 (Leave empty to force GoFile upload) RCLONE_REMOTE=drive RCLONE_FOLDER=roms/device_name # Initial install zip Configuration (Leave empty if you want to use your device's codename or if your device has recovery.img) 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). If omitted, uploads to GoFile |
RCLONE_FOLDER |
The target folder on the rclone remote |
INITIAL_INSTALL_ZIP_DEVICES |
Used only if recovery.img is missing. Defines allowed devices for the generated install zip. Defaults to DEVICE |
POWEROFF |
Set to True to power off the server after completion |
The script automatically handles uploads based on your configuration:
- ROM Zip:
- Primary: Uploads to the Rclone Remote defined in the config.
- Fallback: If
RCLONE_REMOTEorRCLONE_FOLDERare missing from the config, the ROM zip is automatically uploaded to GoFile.io.
- Auxiliary Files: Always uploaded to GoFile.io for quick access:
- Recovery: If
recovery.imgis found in the output, it is uploaded directly. - Initial Install Zip: If
recovery.imgis not found, the script generates a flashable zip containingboot,vendor_boot, anddtboand uploads that instead. - OTA JSON: If a matching JSON file is found in
vendor/ota/, it is also uploaded.
- Recovery: If
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. |