From 7b8ad7ca0f575113359bacadf151303f5b4c53a4 Mon Sep 17 00:00:00 2001 From: Mohamed Zenadi Date: Sat, 24 Jun 2017 12:24:28 +0200 Subject: revert auto-sync and background git activity too buggy, no time to work on it correclty --- .../java/com/zeapo/pwdstore/git/GitOperation.java | 29 +++++++--------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/git/GitOperation.java') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitOperation.java b/app/src/main/java/com/zeapo/pwdstore/git/GitOperation.java index 4dc39293..f6b05f4c 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitOperation.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitOperation.java @@ -76,10 +76,8 @@ public abstract class GitOperation { /** * Executes the GitCommand in an async task - * - * @param finishOnEnd */ - public abstract void execute(boolean finishOnEnd); + public abstract void execute(); /** * Executes the GitCommand in an async task after creating the authentication @@ -87,10 +85,9 @@ public abstract class GitOperation { * @param connectionMode the server-connection mode * @param username the username * @param sshKey the ssh-key file - * @param finishOnEnd */ - public void executeAfterAuthentication(final String connectionMode, final String username, @Nullable final File sshKey, boolean finishOnEnd) { - executeAfterAuthentication(connectionMode, username, sshKey, false, finishOnEnd); + public void executeAfterAuthentication(final String connectionMode, final String username, @Nullable final File sshKey) { + executeAfterAuthentication(connectionMode, username, sshKey, false); } /** @@ -100,14 +97,8 @@ public abstract class GitOperation { * @param username the username * @param sshKey the ssh-key file * @param showError show the passphrase edit text in red - * @param finishOnEnd */ - private void executeAfterAuthentication( - final String connectionMode, - final String username, - @Nullable final File sshKey, - final boolean showError, - final boolean finishOnEnd) { + private void executeAfterAuthentication(final String connectionMode, final String username, @Nullable final File sshKey, final boolean showError) { if (connectionMode.equalsIgnoreCase("ssh-key")) { if (sshKey == null || !sshKey.exists()) { new AlertDialog.Builder(callingActivity) @@ -170,21 +161,19 @@ public abstract class GitOperation { public void onClick(DialogInterface dialog, int whichButton) { if (keyPair.decrypt(passphrase.getText().toString())) { // Authenticate using the ssh-key and then execute the command - setAuthentication(sshKey, username, passphrase.getText().toString()).execute(finishOnEnd); - callingActivity.finish(); + setAuthentication(sshKey, username, passphrase.getText().toString()).execute(); } else { // call back the method - executeAfterAuthentication(connectionMode, username, sshKey, true, finishOnEnd); + executeAfterAuthentication(connectionMode, username, sshKey, true); } } }).setNegativeButton(callingActivity.getResources().getString(R.string.dialog_cancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { - callingActivity.finish(); + // Do nothing. } }).show(); } else { - setAuthentication(sshKey, username, "").execute(finishOnEnd); - callingActivity.finish(); + setAuthentication(sshKey, username, "").execute(); } } catch (JSchException e) { new AlertDialog.Builder(callingActivity) @@ -211,7 +200,7 @@ public abstract class GitOperation { .setPositiveButton(callingActivity.getResources().getString(R.string.dialog_ok), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { // authenticate using the user/pwd and then execute the command - setAuthentication(username, password.getText().toString()).execute(finishOnEnd); + setAuthentication(username, password.getText().toString()).execute(); } }).setNegativeButton(callingActivity.getResources().getString(R.string.dialog_cancel), new DialogInterface.OnClickListener() { -- cgit v1.2.3