diff options
author | Mohamed <mohamed@zenadi.com> | 2017-06-15 13:51:19 +0200 |
---|---|---|
committer | Mohamed <mohamed@zenadi.com> | 2017-06-15 13:51:19 +0200 |
commit | 496d058819ef42d37064012befe4d3197c0f942d (patch) | |
tree | bc7fdd16b499eee96b2a70b4cabf58178d6ea506 /app/src/main/java | |
parent | d9ca60908976c0e284ab5c5b037b900fe562f9df (diff) |
fix authentication dialog not showing
Diffstat (limited to 'app/src/main/java')
4 files changed, 11 insertions, 7 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java index e0a63ab0..45da34fb 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java @@ -634,8 +634,7 @@ public class GitActivity extends AppCompatActivity { try { op.executeAfterAuthentication(connectionMode, settings.getString("git_remote_username", "git"), - new File(getFilesDir() + "/.ssh_key"), true); - activity.finish(); + new File(getFilesDir() + "/.ssh_key"), false); } catch (Exception e) { e.printStackTrace(); } 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 2c42c6fa..4dc39293 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitOperation.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitOperation.java @@ -76,13 +76,15 @@ public abstract class GitOperation { /** * Executes the GitCommand in an async task + * * @param finishOnEnd */ public abstract void execute(boolean finishOnEnd); /** * Executes the GitCommand in an async task after creating the authentication - * @param connectionMode the server-connection mode + * + * @param connectionMode the server-connection mode * @param username the username * @param sshKey the ssh-key file * @param finishOnEnd @@ -93,7 +95,8 @@ public abstract class GitOperation { /** * Executes the GitCommand in an async task after creating the authentication - * @param connectionMode the server-connection mode + * + * @param connectionMode the server-connection mode * @param username the username * @param sshKey the ssh-key file * @param showError show the passphrase edit text in red @@ -168,6 +171,7 @@ public abstract class GitOperation { 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(); } else { // call back the method executeAfterAuthentication(connectionMode, username, sshKey, true, finishOnEnd); @@ -175,11 +179,12 @@ public abstract class GitOperation { } }).setNegativeButton(callingActivity.getResources().getString(R.string.dialog_cancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { - // Do nothing. + callingActivity.finish(); } }).show(); } else { setAuthentication(sshKey, username, "").execute(finishOnEnd); + callingActivity.finish(); } } catch (JSchException e) { new AlertDialog.Builder(callingActivity) diff --git a/app/src/main/java/com/zeapo/pwdstore/git/PullOperation.java b/app/src/main/java/com/zeapo/pwdstore/git/PullOperation.java index a5422cb4..d6859e9f 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/PullOperation.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/PullOperation.java @@ -40,7 +40,7 @@ public class PullOperation extends GitOperation { if (this.provider != null) { ((PullCommand) this.command).setCredentialsProvider(this.provider); } - new GitAsyncTask(callingActivity, true, false, this).execute(this.command); + new GitAsyncTask(callingActivity, finishOnEnd, false, this).execute(this.command); } @Override diff --git a/app/src/main/java/com/zeapo/pwdstore/git/PushOperation.java b/app/src/main/java/com/zeapo/pwdstore/git/PushOperation.java index afe058f0..d66eb359 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/PushOperation.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/PushOperation.java @@ -40,7 +40,7 @@ public class PushOperation extends GitOperation { if (this.provider != null) { ((PushCommand) this.command).setCredentialsProvider(this.provider); } - new GitAsyncTask(callingActivity, true, false, this).execute(this.command); + new GitAsyncTask(callingActivity, finishOnEnd, false, this).execute(this.command); } @Override |