Skip to content

Commit

Permalink
2.9.6
Browse files Browse the repository at this point in the history
-----2.9.6-----:
05/05/2015 - Fixed a typo in the about window
05/28/2015 - Started importing JD-GUI Decompiler.
05/28/2015 - Compile on refresh and compile on save are now enabled by
default.
05/28/2015 - Renamed the File>Save As options to be much more
informative.
06/24/2015 - Fixed a logic error with the Field & Method searchers.
06/26/2015 - Updated Procyon & CFR to their latest versions.
07/02/2015 - Added JD-GUI Decompiler. - Huge thanks to the guys behind
JD-GUI! <3 (FIVE DECOMPILERS NOW LOL)
  • Loading branch information
Konloch committed Jul 3, 2015
1 parent 13e52bb commit 858f3ea
Show file tree
Hide file tree
Showing 30 changed files with 1,611 additions and 90 deletions.
Binary file not shown.
10 changes: 9 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,12 @@ Changelog:
04/21/2015 - The about pane now provides a lot more up to date information.
04/21/2015 - Changed 'View Panes' to simply 'View'.
--- 2.9.5 ---:
05/01/2015 - Added 'pingback' for statistics (to track how many people globally use BCV)
05/01/2015 - Added 'pingback' for statistics (to track how many people globally use BCV)
-----2.9.6-----:
05/05/2015 - Fixed a typo in the about window
05/28/2015 - Started importing JD-GUI Decompiler.
05/28/2015 - Compile on refresh and compile on save are now enabled by default.
05/28/2015 - Renamed the File>Save As options to be much more informative.
06/24/2015 - Fixed a logic error with the Field & Method searchers.
06/26/2015 - Updated Procyon & CFR to their latest versions.
07/02/2015 - Added JD-GUI Decompiler. - Huge thanks to the guys behind JD-GUI! <3 (FIVE DECOMPILERS NOW LOL)
14 changes: 0 additions & 14 deletions install/_install BCV.64.bat

This file was deleted.

6 changes: 3 additions & 3 deletions install/_install BCV.32.bat → install/_install BCV.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
assoc .class=BCV
assoc .apk=BCV
assoc .dex=BCV
ftype BCV="%CD%\BytecodeViewer.32.exe" "%%1"
ftype BCV="%CD%\BytecodeViewer.exe" "%%1"
echo.
echo.
echo Installed, .class, .apk and .dex will be associated with BytecodeViwer.32.exe
echo Installed, .class, .apk and .dex will be associated with BytecodeViwer.exe
echo.
echo Note, if you move BytecodeViewer.32.exe
echo Note, if you move BytecodeViewer.exe
echo you'll need to re-run this program in the same directory as it.
echo.
echo.
Expand Down
38 changes: 38 additions & 0 deletions install/launch4j_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>H:\Repo\BCV\bytecode-viewer\BytecodeViewer 2.9.6.jar</jar>
<outfile>H:\Repo\BCV\bytecode-viewer\BytecodeViewer.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir>.</chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<stayAlive>false</stayAlive>
<restartOnCrash>false</restartOnCrash>
<manifest></manifest>
<icon>H:\Repo\BCV\bytecode-viewer\BCV Icon.ico</icon>
<jre>
<path></path>
<bundledJre64Bit>false</bundledJre64Bit>
<bundledJreAsFallback>false</bundledJreAsFallback>
<minVersion>1.7.0_00</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
</jre>
<versionInfo>
<fileVersion>0.2.9.6</fileVersion>
<txtFileVersion>http://the.bytecode.club</txtFileVersion>
<fileDescription>Bytecode Viewer</fileDescription>
<copyright>http://bytecodeviewer.com</copyright>
<productVersion>0.2.9.6</productVersion>
<txtProductVersion>http://the.bytecode.club</txtProductVersion>
<productName>Bytecode Viewer</productName>
<companyName></companyName>
<internalName>BCV</internalName>
<originalFilename>Bytecode_Viewer.exe</originalFilename>
</versionInfo>
</launch4jConfig>
Binary file renamed libs/cfr_0_100.jar → libs/cfr_0_101.jar
Binary file not shown.
Binary file not shown.
54 changes: 54 additions & 0 deletions src/jd/cli/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package jd.cli;

import java.io.File;
import java.io.PrintStream;

import jd.cli.loader.DirectoryLoader;
import jd.cli.preferences.CommonPreferences;
import jd.cli.printer.text.PlainTextPrinter;
import jd.cli.util.ClassFileUtil;
import jd.core.Decompiler;
import jd.core.process.DecompilerImpl;


public class Main
{
/**
* @param args Path to java class
*/
public static void main(String[] args) {

if (args.length == 0) {
System.out.println("usage: ...");
} else {
try {
String pathToClass = args[0].replace('/', File.separatorChar).replace('\\', File.separatorChar);
String directoryPath = ClassFileUtil.ExtractDirectoryPath(pathToClass);

if (directoryPath == null)
return;

String internalPath = ClassFileUtil.ExtractInternalPath(directoryPath, pathToClass);

if (internalPath == null)
return;

CommonPreferences preferences = new CommonPreferences();
DirectoryLoader loader = new DirectoryLoader(new File(directoryPath));

//PrintStream ps = new PrintStream("test.html");
//HtmlPrinter printer = new HtmlPrinter(ps);
PrintStream ps = new PrintStream("test.txt");
PlainTextPrinter printer = new PlainTextPrinter(preferences, ps);

Decompiler decompiler = new DecompilerImpl();
decompiler.decompile(preferences, loader, printer, internalPath);

System.out.println("done.");

} catch (Exception e) {
e.printStackTrace();
}
}
}
}
34 changes: 34 additions & 0 deletions src/jd/cli/loader/BaseLoader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package jd.cli.loader;

