Ignore existing attributes in manifest

Close #2595
This commit is contained in:
topjohnwu 2020-03-28 21:42:31 -07:00
parent d382b00efd
commit a9eb443072

View File

@ -196,9 +196,7 @@ public class SignAPK {
if (md_sha1 != null) md_sha1.update(buffer, 0, num); if (md_sha1 != null) md_sha1.update(buffer, 0, num);
if (md_sha256 != null) md_sha256.update(buffer, 0, num); if (md_sha256 != null) md_sha256.update(buffer, 0, num);
} }
Attributes attr = null; Attributes attr = new Attributes();
if (input != null) attr = input.getAttributes(name);
attr = attr != null ? new Attributes(attr) : new Attributes();
if (md_sha1 != null) { if (md_sha1 != null) {
attr.putValue("SHA1-Digest", attr.putValue("SHA1-Digest",
new String(Base64.encode(md_sha1.digest()), "ASCII")); new String(Base64.encode(md_sha1.digest()), "ASCII"));