|
8 | 8 | import extension.burp.BurpUtil; |
9 | 9 | import extension.helpers.FileUtil; |
10 | 10 | import extension.helpers.StringUtil; |
| 11 | +import java.awt.Frame; |
11 | 12 | import java.awt.Point; |
12 | 13 | import java.awt.event.ActionEvent; |
13 | 14 | import java.awt.event.ActionListener; |
|
19 | 20 | import java.util.logging.Level; |
20 | 21 | import java.util.logging.Logger; |
21 | 22 | import javax.swing.DefaultComboBoxModel; |
| 23 | +import javax.swing.JButton; |
22 | 24 | import javax.swing.JCheckBoxMenuItem; |
23 | 25 | import javax.swing.JFileChooser; |
24 | 26 | import javax.swing.JOptionPane; |
@@ -89,6 +91,7 @@ private void initComponents() { |
89 | 91 | btnWrapTabLayout = new javax.swing.JButton(); |
90 | 92 | btnScrollTabLayout = new javax.swing.JButton(); |
91 | 93 | btnBurpOption = new javax.swing.JButton(); |
| 94 | + btnBurpConfig = new javax.swing.JButton(); |
92 | 95 |
|
93 | 96 | mnuLoadProjectSettings.setText("Load project settings"); |
94 | 97 | mnuLoadProjectSettings.setToolTipText(""); |
@@ -295,6 +298,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { |
295 | 298 | }); |
296 | 299 | toolBar.add(btnBurpOption); |
297 | 300 |
|
| 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 | + |
298 | 307 | add(toolBar, java.awt.BorderLayout.CENTER); |
299 | 308 | }// </editor-fold>//GEN-END:initComponents |
300 | 309 |
|
@@ -322,29 +331,24 @@ public void stateChanged(ChangeEvent e) { |
322 | 331 | private void customizeComponents() { |
323 | 332 | this.cmbProfile.setModel(this.modelProfile); |
324 | 333 | this.renewProfile(); |
325 | | - JToggleButton button = BurpUtil.findSuiteIntercept(BurpUtil.suiteFrame()); |
| 334 | + Frame frame = BurpUtil.suiteFrame(); |
| 335 | + JToggleButton button = BurpUtil.findSuiteIntercept(frame); |
326 | 336 | if (button != null) { |
327 | 337 | this.tglButtonChangeListener.stateChanged(new ChangeEvent(button)); |
328 | 338 | button.addChangeListener(this.tglButtonChangeListener); |
329 | 339 | } |
330 | 340 |
|
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 | + }); |
344 | 350 |
|
345 | | - } |
346 | | - }); |
347 | | -// this.timer.schedule(this.task, 0, this.interval_time); |
| 351 | + } |
348 | 352 | } |
349 | 353 |
|
350 | 354 | public boolean isInterceptEnabled() { |
@@ -502,12 +506,6 @@ private void mnuSaveProjectSettingsActionPerformed(java.awt.event.ActionEvent ev |
502 | 506 | } |
503 | 507 | }//GEN-LAST:event_mnuSaveProjectSettingsActionPerformed |
504 | 508 |
|
505 | | -// Frame frame = BurpUtil.suiteFrame(); |
506 | | -// JButton setting = BurpUtil.findSuiteButton("settingsButton", frame); |
507 | | -// if (setting != null) { |
508 | | -// setting.doClick(); |
509 | | -// } |
510 | | - |
511 | 509 | /** |
512 | 510 | * Intercept requests based on the following rules |
513 | 511 | * Request interception rules |
@@ -546,6 +544,7 @@ private void mnuChkInterceptInScopeOnlyActionPerformed(java.awt.event.ActionEven |
546 | 544 | }//GEN-LAST:event_mnuChkInterceptInScopeOnlyActionPerformed |
547 | 545 |
|
548 | 546 | // Variables declaration - do not modify//GEN-BEGIN:variables |
| 547 | + private javax.swing.JButton btnBurpConfig; |
549 | 548 | private javax.swing.JButton btnBurpOption; |
550 | 549 | private javax.swing.JButton btnInterceptOption; |
551 | 550 | private javax.swing.JButton btnOpenBrowser; |
|
0 commit comments