Version: 2.3 Update
This commit is contained in:
@@ -32,7 +32,7 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
|||||||
this.callbacks = callbacks;
|
this.callbacks = callbacks;
|
||||||
BurpExtender.helpers = callbacks.getHelpers();
|
BurpExtender.helpers = callbacks.getHelpers();
|
||||||
|
|
||||||
String version = "2.2.3";
|
String version = "2.3";
|
||||||
callbacks.setExtensionName(String.format("HaE (%s) - Highlighter and Extractor", version));
|
callbacks.setExtensionName(String.format("HaE (%s) - Highlighter and Extractor", version));
|
||||||
// 定义输出
|
// 定义输出
|
||||||
stdout = new PrintWriter(callbacks.getStdout(), true);
|
stdout = new PrintWriter(callbacks.getStdout(), true);
|
||||||
@@ -189,6 +189,7 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
|
|||||||
Object[][] data = new Object[extractData.length][1];
|
Object[][] data = new Object[extractData.length][1];
|
||||||
for (int x = 0; x < extractData.length; x++) {
|
for (int x = 0; x < extractData.length; x++) {
|
||||||
data[x][0] = extractData[x];
|
data[x][0] = extractData[x];
|
||||||
|
stdout.println(extractData[x]);
|
||||||
}
|
}
|
||||||
int indexOfTab = this.jTabbedPane.indexOfTab(i);
|
int indexOfTab = this.jTabbedPane.indexOfTab(i);
|
||||||
JScrollPane jScrollPane = new JScrollPane(new JTable(data, new Object[] {"Information"}));
|
JScrollPane jScrollPane = new JScrollPane(new JTable(data, new Object[] {"Information"}));
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import burp.Config;
|
import burp.Config;
|
||||||
import burp.yaml.LoadConfig;
|
|
||||||
import dk.brics.automaton.Automaton;
|
import dk.brics.automaton.Automaton;
|
||||||
import dk.brics.automaton.AutomatonMatcher;
|
import dk.brics.automaton.AutomatonMatcher;
|
||||||
import dk.brics.automaton.RegExp;
|
import dk.brics.automaton.RegExp;
|
||||||
@@ -33,6 +32,7 @@ public class ExtractContent {
|
|||||||
String color = objects[3].toString();
|
String color = objects[3].toString();
|
||||||
String scope = objects[4].toString();
|
String scope = objects[4].toString();
|
||||||
String engine = objects[5].toString();
|
String engine = objects[5].toString();
|
||||||
|
boolean sensitive = (Boolean) objects[6];
|
||||||
// 判断规则是否开启与作用域
|
// 判断规则是否开启与作用域
|
||||||
if (loaded && (scope.contains(scopeString) || "any".equals(scope))) {
|
if (loaded && (scope.contains(scopeString) || "any".equals(scope))) {
|
||||||
switch (scope) {
|
switch (scope) {
|
||||||
@@ -54,7 +54,13 @@ public class ExtractContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ("nfa".equals(engine)) {
|
if ("nfa".equals(engine)) {
|
||||||
Pattern pattern = new Pattern(regex);
|
Pattern pattern;
|
||||||
|
// 判断规则是否大小写敏感
|
||||||
|
if (sensitive) {
|
||||||
|
pattern = new Pattern(regex);
|
||||||
|
} else {
|
||||||
|
pattern = new Pattern(regex, Pattern.IGNORE_CASE);
|
||||||
|
}
|
||||||
Matcher matcher = pattern.matcher(matchContent);
|
Matcher matcher = pattern.matcher(matchContent);
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
// 添加匹配数据至list
|
// 添加匹配数据至list
|
||||||
|
|||||||
@@ -284,7 +284,7 @@ class TabTitleEditListener extends MouseAdapter implements ChangeListener, Docum
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void newTab(){
|
public void newTab(){
|
||||||
Object[][] data = new Object[][]{{false, "New Name", "(New Regex)", "gray", "any", "nfa"}};
|
Object[][] data = new Object[][]{{false, "New Name", "(New Regex)", "gray", "any", "nfa", false}};
|
||||||
insertTab(ruleEditTabbedPane, setConfig.newRules(),data);
|
insertTab(ruleEditTabbedPane, setConfig.newRules(),data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package burp.ui;
|
|||||||
|
|
||||||
import burp.yaml.SetConfig;
|
import burp.yaml.SetConfig;
|
||||||
|
|
||||||
|
import java.awt.event.ComponentListener;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.TableModelEvent;
|
import javax.swing.event.TableModelEvent;
|
||||||
import javax.swing.event.TableModelListener;
|
import javax.swing.event.TableModelListener;
|
||||||
@@ -24,38 +25,46 @@ public class RulePane extends JPanel {
|
|||||||
private Boolean isEdit = false;
|
private Boolean isEdit = false;
|
||||||
|
|
||||||
private void ruleAddMouseClicked(MouseEvent e, JTabbedPane pane) {
|
private void ruleAddMouseClicked(MouseEvent e, JTabbedPane pane) {
|
||||||
RuleSetting add = new RuleSetting();
|
RuleSetting ruleSettingPanel = new RuleSetting();
|
||||||
int isOk = JOptionPane.showConfirmDialog(null, add, "RuleSetting - Add Rule", JOptionPane.OK_OPTION);
|
int showState = JOptionPane.showConfirmDialog(null, ruleSettingPanel, "RuleSetting - Add Rule", JOptionPane.OK_OPTION);
|
||||||
if(isOk == 0){
|
if(showState == 0){
|
||||||
Vector data = new Vector();
|
Vector ruleData = new Vector();
|
||||||
data.add(false);
|
ruleData.add(false);
|
||||||
data.add(add.Name.getText());
|
ruleData.add(ruleSettingPanel.ruleNameTextField.getText());
|
||||||
data.add(add.regexTextField.getText());
|
ruleData.add(ruleSettingPanel.regexTextField.getText());
|
||||||
data.add(add.colorComboBox.getSelectedItem().toString());
|
ruleData.add(ruleSettingPanel.colorComboBox.getSelectedItem().toString());
|
||||||
data.add(add.scopeComboBox.getSelectedItem().toString());
|
ruleData.add(ruleSettingPanel.scopeComboBox.getSelectedItem().toString());
|
||||||
data.add(add.engineComboBox.getSelectedItem().toString());
|
ruleData.add(ruleSettingPanel.engineComboBox.getSelectedItem().toString());
|
||||||
model.insertRow(model.getRowCount(), data);
|
ruleData.add(ruleSettingPanel.sensitiveComboBox.getSelectedItem());
|
||||||
|
model.insertRow(model.getRowCount(), ruleData);
|
||||||
model = (DefaultTableModel) ruleTable.getModel();
|
model = (DefaultTableModel) ruleTable.getModel();
|
||||||
setConfig.add(data, pane.getTitleAt(pane.getSelectedIndex()));
|
setConfig.add(ruleData, pane.getTitleAt(pane.getSelectedIndex()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ruleEditMouseClicked(MouseEvent e, JTabbedPane pane){
|
private void ruleEditMouseClicked(MouseEvent e, JTabbedPane pane){
|
||||||
if (ruleTable.getSelectedRowCount() >= 1){
|
if (ruleTable.getSelectedRowCount() >= 1){
|
||||||
RuleSetting edit = new RuleSetting();
|
RuleSetting ruleSettingPanel = new RuleSetting();
|
||||||
edit.Name.setText(ruleTable.getValueAt(ruleTable.getSelectedRow(), 1).toString());
|
ruleSettingPanel.ruleNameTextField.setText(ruleTable.getValueAt(ruleTable.getSelectedRow(), 1).toString());
|
||||||
edit.regexTextField.setText(ruleTable.getValueAt(ruleTable.getSelectedRow(), 2).toString());
|
ruleSettingPanel.regexTextField.setText(ruleTable.getValueAt(ruleTable.getSelectedRow(), 2).toString());
|
||||||
edit.colorComboBox.setSelectedItem(ruleTable.getValueAt(ruleTable.getSelectedRow(), 3).toString());
|
ruleSettingPanel.colorComboBox.setSelectedItem(ruleTable.getValueAt(ruleTable.getSelectedRow(), 3).toString());
|
||||||
edit.scopeComboBox.setSelectedItem(ruleTable.getValueAt(ruleTable.getSelectedRow(), 4).toString());
|
ruleSettingPanel.scopeComboBox.setSelectedItem(ruleTable.getValueAt(ruleTable.getSelectedRow(), 4).toString());
|
||||||
edit.engineComboBox.setSelectedItem(ruleTable.getValueAt(ruleTable.getSelectedRow(), 5).toString());
|
ruleSettingPanel.engineComboBox.setSelectedItem(ruleTable.getValueAt(ruleTable.getSelectedRow(), 5).toString());
|
||||||
int isOk = JOptionPane.showConfirmDialog(null, edit, "RuleSetting - Edit Rule", JOptionPane.OK_OPTION);
|
ruleSettingPanel.sensitiveComboBox.setSelectedItem(ruleTable.getValueAt(ruleTable.getSelectedRow(),6).toString());
|
||||||
if (isOk == 0){
|
|
||||||
|
ruleSettingPanel.sensitiveComboBox.setEnabled(
|
||||||
|
ruleSettingPanel.engineComboBox.getSelectedItem().toString().equals("nfa")
|
||||||
|
);
|
||||||
|
|
||||||
|
int showState = JOptionPane.showConfirmDialog(null, ruleSettingPanel, "RuleSetting - Edit Rule", JOptionPane.OK_OPTION);
|
||||||
|
if (showState == 0){
|
||||||
int select = ruleTable.convertRowIndexToModel(ruleTable.getSelectedRow());
|
int select = ruleTable.convertRowIndexToModel(ruleTable.getSelectedRow());
|
||||||
model.setValueAt(edit.Name.getText(), select, 1);
|
model.setValueAt(ruleSettingPanel.ruleNameTextField.getText(), select, 1);
|
||||||
model.setValueAt(edit.regexTextField.getText(), select, 2);
|
model.setValueAt(ruleSettingPanel.regexTextField.getText(), select, 2);
|
||||||
model.setValueAt(edit.colorComboBox.getSelectedItem().toString(), select, 3);
|
model.setValueAt(ruleSettingPanel.colorComboBox.getSelectedItem().toString(), select, 3);
|
||||||
model.setValueAt(edit.scopeComboBox.getSelectedItem().toString(), select, 4);
|
model.setValueAt(ruleSettingPanel.scopeComboBox.getSelectedItem().toString(), select, 4);
|
||||||
model.setValueAt(edit.engineComboBox.getSelectedItem().toString(), select, 5);
|
model.setValueAt(ruleSettingPanel.engineComboBox.getSelectedItem().toString(), select, 5);
|
||||||
|
model.setValueAt(ruleSettingPanel.sensitiveComboBox.getSelectedItem(), select, 6);
|
||||||
model = (DefaultTableModel) ruleTable.getModel();
|
model = (DefaultTableModel) ruleTable.getModel();
|
||||||
setConfig.edit((Vector) model.getDataVector().get(select), select, pane.getTitleAt(pane.getSelectedIndex()));
|
setConfig.edit((Vector) model.getDataVector().get(select), select, pane.getTitleAt(pane.getSelectedIndex()));
|
||||||
}
|
}
|
||||||
@@ -111,8 +120,8 @@ public class RulePane extends JPanel {
|
|||||||
});
|
});
|
||||||
|
|
||||||
add(addButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
|
add(addButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
|
||||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||||
new Insets(15, 5, 3, 2), 0, 0));
|
new Insets(15, 5, 3, 2), 0, 0));
|
||||||
|
|
||||||
//---- editButton ----
|
//---- editButton ----
|
||||||
editButton.setText("Edit");
|
editButton.setText("Edit");
|
||||||
@@ -127,8 +136,8 @@ public class RulePane extends JPanel {
|
|||||||
});
|
});
|
||||||
|
|
||||||
add(editButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
|
add(editButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
|
||||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||||
new Insets(0, 5, 3, 2), 0, 0));
|
new Insets(0, 5, 3, 2), 0, 0));
|
||||||
|
|
||||||
//======== scrollPane ========
|
//======== scrollPane ========
|
||||||
{
|
{
|
||||||
@@ -143,8 +152,8 @@ public class RulePane extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add(scrollPane, new GridBagConstraints(1, 0, 1, 4, 0.0, 0.0,
|
add(scrollPane, new GridBagConstraints(1, 0, 1, 4, 0.0, 0.0,
|
||||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||||
new Insets(15, 5, 5, 5), 0, 0));
|
new Insets(15, 5, 5, 5), 0, 0));
|
||||||
|
|
||||||
//---- removeButton ----
|
//---- removeButton ----
|
||||||
removeButton.setText("Remove");
|
removeButton.setText("Remove");
|
||||||
@@ -160,8 +169,8 @@ public class RulePane extends JPanel {
|
|||||||
});
|
});
|
||||||
|
|
||||||
add(removeButton, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
|
add(removeButton, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
|
||||||
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
GridBagConstraints.CENTER, GridBagConstraints.BOTH,
|
||||||
new Insets(0, 5, 3, 2), 0, 0));
|
new Insets(0, 5, 3, 2), 0, 0));
|
||||||
|
|
||||||
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
// JFormDesigner - End of component initialization //GEN-END:initComponents
|
||||||
ruleTable.setModel(model);
|
ruleTable.setModel(model);
|
||||||
@@ -183,7 +192,7 @@ public class RulePane extends JPanel {
|
|||||||
public JTable ruleTable;
|
public JTable ruleTable;
|
||||||
public JButton removeButton;
|
public JButton removeButton;
|
||||||
// JFormDesigner - End of variables declaration //GEN-END:variables
|
// JFormDesigner - End of variables declaration //GEN-END:variables
|
||||||
private final String[] title = new String[]{"Loaded", "Name", "Regex", "Color", "Scope", "Engine"};
|
private final String[] title = new String[]{"Loaded", "Name", "Regex", "Color", "Scope", "Engine", "Sensitive"};
|
||||||
private DefaultTableModel model = new DefaultTableModel() {
|
private DefaultTableModel model = new DefaultTableModel() {
|
||||||
@Override
|
@Override
|
||||||
public Class<?> getColumnClass (int column){
|
public Class<?> getColumnClass (int column){
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package burp.ui;
|
package burp.ui;
|
||||||
|
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.ItemEvent;
|
||||||
|
import java.awt.event.ItemListener;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import burp.Config;
|
import burp.Config;
|
||||||
@@ -14,16 +18,18 @@ public class RuleSetting extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void initComponents() {
|
public void initComponents() {
|
||||||
|
sensitiveLabel = new JLabel();
|
||||||
engineLabel = new JLabel();
|
engineLabel = new JLabel();
|
||||||
scopeLabel = new JLabel();
|
scopeLabel = new JLabel();
|
||||||
regexTextField = new JTextField();
|
regexTextField = new JTextField();
|
||||||
regexLabel = new JLabel();
|
regexLabel = new JLabel();
|
||||||
nameLabel = new JLabel();
|
nameLabel = new JLabel();
|
||||||
Name = new JTextField();
|
ruleNameTextField = new JTextField();
|
||||||
scopeComboBox = new JComboBox<>();
|
scopeComboBox = new JComboBox<>();
|
||||||
engineComboBox = new JComboBox<>();
|
engineComboBox = new JComboBox<>();
|
||||||
colorLabel = new JLabel();
|
colorLabel = new JLabel();
|
||||||
colorComboBox = new JComboBox<>();
|
colorComboBox = new JComboBox<>();
|
||||||
|
sensitiveComboBox = new JComboBox<>();
|
||||||
|
|
||||||
setLayout(null);
|
setLayout(null);
|
||||||
|
|
||||||
@@ -31,6 +37,10 @@ public class RuleSetting extends JPanel {
|
|||||||
add(engineLabel);
|
add(engineLabel);
|
||||||
engineLabel.setBounds(new Rectangle(new Point(10, 175), engineLabel.getPreferredSize()));
|
engineLabel.setBounds(new Rectangle(new Point(10, 175), engineLabel.getPreferredSize()));
|
||||||
|
|
||||||
|
sensitiveLabel.setText("Sensitive:");
|
||||||
|
add(sensitiveLabel);
|
||||||
|
sensitiveLabel.setBounds(new Rectangle(new Point(10,215), sensitiveLabel.getPreferredSize()));
|
||||||
|
|
||||||
scopeLabel.setText("Scope:");
|
scopeLabel.setText("Scope:");
|
||||||
add(scopeLabel);
|
add(scopeLabel);
|
||||||
scopeLabel.setBounds(new Rectangle(new Point(10, 135), scopeLabel.getPreferredSize()));
|
scopeLabel.setBounds(new Rectangle(new Point(10, 135), scopeLabel.getPreferredSize()));
|
||||||
@@ -44,14 +54,25 @@ public class RuleSetting extends JPanel {
|
|||||||
nameLabel.setText("Name:");
|
nameLabel.setText("Name:");
|
||||||
add(nameLabel);
|
add(nameLabel);
|
||||||
nameLabel.setBounds(new Rectangle(new Point(10, 15), nameLabel.getPreferredSize()));
|
nameLabel.setBounds(new Rectangle(new Point(10, 15), nameLabel.getPreferredSize()));
|
||||||
add(Name);
|
add(ruleNameTextField);
|
||||||
Name.setBounds(70, 10, 265, 30);
|
ruleNameTextField.setBounds(70, 10, 265, 30);
|
||||||
|
|
||||||
scopeComboBox.setModel(new DefaultComboBoxModel<>(Config.scopeArray));
|
scopeComboBox.setModel(new DefaultComboBoxModel<>(Config.scopeArray));
|
||||||
add(scopeComboBox);
|
add(scopeComboBox);
|
||||||
scopeComboBox.setBounds(70, 130, 265, scopeComboBox.getPreferredSize().height);
|
scopeComboBox.setBounds(70, 130, 265, scopeComboBox.getPreferredSize().height);
|
||||||
|
|
||||||
engineComboBox.setModel(new DefaultComboBoxModel<>(Config.engineArray));
|
engineComboBox.setModel(new DefaultComboBoxModel<>(Config.engineArray));
|
||||||
|
engineComboBox.addActionListener(new ActionListener() {
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
String engineValue = engineComboBox.getSelectedItem().toString();
|
||||||
|
if (engineValue.equals("nfa")) {
|
||||||
|
sensitiveComboBox.setEnabled(true);
|
||||||
|
} else {
|
||||||
|
sensitiveComboBox.setEnabled(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
add(engineComboBox);
|
add(engineComboBox);
|
||||||
engineComboBox.setBounds(70, 170, 265, engineComboBox.getPreferredSize().height);
|
engineComboBox.setBounds(70, 170, 265, engineComboBox.getPreferredSize().height);
|
||||||
|
|
||||||
@@ -63,6 +84,10 @@ public class RuleSetting extends JPanel {
|
|||||||
add(colorComboBox);
|
add(colorComboBox);
|
||||||
colorComboBox.setBounds(70, 90, 265, colorComboBox.getPreferredSize().height);
|
colorComboBox.setBounds(70, 90, 265, colorComboBox.getPreferredSize().height);
|
||||||
|
|
||||||
|
sensitiveComboBox.setModel(new DefaultComboBoxModel<>(new Boolean[]{true, false}));
|
||||||
|
add(sensitiveComboBox);
|
||||||
|
sensitiveComboBox.setBounds(70,210,265,sensitiveComboBox.getPreferredSize().height);
|
||||||
|
|
||||||
{
|
{
|
||||||
Dimension preferredSize = new Dimension();
|
Dimension preferredSize = new Dimension();
|
||||||
for(int i = 0; i < getComponentCount(); i++) {
|
for(int i = 0; i < getComponentCount(); i++) {
|
||||||
@@ -79,13 +104,15 @@ public class RuleSetting extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private JLabel engineLabel;
|
private JLabel engineLabel;
|
||||||
|
private JLabel sensitiveLabel;
|
||||||
private JLabel scopeLabel;
|
private JLabel scopeLabel;
|
||||||
public JTextField regexTextField;
|
public JTextField regexTextField;
|
||||||
private JLabel regexLabel;
|
private JLabel regexLabel;
|
||||||
private JLabel nameLabel;
|
private JLabel nameLabel;
|
||||||
public JTextField Name;
|
public JTextField ruleNameTextField;
|
||||||
public JComboBox<String> scopeComboBox;
|
public JComboBox<String> scopeComboBox;
|
||||||
public JComboBox<String> engineComboBox;
|
public JComboBox<String> engineComboBox;
|
||||||
private JLabel colorLabel;
|
private JLabel colorLabel;
|
||||||
public JComboBox<String> colorComboBox;
|
public JComboBox<String> colorComboBox;
|
||||||
|
public JComboBox<Boolean> sensitiveComboBox;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ public class LoadConfig {
|
|||||||
rule.setEngine("nfa");
|
rule.setEngine("nfa");
|
||||||
rule.setScope("response");
|
rule.setScope("response");
|
||||||
rule.setRegex("(([a-zA-Z0-9][_|\\.])*[a-zA-Z0-9]+@([a-zA-Z0-9][-|_|\\.])*[a-zA-Z0-9]+\\.((?!js|css|jpg|jpeg|png|ico)[a-zA-Z]{2,}))");
|
rule.setRegex("(([a-zA-Z0-9][_|\\.])*[a-zA-Z0-9]+@([a-zA-Z0-9][-|_|\\.])*[a-zA-Z0-9]+\\.((?!js|css|jpg|jpeg|png|ico)[a-zA-Z]{2,}))");
|
||||||
|
rule.setSensitive(false);
|
||||||
|
|
||||||
Rules rules = new Rules();
|
Rules rules = new Rules();
|
||||||
rules.setType("Basic Information");
|
rules.setType("Basic Information");
|
||||||
ArrayList<Rule> rl = new ArrayList<>();
|
ArrayList<Rule> rl = new ArrayList<>();
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public class SetConfig {
|
|||||||
rlTmp.setColor((String) objects[3]);
|
rlTmp.setColor((String) objects[3]);
|
||||||
rlTmp.setScope((String) objects[4]);
|
rlTmp.setScope((String) objects[4]);
|
||||||
rlTmp.setEngine((String) objects[5]);
|
rlTmp.setEngine((String) objects[5]);
|
||||||
|
rlTmp.setSensitive((Boolean) objects[6]);
|
||||||
rl.add(rlTmp);
|
rl.add(rlTmp);
|
||||||
}
|
}
|
||||||
rlsTmp.setRule(rl);
|
rlsTmp.setRule(rl);
|
||||||
@@ -87,7 +88,7 @@ public class SetConfig {
|
|||||||
String name = "New ";
|
String name = "New ";
|
||||||
Object[][] data = new Object[][]{
|
Object[][] data = new Object[][]{
|
||||||
{
|
{
|
||||||
false, "New Name", "(New Regex)", "gray", "any", "nfa"
|
false, "New Name", "(New Regex)", "gray", "any", "nfa", false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
while (Config.ruleConfig.containsKey(name + i)) {
|
while (Config.ruleConfig.containsKey(name + i)) {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ public class Rule {
|
|||||||
private String Color;
|
private String Color;
|
||||||
private String Engine;
|
private String Engine;
|
||||||
private String Scope;
|
private String Scope;
|
||||||
|
private Boolean Sensitive;
|
||||||
|
|
||||||
public Boolean getLoaded() {
|
public Boolean getLoaded() {
|
||||||
return Loaded;
|
return Loaded;
|
||||||
@@ -38,6 +39,9 @@ public class Rule {
|
|||||||
return Scope;
|
return Scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getSensitive(){
|
||||||
|
return Sensitive = Sensitive;
|
||||||
|
}
|
||||||
public void setLoaded(Boolean loaded) {
|
public void setLoaded(Boolean loaded) {
|
||||||
this.Loaded = loaded;
|
this.Loaded = loaded;
|
||||||
}
|
}
|
||||||
@@ -62,9 +66,12 @@ public class Rule {
|
|||||||
public void setScope(String scope) {
|
public void setScope(String scope) {
|
||||||
this.Scope = scope;
|
this.Scope = scope;
|
||||||
}
|
}
|
||||||
|
public void setSensitive(Boolean sensitive){
|
||||||
|
this.Sensitive = sensitive;
|
||||||
|
}
|
||||||
|
|
||||||
public Object[] getRuleObject() {
|
public Object[] getRuleObject() {
|
||||||
return new Object[] { Loaded, Name, Regex, Color, Scope, Engine };
|
return new Object[] { Loaded, Name, Regex, Color, Scope, Engine,Sensitive };
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getRuleObjMap(){
|
public Map<String, Object> getRuleObjMap(){
|
||||||
@@ -75,10 +82,12 @@ public class Rule {
|
|||||||
r.put("Color", Color);
|
r.put("Color", Color);
|
||||||
r.put("Scope", Scope);
|
r.put("Scope", Scope);
|
||||||
r.put("Engine", Engine);
|
r.put("Engine", Engine);
|
||||||
|
r.put("Sensitive", Sensitive);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "{ \nLoaded: " + Loaded + "\nName: " + Name + "\nRegex: " + Regex + "\nColor: " + Color + "\nScope: " + Scope + "\nEngine: " + Engine + "\n}";
|
return "{ \nLoaded: " + Loaded + "\nName: " + Name + "\nRegex: " + Regex + "\nColor: " + Color + "\nScope: " + Scope + "\nEngine: " + Engine + "\nSensitive: " + Sensitive + "\n }";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,9 +28,9 @@ public class Rules {
|
|||||||
this.rule = rule;
|
this.rule = rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRuleObj(){
|
public void setRuleObj(){}
|
||||||
|
|
||||||
}
|
@Override
|
||||||
public String toString(){
|
public String toString(){
|
||||||
return "{ type: "+type+"\n config: "+ rule +"}\n";
|
return "{ type: "+type+"\n config: "+ rule +"}\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user