Skip to content

Commit

Permalink
230 - Removing simprints (medic#241)
Browse files Browse the repository at this point in the history
Ticket: medic#230

This commit removes Simprints integration.
  • Loading branch information
latin-panda authored and melema123 committed Apr 27, 2022
1 parent 4645128 commit 04eec45
Show file tree
Hide file tree
Showing 14 changed files with 114 additions and 318 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,6 @@ jobs:
with:
lane: build
options: '{ "flavor": "safaridoctors_kenya" }'
- name: Assemble simprints
uses: maierj/[email protected]
with:
lane: build
options: '{ "flavor": "simprints" }'
- name: Assemble surveillance_covid19_kenya
uses: maierj/[email protected]
with:
Expand Down
41 changes: 1 addition & 40 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ repositories {
}
}

def simprintsApiKey, simprintsModuleId, simprintsUserId

def getVersionCode = {
int versionCode = 2
if (System.env.CI == 'true' && System.env.RELEASE_VERSION && System.env.RELEASE_VERSION.startsWith('v')) {
Expand Down Expand Up @@ -97,30 +95,6 @@ android {
buildConfigField "String", "LOG_TAG", '"MedicMobile"'
buildConfigField "Long", "TTL_LAST_URL", '24l * 60 * 60 * 1000' // 24 hs max time last URL loaded is remembered

if (System.env.SIMPRINTS_API_KEY) {
buildConfigField "String", "SIMPRINTS_API_KEY", /"${System.env.SIMPRINTS_API_KEY}"/
} else if (simprintsApiKey) {
buildConfigField "String", "SIMPRINTS_API_KEY", /"${simprintsApiKey}"/
} else {
buildConfigField "String", "SIMPRINTS_API_KEY", /"Medic's API Key"/
}

if (System.env.SIMPRINTS_USER_ID) {
buildConfigField "String", "SIMPRINTS_USER_ID", /"${System.env.SIMPRINTS_USER_ID}"/
} else if (simprintsUserId) {
buildConfigField "String", "SIMPRINTS_USER_ID", /"${simprintsUserId}"/
} else {
buildConfigField "String", "SIMPRINTS_USER_ID", '"some-user-id"'
}

if (System.env.SIMPRINTS_MODULE_ID) {
buildConfigField "String", "SIMPRINTS_MODULE_ID", /"${System.env.SIMPRINTS_MODULE_ID}"/
} else if (simprintsModuleId) {
buildConfigField "String", "SIMPRINTS_MODULE_ID", /"${simprintsModuleId}"/
} else {
buildConfigField "String", "SIMPRINTS_MODULE_ID", '"Medic Module ID"'
}

// Every APK requires a unique version code.
// So when compiling multiple APKS for the different ABIs, use the first digit
variant.outputs.each { output ->
Expand All @@ -144,7 +118,7 @@ android {
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'config/libsimprints.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
shrinkResources true
signingConfig signingConfigs.release
}
Expand Down Expand Up @@ -188,9 +162,6 @@ android {
// for `unbranded` - it will use the defaults in
// src/main
dimension = 'brand'
simprintsApiKey = 'f4c47c4e-d6ee-444f-b16e-22a4761b1f3c'
simprintsModuleId = 'simprints.app'
simprintsUserId = '[email protected]'
}

medicmobiledemo {
Expand Down Expand Up @@ -308,15 +279,6 @@ android {
applicationId = 'org.medicmobile.webapp.mobile.safaridoctors_kenya'
}

simprints {
dimension = 'brand'
applicationId = 'org.medicmobile.webapp.mobile.simprints'

simprintsApiKey = 'f4c47c4e-d6ee-444f-b16e-22a4761b1f3c'
simprintsModuleId = 'simprints.app'
simprintsUserId = '[email protected]'
}

vhw_burundi {
dimension = 'brand'
applicationId = 'org.medicmobile.webapp.mobile.vhw_burundi'
Expand Down Expand Up @@ -396,7 +358,6 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.simprints:LibSimprints:1.0.11'
implementation 'com.github.Mariovc:ImagePicker:1.2.2'
// Latest version of androidx.core requires Android 12+
// noinspection GradleDependency
Expand Down
3 changes: 0 additions & 3 deletions config/libsimprints.pro

This file was deleted.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
android.useAndroidX=true
# Remove 'android.enableJetifier=true' when dropping the libraries: com.simprints:LibSimprints and com.github.Mariovc:ImagePicker.
# Remove 'android.enableJetifier=true' when dropping the library: com.github.Mariovc:ImagePicker.
android.enableJetifier=true
org.gradle.jvmargs=-Xmx2048m
3 changes: 0 additions & 3 deletions src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>
<intent>
<action android:name="simprints.app" />
</intent>
<intent>
<action android:name="medic.mrdt.verify" />
</intent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
import static android.app.Activity.RESULT_OK;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static org.medicmobile.webapp.mobile.EmbeddedBrowserActivity.ACCESS_STORAGE_PERMISSION_REQUEST_CODE;
import static org.medicmobile.webapp.mobile.EmbeddedBrowserActivity.CHT_EXTERNAL_APP_ACTIVITY_REQUEST_CODE;
import static org.medicmobile.webapp.mobile.EmbeddedBrowserActivity.RequestCode;
import static org.medicmobile.webapp.mobile.JavascriptUtils.safeFormat;
import static org.medicmobile.webapp.mobile.MedicLog.error;
import static org.medicmobile.webapp.mobile.MedicLog.trace;
Expand Down Expand Up @@ -59,7 +58,11 @@ void startIntent(ChtExternalApp chtExternalApp) {
if (ContextCompat.checkSelfPermission(this.context, READ_EXTERNAL_STORAGE) != PERMISSION_GRANTED) {
trace(this, "ChtExternalAppHandler :: Requesting storage permissions to process image files taken from external apps");
this.lastIntent = intent; // Saving intent to start it when permission is granted.
ActivityCompat.requestPermissions(this.context, PERMISSIONS_STORAGE, ACCESS_STORAGE_PERMISSION_REQUEST_CODE);
ActivityCompat.requestPermissions(
this.context,
PERMISSIONS_STORAGE,
RequestCode.ACCESS_STORAGE_PERMISSION.getCode()
);
return;
}

Expand All @@ -80,7 +83,7 @@ void resumeActivity() {
private void startActivity(Intent intent) {
try {
trace(this, "ChtExternalAppHandler :: Starting activity %s %s", intent, intent.getExtras());
this.context.startActivityForResult(intent, CHT_EXTERNAL_APP_ACTIVITY_REQUEST_CODE);
this.context.startActivityForResult(intent, RequestCode.CHT_EXTERNAL_APP_ACTIVITY.getCode());

} catch (Exception exception) {
error(exception, "ChtExternalAppHandler :: Error when starting the activity %s %s", intent, intent.getExtras());
Expand Down
Loading

0 comments on commit 04eec45

Please sign in to comment.