Skip to content

Commit 9f3302f

Browse files
committed
v2.9.19 changes
1 parent 7f227ca commit 9f3302f

File tree

7 files changed

+53
-22
lines changed

7 files changed

+53
-22
lines changed

.gitignore

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
/bin/
1+
.bin/
2+
.idea/
3+
.out/
4+
.gradle/
25
.classpath
36
.project
4-
*.iml
5-
.idea/
6-
out/
7-
.DS_Store
7+
.DS_Store
8+
*.iml

CREDITS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
* ASM by OW2
77
* FernFlower by Stiver
88
* Procyon by Mstrobel
9+
* Luyten by DeathMarine
910
* CFR by Lee Benfield
1011
* CFIDE by Bibl
1112
* Smali by JesusFreke
12-
* Dex2Jar by pxb1988
13+
* Dex2Jar by pxb1988 & Lanchon
1314
* Krakatau by Storyyeller
1415
* JD GUI/JD Core by The Java-Decompiler Team
1516
* Enjarify by Storyyeller
17+
* JADX by Skylot
1618

1719
## Contributors
1820
* Konloch

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
Bytecode Viewer - a lightweight user friendly Java Bytecode Viewer.
44

55
#### New Features
6+
* WAR & JSP Loading
7+
* JADX-Core Decompiler
68
* Fixed APK & dex loading
79
* Fixed Java 10+ classfiles
810
* Better visual feedback due to the new busy icon system
911
* Synchronized viewing pane option & quick method selection
12+
* Updated most libraries to their 2019 version
1013
* Tons of bug fixes and general improvements
11-
* Updated most libraries to their 2019 versions (still a WIP)
1214

1315

1416
#### Links

