diff options
| author | Zeapo <mohamed@zenadi.com> | 2014-07-27 03:33:08 +0100 |
|---|---|---|
| committer | Zeapo <mohamed@zenadi.com> | 2014-07-27 03:33:08 +0100 |
| commit | c75fd77fdf39328e41a2e23c26583ab745df44a3 (patch) | |
| tree | 7afff75e12814185501521a6c3d9315ec87ce65c /app/src/main/java/com/zeapo/pwdstore/GitClone.java | |
| parent | 784a474efb93f5c45fd24ed63ecfdd6f198ba51d (diff) | |
| download | HardenedPass-c75fd77fdf39328e41a2e23c26583ab745df44a3.tar.gz HardenedPass-c75fd77fdf39328e41a2e23c26583ab745df44a3.zip | |
Implemented the List view, a lot of work to do..
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/GitClone.java')
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/GitClone.java | 64 |
1 files changed, 37 insertions, 27 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/GitClone.java b/app/src/main/java/com/zeapo/pwdstore/GitClone.java index a7c817c5..cab56e96 100644 --- a/app/src/main/java/com/zeapo/pwdstore/GitClone.java +++ b/app/src/main/java/com/zeapo/pwdstore/GitClone.java @@ -325,33 +325,43 @@ public class GitClone extends Activity { if (connectionMode.equalsIgnoreCase("ssh-key")) { } else { - final EditText password = new EditText(activity); - password.setHint("Password"); - password.setWidth(LinearLayout.LayoutParams.MATCH_PARENT); - password.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); - - new AlertDialog.Builder(activity) - .setTitle("Authenticate") - .setMessage("Please provide the password for this repository") - .setView(password) - .setPositiveButton("OK", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - - SshSessionFactory.setInstance(new GitConfigSessionFactory()); - - CloneCommand cmd = Git.cloneRepository(). - setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password.getText().toString())). - setCloneAllBranches(true). - setDirectory(localDir). - setURI(hostname); - - new CloneTask(activity).execute(cmd); - } - }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - // Do nothing. - } - }).show(); + if (protocol.equals("ssh://")) { + + final EditText password = new EditText(activity); + password.setHint("Password"); + password.setWidth(LinearLayout.LayoutParams.MATCH_PARENT); + password.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); + + new AlertDialog.Builder(activity) + .setTitle("Authenticate") + .setMessage("Please provide the password for this repository") + .setView(password) + .setPositiveButton("OK", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int whichButton) { + + SshSessionFactory.setInstance(new GitConfigSessionFactory()); + + CloneCommand cmd = Git.cloneRepository(). + setCredentialsProvider(new UsernamePasswordCredentialsProvider(username, password.getText().toString())). + setCloneAllBranches(true). + setDirectory(localDir). + setURI(hostname); + + new CloneTask(activity).execute(cmd); + } + }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int whichButton) { + // Do nothing. + } + }).show(); + } else { + CloneCommand cmd = Git.cloneRepository(). + setCloneAllBranches(true). + setDirectory(localDir). + setURI(hostname); + + new CloneTask(activity).execute(cmd); + } } } |
