Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -377,11 +377,11 @@ class HomeFragment : Fragment() {
|
||||
val encryptedString = file.readText()
|
||||
val encryptionKey =
|
||||
Settings.Secure.getString(context?.contentResolver, Settings.Secure.ANDROID_ID)
|
||||
// val decryptedMessage: String = Encryption.decrypt(encryptedString, encryptionKey)
|
||||
// val credentials = decryptedMessage.split("\n")
|
||||
// userID = credentials[0]
|
||||
// password = credentials[1]
|
||||
// Toast.makeText(context, "DECRYPTED: $credentials", Toast.LENGTH_SHORT).show()
|
||||
val decryptedMessage: String = Encryption.decrypt(encryptedString, encryptionKey)
|
||||
val credentials = decryptedMessage.split("\n")
|
||||
userID = credentials[0]
|
||||
password = credentials[1]
|
||||
Toast.makeText(context, "DECRYPTED: $credentials", Toast.LENGTH_SHORT).show()
|
||||
if (!isTokenAvailable) {
|
||||
hemoCubeViewModel.login(createLoginRequestData(userID, password))
|
||||
}
|
||||
|
||||
@@ -423,7 +423,10 @@ class HemoCubeViewModel @Inject constructor(
|
||||
testDetails!!.reportUploadTime = SimpleDateFormat(
|
||||
"yyyy-MM-dd HH:mm:ss", Locale.getDefault()
|
||||
).format(Calendar.getInstance().time)
|
||||
|
||||
val currentTimeFormatted = SimpleDateFormat(
|
||||
"yyyy-MM-dd'T'HH:mm:ssZZZZZ",
|
||||
Locale.getDefault()
|
||||
).format(Calendar.getInstance().time)
|
||||
when (val response = repository.addTestToDatabase(testDetails)) {
|
||||
is Response.Success -> {
|
||||
val kitCount = sharedPreference.getInt(Constants.KIT_COUNT, 0)
|
||||
@@ -445,14 +448,14 @@ class HemoCubeViewModel @Inject constructor(
|
||||
MolbioV2Result(
|
||||
rawData = sanitizedTestDetails,
|
||||
analysisId = sanitizedTestDetails._id,
|
||||
analysisDate = sanitizedTestDetails.testTime,
|
||||
analysisDate = currentTimeFormatted,
|
||||
analysisStatus = sanitizedTestDetails.classificationResult,
|
||||
thresholds = Constants.BUFFER_INTENSITY_THRESHOLDS[sanitizedTestDetails.deviceId]?.toString(),
|
||||
interpretation = sanitizedTestDetails.classificationResult,
|
||||
testId = sanitizedTestDetails._id,
|
||||
testTime = sanitizedTestDetails.testTime,
|
||||
collectionTime = sanitizedTestDetails.testTime,
|
||||
expiryTime = sanitizedTestDetails.testTime,
|
||||
testTime = currentTimeFormatted,
|
||||
collectionTime = currentTimeFormatted,
|
||||
expiryTime = currentTimeFormatted,
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user