florinzaicu / FloatingOverlay

Android application that displays a set of floating controls over other apps
MIT License
0 stars 0 forks source link

Investigate APK update via github release #3

Open florinzaicu opened 7 months ago

florinzaicu commented 7 months ago

Investigate a feature that will allow pushing OTA updates via the GitHub releases. Do the following: 1) Look at GitHub API to find an endpoint to allow getting current releases 2) Investigate installing/updating the app using an APK (Android enforces some security restrictions for app updates) 3) Implement a settings activity that contains an option to check for updates

florinzaicu commented 7 months ago

Use the rest API to get the details of the latest release. If available, ask user if they wish to download and apply update.

The API provides and endpoint to get the most recent release, or the most recent release. Based in a TAG. 1) Make a call to the API and return the details of the release. 2) If newer version available, prompt the user if they wish to update. 3) If yes, install the update.

florinzaicu commented 6 months ago

It seems that you do not need an authorization token to access the release API. Example of CURL call to get latest release (doesn't get drafts).

curl -L -H "Accept: application/vnd.github.json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/florinzaicu/FloatingOverlay/releases/latest
florinzaicu commented 6 months ago

In order to implement the update feature, I need to modify the pipeline signing process to use the same key for the RC APK, otherwise, the Android app cannot self update.

It also looks like you need to flag the release as latest to not receive from the API endpoint. I need to also ensure that I can get the version and display the markdown to tell the user what the changelog is.