Propagate ABCIndex everywhere

This commit is contained in:
Jindra Petřík
2022-11-30 22:58:35 +01:00
parent e22669d377
commit 25aa987cdf
32 changed files with 237 additions and 163 deletions
+3 -4
View File
@@ -213,15 +213,14 @@ public class Main {
public static CancellableWorker deobfuscatePCodeWorker = null;
public static CancellableWorker swfPrepareWorker = null;
public static final int LIBRARY_AIR = 0;
public static final int LIBRARY_FLASH = 1;
public static boolean isSwfAir(Openable openable) {
SwfSpecificCustomConfiguration conf = Configuration.getSwfSpecificCustomConfiguration(openable.getShortPathTitle());
if (conf != null) {
String libraryAsStr = conf.getCustomData(CustomConfigurationKeys.KEY_LIBRARY, "" + LIBRARY_FLASH);
String libraryAsStr = conf.getCustomData(CustomConfigurationKeys.KEY_LIBRARY, "" + SWF.LIBRARY_FLASH);
int libraryAsInt = Integer.parseInt(libraryAsStr);
return libraryAsInt == LIBRARY_AIR;
return libraryAsInt == SWF.LIBRARY_AIR;
}
return false;
}
@@ -243,9 +243,9 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
}
if (Main.isSwfAir(abc.getOpenable())) {
libraryComboBox.setSelectedIndex(Main.LIBRARY_AIR);
libraryComboBox.setSelectedIndex(SWF.LIBRARY_AIR);
} else {
libraryComboBox.setSelectedIndex(Main.LIBRARY_FLASH);
libraryComboBox.setSelectedIndex(SWF.LIBRARY_FLASH);
}
this.abc = abc;
setDecompiledEditMode(false);
@@ -972,7 +972,7 @@ public class ABCPanel extends JPanel implements ItemListener, SearchListener<Scr
libraryComboBox = new JComboBox<>();
libraryComboBox.addItem("AIR (airglobal.swc)");
libraryComboBox.addItem("Flash (playerglobal.swc)");
libraryComboBox.setSelectedIndex(Main.LIBRARY_FLASH);
libraryComboBox.setSelectedIndex(SWF.LIBRARY_FLASH);
libraryComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
@@ -247,7 +247,7 @@ public class ASMSourceEditorPane extends DebuggableEditorPane implements CaretLi
public void graph() {
try {
AVM2Graph gr = new AVM2Graph(abc.bodies.get(bodyIndex).getCode(), abc, abc.bodies.get(bodyIndex), false, -1, -1, new HashMap<>(), new ScopeStack(), new HashMap<>(), new ArrayList<>(), new HashMap<>(), abc.bodies.get(bodyIndex).getCode().visitCode(abc.bodies.get(bodyIndex)));
AVM2Graph gr = new AVM2Graph(null /*?*/, abc.bodies.get(bodyIndex).getCode(), abc, abc.bodies.get(bodyIndex), false, -1, -1, new HashMap<>(), new ScopeStack(), new HashMap<>(), new ArrayList<>(), new HashMap<>(), abc.bodies.get(bodyIndex).getCode().visitCode(abc.bodies.get(bodyIndex)));
(new GraphDialog(getAbcPanel().getMainPanel().getMainFrame().getWindow(), gr, name)).setVisible(true);
} catch (InterruptedException ex) {
Logger.getLogger(ASMSourceEditorPane.class.getName()).log(Level.SEVERE, null, ex);