Skip to content

Commit

Permalink
fix code format
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot authored Nov 25, 2023
1 parent fa86d8f commit 885a207
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions jadx-gui/src/main/java/jadx/gui/ui/codearea/XposedAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
public class XposedAction extends JNodeAction {
private static final Logger LOG = LoggerFactory.getLogger(XposedAction.class);
private static final long serialVersionUID = 2641585141624592578L;

private static final Map<String, String> PRIMITIVE_TYPE_MAPPING = Map.of(
"int", "Int",
"byte", "Byte",
Expand All @@ -34,8 +35,7 @@ public class XposedAction extends JNodeAction {
"float", "Float",
"double", "Double",
"char", "Char",
"boolean", "Boolean"
);
"boolean", "Boolean");

public XposedAction(CodeArea codeArea) {
super(ActionModel.XPOSED_COPY, codeArea);
Expand Down Expand Up @@ -100,7 +100,9 @@ private String generateMethodSnippet(JMethod jMth) {
if (mthArgs.isEmpty()) {
return String.format(xposedFormatStr, xposedMethod, rawClassName, methodName);
}
String params = mthArgs.stream().map(type -> (type.isGeneric() ? type.getObject() : type) + ".class, ").collect(Collectors.joining());
String params = mthArgs.stream()
.map(type -> (type.isGeneric() ? type.getObject() : type) + ".class, ")
.collect(Collectors.joining());
return String.format(xposedFormatStr, xposedMethod, rawClassName, methodName + params);
}

Expand All @@ -109,7 +111,7 @@ private String generateClassSnippet(JClass jc) {
String rawClassName = javaClass.getRawName();
String shortClassName = javaClass.getName();
return String.format("ClassLoader classLoader = lpparam.classLoader;\n"
+ "Class<?> %sClass = classLoader.loadClass(\"%s\");",
+ "Class<?> %sClass = classLoader.loadClass(\"%s\");",
shortClassName, rawClassName);
}

Expand All @@ -118,8 +120,6 @@ private String generateFieldSnippet(JField jf) {
String isStatic = javaField.getAccessFlags().isStatic() ? "Static" : "";
String type = PRIMITIVE_TYPE_MAPPING.getOrDefault(javaField.getFieldNode().getType().toString(), "Object");
String xposedMethod = "XposedHelpers.get" + isStatic + type + "Field";
return String.format("%s(/*runtimeObject*/, \"%s\");",
xposedMethod, javaField.getName());

return String.format("%s(/*runtimeObject*/, \"%s\");", xposedMethod, javaField.getName());
}
}

0 comments on commit 885a207

Please sign in to comment.