Allow change of minSdkVersion via settings
This commit is contained in:
parent
63df81e378
commit
68383dca5e
6 changed files with 33 additions and 11 deletions
|
@ -163,7 +163,7 @@ public class SettingsSerializer
|
||||||
save("deprecated");
|
save("deprecated");
|
||||||
save("deprecated");
|
save("deprecated");
|
||||||
save("deprecated");
|
save("deprecated");
|
||||||
save(BytecodeViewer.viewer.fontSpinner.getValue());
|
save(BytecodeViewer.viewer.getFontSize());
|
||||||
save(Configuration.deleteForeignLibraries);
|
save(Configuration.deleteForeignLibraries);
|
||||||
|
|
||||||
if (BytecodeViewer.viewer.apkConversionGroup.isSelected(BytecodeViewer.viewer.apkConversionDex.getModel()))
|
if (BytecodeViewer.viewer.apkConversionGroup.isSelected(BytecodeViewer.viewer.apkConversionDex.getModel()))
|
||||||
|
@ -200,6 +200,7 @@ public class SettingsSerializer
|
||||||
save(Configuration.lastPluginDirectory);
|
save(Configuration.lastPluginDirectory);
|
||||||
save(Configuration.python2Extra);
|
save(Configuration.python2Extra);
|
||||||
save(Configuration.python3Extra);
|
save(Configuration.python3Extra);
|
||||||
|
save(BytecodeViewer.viewer.getMinSdkVersion());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
BytecodeViewer.handleException(e);
|
BytecodeViewer.handleException(e);
|
||||||
}
|
}
|
||||||
|
@ -396,6 +397,7 @@ public class SettingsSerializer
|
||||||
Configuration.lastPluginDirectory = asString(138);
|
Configuration.lastPluginDirectory = asString(138);
|
||||||
Configuration.python2Extra = asBoolean(139);
|
Configuration.python2Extra = asBoolean(139);
|
||||||
Configuration.python3Extra = asBoolean(140);
|
Configuration.python3Extra = asBoolean(140);
|
||||||
|
BytecodeViewer.viewer.minSdkVersionSpinner.setValue(asInt(141));
|
||||||
}
|
}
|
||||||
catch (IndexOutOfBoundsException e)
|
catch (IndexOutOfBoundsException e)
|
||||||
{
|
{
|
||||||
|
@ -426,4 +428,4 @@ public class SettingsSerializer
|
||||||
{
|
{
|
||||||
return Integer.parseInt(DiskReader.loadString(settingsName, lineNumber, false));
|
return Integer.parseInt(DiskReader.loadString(settingsName, lineNumber, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,7 +266,11 @@ public class MainViewerGUI extends JFrame
|
||||||
public final JCheckBoxMenuItem recoveryTypehInts = new TranslatedJCheckBoxMenuItem("Recover Type Hints", TranslatedComponents.RECOVER_TYPE__HINTS);
|
public final JCheckBoxMenuItem recoveryTypehInts = new TranslatedJCheckBoxMenuItem("Recover Type Hints", TranslatedComponents.RECOVER_TYPE__HINTS);
|
||||||
public final JCheckBoxMenuItem forceTurningIFs = new TranslatedJCheckBoxMenuItem("Force Returning IFs", TranslatedComponents.FORCE_RETURNING_IFS);
|
public final JCheckBoxMenuItem forceTurningIFs = new TranslatedJCheckBoxMenuItem("Force Returning IFs", TranslatedComponents.FORCE_RETURNING_IFS);
|
||||||
public final JCheckBoxMenuItem forLoopAGGCapture = new TranslatedJCheckBoxMenuItem("For Loop AGG Capture", TranslatedComponents.FOR_LOOP_AGG_CAPTURE);
|
public final JCheckBoxMenuItem forLoopAGGCapture = new TranslatedJCheckBoxMenuItem("For Loop AGG Capture", TranslatedComponents.FOR_LOOP_AGG_CAPTURE);
|
||||||
|
|
||||||
|
//Smali/D2Jar
|
||||||
|
public final JMenu minSdkVersionMenu = new TranslatedJMenu("Minimum SDK version", TranslatedComponents.MIN_SDK_VERSION);
|
||||||
|
public final JSpinner minSdkVersionSpinner = new JSpinner();
|
||||||
|
|
||||||
//obfuscation
|
//obfuscation
|
||||||
public final JMenu obfuscate = new JMenu("Obfuscate");
|
public final JMenu obfuscate = new JMenu("Obfuscate");
|
||||||
public final JMenuItem renameFields = new JMenuItem("Rename Fields");
|
public final JMenuItem renameFields = new JMenuItem("Rename Fields");
|
||||||
|
@ -611,6 +615,13 @@ public class MainViewerGUI extends JFrame
|
||||||
bytecodeDecompilerSettingsSecondaryMenu.add(appendBracketsToLabels);
|
bytecodeDecompilerSettingsSecondaryMenu.add(appendBracketsToLabels);
|
||||||
bytecodeDecompilerSettingsDialog = new SettingsDialog(bytecodeDecompilerSettingsSecondaryMenu, new JPanel());
|
bytecodeDecompilerSettingsDialog = new SettingsDialog(bytecodeDecompilerSettingsSecondaryMenu, new JPanel());
|
||||||
bytecodeDecompilerSettings.addActionListener((e)-> bytecodeDecompilerSettingsDialog.showDialog());
|
bytecodeDecompilerSettings.addActionListener((e)-> bytecodeDecompilerSettingsDialog.showDialog());
|
||||||
|
|
||||||
|
//Smali minSdkVersion
|
||||||
|
minSdkVersionSpinner.setPreferredSize(new Dimension(60, 24));
|
||||||
|
minSdkVersionSpinner.setMinimumSize(new Dimension(60, 24));
|
||||||
|
minSdkVersionSpinner.setModel(new SpinnerNumberModel(26, 1, null, 1));
|
||||||
|
minSdkVersionMenu.add(minSdkVersionSpinner);
|
||||||
|
settingsMainMenu.add(minSdkVersionMenu);
|
||||||
|
|
||||||
deleteForeignOutdatedLibs.addActionListener(arg0 -> showForeignLibraryWarning());
|
deleteForeignOutdatedLibs.addActionListener(arg0 -> showForeignLibraryWarning());
|
||||||
forcePureAsciiAsText.addActionListener(arg0 -> SettingsSerializer.saveSettingsAsync());
|
forcePureAsciiAsText.addActionListener(arg0 -> SettingsSerializer.saveSettingsAsync());
|
||||||
|
@ -798,6 +809,11 @@ public class MainViewerGUI extends JFrame
|
||||||
{
|
{
|
||||||
return (int) fontSpinner.getValue();
|
return (int) fontSpinner.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMinSdkVersion()
|
||||||
|
{
|
||||||
|
return (int) minSdkVersionSpinner.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized void clearBusyStatus()
|
public synchronized void clearBusyStatus()
|
||||||
{
|
{
|
||||||
|
@ -968,4 +984,4 @@ public class MainViewerGUI extends JFrame
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final long serialVersionUID = 1851409230530948543L;
|
public static final long serialVersionUID = 1851409230530948543L;
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,6 +250,7 @@ public enum TranslatedComponents
|
||||||
DESC,
|
DESC,
|
||||||
RESULTS,
|
RESULTS,
|
||||||
REFRESH,
|
REFRESH,
|
||||||
|
MIN_SDK_VERSION,
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -265,4 +266,4 @@ public enum TranslatedComponents
|
||||||
{
|
{
|
||||||
return componentReference;
|
return componentReference;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package the.bytecode.club.bytecodeviewer.util;
|
package the.bytecode.club.bytecodeviewer.util;
|
||||||
|
|
||||||
import com.googlecode.d2j.dex.Dex2jar;
|
import com.googlecode.d2j.dex.Dex2jar;
|
||||||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
|
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
|
||||||
|
@ -60,7 +59,9 @@ public class Dex2Jar {
|
||||||
|
|
||||||
public static synchronized void saveAsDex(File input, File output, boolean delete) {
|
public static synchronized void saveAsDex(File input, File output, boolean delete) {
|
||||||
try {
|
try {
|
||||||
com.googlecode.dex2jar.tools.Jar2Dex.main(input.getAbsolutePath(), "-o", output.getAbsolutePath());
|
com.googlecode.dex2jar.tools.Jar2Dex.main(input.getAbsolutePath(),
|
||||||
|
"-o", output.getAbsolutePath(),
|
||||||
|
"-s", BytecodeViewer.viewer.getMinSdkVersion() + "");
|
||||||
if (delete)
|
if (delete)
|
||||||
input.delete();
|
input.delete();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -279,5 +279,6 @@
|
||||||
"SAVE": "Save...",
|
"SAVE": "Save...",
|
||||||
"SAVE_AS": "Save As...",
|
"SAVE_AS": "Save As...",
|
||||||
"RESULTS": "Results",
|
"RESULTS": "Results",
|
||||||
"REFRESH": "Refresh"
|
"REFRESH": "Refresh",
|
||||||
}
|
"MIN_SDK_VERSION": "Minimum SDK version"
|
||||||
|
}
|
||||||
|
|
|
@ -254,5 +254,6 @@
|
||||||
"CLOSE_ALL_BUT_THIS": "Alle außer diesen schließen",
|
"CLOSE_ALL_BUT_THIS": "Alle außer diesen schließen",
|
||||||
"CLOSE_TAB": "Tab schließen",
|
"CLOSE_TAB": "Tab schließen",
|
||||||
"PLEASE_SEND_THIS_ERROR_LOG_TO": "Bitte senden Sie dieses Fehlerprotokoll an",
|
"PLEASE_SEND_THIS_ERROR_LOG_TO": "Bitte senden Sie dieses Fehlerprotokoll an",
|
||||||
"PLEASE_SEND_RESOURCES": "Wenn Sie entsprechende gesetzliche Rechte an der jeweiligen Klasse besitzen"
|
"PLEASE_SEND_RESOURCES": "Wenn Sie entsprechende gesetzliche Rechte an der jeweiligen Klasse besitzen",
|
||||||
|
"MIN_SDK_VERSION": "Minimale SDK-Version"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue