Skip to content

Commit fa19191

Browse files
committed
Add a special flavour to allow logout for CHW supervisors
1 parent 1d2a0de commit fa19191

File tree

8 files changed

+22
-0
lines changed

8 files changed

+22
-0
lines changed

build.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ android {
100100
versionCode getVersionCode()
101101
versionName getVersionName()
102102
archivesBaseName = "${project.name}-${versionName}"
103+
104+
buildConfigField "boolean", "FORCE_LOGIN_HOTDOG_VIA_DODGY_MEANS", "false"
103105
}
104106

105107
applicationVariants.all {
@@ -203,6 +205,11 @@ android {
203205
moh_kenya_siaya {
204206
applicationId = 'org.medicmobile.webapp.mobile.moh_kenya_siaya'
205207
}
208+
moh_kenya_siaya_multi {
209+
// special build for moh_kenya_siaya to allow for account switching via hotdog logout button
210+
applicationId = 'org.medicmobile.webapp.mobile.moh_kenya_siaya_multi'
211+
buildConfigField "boolean", "FORCE_LOGIN_HOTDOG_VIA_DODGY_MEANS", "true"
212+
}
206213
musomali {
207214
applicationId = 'org.medicmobile.webapp.mobile.musomali'
208215
}

src/main/java/org/medicmobile/webapp/mobile/MedicAndroidJavascript.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ public void setLocationManager(LocationManager locationManager) {
4747
@org.xwalk.core.JavascriptInterface
4848
@android.webkit.JavascriptInterface
4949
public String getAppVersion() {
50+
if(org.medicmobile.webapp.mobile.BuildConfig.FORCE_LOGIN_HOTDOG_VIA_DODGY_MEANS) {
51+
// Horrible hack - if we return a blank string for the
52+
// app version, in certain places the webapp will think
53+
// we're not using the mobile app, so will display the
54+
// logout option in the homburg menu. This allows a
55+
// user to switch accounts without having to log out and
56+
// then in again.
57+
return "";
58+
}
59+
5060
try {
5161
return parent.getPackageManager()
5262
.getPackageInfo(parent.getPackageName(), 0)
7.59 KB
Loading
3.58 KB
Loading
12 KB
Loading
24.4 KB
Loading
39.4 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="app_name">MOH Siaya MULTI</string>
4+
<string name="fixed_app_url">https://moh-kenya-siaya.app.medicmobile.org</string>
5+
</resources>

0 commit comments

Comments
 (0)