Skip to content

Commit a99c2bc

Browse files
author
isayan
committed
ToolbarにBurp Configボタン追加
1 parent 0321c18 commit a99c2bc

File tree

3 files changed

+32
-23
lines changed

3 files changed

+32
-23
lines changed

release/YaguraExtension-v3.2.jar

280 Bytes
Binary file not shown.

src/main/java/yagura/view/BurpToolBar.form

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,16 @@
288288
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBurpOptionActionPerformed"/>
289289
</Events>
290290
</Component>
291+
<Component class="javax.swing.JButton" name="btnBurpConfig">
292+
<Properties>
293+
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
294+
<Image iconType="3" name="/yagura/resources/cog.png"/>
295+
</Property>
296+
<Property name="focusable" type="boolean" value="false"/>
297+
<Property name="horizontalTextPosition" type="int" value="0"/>
298+
<Property name="verticalTextPosition" type="int" value="3"/>
299+
</Properties>
300+
</Component>
291301
</SubComponents>
292302
</Container>
293303
</SubComponents>

src/main/java/yagura/view/BurpToolBar.java

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import extension.burp.BurpUtil;
99
import extension.helpers.FileUtil;
1010
import extension.helpers.StringUtil;
11+
import java.awt.Frame;
1112
import java.awt.Point;
1213
import java.awt.event.ActionEvent;
1314
import java.awt.event.ActionListener;
@@ -19,6 +20,7 @@
1920
import java.util.logging.Level;
2021
import java.util.logging.Logger;
2122
import javax.swing.DefaultComboBoxModel;
23+
import javax.swing.JButton;
2224
import javax.swing.JCheckBoxMenuItem;
2325
import javax.swing.JFileChooser;
2426
import javax.swing.JOptionPane;
@@ -89,6 +91,7 @@ private void initComponents() {
8991
btnWrapTabLayout = new javax.swing.JButton();
9092
btnScrollTabLayout = new javax.swing.JButton();
9193
btnBurpOption = new javax.swing.JButton();
94+
btnBurpConfig = new javax.swing.JButton();
9295

9396
mnuLoadProjectSettings.setText("Load project settings");
9497
mnuLoadProjectSettings.setToolTipText("");
@@ -295,6 +298,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
295298
});
296299
toolBar.add(btnBurpOption);
297300

301+
btnBurpConfig.setIcon(new javax.swing.ImageIcon(getClass().getResource("/yagura/resources/cog.png"))); // NOI18N
302+
btnBurpConfig.setFocusable(false);
303+
btnBurpConfig.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
304+
btnBurpConfig.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
305+
toolBar.add(btnBurpConfig);
306+
298307
add(toolBar, java.awt.BorderLayout.CENTER);
299308
}// </editor-fold>//GEN-END:initComponents
300309

@@ -322,29 +331,24 @@ public void stateChanged(ChangeEvent e) {
322331
private void customizeComponents() {
323332
this.cmbProfile.setModel(this.modelProfile);
324333
this.renewProfile();
325-
JToggleButton button = BurpUtil.findSuiteIntercept(BurpUtil.suiteFrame());
334+
Frame frame = BurpUtil.suiteFrame();
335+
JToggleButton button = BurpUtil.findSuiteIntercept(frame);
326336
if (button != null) {
327337
this.tglButtonChangeListener.stateChanged(new ChangeEvent(button));
328338
button.addChangeListener(this.tglButtonChangeListener);
329339
}
330340

331-
this.popupInterceptOption.addPopupMenuListener(new PopupMenuListener() {
332-
@Override
333-
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
334-
335-
}
336-
337-
@Override
338-
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
339-
340-
}
341-
342-
@Override
343-
public void popupMenuCanceled(PopupMenuEvent e) {
341+
final JButton setting = BurpUtil.findSuiteButton("settingsButton", frame);
342+
this.btnBurpConfig.setVisible(setting != null);
343+
if (setting != null) {
344+
this.btnBurpConfig.addActionListener(new ActionListener() {
345+
@Override
346+
public void actionPerformed(ActionEvent e) {
347+
setting.doClick();
348+
}
349+
});
344350

345-
}
346-
});
347-
// this.timer.schedule(this.task, 0, this.interval_time);
351+
}
348352
}
349353

350354
public boolean isInterceptEnabled() {
@@ -502,12 +506,6 @@ private void mnuSaveProjectSettingsActionPerformed(java.awt.event.ActionEvent ev
502506
}
503507
}//GEN-LAST:event_mnuSaveProjectSettingsActionPerformed
504508

505-
// Frame frame = BurpUtil.suiteFrame();
506-
// JButton setting = BurpUtil.findSuiteButton("settingsButton", frame);
507-
// if (setting != null) {
508-
// setting.doClick();
509-
// }
510-
511509
/**
512510
* Intercept requests based on the following rules
513511
* Request interception rules
@@ -546,6 +544,7 @@ private void mnuChkInterceptInScopeOnlyActionPerformed(java.awt.event.ActionEven
546544
}//GEN-LAST:event_mnuChkInterceptInScopeOnlyActionPerformed
547545

548546
// Variables declaration - do not modify//GEN-BEGIN:variables
547+
private javax.swing.JButton btnBurpConfig;
549548
private javax.swing.JButton btnBurpOption;
550549
private javax.swing.JButton btnInterceptOption;
551550
private javax.swing.JButton btnOpenBrowser;

0 commit comments

Comments
 (0)