From 225ee471ecb17f1e6b878756b5a4f18cda5b3a78 Mon Sep 17 00:00:00 2001 From: AnonymousUser Date: Fri, 15 Jul 2022 10:12:34 +0800 Subject: [PATCH] Version: 2.4.2 Update --- src/main/java/burp/BurpExtender.java | 6 ++-- .../java/burp/ui/JTabbedPaneCloseButton.java | 1 - src/main/java/burp/ui/MainUI.java | 30 +++++-------------- src/main/java/burp/ui/RulePane.java | 29 +++++++++--------- 4 files changed, 25 insertions(+), 41 deletions(-) diff --git a/src/main/java/burp/BurpExtender.java b/src/main/java/burp/BurpExtender.java index c6dba75..12c6d9e 100644 --- a/src/main/java/burp/BurpExtender.java +++ b/src/main/java/burp/BurpExtender.java @@ -34,12 +34,12 @@ public void registerExtenderCallbacks(final IBurpExtenderCallbacks callbacks) this.callbacks = callbacks; BurpExtender.helpers = callbacks.getHelpers(); - String version = "2.4.1"; + String version = "2.4.2"; callbacks.setExtensionName(String.format("HaE (%s) - Highlighter and Extractor", version)); // 定义输出 stdout = new PrintWriter(callbacks.getStdout(), true); - stdout.println("@Core Author: EvilChen"); - stdout.println("@Architecture Author: 0chencc"); + stdout.println("@First Author: EvilChen"); + stdout.println("@Second Author: 0chencc"); stdout.println("@Github: https://github.com/gh0stkey/HaE"); // UI SwingUtilities.invokeLater(this::initialize); diff --git a/src/main/java/burp/ui/JTabbedPaneCloseButton.java b/src/main/java/burp/ui/JTabbedPaneCloseButton.java index 923beb4..4bd8ccb 100644 --- a/src/main/java/burp/ui/JTabbedPaneCloseButton.java +++ b/src/main/java/burp/ui/JTabbedPaneCloseButton.java @@ -60,7 +60,6 @@ public void addTabNoExit(String title, Component component) { /** Button */ public class CloseButtonTab extends JPanel { - public CloseButtonTab(final Component tab, String title, Icon icon) { setOpaque(false); FlowLayout flowLayout = new FlowLayout(FlowLayout.CENTER, 3, 3); diff --git a/src/main/java/burp/ui/MainUI.java b/src/main/java/burp/ui/MainUI.java index 70f58cd..db28cfd 100644 --- a/src/main/java/burp/ui/MainUI.java +++ b/src/main/java/burp/ui/MainUI.java @@ -44,7 +44,7 @@ public void closeTabActionPerformed(ActionEvent e){ } } - private void onlineUpdateMouseClicked(MouseEvent e) { + private void onlineUpdateActionPerformed(ActionEvent e) { String url = "https://raw.githubusercontent.com/gh0stkey/HaE/gh-pages/Config.yml"; OkHttpClient httpClient = new OkHttpClient(); Request httpRequest = new Request.Builder().url(url).get().build(); @@ -62,6 +62,7 @@ private void onlineUpdateMouseClicked(MouseEvent e) { } new LoadConfig(); + reloadRule(); } private void reloadRule(){ @@ -78,11 +79,11 @@ private void reloadRule(){ ruleSwitch.setListen(true); } - private void reloadMouseClicked(MouseEvent e) { + private void reloadActionPerformed(ActionEvent e) { reloadRule(); } - private void excludeSuffixSaveMouseClicked(MouseEvent e) { + private void excludeSuffixSaveActionPerformed(ActionEvent e) { LoadConfig loadCon = new LoadConfig(); loadCon.setExcludeSuffix(excludeSuffixTextField.getText()); } @@ -125,23 +126,13 @@ private void initComponents() { new Insets(5, 5, 5, 5), 0, 0)); onlineUpdateButton.setText("Online Update"); - onlineUpdateButton.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - onlineUpdateMouseClicked(e); - } - }); + onlineUpdateButton.addActionListener(this::onlineUpdateActionPerformed); rulePanel.add(onlineUpdateButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 0, 5, 5), 0, 0)); reloadButton.setText("Reload"); - reloadButton.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - reloadMouseClicked(e); - } - }); + reloadButton.addActionListener(this::reloadActionPerformed); rulePanel.add(reloadButton, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, @@ -156,12 +147,7 @@ public void mouseClicked(MouseEvent e) { new Insets(0, 0, 0, 5), 0, 0)); excludeSuffixSaveButton.setText("Save"); - excludeSuffixSaveButton.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - excludeSuffixSaveMouseClicked(e); - } - }); + excludeSuffixSaveButton.addActionListener(this::excludeSuffixSaveActionPerformed); rulePanel.add(excludeSuffixSaveButton, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.SOUTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 5), 0, 0)); @@ -183,7 +169,7 @@ public void mouseClicked(MouseEvent e) { ruleSwitch = new TabTitleEditListener(ruleTabbedPane); ruleTabbedPane.addChangeListener(ruleSwitch); ruleTabbedPane.addMouseListener(ruleSwitch); - closeTabMenuItem.addActionListener(e -> closeTabActionPerformed(e)); + closeTabMenuItem.addActionListener(this::closeTabActionPerformed); tabMenu.add(closeTabMenuItem); } diff --git a/src/main/java/burp/ui/RulePane.java b/src/main/java/burp/ui/RulePane.java index bfe26cb..15cfaa5 100644 --- a/src/main/java/burp/ui/RulePane.java +++ b/src/main/java/burp/ui/RulePane.java @@ -2,15 +2,14 @@ import burp.yaml.SetConfig; -import java.awt.event.ComponentListener; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import javax.swing.*; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableRowSorter; import java.awt.*; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; import java.util.Vector; /** @@ -24,7 +23,7 @@ public RulePane(Object[][] data, JTabbedPane pane) { private SetConfig setConfig = new SetConfig(); private Boolean isEdit = false; - private void ruleAddMouseClicked(MouseEvent e, JTabbedPane pane) { + private void ruleAddActionPerformed(ActionEvent e, JTabbedPane pane) { RuleSetting ruleSettingPanel = new RuleSetting(); int showState = JOptionPane.showConfirmDialog(null, ruleSettingPanel, "RuleSetting - Add Rule", JOptionPane.OK_OPTION); if(showState == 0){ @@ -42,7 +41,7 @@ private void ruleAddMouseClicked(MouseEvent e, JTabbedPane pane) { } } - private void ruleEditMouseClicked(MouseEvent e, JTabbedPane pane){ + private void ruleEditActionPerformed(ActionEvent e, JTabbedPane pane){ if (ruleTable.getSelectedRowCount() >= 1){ RuleSetting ruleSettingPanel = new RuleSetting(); ruleSettingPanel.ruleNameTextField.setText(ruleTable.getValueAt(ruleTable.getSelectedRow(), 1).toString()); @@ -71,7 +70,7 @@ private void ruleEditMouseClicked(MouseEvent e, JTabbedPane pane){ } } - private void ruleRemoveMouseClicked(MouseEvent e, JTabbedPane pane){ + private void ruleRemoveActionPerformed(ActionEvent e, JTabbedPane pane){ if (ruleTable.getSelectedRowCount() >= 1){ int isOk = JOptionPane.showConfirmDialog(null, "Are your sure?", "RuleSetting - Delete Rule", JOptionPane.OK_OPTION); if (isOk == 0){ @@ -109,11 +108,11 @@ private void initComponents(Object[][] data, JTabbedPane pane) { //---- addButton ---- addButton.setText("Add"); - addButton.addMouseListener(new MouseAdapter() { + addButton.addActionListener(new ActionListener() { @Override - public void mouseClicked(MouseEvent e) { + public void actionPerformed(ActionEvent e) { isEdit = true; - ruleAddMouseClicked(e, pane); + ruleAddActionPerformed(e, pane); model = (DefaultTableModel) ruleTable.getModel(); isEdit = false; } @@ -125,11 +124,11 @@ public void mouseClicked(MouseEvent e) { //---- editButton ---- editButton.setText("Edit"); - editButton.addMouseListener(new MouseAdapter() { + editButton.addActionListener(new ActionListener() { @Override - public void mouseClicked(MouseEvent e) { + public void actionPerformed(ActionEvent e) { isEdit = true; - ruleEditMouseClicked(e, pane); + ruleEditActionPerformed(e, pane); model = (DefaultTableModel) ruleTable.getModel(); isEdit = false; } @@ -158,11 +157,11 @@ public void mouseClicked(MouseEvent e) { //---- removeButton ---- removeButton.setText("Remove"); - removeButton.addMouseListener(new MouseAdapter() { + removeButton.addActionListener(new ActionListener() { @Override - public void mouseClicked(MouseEvent e) { + public void actionPerformed(ActionEvent e) { isEdit = true; - ruleRemoveMouseClicked(e, pane); + ruleRemoveActionPerformed(e, pane); model = (DefaultTableModel) ruleTable.getModel(); isEdit = false; }