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>unpublish</w>
<w>unwedging</w> <w>unwedging</w>
<w>vctr</w> <w>vctr</w>
<w>vodozemac</w>
<w>wellknown</w> <w>wellknown</w>
</words> </words>
</dictionary> </dictionary>

View file

@ -1002,7 +1002,9 @@
</plurals> </plurals>
<string name="settings_version">Version</string> <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_app_term_conditions">Terms &amp; conditions</string>
<string name="settings_acceptable_use_policy">Acceptable Use Policy</string> <string name="settings_acceptable_use_policy">Acceptable Use Policy</string>
<string name="settings_third_party_notices">Third party notices</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 { override fun getCryptoVersion(context: Context, longFormat: Boolean): String {
// TODO we should provide olm and rust-sdk version from the rust-sdk val version = org.matrix.rustcomponents.sdk.crypto.version()
return if (longFormat) "Rust SDK 0.3" else "0.3" val vodozemac = org.matrix.rustcomponents.sdk.crypto.vodozemacVersion()
return if (longFormat) "Rust SDK $version, Vodozemac $vodozemac" else version
} }
override fun getMyCryptoDevice(): CryptoDeviceInfo { 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_CHANGE_PASSWORD_PREFERENCE_KEY = "SETTINGS_CHANGE_PASSWORD_PREFERENCE_KEY"
const val SETTINGS_VERSION_PREFERENCE_KEY = "SETTINGS_VERSION_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_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_LOGGED_IN_PREFERENCE_KEY = "SETTINGS_LOGGED_IN_PREFERENCE_KEY"
const val SETTINGS_HOME_SERVER_PREFERENCE_KEY = "SETTINGS_HOME_SERVER_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" const val SETTINGS_IDENTITY_SERVER_PREFERENCE_KEY = "SETTINGS_IDENTITY_SERVER_PREFERENCE_KEY"

View file

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

View file

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