import java.io.File;

import jd.core.loader.Loader;

public abstract class BaseLoader implements Loader
{
protected String codebase;
protected long lastModified;
protected boolean isFile;

public BaseLoader(File file)
{
this.codebase = file.getAbsolutePath();
this.lastModified = file.lastModified();
this.isFile = file.isFile();
}

public String getCodebase()
{
return codebase;
}

public long getLastModified()
{
return lastModified;
}

public boolean isFile()
{
return isFile;
}
}
44 changes: 44 additions & 0 deletions src/jd/cli/loader/DirectoryLoader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package jd.cli.loader;

import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

import jd.core.loader.LoaderException;


public class DirectoryLoader extends BaseLoader
{
public DirectoryLoader(File file) throws LoaderException
{
super(file);

if (! (file.exists() && file.isDirectory()))
throw new LoaderException("'" + codebase + "' is not a directory");
}

public DataInputStream load(String internalPath)
throws LoaderException
{
File file = new File(this.codebase, internalPath);

try
{
return new DataInputStream(
new BufferedInputStream(new FileInputStream(file)));
}
catch (FileNotFoundException e)
{
throw new LoaderException(
"'" + file.getAbsolutePath() + "' not found.");
}
}

public boolean canLoad(String internalPath)
{
File file = new File(this.codebase, internalPath);
return file.exists() && file.isFile();
}
}
59 changes: 59 additions & 0 deletions src/jd/cli/loader/JarLoader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package jd.cli.loader;

import java.io.DataInputStream;
import java.io.File;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

import jd.core.loader.LoaderException;


public class JarLoader extends BaseLoader
{
private ZipFile zipFile;

public JarLoader(File file) throws LoaderException
{
super(file);

if (! (file.exists() && file.isFile()))
{
throw new LoaderException("'" + codebase + "' is not a directory");
}

try
{
this.zipFile = new ZipFile(codebase);
}
catch (IOException e)
{
throw new LoaderException("Error reading from '" + codebase + "'");
}
}

public DataInputStream load(String internalPath)
throws LoaderException
{
ZipEntry zipEntry = this.zipFile.getEntry(internalPath);

if (zipEntry == null)
{
throw new LoaderException("Can not read '" + internalPath + "'");
}

try
{
return new DataInputStream(this.zipFile.getInputStream(zipEntry));
}
catch (IOException e)
{
throw new LoaderException("Error reading '" + internalPath + "'");
}
}

public boolean canLoad(String internalPath)
{
return this.zipFile.getEntry(internalPath) != null;
}
}
79 changes: 79 additions & 0 deletions src/jd/cli/loader/LoaderManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package jd.cli.loader;

import java.io.File;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import jd.core.loader.LoaderException;

public class LoaderManager
{
protected final static String JAR_SUFFIX = ".jar";
protected final static String ZIP_SUFFIX = ".zip";

protected Map<String, BaseLoader> map;

public LoaderManager()
{
this.map = new ConcurrentHashMap<String, BaseLoader>();
}

public BaseLoader getLoader(String codebase) throws LoaderException
{
File file = new File(codebase);
String key = file.getAbsolutePath();
BaseLoader loader = map.get(key);

if (loader == null)
{
if (file.exists())
{
loader = newLoader(key, file);
}
}
else
{
if (file.exists())
{
if ((file.lastModified() != loader.getLastModified()) ||
(file.isFile() != loader.isFile()))
{
loader = newLoader(key, file);
}
}
else
{
map.remove(key);
}
}

return loader;
}

protected BaseLoader newLoader(String key, File file) throws LoaderException
{
BaseLoader loader = null;

if (file.isFile())
{
if (endsWithIgnoreCase(key, JAR_SUFFIX) ||
endsWithIgnoreCase(key, ZIP_SUFFIX))
{
this.map.put(key, loader = new JarLoader(file));
}
}
else if (file.isDirectory())
{
this.map.put(key, loader = new DirectoryLoader(file));
}

return loader;
}

protected static boolean endsWithIgnoreCase(String s, String suffix)
{
int suffixLength = suffix.length();
int index = s.length() - suffixLength;
return (s.regionMatches(true, index, suffix, 0, suffixLength));
}
}
36 changes: 36 additions & 0 deletions src/jd/cli/preferences/CommonPreferences.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package jd.cli.preferences;

import jd.core.preferences.Preferences;

public class CommonPreferences extends Preferences
{
protected boolean showPrefixThis;
protected boolean mergeEmptyLines;
protected boolean unicodeEscape;
protected boolean showLineNumbers;

public CommonPreferences()
{
this.showPrefixThis = true;
this.mergeEmptyLines = false;
this.unicodeEscape = false;
this.showLineNumbers = true;
}

public CommonPreferences(
boolean showDefaultConstructor, boolean realignmentLineNumber,
boolean showPrefixThis, boolean mergeEmptyLines,
boolean unicodeEscape, boolean showLineNumbers)
{
super(showDefaultConstructor, realignmentLineNumber);
this.showPrefixThis = showPrefixThis;
this.mergeEmptyLines = mergeEmptyLines;
this.unicodeEscape = unicodeEscape;
this.showLineNumbers = showLineNumbers;
}

public boolean isShowPrefixThis() { return showPrefixThis; }
public boolean isMergeEmptyLines() { return mergeEmptyLines; }
public boolean isUnicodeEscape() { return unicodeEscape; }
public boolean isShowLineNumbers() { return showLineNumbers; }
}

0 comments on commit 858f3ea

Please sign in to comment.