src/the/bytecode/club/bootloader/Boot.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,18 @@ public static void populateLibsDirectory() {
320320

321321
public static void dropKrakatau()
322322
{
323+
File temp = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "krakatau_" + BytecodeViewer.krakatauVersion + ".zip");
323324
File krakatauDirectory = new File(BytecodeViewer.krakatauWorkingDirectory);
324325
BytecodeViewer.krakatauWorkingDirectory = BytecodeViewer.krakatauWorkingDirectory + BytecodeViewer.fs + "Krakatau-master";
325-
if (!krakatauDirectory.exists())
326+
if (!krakatauDirectory.exists() || temp.exists())
326327
{
328+
if(temp.exists())
329+
temp.delete();
330+
327331
setState("Bytecode Viewer Boot Screen - Extracting Krakatau");
328332
System.out.println("Extracting Krakatau");
329333
try
330334
{
331-
File temp = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "krakatau_" + BytecodeViewer.krakatauVersion + ".zip");
332335

333336
while (temp.exists())
334337
temp.delete();
@@ -358,15 +361,17 @@ public static void dropKrakatau()
358361

359362
public static void dropEnjarify()
360363
{
364+
File temp = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "enjarify" + BytecodeViewer.enjarifyVersion + ".zip");
361365
File enjarifyDirectory = new File(BytecodeViewer.enjarifyWorkingDirectory);
362366
BytecodeViewer.enjarifyWorkingDirectory = BytecodeViewer.enjarifyWorkingDirectory + BytecodeViewer.fs + "enjarify-master";
363-
if (!enjarifyDirectory.exists())
367+
if (!enjarifyDirectory.exists() || temp.exists())
364368
{
369+
if(temp.exists())
370+
temp.delete();
365371
setState("Bytecode Viewer Boot Screen - Extracting Enjarify");
366372
System.out.println("Extracting Enjarify");
367373
try
368374
{
369-
File temp = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "enjarify" + BytecodeViewer.enjarifyVersion + ".zip");
370375

371376
while (temp.exists())
372377
temp.delete();

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

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
* http://the.bytecode.club
9898
*
9999
* TODO:
100-
* Update fernflower for it's 2019 version
101100
* Finish dragging code
102101
* Finish right-click tab menu detection
103102
* make it use that global last used inside of export as jar
@@ -119,7 +118,7 @@
119118
public class BytecodeViewer
120119
{
121120
/*per version*/
122-
public static final String VERSION = "2.9.18";
121+
public static final String VERSION = "2.9.19";
123122
public static String krakatauVersion = "12";
124123
public static String enjarifyVersion = "4";
125124
public static final boolean BLOCK_TAB_MENU = true;
@@ -746,8 +745,15 @@ public static boolean compile(boolean message) {
746745
String smaliText = (String) smali[1];
747746
byte[] smaliCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.smali.compile(smaliText, origNode.name);
748747
if (smaliCompiled != null) {
749-
ClassNode newNode = JarUtils.getNode(smaliCompiled);
750-
BytecodeViewer.updateNode(origNode, newNode);
748+
try
749+
{
750+
ClassNode newNode = JarUtils.getNode(smaliCompiled);
751+
BytecodeViewer.updateNode(origNode, newNode);
752+
}
753+
catch(Exception e)
754+
{
755+
e.printStackTrace();
756+
}
751757
} else {
752758
BytecodeViewer.showMessage("There has been an error with assembling your Smali code, please check this. Class: " + origNode.name);
753759
BytecodeViewer.viewer.setIcon(false);
@@ -767,8 +773,15 @@ public static boolean compile(boolean message) {
767773
String krakatauText = (String) krakatau[1];
768774
byte[] krakatauCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.krakatau.compile(krakatauText, origNode.name);
769775
if (krakatauCompiled != null) {
770-
ClassNode newNode = JarUtils.getNode(krakatauCompiled);
771-
BytecodeViewer.updateNode(origNode, newNode);
776+
try
777+
{
778+
ClassNode newNode = JarUtils.getNode(krakatauCompiled);
779+
BytecodeViewer.updateNode(origNode, newNode);
780+
}
781+
catch(Exception e)
782+
{
783+
e.printStackTrace();
784+
}
772785
} else {
773786
BytecodeViewer.showMessage("There has been an error with assembling your Krakatau Bytecode, please check this. Class: " + origNode.name);
774787
BytecodeViewer.viewer.setIcon(false);
@@ -791,8 +804,15 @@ public static boolean compile(boolean message) {
791804

792805
byte[] javaCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.java.compile(javaText, origNode.name);
793806
if (javaCompiled != null) {
794-
ClassNode newNode = JarUtils.getNode(javaCompiled);
795-
BytecodeViewer.updateNode(origNode, newNode);
807+
try
808+
{
809+
ClassNode newNode = JarUtils.getNode(javaCompiled);
810+
BytecodeViewer.updateNode(origNode, newNode);
811+
}
812+
catch(Exception e)
813+
{
814+
e.printStackTrace();
815+
}
796816
errConsole.finished();
797817
} else {
798818
errConsole.pretty();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ public Component getTreeCellRendererComponent(
639639
setIcon(Resources.textIcon);
640640
} else if (name.equals("decoded resources")) {
641641
setIcon(Resources.decodedIcon);
642-
} else if (name.endsWith(".properties") || name.endsWith(".xml") || name.endsWith(".mf") || name.endsWith(".config") || name.endsWith(".cfg")) {
642+
} else if (name.endsWith(".properties") || name.endsWith(".xml") || name.endsWith(".jsp") || name.endsWith(".mf") || name.endsWith(".config") || name.endsWith(".cfg")) {
643643
setIcon(Resources.configIcon);
644644
} else if (node.getChildCount() <= 0) { //random file
645645
setIcon(Resources.fileIcon);

src/the/bytecode/club/bytecodeviewer/util/JarUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public static void put(final File jarFile) throws IOException {
7575
final ClassNode cn = getNode(bytes);
7676
container.classes.add(cn);
7777
} catch (Exception e) {
78+
System.err.println("Skipping: " + name);
7879
e.printStackTrace();
7980
}
8081
} else {
@@ -255,7 +256,7 @@ public static byte[] getBytes(final InputStream is) throws IOException {
255256
* @param bytez the class file's byte[]
256257
* @return the ClassNode instance
257258
*/
258-
public static ClassNode getNode(final byte[] bytez) {
259+
public static ClassNode getNode(final byte[] bytez) throws Exception {
259260
ClassReader cr = new ClassReader(bytez);
260261
ClassNode cn = new ClassNode();
261262
try {
@@ -264,7 +265,7 @@ public static ClassNode getNode(final byte[] bytez) {
264265
try {
265266
cr.accept(cn, ClassReader.SKIP_FRAMES);
266267
} catch (Exception e2) {
267-
e2.printStackTrace(); //just skip it
268+
throw e2;
268269
}
269270
}
270271
cr = null;

0 commit comments

Comments
 (0)