diff --git a/app/src/main/java/io/heckel/ntfy/ui/TrustedCertificateFragment.kt b/app/src/main/java/io/heckel/ntfy/ui/TrustedCertificateFragment.kt index 53be0e84..ac2bdeec 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/TrustedCertificateFragment.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/TrustedCertificateFragment.kt @@ -62,6 +62,7 @@ class TrustedCertificateFragment : DialogFragment() { // Page 2 views private lateinit var page2Layout: LinearLayout + private lateinit var securityWarningLayout: LinearLayout private lateinit var descriptionText: TextView private lateinit var warningText: TextView private lateinit var baseUrlValueLabel: TextView @@ -174,6 +175,7 @@ class TrustedCertificateFragment : DialogFragment() { // Page 2 views page2Layout = view.findViewById(R.id.trusted_certificate_page2) + securityWarningLayout = view.findViewById(R.id.trusted_certificate_security_warning) descriptionText = view.findViewById(R.id.trusted_certificate_description) warningText = view.findViewById(R.id.trusted_certificate_warning) baseUrlValueLabel = view.findViewById(R.id.trusted_certificate_base_url_value_label) @@ -196,7 +198,7 @@ class TrustedCertificateFragment : DialogFragment() { } private fun setupUnknownMode() { - // Go directly to page 2 with details + // Go directly to page 2 with details and security warning toolbar.setTitle(R.string.trusted_certificate_dialog_title_unknown) toolbar.setNavigationIcon(R.drawable.ic_close_white_24dp) page1Layout.isVisible = false @@ -205,8 +207,9 @@ class TrustedCertificateFragment : DialogFragment() { trustMenuItem.isVisible = true deleteMenuItem.isVisible = false - descriptionText.setText(R.string.trusted_certificate_dialog_description_unknown) - descriptionText.isVisible = true + // Show security warning banner instead of description + securityWarningLayout.isVisible = true + descriptionText.isVisible = false baseUrlValueLabel.isVisible = true baseUrlValueText.isVisible = true baseUrlValueText.text = baseUrl diff --git a/app/src/main/res/drawable/ic_warning_amber_24dp.xml b/app/src/main/res/drawable/ic_warning_amber_24dp.xml new file mode 100644 index 00000000..d35dd04b --- /dev/null +++ b/app/src/main/res/drawable/ic_warning_amber_24dp.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/layout/fragment_trusted_certificate_dialog.xml b/app/src/main/res/layout/fragment_trusted_certificate_dialog.xml index 5dc0e3c8..f4e7088f 100644 --- a/app/src/main/res/layout/fragment_trusted_certificate_dialog.xml +++ b/app/src/main/res/layout/fragment_trusted_certificate_dialog.xml @@ -96,7 +96,50 @@ android:orientation="vertical" android:visibility="gone"> - + + + + + + + + + + + + %1$s, expires %2$s %1$s, expired Add a trusted certificate - Import a certificate into the trust store (PEM). HTTPS and WebSocket connections will trust this certificate. + Import a certificate into the trust store (PEM). When connecting to the specified ntfy server, this certificate will be trusted. Client certificates (mTLS) Client certificate, issued by %1$s\nExpires %2$s, used by %3$s Client certificate, issued by %1$s\nExpired, used by %2$s @@ -501,11 +501,12 @@ Certificate details - Unknown certificate + Security warning Add trusted certificate The server\'s certificate could not be verified. Review the details below before trusting. - The server\'s certificate could not be verified. Review the details below before trusting. - You\'ve selected a certificate file. Please review the details below before adding it to your trusted certificates. + Your connection is not private + Attackers might be trying to steal your information. You should not proceed unless you know why this certificate is not trusted. + You\'ve selected a certificate file. Review the details below before adding it to your trusted certificates. Enter the service URL that this certificate should be pinned to. The certificate will only be trusted for this URL. Service URL https://ntfy.example.com