Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 496d058

Browse files
committed
fix authentication dialog not showing
1 parent d9ca609 commit 496d058

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,8 +634,7 @@ public void onClick(DialogInterface dialogInterface, int i) {
634634
try {
635635
op.executeAfterAuthentication(connectionMode,
636636
settings.getString("git_remote_username", "git"),
637-
new File(getFilesDir() + "/.ssh_key"), true);
638-
activity.finish();
637+
new File(getFilesDir() + "/.ssh_key"), false);
639638
} catch (Exception e) {
640639
e.printStackTrace();
641640
}

app/src/main/java/com/zeapo/pwdstore/git/GitOperation.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,15 @@ public GitOperation setAuthentication(File sshKey, String username, String passp
7676

7777
/**
7878
* Executes the GitCommand in an async task
79+
*
7980
* @param finishOnEnd
8081
*/
8182
public abstract void execute(boolean finishOnEnd);
8283

8384
/**
8485
* Executes the GitCommand in an async task after creating the authentication
85-
* @param connectionMode the server-connection mode
86+
*
87+
* @param connectionMode the server-connection mode
8688
* @param username the username
8789
* @param sshKey the ssh-key file
8890
* @param finishOnEnd
@@ -93,7 +95,8 @@ public void executeAfterAuthentication(final String connectionMode, final String
9395

9496
/**
9597
* Executes the GitCommand in an async task after creating the authentication
96-
* @param connectionMode the server-connection mode
98+
*
99+
* @param connectionMode the server-connection mode
97100
* @param username the username
98101
* @param sshKey the ssh-key file
99102
* @param showError show the passphrase edit text in red
@@ -168,18 +171,20 @@ public void onClick(DialogInterface dialog, int whichButton) {
168171
if (keyPair.decrypt(passphrase.getText().toString())) {
169172
// Authenticate using the ssh-key and then execute the command
170173
setAuthentication(sshKey, username, passphrase.getText().toString()).execute(finishOnEnd);
174+
callingActivity.finish();
171175
} else {
172176
// call back the method
173177
executeAfterAuthentication(connectionMode, username, sshKey, true, finishOnEnd);
174178
}
175179
}
176180
}).setNegativeButton(callingActivity.getResources().getString(R.string.dialog_cancel), new DialogInterface.OnClickListener() {
177181
public void onClick(DialogInterface dialog, int whichButton) {
178-
// Do nothing.
182+
callingActivity.finish();
179183
}
180184
}).show();
181185
} else {
182186
setAuthentication(sshKey, username, "").execute(finishOnEnd);
187+
callingActivity.finish();
183188
}
184189
} catch (JSchException e) {
185190
new AlertDialog.Builder(callingActivity)

app/src/main/java/com/zeapo/pwdstore/git/PullOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void execute(boolean finishOnEnd) {
4040
if (this.provider != null) {
4141
((PullCommand) this.command).setCredentialsProvider(this.provider);
4242
}
43-
new GitAsyncTask(callingActivity, true, false, this).execute(this.command);
43+
new GitAsyncTask(callingActivity, finishOnEnd, false, this).execute(this.command);
4444
}
4545

4646
@Override

app/src/main/java/com/zeapo/pwdstore/git/PushOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void execute(boolean finishOnEnd) {
4040
if (this.provider != null) {
4141
((PushCommand) this.command).setCredentialsProvider(this.provider);
4242
}
43-
new GitAsyncTask(callingActivity, true, false, this).execute(this.command);
43+
new GitAsyncTask(callingActivity, finishOnEnd, false, this).execute(this.command);
4444
}
4545

4646
@Override

0 commit comments

Comments
 (0)