From d18ac89c34a5cc3d481332d48f709ba5c1e4d6a1 Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Tue, 13 Jan 2026 12:03:04 +0100 Subject: [PATCH 1/6] fix: update ANDROID_APP_VERSION to use dynamic versioning Previously, we were only using `OPENEDX_COMMON_VERSION` and there was no room to use a custom branch/version. Close #46 --- tutorandroid/plugin.py | 4 +--- tutorandroid/templates/android/build/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tutorandroid/plugin.py b/tutorandroid/plugin.py index 4b65e2c..11af7ab 100644 --- a/tutorandroid/plugin.py +++ b/tutorandroid/plugin.py @@ -20,9 +20,7 @@ "defaults": { "VERSION": __version__, "APP_HOST": "mobile.{{ LMS_HOST }}", - # Version 4.0.0 is not working: - # https://github.com/overhangio/tutor-android/pull/6#issuecomment-1541510489 - "APP_VERSION": "3.1.4", + "APP_VERSION": '{% if OPENEDX_COMMON_VERSION == "master" %}main{% else %}{{ OPENEDX_COMMON_VERSION }}{% endif %}', # noqa: E501 "DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android:{{ ANDROID_VERSION }}", # noqa: E501 "APP_DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android-app:{{ ANDROID_VERSION }}", # noqa: E501 "ENABLE_RELEASE_MODE": False, diff --git a/tutorandroid/templates/android/build/Dockerfile b/tutorandroid/templates/android/build/Dockerfile index 64fb84a..85a9fdd 100644 --- a/tutorandroid/templates/android/build/Dockerfile +++ b/tutorandroid/templates/android/build/Dockerfile @@ -35,7 +35,7 @@ RUN yes | /app/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOM FROM base AS code # Install android app repo ARG ANDROID_APP_REPOSITORY=https://github.com/openedx/openedx-app-android.git -ARG ANDROID_APP_VERSION={% if OPENEDX_COMMON_VERSION == "master" %}main{% else %}{{ OPENEDX_COMMON_VERSION }}{% endif %} +ARG ANDROID_APP_VERSION={{ ANDROID_APP_VERSION }} ADD --keep-git-dir $ANDROID_APP_REPOSITORY#$ANDROID_APP_VERSION /app/openedx-app-android ###### Empty layer to mount custom repo at build time From 3479dca9c422982767b5d2dceb7022a26db0af6c Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Tue, 13 Jan 2026 12:03:25 +0100 Subject: [PATCH 2/6] chore: improve formatting and clarity in README.rst --- README.rst | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 6bba9c0..4f845c4 100644 --- a/README.rst +++ b/README.rst @@ -1,36 +1,44 @@ Android application plugin for `Tutor `__ -========================================================================= +===================================================================== This is a plugin to easily build an Android mobile application for your `Open edX `__ instance. Installation ------------ -:: +.. code-block:: bash tutor plugins install android Usage ----- -Enable the plugin and start the platform:: +Enable the plugin and start the platform: + +.. code-block:: bash tutor plugins enable android tutor local launch -The ``.apk`` file will then be available for download at http(s)://mobile.LMS_HOST/app.apk. When running locally, this will be: http://mobile.local.openedx.io/app.apk. You can forward this address to your students for download. +The ``.apk`` file will then be available for download at http(s)://mobile.LMS_HOST/app.apk. When running locally, +this will be: http://mobile.local.openedx.io/app.apk. You can forward this address to your students for download. Building a custom Android app ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The Android app is built from the `official openedx-app-android repository `__. To change this repository or the app version, you can simply build a different docker image with:: +The Android app is built from the `official openedx-app-android repository `__. +To change this repository or the app version, you can simply build a different docker image with: + +.. code-block:: bash tutor images build \ --build-arg ANDROID_APP_REPOSITORY=https://github.com/mycustomfork/openedx-app-android \ --build-arg ANDROID_APP_VERSION=master \ android -Alternatively, you can build an image from a local checked-out fork of openedx-app-android:: +Alternatively, you can build an image from a local checked-out fork of openedx-app-android: + +.. code-block:: bash tutor mounts add /path/to/openedx-app-android tutor local launch @@ -38,7 +46,8 @@ Alternatively, you can build an image from a local checked-out fork of openedx-a Making courses visible in app ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -By default, courses are not visible in the mobile app. To make them available, go to Studio → YOUR COURSE → Settings → Advanced Settings and set ``Mobile Course Available`` to true. +By default, courses are not visible in the mobile app. To make them available, go to +Studio → YOUR COURSE → Settings → Advanced Settings and set ``Mobile Course Available`` to true. Releasing an Android app @@ -46,7 +55,10 @@ Releasing an Android app **Note**: this is an untested feature. -Releasing an Android app on the Play Store requires to build the app in release mode. To do so, modify the following Tutor settings:: +Releasing an Android app on the Play Store requires to build the app in release mode. To do so, +modify the following Tutor settings: + +.. code-block:: bash tutor config save \ --set ANDROID_RELEASE_STORE_PASSWORD=yourstorepassword \ @@ -54,14 +66,18 @@ Releasing an Android app on the Play Store requires to build the app in release --set ANDROID_RELEASE_KEY_ALIAS=yourreleasekeyalias \ --set ANDROID_ENABLE_RELEASE_MODE=true -Then, place your keystore file in ``$(tutor config printroot)/env/plugins/android/build/app/config/app.keystore``. Finally, rebuild the image by starting the "android-app" container:: +Then, place your keystore file in ``$(tutor config printroot)/env/plugins/android/build/app/config/app.keystore``. +Finally, rebuild the image by starting the "android-app" container: + +.. code-block:: bash tutor local start -d android-app Customising the Android app ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Customising the application, such as the logo or the background image, is currently not supported. If you are interested by this feature, please tell us about it in the Tutor `discussion forums `_. +Customising the application, such as the logo or the background image, is currently not supported. +If you are interested by this feature, please tell us about it in the Tutor `discussion forums `_. Troubleshooting --------------- From 6b1fc23464f66dd12d53cd69ded6de27774c2604 Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Tue, 13 Jan 2026 12:04:07 +0100 Subject: [PATCH 3/6] fix: add .venv to .gitignore to exclude virtual environment files We need to make it simpler for devs to debug this plugin without any previous setup. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f6a874f..dcccc20 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ __pycache__ *.egg-info/ /build/ /dist/ +.venv/ From 7e79e81b444f109ecf6121f7218b21759bf71539 Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Tue, 13 Jan 2026 12:31:39 +0100 Subject: [PATCH 4/6] feat: ANDROID_APP_ID added with this, we can set the APPLICATION_ID inside `tutor.yml` --- tutorandroid/plugin.py | 1 + tutorandroid/templates/android/build/config/tutor.yaml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tutorandroid/plugin.py b/tutorandroid/plugin.py index 11af7ab..6036ae9 100644 --- a/tutorandroid/plugin.py +++ b/tutorandroid/plugin.py @@ -21,6 +21,7 @@ "VERSION": __version__, "APP_HOST": "mobile.{{ LMS_HOST }}", "APP_VERSION": '{% if OPENEDX_COMMON_VERSION == "master" %}main{% else %}{{ OPENEDX_COMMON_VERSION }}{% endif %}', # noqa: E501 + "APP_ID": "org.openedx.app", "DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android:{{ ANDROID_VERSION }}", # noqa: E501 "APP_DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android-app:{{ ANDROID_VERSION }}", # noqa: E501 "ENABLE_RELEASE_MODE": False, diff --git a/tutorandroid/templates/android/build/config/tutor.yaml b/tutorandroid/templates/android/build/config/tutor.yaml index c5b9e6e..76a85f1 100644 --- a/tutorandroid/templates/android/build/config/tutor.yaml +++ b/tutorandroid/templates/android/build/config/tutor.yaml @@ -1,6 +1,6 @@ # See docs: https://openedx.atlassian.net/wiki/spaces/LEARNER/pages/48792067/App+Configuration+Flags API_HOST_URL: "{{ "https" if ENABLE_HTTPS else "http" }}://{{ LMS_HOST }}" -APPLICATION_ID: 'org.openedx.app' +APPLICATION_ID: "{{ ANDROID_APP_ID }}" ENVIRONMENT_DISPLAY_NAME: "tutor" URI_SCHEME: '' FEEDBACK_EMAIL_ADDRESS: "{{ CONTACT_EMAIL }}" @@ -35,7 +35,7 @@ FIREBASE: CLOUD_MESSAGING_ENABLED: false PROJECT_NUMBER: '' PROJECT_ID: '' - APPLICATION_ID: '' #App ID field from the Firebase console or mobilesdk_app_id from the google-services.json file. + APPLICATION_ID: '' # App ID field from the Firebase console or mobilesdk_app_id from the google-services.json file. API_KEY: '' SEGMENT_IO: From 9c5454a5b2a0d1c7cb88cc8582fbb8d790a2a427 Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Tue, 13 Jan 2026 13:05:59 +0100 Subject: [PATCH 5/6] fix: ANDROID_APP_REPOSITORY added This ensure dynamic handling of APP_VERSION in Dockerfile without passing an argument in build level --- tutorandroid/plugin.py | 3 ++- tutorandroid/templates/android/build/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tutorandroid/plugin.py b/tutorandroid/plugin.py index 6036ae9..6e1cd59 100644 --- a/tutorandroid/plugin.py +++ b/tutorandroid/plugin.py @@ -20,8 +20,9 @@ "defaults": { "VERSION": __version__, "APP_HOST": "mobile.{{ LMS_HOST }}", - "APP_VERSION": '{% if OPENEDX_COMMON_VERSION == "master" %}main{% else %}{{ OPENEDX_COMMON_VERSION }}{% endif %}', # noqa: E501 "APP_ID": "org.openedx.app", + "APP_REPOSITORY": "https://github.com/openedx/openedx-app-android.git", + "APP_VERSION": '{% if OPENEDX_COMMON_VERSION == "master" %}main{% else %}{{ OPENEDX_COMMON_VERSION }}{% endif %}', # noqa: E501 "DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android:{{ ANDROID_VERSION }}", # noqa: E501 "APP_DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}overhangio/openedx-android-app:{{ ANDROID_VERSION }}", # noqa: E501 "ENABLE_RELEASE_MODE": False, diff --git a/tutorandroid/templates/android/build/Dockerfile b/tutorandroid/templates/android/build/Dockerfile index 85a9fdd..fdadf9f 100644 --- a/tutorandroid/templates/android/build/Dockerfile +++ b/tutorandroid/templates/android/build/Dockerfile @@ -34,7 +34,7 @@ RUN yes | /app/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_HOM ###### Checkout code FROM base AS code # Install android app repo -ARG ANDROID_APP_REPOSITORY=https://github.com/openedx/openedx-app-android.git +ARG ANDROID_APP_REPOSITORY={{ ANDROID_APP_REPOSITORY }} ARG ANDROID_APP_VERSION={{ ANDROID_APP_VERSION }} ADD --keep-git-dir $ANDROID_APP_REPOSITORY#$ANDROID_APP_VERSION /app/openedx-app-android From ced494809604b801406e6987ae79d8ca5217e797 Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Tue, 13 Jan 2026 13:06:34 +0100 Subject: [PATCH 6/6] chore: changelog entry added --- changelog.d/20260113_122626_codewithemad_app_version.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog.d/20260113_122626_codewithemad_app_version.md diff --git a/changelog.d/20260113_122626_codewithemad_app_version.md b/changelog.d/20260113_122626_codewithemad_app_version.md new file mode 100644 index 0000000..7f7d7e0 --- /dev/null +++ b/changelog.d/20260113_122626_codewithemad_app_version.md @@ -0,0 +1,3 @@ + +- [Improvement] `ANDROID_APP_VERSION` and `ANDROID_APP_REPOSITORY` values now set correctly in `Dockerfile` (by @CodeWithEmad) +- [Feature] `ANDROID_APP_ID` introduced to set the `APPLICATION_ID` inside `tutor.yaml` (by @CodeWithEmad) \ No newline at end of file