Program: 62176
Project: 62176
Buggy source:
@Override public void actionPerformed(ActionEvent e){
switch (e.getActionCommand()) {
case "String_Node_Str":
    String documentClass=null;
  loopdc:   for (  Tag t : swf.tags) {
    if (t instanceof SymbolClassTag) {
      SymbolClassTag sc=(SymbolClassTag)t;
      for (int i=0; i < sc.tagIDs.length; i++) {
        if (sc.tagIDs[i] == 0) {
          documentClass=sc.classNames[i];
          break loopdc;
        }
      }
    }
  }
if (documentClass != null) {
  abcPanel.hilightScript(documentClass);
}
break;
case "String_Node_Str":
String confStr="String_Node_Str";
if (miParallelSpeedUp.isSelected()) {
confStr+="String_Node_Str";
}
 else {
confStr+="String_Node_Str";
}
if (JOptionPane.showConfirmDialog(null,confStr,"String_Node_Str",JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
Configuration.setConfig("String_Node_Str",(Boolean)miParallelSpeedUp.isSelected());
}
 else {
miParallelSpeedUp.setSelected(!miParallelSpeedUp.isSelected());
}
break;
case "String_Node_Str":
Configuration.setConfig("String_Node_Str",(Boolean)miInternalViewer.isSelected());
break;
case "String_Node_Str":
if (searchDialog == null) {
searchDialog=new SearchDialog();
}
searchDialog.setVisible(true);
if (searchDialog.result) {
final String txt=searchDialog.searchField.getText();
if (!txt.equals("String_Node_Str")) {
Main.startWork("String_Node_Str" + txt + "String_Node_Str");
if (abcPanel != null) {
(new Thread(){
@Override public void run(){
if (abcPanel.search(txt,searchDialog.ignoreCaseCheckBox.isSelected(),searchDialog.regexpCheckBox.isSelected())) {
showDetail(DETAILCARDAS3NAVIGATOR);
showCard(CARDACTIONSCRIPTPANEL);
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str" + txt + "String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
}
Main.stopWork();
}
}
).start();
}
 else {
(new Thread(){
@Override public void run(){
if (actionPanel.search(txt,searchDialog.ignoreCaseCheckBox.isSelected(),searchDialog.regexpCheckBox.isSelected())) {
showCard(CARDACTIONSCRIPTPANEL);
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str" + txt + "String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
}
Main.stopWork();
}
}
).start();
}
}
}
break;
case "String_Node_Str":
Object tagObj=tagTree.getLastSelectedPathComponent();
if (tagObj == null) {
return;
}
if (tagObj instanceof TagNode) {
tagObj=((TagNode)tagObj).tag;
}
if (tagObj instanceof ImageTag) {
ImageTag it=(ImageTag)tagObj;
if (it.importSupported()) {
JFileChooser fc=new JFileChooser();
fc.setCurrentDirectory(new File((String)Configuration.getConfig("String_Node_Str","String_Node_Str")));
fc.setFileFilter(new FileFilter(){
@Override public boolean accept(File f){
return (f.getName().toLowerCase().endsWith("String_Node_Str")) || (f.getName().toLowerCase().endsWith("String_Node_Str")) || (f.getName().toLowerCase().endsWith("String_Node_Str"))|| (f.getName().toLowerCase().endsWith("String_Node_Str"))|| (f.isDirectory());
}
@Override public String getDescription(){
return "String_Node_Str";
}
}
);
JFrame f=new JFrame();
View.setWindowIcon(f);
int returnVal=fc.showOpenDialog(f);
if (returnVal == JFileChooser.APPROVE_OPTION) {
Configuration.setConfig("String_Node_Str",Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath());
File selfile=Helper.fixDialogFile(fc.getSelectedFile());
byte data[]=Helper.readFile(selfile.getAbsolutePath());
try {
it.setImage(data);
}
 catch (IOException ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
}
reload(true);
}
}
}
break;
case "String_Node_Str":
tagObj=tagTree.getLastSelectedPathComponent();
if (tagObj == null) {
return;
}
if (tagObj instanceof TagNode) {
tagObj=((TagNode)tagObj).tag;
}
if (tagObj instanceof DefineSpriteTag) {
DefineSpriteTag sprite=(DefineSpriteTag)tagObj;
for (int i=0; i < swf.tags.size(); i++) {
Tag t=swf.tags.get(i);
if (t == sprite) {
swf.tags.remove(i);
i--;
}
 else if (t instanceof DefineSpriteTag) {
DefineSpriteTag st=(DefineSpriteTag)t;
for (int j=0; j < st.subTags.size(); j++) {
Tag t2=st.subTags.get(j);
Set<Integer> needed=t2.getNeededCharacters();
if (needed.contains(sprite.spriteId)) {
st.subTags.remove(j);
j--;
}
}
}
 else {
Set<Integer> needed=t.getNeededCharacters();
if (needed.contains(sprite.spriteId)) {
swf.tags.remove(i);
i--;
}
}
}
showCard(CARDEMPTYPANEL);
refreshTree();
}
break;
case "String_Node_Str":
setEditText(true);
break;
case "String_Node_Str":
setEditText(false);
break;
case "String_Node_Str":
if (oldValue instanceof TextTag) {
try {
((TextTag)oldValue).setFormattedText(swf.tags,textValue.getText());
setEditText(false);
}
 catch (ParseException ex) {
JOptionPane.showMessageDialog(null,"String_Node_Str" + ex.text + "String_Node_Str"+ ex.line,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
}
}
break;
case "String_Node_Str":
if (JOptionPane.showConfirmDialog(this,"String_Node_Str" + (autoDeobfuscateMenuItem.getState() ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str","String_Node_Str",JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
Configuration.setConfig("String_Node_Str",autoDeobfuscateMenuItem.getState());
}
 else {
autoDeobfuscateMenuItem.setState(!autoDeobfuscateMenuItem.getState());
}
break;
case "String_Node_Str":
setVisible(false);
if (Main.proxyFrame != null) {
if (Main.proxyFrame.isVisible()) {
return;
}
}
Main.exit();
break;
}
if (Main.isWorking()) {
return;
}
switch (e.getActionCommand()) {
case "String_Node_Str":
if (swf.fileAttributes.actionScript3) {
final int multiName=abcPanel.decompiledTextArea.getMultinameUnderCursor();
if (multiName > 0) {
(new Thread(){
@Override public void run(){
Main.startWork("String_Node_Str");
renameMultiname(multiName);
Main.stopWork();
}
}
).start();
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
}
}
 else {
final String identifier=actionPanel.getStringUnderCursor();
if (identifier != null) {
(new Thread(){
@Override public void run(){
Main.startWork("String_Node_Str");
renameIdentifier(identifier);
Main.stopWork();
}
}
).start();
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
}
}
break;
case "String_Node_Str":
Main.about();
break;
case "String_Node_Str":
Main.showProxy();
break;
case "String_Node_Str":
if (e.getSource() instanceof JCheckBoxMenuItem) {
Main.setSubLimiter(((JCheckBoxMenuItem)e.getSource()).getState());
}
break;
case "String_Node_Str":
try {
Main.saveFile(Main.file);
}
 catch (IOException ex) {
Logger.getLogger(com.jpexs.decompiler.flash.abc.gui.ABCPanel.class.getName()).log(Level.SEVERE,null,ex);
JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
}
break;
case "String_Node_Str":
if (Main.saveFileDialog()) {
setTitle(Main.applicationVerName + (Configuration.DISPLAY_FILENAME ? "String_Node_Str" + Main.getFileTitle() : "String_Node_Str"));
}
break;
case "String_Node_Str":
Main.openFileDialog();
break;
case "String_Node_Str":
JFileChooser fc=new JFileChooser();
String selDir=(String)Configuration.getConfig("String_Node_Str","String_Node_Str");
fc.setCurrentDirectory(new File(selDir));
if (!selDir.endsWith(File.separator)) {
selDir+=File.separator;
}
String fileName=(new File(Main.file).getName());
fileName=fileName.substring(0,fileName.length() - 4) + "String_Node_Str";
fc.setSelectedFile(new File(selDir + fileName));
FileFilter fla=new FileFilter(){
@Override public boolean accept(File f){
return f.isDirectory() || (f.getName().toLowerCase().endsWith("String_Node_Str"));
}
@Override public String getDescription(){
return "String_Node_Str";
}
}
;
FileFilter xfl=new FileFilter(){
@Override public boolean accept(File f){
return f.isDirectory() || (f.getName().toLowerCase().endsWith("String_Node_Str"));
}
@Override public String getDescription(){
return "String_Node_Str";
}
}
;
fc.setFileFilter(fla);
fc.addChoosableFileFilter(xfl);
fc.setAcceptAllFileFilterUsed(false);
JFrame f=new JFrame();
View.setWindowIcon(f);
int returnVal=fc.showSaveDialog(f);
if (returnVal == JFileChooser.APPROVE_OPTION) {
Configuration.setConfig("String_Node_Str",Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath());
File sf=Helper.fixDialogFile(fc.getSelectedFile());
Main.startWork("String_Node_Str");
final boolean compressed=fc.getFileFilter() == fla;
if (!compressed) {
if (sf.getName().endsWith("String_Node_Str")) {
sf=new File(sf.getAbsolutePath().substring(0,sf.getAbsolutePath().length() - 4) + "String_Node_Str");
}
}
final File selfile=sf;
(new Thread(){
@Override public void run(){
if (compressed) {
swf.exportFla(selfile.getAbsolutePath(),new File(Main.file).getName(),Main.applicationName,Main.applicationVerName,Main.version,(Boolean)Configuration.getConfig("String_Node_Str",Boolean.TRUE));
}
 else {
swf.exportXfl(selfile.getAbsolutePath(),new File(Main.file).getName(),Main.applicationName,Main.applicationVerName,Main.version,(Boolean)Configuration.getConfig("String_Node_Str",Boolean.TRUE));
}
Main.stopWork();
}
}
).start();
}
break;
case "String_Node_Str":
case "String_Node_Str":
final ExportDialog export=new ExportDialog();
export.setVisible(true);
if (!export.cancelled) {
JFileChooser chooser=new JFileChooser();
chooser.setCurrentDirectory(new java.io.File((String)Configuration.getConfig("String_Node_Str","String_Node_Str")));
chooser.setDialogTitle("String_Node_Str");
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
chooser.setAcceptAllFileFilterUsed(false);
if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
final long timeBefore=System.currentTimeMillis();
Main.startWork("String_Node_Str");
final String selFile=Helper.fixDialogFile(chooser.getSelectedFile()).getAbsolutePath();
Configuration.setConfig("String_Node_Str",Helper.fixDialogFile(chooser.getSelectedFile()).getParentFile().getAbsolutePath());
final boolean isPcode=export.getOption(ExportDialog.OPTION_ACTIONSCRIPT) == 1;
final boolean isMp3OrWav=export.getOption(ExportDialog.OPTION_SOUNDS) == 0;
final boolean isFormatted=export.getOption(ExportDialog.OPTION_TEXTS) == 1;
final boolean onlySel=e.getActionCommand().endsWith("String_Node_Str");
(new Thread(){
@Override public void run(){
try {
if (onlySel) {
exportSelection(selFile,export);
}
 else {
swf.exportImages(selFile + File.separator + "String_Node_Str");
swf.exportShapes(selFile + File.separator + "String_Node_Str");
swf.exportTexts(selFile + File.separator + "String_Node_Str",isFormatted);
swf.exportMovies(selFile + File.separator + "String_Node_Str");
swf.exportSounds(selFile + File.separator + "String_Node_Str",isMp3OrWav,isMp3OrWav);
swf.exportBinaryData(selFile + File.separator + "String_Node_Str");
swf.exportActionScript(selFile,isPcode,(Boolean)Configuration.getConfig("String_Node_Str",Boolean.TRUE));
}
}
 catch (Exception ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
JOptionPane.showMessageDialog(null,"String_Node_Str");
}
Main.stopWork();
long timeAfter=System.currentTimeMillis();
long timeMs=timeAfter - timeBefore;
long timeS=timeMs / 1000;
timeMs=timeMs % 1000;
long timeM=timeS / 60;
timeS=timeS % 60;
long timeH=timeM / 60;
timeM=timeM % 60;
String timeStr="String_Node_Str";
if (timeH > 0) {
timeStr+=Helper.padZeros(timeH,2) + "String_Node_Str";
}
timeStr+=Helper.padZeros(timeM,2) + "String_Node_Str";
timeStr+=Helper.padZeros(timeS,2) + "String_Node_Str" + Helper.padZeros(timeMs,3);
setStatus("String_Node_Str" + timeStr);
}
}
).start();
}
}
break;
case "String_Node_Str":
if (!Main.checkForUpdates()) {
JOptionPane.showMessageDialog(null,"String_Node_Str");
}
break;
case "String_Node_Str":
String helpUsURL=Main.projectPage + "String_Node_Str";
if (java.awt.Desktop.isDesktopSupported()) {
java.awt.Desktop desktop=java.awt.Desktop.getDesktop();
try {
java.net.URI uri=new java.net.URI(helpUsURL);
desktop.browse(uri);
}
 catch (Exception ex) {
}
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str" + helpUsURL + "String_Node_Str");
}
break;
case "String_Node_Str":
String homePageURL=Main.projectPage;
if (java.awt.Desktop.isDesktopSupported()) {
java.awt.Desktop desktop=java.awt.Desktop.getDesktop();
try {
java.net.URI uri=new java.net.URI(homePageURL);
desktop.browse(uri);
}
 catch (Exception ex) {
}
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str" + homePageURL);
}
break;
case "String_Node_Str":
case "String_Node_Str":
Main.startWork("String_Node_Str");
final boolean all=e.getActionCommand().endsWith("String_Node_Str");
if ((!all) || confirmExperimental()) {
new SwingWorker(){
@Override protected Object doInBackground() throws Exception {
int cnt=0;
if (all) {
for (ABCContainerTag tag : abcPanel.list) {
tag.getABC().restoreControlFlow();
}
}
 else {
int bi=abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex();
if (bi != -1) {
abcPanel.abc.bodies[bi].restoreControlFlow(abcPanel.abc.constants);
}
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi,abcPanel.abc);
}
Main.stopWork();
JOptionPane.showMessageDialog(null,"String_Node_Str");
abcPanel.reload();
return true;
}
}
.execute();
}
break;
case "String_Node_Str":
if (confirmExperimental()) {
final RenameType renameType=new RenameDialog().display();
if (renameType != null) {
Main.startWork("String_Node_Str");
new SwingWorker(){
@Override protected Object doInBackground() throws Exception {
try {
int cnt=0;
cnt=swf.deobfuscateIdentifiers(renameType);
Main.stopWork();
JOptionPane.showMessageDialog(null,"String_Node_Str" + cnt);
if (abcPanel != null) {
abcPanel.reload();
}
doFilter();
reload(true);
}
 catch (Exception ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
}
return true;
}
}
.execute();
}
}
break;
case "String_Node_Str":
case "String_Node_Str":
if (deobfuscationDialog == null) {
deobfuscationDialog=new DeobfuscationDialog();
}
deobfuscationDialog.setVisible(true);
if (deobfuscationDialog.ok) {
Main.startWork("String_Node_Str");
new SwingWorker(){
@Override protected Object doInBackground() throws Exception {
try {
if (deobfuscationDialog.processAllCheckbox.isSelected()) {
for (ABCContainerTag tag : abcPanel.list) {
if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_DEAD_CODE) {
tag.getABC().removeDeadCode();
}
 else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_TRAPS) {
tag.getABC().removeTraps();
}
 else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_RESTORE_CONTROL_FLOW) {
tag.getABC().removeTraps();
tag.getABC().restoreControlFlow();
}
}
}
 else {
int bi=abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex();
if (bi != -1) {
if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_DEAD_CODE) {
abcPanel.abc.bodies[bi].removeDeadCode(abcPanel.abc.constants);
}
 else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_TRAPS) {
abcPanel.abc.bodies[bi].removeTraps(abcPanel.abc.constants,abcPanel.abc,abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex,abcPanel.decompiledTextArea.getClassIndex(),abcPanel.decompiledTextArea.getIsStatic());
}
 else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_RESTORE_CONTROL_FLOW) {
abcPanel.abc.bodies[bi].removeTraps(abcPanel.abc.constants,abcPanel.abc,abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex,abcPanel.decompiledTextArea.getClassIndex(),abcPanel.decompiledTextArea.getIsStatic());
abcPanel.abc.bodies[bi].restoreControlFlow(abcPanel.abc.constants);
}
}
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi,abcPanel.abc);
}
}
 catch (Exception ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
}
Main.stopWork();
JOptionPane.showMessageDialog(null,"String_Node_Str");
abcPanel.reload();
return true;
}
}
.execute();
}
break;
case "String_Node_Str":
case "String_Node_Str":
Main.startWork("String_Node_Str");
final boolean rall=e.getActionCommand().endsWith("String_Node_Str");
if ((!rall) || confirmExperimental()) {
new SwingWorker(){
@Override protected Object doInBackground() throws Exception {
int cnt=0;
if (rall) {
for (ABCContainerTag tag : abcPanel.list) {
cnt+=tag.getABC().removeTraps();
}
}
 else {
int bi=abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex();
if (bi != -1) {
cnt+=abcPanel.abc.bodies[bi].removeTraps(abcPanel.abc.constants,abcPanel.abc,abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex,abcPanel.decompiledTextArea.getClassIndex(),abcPanel.decompiledTextArea.getIsStatic());
}
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi,abcPanel.abc);
}
Main.stopWork();
JOptionPane.showMessageDialog(null,"String_Node_Str" + cnt);
abcPanel.reload();
return true;
}
}
.execute();
}
break;
case "String_Node_Str":
case "String_Node_Str":
Main.startWork("String_Node_Str");
final boolean dall=e.getActionCommand().endsWith("String_Node_Str");
if ((!dall) || confirmExperimental()) {
new SwingWorker(){
@Override protected Object doInBackground() throws Exception {
int cnt=0;
if (dall) {
for (ABCContainerTag tag : abcPanel.list) {
cnt+=tag.getABC().removeDeadCode();
}
}
 else {
int bi=abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex();
if (bi != -1) {
cnt+=abcPanel.abc.bodies[bi].removeDeadCode(abcPanel.abc.constants);
}
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi,abcPanel.abc);
}
Main.stopWork();
JOptionPane.showMessageDialog(null,"String_Node_Str" + cnt);
abcPanel.reload();
return true;
}
}
.execute();
}
break;
}
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
switch (e.getActionCommand()) {
case "String_Node_Str":
    if (miAssociate.getState() == Main.isAssociated()) {
      return;
    }
  Main.associate(miAssociate.getState());
new Timer().schedule(new TimerTask(){
  @Override public void run(){
    miAssociate.setState(Main.isAssociated());
  }
}
,500);
break;
case "String_Node_Str":
String documentClass=null;
loopdc: for (Tag t : swf.tags) {
if (t instanceof SymbolClassTag) {
SymbolClassTag sc=(SymbolClassTag)t;
for (int i=0; i < sc.tagIDs.length; i++) {
if (sc.tagIDs[i] == 0) {
  documentClass=sc.classNames[i];
  break loopdc;
}
}
}
}
if (documentClass != null) {
abcPanel.hilightScript(documentClass);
}
break;
case "String_Node_Str":
String confStr="String_Node_Str";
if (miParallelSpeedUp.isSelected()) {
confStr+="String_Node_Str";
}
 else {
confStr+="String_Node_Str";
}
if (JOptionPane.showConfirmDialog(null,confStr,"String_Node_Str",JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
Configuration.setConfig("String_Node_Str",(Boolean)miParallelSpeedUp.isSelected());
}
 else {
miParallelSpeedUp.setSelected(!miParallelSpeedUp.isSelected());
}
break;
case "String_Node_Str":
Configuration.setConfig("String_Node_Str",(Boolean)miInternalViewer.isSelected());
break;
case "String_Node_Str":
if (searchDialog == null) {
searchDialog=new SearchDialog();
}
searchDialog.setVisible(true);
if (searchDialog.result) {
final String txt=searchDialog.searchField.getText();
if (!txt.equals("String_Node_Str")) {
Main.startWork("String_Node_Str" + txt + "String_Node_Str");
if (abcPanel != null) {
(new Thread(){
@Override public void run(){
if (abcPanel.search(txt,searchDialog.ignoreCaseCheckBox.isSelected(),searchDialog.regexpCheckBox.isSelected())) {
showDetail(DETAILCARDAS3NAVIGATOR);
showCard(CARDACTIONSCRIPTPANEL);
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str" + txt + "String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
}
Main.stopWork();
}
}
).start();
}
 else {
(new Thread(){
@Override public void run(){
if (actionPanel.search(txt,searchDialog.ignoreCaseCheckBox.isSelected(),searchDialog.regexpCheckBox.isSelected())) {
showCard(CARDACTIONSCRIPTPANEL);
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str" + txt + "String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
}
Main.stopWork();
}
}
).start();
}
}
}
break;
case "String_Node_Str":
Object tagObj=tagTree.getLastSelectedPathComponent();
if (tagObj == null) {
return;
}
if (tagObj instanceof TagNode) {
tagObj=((TagNode)tagObj).tag;
}
if (tagObj instanceof ImageTag) {
ImageTag it=(ImageTag)tagObj;
if (it.importSupported()) {
JFileChooser fc=new JFileChooser();
fc.setCurrentDirectory(new File((String)Configuration.getConfig("String_Node_Str","String_Node_Str")));
fc.setFileFilter(new FileFilter(){
@Override public boolean accept(File f){
return (f.getName().toLowerCase().endsWith("String_Node_Str")) || (f.getName().toLowerCase().endsWith("String_Node_Str")) || (f.getName().toLowerCase().endsWith("String_Node_Str"))|| (f.getName().toLowerCase().endsWith("String_Node_Str"))|| (f.isDirectory());
}
@Override public String getDescription(){
return "String_Node_Str";
}
}
);
JFrame f=new JFrame();
View.setWindowIcon(f);
int returnVal=fc.showOpenDialog(f);
if (returnVal == JFileChooser.APPROVE_OPTION) {
Configuration.setConfig("String_Node_Str",Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath());
File selfile=Helper.fixDialogFile(fc.getSelectedFile());
byte data[]=Helper.readFile(selfile.getAbsolutePath());
try {
it.setImage(data);
}
 catch (IOException ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
}
reload(true);
}
}
}
break;
case "String_Node_Str":
tagObj=tagTree.getLastSelectedPathComponent();
if (tagObj == null) {
return;
}
if (tagObj instanceof TagNode) {
tagObj=((TagNode)tagObj).tag;
}
if (tagObj instanceof DefineSpriteTag) {
DefineSpriteTag sprite=(DefineSpriteTag)tagObj;
for (int i=0; i < swf.tags.size(); i++) {
Tag t=swf.tags.get(i);
if (t == sprite) {
swf.tags.remove(i);
i--;
}
 else if (t instanceof DefineSpriteTag) {
DefineSpriteTag st=(DefineSpriteTag)t;
for (int j=0; j < st.subTags.size(); j++) {
Tag t2=st.subTags.get(j);
Set<Integer> needed=t2.getNeededCharacters();
if (needed.contains(sprite.spriteId)) {
st.subTags.remove(j);
j--;
}
}
}
 else {
Set<Integer> needed=t.getNeededCharacters();
if (needed.contains(sprite.spriteId)) {
swf.tags.remove(i);
i--;
}
}
}
showCard(CARDEMPTYPANEL);
refreshTree();
}
break;
case "String_Node_Str":
setEditText(true);
break;
case "String_Node_Str":
setEditText(false);
break;
case "String_Node_Str":
if (oldValue instanceof TextTag) {
try {
((TextTag)oldValue).setFormattedText(swf.tags,textValue.getText());
setEditText(false);
}
 catch (ParseException ex) {
JOptionPane.showMessageDialog(null,"String_Node_Str" + ex.text + "String_Node_Str"+ ex.line,"String_Node_Str",JOptionPane.ERROR_MESSAGE);
}
}
break;
case "String_Node_Str":
if (JOptionPane.showConfirmDialog(this,"String_Node_Str" + (autoDeobfuscateMenuItem.getState() ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str","String_Node_Str",JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
Configuration.setConfig("String_Node_Str",autoDeobfuscateMenuItem.getState());
}
 else {
autoDeobfuscateMenuItem.setState(!autoDeobfuscateMenuItem.getState());
}
break;
case "String_Node_Str":
setVisible(false);
if (Main.proxyFrame != null) {
if (Main.proxyFrame.isVisible()) {
return;
}
}
Main.exit();
break;
}
if (Main.isWorking()) {
return;
}
switch (e.getActionCommand()) {
case "String_Node_Str":
if (swf.fileAttributes.actionScript3) {
final int multiName=abcPanel.decompiledTextArea.getMultinameUnderCursor();
if (multiName > 0) {
(new Thread(){
@Override public void run(){
Main.startWork("String_Node_Str");
renameMultiname(multiName);
Main.stopWork();
}
}
).start();
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
}
}
 else {
final String identifier=actionPanel.getStringUnderCursor();
if (identifier != null) {
(new Thread(){
@Override public void run(){
Main.startWork("String_Node_Str");
renameIdentifier(identifier);
Main.stopWork();
}
}
).start();
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.INFORMATION_MESSAGE);
}
}
break;
case "String_Node_Str":
Main.about();
break;
case "String_Node_Str":
Main.showProxy();
break;
case "String_Node_Str":
if (e.getSource() instanceof JCheckBoxMenuItem) {
Main.setSubLimiter(((JCheckBoxMenuItem)e.getSource()).getState());
}
break;
case "String_Node_Str":
try {
Main.saveFile(Main.file);
}
 catch (IOException ex) {
Logger.getLogger(com.jpexs.decompiler.flash.abc.gui.ABCPanel.class.getName()).log(Level.SEVERE,null,ex);
JOptionPane.showMessageDialog(null,"String_Node_Str","String_Node_Str",JOptionPane.ERROR_MESSAGE);
}
break;
case "String_Node_Str":
if (Main.saveFileDialog()) {
setTitle(Main.applicationVerName + (Configuration.DISPLAY_FILENAME ? "String_Node_Str" + Main.getFileTitle() : "String_Node_Str"));
}
break;
case "String_Node_Str":
Main.openFileDialog();
break;
case "String_Node_Str":
JFileChooser fc=new JFileChooser();
String selDir=(String)Configuration.getConfig("String_Node_Str","String_Node_Str");
fc.setCurrentDirectory(new File(selDir));
if (!selDir.endsWith(File.separator)) {
selDir+=File.separator;
}
String fileName=(new File(Main.file).getName());
fileName=fileName.substring(0,fileName.length() - 4) + "String_Node_Str";
fc.setSelectedFile(new File(selDir + fileName));
FileFilter fla=new FileFilter(){
@Override public boolean accept(File f){
return f.isDirectory() || (f.getName().toLowerCase().endsWith("String_Node_Str"));
}
@Override public String getDescription(){
return "String_Node_Str";
}
}
;
FileFilter xfl=new FileFilter(){
@Override public boolean accept(File f){
return f.isDirectory() || (f.getName().toLowerCase().endsWith("String_Node_Str"));
}
@Override public String getDescription(){
return "String_Node_Str";
}
}
;
fc.setFileFilter(fla);
fc.addChoosableFileFilter(xfl);
fc.setAcceptAllFileFilterUsed(false);
JFrame f=new JFrame();
View.setWindowIcon(f);
int returnVal=fc.showSaveDialog(f);
if (returnVal == JFileChooser.APPROVE_OPTION) {
Configuration.setConfig("String_Node_Str",Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath());
File sf=Helper.fixDialogFile(fc.getSelectedFile());
Main.startWork("String_Node_Str");
final boolean compressed=fc.getFileFilter() == fla;
if (!compressed) {
if (sf.getName().endsWith("String_Node_Str")) {
sf=new File(sf.getAbsolutePath().substring(0,sf.getAbsolutePath().length() - 4) + "String_Node_Str");
}
}
final File selfile=sf;
(new Thread(){
@Override public void run(){
if (compressed) {
swf.exportFla(selfile.getAbsolutePath(),new File(Main.file).getName(),Main.applicationName,Main.applicationVerName,Main.version,(Boolean)Configuration.getConfig("String_Node_Str",Boolean.TRUE));
}
 else {
swf.exportXfl(selfile.getAbsolutePath(),new File(Main.file).getName(),Main.applicationName,Main.applicationVerName,Main.version,(Boolean)Configuration.getConfig("String_Node_Str",Boolean.TRUE));
}
Main.stopWork();
}
}
).start();
}
break;
case "String_Node_Str":
case "String_Node_Str":
final ExportDialog export=new ExportDialog();
export.setVisible(true);
if (!export.cancelled) {
JFileChooser chooser=new JFileChooser();
chooser.setCurrentDirectory(new java.io.File((String)Configuration.getConfig("String_Node_Str","String_Node_Str")));
chooser.setDialogTitle("String_Node_Str");
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
chooser.setAcceptAllFileFilterUsed(false);
if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
final long timeBefore=System.currentTimeMillis();
Main.startWork("String_Node_Str");
final String selFile=Helper.fixDialogFile(chooser.getSelectedFile()).getAbsolutePath();
Configuration.setConfig("String_Node_Str",Helper.fixDialogFile(chooser.getSelectedFile()).getParentFile().getAbsolutePath());
final boolean isPcode=export.getOption(ExportDialog.OPTION_ACTIONSCRIPT) == 1;
final boolean isMp3OrWav=export.getOption(ExportDialog.OPTION_SOUNDS) == 0;
final boolean isFormatted=export.getOption(ExportDialog.OPTION_TEXTS) == 1;
final boolean onlySel=e.getActionCommand().endsWith("String_Node_Str");
(new Thread(){
@Override public void run(){
try {
if (onlySel) {
exportSelection(selFile,export);
}
 else {
swf.exportImages(selFile + File.separator + "String_Node_Str");
swf.exportShapes(selFile + File.separator + "String_Node_Str");
swf.exportTexts(selFile + File.separator + "String_Node_Str",isFormatted);
swf.exportMovies(selFile + File.separator + "String_Node_Str");
swf.exportSounds(selFile + File.separator + "String_Node_Str",isMp3OrWav,isMp3OrWav);
swf.exportBinaryData(selFile + File.separator + "String_Node_Str");
swf.exportActionScript(selFile,isPcode,(Boolean)Configuration.getConfig("String_Node_Str",Boolean.TRUE));
}
}
 catch (Exception ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
JOptionPane.showMessageDialog(null,"String_Node_Str");
}
Main.stopWork();
long timeAfter=System.currentTimeMillis();
long timeMs=timeAfter - timeBefore;
long timeS=timeMs / 1000;
timeMs=timeMs % 1000;
long timeM=timeS / 60;
timeS=timeS % 60;
long timeH=timeM / 60;
timeM=timeM % 60;
String timeStr="String_Node_Str";
if (timeH > 0) {
timeStr+=Helper.padZeros(timeH,2) + "String_Node_Str";
}
timeStr+=Helper.padZeros(timeM,2) + "String_Node_Str";
timeStr+=Helper.padZeros(timeS,2) + "String_Node_Str" + Helper.padZeros(timeMs,3);
setStatus("String_Node_Str" + timeStr);
}
}
).start();
}
}
break;
case "String_Node_Str":
if (!Main.checkForUpdates()) {
JOptionPane.showMessageDialog(null,"String_Node_Str");
}
break;
case "String_Node_Str":
String helpUsURL=Main.projectPage + "String_Node_Str";
if (java.awt.Desktop.isDesktopSupported()) {
java.awt.Desktop desktop=java.awt.Desktop.getDesktop();
try {
java.net.URI uri=new java.net.URI(helpUsURL);
desktop.browse(uri);
}
 catch (Exception ex) {
}
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str" + helpUsURL + "String_Node_Str");
}
break;
case "String_Node_Str":
String homePageURL=Main.projectPage;
if (java.awt.Desktop.isDesktopSupported()) {
java.awt.Desktop desktop=java.awt.Desktop.getDesktop();
try {
java.net.URI uri=new java.net.URI(homePageURL);
desktop.browse(uri);
}
 catch (Exception ex) {
}
}
 else {
JOptionPane.showMessageDialog(null,"String_Node_Str" + homePageURL);
}
break;
case "String_Node_Str":
case "String_Node_Str":
Main.startWork("String_Node_Str");
final boolean all=e.getActionCommand().endsWith("String_Node_Str");
if ((!all) || confirmExperimental()) {
new SwingWorker(){
@Override protected Object doInBackground() throws Exception {
int cnt=0;
if (all) {
for (ABCContainerTag tag : abcPanel.list) {
tag.getABC().restoreControlFlow();
}
}
 else {
int bi=abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex();
if (bi != -1) {
abcPanel.abc.bodies[bi].restoreControlFlow(abcPanel.abc.constants);
}
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi,abcPanel.abc);
}
Main.stopWork();
JOptionPane.showMessageDialog(null,"String_Node_Str");
abcPanel.reload();
return true;
}
}
.execute();
}
break;
case "String_Node_Str":
if (confirmExperimental()) {
final RenameType renameType=new RenameDialog().display();
if (renameType != null) {
Main.startWork("String_Node_Str");
new SwingWorker(){
@Override protected Object doInBackground() throws Exception {
try {
int cnt=0;
cnt=swf.deobfuscateIdentifiers(renameType);
Main.stopWork();
JOptionPane.showMessageDialog(null,"String_Node_Str" + cnt);
if (abcPanel != null) {
abcPanel.reload();
}
doFilter();
reload(true);
}
 catch (Exception ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
}
return true;
}
}
.execute();
}
}
break;
case "String_Node_Str":
case "String_Node_Str":
if (deobfuscationDialog == null) {
deobfuscationDialog=new DeobfuscationDialog();
}
deobfuscationDialog.setVisible(true);
if (deobfuscationDialog.ok) {
Main.startWork("String_Node_Str");
new SwingWorker(){
@Override protected Object doInBackground() throws Exception {
try {
if (deobfuscationDialog.processAllCheckbox.isSelected()) {
for (ABCContainerTag tag : abcPanel.list) {
if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_DEAD_CODE) {
tag.getABC().removeDeadCode();
}
 else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_TRAPS) {
tag.getABC().removeTraps();
}
 else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_RESTORE_CONTROL_FLOW) {
tag.getABC().removeTraps();
tag.getABC().restoreControlFlow();
}
}
}
 else {
int bi=abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex();
if (bi != -1) {
if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_DEAD_CODE) {
abcPanel.abc.bodies[bi].removeDeadCode(abcPanel.abc.constants);
}
 else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_REMOVE_TRAPS) {
abcPanel.abc.bodies[bi].removeTraps(abcPanel.abc.constants,abcPanel.abc,abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex,abcPanel.decompiledTextArea.getClassIndex(),abcPanel.decompiledTextArea.getIsStatic());
}
 else if (deobfuscationDialog.codeProcessingLevel.getValue() == DeobfuscationDialog.LEVEL_RESTORE_CONTROL_FLOW) {
abcPanel.abc.bodies[bi].removeTraps(abcPanel.abc.constants,abcPanel.abc,abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex,abcPanel.decompiledTextArea.getClassIndex(),abcPanel.decompiledTextArea.getIsStatic());
abcPanel.abc.bodies[bi].restoreControlFlow(abcPanel.abc.constants);
}
}
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi,abcPanel.abc);
}
}
 catch (Exception ex) {
Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,"String_Node_Str",ex);
}
Main.stopWork();
JOptionPane.showMessageDialog(null,"String_Node_Str");
abcPanel.reload();
return true;
}
}
.execute();
}
break;
case "String_Node_Str":
case "String_Node_Str":
Main.startWork("String_Node_Str");
final boolean rall=e.getActionCommand().endsWith("String_Node_Str");
if ((!rall) || confirmExperimental()) {
new SwingWorker(){
@Override protected Object doInBackground() throws Exception {
int cnt=0;
if (rall) {
for (ABCContainerTag tag : abcPanel.list) {
cnt+=tag.getABC().removeTraps();
}
}
 else {
int bi=abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex();
if (bi != -1) {
cnt+=abcPanel.abc.bodies[bi].removeTraps(abcPanel.abc.constants,abcPanel.abc,abcPanel.decompiledTextArea.getScriptLeaf().scriptIndex,abcPanel.decompiledTextArea.getClassIndex(),abcPanel.decompiledTextArea.getIsStatic());
}
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi,abcPanel.abc);
}
Main.stopWork();
JOptionPane.showMessageDialog(null,"String_Node_Str" + cnt);
abcPanel.reload();
return true;
}
}
.execute();
}
break;
case "String_Node_Str":
case "String_Node_Str":
Main.startWork("String_Node_Str");
final boolean dall=e.getActionCommand().endsWith("String_Node_Str");
if ((!dall) || confirmExperimental()) {
new SwingWorker(){
@Override protected Object doInBackground() throws Exception {
int cnt=0;
if (dall) {
for (ABCContainerTag tag : abcPanel.list) {
cnt+=tag.getABC().removeDeadCode();
}
}
 else {
int bi=abcPanel.detailPanel.methodTraitPanel.methodCodePanel.getBodyIndex();
if (bi != -1) {
cnt+=abcPanel.abc.bodies[bi].removeDeadCode(abcPanel.abc.constants);
}
abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setBodyIndex(bi,abcPanel.abc);
}
Main.stopWork();
JOptionPane.showMessageDialog(null,"String_Node_Str" + cnt);
abcPanel.reload();
return true;
}
}
.execute();
}
break;
}
}