EDIT: I took the time to develop the first release of the REST API server, you can find it on my Github as always as an OpenSource project.
first of all Happy New Year since it’s the first post of 2014 :) Next, you probably may be curious to know what I was doing all these days. Well, since I’m using a custom ROM on my own Galaxy S2 (CM11 compiled by iNFECTED) I was asking myself “why cannot custom roms use the already built-in OTA by CM with our custom server?
Well, today I’m here to explain how to it, since I’m really astonished why a bigger community like LineageOS which loves Open Source does not document or release their public server interface that talks with their ROMs. But hey, we love to hack, right? Let’s get back to business!
First of all clone the Unit Test example on how to call the ACTUAL server of LineageOS. You can run this script using NodeJS. These are the simple steps you have to do to run it and debug it by yourself
If all went well, you will see a
console.log of the server answer, which will be like this one (I’m using a piece of that from the i9300 channel):
As we may see, the answer is pretty much a simple JSON object with some metadata inside. To replicate by yourself you just have to implement a simple REST API that works on POST requests.
For generic lists the ROM is using
http://download.cyanogenmod.org/api while for DELTA updates is using
If you would like to point to your own server you have two ways doing so:
cm.updater.urion your own
build.propfile with the value of you own server URL where you have deployed it
- Replace the string
values.xmlof the OTA source code
And that’s it! Possible good points on using your own server would be to provide an OTA update also to all the custom builds based on CM without having to hassle users on going everyday into the topic and reading if it was released something. Also, you can use it to centralize updates on your own Corp if people are using massively LineageOS as their ROMs on their phones.
As always, thanks for reading and I hope to provide a simple REST server for this on my GitHub so stay tuned :)