Skip to content

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📦 OTA JSON File Generator & Uploader

A simple Python tool to:

  • 🔍 Automatically detect OTA ZIP and recovery image
  • ☁️ Upload OTA packages to OneDrive
  • ⚙️ Generate OTA JSON

🚀 Installation

📥 Clone Repository

git clone -b 16 https://github.com/AndroidOne-Experience/OTA-update.git OTA

📦 Install Dependencies

sudo apt update
sudo apt install python3
sudo apt install python3-pip
pip3 install requests msal

⚙️ Configuration

Create file:

OTA/token.txt

✏️ Example token.txt

ANDROID="define the version, like 16, 17"

TENANT_ID=xxxxxxxxxxxxxxxx
CLIENT_ID=xxxxxxxxxxxxxxxx
CLIENT_SECRET=xxxxxxxxxxxxxxxx
DRIVE_ID=xxxxxxxxxxxxxxxx
FOLDER_ID=xxxxxxxxxxxxxxxx

📂 Required Build Output

out/target/product/<codename>/

Must contain:

  • 📦 AndroidOne-<codename>-OTA-*.zip
  • 📄 system/build.prop
  • 🧩 recovery.img (optional)

▶️ Usage

🔹 Upload + JSON file generation (default)

python3 ./OTA/generate_ota.py

☁️ Upload OTA files ONLY

python3 ./OTA/generate_ota.py --upload

👉 --upload = OneDrive upload only


🗂️ Generate JSON file ONLY

python3 ./OTA/generate_ota.py --json

👉 --json = JSON generation only


📘 Argument Explanation

  • ☁️ --upload → Upload OTA files only
  • 🗂️ --json → Generate JSON file only
  • 🔁 No argument → Upload + JSON generation

📄 Generated JSON

OTA/devices/<codename>.json

📌 Example JSON

{
  "response": [
    {
      "datetime": "1712658960",
      "filename": "AndroidOne-miatoll-OTA-xxxx.zip",
      "id": "sha256hash",
      "size": 2697982122,
      "url": "download_url",
      "version": "16"
    }
  ]
}

⚠️ Notes

  • 🧾 Ensure token.txt is correctly configured
  • 🔐 Microsoft Graph API credentials are required for OneDrive upload
  • 🐧 Works best on Linux

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages