From 035ba2b5c7c665344cfe78f10b48b4a7354b0e96 Mon Sep 17 00:00:00 2001 From: 4ra1n <2023503307@qq.com> Date: Thu, 19 Jan 2023 01:20:03 +0800 Subject: [PATCH] #134 --- CHANGELOG.MD | 1 + src/main/java/com/chaitin/xray/form/AllPoCForm.java | 5 +++++ src/main/java/com/chaitin/xray/model/Poc.java | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 3758d5c..645a599 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -236,5 +236,6 @@ Others: - [important] [improve] CPU占用较高需要进行优化 #128 - [bug] 提示文字的翻译有误 #133 - [feat] 被动扫描允许自由设置(目前仅支持127) #131 +- [improve] 查看搜索PoC时应该排序以提高效率 #134 - [improve] 不常用的配置应该都移到高级配置中 #132 - [improve] 避免直接使用其他项目的图标 #130 \ No newline at end of file diff --git a/src/main/java/com/chaitin/xray/form/AllPoCForm.java b/src/main/java/com/chaitin/xray/form/AllPoCForm.java index e16b9d7..9c6a4b7 100644 --- a/src/main/java/com/chaitin/xray/form/AllPoCForm.java +++ b/src/main/java/com/chaitin/xray/form/AllPoCForm.java @@ -10,6 +10,7 @@ import javax.swing.text.StyleContext; import java.awt.*; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Locale; @@ -51,11 +52,15 @@ public AllPoCForm() { } } StringBuilder sb = new StringBuilder(); + + Collections.sort(result); + for (String r : result) { sb.append(r); sb.append("\n"); } pocList.setText(sb.toString()); + pocList.setCaretPosition(0); }); } diff --git a/src/main/java/com/chaitin/xray/model/Poc.java b/src/main/java/com/chaitin/xray/model/Poc.java index 1bcc28e..e4763d6 100644 --- a/src/main/java/com/chaitin/xray/model/Poc.java +++ b/src/main/java/com/chaitin/xray/model/Poc.java @@ -2,6 +2,8 @@ import com.chaitin.xray.utils.StringUtil; +import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.List; @@ -34,7 +36,11 @@ public static HashSet getPocList() { public static String getString() { StringBuilder sb = new StringBuilder(); - for (String s : pocList) { + + List finalList = new ArrayList<>(pocList); + Collections.sort(finalList); + + for (String s : finalList) { sb.append(s); sb.append("\n"); }