Skip to content

Commit

Permalink
Merge branch 'release' into post_release
Browse files Browse the repository at this point in the history
  • Loading branch information
ddwightx committed Sep 11, 2024
2 parents 09c3899 + 5925e59 commit ad91c04
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion extension/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

group 'com.synfron.reshaper.burp'
archivesBaseName = 'reshaper-for-burp'
version '2.5.1'
version '2.5.2'

targetCompatibility = '21'
sourceCompatibility = '21'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ public class ReshaperObj {

public static class VariablesObj {

private final Workspace workspace = Dispatcher.getCurrent().getEventInfo().getWorkspace();

public String getGlobalVariable(String name) {
return getVariable(workspace.getGlobalVariables(), name);
return getVariable(Dispatcher.getCurrent().getEventInfo().getWorkspace().getGlobalVariables(), name);
}

public String getEventVariable(String name) {
Expand All @@ -46,6 +44,7 @@ public String getSessionVariable(String name) {
}

public String[] getGlobalListVariable(String name) {
Workspace workspace = Dispatcher.getCurrent().getEventInfo().getWorkspace();
return getListVariable(workspace.getGlobalVariables(), name);
}

Expand Down Expand Up @@ -81,7 +80,7 @@ public void setGlobalVariable(String name, String value) {
if (!VariableString.isValidVariableName(name)) {
throw new IllegalArgumentException(String.format("Invalid variable name '%s'", name));
}
workspace.getGlobalVariables().add(Variables.asKey(name, false)).setValue(value);
Dispatcher.getCurrent().getEventInfo().getWorkspace().getGlobalVariables().add(Variables.asKey(name, false)).setValue(value);
}

public void setEventVariable(String name, String value) {
Expand All @@ -102,7 +101,7 @@ public void setGlobalListVariable(String name, Object[] values, String delimiter
if (!VariableString.isValidVariableName(name)) {
throw new IllegalArgumentException(String.format("Invalid variable name '%s'", name));
}
ListVariable variable = (ListVariable) workspace.getGlobalVariables().add(Variables.asKey(name, true));
ListVariable variable = (ListVariable) Dispatcher.getCurrent().getEventInfo().getWorkspace().getGlobalVariables().add(Variables.asKey(name, true));
variable.setValues(values, delimiter, SetListItemsPlacement.Overwrite);
}

Expand All @@ -123,7 +122,7 @@ public void setSessionListVariable(String name, Object[] values, String delimite
}

public void deleteGlobalVariable(String name) {
workspace.getGlobalVariables().remove(Variables.asKey(name, false));
Dispatcher.getCurrent().getEventInfo().getWorkspace().getGlobalVariables().remove(Variables.asKey(name, false));
}

public void deleteEventVariable(String name) {
Expand All @@ -135,7 +134,7 @@ public void deleteSessionVariable(String name) {
}

public void deleteGlobalListVariable(String name) {
workspace.getGlobalVariables().remove(Variables.asKey(name, true));
Dispatcher.getCurrent().getEventInfo().getWorkspace().getGlobalVariables().remove(Variables.asKey(name, true));
}

public void deleteEventListVariable(String name) {
Expand All @@ -149,8 +148,6 @@ public void deleteSessionListVariable(String name) {

public static class EventObj {

private final EventInfo eventInfo = Dispatcher.getCurrent().getEventInfo();

public List<String> getMessageValueKeys() {
EventInfo eventInfo = (EventInfo)Dispatcher.getCurrent().getDataBag().get("eventInfo");
return Arrays.stream(MessageValue.values())
Expand All @@ -160,6 +157,7 @@ public List<String> getMessageValueKeys() {
}

public String getMessageValue(String key, String identifier) {
EventInfo eventInfo = Dispatcher.getCurrent().getEventInfo();
MessageValue messageValue = EnumUtils.getEnumIgnoreCase(MessageValue.class, key);
if (messageValue == null || !messageValue.hasProtocolType(eventInfo.getProtocolType())) {
throw new IllegalArgumentException(String.format("Invalid message value key: '%s'", key));
Expand All @@ -173,6 +171,7 @@ public String getMessageValue(String key, String identifier) {
}

public void setMessageValue(String key, String identifier, String value) {
EventInfo eventInfo = Dispatcher.getCurrent().getEventInfo();
MessageValue messageValue = EnumUtils.getEnumIgnoreCase(MessageValue.class, key);
if (messageValue == null || !messageValue.hasProtocolType(eventInfo.getProtocolType())) {
throw new IllegalArgumentException(String.format("Invalid message value key: '%s'", key));
Expand All @@ -188,7 +187,7 @@ public void setMessageValue(String key, String identifier, String value) {

public String runThen(String thenType, NativeObject thenData) {
Dispatcher dispatcher = Dispatcher.getCurrent();
EventInfo eventInfo = (EventInfo)Dispatcher.getCurrent().getDataBag().get("eventInfo");
EventInfo eventInfo = dispatcher.getEventInfo();
Workspaces.get().setCurrentWorkspace(eventInfo.getWorkspace());
String adjustedThenTypeName = StringUtils.prependIfMissing(thenType, "Then");
Stream<ThenType<?>> supportedThenTypes = Stream.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ private Component getOperationsList() {
protected void refreshOperationsList() {
operationsListModel.clear();
operationsListModel.addAll(getRuleOperations());
setModelChangedListeners();
}

private Component getActionBar() {
Expand Down

0 comments on commit ad91c04

Please sign in to comment.