commit | 418d464d148bd9476e14c5ae2ca915a32d8376d2 | [log] [tgz] |
---|---|---|
author | Aayush Gupta <theimpulson@e.email> | Tue Mar 23 15:30:47 2021 +0530 |
committer | Aayush Gupta <aayushgupta219@gmail.com> | Mon May 23 11:20:45 2022 +0530 |
tree | b231ff61d760dce3de6aecc1d5dc6e80f5759d26 | |
parent | 55a4e6eb97f2a74e77af20361a466e1ece759db7 [diff] |
Updater: Show update's version on AlertDialog and Notification Currently at most of the places, build version is obtained from BuildInfoUtils.getBuildVersion() method. This method obtains build version from the current running system's property. However, in case there is a version bump on OTA, this logic results in wrong version being shown to the user while updating/upgrading the system. Get the version from the update itself to show the proper version in update notification and pre-install warning. Signed-off-by: Aayush Gupta <theimpulson@e.email> Change-Id: Ia74085d8d7c067c408e7cfce1de90d49dcc68307
Simple application to download and apply OTA packages.
The app sends GET
requests to the URL defined by the updater_server_url
resource (or the lineage.updater.uri
system property) and expects as response a JSON with the following structure:
{ "response": [ { "datetime": 1230764400, "filename": "ota-package.zip", "id": "5eb63bbbe01eeed093cb22bb8f5acdc3", "romtype": "nightly", "size": 314572800, "url": "https://example.com/ota-package.zip", "version": "15.1" } ] }
The datetime
attribute is the build date expressed as UNIX timestamp.
The filename
attribute is the name of the file to be downloaded.
The id
attribute is a string that uniquely identifies the update.
The romtype
attribute is the string to be compared with the ro.lineage.releasetype
property.
The size
attribute is the size of the update expressed in bytes.
The url
attribute is the URL of the file to be downloaded.
The version
attribute is the string to be compared with the ro.lineage.build.version
property.
Additional attributes are ignored.
Updater needs access to the system API, therefore it can't be built only using the public SDK. You first need to generate the libraries with all the needed classes. The application also needs elevated privileges, so you need to sign it with the right key to update the one in the system partition. To do this:
gen-keystore.sh
make UpdaterStudio
from the root of the Android source tree. This command will add the needed libraries in system_libraries/
.You need to do the above once, unless Android Studio can't find some symbol. In this case, rebuild the system libraries with make UpdaterStudio
.