Giter Club home page Giter Club logo

updater's Introduction

LineageOS Updater Backend

Copyright (c) 2017 The LineageOS Project

Adding a new device

  1. Add your device to devices.json, sorted alphanumerically by codename. Fields are documented below.
  2. Submit your change to gerrit (this repository is configured for use with git review)

devices.json

devices.json is an array of objects, each with several fields:

  • model: should be the first thing on the line, and is the device's codename (PRODUCT_DEVICE) - e.g. i9300.
  • oem: the manufacturer of the device. (PRODUCT_BRAND) - e.g. Samsung.
  • name: the user-friendly name of the device - e.g. Galaxy S III (Intl). Long values will overflow and look bad, so limit this to around 25 characters.
  • has_recovery: (optional) whether or not the device has a separate recovery partition. Defaults to true.
  • lineage_recovery: (optional) whether or not to offer Lineage recovery downloads for this device. Defaults to true.

Development set up:

  1. Install requirements with pip install -r requirements.txt
  2. Configure your environment appropriately - see config.py for possible variables.
  3. Supply a device_deps.json, devices.json, and optional devices_local.json. (See https://github.com/LineageOS/hudson/tree/main/updater for example)
  4. Run with FLASK_APP=app.py flask run

Example API Calls:

Obtaining rom list for a device:
GET /api/v1/<device>/<romtype>/<incremental>?after=<utc_timestamp>&version=<14.1> (incremental can be anything, it is currently unused)
<device> - Name of device. Example: d2vzw
<romtype> - Type of rom. Example: nightly
<incremental> - Caller device's incremental ID (ro.build.incr). Can be anything.
<after> - Timestamp for current build on device. (optional)
<romversion> - Version of rom. Example: 14.1(optional)

This project depends on a mirrorbits server (https://github.com/etix/mirrorbits) running our mirrorbits API (https://github.com/lineageos-infra/mirrorbits-api). Please see the README in that project for more information.

Don't want to run mirrorbits/mirrorbits-api?

To run the server stand-alone you can use the included docker-compose script to bring up a simple nginx server to host your builds for you.

Setup

  1. Place your builds in ./nginx/builds/. These will be exposed on http://example.com/builds when you start the server. They don't need to be android builds, just make sure they have differing sha256s and match the filename format foobar-VERSION-BUILDDATE-BUILDTYPE-DEVICE-foobar.zip.
  2. Run python gen_mirror_json.py ./nginx/builds > ./nginx/builds.json
  3. Make sure you have device_deps.json, devices.json, and optional devices_local.json in the root directory of this repo.
  4. Install docker-compose on your system.
  5. Make sure that docker-compose.yml and ./nginx/default.conf use suitable hostnames for your setup (rather than "updater" and "nginx", you should use the address of the computer running docker).

Building and Running

  1. To build, use docker-compose build in the root of the repo.
  2. To start the server, run docker-compose up in the root of the repo (include a -d flag to run in detached mode)
  3. To stop the server, run docker-compose down in the root of the repo.

updater's People

Contributors

alberto97 avatar baddaemon avatar bgcngm avatar deadman96385 avatar demon000 avatar dependabot[bot] avatar flex1911 avatar fourkbomb avatar h8rift avatar haggertk avatar harryyoud avatar invisiblek avatar javelinanddart avatar jrior001 avatar luca020400 avatar luk1337 avatar mikeng avatar n1kolaa avatar npjohnson avatar olefb avatar olivier97 avatar rashed97 avatar razorloves avatar stricted avatar syphyr avatar tincho5588 avatar tortel avatar vince2678 avatar webgeek1234 avatar zifnab06 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

updater's Issues

I cannot download updates via vpn

I have a always on vpn connection using openvpn.

image

When I turn on the always on feature, I consistently get the following error message:

image

Note that I can surf the web just fine.

I tried checking the connection settings of my updater app, but they seem fine:

image

Any ideas what is going wrong or how I can fix this?

Thanks in advance.

After installing updates prompted from updated cannot reboot to my phone

Hi folks,
I have an OnePlus2 which until yesterday was working fine, today I got an update prompted from updater and installed the update upon reboot and on my surprise I found that I couldn't get into the actual os system, meaning the phone kept bringing up the twrp menu, and every time I tried to reboot I always ended up in the same twrp menu.

I've noticed that upon reboot the phone tries to boot into the os cause I can see the lineage os logo but then all of the sudden it reboots on its own and immediately throws me off at the twrp menu, and this cycle continues every time I try to reboot. It seems that I'm stuck at this boot cycle from which I don't know how to exit and retrieve back the functionality of my phone prior to the update?

Is there any I can restore the phone to previous stage prior to update without loosing any data?

No API parameters

Hi there,

The device manager can't find any update on my device.
In fact, I've inspected the request with a mitm proxy, and it appears that it searches at https://download.lineageos.org/api/v1///2bc6f0b58c, which of course returns a 404.

Device: fajita
Build number: lineage_fajita-userdebug 12 SQ3A.220705.004 2bc6f0b58c

Is this issue known and do I have to do the update manually ?

no incrementals

hi there ,
i noticed that the incremental ota 's are not working in lineageos .
is there anything that i can do to fix this?
any ideas would be deeply appreciated.

Allow vote for a device

Please add possibility to vote for a Device. At moment I got more and more devices unsupported by lineageOS like my "Asus Transformer TF701" and "Samsung Galaxy Tab2 (espressowifi)" even I get actual Roms from other sources without problem I wish that lineage do support it. If possible I would vote for it.

ENH,PERF: Keep screen on while updating

Users can enable ~wakelock in the lineageos updater in order to install updates more quickly.

It appears that the updater runs more quickly when the screen is kept on. This can be done with Developer Options > Stay Awake, but a "Stay Awake" toggle or similar UI element in the lineageos updater would be helpful for performance and also when/if Developer Options is not enabled.

j5xnlte USB-Ethernet perfomance degraded

USB-Ethernet perfomance is degraded from 90+ to 50...70MBps.
Tested with:
17.1-20200624, 17.1-20201110
TP-LINK EU-300 USB 3.0 to Gigabit Ethernet Network Adapter (RTL8153)
Magic iPerf, Speedtest by Ookla

This is not a new problem, it appeared in some builds 16.0

which backend to use

hello there , i happened to notice another ota backend in :
LineageOTA

could you provide me with some more info about which one to use ?
i need the infrastructure as official and properly configured as possible.
thanks in advance.

Camera Issue

I have le eco2 and i have downloaded the build for the same , codenamed s2. I am unable to access the camera in some apps namely , WhatsApp, Facebook , Instagram. And in some other apps, i have to switch between front and back camera multiple times before I can use camera.
Error : Unable to start camera, please restart device.

NTFS flash drive

System does not show NTFS volume on USB Flash drive.
j5xnlte
17.1-20200624, 17.1-20201110
Formatted by standard Windows 7 tool.

api calls for unoffical builds don't work on standalone

I'm using the docker-compose script, and while everything works fine (on my pc at least, rpi has weird issues), when I visit /api/v1/grouper/unofficial/foo, I get an internal server error, compared to an empty "response" when I visit /api/v1/grouper/nightly/foo.
Have a look here id you want to check: http://charles-iv.serveo.net (it's probably going to disconnect again, but I'll try to keep it online)
idk if this is the right place to report it or if you'll care because it's about unofficial stuff.

ENH,SEC: Generate a sha256sums file for each build

Users can download a sha256sums file which contains sha256 checksums for each file in the build; alongside the other files for download at e.g. https://download.lineageos.org/devices/coral/builds

curl './.zip'
curl './.img'
curl './sha256sums'
sha256sum -c ./sailfish_build_id?.sha256sums

Something like:?

for file in rom['files']:
    sha256sumfile.write(f"{file['sha256']} *{file['filename']}\n")

See also:

updater outage when github/gerrit is offline.

Gunicorn workers get rotated, this service goes down & requires a restart due to docker links. Probably should wrap the requests fetch in a try/except & return a 500 to the user, along with moving away from docker links.

ENH,BLD,SEC: sigstore, SLSA

Users can verify lineageOS-built software artifacts with sigstore (and someday, SLSA) manually and with the lineageos updater android app
(because sha256 without crytographic signatures is not good enough according to TUF, Sigstore, and SLSA)

  • https://wiki.lineageos.org/signing_builds
  • Decide whether to start with SLSA, Sigstore, or just TUF
    • SLSA supports Sigstore
    • Sigstore depends on TUF to be verified itself
    • blockcerts/cert-verifier-js is another approach (built with W3C Verfiable Credentials and W3C DID Decentralized Identifier keys instead of OIDC OpenID Connect)
  • Sign LineageOS build list json files
  • Sign LineageOS CI ROM builds
    • Upload artifact signatures to a log
  • Update lineageos-infra/updater?
  • Verify LineageOS ROM downloads with a (python?) CLI tool
    by default, and optionally
    • allow skipping tuf||sigstore verfication for UNOFFICIAL custom builds
      • display a note about unsigned UNOFFICIAL custom builds
  • Verify LineageOS ROM downloads with the LineageOS updater android app
    • sigstore-java is not considered production-ready
    • sigstore-js and tuf-js are IIUC

TUF

TUF: The Update Framework

python-tuf
tuf-js
go-tuf

Sigstore

fulcio

rekor

  • src: https://github.com/sigstore/rekor

    The Rekor project provides a restful API based server for validation and a transparency log for storage. A CLI application is available to make and verify entries, query the transparency log for inclusion proof, integrity verification of the transparency log or retrieval of entries by either public key or artifact.

cosign

sigstore-js

sigstore-java

sigstore-python

SLSA

Search for Updates

When I search on my LG G3 with the LineageOS build 14.1-20180410-nightly-d855 for updates I got an error that the updater couldn't search for updates and I should check my internet connection.
This is the exception which appears in adb:

04-16 22:51:55.051 15411-15411/org.lineageos.updater D/UpdatesActivity: Checking https://download.lineageos.org/api/v1/d855/nightly/a556d30458
04-16 22:51:55.847 15411-15411/org.lineageos.updater D/UpdatesActivity: List downloaded
04-16 22:51:55.847 15411-15411/org.lineageos.updater D/UpdatesActivity: Adding remote updates
04-16 22:51:55.855 15411-15411/org.lineageos.updater D/Utils: lineage-14.1-20180321-nightly-d855-signed.zip is older than current build
04-16 22:51:55.855 15411-15411/org.lineageos.updater D/Utils: Ignoring incompatible update lineage-14.1-20180321-nightly-d855-signed.zip
04-16 22:51:55.855 15411-15411/org.lineageos.updater D/Utils: lineage-14.1-20180328-nightly-d855-signed.zip is older than current build
04-16 22:51:55.855 15411-15411/org.lineageos.updater D/Utils: Ignoring incompatible update lineage-14.1-20180328-nightly-d855-signed.zip
04-16 22:51:55.856 15411-15411/org.lineageos.updater D/Utils: lineage-14.1-20180404-nightly-d855-signed.zip is older than current build
04-16 22:51:55.856 15411-15411/org.lineageos.updater D/Utils: Ignoring incompatible update lineage-14.1-20180404-nightly-d855-signed.zip
04-16 22:51:55.856 15411-15411/org.lineageos.updater D/Utils: lineage-14.1-20180410-nightly-d855-signed.zip is older than current build
04-16 22:51:55.856 15411-15411/org.lineageos.updater D/Utils: Ignoring incompatible update lineage-14.1-20180410-nightly-d855-signed.zip
04-16 22:51:55.882 15411-15411/org.lineageos.updater E/UpdatesActivity: Could not read json
                                                                        org.json.JSONException: End of input at character 0 of 
                                                                            at org.json.JSONTokener.syntaxError(JSONTokener.java:449)
                                                                            at org.json.JSONTokener.nextValue(JSONTokener.java:97)
                                                                            at org.json.JSONObject.<init>(JSONObject.java:156)
                                                                            at org.json.JSONObject.<init>(JSONObject.java:173)
                                                                            at org.lineageos.updater.misc.Utils.parseJson(Utils.java:125)
                                                                            at org.lineageos.updater.misc.Utils.checkForNewUpdates(Utils.java:201)
                                                                            at org.lineageos.updater.UpdatesActivity.processNewJson(UpdatesActivity.java:306)
                                                                            at org.lineageos.updater.UpdatesActivity.-wrap2(UpdatesActivity.java)
                                                                            at org.lineageos.updater.UpdatesActivity$4.-org_lineageos_updater_UpdatesActivity$4_lambda$3(UpdatesActivity.java:345)
                                                                            at org.lineageos.updater.UpdatesActivity$4$-void_onSuccess_java_io_File_destination_LambdaImpl0.run(UpdatesActivity.java)
                                                                            at android.os.Handler.handleCallback(Handler.java:751)
                                                                            at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                            at android.os.Looper.loop(Looper.java:154)
                                                                            at android.app.ActivityThread.main(ActivityThread.java:6186)
                                                                            at java.lang.reflect.Method.invoke(Native Method)
                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
                                                                            at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)
04-16 22:52:54.737 15411-15411/org.lineageos.updater D/UpdaterService: Service no longer needed, stopping

But if there is an update, it is displayed and I can download it, so the main function is working.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.