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(BytecodeViewer.viewer.fontSpinner.getValue());
|
||||
save(BytecodeViewer.viewer.getFontSize());
|
||||
save(Configuration.deleteForeignLibraries);
|
||||
|
||||
if (BytecodeViewer.viewer.apkConversionGroup.isSelected(BytecodeViewer.viewer.apkConversionDex.getModel()))
|
||||
|
@ -200,6 +200,7 @@ public class SettingsSerializer
|
|||
save(Configuration.lastPluginDirectory);
|
||||
save(Configuration.python2Extra);
|
||||
save(Configuration.python3Extra);
|
||||
save(BytecodeViewer.viewer.getMinSdkVersion());
|
||||
} catch (Exception e) {
|
||||
BytecodeViewer.handleException(e);
|
||||
}
|
||||
|
@ -396,6 +397,7 @@ public class SettingsSerializer
|
|||
Configuration.lastPluginDirectory = asString(138);
|
||||
Configuration.python2Extra = asBoolean(139);
|
||||
Configuration.python3Extra = asBoolean(140);
|
||||
BytecodeViewer.viewer.minSdkVersionSpinner.setValue(asInt(141));
|
||||
}
|
||||
catch (IndexOutOfBoundsException e)
|
||||
{
|
||||
|
|
|
@ -267,6 +267,10 @@ public class MainViewerGUI extends JFrame
|
|||
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);
|
||||
|
||||
//Smali/D2Jar
|
||||
public final JMenu minSdkVersionMenu = new TranslatedJMenu("Minimum SDK version", TranslatedComponents.MIN_SDK_VERSION);
|
||||
public final JSpinner minSdkVersionSpinner = new JSpinner();
|
||||
|
||||
//obfuscation
|
||||
public final JMenu obfuscate = new JMenu("Obfuscate");
|
||||
public final JMenuItem renameFields = new JMenuItem("Rename Fields");
|
||||
|
@ -612,6 +616,13 @@ public class MainViewerGUI extends JFrame
|
|||
bytecodeDecompilerSettingsDialog = new SettingsDialog(bytecodeDecompilerSettingsSecondaryMenu, new JPanel());
|
||||
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());
|
||||
forcePureAsciiAsText.addActionListener(arg0 -> SettingsSerializer.saveSettingsAsync());
|
||||
setPython2.addActionListener(arg0 -> ExternalResources.getSingleton().selectPython2());
|
||||
|
@ -799,6 +810,11 @@ public class MainViewerGUI extends JFrame
|
|||
return (int) fontSpinner.getValue();
|
||||
}
|
||||
|
||||
public int getMinSdkVersion()
|
||||
{
|
||||
return (int) minSdkVersionSpinner.getValue();
|
||||
}
|
||||
|
||||
public synchronized void clearBusyStatus()
|
||||
{
|
||||
SwingUtilities.invokeLater(()->
|
||||
|
|
|
@ -250,6 +250,7 @@ public enum TranslatedComponents
|
|||
DESC,
|
||||
RESULTS,
|
||||
REFRESH,
|
||||
MIN_SDK_VERSION,
|
||||
|
||||
;
|
||||
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package the.bytecode.club.bytecodeviewer.util;
|
||||
|
||||
import com.googlecode.d2j.dex.Dex2jar;
|
||||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||
|
||||
import java.io.File;
|
||||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||
|
||||
/***************************************************************************
|
||||
* 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) {
|
||||
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)
|
||||
input.delete();
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -279,5 +279,6 @@
|
|||
"SAVE": "Save...",
|
||||
"SAVE_AS": "Save As...",
|
||||
"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_TAB": "Tab schließen",
|
||||
"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