Compare commits
18 Commits
dev-server
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c0d5bc76e | ||
|
|
a82f72ac38 | ||
|
|
7779f362af | ||
|
|
07c778b0cc | ||
|
|
bb2fc0eb8f | ||
|
|
d1a6231716 | ||
|
|
35614e082f | ||
|
|
2637f84cac | ||
|
|
f5dc2f425b | ||
|
|
daf6dc81d4 | ||
|
|
9ed666e6e6 | ||
|
|
21b19188e5 | ||
|
|
04cf366042 | ||
|
|
b81666dffd | ||
|
|
63891fdade | ||
|
|
1400f71d61 | ||
|
|
70ba5077d6 | ||
|
|
179752b0b0 |
107
.gitlab-ci.yml
107
.gitlab-ci.yml
@@ -1,63 +1,31 @@
|
||||
# This file is a template, and might need editing before it works on your project.
|
||||
# To contribute improvements to CI/CD templates, please follow the Development guide at:
|
||||
# https://docs.gitlab.com/ee/development/cicd/templates.html
|
||||
# This specific template is located at:
|
||||
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Android.gitlab-ci.yml
|
||||
|
||||
# Read more about this script on this blog post https://about.gitlab.com/2018/10/24/setting-up-gitlab-ci-for-android-projects/, by Jason Lenny
|
||||
# If you are interested in using Android with FastLane for publishing take a look at the Android-Fastlane template.
|
||||
|
||||
image: eclipse-temurin:17-jdk-jammy
|
||||
|
||||
variables:
|
||||
|
||||
# ANDROID_COMPILE_SDK is the version of Android you're compiling with.
|
||||
# It should match compileSdkVersion.
|
||||
ANDROID_COMPILE_SDK: "34"
|
||||
|
||||
# ANDROID_BUILD_TOOLS is the version of the Android build tools you are using.
|
||||
# It should match buildToolsVersion.
|
||||
ANDROID_BUILD_TOOLS: "33.0.2"
|
||||
|
||||
# It's what version of the command line tools we're going to download from the official site.
|
||||
# Official Site-> https://developer.android.com/studio/index.html
|
||||
# There, look down below at the cli tools only, sdk tools package is of format:
|
||||
# commandlinetools-os_type-ANDROID_SDK_TOOLS_latest.zip
|
||||
# when the script was last modified for latest compileSdkVersion, it was which is written down below
|
||||
ANDROID_SDK_TOOLS: "9477386"
|
||||
|
||||
# Keystore credentials stored as GitLab CI/CD variables
|
||||
KEYSTORE_PASSWORD: $KS_PASSWORD
|
||||
KEY_ALIAS: $KS_ALIAS
|
||||
KEY_PASSWORD: $KS_KEY_PASSWORD
|
||||
|
||||
# Packages installation before running script
|
||||
before_script:
|
||||
- apt-get --quiet update --yes
|
||||
- apt-get --quiet install --yes wget unzip
|
||||
|
||||
# Setup path as android_home for moving/exporting the downloaded sdk into it
|
||||
- export ANDROID_HOME="${PWD}/android-sdk-root"
|
||||
# Create a new directory at specified location
|
||||
- install -d $ANDROID_HOME
|
||||
# Here we are installing androidSDK tools from official source,
|
||||
# (the key thing here is the url from where you are downloading these sdk tool for command line, so please do note this url pattern there and here as well)
|
||||
# after that unzipping those tools and
|
||||
# then running a series of SDK manager commands to install necessary android SDK packages that'll allow the app to build
|
||||
- wget --no-verbose --output-document=$ANDROID_HOME/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}_latest.zip
|
||||
- unzip -q -d "$ANDROID_HOME/cmdline-tools" "$ANDROID_HOME/cmdline-tools.zip"
|
||||
- mv -T "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/tools"
|
||||
- export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/cmdline-tools/tools/bin
|
||||
|
||||
# Nothing fancy here, just checking sdkManager version
|
||||
- sdkmanager --version
|
||||
|
||||
# use yes to accept all licenses
|
||||
- yes | sdkmanager --licenses > /dev/null || true
|
||||
- sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}"
|
||||
- sdkmanager "platform-tools"
|
||||
- sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}"
|
||||
|
||||
# Not necessary, but just for surity
|
||||
- chmod +x ./gradlew
|
||||
|
||||
# Basic android and gradle stuff
|
||||
# Check linting
|
||||
lintDebug:
|
||||
interruptible: true
|
||||
stage: build
|
||||
@@ -69,7 +37,6 @@ lintDebug:
|
||||
expose_as: "lint-report"
|
||||
when: always
|
||||
|
||||
# Make Project
|
||||
assembleDebug:
|
||||
interruptible: true
|
||||
stage: build
|
||||
@@ -78,8 +45,68 @@ assembleDebug:
|
||||
artifacts:
|
||||
paths:
|
||||
- app/build/outputs/
|
||||
|
||||
# Job for building signed release APK for tags containing "release" on any branch
|
||||
assembleRelease:
|
||||
stage: build
|
||||
script:
|
||||
- |
|
||||
if [[ "$CI_COMMIT_TAG" =~ release ]]; then
|
||||
echo "Decoding keystore file from Base64"
|
||||
|
||||
# Debug: Print the first few characters of BASE64_KEYSTORE
|
||||
echo "First 20 characters of BASE64_KEYSTORE: ${BASE64_KEYSTORE:0:20}..."
|
||||
|
||||
# Check if BASE64_KEYSTORE is a file path
|
||||
if [[ "$BASE64_KEYSTORE" == /* ]] && [[ -f "$BASE64_KEYSTORE" ]]; then
|
||||
echo "BASE64_KEYSTORE appears to be a file path. Reading content..."
|
||||
BASE64_CONTENT=$(cat "$BASE64_KEYSTORE")
|
||||
else
|
||||
echo "BASE64_KEYSTORE is not a file path. Using as-is."
|
||||
BASE64_CONTENT="$BASE64_KEYSTORE"
|
||||
fi
|
||||
|
||||
# Remove any potential whitespace or newline characters
|
||||
CLEANED_KEYSTORE=$(echo "$BASE64_CONTENT" | tr -d '[:space:]')
|
||||
|
||||
# Attempt to decode and save to a file
|
||||
if echo "$CLEANED_KEYSTORE" | base64 -d > "$CI_PROJECT_DIR/app/keystore.jks" 2>/tmp/base64_error; then
|
||||
echo "Keystore file decoded successfully"
|
||||
else
|
||||
echo "Error decoding keystore file:"
|
||||
cat /tmp/base64_error
|
||||
echo "First 20 characters of cleaned content: ${CLEANED_KEYSTORE:0:20}..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the keystore file was created and has content
|
||||
if [ -s "$CI_PROJECT_DIR/app/keystore.jks" ]; then
|
||||
echo "Keystore file created successfully"
|
||||
# Print file size for verification
|
||||
ls -l "$CI_PROJECT_DIR/app/keystore.jks"
|
||||
else
|
||||
echo "Error: Keystore file is empty or not created"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building signed release APK"
|
||||
./gradlew assembleRelease \
|
||||
-Pandroid.injected.signing.store.file="$CI_PROJECT_DIR/app/keystore.jks" \
|
||||
-Pandroid.injected.signing.store.password="$KEYSTORE_PASSWORD" \
|
||||
-Pandroid.injected.signing.key.alias="$KEY_ALIAS" \
|
||||
-Pandroid.injected.signing.key.password="$KEY_PASSWORD"
|
||||
else
|
||||
echo "Tag '$CI_COMMIT_TAG' does not contain 'release'. Skipping release build."
|
||||
fi
|
||||
artifacts:
|
||||
paths:
|
||||
- app/build/outputs/
|
||||
expire_in: never
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG =~ /release/
|
||||
when: always
|
||||
- when: never
|
||||
|
||||
# Run all tests, if any fails, interrupt the pipeline(fail it)
|
||||
debugTests:
|
||||
needs: [lintDebug, assembleDebug]
|
||||
interruptible: true
|
||||
@@ -98,4 +125,4 @@ publishTestResults:
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
junit: app/build/test-results/testDebugUnitTest/*.xml
|
||||
junit: app/build/test-results/testDebugUnitTest/*.xml
|
||||
@@ -19,8 +19,8 @@ android {
|
||||
applicationId "in.sminnovations.hpostesting.dev"
|
||||
minSdk 21
|
||||
targetSdk 34
|
||||
versionCode 127
|
||||
versionName "2.1.127"
|
||||
versionCode 128
|
||||
versionName "2.1.128"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 127,
|
||||
"versionName": "2.1.127",
|
||||
"versionCode": 128,
|
||||
"versionName": "2.1.128",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -28,7 +28,7 @@ object Constants {
|
||||
const val DOCUMENT_ID_FOR_UPDATE ="2o71vBKLqdgEKYtFG8Lb"
|
||||
const val ABHA_APP_PACKAGE = "in.ndhm.phr"
|
||||
|
||||
const val MOLBIO_INTEGRATION = true
|
||||
const val MOLBIO_INTEGRATION = false
|
||||
const val FIREBASE_INTEGRATION = true
|
||||
const val deviceProvisionEmail = "HPOS_provisioner@bigtec.co.in"
|
||||
const val deviceProvisionPassword = "f2ab0e7f9d69"
|
||||
|
||||
@@ -35,6 +35,8 @@ enum class TestStatus(val code: Double) {
|
||||
BUFFER_PRINT_STARTED(6.0),
|
||||
BUFFER_PRINT_COMPLETED(7.0),
|
||||
SAMPLE_STARTED(8.0),
|
||||
CUVETTE_ABSENTT(30.2),
|
||||
CUVETTE_PRESENTT(30.1),
|
||||
SAMPLE_COMPLETED(9.0),
|
||||
SAMPLE_PRINT_STARTED(10.0),
|
||||
SAMPLE_PRINT_COMPLETED(11.0),
|
||||
|
||||
@@ -58,7 +58,7 @@ class ActivitiesFragment : Fragment() {
|
||||
|
||||
if (userData.isNotEmpty()) {
|
||||
userData.forEach { user ->
|
||||
if(isBetween15And30Minutes(user.incubationTime) > 30 && user.testStatus == false){
|
||||
if((isBetween15And30Minutes(user.incubationTime) > 30 || isBetween15And30Minutes(user.incubationTime) < 0) && user.testStatus == false){
|
||||
hemoCubeViewModel.deleteByStatus()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -862,7 +862,8 @@ class HomeFragment : Fragment() {
|
||||
// )
|
||||
Toast.makeText(requireContext(), "Successfully added- $userId", Toast.LENGTH_SHORT).show()
|
||||
binding.userId.setText("")
|
||||
binding.etBloodGroup.clearListSelection()
|
||||
binding.age.setText("")
|
||||
binding.etBloodGroup.setText("")
|
||||
// val userData = UserData(_id = userId)
|
||||
// DataHolder.selectedTest = userData
|
||||
// findNavController().navigate(R.id.action_nav_home_to_mainActivity)
|
||||
|
||||
@@ -134,7 +134,7 @@ class PrefsFragment: PreferenceFragmentCompat(){
|
||||
|
||||
// App Version Preference
|
||||
val appVersionPreference = Preference(requireContext())
|
||||
appVersionPreference.title = "App Version"
|
||||
appVersionPreference.title = "App Version SMI"
|
||||
appVersionPreference.summary =
|
||||
getAppVersion(requireContext()) + " [ " + getAppEnvironment(requireContext()) + " ]"
|
||||
|
||||
|
||||
@@ -117,10 +117,13 @@ class HBTestFragment : Fragment() {
|
||||
testDetails.testTime = SimpleDateFormat(
|
||||
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||
).format(Calendar.getInstance().time)
|
||||
//Toast.makeText(requireContext(), "deviceID"+deviceId, Toast.LENGTH_LONG).show()
|
||||
hBTestViewModel.uploadFirebaseQc(testDetails)
|
||||
}
|
||||
binding.btnBuffer.setOnClickListener {
|
||||
binding.btnBuffer.visibility = View.GONE
|
||||
binding.btnSample.isEnabled = false
|
||||
binding.btnSample.isClickable = false
|
||||
hBTestViewModel.messages.postValue("Buffer Started")
|
||||
runBCommand()
|
||||
}
|
||||
@@ -174,7 +177,6 @@ class HBTestFragment : Fragment() {
|
||||
override fun onUsbRead(data: ByteArray?) {
|
||||
data?.let {
|
||||
val stringData = String(it)
|
||||
deviceId = stringData
|
||||
hBTestViewModel.messages.postValue(stringData)
|
||||
binding.tvSubtitle4.text = stringData
|
||||
}
|
||||
@@ -224,7 +226,12 @@ class HBTestFragment : Fragment() {
|
||||
}
|
||||
})
|
||||
}
|
||||
fun extractV2HardwareId(input: String): String? {
|
||||
val pattern = Regex("SNS\\s*(.*?)\\s*SNE")
|
||||
val matchResult: MatchResult? = pattern.find(input)
|
||||
|
||||
return matchResult?.groups?.get(1)?.value
|
||||
}
|
||||
private fun listenToHemoCube() {
|
||||
|
||||
val fullReadOutput = StringBuilder()
|
||||
@@ -240,10 +247,10 @@ class HBTestFragment : Fragment() {
|
||||
resultData += stringData
|
||||
hBTestViewModel.messages.postValue(resultData)
|
||||
// binding.tvSubtitle4.text = resultData
|
||||
if (stringData.contains("SN")) {
|
||||
if (stringData.contains("SNE")) {
|
||||
val slData = stringData.split(" ")
|
||||
if (slData.size > 1) {
|
||||
val hardwareId = slData[1].trim()
|
||||
deviceId = extractV2HardwareId(resultData).toString()
|
||||
hBTestViewModel.messages.postValue("Place buffer and click below button to start test")
|
||||
// with(sharedPreferences.edit()) {
|
||||
// putString(Constants.DEVICE_ID, hardwareId)
|
||||
|
||||
@@ -87,6 +87,8 @@ class HemoCubeFragment : Fragment() {
|
||||
private var checkCuvette = false
|
||||
private var checkRefreshCuvette = false
|
||||
private var checkCuvetteSam = false
|
||||
private var checkSubmit = false
|
||||
private var submitClick = false
|
||||
private var sampleClick = false
|
||||
private var refreshClick = false
|
||||
private lateinit var binding: FragmentHemoCubeReferenceBinding
|
||||
@@ -182,23 +184,31 @@ class HemoCubeFragment : Fragment() {
|
||||
binding.tvSubtitle4.movementMethod = ScrollingMovementMethod()
|
||||
binding.tvDeviceMessages.movementMethod = ScrollingMovementMethod()
|
||||
binding.btnSubmit.setOnClickListener {
|
||||
with(sharedPreferences.edit()) {
|
||||
putBoolean(Constants.QUICK_CAPTURE, false)
|
||||
apply()
|
||||
submitClick = true
|
||||
if(checkSubmit){
|
||||
with(sharedPreferences.edit()) {
|
||||
putBoolean(Constants.QUICK_CAPTURE, false)
|
||||
apply()
|
||||
}
|
||||
if(DataHolder.hemoCubeTestData!!.classificationResult != "Invalid"){
|
||||
DataHolder.sampleReadCounter++
|
||||
}
|
||||
binding.btnSubmit.isEnabled = false
|
||||
binding.btnSubmit.isClickable = false
|
||||
activity?.runOnUiThread {
|
||||
Log.d("HemoCubeFragment","Test Process completed, result saved")
|
||||
binding.progressBar.visibility = View.VISIBLE
|
||||
binding.btnSubmit.visibility = View.GONE
|
||||
}
|
||||
hemoCubeViewModel.uploadHemoCubeResultToDatabase(
|
||||
isOnline, true, sharedPreferences.getString(Constants.KIT_NUMBER, ""),quickCapture
|
||||
)
|
||||
}else{
|
||||
checkCuvettePresence()
|
||||
binding.btnSubmit.isEnabled = true
|
||||
binding.btnSubmit.isClickable = true
|
||||
}
|
||||
if(DataHolder.hemoCubeTestData!!.classificationResult != "Invalid"){
|
||||
DataHolder.sampleReadCounter++
|
||||
}
|
||||
binding.btnSubmit.isEnabled = false
|
||||
binding.btnSubmit.isClickable = false
|
||||
activity?.runOnUiThread {
|
||||
Log.d("HemoCubeFragment","Test Process completed, result saved")
|
||||
binding.progressBar.visibility = View.VISIBLE
|
||||
binding.btnSubmit.visibility = View.GONE
|
||||
}
|
||||
hemoCubeViewModel.uploadHemoCubeResultToDatabase(
|
||||
isOnline, true, sharedPreferences.getString(Constants.KIT_NUMBER, ""),quickCapture
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
binding.tvTitle2.visibility = View.GONE
|
||||
@@ -664,6 +674,21 @@ class HemoCubeFragment : Fragment() {
|
||||
}
|
||||
showRetryButtonForCuvette()
|
||||
}
|
||||
resultData.contains("#CIN") && this.submitClick && this.testStatusCode < TestStatus.CUVETTE_PRESENTT.code -> {
|
||||
hemoCubeViewModel.messages.postValue(getString(R.string.cuvette_presentt))
|
||||
this.testStatusCode = TestStatus.CUVETTE_PRESENTT.code
|
||||
activity?.runOnUiThread {
|
||||
binding.testing.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
resultData.contains("#AIN") && this.submitClick && this.testStatusCode <= TestStatus.CUVETTE_ABSENTT.code -> {
|
||||
hemoCubeViewModel.messages.postValue(getString(R.string.cuvette_absentt))
|
||||
this.testStatusCode = TestStatus.CUVETTE_ABSENTT.code
|
||||
activity?.runOnUiThread {
|
||||
checkSubmit = true
|
||||
binding.testing.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
resultData.contains("#BS") && this.testStatusCode < TestStatus.BUFFER_STARTED.code -> {
|
||||
hemoCubeViewModel.messages.postValue(getString(R.string.buffer_started))
|
||||
this.testStatusCode = TestStatus.BUFFER_STARTED.code
|
||||
@@ -735,6 +760,7 @@ class HemoCubeFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(resultData.contains("#SC") || resultData.contains("#SC1")) && this.testStatusCode < TestStatus.SAMPLE_COMPLETED.code -> {
|
||||
this.testStatusCode = TestStatus.SAMPLE_COMPLETED.code
|
||||
activity?.runOnUiThread {
|
||||
@@ -748,6 +774,7 @@ class HemoCubeFragment : Fragment() {
|
||||
fetchResult()
|
||||
}
|
||||
|
||||
|
||||
resultData.contains("ovf") -> {
|
||||
activity?.runOnUiThread {
|
||||
binding.testing.visibility = View.GONE
|
||||
@@ -1354,7 +1381,7 @@ class HemoCubeFragment : Fragment() {
|
||||
"%.3f".format(
|
||||
borderlineMetric
|
||||
)
|
||||
}"
|
||||
} \n Remove Cuvette & Click Submit"
|
||||
)
|
||||
if (DataHolder.hemoCubeTestData?.testType == "HB")
|
||||
hemoCubeViewModel.messages.postValue("Hb: $calculatedHb4")
|
||||
@@ -1446,6 +1473,24 @@ class HemoCubeFragment : Fragment() {
|
||||
return "Positive for Sickle Cell. Confirm with HPLC"
|
||||
}
|
||||
}
|
||||
// if (deviceRatioClass == "Negative Borderline") {
|
||||
// if (borderlineMetric < negativeBoderLine10mm1){//1.34
|
||||
// return "Sickle Cell Trait"
|
||||
// }else if(borderlineMetric > negativeBoderLine10mm1){
|
||||
// return "Normal"
|
||||
// }else if(borderlineMetric == negativeBoderLine10mm1){
|
||||
// return "Sickle Cell Trait"
|
||||
// }
|
||||
// }
|
||||
// if (deviceRatioClass == "Positive for Sickle Cell. HPLC for Confirmation") {
|
||||
// if (borderlineMetric < positiveBoderLine10mm1){//1.34
|
||||
// return "Sickle Cell Disease"
|
||||
// }else if(borderlineMetric > positiveBoderLine10mm1){
|
||||
// return "Sickle Cell Trait"
|
||||
// }else if(borderlineMetric == positiveBoderLine10mm1){
|
||||
// return "Sickle Cell Disease"
|
||||
// }
|
||||
// }
|
||||
}else if(cuvetteSize == "2mm"){
|
||||
if (deviceRatioClass == "Negative Borderline") {
|
||||
if (borderlineMetric < negativeBoderLine2mm1){//1.34
|
||||
|
||||
@@ -289,6 +289,8 @@
|
||||
<string name="check_cuvette">Checking cuvette presence</string>
|
||||
<string name="cuvette_present">Cuvette present</string>
|
||||
<string name="cuvette_absent">Cuvette absent</string>
|
||||
<string name="cuvette_presentt">Cuvette Present , Please Remove Cuvette And Try Again</string>
|
||||
<string name="cuvette_absentt">Cuvette Absent,Now You Can Submit</string>
|
||||
<string name="retry">Retry</string>
|
||||
<string name="Firefox">Firefox</string>
|
||||
<string name="Files">Files</string>
|
||||
|
||||
@@ -288,6 +288,8 @@
|
||||
<string name="check_cuvette">ಕುವೆಟ್ ಇರುವಿಕೆಯನ್ನು ಪರಿಶೀಲಿಸಲಾಗುತ್ತಿದೆ</string>
|
||||
<string name="cuvette_present">ಕುವೆಟ್ಟೆ ಇರುತ್ತದೆ</string>
|
||||
<string name="cuvette_absent">ಕುವೆಟ್ಟೆ ಇರುವುದಿಲ್ಲ </string>
|
||||
<string name="cuvette_presentt">Cuvette Present , Please Remove Cuvette And Try Again</string>
|
||||
<string name="cuvette_absentt">Cuvette Absent,Now You Can Submit</string>
|
||||
<string name="retry">ಮರುಪ್ರಯತ್ನಿಸಿ</string>
|
||||
<string name="Firefox">ಫೈರ್ಫಾಕ್ಸ್</string>
|
||||
<string name="Files">ಫೈಲ್</string>
|
||||
|
||||
@@ -291,6 +291,8 @@
|
||||
<string name="check_cuvette">Checking cuvette presence</string>
|
||||
<string name="cuvette_present">Cuvette present , you can start the test</string>
|
||||
<string name="cuvette_absent">Cuvette is absent , please place the cuvette and retry again</string>
|
||||
<string name="cuvette_presentt">Cuvette Present , Please Remove Cuvette And Try Again</string>
|
||||
<string name="cuvette_absentt">Cuvette Absent,Now You Can Submit</string>
|
||||
<string name="retry">Retry again</string>
|
||||
<string name="usb_terminal">Usb Terminal</string>
|
||||
<string name="menu_about">About</string>
|
||||
|
||||
3768
hs_err_pid3592.log
Normal file
3768
hs_err_pid3592.log
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user