Skip to content

Commit

Permalink
Important bug fix
Browse files Browse the repository at this point in the history
To address #19
  • Loading branch information
irsdl committed Dec 20, 2023
1 parent a99e3c8 commit 07b0359
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ repositories {
}

dependencies {
compileOnly "net.portswigger.burp.extensions:montoya-api:2023.10.4" //https://central.sonatype.com/artifact/net.portswigger.burp.extensions/montoya-api/
compileOnly "net.portswigger.burp.extensions:montoya-api:2023.12.1" //https://central.sonatype.com/artifact/net.portswigger.burp.extensions/montoya-api/
implementation "com.github.CoreyD97:Burp-Montoya-Utilities:54678c64" //https://jitpack.io/com/github/CoreyD97/Burp-Montoya-Utilities/
//implementation "com.google.code.gson:gson:2.10.1" //https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation "com.google.guava:guava:32.1.3-jre" //https://mvnrepository.com/artifact/com.google.guava/guava
implementation "org.apache.commons:commons-lang3:3.14.0" //https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation "com.formdev:flatlaf:3.2.5" //https://mvnrepository.com/artifact/com.formdev/flatlaf
implementation "org.springframework:spring-core:6.0.14" //https://mvnrepository.com/artifact/org.springframework/spring-core
implementation "org.springframework:spring-core:6.0.15" //https://mvnrepository.com/artifact/org.springframework/spring-core
implementation "com.fifesoft:rsyntaxtextarea:3.3.4" //https://mvnrepository.com/artifact/com.fifesoft/rsyntaxtextarea/
implementation "com.fifesoft:autocomplete:3.3.1" //https://mvnrepository.com/artifact/com.fifesoft/autocomplete
implementation "org.reflections:reflections:0.10.2" // https://mvnrepository.com/artifact/org.reflections/reflections/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,18 +428,34 @@ public JTabbedPane get_rootTabbedPaneUsingMontoya() {
if (this._rootTabbedPane == null) {
try {
JRootPane rootPane = ((JFrame) montoyaApi.userInterface().swingUtils().suiteFrame()).getRootPane();
set_rootTabbedPane((JTabbedPane) rootPane.getContentPane().getComponent(0));
Component firstComponent = rootPane.getContentPane().getComponent(0);

if (firstComponent instanceof JTabbedPane) {
set_rootTabbedPane((JTabbedPane) firstComponent);
} else {
// fix for version 2023.12.1-25776
set_rootTabbedPane((JTabbedPane) ((JLayeredPane) firstComponent).getComponent(1));
}
} catch (Exception e) {
// This is to find the root of the Burp Suite frame when the above fails
// We should not really be here
printlnError("A failure in get_rootTabbedPaneUsingMontoya() has occurred. Hopefully this will be recovered now.");
// Defining how our Burp Suite frame is
UiSpecObject uiSpecObject = new UiSpecObject();
uiSpecObject.set_objectType(JFrame.class);
uiSpecObject.set_isShowing(true);
UiSpecObject uiSpecObject_for_rootPane = new UiSpecObject();
uiSpecObject_for_rootPane.set_objectType(JFrame.class);
uiSpecObject_for_rootPane.set_isShowing(true);

JRootPane rootPane = ((JFrame) UIWalker.findUIObjectInComponents(JFrame.getWindows(), uiSpecObject_for_rootPane)).getRootPane();

UiSpecObject uiSpecObject_for_JTabbedPane = new UiSpecObject();
uiSpecObject_for_JTabbedPane.set_objectType(JTabbedPane.class);
uiSpecObject_for_JTabbedPane.set_isShowing(true);
uiSpecObject_for_JTabbedPane.set_isJComponent(true);
uiSpecObject_for_JTabbedPane.set_minJComponentCount(2);

JTabbedPane jTabbedPane = ((JTabbedPane) UIWalker.findUIObjectInSubComponents(rootPane, 4, uiSpecObject_for_JTabbedPane));

JRootPane rootPane = ((JFrame) UIWalker.findUIObjectInComponents(JFrame.getWindows(), uiSpecObject)).getRootPane();
set_rootTabbedPane((JTabbedPane) rootPane.getContentPane().getComponent(0));
set_rootTabbedPane(jTabbedPane);
}
}
return this._rootTabbedPane;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/extension.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Sharpener
version=4.4
version=4.5
url=https://github.com/irsdl/BurpSuiteSharpenerEx
issueTracker=https://github.com/irsdl/BurpSuiteSharpenerEx/issues
copyright=Released as open source under AGPL license\nOriginally released by MDSec - https://www.mdsec.co.uk/\nDeveloped by Soroush Dalili (@irsdl): https://burpsuite.ninja/
Expand Down

0 comments on commit 07b0359

Please sign in to comment.