aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorMohamed Zenadi <mohamed@zenadi.com>2015-05-17 19:12:14 +0200
committerMohamed Zenadi <mohamed@zenadi.com>2015-05-17 19:12:14 +0200
commit275f06835a18413a88b24137f7d5e7db114e10de (patch)
tree897e8f6ffcc15752df5c98875804e1f4b7e669d2 /app/src/main/java
parent7fe81e9c27d10ec992a28bdea146c84f3e11cd60 (diff)
Initial support for external *git* repositories, fix #41, fix #48
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordStore.java1
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/UserPreference.java2
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java2
3 files changed, 4 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
index 048a7b29..30777d46 100644
--- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
+++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
@@ -24,6 +24,7 @@ import com.zeapo.pwdstore.utils.PasswordItem;
import com.zeapo.pwdstore.utils.PasswordRecyclerAdapter;
import com.zeapo.pwdstore.utils.PasswordRepository;
+import org.apache.commons.io.FileUtils;
import org.eclipse.jgit.api.CommitCommand;
import org.eclipse.jgit.api.Git;
diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.java b/app/src/main/java/com/zeapo/pwdstore/UserPreference.java
index 00e71ae8..4c6ad4f5 100644
--- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.java
+++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.java
@@ -45,6 +45,8 @@ public class UserPreference extends AppCompatActivity {
final UserPreference callingActivity = (UserPreference) getActivity();
final SharedPreferences sharedPreferences = getPreferenceManager().getSharedPreferences();
+ addPreferencesFromResource(R.xml.preference);
+
Preference keyPref = findPreference("openpgp_key_id_pref");
String selectedKeys = sharedPreferences.getString("openpgp_key_ids", "");
if (Strings.isNullOrEmpty(selectedKeys)) {
diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java
index 9395fd68..245d9604 100644
--- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java
+++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java
@@ -107,7 +107,7 @@ public class PasswordRepository {
}
public static void closeRepository() {
- repository.close();
+ if (repository != null) repository.close();
repository = null;
}