corrected a bug with file path when decrypting

This commit is contained in:
Zeapo
2014-08-01 00:22:15 +01:00
parent a0263aabad
commit 1579a6347e
2 changed files with 3 additions and 3 deletions

View File

@@ -158,12 +158,12 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
try { try {
byte[] data = new byte[0]; byte[] data = new byte[0];
try { try {
data = FileUtils.readFileToByteArray(PasswordRepository.getFile(item.getName())); data = FileUtils.readFileToByteArray(item.getFile());
Intent intent = new Intent(this, PgpHandler.class); Intent intent = new Intent(this, PgpHandler.class);
intent.putExtra("PGP-ID", FileUtils.readFileToString(PasswordRepository.getFile("/.gpg-id"))); intent.putExtra("PGP-ID", FileUtils.readFileToString(PasswordRepository.getFile("/.gpg-id")));
intent.putExtra("NAME", item.getName()); intent.putExtra("NAME", item.getName());
intent.putExtra("FILE_PATH", PasswordRepository.getFile(item.getName()).getAbsolutePath()); intent.putExtra("FILE_PATH", item.getFile().getAbsolutePath());
startActivity(intent); startActivity(intent);
} catch (IOException e) { } catch (IOException e) {

View File

@@ -75,7 +75,7 @@ public class PasswordRepository {
String[] parts = fileName.split("/"); String[] parts = fileName.split("/");
if (parts.length == 1) { if (parts.length == 1) {
passwordList.add(PasswordItem.newPassword(parts[0], file.getParentFile())); passwordList.add(PasswordItem.newPassword(parts[0], file));
} else { } else {
if (!passwordList.contains(PasswordItem.newCategory(parts[0], file.getParentFile()))) { if (!passwordList.contains(PasswordItem.newCategory(parts[0], file.getParentFile()))) {
passwordList.add(PasswordItem.newCategory(parts[0], file.getParentFile())); passwordList.add(PasswordItem.newCategory(parts[0], file.getParentFile()));