Upgrade target sdk to 30 and associated changes
Closed this issue ยท 9 comments
Update targetSdkVersion
to 30 along with a range of other requirements, documented here.
New apps will require this by August 2021
App updates will require this by November 2021
With the change to the app bundle format we'll need to make sure the app can still be sideloaded, and ideally still able to be distributed via F-Droid.
Progress Update
- The requirement for new and existing Apps to upgrade the targeted SDK to version 30 (Android 11) was implemented and merged into master this week.
- We already complaint with other new requirements for existing apps, e.g. the minimal version of the algorithm to sign APKs and Bundles is v2, that is the version we use now.
- The are other requirements that we have verified don't apply to our apps, e.g. location permission in the background has new requirements but we only access location in the foreground.
- New apps in the Play Store (not updates from existing apps) will require to be uploaded using the new Bundle format (.aab). We did some experiments with this format and creates these files is easy. The bundle cannot be used for side-loading, but we can still generate the .apk files for each flavor along with the .aab files. We will implement a specific task in the CI to produce the .aab files for new flavors.
- New apps in the Play Store (not updates from existing apps) after being uploaded with the new Bundle format will be converted by Google to optimized APKs in the Play Store, so Google needs the same or a new created private key to sign the app. We are defining a new workflow for this.
Proposed workflow
In summary, the new workflow is:
- New apps from partners will have their own private keys to sign the app, not using the one that we currently use to sign existing apps.
- For each app, we will use the same key to sign the bundle (Upload Key) and to let Google sign the APKs (Signing App Key), allowing us to keep generating .apk files for sideloading, compatible with the .apk files generated by Google (signed with the same key).
- We will make changes in the CI pipeline to generate both .apk and .aab files, signed with this key, so each time a new private key is generated to sign an app, we need to setup it in our repo. We need to document well each step to create a new flavored version of the app. We also recommend to only setup one key for partner, using the new key for each new flavored app created by that partner.
- After the creation of the app in our repo and in the Play Console, the owner of the Play account (partner or us) will register the key for signing, and upload the .aab file for publishing the release.
Ready for AT, tag v0.8.1-alpha.6.
Although this is not done yet and there is no new features, we need to test that the SDK change and building changes don't affect the normal function of the App, and we can continue releasing apps after the end of the month when no apps can't be updated in the Play Store without targeting Android 11.
This alpha also include the changes from another PR (#192). In summary the list of changes are:
- Target SDK 30 (Android 11)
- Upgrade Java and building dependencies
- Refactor some methods to lambda (Java 8+)
- Skip upload of APKs for
webview-armeabi-v7a
arch not used - Disable for now demo app publishing (demo.dev.medicmobile.org is unmaintained)
make assemble-all
only assemble release versions- Refactor Make config
- Moved suppression of linters, setting the suppression in particular fragment of codes instead of the entire class
- Typo in Makefile argument:
flavourโ flavor
But again no change has an impact in the UI or the usability of the app.
Quality Assurance, by mistake I have merged a PR into master that wasn't tested yet. Anyway, the PR does not introduce code changes, only assets changes (logo and brand name), so I have released a new alpha version that replace the one mentioned above for release testing. Sorry for the inconvenient.
New version is v0.8.1-alpha.7.
Also I notice that this new release will also include another feature that was tested but not released yet: Add version of android app.
So the final list of features in this release is:
- Target SDK 30 (Android 11)
- Upgrade Java and building dependencies
- Refactor some methods to lambda (Java 8+)
- Skip upload of APKs for
webview-armeabi-v7a
arch not used - Disable for now demo app publishing (demo.dev.medicmobile.org is unmaintained)
make assemble-all
only assemble release versions- Refactor Make config
- Moved suppression of linters, setting the suppression in particular fragment of codes instead of the entire class
- Typo in Makefile argument:
flavourโ flavor - New branding icon, and switching from "Medic Mobile" to "Medic"
- Add more info about the version of the Android app
- App rebranded :
- Outstanding : Login page not yet rebranded but that will be addressed with this issue I suppose
- We are getting rid of the
medicmobile.org
in favor ofmedic.org
. Are going to wait until this issue is done before we change (if ever) references tomedicmobile
incht-android
, such as some flavor's names, applicationId and package name @latin-panda ? - App builds and loads with SDK 30 (used emulator for this test):
@ngaruko we cannot change flavor's names or application's ids, because it would make the app to turn into a new app, e.g. the application Id is used by Google to identify the app in the Play Store, and it is an immutable identifier.
Also @mrsarm, two more observations, none seems to affect the functionality and not all are related to this PR - thus will be dealt in another issue, if needed. Just leaving it here for reference!
-
If/when we rename medic-api to cht-api , this will call for change in cht-android AppUrlVerifier
-
Looking at the documentation, it seems like we might need to do a little more on privacy, esp Permissions auto-reset and Background location access. Have you investigated those @mrsarm ?