diff options
author | zeapo <mohamed@zenadi.com> | 2015-01-02 23:54:30 +0100 |
---|---|---|
committer | zeapo <mohamed@zenadi.com> | 2015-01-02 23:57:57 +0100 |
commit | 3b29602ca11874185b889504210fd3534f32bbf3 (patch) | |
tree | 26306c1755c8e0d8a9d5569416039e7673c07074 /app/src | |
parent | 41ae2ee951bc6ae6b02aa67ca6a701b0e97d0603 (diff) |
do not check for gpg-id file fix #51
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index 8e502cc3..f7107eff 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -286,6 +286,7 @@ public class PasswordStore extends ActionBarActivity { status = folders.length; // this means that the repository has been correctly cloned + // if this file does not exist, well... this will not work if there is no other files if ((new File(localDir.getAbsolutePath() + "/.gpg-id")).exists()) status++; } @@ -347,19 +348,13 @@ public class PasswordStore extends ActionBarActivity { } public void decryptPassword(PasswordItem item) { - try { - this.leftActivity = true; - - Intent intent = new Intent(this, PgpHandler.class); - intent.putExtra("PGP-ID", FileUtils.readFileToString(PasswordRepository.getFile("/.gpg-id"))); - intent.putExtra("NAME", item.toString()); - intent.putExtra("FILE_PATH", item.getFile().getAbsolutePath()); - intent.putExtra("Operation", "DECRYPT"); - startActivityForResult(intent, PgpHandler.REQUEST_CODE_DECRYPT_AND_VERIFY); + this.leftActivity = true; - } catch (IOException e) { - e.printStackTrace(); - } + Intent intent = new Intent(this, PgpHandler.class); + intent.putExtra("NAME", item.toString()); + intent.putExtra("FILE_PATH", item.getFile().getAbsolutePath()); + intent.putExtra("Operation", "DECRYPT"); + startActivityForResult(intent, PgpHandler.REQUEST_CODE_DECRYPT_AND_VERIFY); } public void createPassword(View v) { @@ -367,15 +362,10 @@ public class PasswordStore extends ActionBarActivity { Log.i("PWDSTR", "Adding file to : " + this.currentDir.getAbsolutePath()); this.leftActivity = true; - try { - Intent intent = new Intent(this, PgpHandler.class); - intent.putExtra("PGP-ID", FileUtils.readFileToString(PasswordRepository.getFile("/.gpg-id"))); - intent.putExtra("FILE_PATH", getCurrentDir().getAbsolutePath()); - intent.putExtra("Operation", "ENCRYPT"); - startActivityForResult(intent, PgpHandler.REQUEST_CODE_ENCRYPT); - } catch (Exception e) { - e.printStackTrace(); - } + Intent intent = new Intent(this, PgpHandler.class); + intent.putExtra("FILE_PATH", getCurrentDir().getAbsolutePath()); + intent.putExtra("Operation", "ENCRYPT"); + startActivityForResult(intent, PgpHandler.REQUEST_CODE_ENCRYPT); } public void deletePassword(final PasswordRecyclerAdapter adapter, final int position) { |