From 073346c157ec34b750d175c8543f346e6eae94de Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 1 Oct 2019 22:14:28 +0530 Subject: Redesign UI and introduce dark theme (#519) Caveats: - The openpgp preference had to be removed because the open-intents developers are too lazy to update their libraries. Over the coming weeks I will be reimplementing a local solution for this instead. - The autofill dialog is broken but I since it is being worked on in #410 already I'm not going to bother fixing it. --- .../zeapo/pwdstore/git/config/SshApiSessionFactory.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/git/config') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java b/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java index 085beadd..dbb5b7b1 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/config/SshApiSessionFactory.java @@ -5,8 +5,9 @@ import android.app.PendingIntent; import android.content.Intent; import android.content.IntentSender; -import androidx.appcompat.app.AlertDialog; +import androidx.annotation.NonNull; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.jcraft.jsch.Identity; import com.jcraft.jsch.JSch; import com.jcraft.jsch.JSchException; @@ -49,9 +50,9 @@ public class SshApiSessionFactory extends GitConfigSessionFactory { this.identity = identity; } + @NonNull @Override - protected JSch - getJSch(final OpenSshConfig.Host hc, FS fs) throws JSchException { + protected JSch getJSch(@NonNull final OpenSshConfig.Host hc, @NonNull FS fs) throws JSchException { JSch jsch = super.getJSch(hc, fs); jsch.removeAllIdentity(); jsch.addIdentity(identity, null); @@ -59,7 +60,7 @@ public class SshApiSessionFactory extends GitConfigSessionFactory { } @Override - protected void configure(OpenSshConfig.Host hc, Session session) { + protected void configure(@NonNull OpenSshConfig.Host hc, Session session) { session.setConfig("StrictHostKeyChecking", "no"); session.setConfig("PreferredAuthentications", "publickey"); @@ -204,8 +205,9 @@ public class SshApiSessionFactory extends GitConfigSessionFactory { @Override public void onError() { - new AlertDialog.Builder(callingActivity).setMessage(callingActivity.getString( - R.string.openkeychain_ssh_api_connect_fail)).show(); + new MaterialAlertDialogBuilder(callingActivity) + .setMessage(callingActivity.getString( + R.string.openkeychain_ssh_api_connect_fail)).show(); } }); -- cgit v1.2.3