mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 17:35:54 +03:00
Fix false positive on string template suspicious usage.
This commit is contained in:
parent
6089d24409
commit
ea465a1b86
5 changed files with 8 additions and 8 deletions
|
@ -93,7 +93,7 @@ internal class SessionRealmConfigurationFactory @Inject constructor(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
listOf(REALM_NAME, "$REALM_NAME.lock", "$REALM_NAME.note", "$REALM_NAME.management").forEach { file ->
|
listOf(REALM_NAME, "${REALM_NAME}.lock", "${REALM_NAME}.note", "${REALM_NAME}.management").forEach { file ->
|
||||||
try {
|
try {
|
||||||
File(directory, file).deleteRecursively()
|
File(directory, file).deleteRecursively()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|
|
@ -83,7 +83,7 @@ private fun useMediaStoreScreenshotStorage(
|
||||||
screenshotLocation: String,
|
screenshotLocation: String,
|
||||||
bitmap: Bitmap
|
bitmap: Bitmap
|
||||||
) {
|
) {
|
||||||
contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, "$screenshotName.jpeg")
|
contentValues.put(MediaStore.MediaColumns.DISPLAY_NAME, "${screenshotName}.jpeg")
|
||||||
contentValues.put(MediaStore.Images.Media.RELATIVE_PATH, screenshotLocation)
|
contentValues.put(MediaStore.Images.Media.RELATIVE_PATH, screenshotLocation)
|
||||||
val uri: Uri? = contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues)
|
val uri: Uri? = contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues)
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
|
@ -104,7 +104,7 @@ private fun usePublicExternalScreenshotStorage(
|
||||||
if (!directory.exists()) {
|
if (!directory.exists()) {
|
||||||
directory.mkdirs()
|
directory.mkdirs()
|
||||||
}
|
}
|
||||||
val file = File(directory, "$screenshotName.jpeg")
|
val file = File(directory, "${screenshotName}.jpeg")
|
||||||
saveScreenshotToStream(bitmap, FileOutputStream(file))
|
saveScreenshotToStream(bitmap, FileOutputStream(file))
|
||||||
contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues)
|
contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues)
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ fun Fragment.queryExportKeys(userId: String, activityResultLauncher: ActivityRes
|
||||||
selectTxtFileToWrite(
|
selectTxtFileToWrite(
|
||||||
activity = requireActivity(),
|
activity = requireActivity(),
|
||||||
activityResultLauncher = activityResultLauncher,
|
activityResultLauncher = activityResultLauncher,
|
||||||
defaultFileName = "$appName-megolm-export-$userId-$timestamp.txt",
|
defaultFileName = "$appName-megolm-export-$userId-${timestamp}.txt",
|
||||||
chooserHint = getString(R.string.keys_backup_setup_step1_manual_export)
|
chooserHint = getString(R.string.keys_backup_setup_step1_manual_export)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ fun Activity.queryExportKeys(userId: String, activityResultLauncher: ActivityRes
|
||||||
selectTxtFileToWrite(
|
selectTxtFileToWrite(
|
||||||
activity = this,
|
activity = this,
|
||||||
activityResultLauncher = activityResultLauncher,
|
activityResultLauncher = activityResultLauncher,
|
||||||
defaultFileName = "$appName-megolm-export-$userId-$timestamp.txt",
|
defaultFileName = "$appName-megolm-export-$userId-${timestamp}.txt",
|
||||||
chooserHint = getString(R.string.keys_backup_setup_step1_manual_export)
|
chooserHint = getString(R.string.keys_backup_setup_step1_manual_export)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ class KeysBackupSetupStep3Fragment @Inject constructor() : VectorBaseFragment<Fr
|
||||||
selectTxtFileToWrite(
|
selectTxtFileToWrite(
|
||||||
activity = requireActivity(),
|
activity = requireActivity(),
|
||||||
activityResultLauncher = saveRecoveryActivityResultLauncher,
|
activityResultLauncher = saveRecoveryActivityResultLauncher,
|
||||||
defaultFileName = "recovery-key-$userId-$timestamp.txt",
|
defaultFileName = "recovery-key-$userId-${timestamp}.txt",
|
||||||
chooserHint = getString(R.string.save_recovery_key_chooser_hint)
|
chooserHint = getString(R.string.save_recovery_key_chooser_hint)
|
||||||
)
|
)
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
|
|
|
@ -74,7 +74,7 @@ class VectorFileLogger @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i in 0..15) {
|
for (i in 0..15) {
|
||||||
val file = File(cacheDirectory, "elementLogs.$i.txt")
|
val file = File(cacheDirectory, "elementLogs.${i}.txt")
|
||||||
tryOrNull { file.delete() }
|
tryOrNull { file.delete() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ class VectorFileLogger @Inject constructor(
|
||||||
?.flush()
|
?.flush()
|
||||||
?.let { 0 until logRotationCount }
|
?.let { 0 until logRotationCount }
|
||||||
?.mapNotNull { index ->
|
?.mapNotNull { index ->
|
||||||
File(cacheDirectory, "$fileNamePrefix.$index.txt")
|
File(cacheDirectory, "$fileNamePrefix.${index}.txt")
|
||||||
.takeIf { it.exists() }
|
.takeIf { it.exists() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue