Issue #67 Renaming invalid identifiers to Type+Number

This commit is contained in:
Jindra Petk
2013-06-23 07:14:14 +02:00
parent 43ffd2ce51
commit 6417835960
7 changed files with 396 additions and 81 deletions

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.FrameNode;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.SWFOutputStream;
import com.jpexs.decompiler.flash.TagNode;
import com.jpexs.decompiler.flash.abc.RenameType;
import com.jpexs.decompiler.flash.abc.ScriptPack;
import com.jpexs.decompiler.flash.abc.gui.ABCPanel;
import com.jpexs.decompiler.flash.abc.gui.ClassesListTreeModel;
@@ -1696,34 +1697,35 @@ public class MainFrame extends JFrame implements ActionListener, TreeSelectionLi
if (e.getActionCommand().equals("RENAMEIDENTIFIERS")) {
if (confirmExperimental()) {
final RenameType renameType = new RenameDialog().display();
if (renameType != null) {
Main.startWork("Renaming identifiers...");
new SwingWorker() {
@Override
protected Object doInBackground() throws Exception {
try {
int cnt = 0;
Main.startWork("Renaming identifiers...");
new SwingWorker() {
@Override
protected Object doInBackground() throws Exception {
try {
int cnt = 0;
if (abcPanel != null) {
cnt = swf.deobfuscateAS3Identifiers();
} else {
cnt = swf.deobfuscateAS2Identifiers();
if (abcPanel != null) {
cnt = swf.deobfuscateAS3Identifiers(renameType);
} else {
cnt = swf.deobfuscateAS2Identifiers(renameType);
}
Main.stopWork();
JOptionPane.showMessageDialog(null, "Identifiers renamed: " + cnt);
if (abcPanel != null) {
abcPanel.reload();
}
doFilter();
reload(true);
} catch (Exception ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, "message", ex);
}
Main.stopWork();
JOptionPane.showMessageDialog(null, "Identifiers renamed: " + cnt);
if (abcPanel != null) {
abcPanel.reload();
}
doFilter();
reload(true);
} catch (Exception ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, "message", ex);
return true;
}
return true;
}
}.execute();
}.execute();
}
}
}