OTA Source toolkit for other language sites


Site Founder
Staff member
Nov 6, 2010
Hi everyone,

I'll keep this initial post short, essentially we've managed to get the end to end OTA process working including packaging a FULL English ROM as OTA!

We'd like to thank MIUI.us for the ota binary tip-off to get the final piece of our puzzle done. We'd just like to make it clear we wrote our own PHP to handle the front and backend process and edited our own apk and strings to our preference, nothing was kanged except a little help on the binary to thanks @warttack for that.

Onto business, we have developed scripts to handle OTA, these are based on PHP / MySQL in a Linux environment.

<strong>PHP / MySQL source code:</strong>
<h3>1. OTA Database updater script - <a href="http://pastebin.com/qB8pUv9m" target="_blank">http://pastebin.com/qB8pUv9m</a></h3>
This file basically will read your 'ota' web root folder for latest release you define in the script, we'll make it dynamic soon! it writes the required data to MySQL to be later retrieved in JSON output in the Updater.apk app.
<h3>2. MySQL Schema for OTA Database - <a href="http://pastebin.com/RE4nNFMW" target="_blank">http://pastebin.com/RE4nNFMW</a></h3>
Run the SQL file on a database named: ota
<h3>3. JSON Updater.apk handler - <a href="http://pastebin.com/3HESrhv8" target="_blank">http://pastebin.com/3HESrhv8</a></h3>
This file handles the output of the JSON which is parsed into Updater.apk, this file needs to be called in Updater.apk at http://yoursite.com/ota/update.php

The app sends a series of parameters, you'll see from the script what because we've commented the code.
<h3>4. Library items which MUST go in the libs folder within the ota directory!</h3>
config.php - <a href="http://pastebin.com/QWMcQEmw" target="_blank">http://pastebin.com/QWMcQEmw</a>

settings.php -<a href="http://pastebin.com/eUD27z9F" target="_blank">http://pastebin.com/eUD27z9F</a>

ota_functions.php -<a href="http://pastebin.com/eUD27z9F" target="_blank">http://pastebin.com/tJijzwE3</a> (some redundant functions need to come out, moment of madness :))

xss-filter.php -<a href="http://pastebin.com/eUD27z9F" target="_blank">http://pastebin.com/cJL22MWF</a> (Because escaped code matters)