diff --git a/build.gradle b/build.gradle index 6b9df07..345ef41 100644 --- a/build.gradle +++ b/build.gradle @@ -10,9 +10,9 @@ plugins { id 'java-library' id 'application' id 'com.github.johnrengelman.shadow' version '7.1.2' - id 'org.asciidoctor.jvm.base' version '4.0.3' - id 'org.asciidoctor.jvm.convert' version '4.0.3' - id 'org.asciidoctor.jvm.pdf' version '4.0.3' + id 'org.asciidoctor.jvm.base' version '4.0.4' + id 'org.asciidoctor.jvm.convert' version '4.0.4' + id 'org.asciidoctor.jvm.pdf' version '4.0.4' } repositories { @@ -103,7 +103,7 @@ dependencies { // https://mvnrepository.com/artifact/net.portswigger.burp.extensions/montoya-api implementation 'net.portswigger.burp.extensions:montoya-api:2024.12' // https://mvnrepository.com/artifact/commons-codec/commons-codec - implementation 'commons-codec:commons-codec:1.17.1' + implementation 'commons-codec:commons-codec:1.17.2' // https://mvnrepository.com/artifact/com.fifesoft/rsyntaxtextarea implementation 'com.fifesoft:rsyntaxtextarea:3.3.4' @@ -119,8 +119,8 @@ dependencies { // Use JUnit Jupiter for testing. // https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3' - testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.3' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.5' + testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.5' // testImplementation fileTree(dir: 'libs', include: ['*.jar']) @@ -132,7 +132,7 @@ dependencies { // https://mvnrepository.com/artifact/io.github.rburgst/okhttp-digest testImplementation 'io.github.rburgst:okhttp-digest:3.1.1' // https://mvnrepository.com/artifact/com.squareup.okhttp3/mockwebserver - testImplementation 'com.squareup.okhttp3:mockwebserver:4.11.0' + testImplementation 'com.squareup.okhttp3:mockwebserver:4.12.0' // https://mvnrepository.com/artifact/org.mockito/mockito-core testImplementation 'org.mockito:mockito-core:5.4.0' diff --git a/libs/BurpExtensionCommons-v3.2.5.0-all.jar b/libs/BurpExtensionCommons-v3.2.5.0-all.jar index 04a883a..00b4ddf 100644 Binary files a/libs/BurpExtensionCommons-v3.2.5.0-all.jar and b/libs/BurpExtensionCommons-v3.2.5.0-all.jar differ diff --git a/release/YaguraExtension-v3.2.jar b/release/YaguraExtension-v3.2.jar new file mode 100644 index 0000000..b751135 Binary files /dev/null and b/release/YaguraExtension-v3.2.jar differ diff --git a/src/main/java/yagura/model/SendToExtend.java b/src/main/java/yagura/model/SendToExtend.java index c2ae515..4386848 100644 --- a/src/main/java/yagura/model/SendToExtend.java +++ b/src/main/java/yagura/model/SendToExtend.java @@ -225,13 +225,14 @@ public boolean isEnabled() { || (this.contextMenu.invocationType() == null); // Orgnaizerではnull break; } - case REQUEST_BODY_TO_FILE: + case REQUEST_BODY_TO_FILE: { enabled = (this.contextMenu.invocationType() == InvocationType.PROXY_HISTORY) || (this.contextMenu.invocationType() == InvocationType.SEARCH_RESULTS) || (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_REQUEST) || (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_REQUEST) || (this.contextMenu.invocationType() == null); // Orgnaizerではnull break; + } case RESPONSE_BODY_TO_FILE: { enabled = (this.contextMenu.invocationType() == InvocationType.PROXY_HISTORY) || (this.contextMenu.invocationType() == InvocationType.SEARCH_RESULTS) @@ -252,7 +253,7 @@ public boolean isEnabled() { || (this.contextMenu.invocationType() == null); // Orgnaizerではnull break; } - case MESSAGE_INFO_COPY: + case MESSAGE_INFO_COPY: { enabled = (this.contextMenu.invocationType() == InvocationType.PROXY_HISTORY) || (this.contextMenu.invocationType() == InvocationType.SEARCH_RESULTS) || (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_REQUEST) @@ -261,6 +262,7 @@ public boolean isEnabled() { || (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_RESPONSE) || (this.contextMenu.invocationType() == null); // Orgnaizerではnull break; + } case ADD_HOST_TO_INCLUDE_SCOPE: case ADD_HOST_TO_EXCLUDE_SCOPE: case ADD_TO_EXCLUDE_SCOPE: { diff --git a/src/main/java/yagura/model/SendToParameterProperty.java b/src/main/java/yagura/model/SendToParameterProperty.java index 927edb4..1cfa967 100644 --- a/src/main/java/yagura/model/SendToParameterProperty.java +++ b/src/main/java/yagura/model/SendToParameterProperty.java @@ -242,10 +242,11 @@ public Properties getProperties() { public static String getParameter(SendToParameterProperty.SendToParameterType type, HttpRequestResponse messageInfo) { String value = null; switch (type) { - case HISTORY_COMMENT: + case HISTORY_COMMENT: { value = messageInfo.annotations().notes(); break; - case RESPONSE_TITLE: + } + case RESPONSE_TITLE: { if (messageInfo.response() != null) { try { HttpResponseWapper wrapResponse = new HttpResponseWapper(messageInfo.response()); @@ -262,8 +263,10 @@ public static String getParameter(SendToParameterProperty.SendToParameterType ty } } break; - case HISTORY_NUMBER: + } + case HISTORY_NUMBER: { break; + } } return value; } @@ -275,14 +278,17 @@ public static String extractLinePart(SendToParameterProperty.LinePartType commen Matcher m = LINE_PART.matcher(part); if (m.find()) { switch (commentLineType) { - case FIRST_LINE: + case FIRST_LINE: { part = m.group(1); break; - case SECOND_LINE: + } + case SECOND_LINE: { part = m.group(2); break; - default: + } + default: { break; + } } } return part; diff --git a/src/main/java/yagura/model/SendToServer.java b/src/main/java/yagura/model/SendToServer.java index a79c262..f15de81 100644 --- a/src/main/java/yagura/model/SendToServer.java +++ b/src/main/java/yagura/model/SendToServer.java @@ -492,12 +492,14 @@ public void run() { String authorizationPasswd = extendConnectionProp.getAuthorizationPasswd(); okhttp3.Authenticator authenticator = null; switch (authorizationType) { - case BASIC: + case BASIC: { authenticator = new BasicAuthenticator(new com.burgstaller.okhttp.digest.Credentials(authorizationUser, authorizationPasswd)); break; - case DIGEST: + } + case DIGEST: { authenticator = new DigestAuthenticator(new com.burgstaller.okhttp.digest.Credentials(authorizationUser, authorizationPasswd)); break; + } } // Proxy diff --git a/src/main/java/yagura/view/BurpToolBar.java b/src/main/java/yagura/view/BurpToolBar.java index 4e305b1..3d3efa5 100644 --- a/src/main/java/yagura/view/BurpToolBar.java +++ b/src/main/java/yagura/view/BurpToolBar.java @@ -416,14 +416,16 @@ private void mnuSaveProjectSettingsActionPerformed(java.awt.event.ActionEvent ev public void applyStyleTheme(Theme theme) { switch (theme) { - case DARK: + case DARK: { this.tglIntercept.setIcon(inspector_off_dark); this.tglIntercept.setSelectedIcon(inspector_on_dark); break; - case LIGHT: + } + case LIGHT: { this.tglIntercept.setIcon(inspector_off_light); this.tglIntercept.setSelectedIcon(inspector_on_light); break; + } } this.tglIntercept.updateUI(); } diff --git a/src/main/java/yagura/view/ConnectionsPanel.java b/src/main/java/yagura/view/ConnectionsPanel.java index 6a4c822..3191204 100644 --- a/src/main/java/yagura/view/ConnectionsPanel.java +++ b/src/main/java/yagura/view/ConnectionsPanel.java @@ -569,15 +569,18 @@ public void setProperty(HttpExtendProperty prop) { this.rdoBurpClient.setSelected(true); } switch (httpProtocol) { - case HTTP_1_1: + case HTTP_1_1: { this.rdoHttpProtocol1.setSelected(true); break; - case HTTP_2: + } + case HTTP_2: { this.rdoHttpProtocol2.setSelected(true); break; - default: + } + default: { this.rdoHttpProtocolAuto.setSelected(true); break; + } } this.spnTimeout.setValue(prop.getTimeout()); diff --git a/src/main/java/yagura/view/HotKeyDlg.form b/src/main/java/yagura/view/HotKeyDlg.form index 730028c..51c69b4 100644 --- a/src/main/java/yagura/view/HotKeyDlg.form +++ b/src/main/java/yagura/view/HotKeyDlg.form @@ -18,7 +18,7 @@ - + @@ -33,19 +33,19 @@ - + - + + - - + @@ -60,7 +60,7 @@ - + @@ -101,7 +101,7 @@ - + diff --git a/src/main/java/yagura/view/HotKeyDlg.java b/src/main/java/yagura/view/HotKeyDlg.java index 177575b..18b6835 100644 --- a/src/main/java/yagura/view/HotKeyDlg.java +++ b/src/main/java/yagura/view/HotKeyDlg.java @@ -53,14 +53,14 @@ private void initComponents() { .addGroup(pnlMainLayout.createSequentialGroup() .addContainerGap() .addGroup(pnlMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtKey, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(pnlMainLayout.createSequentialGroup() .addComponent(chkControl) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(chkShift) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(chkAlt)) - .addComponent(txtKey, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(235, Short.MAX_VALUE)) + .addComponent(chkAlt))) + .addContainerGap(294, Short.MAX_VALUE)) ); pnlMainLayout.setVerticalGroup( pnlMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -72,7 +72,7 @@ private void initComponents() { .addComponent(chkAlt)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtKey, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(87, Short.MAX_VALUE)) + .addContainerGap(100, Short.MAX_VALUE)) ); getContentPane().add(pnlMain, java.awt.BorderLayout.CENTER); @@ -98,7 +98,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { pnlApplyLayout.setHorizontalGroup( pnlApplyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlApplyLayout.createSequentialGroup() - .addContainerGap(203, Short.MAX_VALUE) + .addContainerGap(353, Short.MAX_VALUE) .addComponent(btnOK, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnCancel, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -182,6 +182,20 @@ public void windowClosing(java.awt.event.WindowEvent e) { private javax.swing.JTextField txtKey; // End of variables declaration//GEN-END:variables + public void setHotKey(KeyStroke ks) { + int modifiers = ks.getModifiers(); + if ((modifiers &= KeyEvent.CTRL_DOWN_MASK) == KeyEvent.CTRL_DOWN_MASK) { + this.chkControl.setSelected(true); + } + if ((modifiers &= KeyEvent.SHIFT_DOWN_MASK) == KeyEvent.SHIFT_DOWN_MASK) { + this.chkShift.setSelected(true); + } + if ((modifiers &= KeyEvent.ALT_GRAPH_DOWN_MASK) == KeyEvent.ALT_GRAPH_DOWN_MASK) { + this.chkAlt.setSelected(true); + } + this.txtKey.setText(String.valueOf(ks.getKeyChar())); + } + public KeyStroke getHotKey() { int modifiers = 0; if (this.chkControl.isSelected()) { @@ -192,9 +206,9 @@ public KeyStroke getHotKey() { } if (this.chkAlt.isSelected()) { modifiers |= KeyEvent.ALT_GRAPH_DOWN_MASK; - } + } return KeyStroke.getKeyStroke(ConvertUtil.parseIntDefault(this.txtKey.getText(), -1), modifiers); - } + } } diff --git a/src/main/java/yagura/view/SendToParameterPanel.java b/src/main/java/yagura/view/SendToParameterPanel.java index 3fcbddf..5d8ffa8 100644 --- a/src/main/java/yagura/view/SendToParameterPanel.java +++ b/src/main/java/yagura/view/SendToParameterPanel.java @@ -297,15 +297,18 @@ public void setProperty(SendToParameterProperty prop) { } switch (prop.getReqNameLineType()) { - case FIRST_LINE: + case FIRST_LINE: { this.rdoReqNameFirstLine.setSelected(true); break; - case SECOND_LINE: + } + case SECOND_LINE: { this.rdoReqNameSecondLine.setSelected(true); break; - default: + } + default: { this.rdoReqNameAllLine.setSelected(true); break; + } } this.chkUseReqNotes.setSelected(prop.isUseReqComment());