mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 11:26:01 +03:00
Fix warning 1.5: 'toUpperCase(Locale): String' and 'toLowerCase(Locale): String' are deprecated
This commit is contained in:
parent
7a28be941c
commit
c70445a9a1
8 changed files with 9 additions and 9 deletions
|
@ -132,7 +132,7 @@ sealed class MatrixItem(
|
|||
|
||||
dn.substring(startIndex, startIndex + length)
|
||||
}
|
||||
.toUpperCase(Locale.ROOT)
|
||||
.uppercase(Locale.ROOT)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
|
|
@ -345,7 +345,7 @@ internal abstract class SASDefaultVerificationTransaction(
|
|||
}
|
||||
|
||||
protected fun hashUsingAgreedHashMethod(toHash: String): String? {
|
||||
if ("sha256" == accepted?.hash?.toLowerCase(Locale.ROOT)) {
|
||||
if ("sha256" == accepted?.hash?.lowercase(Locale.ROOT)) {
|
||||
val olmUtil = OlmUtility()
|
||||
val hashBytes = olmUtil.sha256(toHash)
|
||||
olmUtil.releaseUtility()
|
||||
|
@ -355,7 +355,7 @@ internal abstract class SASDefaultVerificationTransaction(
|
|||
}
|
||||
|
||||
private fun macUsingAgreedMethod(message: String, info: String): String? {
|
||||
return when (accepted?.messageAuthenticationCode?.toLowerCase(Locale.ROOT)) {
|
||||
return when (accepted?.messageAuthenticationCode?.lowercase(Locale.ROOT)) {
|
||||
SAS_MAC_SHA256_LONGKDF -> getSAS().calculateMacLongKdf(message, info)
|
||||
SAS_MAC_SHA256 -> getSAS().calculateMac(message, info)
|
||||
else -> null
|
||||
|
|
|
@ -117,7 +117,7 @@ internal class DefaultIdentityBulkLookupTask @Inject constructor(
|
|||
return withOlmUtility { olmUtility ->
|
||||
threePids.map { threePid ->
|
||||
base64ToBase64Url(
|
||||
olmUtility.sha256(threePid.value.toLowerCase(Locale.ROOT)
|
||||
olmUtility.sha256(threePid.value.lowercase(Locale.ROOT)
|
||||
+ " " + threePid.toMedium() + " " + pepper)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ fun String.md5() = try {
|
|||
digest.update(toByteArray())
|
||||
digest.digest()
|
||||
.joinToString("") { String.format("%02X", it) }
|
||||
.toLowerCase(Locale.ROOT)
|
||||
.lowercase(Locale.ROOT)
|
||||
} catch (exc: Exception) {
|
||||
// Should not happen, but just in case
|
||||
hashCode().toString()
|
||||
|
|
|
@ -45,7 +45,7 @@ fun getMimeTypeFromUri(context: Context, uri: Uri): String? {
|
|||
|
||||
if (null != mimeType) {
|
||||
// the mimetype is sometimes in uppercase.
|
||||
mimeType = mimeType.toLowerCase(Locale.ROOT)
|
||||
mimeType = mimeType.lowercase(Locale.ROOT)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Timber.e(e, "Failed to open resource input stream")
|
||||
|
|
|
@ -112,7 +112,7 @@ fun getFileExtension(fileUri: String): String? {
|
|||
val ext = filename.substring(dotPos + 1)
|
||||
|
||||
if (ext.isNotBlank()) {
|
||||
return ext.toLowerCase(Locale.ROOT)
|
||||
return ext.lowercase(Locale.ROOT)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -449,7 +449,7 @@ class RoomDetailViewModel @AssistedInject constructor(
|
|||
widgetSessionId = widgetSessionId.substring(0, 7)
|
||||
}
|
||||
val roomId: String = room.roomId
|
||||
val confId = roomId.substring(1, roomId.indexOf(":") - 1) + widgetSessionId.toLowerCase(VectorLocale.applicationLocale)
|
||||
val confId = roomId.substring(1, roomId.indexOf(":") - 1) + widgetSessionId.lowercase(VectorLocale.applicationLocale)
|
||||
|
||||
val preferredJitsiDomain = tryOrNull {
|
||||
rawService.getElementWellknown(session.myUserId)
|
||||
|
|
|
@ -181,7 +181,7 @@ object VectorLocale {
|
|||
}
|
||||
}
|
||||
// sort by human display names
|
||||
.sortedBy { localeToLocalisedString(it).toLowerCase(it) }
|
||||
.sortedBy { localeToLocalisedString(it).lowercase(it) }
|
||||
|
||||
supportedLocales.clear()
|
||||
supportedLocales.addAll(list)
|
||||
|
|
Loading…
Reference in a new issue