aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/com/zeapo/pwdstore/git/GitOperation.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/git/GitOperation.java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/git/GitOperation.java29
1 files changed, 9 insertions, 20 deletions
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() {