fixed pgp signature creation
This commit is contained in:
parent
567827ffca
commit
f1494f83ff
|
@ -292,9 +292,25 @@ public class PgpEngine {
|
|||
switch (result.getIntExtra(OpenPgpApi.RESULT_CODE, 0)) {
|
||||
case OpenPgpApi.RESULT_CODE_SUCCESS:
|
||||
StringBuilder signatureBuilder = new StringBuilder();
|
||||
try {
|
||||
os.flush();
|
||||
String[] lines = os.toString().split("\n");
|
||||
for (int i = 7; i < lines.length - 1; ++i) {
|
||||
signatureBuilder.append(lines[i].trim());
|
||||
boolean sig = false;
|
||||
for(String line : lines) {
|
||||
if (sig) {
|
||||
if (line.contains("END PGP SIGNATURE")) {
|
||||
sig = false;
|
||||
} else {
|
||||
signatureBuilder.append(line.trim());
|
||||
}
|
||||
}
|
||||
if (line.contains("BEGIN PGP SIGNATURE")) {
|
||||
sig = true;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
callback.error(R.string.openpgp_error, account);
|
||||
return;
|
||||
}
|
||||
account.setKey("pgp_signature", signatureBuilder.toString());
|
||||
callback.success(account);
|
||||
|
|
Loading…
Reference in New Issue