diff options
author | Zeapo <mohamed@zenadi.com> | 2014-07-26 20:57:33 +0100 |
---|---|---|
committer | Zeapo <mohamed@zenadi.com> | 2014-07-26 20:57:33 +0100 |
commit | 1c4defa4c96537300528f119695ca8fdc5f4c625 (patch) | |
tree | f39861db31f762bf22c15c40fd91ab76d7d236d4 /app/src/main/java | |
parent | 6532252f31d032b461d229ba3cf49245b2c5fe85 (diff) |
Moved the cloning to settings, needs a nicer icon
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/GitClone.java | 28 | ||||
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/pwdstore.java | 5 |
2 files changed, 4 insertions, 29 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/GitClone.java b/app/src/main/java/com/zeapo/pwdstore/GitClone.java index c7b67812..6f57a9f7 100644 --- a/app/src/main/java/com/zeapo/pwdstore/GitClone.java +++ b/app/src/main/java/com/zeapo/pwdstore/GitClone.java @@ -2,15 +2,11 @@ package com.zeapo.pwdstore; import android.app.Activity; import android.app.AlertDialog; -import android.app.Dialog; -import android.app.DialogFragment; -import android.app.ListActivity; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.os.AsyncTask; import android.os.Bundle; -import android.os.Message; import android.text.InputType; import android.view.Menu; import android.view.MenuItem; @@ -22,46 +18,24 @@ import android.widget.EditText; import android.widget.LinearLayout; import android.widget.Spinner; import android.widget.TextView; -import android.widget.Toast; import com.jcraft.jsch.JSch; import com.jcraft.jsch.JSchException; import com.jcraft.jsch.Session; -import com.jcraft.jsch.UserInfo; -import com.zeapo.pwdstore.R; import org.eclipse.jgit.api.CloneCommand; import org.eclipse.jgit.api.Git; import org.apache.commons.io.FileUtils; import org.eclipse.jgit.api.errors.InvalidRemoteException; -import org.eclipse.jgit.diff.Edit; -import org.eclipse.jgit.errors.NoRemoteRepositoryException; -import org.eclipse.jgit.errors.UnsupportedCredentialItem; -import org.eclipse.jgit.lib.TextProgressMonitor; -import org.eclipse.jgit.transport.CredentialItem; -import org.eclipse.jgit.transport.CredentialsProvider; -import org.eclipse.jgit.transport.CredentialsProviderUserInfo; import org.eclipse.jgit.transport.JschConfigSessionFactory; import org.eclipse.jgit.transport.OpenSshConfig; import org.eclipse.jgit.transport.SshSessionFactory; -import org.eclipse.jgit.transport.URIish; import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.eclipse.jgit.util.FS; -import org.eclipse.jgit.util.StringUtils; import java.io.File; import java.io.IOException; -import java.security.GeneralSecurityException; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.List; -import java.util.Properties; - -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; public class GitClone extends Activity { @@ -231,7 +205,7 @@ public class GitClone extends Activity { // now cheat a little and prepend the real protocol // jGit does not accept a ssh:// but requires https:// - if (!protocol.equals("ssh://")) hostname = new String(protocol + hostname); + if (!protocol.equals("ssh://")) hostname = protocol + hostname; if (localDir.exists()) { new AlertDialog.Builder(this). diff --git a/app/src/main/java/com/zeapo/pwdstore/pwdstore.java b/app/src/main/java/com/zeapo/pwdstore/pwdstore.java index 5bf9ca3c..54e1605b 100644 --- a/app/src/main/java/com/zeapo/pwdstore/pwdstore.java +++ b/app/src/main/java/com/zeapo/pwdstore/pwdstore.java @@ -37,13 +37,14 @@ public class pwdstore extends Activity { // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); - if (id == R.id.action_settings) { + if (id == R.id.clone_setting) { + getClone(); return true; } return super.onOptionsItemSelected(item); } - public void getClone(View view){ + public void getClone(){ Intent intent = new Intent(this, GitClone.class); startActivity(intent); } |