Skip to content

Commit 3df513f

Browse files
committed
2.9.1
02/24/2015 - Fixed the third pane window not showing the search buttons. 02/24/2015 - Fixed some issues with the compiler functionality.
1 parent fd9f078 commit 3df513f

6 files changed

Lines changed: 78 additions & 73 deletions

File tree

BytecodeViewer.exe

468 Bytes
Binary file not shown.

README.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,7 @@ Changelog:
318318
02/23/2015 - Not really code related, but added _install.bat and _uninstall.bat for the exe version of BCV.
319319
02/23/2015 - Back to ASM5, packed dex2jar in its own obfuscated jar.
320320
02/23/2015 - Added the annotations back to the Bytecode Decompiler. (Once again, thanks Bibl)
321-
02/23/2015 - It once again works with Java 8 Jars.
321+
02/23/2015 - It once again works with Java 8 Jars.
322+
--- 2.9.1 ---:
323+
02/24/2015 - Fixed the third pane window not showing the search buttons.
324+
02/24/2015 - Fixed some issues with the compiler functionality.

src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java

Lines changed: 62 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,9 @@
8181
* fix the randomly sometimes fucked up names on file navigation bug
8282
* make zipfile not include the decode shit
8383
*
84-
* -----2.9.0-----:
85-
* 02/11/2015 - Added ZStringArray String Decrypter. (Thanks Righteous)
86-
* 02/20/2015 - Moved the decompilers/disassemblers around.
87-
* 02/20/2015 - Fixed a resource leak with Krakatau Decompiler/Disassembler/Assembler.
88-
* 02/21/2015 - Fixed regex searching if your regex search contained a syntax error.
89-
* 02/21/2015 - Added the compiler/decompiler instances to the BytecodeViewer API class.
90-
* 02/21/2015 - Sped up the decompilers, each view pane runs its own decompiler thread.
91-
* 02/21/2015 - Added Janino compiler, you can now compile the decompiled source code inside of BCV.
92-
* 02/21/2015 - Added the editable option for almost all of the decompilers/disassemblers.
93-
* 02/21/2015 - Cached the next/previous icons and added a resources class for all resources.
94-
* 01/21/2015 - Renamed EZ-Injection as File-Run, however kept the plugin named EZ-Injection.
95-
* 02/21/2015 - Dropped Groovy support, added .Java plugin compilation instead (now only 10mb).
96-
* 02/21/2015 - Added support for reading resources, including displaying images, detecting pure ascii files and more.
97-
* 02/21/2015 - Fixed an issue with loading an already selected node in the file navigation pane.
98-
* 02/22/2015 - Added an error console to the Java compiler
99-
* 02/22/2015 - Ensured the spawned Python/Krakatau processes are killed when closing BCV.
100-
* 02/22/2015 - Made it more beginner friendly.
101-
* 02/22/2015 - Fixed? The file navigation search.
102-
* 02/22/2015 - Added a shit ton more comments to non-api related classes.
103-
* 02/23/2015 - Added APK resources.
104-
* 02/23/2015 - MORE ANDROID LOVE! Added APKTool.jar's decode. (Takes a while so it's a setting, also pumped the jar back to 16MB :()
105-
* 02/23/2015 - Added close all but this tab menu.
106-
* 02/23/2015 - Not really code related, but added _install.bat and _uninstall.bat for the exe version of BCV.
107-
* 02/23/2015 - Back to ASM5, packed dex2jar in its own obfuscated jar.
108-
* 02/23/2015 - Added the annotations back to the Bytecode Decompiler. (Once again, thanks Bibl)
109-
* 02/23/2015 - It once again works with Java 8 Jars.
84+
* -----2.9.1-----:
85+
* 02/24/2015 - Fixed the third pane window not showing the search buttons.
86+
* 02/24/2015 - Fixed some issues with the compiler functionality.
11087
*
11188
* @author Konloch
11289
*
@@ -115,7 +92,7 @@
11592
public class BytecodeViewer {
11693

11794
/*per version*/
118-
public static String version = "2.9.0";
95+
public static String version = "2.9.1";
11996
public static String krakatauVersion = "2";
12097
/*the rest*/
12198
public static MainViewerGUI viewer = null;
@@ -431,63 +408,80 @@ public static boolean compile(boolean message) {
431408
if(getLoadedClasses().isEmpty())
432409
return false;
433410

411+
boolean actuallyTried = false;
412+
434413
for(java.awt.Component c : BytecodeViewer.viewer.workPane.getLoadedViewers()) {
435414
if(c instanceof ClassViewer) {
436415
ClassViewer cv = (ClassViewer) c;
437-
Object smali[] = cv.getSmali();
438-
if(smali != null) {
439-
ClassNode origNode = (ClassNode) smali[0];
440-
String smaliText = (String) smali[1];
441-
byte[] smaliCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.smali.compile(smaliText, origNode.name);
442-
if(smaliCompiled != null) {
443-
ClassNode newNode = JarUtils.getNode(smaliCompiled);
444-
BytecodeViewer.updateNode(origNode, newNode);
445-
} else {
446-
BytecodeViewer.showMessage("There has been an error with assembling your Smali code, please check this. Class: " + origNode.name);
447-
return false;
416+
if((cv.smali1 != null && cv.smali2 != null && cv.smali3 != null) &&
417+
(cv.smali1.isEditable() || cv.smali2.isEditable() || cv.smali3.isEditable())) {
418+
actuallyTried = true;
419+
Object smali[] = cv.getSmali();
420+
if(smali != null) {
421+
ClassNode origNode = (ClassNode) smali[0];
422+
String smaliText = (String) smali[1];
423+
byte[] smaliCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.smali.compile(smaliText, origNode.name);
424+
if(smaliCompiled != null) {
425+
ClassNode newNode = JarUtils.getNode(smaliCompiled);
426+
BytecodeViewer.updateNode(origNode, newNode);
427+
} else {
428+
BytecodeViewer.showMessage("There has been an error with assembling your Smali code, please check this. Class: " + origNode.name);
429+
return false;
430+
}
448431
}
449432
}
450433

451434

452-
Object krakatau[] = cv.getKrakatau();
453-
if(krakatau != null) {
454-
ClassNode origNode = (ClassNode) krakatau[0];
455-
String krakatauText = (String) krakatau[1];
456-
byte[] krakatauCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.krakatau.compile(krakatauText, origNode.name);
457-
if(krakatauCompiled != null) {
458-
ClassNode newNode = JarUtils.getNode(krakatauCompiled);
459-
BytecodeViewer.updateNode(origNode, newNode);
460-
} else {
461-
BytecodeViewer.showMessage("There has been an error with assembling your Krakatau Bytecode, please check this. Class: " + origNode.name);
462-
return false;
435+
if((cv.krakatau1 != null && cv.krakatau2 != null && cv.krakatau3 != null) &&
436+
(cv.krakatau1.isEditable() || cv.krakatau2.isEditable() || cv.krakatau3.isEditable())) {
437+
actuallyTried = true;
438+
Object krakatau[] = cv.getKrakatau();
439+
if(krakatau != null) {
440+
ClassNode origNode = (ClassNode) krakatau[0];
441+
String krakatauText = (String) krakatau[1];
442+
byte[] krakatauCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.krakatau.compile(krakatauText, origNode.name);
443+
if(krakatauCompiled != null) {
444+
ClassNode newNode = JarUtils.getNode(krakatauCompiled);
445+
BytecodeViewer.updateNode(origNode, newNode);
446+
} else {
447+
BytecodeViewer.showMessage("There has been an error with assembling your Krakatau Bytecode, please check this. Class: " + origNode.name);
448+
return false;
449+
}
463450
}
464451
}
465452

466-
Object java[] = cv.getJava();
467-
if(java != null) {
468-
ClassNode origNode = (ClassNode) java[0];
469-
String javaText = (String) java[1];
470-
471-
SystemErrConsole errConsole = new SystemErrConsole("Java Compile Issues");
472-
errConsole.setText("Error compiling class: " + origNode.name + nl + "Keep in mind most decompilers cannot produce compilable classes"+nl+nl);
473-
474-
byte[] javaCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.java.compile(javaText, origNode.name);
475-
if(javaCompiled != null) {
476-
ClassNode newNode = JarUtils.getNode(javaCompiled);
477-
BytecodeViewer.updateNode(origNode, newNode);
478-
errConsole.finished();
479-
} else {
480-
errConsole.pretty();
481-
errConsole.setVisible(true);
482-
errConsole.finished();
483-
return false;
453+
if((cv.java1 != null && cv.java2 != null && cv.java3 != null) &&
454+
(cv.java1.isEditable() || cv.java2.isEditable() || cv.java3.isEditable())) {
455+
actuallyTried = true;
456+
Object java[] = cv.getJava();
457+
if(java != null) {
458+
ClassNode origNode = (ClassNode) java[0];
459+
String javaText = (String) java[1];
460+
461+
SystemErrConsole errConsole = new SystemErrConsole("Java Compile Issues");
462+
errConsole.setText("Error compiling class: " + origNode.name + nl + "Keep in mind most decompilers cannot produce compilable classes"+nl+nl);
463+
464+
byte[] javaCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.java.compile(javaText, origNode.name);
465+
if(javaCompiled != null) {
466+
ClassNode newNode = JarUtils.getNode(javaCompiled);
467+
BytecodeViewer.updateNode(origNode, newNode);
468+
errConsole.finished();
469+
} else {
470+
errConsole.pretty();
471+
errConsole.setVisible(true);
472+
errConsole.finished();
473+
return false;
474+
}
484475
}
485476
}
486477
}
487478
}
488479

489480
if(message)
490-
BytecodeViewer.showMessage("Compiled Successfully.");
481+
if(actuallyTried)
482+
BytecodeViewer.showMessage("Compiled Successfully.");
483+
else
484+
BytecodeViewer.showMessage("You have no editable panes opened, make one editable and try again.");
491485

492486
return true;
493487
}

src/the/bytecode/club/bytecodeviewer/decompilers/CFRDecompiler.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,16 @@ public void decompileToClass(String className, String classNameSaved) {
4343
@Override
4444
public String decompileClassNode(ClassNode cn) {
4545
final ClassWriter cw = new ClassWriter(0);
46-
cn.accept(cw);
47-
46+
try {
47+
cn.accept(cw);
48+
} catch(Exception e) {
49+
e.printStackTrace();
50+
try {
51+
Thread.sleep(200);
52+
cn.accept(cw);
53+
} catch (InterruptedException e1) { }
54+
}
55+
4856
String fileStart = BytecodeViewer.tempDirectory + BytecodeViewer.fs;
4957

5058
final File tempClass = new File(MiscUtils.getUniqueName(fileStart, ".class") + ".class");

src/the/bytecode/club/bytecodeviewer/gui/ClassViewer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,8 @@ public void keyTyped(KeyEvent arg0) {
359359
JPanel buttonPane3 = new JPanel(new BorderLayout());
360360
buttonPane3.add(searchNext3, BorderLayout.WEST);
361361
buttonPane3.add(searchPrev3, BorderLayout.EAST);
362-
searchNext2.setIcon(Resources.nextIcon);
363-
searchPrev2.setIcon(Resources.prevIcon);
362+
searchNext3.setIcon(Resources.nextIcon);
363+
searchPrev3.setIcon(Resources.prevIcon);
364364
panel3Search.add(buttonPane3, BorderLayout.WEST);
365365
panel3Search.add(field3, BorderLayout.CENTER);
366366
panel3Search.add(check3, BorderLayout.EAST);

0 commit comments

Comments
 (0)