提交 667cae2e 编写于 作者: S Skylot

chore: use SVG icon for Quark (thanks @MrIkso)

上级 e8e0491c
......@@ -33,3 +33,4 @@ jadx-output/
*.log
*.cfg
*.orig
quark.json
......@@ -29,7 +29,8 @@ public class QuarkReportNode extends JNode {
private static final Gson GSON = new GsonBuilder().create();
private static final ImageIcon ICON = UiUtils.openSvgIcon("ui/analyze");
private static final ImageIcon ICON = UiUtils.openSvgIcon("ui/quark");
private final Path apkFile;
private String errorContent;
......
......@@ -270,7 +270,7 @@ public class QuarkReportPanel extends ContentPanel {
public MutableTreeNode resolveMethod(String descr) {
try {
String[] parts = descr.split(" ", 3);
String[] parts = removeQuotes(descr).split(" ", 3);
String cls = Utils.cleanObjectName(parts[0].replace('$', '.'));
String mth = parts[1] + parts[2].replace(" ", "");
MainWindow mainWindow = getTabbedPane().getMainWindow();
......@@ -290,6 +290,13 @@ public class QuarkReportPanel extends ContentPanel {
}
}
private static String removeQuotes(String descr) {
if (descr.charAt(0) == '\'') {
return descr.substring(1, descr.length() - 1);
}
return descr;
}
private class MethodTreeNode extends BaseTreeNode {
private static final long serialVersionUID = 4350343915220068508L;
......
......@@ -158,7 +158,7 @@ public class MainWindow extends JFrame {
private static final ImageIcon ICON_COMMENT_SEARCH = UiUtils.openSvgIcon("ui/usagesFinder");
private static final ImageIcon ICON_BACK = UiUtils.openSvgIcon("ui/left");
private static final ImageIcon ICON_FORWARD = UiUtils.openSvgIcon("ui/right");
private static final ImageIcon ICON_QUARK = UiUtils.openSvgIcon("ui/analyze");
private static final ImageIcon ICON_QUARK = UiUtils.openSvgIcon("ui/quark");
private static final ImageIcon ICON_PREF = UiUtils.openSvgIcon("ui/settings");
private static final ImageIcon ICON_DEOBF = UiUtils.openSvgIcon("ui/helmChartLock");
private static final ImageIcon ICON_LOG = UiUtils.openSvgIcon("ui/logVerbose");
......
......@@ -58,7 +58,17 @@ public class UiUtils {
public static FlatSVGIcon openSvgIcon(String name) {
String iconPath = "icons/" + name + ".svg";
return new FlatSVGIcon(iconPath);
FlatSVGIcon icon = new FlatSVGIcon(iconPath);
boolean found;
try {
found = icon.hasFound();
} catch (Exception e) {
throw new JadxRuntimeException("Failed to load icon: " + iconPath, e);
}
if (!found) {
throw new JadxRuntimeException("Icon not found: " + iconPath);
}
return icon;
}
public static ImageIcon openIcon(String name) {
......
<svg width='16' height='16' viewBox='0,0,16,16' xmlns='http://www.w3.org/2000/svg'>
<g>
<path fill-rule='evenodd'
d='M14,11.697000000000003L11,5.6970000000000027L11,3L12,3L12,1L4,1L4,3L5,3L5,5.6970000000000027L2,11.697000000000003L2,12.235000000000014L3.3819999999999979,15L12.618000000000002,15L14,12.235000000000014L14,11.697000000000003Z'
fill='#242424'/>
<path fill-rule='evenodd' d='M10,6L10,3L11,3L11,2L5,2L5,3L6,3L6,6L3,12L4,14L12,14L13,12L10,6Z' fill='#6E6E6E'/>
<path fill-rule='evenodd'
d='M10.131799999999998,8L7.3327999999999989,8L4.9998000000000005,13L4.6178000000000026,13L4.1527999999999992,12.072000000000003L6.8318000000000012,6.5550000000000068L6.9998000000000005,6.3029999999999973L6.9998000000000005,6L6.9998000000000005,3L8.9998,3L8.9998,6L8.9998,6.3029999999999973L9.1678,6.5550000000000068L10.131799999999998,8Z'
fill='#282828'/>
</g>
</svg>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="m1.2538 16.022h9.6163l-0.99027-2.334-0.38734-0.83702-0.40096-0.03079h-5.1247v-8.9172c0-0.15265-0.067901-0.52489 0.048301-0.64027 0.073078-0.072556 0.21994-0.047945 0.31342-0.047945h6.9334c0.20344 0 0.79758-0.099828 0.94647 0.047945 0.0908 0.0901 0.0483 0.3147 0.0483 0.43081v5.476c0 0.13053-0.03465 0.32066 0.01819 0.44257 0.0864 0.19926 0.54993 0.37168 0.73544 0.47665 0.6598 0.37339 1.302 0.82646 1.9896 1.1455v-9.1865c0-0.48543-0.0031-0.98972-0.28698-1.4064-0.59151-0.86949-1.8395-0.59847-2.7577-0.59847h-7.5061c-0.9301 0-2.3047-0.29489-2.9178 0.56855-0.33614 0.47341-0.27762 1.006-0.27762 1.556v2.753z" fill="#9AA7B0"/>
<path fill-rule="evenodd" d="m10 10 0.52227 1.3005 1.293 3.1099 0.46727 1.1309 0.21067 0.45156 0.66975 0.02906h1.8428v-2.1769c0-0.21487 0.08141-0.65274-0.02833-0.83885-0.07554-0.1282-0.2887-0.21195-0.41178-0.28407-0.3043-0.17834-0.60558-0.36245-0.90764-0.5448-0.77799-0.46971-1.5617-0.92969-2.3378-1.4027-0.42018-0.25612-0.86153-0.60196-1.3202-0.77456z" fill="#297FA5"/>
</svg>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册