Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #174

Merged
merged 44 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
522a5c3
OTC-768 Removed MANAGE_EXTERNAL_STORAGE permission
malinowskikam May 20, 2022
416d666
OP-768 Removed getMainDirectory method
malinowskikam May 20, 2022
619a8f2
OP-768 Bumped target SDK to 32 (Android 12)
malinowskikam May 20, 2022
e9d0844
Finish feature/OP-768
dragos-dobre May 24, 2022
6dda047
OTC-596 Fixed checking photos after validation
malinowskikam May 30, 2022
444afe5
OTC-596 Fixed EOF in AndroidManifest.xml
malinowskikam May 30, 2022
fa6eb4b
Finish feature/OTC-596
dragos-dobre Jun 1, 2022
57448d5
OTC-581: Custom message is now displayed when no policy is active.
wzgliniecki Jun 15, 2022
b49b787
Merge pull request #152 from openimis/feature/OTC-581
delcroip Jun 24, 2022
9e3c4f4
Release Log class fixed
malinowskikam Jun 29, 2022
353b663
Merge pull request #153 from openimis/release_log_fix
delcroip Jun 29, 2022
65c046f
OTC-640 Fixed app freezes on modify family
malinowskikam Jul 11, 2022
4fc2158
Finish feature/OTC-640
dragos-dobre Jul 11, 2022
2c61b5f
OTC-642: Fixed XML enrolment export
malinowskikam Jul 22, 2022
b65a57c
OTC-642 Fixed typo in method name
malinowskikam Jul 25, 2022
4ab63f1
Finish feature/OTC-642
dragos-dobre Jul 25, 2022
3c149f0
OTC-651 Implemented default language, fixed saved language
malinowskikam Aug 4, 2022
2944b1c
OTC-651 Removed redundant files
malinowskikam Aug 4, 2022
77cb6c9
Finish feature/OTC-651
dragos-dobre Aug 4, 2022
281b198
OTC-683 Fixed no InsureePolicy after Policy
malinowskikam Aug 30, 2022
77cada0
Finish OTC-683
dragos-dobre Aug 30, 2022
eb37472
OTC-683 Added policy check to insuree page
malinowskikam Aug 31, 2022
0a1cd20
Finish feature/OTC-683-fix
dragos-dobre Aug 31, 2022
79aa79f
OTC-662 Fixed misleading modify family errors
malinowskikam Sep 2, 2022
9325750
OP-703: Policy status is displayed in the Enquire menu.
wzgliniecki Sep 2, 2022
cb5fbd3
Finish feature/OP-703
dragos-dobre Sep 2, 2022
157ab79
Merge branch 'develop' into feature/OTC-662
malinowskikam Sep 5, 2022
ffc25fb
Finish feature/OTC-662
dragos-dobre Sep 5, 2022
fe93a62
Updated SDK to 33, updated strings
malinowskikam Sep 6, 2022
c8bf26e
Finish feature/sdk-string-update
dragos-dobre Sep 6, 2022
eff468b
OP-705: Message added when no insuree is found in Enquire.
wzgliniecki Sep 7, 2022
9df601e
Merge pull request #166 from openimis/feature/OP-705
dragos-dobre Sep 11, 2022
f3b2bb4
OP-687: No renewals found message added.
wzgliniecki Sep 15, 2022
0bbf9de
Finish feature/OP-687
dragos-dobre Sep 15, 2022
8417971
OTC-696 Implemented LanguageManager
malinowskikam Sep 22, 2022
b66aa99
OTC-696 Implemented separate resource dirs for localisation
malinowskikam Sep 22, 2022
c885f01
OTC-696 Removed unused build variable
malinowskikam Sep 22, 2022
a1c2cd3
Finish feature/OTC-696
dragos-dobre Sep 22, 2022
21349c3
OTC-708 Added fail message to master data redownload
malinowskikam Sep 26, 2022
29dbb44
Finish feature/OTC-708
dragos-dobre Sep 26, 2022
2b4b36d
Fixed missing default locale key
malinowskikam Sep 28, 2022
116ca69
Finish feature/compile-resource-fix
dragos-dobre Sep 28, 2022
54625dc
OP-940 Updated release configuration
malinowskikam Nov 7, 2022
769bb12
Merge pull request #173 from openimis/feature/OP-940
delcroip Nov 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 31 additions & 32 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ apply from: "$project.rootDir/script-git-version.gradle"
// Load keystore
def keystorePropertiesFile = file("keystore.properties")
def keystoreProperties = new Properties()
if ( keystorePropertiesFile.exists() ) {
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

Expand All @@ -20,9 +20,9 @@ static def getDate() {
}

android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
if ( keystorePropertiesFile.exists() ) {
compileSdkVersion 33
buildToolsVersion '33.0.0'
if (keystorePropertiesFile.exists()) {
signingConfigs {
releaseConfig {
storeFile file(keystoreProperties['storeFile'])
Expand All @@ -35,11 +35,10 @@ android {
defaultConfig {
applicationId "org.openimis.imispolicies"
minSdkVersion 19
targetSdkVersion 30
targetSdkVersion 33
versionCode gitVersionCode
versionName gitVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
useLibrary('org.apache.http.legacy')
vectorDrawables {
useSupportLibrary = true
}
Expand All @@ -50,7 +49,7 @@ android {
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
debuggable = false
if ( keystorePropertiesFile.exists() ) {
if (keystorePropertiesFile.exists()) {
signingConfig signingConfigs.releaseConfig
}
buildConfigField "boolean", "LOGGING_ENABLED", "false"
Expand All @@ -66,7 +65,7 @@ android {

// Refer to https://developer.android.com/reference/android/util/Log for the log level values
buildConfigField "int", "CONSOLE_LOG_LEVEL", '2' //Verbose
buildConfigField "int", "FILE_LOG_LEVEL", '2' //Verbose
buildConfigField "int", "FILE_LOG_LEVEL", '5' //Warn
}
flavorDimensions 'std'
}
Expand All @@ -77,60 +76,56 @@ android {
buildConfigField "boolean", "SHOW_BULK_CN_MENU", 'false'
buildConfigField "String", "RAR_PASSWORD", '")(#$1HsD"'
buildConfigField "String", "API_VERSION", '"3"'
buildConfigField "String", "APP_DIR", '"IMIS"'
buildConfigField "String", "DEFAULT_LANGUAGE_CODE", '"en"'
resValue "string", "app_name_policies", "Policies"
resValue "string", "ReleaseDateValue", getDate()
}
productFlavors {
demoProd {
applicationId "org.openimis.imispolicies.demoProd"
buildConfigField "String", "API_BASE_URL", '"https://demo.openimis.org/rest/"'
buildConfigField "String", "APP_DIR", '"IMIS-DEMOPROD"'
resValue "string", "app_name_policies", "Policies Demo"
dimension = 'std'
}
demoRelease {
applicationId "org.openimis.imispolicies.demoRelease"
buildConfigField "String", "API_BASE_URL", '"https://legacy-release.s1.openimis.org/rest/"'
buildConfigField "String", "APP_DIR", '"IMIS-DEMORELEASE"'
buildConfigField "String", "API_BASE_URL", '"https://release.openimis.org/rest/"'
resValue "string", "app_name_policies", "Policies Release"
dimension = 'std'
}
chfDev {
applicationId "org.openimis.imispolicies.chfdev"
buildConfigField "String", "API_BASE_URL", '"http://chf-dev.swisstph-mis.ch/rest/"'
buildConfigField "boolean", "SHOW_PAYMENT_MENU", 'true'
buildConfigField "boolean", "SHOW_BULK_CN_MENU", 'true'
buildConfigField "String", "APP_DIR", '"IMIS-CHFDEV"'
buildConfigField "String", "DEFAULT_LANGUAGE_CODE", '"en-tz"'
resValue "string", "app_name_policies", "Policies CHF DEV"
dimension = 'std'
}
mvDev {
applicationId "org.openimis.imispolicies.mv"
buildConfigField "String", "API_BASE_URL", '"http://imis-mv.swisstph-mis.ch/rest/"'
buildConfigField "boolean", "SHOW_PAYMENT_MENU", 'true'
buildConfigField "String", "APP_DIR", '"IMIS-MVDEV"'
buildConfigField "String", "API_VERSION", '"3"'
resValue "string", "app_name_policies", "Policies MV DEV"
dimension = 'std'
}
bephaDev {
applicationId "org.openimis.imispolicies.bepha"
buildConfigField "String", "API_BASE_URL", '"http://149.210.235.40/devupgrade/rest/"'
buildConfigField "String", "APP_DIR", '"IMIS-BEPHADEV"'
buildConfigField "String", "DEFAULT_LANGUAGE_CODE", '"en-cm"'
resValue "string", "app_name_policies", "Policies BEPHA DEV"
dimension = 'std'
}
tchadDev {
applicationId "org.openimis.imispolicies.tchadDev"
buildConfigField "String", "API_BASE_URL", '"http://imis-tchad-dev.swisstph-mis.ch/rest/"'
buildConfigField "String", "APP_DIR", '"IMIS-TCHADDEV"'
resValue "string", "app_name_policies", "Policies TCHAD DEV"
dimension = 'std'
}
local {
applicationId "org.openimis.imispolicies.local"
buildConfigField "String", "API_BASE_URL", '"http://10.0.2.2:35787/"'
buildConfigField "String", "APP_DIR", '"IMIS-LOCAL"'
buildConfigField "boolean", "SHOW_PAYMENT_MENU", 'true'
resValue "string", "app_name_policies", "Policies Local"
dimension = 'std'
Expand All @@ -139,13 +134,12 @@ android {
niger {
applicationId "org.openimis.imispolicies.niger"
buildConfigField "String", "API_BASE_URL", '"' + (System.getenv("API_BASE_URL") ?: 'http://192.168.0.100/') + '"'
buildConfigField "String", "APP_DIR", '"' + (System.getenv("CLI_APP_DIR") ?: 'IMIS-POL') + '"'
resValue "string", "app_name_policies", System.getenv("CLI_APP_NAME") ?: "Polices Niger"
dimension = 'std'
}
cli {
applicationIdSuffix System.getenv("APPLICATION_ID") ?: "org.openimis.imispolicies.cli"
buildConfigField "String", "API_BASE_URL", '"' + (System.getenv("API_BASE_URL") ?: 'http://10.0.2.2:35787/') + '"'
buildConfigField "String", "APP_DIR", '"' + (System.getenv("CLI_APP_DIR") ?: 'IMIS-CLI') + '"'
resValue "string", "app_name_policies", System.getenv("CLI_APP_NAME") ?: "Policies CLI"
dimension 'std'
}
Expand All @@ -154,23 +148,22 @@ android {
buildConfigField "String", "API_BASE_URL", '"https://formation.cnass-mauritanie.swisstph-mis.ch/rest/"'
buildConfigField "boolean", "SHOW_PAYMENT_MENU", 'false'
buildConfigField "boolean", "SHOW_BULK_CN_MENU", 'false'
buildConfigField "String", "APP_DIR", '"IMIS-MAURITANIA-TRAIN"'
resValue "string", "app_name_policies", "Policies CNASS TRAIN"
dimension = 'std'
}
}
sourceSets {
chfDev.java.srcDir 'src/chf/java'
chfDev.res.srcDir 'src/chf/res'
chfDev.res.srcDirs = ['src/chf/res', 'src/localeChf/res']

mvDev.java.srcDir 'src/master/java'
mvDev.res.srcDirs 'src/master/res'
mvDev.res.srcDirs = ['src/master/res', 'src/localeMv/res']

local.java.srcDir 'src/master/java'
local.res.srcDir 'src/master/res'
local.res.srcDirs = ['src/master/res', 'src/localeMv/res']

bephaDev.java.srcDir 'src/bepha/java'
bephaDev.res.srcDir 'src/bepha/res'
bephaDev.res.srcDirs = ['src/bepha/res', 'src/localeBepha/res']

niger.java.srcDir 'src/niger/java'
niger.res.srcDir 'src/niger/res'
Expand All @@ -180,10 +173,10 @@ android {
tchadDev.res.srcDir 'src/tchad/res'

demoProd.java.srcDir 'src/master/java'
demoProd.res.srcDir 'src/demoProd/res'
demoProd.res.srcDirs = ['src/demoProd/res', 'src/localeMv/res']

demoRelease.java.srcDir 'src/master/java'
demoRelease.res.srcDir 'src/demoRelease/res'
demoRelease.res.srcDirs = ['src/demoRelease/res', 'src/localeMv/res']

cli.java.srcDir System.getenv("CLI_JAVA_DIR") ?: 'src/master/java'
cli.res.srcDir System.getenv("CLI_RES_DIR") ?: 'src/demoProd/res'
Expand All @@ -194,19 +187,25 @@ android {
mauritaniaTrain.java.srcDir 'src/master/java'
}

// Apply custom flavours
if(file('custom-flavours.gradle').exists()){
// Apply custom flavours
if (file('custom-flavours.gradle').exists()) {
apply from: 'custom-flavours.gradle'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

packagingOptions {
resources {
excludes += ['META-INF/DEPENDENCIES']
}
}
}

dependencies {
implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs')
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
Expand All @@ -215,11 +214,11 @@ dependencies {
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'org.apache.commons:commons-lang3:3.12.0'

implementation 'org.jetbrains:annotations:15.0'
implementation 'cz.msebera.android:httpclient:4.5.8'

androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.13.1'
//compile 'com.android.support:support-annotations:27.1.1'
testImplementation 'junit:junit:4.13.2'
}
1 change: 0 additions & 1 deletion app/custom-flavours.gradle.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ android {
buildConfigField "String", "API_BASE_URL", [API_BASE_URL]
buildConfigField "boolean", "SHOW_PAYMENT_MENU", [SHOW_PAYMENT_MENU]
buildConfigField "boolean", "SHOW_BULK_CN_MENU", [SHOW_BULK_CN_MENU]
buildConfigField "String", "APP_DIR", [APP_DIR_NAME]
buildConfigField "String", "API_VERSION", [API_VERSION]
buildConfigField "String", "RAR_PASSWORD", [RAR_PASSWORD]
resValue "string", "app_name_policies", [APP_NAME]
Expand Down
29 changes: 19 additions & 10 deletions app/src/debug/java/org/openimis/imispolicies/tools/Log.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package org.openimis.imispolicies.tools;

import android.content.Context;
import android.net.Uri;
import android.support.v4.content.FileProvider;

import org.openimis.imispolicies.AppInformation;
import org.openimis.imispolicies.BuildConfig;
import org.openimis.imispolicies.Global;
import org.openimis.imispolicies.util.FileUtils;
import org.openimis.imispolicies.util.ZipUtils;

import java.io.File;
import java.io.FileOutputStream;
Expand Down Expand Up @@ -88,26 +91,30 @@ private static void log(String tag, String msg, int level) {
}
}

public static void zipLogFiles() {
File cacheDir = Global.getContext().getExternalCacheDir();
File[] logFiles = cacheDir.listFiles((dir, filename) -> filename.startsWith(logFilePrefix));
File targetFile = new File(cacheDir, logExportFileName);
public static void zipLogFiles(Context context) {
File cacheDir = Global.getContext().getCacheDir();
File logsDir = new File(cacheDir, "logs");
FileUtils.createDirectoryWithSubdirectories(logsDir);
File[] logFiles = logsDir.listFiles((dir, filename) -> filename.startsWith(logFilePrefix));
File targetFile = new File(logsDir, logExportFileName);

if (logFiles != null) {
ArrayList<File> filesToZip = new ArrayList<>(Arrays.asList(logFiles));
Compressor.zip(filesToZip, targetFile, "");
ZipUtils.zipFiles(filesToZip, targetFile, "");
}

Uri logExportUri = FileProvider.getUriForFile(Global.getContext(),
String.format("%s.fileprovider", BuildConfig.APPLICATION_ID),
targetFile);

Global.getGlobal().sendFile(logExportUri, "application/zip");
Global.getGlobal().sendFile(context, logExportUri, "application/octet-stream");
}

public static void deleteLogFiles() {
File cacheDir = Global.getContext().getExternalCacheDir();
File[] logFiles = cacheDir.listFiles((dir, filename) -> filename.startsWith(logFilePrefix));
File cacheDir = Global.getContext().getCacheDir();
File logsDir = new File(cacheDir, "logs");
FileUtils.createDirectoryWithSubdirectories(logsDir);
File[] logFiles = logsDir.listFiles((dir, filename) -> filename.startsWith(logFilePrefix));
if (logFiles != null) {
for (File f : logFiles) {
f.delete();
Expand All @@ -129,10 +136,12 @@ private synchronized static void storeLog(String tag, String msg, int level) {

private static void initializeLogFile(Date date) {
if (logFile == null || !logFile.exists()) {
File cacheDir = Global.getContext().getExternalCacheDir();
File cacheDir = Global.getContext().getCacheDir();
File logsDir = new File(cacheDir, "logs");
FileUtils.createDirectoryWithSubdirectories(logsDir);

String filename = String.format("%s%s.txt",logFilePrefix, AppInformation.DateTimeInfo.getDefaultFileDatetimeFormatter().format(date));
logFile = new File(cacheDir, filename);
logFile = new File(logsDir, filename);

try {
if (!logFile.createNewFile())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- default en overridden with en-rCM for bepha builds -->
<resources>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
Expand Down Expand Up @@ -445,4 +444,37 @@
<string name="WaitXSeconds">Wait %1$s seconds</string>
<string name="CnRequestComplete">Control number request finished. If the available CN amount does not increase, please try again in %1$s seconds.</string>
<string name="CnLimitReached">CN limit reached</string>
<string name="NoCNReceived">No control numbers received from the server</string>
<string name="CNThresholdReached">You cannot receive more control numbers for this product</string>
<string name="ExportLogs">Export all logs:</string>
<string name="ExportLogsButton">Export logs</string>
<string name="ConfirmExportLogs">Do you want to export logs?</string>
<string name="ExportLogsCanceled">Export canceled. Export file can be found in external cache directory.</string>
<string name="ClearLogs">Clear all logs:</string>
<string name="ClearLogsButton">Clear logs</string>
<string name="ConfirmClearLogs">Do you want to clear logs?</string>
<string name="Wait">Wait</string>
<string name="Suspend">Suspend</string>
<string name="Enforce">Enforce</string>
<string name="WithoutPolicy">without a policy</string>
<string name="WithoutPremium">without a premium</string>
<string name="HttpResponse">HTTP response: %1$d — %2$s</string>
<string name="EnquireNoPolicies">No policies registered.</string>
<string name="UsedChequeNumber">This cheque number already used</string>
<string name="AbortedChequeNumber">This cheque number was aborted</string>
<string name="DownladChequeDataFail">Could not download cheque numbers data</string>
<string name="EnquirePolicyCovered">Policy Status: Covered</string>
<string name="EnquirePolicyNotCovered">Policy Status: Not Covered</string>
<string name="EnquirePolicyLabel">Policy Status</string>
<string name="NotExistChequeNumber">This cheque number not exist</string>
<string name="PhotoRequired">Please add a picture</string>
<string name="NotFound">Entry does not exist.</string>
<string name="Unauthorized">Authorization failed.</string>
<string name="UnknownError">Unknown Error.</string>
<string name="Forbidden">You are not allowed to take this action.</string>
<string name="LanguageCode">en_CM</string>
<string name="LanguageSettings">Language settings</string>
<string name="CurrentResourceLanguage">Current resource language: %1$s</string>
<string name="SystemLanguageNotSupported">Current system language is not supported. The app will use the default language.</string>
<string name="SupportedLanguages">Supported languages:\n%1$s</string>
</resources>
Loading