1010import burp .vaycore .common .widget .HintTextField ;
1111import burp .vaycore .onescan .bean .FpData ;
1212import burp .vaycore .onescan .bean .TaskData ;
13+ import burp .vaycore .onescan .common .Config ;
1314import burp .vaycore .onescan .common .DialogCallbackAdapter ;
1415import burp .vaycore .onescan .manager .FpManager ;
1516import burp .vaycore .onescan .ui .base .BaseTab ;
@@ -30,9 +31,9 @@ public class DataBoardTab extends BaseTab {
3031
3132 private TaskTable mTaskTable ;
3233 private JCheckBox mListenProxyMessage ;
33- private JCheckBox mEnableExcludeHeader ;
34- private JCheckBox mDisableHeaderReplace ;
35- private JCheckBox mDisableDirScan ;
34+ private JCheckBox mExcludeHeader ;
35+ private JCheckBox mReplaceHeader ;
36+ private JCheckBox mDirScan ;
3637 private ArrayList <FilterRule > mLastFilters ;
3738 private HintTextField mFilterRuleText ;
3839
@@ -83,13 +84,13 @@ public void init(Component requestTextEditor, Component responseTextEditor) {
8384 controlPanel .setLayout (new HLayout (5 , true ));
8485 add (controlPanel );
8586 // 代理监听开关
86- mListenProxyMessage = newJCheckBox (controlPanel , "Listen Proxy Message" );
87- // 启用请求头排除开关
88- mEnableExcludeHeader = newJCheckBox (controlPanel , "Enable ExcludeHeader" );
89- // 禁用请求头替换功能
90- mDisableHeaderReplace = newJCheckBox (controlPanel , "Disable HeaderReplace" );
91- // 禁用递归扫描功能
92- mDisableDirScan = newJCheckBox (controlPanel , "Disable DirScan" );
87+ mListenProxyMessage = newJCheckBox (controlPanel , "Listen Proxy Message" , Config . KEY_ENABLE_LISTEN_PROXY );
88+ // 请求头排除开关
89+ mExcludeHeader = newJCheckBox (controlPanel , "Exclude Header" , Config . KEY_ENABLE_EXCLUDE_HEADER );
90+ // 请求头替换开关
91+ mReplaceHeader = newJCheckBox (controlPanel , "Replace Header" , Config . KEY_ENABLE_REPLACE_HEADER );
92+ // 递归扫描开关
93+ mDirScan = newJCheckBox (controlPanel , "DirScan" , Config . KEY_ENABLE_DIR_SCAN );
9394 // 过滤设置
9495 controlPanel .add (new JPanel (), "1w" );
9596 mFilterRuleText = new HintTextField ();
@@ -122,11 +123,20 @@ public void init(Component requestTextEditor, Component responseTextEditor) {
122123 add (mainSplitPanel , "100%" );
123124 }
124125
125- private JCheckBox newJCheckBox (JPanel panel , String text ) {
126- JCheckBox checkBox = new JCheckBox (text , false );
126+ private JCheckBox newJCheckBox (JPanel panel , String text , String configKey ) {
127+ JCheckBox checkBox = new JCheckBox (text , Config . getBoolean ( configKey ) );
127128 checkBox .setFocusable (false );
128129 checkBox .setMargin (new Insets (5 , 5 , 5 , 5 ));
129130 panel .add (checkBox );
131+ checkBox .addActionListener (e -> {
132+ boolean configSelected = Config .getBoolean (configKey );
133+ boolean selected = checkBox .isSelected ();
134+ if (selected == configSelected ) {
135+ return ;
136+ }
137+ // 保存配置
138+ Config .put (configKey , String .valueOf (selected ));
139+ });
130140 return checkBox ;
131141 }
132142
@@ -138,16 +148,16 @@ public boolean hasListenProxyMessage() {
138148 return mListenProxyMessage != null && mListenProxyMessage .isSelected ();
139149 }
140150
141- public boolean hasEnableExcludeHeader () {
142- return mEnableExcludeHeader != null && mEnableExcludeHeader .isSelected ();
151+ public boolean hasExcludeHeader () {
152+ return mExcludeHeader != null && mExcludeHeader .isSelected ();
143153 }
144154
145- public boolean hasDisableHeaderReplace () {
146- return mDisableHeaderReplace != null && mDisableHeaderReplace .isSelected ();
155+ public boolean hasReplaceHeader () {
156+ return mReplaceHeader != null && mReplaceHeader .isSelected ();
147157 }
148158
149- public boolean hasDisableDirScan () {
150- return mDisableDirScan != null && mDisableDirScan .isSelected ();
159+ public boolean hasDirScan () {
160+ return mDirScan != null && mDirScan .isSelected ();
151161 }
152162
153163 /**
0 commit comments