Merge pull request #8364 from vector-im/feature/bca/expose_rust_crate_version

Expose rust version in settings and RS
This commit is contained in:
Valere 2023-05-03 12:50:37 +02:00 committed by GitHub
commit 92c37f3bb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 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>

1
changelog.d/8364.misc Normal file
View File

@ -0,0 +1 @@
Expose Rust SDK Version in Help & About page and in Bug Reports

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>