Skip to content

Commit

Permalink
refactor: applied spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
iscle committed Dec 28, 2023
1 parent ac4755e commit 5ed8da9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;

import jadx.gui.settings.XposedCodegenLanguage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -60,6 +59,7 @@
import jadx.gui.settings.JadxSettings;
import jadx.gui.settings.JadxSettingsAdapter;
import jadx.gui.settings.LineNumbersMode;
import jadx.gui.settings.XposedCodegenLanguage;
import jadx.gui.settings.ui.cache.CacheSettingsGroup;
import jadx.gui.settings.ui.plugins.PluginSettings;
import jadx.gui.settings.ui.shortcut.ShortcutsSettingsGroup;
Expand Down Expand Up @@ -623,7 +623,8 @@ private SettingsGroup makeOtherGroup() {
needReload();
});

JComboBox<XposedCodegenLanguage> xposedCodegenLanguage = new JComboBox<>(XposedCodegenLanguage.getEntries().toArray(new XposedCodegenLanguage[0]));
JComboBox<XposedCodegenLanguage> xposedCodegenLanguage =
new JComboBox<>(XposedCodegenLanguage.getEntries().toArray(new XposedCodegenLanguage[0]));
xposedCodegenLanguage.setSelectedItem(settings.getXposedCodegenLanguage());
xposedCodegenLanguage.addActionListener(e -> {
settings.setXposedCodegenLanguage((XposedCodegenLanguage) xposedCodegenLanguage.getSelectedItem());
Expand Down
40 changes: 20 additions & 20 deletions jadx-gui/src/main/java/jadx/gui/ui/codearea/XposedAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import javax.swing.JOptionPane;

import jadx.gui.settings.XposedCodegenLanguage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -16,6 +15,7 @@
import jadx.core.dex.instructions.args.ArgType;
import jadx.core.dex.nodes.MethodNode;
import jadx.core.utils.exceptions.JadxRuntimeException;
import jadx.gui.settings.XposedCodegenLanguage;
import jadx.gui.treemodel.JClass;
import jadx.gui.treemodel.JField;
import jadx.gui.treemodel.JMethod;
Expand Down Expand Up @@ -88,25 +88,25 @@ private String generateMethodSnippet(JMethod jMth) {
String rawClassName = javaMethod.getDeclaringClass().getRawName();
String javaXposedFormatStr =
"XposedHelpers.%s(\"%s\", classLoader, %snew XC_MethodHook() {\n"
+ " @Override\n"
+ " protected void beforeHookedMethod(MethodHookParam param) throws Throwable {\n"
+ " super.beforeHookedMethod(param);\n"
+ " }\n"
+ " @Override\n"
+ " protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n"
+ " super.afterHookedMethod(param);\n"
+ " }\n"
+ "});";
+ " @Override\n"
+ " protected void beforeHookedMethod(MethodHookParam param) throws Throwable {\n"
+ " super.beforeHookedMethod(param);\n"
+ " }\n"
+ " @Override\n"
+ " protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n"
+ " super.afterHookedMethod(param);\n"
+ " }\n"
+ "});";
String kotlinXposedFormatStr =
"XposedHelpers.%s(\"%s\", classLoader, %sobject : XC_MethodHook() {\n" +
" override fun beforeHookedMethod(param: MethodHookParam) {\n" +
" super.beforeHookedMethod(param)\n" +
" }\n" +
"\n" +
" override fun afterHookedMethod(param: MethodHookParam) {\n" +
" super.afterHookedMethod(param)\n" +
" }\n" +
"})";
" override fun beforeHookedMethod(param: MethodHookParam) {\n" +
" super.beforeHookedMethod(param)\n" +
" }\n" +
"\n" +
" override fun afterHookedMethod(param: MethodHookParam) {\n" +
" super.afterHookedMethod(param)\n" +
" }\n" +
"})";

XposedCodegenLanguage language = getLanguage();
String xposedFormatStr;
Expand Down Expand Up @@ -147,10 +147,10 @@ private String generateClassSnippet(JClass jc) {

String javaXposedFormatStr =
"ClassLoader classLoader = lpparam.classLoader;\n" +
"Class<?> %sClass = classLoader.loadClass(\"%s\");";
"Class<?> %sClass = classLoader.loadClass(\"%s\");";
String kotlinXposedFormatStr =
"val classLoader = lpparam.classLoader\n" +
"val %sClass = classLoader.loadClass(\"%s\")";
"val %sClass = classLoader.loadClass(\"%s\")";

XposedCodegenLanguage language = getLanguage();
String xposedFormatStr;
Expand Down

0 comments on commit 5ed8da9

Please sign in to comment.