|
|
@ -948,9 +948,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
DB db = DB.getInstance(context);
|
|
|
|
|
|
|
|
|
|
|
|
// Find encrypted data
|
|
|
|
// Find encrypted data
|
|
|
|
|
|
|
|
boolean found = false;
|
|
|
|
List<EntityAttachment> attachments = db.attachment().getAttachments(id);
|
|
|
|
List<EntityAttachment> attachments = db.attachment().getAttachments(id);
|
|
|
|
for (EntityAttachment attachment : attachments)
|
|
|
|
for (EntityAttachment attachment : attachments)
|
|
|
|
if (attachment.available && "encrypted.asc".equals(attachment.name)) {
|
|
|
|
if (attachment.available && "encrypted.asc".equals(attachment.name)) {
|
|
|
|
|
|
|
|
found = true;
|
|
|
|
|
|
|
|
|
|
|
|
// Serialize encrypted data
|
|
|
|
// Serialize encrypted data
|
|
|
|
FileInputStream encrypted = new FileInputStream(EntityAttachment.getFile(context, attachment.id));
|
|
|
|
FileInputStream encrypted = new FileInputStream(EntityAttachment.getFile(context, attachment.id));
|
|
|
|
ByteArrayOutputStream decrypted = new ByteArrayOutputStream();
|
|
|
|
ByteArrayOutputStream decrypted = new ByteArrayOutputStream();
|
|
|
@ -1008,6 +1011,9 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!found)
|
|
|
|
|
|
|
|
throw new IllegalArgumentException(getString(R.string.title_not_encrypted));
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|