File | Date | Author | Commit |
---|---|---|---|
.github | 2020-05-03 |
![]() |
[9dbaf5] Create FUNDING.yml |
builds | 2014-08-05 |
![]() |
[5b07a5] Create placeholder directories. |
src | 2020-08-24 |
![]() |
[af5af4] Fix finding numbers on rom names |
.dockerignore | 2017-01-08 |
![]() |
[36bcd6] Add dockerignore file |
.gitignore | 2014-08-05 |
![]() |
[92bdc0] Ignore composer autogenerated folders and files. |
.htaccess | 2014-08-05 |
![]() |
[7651ff] Needed for the routing via Flight. |
CONTRIBUTING.md | 2017-12-25 |
![]() |
[07e081] Add CONTRIBUTING.md |
Dockerfile | 2017-02-26 |
![]() |
[1100a4] Refine ttl for apc entries |
LICENSE | 2020-07-20 |
![]() |
[798c35] Update LICENSE |
README.md | 2020-11-15 |
![]() |
[34a291] Added HTTPS notes |
composer.json | 2020-07-20 |
![]() |
[0c6c93] Bump to 2.9.0 |
index.php | 2020-07-20 |
![]() |
[798c35] Update LICENSE |
A simple OTA REST Server for LineageOS OTA Updater System Application
Got a question? Not sure where it should be made? See CONTRIBUTING.
$ cd /var/www/html # Default Apache WWW directory, feel free to choose your own
$ composer create-project julianxhokaxhiu/lineage-ota LineageOTA
then finally visit http://localhost/LineageOTA to see the REST Server up and running. Please note that this is only for a quick test, when you plan to use that type of setup for production (your users), make sure to also provide HTTPS support.
If you get anything else then a list of files, contained inside the
builds
directory, this means something is wrong in your environment. Double check it, before creating an issue report here.
$ docker run \
--restart=always \
-d \
-p 80:80 \
-v "/home/user/builds:/var/www/html/builds/full" \
julianxhokaxhiu/lineageota
then finally visit http://localhost/ to see the REST Server up and running.
builds/full
directory.builds/delta
directory.If you are willing to use this project on top of your LineageOS 15.x ( or newer ) ROM builds, you may have noticed that the file named build.prop
have been removed inside your ZIP file, and has been instead integrated within your system.new.dat
file, which is basically an ext4 image ( you can find out more here: https://source.android.com/devices/tech/ota/block ).
In order to make use of this Server from now on, you MAY copy the build.prop
file from your build directory ( where your ROM is being built ), inside the same directory of your ZIP and name it like your ZIP file name + the .prop
extension.
For example, feel free to check this structure:
$ cd builds/full
$ tree
.
├── lineage-15.0-20171030-NIGHTLY-gts210vewifi.zip # the full ROM zip file
└── lineage-15.0-20171030-NIGHTLY-gts210vewifi.zip.prop # the ROM build.prop file
The Server is able to serve the ZIP file via the API, also when a build.prop
file is not given, by fetching those missing informations elsewhere ( related always to that ZIP file ). Although, as it's a trial way, it may be incorrect so don't rely too much on it.
I am not sure how much this may help anyway, but this must be used as an extreme fallback scenario where you are not able to provide a build.prop
for any reason. Instead, please always consider to find a way to obtain the prop file, in order to deliver a proper API response.
Feel free to use this simple script made with NodeJS. Instructions are included.
In order to integrate this REST Server within your ROM you have two possibilities: you can make use of the build.prop
( highly suggested ), or you can patch directly the android_packages_apps_CMUpdater
package ( not suggested ).
Before integrating, make sure your OTA Server answers from a public URL. Also, make sure to know which is your path.
For eg. if your URL is http://my.ota.uri/LineageOTA, then your API URL will be http://my.ota.uri/LineageOTA/api
In order to integrate this in your CyanogenMod based ROM, you need to add the cm.updater.uri
property ( for CyanogenMod or Lineage ) in your build.prop
file. See this example:
# ...
cm.updater.uri=http://my.ota.uri/api/v1/{device}/{type}/{incr}
# ...
As of e930cf7:
Optional placeholders replaced at runtime:
{device} - Device name
{type} - Build type
{incr} - Incremental version
In order to integrate this in your LineageOS based ROM, you need to add the lineage.updater.uri
property in your build.prop
file. See this example:
# ...
lineage.updater.uri=https://my.ota.uri/api/v1/{device}/{type}/{incr}
# ...
Make always sure to provide a HTTPS based uri, otherwise the updater will reject to connect with your server! This is caused by the security policies newer versions of Android (at least 10+) include, as any app wanting to use non-secured connections must explicitly enable this during the compilation. The LineageOS Updater does not support that.
Since https://review.lineageos.org/#/c/191274/ is merged, the property
cm.updater.uri
is renamed tolineage.updater.uri
. Make sure to update your entry.As of 5252d60:
Optional placeholders replaced at runtime:
{device} - Device name
{type} - Build type
{incr} - Incremental version
In order to integrate this in your CyanogenMod or LineageOS based ROM, you can patch the relative line inside the package.
Although this works ( and the position may change from release to release ), I personally do not suggest to use this practice as it will always require to override this through the manifest, or maintain the commits from the official repo to your fork.
Using the
build.prop
instead offers an easy and smooth integration, which could potentially be used even in local builds that make use fully of the official repos, but only updates through a local OTA REST Server. For example, by using the docker-lineage-cicd project.
isValid()
( thanks to @McNutnut )build.prop
file in LineageOS 15.x builds ( see #36 )build.prop
is missing, making the JSON response acting similar as if it was therelineage-14.1-20171024_123000-nightly-hammerhead-signed.zip
) ( thanks to @brianjmurrell )lineage-14.0-20161230-NIGHTLY-hammerhead.html
) this will be preferred over .TXT ones! Otherwise fallback to the classic TXT extension ( eg. lineage-14.0-20161230-NIGHTLY-hammerhead.txt
).something
or Thumbs.db
).See LICENSE.
Enjoy :)