diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4990401e..38bc2e30 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -66,567 +66,11 @@ jobs: lane: build options: '{ "flavor": "unbranded" }' - - name: Assemble gamma - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "medicmobilegamma" }' - - name: Assemble gamma training - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "medicmobilegamma_training" }' - # demo app is disabled for now - #- name: Assemble demo - # uses: maierj/fastlane-action@v1.4.0 - # with: - # lane: build - # options: '{ "flavor": "medicmobiledemo" }' - - name: Assemble bracuganda - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "bracuganda" }' - - name: Assemble cic_guatemala - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "cic_guatemala" }' - - name: Assemble cmmb_kenya - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "cmmb_kenya" }' - - name: Assemble covid_moh_mali - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "covid_moh_mali" }' - - name: Assemble ebpp_indonesia - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "ebpp_indonesia" }' - - name: Assemble hope_through_health - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "hope_through_health" }' - - name: Assemble livinggoods - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "livinggoods" }' - - name: Assemble livinggoodskenya - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "livinggoodskenya" }' - - name: Assemble livinggoods_assisted_networks - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "livinggoods_assisted_networks" }' - - name: Assemble livinggoods_innovation_ke_supervisor - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "livinggoods_innovation_ke_supervisor" }' - - name: Assemble livinggoods_innovation_ke_hivst - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "livinggoods_innovation_ke_hivst" }' - - name: Assemble moh_kenya_siaya_red - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_kenya_siaya_red" }' - - name: Assemble moh_kenya_siaya_green - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_kenya_siaya_green" }' - - name: Assemble moh_kenya_siaya_black - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_kenya_siaya_black" }' - - name: Assemble moh_mali - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_mali" }' - - name: Assemble moh_zanzibar_training - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_zanzibar_training" }' - - name: Assemble moh_zanzibar - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_zanzibar" }' - - name: Assemble musomali - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "musomali" }' - - name: Assemble pih_malawi - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "pih_malawi" }' - - name: Assemble pih_malawi_supervisor - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "pih_malawi_supervisor" }' - - name: Assemble safaridoctors_kenya - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "safaridoctors_kenya" }' - - name: Assemble surveillance_covid19_kenya - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "surveillance_covid19_kenya" }' - - name: Assemble trippleeighty - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "trippleeighty" }' - - name: Assemble vhw_burundi - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "vhw_burundi" }' - - name: Assemble icm_ph_chc - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "icm_ph_chc" }' - name: Assemble vhtapp_uganda uses: maierj/fastlane-action@v1.4.0 with: lane: build options: '{ "flavor": "vhtapp_uganda" }' - - name: Assemble itech_aurum - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "itech_aurum" }' - - name: Assemble itech_malawi - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "itech_malawi" }' - - - name: Unpack secrets cares_malawi_kch - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_CARES_MALAWI_KCH }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_CARES_MALAWI_KCH }} - run: make org=cares_malawi_kch keydec - - - name: Assemble cares_malawi_kch - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "cares_malawi_kch" }' - env: - ANDROID_KEYSTORE_PATH: cares_malawi_kch.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_CARES_MALAWI_KCH }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_CARES_MALAWI_KCH }} - - - name: Unpack secrets cares_malawi_mpc - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_CARES_MALAWI_MPC }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_CARES_MALAWI_MPC }} - run: make org=cares_malawi_mpc keydec - - - name: Assemble cares_malawi_mpc - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "cares_malawi_mpc" }' - env: - ANDROID_KEYSTORE_PATH: cares_malawi_mpc.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_CARES_MALAWI_MPC }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_CARES_MALAWI_MPC }} - - - name: Assemble alerte_niger - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "alerte_niger" }' - env: - ANDROID_KEYSTORE_PATH: alerte_niger.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_ALERTE_NIGER }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_ALERTE_NIGER }} - - - name: Unpack secrets moh_kenya_echis - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_MOH_KENYA_ECHIS }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_MOH_KENYA_ECHIS }} - run: make org=moh_kenya_echis keydec - - - name: Assemble moh_kenya_echis - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_kenya_echis" }' - env: - ANDROID_KEYSTORE_PATH: moh_kenya_echis.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_KENYA_ECHIS }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_KENYA_ECHIS }} - - - name: Bundle moh_kenya_echis - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "moh_kenya_echis" }' - env: - ANDROID_KEYSTORE_PATH: moh_kenya_echis.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_KENYA_ECHIS }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_KENYA_ECHIS }} - - - name: Assemble chis_ne - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "chis_ne" }' - env: - ANDROID_KEYSTORE_PATH: chis_ne.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_CHIS_NE }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_CHIS_NE }} - - - name: Assemble cht_rci - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "cht_rci" }' - env: - ANDROID_KEYSTORE_PATH: cht_rci.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_CHT_RCI }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_CHT_RCI }} - - - name: Bundle alerte_niger - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "alerte_niger" }' - env: - ANDROID_KEYSTORE_PATH: alerte_niger.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_ALERTE_NIGER }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_ALERTE_NIGER }} - - name: Bundle chis_ne - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "chis_ne" }' - env: - ANDROID_KEYSTORE_PATH: chis_ne.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_CHIS_NE }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_CHIS_NE }} - - - name: Bundle cht_rci - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "cht_rci" }' - env: - ANDROID_KEYSTORE_PATH: cht_rci.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_CHT_RCI }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_CHT_RCI }} - - - name: Unpack secrets moh_civ_uat - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_MOH_CIV_UAT }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_MOH_CIV_UAT }} - run: make org=moh_civ_uat keydec - - - name: Assemble moh_civ_uat - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_civ_uat" }' - env: - ANDROID_KEYSTORE_PATH: moh_civ_uat.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_CIV_UAT }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_CIV_UAT }} - - - name: Bundle moh_civ_uat - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "moh_civ_uat" }' - env: - ANDROID_KEYSTORE_PATH: moh_civ_uat.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_CIV_UAT }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_CIV_UAT }} - - - name: Unpack secrets moh_mali_chw - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_MOH_MALI_CHW }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_MOH_MALI_CHW }} - run: make org=moh_mali_chw keydec - - - name: Assemble moh_mali_chw - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_mali_chw" }' - env: - ANDROID_KEYSTORE_PATH: moh_mali_chw.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_MALI_CHW }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_MALI_CHW }} - - - name: Bundle moh_mali_chw - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "moh_mali_chw" }' - env: - ANDROID_KEYSTORE_PATH: moh_mali_chw.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_MALI_CHW }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_MALI_CHW }} - - - name: Unpack secrets moh_niger_chw - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_MOH_NIGER_CHW }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_MOH_NIGER_CHW }} - run: make org=moh_niger_chw keydec - - - name: Assemble moh_niger_chw - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_niger_chw" }' - env: - ANDROID_KEYSTORE_PATH: moh_niger_chw.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_NIGER_CHW }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_NIGER_CHW }} - - - name: Bundle moh_niger_chw - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "moh_niger_chw" }' - env: - ANDROID_KEYSTORE_PATH: moh_niger_chw.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_NIGER_CHW }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_NIGER_CHW }} - - - name: Unpack secrets moh_mali_chw_training_three - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_MOH_MALI_CHW_TRAINING_THREE }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_MOH_MALI_CHW_TRAINING_THREE }} - run: make org=moh_mali_chw_training_three keydec - - - name: Assemble moh_mali_chw_training_three - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_mali_chw_training_three" }' - env: - ANDROID_KEYSTORE_PATH: moh_mali_chw_training_three.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_MALI_CHW_TRAINING_THREE }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_MALI_CHW_TRAINING_THREE }} - - - name: Bundle moh_mali_chw_training_three - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "moh_mali_chw_training_three" }' - env: - ANDROID_KEYSTORE_PATH: moh_mali_chw_training_three.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_MALI_CHW_TRAINING_THREE }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_MALI_CHW_TRAINING_THREE }} - - - name: Unpack secrets moh_mali_chw_training_2 - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_MOH_MALI_CHW_TRAINING_2 }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_MOH_MALI_CHW_TRAINING_2 }} - run: make org=moh_mali_chw_training_2 keydec - - - name: Assemble moh_mali_chw_training_2 - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_mali_chw_training_2" }' - env: - ANDROID_KEYSTORE_PATH: moh_mali_chw_training_2.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_MALI_CHW_TRAINING_2 }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_MALI_CHW_TRAINING_2 }} - - - name: Bundle moh_mali_chw_training_2 - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "moh_mali_chw_training_2" }' - env: - ANDROID_KEYSTORE_PATH: moh_mali_chw_training_2.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_MALI_CHW_TRAINING_2 }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_MALI_CHW_TRAINING_2 }} - - - name: Unpack secrets moh_togo_uat - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_MOH_TOGO_UAT }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_MOH_TOGO_UAT }} - run: make org=moh_togo_uat keydec - - - name: Assemble moh_togo_uat - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_togo_uat" }' - env: - ANDROID_KEYSTORE_PATH: moh_togo_uat.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_TOGO_UAT }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_TOGO_UAT }} - - - name: Bundle moh_togo_uat - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "moh_togo_uat" }' - env: - ANDROID_KEYSTORE_PATH: moh_togo_uat.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_TOGO_UAT }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_TOGO_UAT }} - - - - name: Unpack secrets moh_togo_echis - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_MOH_TOGO_ECHIS }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_MOH_TOGO_ECHIS }} - run: make org=moh_togo_echis keydec - - - name: Assemble moh_togo_echis - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_togo_echis" }' - env: - ANDROID_KEYSTORE_PATH: moh_togo_echis.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_TOGO_ECHIS }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_TOGO_ECHIS }} - - - name: Bundle moh_togo_echis - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "moh_togo_echis" }' - env: - ANDROID_KEYSTORE_PATH: moh_togo_echis.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_TOGO_ECHIS }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_TOGO_ECHIS }} - - - name: Unpack secrets lumbini_ne - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_LUMBINI_NE }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_LUMBINI_NE }} - run: make org=lumbini_ne keydec - - - name: Assemble lumbini_ne - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "lumbini_ne" }' - env: - ANDROID_KEYSTORE_PATH: lumbini_ne.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_LUMBINI_NE }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_LUMBINI_NE }} - - - name: Bundle lumbini_ne - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "lumbini_ne" }' - env: - ANDROID_KEYSTORE_PATH: lumbini_ne.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_LUMBINI_NE }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_LUMBINI_NE }} - - - name: Unpack secrets gandaki_ne - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_GANDAKI_NE }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_GANDAKI_NE }} - run: make org=gandaki_ne keydec - - - name: Assemble gandaki_ne - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "gandaki_ne" }' - env: - ANDROID_KEYSTORE_PATH: gandaki_ne.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_GANDAKI_NE }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_GANDAKI_NE }} - - - name: Bundle gandaki_ne - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "gandaki_ne" }' - env: - ANDROID_KEYSTORE_PATH: gandaki_ne.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_GANDAKI_NE }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_GANDAKI_NE }} - - - name: Unpack secrets safaridoctors_kenya_yha - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_SAFARIDOCTORS_KENYA_YHA }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_SAFARIDOCTORS_KENYA_YHA }} - run: make org=safaridoctors_kenya_yha keydec - - - name: Assemble safaridoctors_kenya_yha - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "safaridoctors_kenya_yha" }' - env: - ANDROID_KEYSTORE_PATH: safaridoctors_kenya_yha.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_SAFARIDOCTORS_KENYA_YHA }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_SAFARIDOCTORS_KENYA_YHA }} - - - name: Bundle safaridoctors_kenya_yha - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "safaridoctors_kenya_yha" }' - env: - ANDROID_KEYSTORE_PATH: safaridoctors_kenya_yha.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_SAFARIDOCTORS_KENYA_YHA }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_SAFARIDOCTORS_KENYA_YHA }} - - - name: Unpack secrets moh_civ - env: - ANDROID_SECRETS_KEY: ${{ secrets.ANDROID_SECRETS_KEY_MOH_CIV }} - ANDROID_SECRETS_IV: ${{ secrets.ANDROID_SECRETS_IV_MOH_CIV }} - run: make org=moh_civ keydec - - - name: Assemble moh_civ - uses: maierj/fastlane-action@v1.4.0 - with: - lane: build - options: '{ "flavor": "moh_civ" }' - env: - ANDROID_KEYSTORE_PATH: moh_civ.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_CIV }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_CIV }} - - - name: Bundle moh_civ - uses: maierj/fastlane-action@v1.4.0 - with: - lane: bundle - options: '{ "flavor": "moh_civ" }' - env: - ANDROID_KEYSTORE_PATH: moh_civ.keystore - ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD_MOH_CIV }} - ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD_MOH_CIV }} - - name: GitHub release uses: softprops/action-gh-release@v1 diff --git a/build.gradle b/build.gradle index 5e4f4afb..df8e5091 100644 --- a/build.gradle +++ b/build.gradle @@ -459,6 +459,17 @@ android { dimension = 'brand' applicationId = 'org.medicmobile.webapp.mobile.safaridoctors_kenya_yha' } + + moh_nepal_mhealth { + dimension = 'brand' + applicationId = 'org.medicmobile.webapp.mobile.moh_nepal_mhealth' + } + + lumbini_chis { + dimension = 'brand' + applicationId = 'org.medicmobile.webapp.mobile.lumbini' + } + } splits { @@ -477,6 +488,11 @@ android { } dependencies { + implementation 'com.google.android.gms:play-services-mlkit-barcode-scanning:18.3.1' + def cameraXVersion = '1.3.4' + implementation "androidx.camera:camera-camera2:${cameraXVersion}" + implementation "androidx.camera:camera-lifecycle:${cameraXVersion}" + implementation "androidx.camera:camera-view:${cameraXVersion}" implementation fileTree(dir: 'libs', include: ['*.jar']) implementation platform('org.jetbrains.kotlin:kotlin-bom:1.9.24') implementation 'androidx.core:core:1.13.1' diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index d7c45d01..a6cee7ff 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -11,6 +11,9 @@ + @@ -21,6 +24,9 @@ + + + @@ -32,6 +38,9 @@ android:dataExtractionRules="@xml/backup_rules" android:largeHeap="true" tools:ignore="LockedOrientationActivity,UnusedAttribute"> + @@ -65,6 +74,9 @@ + diff --git a/src/main/java/org/medicmobile/webapp/mobile/BarcodeScanner.java b/src/main/java/org/medicmobile/webapp/mobile/BarcodeScanner.java new file mode 100644 index 00000000..fe5a4b1b --- /dev/null +++ b/src/main/java/org/medicmobile/webapp/mobile/BarcodeScanner.java @@ -0,0 +1,159 @@ +package org.medicmobile.webapp.mobile; + +import android.Manifest; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.util.Log; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.annotation.OptIn; +import androidx.appcompat.app.AppCompatActivity; +import androidx.camera.core.CameraSelector; +import androidx.camera.core.ExperimentalGetImage; +import androidx.camera.core.ImageAnalysis; +import androidx.camera.core.ImageProxy; +import androidx.camera.core.Preview; +import androidx.camera.lifecycle.ProcessCameraProvider; +import androidx.camera.view.PreviewView; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; + +import com.google.android.gms.tasks.Task; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.mlkit.vision.barcode.BarcodeScannerOptions; +import com.google.mlkit.vision.barcode.BarcodeScanning; +import com.google.mlkit.vision.barcode.common.Barcode; +import com.google.mlkit.vision.common.InputImage; + +import java.util.List; +import java.util.Objects; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import static org.medicmobile.webapp.mobile.EmbeddedBrowserActivity.RequestCode; + +public class BarcodeScanner extends AppCompatActivity { + + private PreviewView scannerPreview; + private ExecutorService cameraExecutor; + private static final String TAG = "BarcodeScanner"; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.barcode_scanner); + scannerPreview = findViewById(R.id.scannerPreview); + cameraExecutor = Executors.newSingleThreadExecutor(); + + if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) + == PackageManager.PERMISSION_GRANTED) { + startCamera(); + } else { + ActivityCompat.requestPermissions(this, + new String[]{Manifest.permission.CAMERA}, + RequestCode.BARCODE_SCANNER.getCode()); + } + } + + @Override + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + if (requestCode == RequestCode.BARCODE_SCANNER.getCode() + && grantResults[0] == PackageManager.PERMISSION_GRANTED){ + startCamera(); + } else { + Toast.makeText(this, "Camera permission denied", Toast.LENGTH_SHORT).show(); + } + } + + @Override + protected void onDestroy() { + super.onDestroy(); + cameraExecutor.shutdown(); + } + + private void startCamera() { + ListenableFuture cameraProviderFuture = ProcessCameraProvider.getInstance(this); + cameraProviderFuture.addListener(() -> { + try { + ProcessCameraProvider cameraProvider = cameraProviderFuture.get(); + bindPreview(cameraProvider); + } catch (ExecutionException | InterruptedException e){ + Log.e(TAG, Objects.requireNonNull(e.getMessage())); + } + }, + ContextCompat.getMainExecutor(this)); + } + + private void bindPreview(ProcessCameraProvider cameraProvider){ + Preview preview = new Preview.Builder().build(); + preview.setSurfaceProvider(scannerPreview.getSurfaceProvider()); + CameraSelector cameraSelector = new CameraSelector.Builder() + .requireLensFacing(CameraSelector.LENS_FACING_BACK) + .build(); + + ImageAnalysis imageAnalysis = new ImageAnalysis.Builder() + .setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST) + .build(); + imageAnalysis.setAnalyzer(cameraExecutor, this::imageAnalyzer); + + cameraProvider.bindToLifecycle(this, cameraSelector, preview, imageAnalysis); + } + + + @OptIn(markerClass = ExperimentalGetImage.class) + private void imageAnalyzer(ImageProxy imageProxy) { + + if (imageProxy.getImage() != null) { + InputImage image = InputImage.fromMediaImage(imageProxy.getImage(), imageProxy.getImageInfo().getRotationDegrees()); + BarcodeScannerOptions options = buildBarcodeOptions(); + com.google.mlkit.vision.barcode.BarcodeScanner scanner = BarcodeScanning.getClient(options); + + Task> result = scanner.process(image); + result.addOnSuccessListener(barcodes -> { + for (Barcode barcode : barcodes) { + String rawValue = barcode.getRawValue(); + returnIntent(rawValue); + } + }); + result.addOnFailureListener(e -> { + Log.e(TAG, Objects.requireNonNull(e.getMessage())); + Toast.makeText(this, "Failed to scan image", Toast.LENGTH_SHORT).show(); + }); + + result.addOnCompleteListener(task -> { + imageProxy.close(); + }); + } + } + + private void returnIntent(String barcode) { + if (barcode != null) { + Intent resultIntent = new Intent(); + resultIntent.putExtra("CHT_BARCODE", barcode); + setResult(RESULT_OK, resultIntent); + finish(); + } + } + + private BarcodeScannerOptions buildBarcodeOptions() { + return new BarcodeScannerOptions.Builder() + .setBarcodeFormats( + //formats to support + Barcode.FORMAT_QR_CODE, + Barcode.FORMAT_AZTEC, + Barcode.FORMAT_CODE_39, + Barcode.FORMAT_PDF417, + Barcode.FORMAT_EAN_13, + Barcode.FORMAT_CODE_128, + Barcode.FORMAT_UPC_E, + Barcode.FORMAT_UPC_A, + Barcode.FORMAT_EAN_8 + ) + .build(); + } +} diff --git a/src/main/java/org/medicmobile/webapp/mobile/ChtExternalAppHandler.java b/src/main/java/org/medicmobile/webapp/mobile/ChtExternalAppHandler.java index 2998a5d5..a8880696 100644 --- a/src/main/java/org/medicmobile/webapp/mobile/ChtExternalAppHandler.java +++ b/src/main/java/org/medicmobile/webapp/mobile/ChtExternalAppHandler.java @@ -76,6 +76,11 @@ void resumeActivity(int resultCode) { this.lastIntent = null; // Cleaning as we don't need it anymore. } + void triggerScanner() { + Intent intent = new Intent(context, BarcodeScanner.class); + this.context.startActivityForResult(intent, RequestCode.BARCODE_SCANNER.getCode()); + } + //> PRIVATE private void startActivity(Intent intent) { diff --git a/src/main/java/org/medicmobile/webapp/mobile/EmbeddedBrowserActivity.java b/src/main/java/org/medicmobile/webapp/mobile/EmbeddedBrowserActivity.java index 96f4e318..b1dcea7d 100644 --- a/src/main/java/org/medicmobile/webapp/mobile/EmbeddedBrowserActivity.java +++ b/src/main/java/org/medicmobile/webapp/mobile/EmbeddedBrowserActivity.java @@ -208,6 +208,9 @@ protected void onActivityResult(int requestCd, int resultCode, Intent intent) { case ACCESS_SEND_SMS_PERMISSION: this.smsSender.resumeProcess(resultCode); return; + case BARCODE_SCANNER: + processChtBarcodeResult(resultCode, intent); + return; default: trace(this, "onActivityResult() :: no handling for requestCode=%s", requestCode.name()); } @@ -283,6 +286,10 @@ private void locationRequestResolved() { evaluateJavascript("window.CHTCore.AndroidApi.v1.locationPermissionRequestResolved();"); } + private void processChtBarcodeResult(int resultCode, Intent intentData) { + processChtExternalAppResult(resultCode, intentData); + } + private void processChtExternalAppResult(int resultCode, Intent intentData) { String script = this.chtExternalAppHandler.processResult(resultCode, intentData); trace(this, "ChtExternalAppHandler :: Executing JavaScript: %s", script); @@ -410,7 +417,8 @@ public enum RequestCode { ACCESS_SEND_SMS_PERMISSION(102), CHT_EXTERNAL_APP_ACTIVITY(103), GRAB_MRDT_PHOTO_ACTIVITY(104), - FILE_PICKER_ACTIVITY(105); + FILE_PICKER_ACTIVITY(105), + BARCODE_SCANNER(106); private final int requestCode; diff --git a/src/main/java/org/medicmobile/webapp/mobile/MedicAndroidJavascript.java b/src/main/java/org/medicmobile/webapp/mobile/MedicAndroidJavascript.java index aac1e627..c92adc5e 100644 --- a/src/main/java/org/medicmobile/webapp/mobile/MedicAndroidJavascript.java +++ b/src/main/java/org/medicmobile/webapp/mobile/MedicAndroidJavascript.java @@ -31,6 +31,7 @@ import java.util.Calendar; import java.util.HashMap; import java.util.Map; +import java.util.Objects; import org.json.JSONException; import org.json.JSONObject; @@ -189,21 +190,27 @@ public void sms_send(String id, String destination, String content) throws Excep @android.webkit.JavascriptInterface public void launchExternalApp(String action, String category, String type, String extras, String uri, String packageName, String flags) { try { - JSONObject parsedExtras = extras == null ? null : new JSONObject(extras); - Uri parsedUri = uri == null ? null : Uri.parse(uri); - Integer parsedFlags = flags == null ? null : Integer.parseInt(flags); - - ChtExternalApp chtExternalApp = new ChtExternalApp - .Builder() - .setAction(action) - .setCategory(category) - .setType(type) - .setExtras(parsedExtras) - .setUri(parsedUri) - .setPackageName(packageName) - .setFlags(parsedFlags) - .build(); - this.chtExternalAppHandler.startIntent(chtExternalApp); + //This implementation is hijacking this bridge + // Create a new webapp API specifically for this embedded barcode scanner + if(Objects.equals(action, "cht.android.SCAN_BARCODE")) { + this.chtExternalAppHandler.triggerScanner(); + } else { + JSONObject parsedExtras = (extras == null) ? null : new JSONObject(extras); + Uri parsedUri = (uri == null) ? null : Uri.parse(uri); + Integer parsedFlags = (flags == null) ? null : Integer.parseInt(flags); + + ChtExternalApp chtExternalApp = new ChtExternalApp + .Builder() + .setAction(action) + .setCategory(category) + .setType(type) + .setExtras(parsedExtras) + .setUri(parsedUri) + .setPackageName(packageName) + .setFlags(parsedFlags) + .build(); + this.chtExternalAppHandler.startIntent(chtExternalApp); + } } catch (Exception ex) { logException(ex); diff --git a/src/main/res/layout/barcode_scanner.xml b/src/main/res/layout/barcode_scanner.xml new file mode 100644 index 00000000..f4cb6ff7 --- /dev/null +++ b/src/main/res/layout/barcode_scanner.xml @@ -0,0 +1,15 @@ + + + + + + diff --git a/src/main/res/layout/connection_error.xml b/src/main/res/layout/connection_error.xml index 910509d1..cd91f105 100644 --- a/src/main/res/layout/connection_error.xml +++ b/src/main/res/layout/connection_error.xml @@ -1,5 +1,6 @@ + android:textAllCaps="true" + tools:ignore="UsingOnClickInXml" /> + android:textAllCaps="true" + tools:ignore="UsingOnClickInXml" /> diff --git a/src/main/res/layout/custom_server_form.xml b/src/main/res/layout/custom_server_form.xml index a0c34725..1f85d632 100644 --- a/src/main/res/layout/custom_server_form.xml +++ b/src/main/res/layout/custom_server_form.xml @@ -22,7 +22,7 @@ android:layout_alignParentBottom="true" android:onClick="cancelSettingsEdit" android:text="@string/btnCancel" - tools:ignore="OnClick" /> + tools:ignore="OnClick,UsingOnClickInXml" /> @@ -32,5 +32,5 @@ android:layout_alignParentBottom="true" android:onClick="verifyAndSave" android:text="@string/btnSave" - tools:ignore="OnClick" /> + tools:ignore="OnClick,UsingOnClickInXml" /> diff --git a/src/main/res/layout/free_space_warning.xml b/src/main/res/layout/free_space_warning.xml index 08203107..50192b3a 100644 --- a/src/main/res/layout/free_space_warning.xml +++ b/src/main/res/layout/free_space_warning.xml @@ -37,7 +37,7 @@ style="@style/standardButton" android:text="@string/btnQuit" android:onClick="evtQuit" - tools:ignore="OnClick" + tools:ignore="OnClick,UsingOnClickInXml" android:layout_toStartOf="@+id/btnFreeSpaceContinue" android:layout_alignParentBottom="true"/>