A simple Python tool to:
- 🔍 Automatically detect OTA ZIP and recovery image
- ☁️ Upload OTA packages to OneDrive
- ⚙️ Generate OTA JSON
git clone -b 16 https://github.com/AndroidOne-Experience/OTA-update.git OTAsudo apt update
sudo apt install python3
sudo apt install python3-pip
pip3 install requests msalCreate file:
OTA/token.txt
ANDROID="define the version, like 16, 17"
TENANT_ID=xxxxxxxxxxxxxxxx
CLIENT_ID=xxxxxxxxxxxxxxxx
CLIENT_SECRET=xxxxxxxxxxxxxxxx
DRIVE_ID=xxxxxxxxxxxxxxxx
FOLDER_ID=xxxxxxxxxxxxxxxxout/target/product/<codename>/
Must contain:
- 📦
AndroidOne-<codename>-OTA-*.zip - 📄
system/build.prop - 🧩
recovery.img(optional)
python3 ./OTA/generate_ota.pypython3 ./OTA/generate_ota.py --upload👉 --upload = OneDrive upload only
python3 ./OTA/generate_ota.py --json👉 --json = JSON generation only
- ☁️
--upload→ Upload OTA files only - 🗂️
--json→ Generate JSON file only - 🔁 No argument → Upload + JSON generation
OTA/devices/<codename>.json
{
"response": [
{
"datetime": "1712658960",
"filename": "AndroidOne-miatoll-OTA-xxxx.zip",
"id": "sha256hash",
"size": 2697982122,
"url": "download_url",
"version": "16"
}
]
}- 🧾 Ensure
token.txtis correctly configured - 🔐 Microsoft Graph API credentials are required for OneDrive upload
- 🐧 Works best on Linux