fix the the git fields and a small refactor

This commit is contained in:
zeapo 2014-12-16 23:25:55 +01:00
parent f154dc30a4
commit 47bb25adcb
8 changed files with 24 additions and 23 deletions

View file

@ -4,13 +4,13 @@ apply plugin: 'eclipse'
android { android {
compileSdkVersion 21 compileSdkVersion 21
buildToolsVersion "21.1.1" buildToolsVersion "21.1.2"
defaultConfig { defaultConfig {
applicationId "com.zeapo.pwdstore" applicationId "com.zeapo.pwdstore"
minSdkVersion 15 minSdkVersion 15
targetSdkVersion 21 targetSdkVersion 21
versionCode 29 versionCode 30
versionName "1.2.0.9" versionName "1.2.0.10"
} }
compileOptions { compileOptions {
@ -25,7 +25,7 @@ android {
} }
dependencies { dependencies {
compile "com.android.support:appcompat-v7:21.0.2" compile "com.android.support:appcompat-v7:21.0.3"
compile "com.android.support:recyclerview-v7:21.0.2" compile "com.android.support:recyclerview-v7:21.0.2"
//compile fileTree(dir: 'libs', include: ['*.jar']) //compile fileTree(dir: 'libs', include: ['*.jar'])

View file

@ -11,7 +11,7 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".GitHandler" <activity android:name=".git.GitHandler"
android:parentActivityName=".PasswordStore"> android:parentActivityName=".PasswordStore">
<meta-data android:name="android.PARENT_ACTIVITY1" <meta-data android:name="android.PARENT_ACTIVITY1"
android:value="com.zeapo.pwdstore.PasswordStore" /> android:value="com.zeapo.pwdstore.PasswordStore" />

View file

@ -18,6 +18,8 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import com.zeapo.pwdstore.crypto.PgpHandler; import com.zeapo.pwdstore.crypto.PgpHandler;
import com.zeapo.pwdstore.git.GitAsyncTask;
import com.zeapo.pwdstore.git.GitHandler;
import com.zeapo.pwdstore.utils.PasswordItem; import com.zeapo.pwdstore.utils.PasswordItem;
import com.zeapo.pwdstore.utils.PasswordRecyclerAdapter; import com.zeapo.pwdstore.utils.PasswordRecyclerAdapter;
import com.zeapo.pwdstore.utils.PasswordRepository; import com.zeapo.pwdstore.utils.PasswordRepository;

View file

@ -1,35 +1,26 @@
package com.zeapo.pwdstore; package com.zeapo.pwdstore;
import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.preference.Preference; import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment; import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBarActivity;
import android.util.Log; import android.util.Log;
import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import com.zeapo.pwdstore.crypto.PgpHandler; import com.zeapo.pwdstore.crypto.PgpHandler;
import com.zeapo.pwdstore.git.GitHandler;
import com.zeapo.pwdstore.utils.PasswordRepository; import com.zeapo.pwdstore.utils.PasswordRepository;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.eclipse.jgit.api.CloneCommand;
import org.eclipse.jgit.lib.Repository;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URI;
public class UserPreference extends ActionBarActivity implements Preference.OnPreferenceClickListener { public class UserPreference extends ActionBarActivity implements Preference.OnPreferenceClickListener {
private final static int IMPORT_SSH_KEY = 1; private final static int IMPORT_SSH_KEY = 1;

View file

@ -1,4 +1,4 @@
package com.zeapo.pwdstore; package com.zeapo.pwdstore.git;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
@ -6,6 +6,8 @@ import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.AsyncTask; import android.os.AsyncTask;
import com.zeapo.pwdstore.PasswordStore;
import com.zeapo.pwdstore.R;
import com.zeapo.pwdstore.utils.PasswordRepository; import com.zeapo.pwdstore.utils.PasswordRepository;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;

View file

@ -1,4 +1,4 @@
package com.zeapo.pwdstore; package com.zeapo.pwdstore.git;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
@ -26,6 +26,8 @@ import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException; import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session; import com.jcraft.jsch.Session;
import com.jcraft.jsch.UserInfo; import com.jcraft.jsch.UserInfo;
import com.zeapo.pwdstore.R;
import com.zeapo.pwdstore.UserPreference;
import com.zeapo.pwdstore.utils.PasswordRepository; import com.zeapo.pwdstore.utils.PasswordRepository;
import org.eclipse.jgit.api.CloneCommand; import org.eclipse.jgit.api.CloneCommand;

View file

@ -6,7 +6,7 @@
android:paddingRight="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.zeapo.pwdstore.GitHandler" tools:context="com.zeapo.pwdstore.git.GitHandler"
android:background="@android:color/white"> android:background="@android:color/white">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -73,7 +73,8 @@
android:layout_toEndOf="@+id/label_server_user" android:layout_toEndOf="@+id/label_server_user"
android:layout_toRightOf="@+id/label_server_user" android:layout_toRightOf="@+id/label_server_user"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"/> android:layout_alignParentEnd="true"
android:inputType="textWebEmailAddress"/>
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -100,7 +101,8 @@
android:layout_toEndOf="@+id/label_server_url" android:layout_toEndOf="@+id/label_server_url"
android:layout_toRightOf="@+id/label_server_url" android:layout_toRightOf="@+id/label_server_url"
android:layout_toLeftOf="@+id/label_server_port" android:layout_toLeftOf="@+id/label_server_port"
android:layout_toStartOf="@+id/label_server_port" /> android:layout_toStartOf="@+id/label_server_port"
android:inputType="textWebEmailAddress" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -116,7 +118,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/server_port_hint" android:hint="@string/server_port_hint"
android:id="@+id/server_port" android:id="@+id/server_port"
android:layout_alignParentRight="true"/> android:layout_alignParentRight="true"
android:inputType="number"/>
</RelativeLayout> </RelativeLayout>
@ -145,7 +148,8 @@
android:layout_toEndOf="@+id/label_server_path" android:layout_toEndOf="@+id/label_server_path"
android:layout_toRightOf="@+id/label_server_path" android:layout_toRightOf="@+id/label_server_path"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"/> android:layout_alignParentEnd="true"
android:inputType="textWebEmailAddress"/>
</RelativeLayout> </RelativeLayout>

View file

@ -1,7 +1,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" <menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:pwstore="http://schemas.android.com/apk/res-auto" xmlns:pwstore="http://schemas.android.com/apk/res-auto"
tools:context="com.zeapo.pwdstore.GitHandler" > tools:context="com.zeapo.pwdstore.git.GitHandler" >
<item android:id="@+id/user_pref" <item android:id="@+id/user_pref"
android:title="@string/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" android:orderInCategory="100"