Skip to content

Commit

Permalink
v2.9.19 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Konloch committed May 6, 2019
1 parent 7f227ca commit 9f3302f
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 22 deletions.
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/bin/
.bin/
.idea/
.out/
.gradle/
.classpath
.project
*.iml
.idea/
out/
.DS_Store
.DS_Store
*.iml
4 changes: 3 additions & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
* ASM by OW2
* FernFlower by Stiver
* Procyon by Mstrobel
* Luyten by DeathMarine
* CFR by Lee Benfield
* CFIDE by Bibl
* Smali by JesusFreke
* Dex2Jar by pxb1988
* Dex2Jar by pxb1988 & Lanchon
* Krakatau by Storyyeller
* JD GUI/JD Core by The Java-Decompiler Team
* Enjarify by Storyyeller
* JADX by Skylot

## Contributors
* Konloch
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
Bytecode Viewer - a lightweight user friendly Java Bytecode Viewer.

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


#### Links
Expand Down
13 changes: 9 additions & 4 deletions src/the/bytecode/club/bootloader/Boot.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,18 @@ public static void populateLibsDirectory() {

public static void dropKrakatau()
{
File temp = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "krakatau_" + BytecodeViewer.krakatauVersion + ".zip");
File krakatauDirectory = new File(BytecodeViewer.krakatauWorkingDirectory);
BytecodeViewer.krakatauWorkingDirectory = BytecodeViewer.krakatauWorkingDirectory + BytecodeViewer.fs + "Krakatau-master";
if (!krakatauDirectory.exists())
if (!krakatauDirectory.exists() || temp.exists())
{
if(temp.exists())
temp.delete();

setState("Bytecode Viewer Boot Screen - Extracting Krakatau");
System.out.println("Extracting Krakatau");
try
{
File temp = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "krakatau_" + BytecodeViewer.krakatauVersion + ".zip");

while (temp.exists())
temp.delete();
Expand Down Expand Up @@ -358,15 +361,17 @@ public static void dropKrakatau()

public static void dropEnjarify()
{
File temp = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "enjarify" + BytecodeViewer.enjarifyVersion + ".zip");
File enjarifyDirectory = new File(BytecodeViewer.enjarifyWorkingDirectory);
BytecodeViewer.enjarifyWorkingDirectory = BytecodeViewer.enjarifyWorkingDirectory + BytecodeViewer.fs + "enjarify-master";
if (!enjarifyDirectory.exists())
if (!enjarifyDirectory.exists() || temp.exists())
{
if(temp.exists())
temp.delete();
setState("Bytecode Viewer Boot Screen - Extracting Enjarify");
System.out.println("Extracting Enjarify");
try
{
File temp = new File(BytecodeViewer.getBCVDirectory() + BytecodeViewer.fs + "enjarify" + BytecodeViewer.enjarifyVersion + ".zip");

while (temp.exists())
temp.delete();
Expand Down
36 changes: 28 additions & 8 deletions src/the/bytecode/club/bytecodeviewer/BytecodeViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
* http://the.bytecode.club
*
* TODO:
* Update fernflower for it's 2019 version
* Finish dragging code
* Finish right-click tab menu detection
* make it use that global last used inside of export as jar
Expand All @@ -119,7 +118,7 @@
public class BytecodeViewer
{
/*per version*/
public static final String VERSION = "2.9.18";
public static final String VERSION = "2.9.19";
public static String krakatauVersion = "12";
public static String enjarifyVersion = "4";
public static final boolean BLOCK_TAB_MENU = true;
Expand Down Expand Up @@ -746,8 +745,15 @@ public static boolean compile(boolean message) {
String smaliText = (String) smali[1];
byte[] smaliCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.smali.compile(smaliText, origNode.name);
if (smaliCompiled != null) {
ClassNode newNode = JarUtils.getNode(smaliCompiled);
BytecodeViewer.updateNode(origNode, newNode);
try
{
ClassNode newNode = JarUtils.getNode(smaliCompiled);
BytecodeViewer.updateNode(origNode, newNode);
}
catch(Exception e)
{
e.printStackTrace();
}
} else {
BytecodeViewer.showMessage("There has been an error with assembling your Smali code, please check this. Class: " + origNode.name);
BytecodeViewer.viewer.setIcon(false);
Expand All @@ -767,8 +773,15 @@ public static boolean compile(boolean message) {
String krakatauText = (String) krakatau[1];
byte[] krakatauCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.krakatau.compile(krakatauText, origNode.name);
if (krakatauCompiled != null) {
ClassNode newNode = JarUtils.getNode(krakatauCompiled);
BytecodeViewer.updateNode(origNode, newNode);
try
{
ClassNode newNode = JarUtils.getNode(krakatauCompiled);
BytecodeViewer.updateNode(origNode, newNode);
}
catch(Exception e)
{
e.printStackTrace();
}
} else {
BytecodeViewer.showMessage("There has been an error with assembling your Krakatau Bytecode, please check this. Class: " + origNode.name);
BytecodeViewer.viewer.setIcon(false);
Expand All @@ -791,8 +804,15 @@ public static boolean compile(boolean message) {

byte[] javaCompiled = the.bytecode.club.bytecodeviewer.compilers.Compiler.java.compile(javaText, origNode.name);
if (javaCompiled != null) {
ClassNode newNode = JarUtils.getNode(javaCompiled);
BytecodeViewer.updateNode(origNode, newNode);
try
{
ClassNode newNode = JarUtils.getNode(javaCompiled);
BytecodeViewer.updateNode(origNode, newNode);
}
catch(Exception e)
{
e.printStackTrace();
}
errConsole.finished();
} else {
errConsole.pretty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ public Component getTreeCellRendererComponent(
setIcon(Resources.textIcon);
} else if (name.equals("decoded resources")) {
setIcon(Resources.decodedIcon);
} else if (name.endsWith(".properties") || name.endsWith(".xml") || name.endsWith(".mf") || name.endsWith(".config") || name.endsWith(".cfg")) {
} else if (name.endsWith(".properties") || name.endsWith(".xml") || name.endsWith(".jsp") || name.endsWith(".mf") || name.endsWith(".config") || name.endsWith(".cfg")) {
setIcon(Resources.configIcon);
} else if (node.getChildCount() <= 0) { //random file
setIcon(Resources.fileIcon);
Expand Down
5 changes: 3 additions & 2 deletions src/the/bytecode/club/bytecodeviewer/util/JarUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public static void put(final File jarFile) throws IOException {
final ClassNode cn = getNode(bytes);
container.classes.add(cn);
} catch (Exception e) {
System.err.println("Skipping: " + name);
e.printStackTrace();
}
} else {
Expand Down Expand Up @@ -255,7 +256,7 @@ public static byte[] getBytes(final InputStream is) throws IOException {
* @param bytez the class file's byte[]
* @return the ClassNode instance
*/
public static ClassNode getNode(final byte[] bytez) {
public static ClassNode getNode(final byte[] bytez) throws Exception {
ClassReader cr = new ClassReader(bytez);
ClassNode cn = new ClassNode();
try {
Expand All @@ -264,7 +265,7 @@ public static ClassNode getNode(final byte[] bytez) {
try {
cr.accept(cn, ClassReader.SKIP_FRAMES);
} catch (Exception e2) {
e2.printStackTrace(); //just skip it
throw e2;
}
}
cr = null;
Expand Down

0 comments on commit 9f3302f

Please sign in to comment.