Expose rust version in settings and RS

This commit is contained in:
valere 2023-04-25 13:31:15 +02:00
parent 46a49d899c
commit 3705e14851
6 changed files with 13 additions and 9 deletions

View file

@ -44,6 +44,7 @@
<w>unpublish</w>
<w>unwedging</w>
<w>vctr</w>
<w>vodozemac</w>
<w>wellknown</w>
</words>
</dictionary>

View file

@ -1002,7 +1002,9 @@
</plurals>
<string name="settings_version">Version</string>
<string name="settings_olm_version">olm version</string>
<!-- TODO TO BE REMOVED -->
<string tools:ignore="UnusedResources" name="settings_olm_version">olm version</string>
<string name="settings_crypto_version">Crypto version</string>
<string name="settings_app_term_conditions">Terms &amp; conditions</string>
<string name="settings_acceptable_use_policy">Acceptable Use Policy</string>
<string name="settings_third_party_notices">Third party notices</string>

View file

@ -184,8 +184,9 @@ internal class RustCryptoService @Inject constructor(
}
override fun getCryptoVersion(context: Context, longFormat: Boolean): String {
// TODO we should provide olm and rust-sdk version from the rust-sdk
return if (longFormat) "Rust SDK 0.3" else "0.3"
val version = org.matrix.rustcomponents.sdk.crypto.version()
val vodozemac = org.matrix.rustcomponents.sdk.crypto.vodozemacVersion()
return if (longFormat) "Rust SDK $version, Vodozemac $vodozemac" else version
}
override fun getMyCryptoDevice(): CryptoDeviceInfo {

View file

@ -52,7 +52,7 @@ class VectorPreferences @Inject constructor(
const val SETTINGS_CHANGE_PASSWORD_PREFERENCE_KEY = "SETTINGS_CHANGE_PASSWORD_PREFERENCE_KEY"
const val SETTINGS_VERSION_PREFERENCE_KEY = "SETTINGS_VERSION_PREFERENCE_KEY"
const val SETTINGS_SDK_VERSION_PREFERENCE_KEY = "SETTINGS_SDK_VERSION_PREFERENCE_KEY"
const val SETTINGS_OLM_VERSION_PREFERENCE_KEY = "SETTINGS_OLM_VERSION_PREFERENCE_KEY"
const val SETTINGS_CRYPTO_VERSION_PREFERENCE_KEY = "SETTINGS_CRYPTO_VERSION_PREFERENCE_KEY"
const val SETTINGS_LOGGED_IN_PREFERENCE_KEY = "SETTINGS_LOGGED_IN_PREFERENCE_KEY"
const val SETTINGS_HOME_SERVER_PREFERENCE_KEY = "SETTINGS_HOME_SERVER_PREFERENCE_KEY"
const val SETTINGS_IDENTITY_SERVER_PREFERENCE_KEY = "SETTINGS_IDENTITY_SERVER_PREFERENCE_KEY"

View file

@ -95,8 +95,8 @@ class VectorSettingsHelpAboutFragment :
}
// olm version
findPreference<VectorPreference>(VectorPreferences.SETTINGS_OLM_VERSION_PREFERENCE_KEY)!!
.summary = session.cryptoService().getCryptoVersion(requireContext(), false)
findPreference<VectorPreference>(VectorPreferences.SETTINGS_CRYPTO_VERSION_PREFERENCE_KEY)!!
.summary = session.cryptoService().getCryptoVersion(requireContext(), true)
}
companion object {

View file

@ -24,8 +24,8 @@
tools:summary="4.5.6" />
<im.vector.app.core.preference.VectorPreference
android:key="SETTINGS_OLM_VERSION_PREFERENCE_KEY"
android:title="@string/settings_olm_version"
android:key="SETTINGS_CRYPTO_VERSION_PREFERENCE_KEY"
android:title="@string/settings_crypto_version"
tools:summary="7.8.9" />
</im.vector.app.core.preference.VectorPreferenceCategory>