Skip to content

Commit

Permalink
feat(gui): support APK signature v3 (PR #773)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpstotz authored and skylot committed Nov 1, 2019
1 parent bae36f9 commit cf3e17c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jadx-gui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {

compile 'io.reactivex.rxjava2:rxjava:2.2.11'
compile "com.github.akarnokd:rxjava2-swing:0.3.7"
compile 'com.android.tools.build:apksig:3.4.2'
compile 'com.android.tools.build:apksig:3.5.1'
}

application {
Expand Down
24 changes: 22 additions & 2 deletions jadx-gui/src/main/java/jadx/gui/treemodel/ApkSignature.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import java.util.List;
import java.util.stream.Collectors;

import javax.swing.*;
import javax.swing.Icon;
import javax.swing.ImageIcon;

import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.commons.text.StringEscapeUtils;
Expand Down Expand Up @@ -83,7 +84,6 @@ public String getContent() {
final String sigFailKey = "apkSignature.signatureFailed";

writeIssues(builder, err, result.getErrors());
writeIssues(builder, warn, result.getWarnings());

if (!result.getV1SchemeSigners().isEmpty()) {
builder.append("<h2>");
Expand Down Expand Up @@ -124,6 +124,26 @@ public String getContent() {
}
builder.append("</blockquote>");
}
if (!result.getV3SchemeSigners().isEmpty()) {
builder.append("<h2>");
builder.escape(NLS.str(result.isVerifiedUsingV3Scheme() ? sigSuccKey : sigFailKey, 3));
builder.append("</h2>\n");

builder.append("<blockquote>");
for (ApkVerifier.Result.V3SchemeSignerInfo signer : result.getV3SchemeSigners()) {
builder.append("<h3>");
builder.escape(NLS.str("apkSignature.signer"));
builder.append(" ");
builder.append(Integer.toString(signer.getIndex() + 1));
builder.append("</h3>");
writeCertificate(builder, signer.getCertificate());
writeIssues(builder, err, signer.getErrors());
writeIssues(builder, warn, signer.getWarnings());
}
builder.append("</blockquote>");
}
writeIssues(builder, warn, result.getWarnings());

this.content = builder.toString();
} catch (Exception e) {
LOG.error(e.getMessage(), e);
Expand Down

0 comments on commit cf3e17c

Please sign in to comment.