Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose rust version in settings and RS #8364

Merged
merged 2 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/dictionaries/bmarty.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions changelog.d/8364.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Expose Rust SDK Version in Help & About page and in Bug Reports
4 changes: 3 additions & 1 deletion library/ui-strings/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions vector/src/main/res/xml/vector_settings_help_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -39,4 +39,4 @@

</im.vector.app.core.preference.VectorPreferenceCategory>

</androidx.preference.PreferenceScreen>
</androidx.preference.PreferenceScreen>