mirror of
https://github.com/skylot/jadx.git
synced 2025-02-25 07:34:29 +00:00
fix: update Quark report format parsing
This commit is contained in:
parent
940108661c
commit
439446816c
@ -15,7 +15,7 @@ public class QuarkReportData {
|
||||
public List<String> permissions;
|
||||
|
||||
List<Method> native_api;
|
||||
List<Method> combination;
|
||||
List<String[]> combination;
|
||||
List<Map<String, InvokePlace>> register;
|
||||
}
|
||||
|
||||
|
@ -56,21 +56,24 @@ public class QuarkReportNode extends JNode {
|
||||
|
||||
@Override
|
||||
public ContentPanel getContentPanel(TabbedPane tabbedPane) {
|
||||
QuarkReportData data;
|
||||
try {
|
||||
data = GSON.fromJson(Files.newBufferedReader(apkFile), QuarkReportData.class);
|
||||
QuarkReportData data = GSON.fromJson(Files.newBufferedReader(apkFile), QuarkReportData.class);
|
||||
return new QuarkReportPanel(tabbedPane, this, data);
|
||||
} catch (Exception e) {
|
||||
LOG.error("Quark report parse error", e);
|
||||
StringEscapeUtils.Builder builder = StringEscapeUtils.builder(StringEscapeUtils.ESCAPE_HTML4);
|
||||
builder.append("<h2>");
|
||||
builder.escape("Quark analysis failed!");
|
||||
builder.append("</h2><pre>");
|
||||
builder.append("</h2>");
|
||||
builder.append("<h3>");
|
||||
builder.append("Error: ").escape(e.getMessage());
|
||||
builder.append("</h3>");
|
||||
builder.append("<pre>");
|
||||
builder.escape(ExceptionUtils.getStackTrace(e));
|
||||
builder.append("</pre>");
|
||||
errorContent = builder.toString();
|
||||
return new HtmlPanel(tabbedPane, this);
|
||||
}
|
||||
return new QuarkReportPanel(tabbedPane, this, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,6 +8,7 @@ import java.awt.event.MouseEvent;
|
||||
import java.util.Comparator;
|
||||
import java.util.Enumeration;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
@ -238,20 +239,25 @@ public class QuarkReportPanel extends ContentPanel {
|
||||
if (Utils.notEmpty(crime.permissions)) {
|
||||
add(new TextTreeNode("Permissions: " + Strings.join(", ", crime.permissions)));
|
||||
}
|
||||
if (Utils.notEmpty(crime.combination)) {
|
||||
if (Utils.notEmpty(crime.native_api)) {
|
||||
TextTreeNode node = new TextTreeNode("Native API");
|
||||
for (QuarkReportData.Method method : crime.combination) {
|
||||
for (QuarkReportData.Method method : crime.native_api) {
|
||||
node.add(new TextTreeNode(method.toString()));
|
||||
}
|
||||
add(node);
|
||||
} else {
|
||||
if (Utils.notEmpty(crime.native_api)) {
|
||||
TextTreeNode node = new TextTreeNode("Native API");
|
||||
for (QuarkReportData.Method method : crime.native_api) {
|
||||
node.add(new TextTreeNode(method.toString()));
|
||||
}
|
||||
List<String[]> combination = crime.combination;
|
||||
if (Utils.notEmpty(combination)) {
|
||||
TextTreeNode node = new TextTreeNode("Combination");
|
||||
int size = combination.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
TextTreeNode set = new TextTreeNode("Set " + i);
|
||||
for (String mth : combination.get(i)) {
|
||||
set.add(resolveMethod(mth));
|
||||
}
|
||||
add(node);
|
||||
node.add(set);
|
||||
}
|
||||
add(node);
|
||||
}
|
||||
if (Utils.notEmpty(crime.register)) {
|
||||
TextTreeNode node = new TextTreeNode("Invocations");
|
||||
|
Loading…
x
Reference in New Issue
Block a user