A few quick updates

This commit is contained in:
Konloch 2015-11-08 15:24:34 -07:00
parent 60c14f9d2c
commit 0ae50e538b
5 changed files with 107 additions and 6 deletions

View file

@ -1,9 +1,12 @@
package the.bytecode.club.bytecodeviewer;
import java.awt.Desktop;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
@ -102,6 +105,7 @@ import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
*
* before 3.0.0:
* EVERYTHING ON THE FUCKING GITHUB ISSUES LOL
* EVERYTHING ON THE BYTECODE CLUB ISSUES LOL
* make it use that global last used inside of export as jar
* Spiffy up the plugin console with hilighted lines
* Take https://github.com/ptnkjke/Java-Bytecode-Editor visualize
@ -111,9 +115,10 @@ import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
* make ez-injection plugin console show all sys.out calls
* add JEB decompiler optionally, requires them to add jeb library jar externally and disable update check ?
* add decompile as zip for krakatau-bytecode, jd-gui and smali for CLI
* fix hook inject for EZ-Injection
* fix hook inject for EZ-Injection < Move to JVMCommand?
* fix classfile searcher
* make the decompilers launch in a separate process?
* figure out a way to deploy kratau/enjarify versions without downstreaming the latest version via internet for fatjar mode
*
* -----2.9.9-----:
* 08/01/2015 - Fixed a pingback concurrency exception issue.
@ -123,6 +128,7 @@ import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
* 08/07/2015 - FernFlower & CFR Decompiler now launch in their own process with the 'slimjar' version.
* 08/07/2015 - Switched the ClassViewer up slightly so it utilizes the event dispatch thread.
* 08/07/2015 - Fixed? CFIDE's Bytecode Decompiler on TableSwitchs
* 11/08/2015 - A bunch of changes have been implemented, thanks to all the developers who've helped <3.
*
* @author Konloch
*
@ -498,6 +504,17 @@ public class BytecodeViewer {
System.setSecurityManager(sm);
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
// HIGHDPI FIX
Font font = UIManager.getFont("Tree.font");
BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
Graphics g = image.getGraphics();
int fontHeight = g.getFontMetrics(font).getHeight();
int rowHeight = (int) UIManager.get("Tree.rowHeight");
if (rowHeight < fontHeight) {
UIManager.getDefaults().put("Tree.rowHeight", fontHeight);
}
if(previewCopy && !CommandLineInput.containsCommand(args))
showMessage("WARNING: This is a preview/dev copy, you WON'T be alerted when "+version+" is actually out if you use this."+nl+
"Make sure to watch the repo: https://github.com/Konloch/bytecode-viewer for "+version+"'s release");

View file

@ -0,0 +1,78 @@
package the.bytecode.club.bytecodeviewer.gui;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
import the.bytecode.club.bytecodeviewer.Resources;
import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.AllatoriStringDecrypter;
/***************************************************************************
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
* Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
/**
* The UI for replace strings plugin.
*
* @author Konloch
*
*/
public class AllatoriStringDecryptionOptions extends JFrame {
public AllatoriStringDecryptionOptions() {
this.setIconImages(Resources.iconList);
setSize(new Dimension(250, 120));
setResizable(false);
setTitle("Allatori decrypter");
getContentPane().setLayout(null);
JButton btnNewButton = new JButton("Decrypt");
btnNewButton.setBounds(6, 56, 232, 23);
getContentPane().add(btnNewButton);
JLabel lblNewLabel = new JLabel("Class:");
lblNewLabel.setBounds(6, 20, 67, 14);
getContentPane().add(lblNewLabel);
textField = new JTextField();
textField.setToolTipText("* will search all classes");
textField.setText("*");
textField.setBounds(80, 17, 158, 20);
getContentPane().add(textField);
textField.setColumns(10);
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
PluginManager.runPlugin(new AllatoriStringDecrypter(textField.getText()));
dispose();
}
});
this.setLocationRelativeTo(null);
}
private static final long serialVersionUID = -2662514582647810868L;
private JTextField textField;
}

View file

@ -79,6 +79,8 @@ public class FileNavigationPane extends VisibleComponent implements
JButton open = new JButton("+");
JButton close = new JButton("-");
boolean doNothing = false;
MyTreeNode treeRoot = new MyTreeNode("Loaded Files:");
MyTree tree = new MyTree(treeRoot);
final String quickSearchText = "Quick file search (no file extension)";
@ -195,16 +197,19 @@ public class FileNavigationPane extends VisibleComponent implements
this.close.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
doNothing = true;
final TreeNode root = (TreeNode) tree.getModel().getRoot();
expandAll(tree, new TreePath(root), false);
tree.expandPath(new TreePath(root));
doNothing = false;
}
});
this.tree.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
openPath(tree.getPathForLocation(e.getX(), e.getY()));
if(!doNothing)
openPath(tree.getPathForLocation(e.getX(), e.getY()));
}
});
@ -215,7 +220,9 @@ public class FileNavigationPane extends VisibleComponent implements
cancel = false;
return;
}
openPath(arg0.getPath());
if(!doNothing)
openPath(arg0.getPath());
}
});

View file

@ -48,7 +48,6 @@ import the.bytecode.club.bytecodeviewer.obfuscators.rename.RenameFields;
import the.bytecode.club.bytecodeviewer.obfuscators.rename.RenameMethods;
import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.CodeSequenceDiagram;
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.AllatoriStringDecrypter;
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ShowAllStrings;
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ShowMainMethods;
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ZKMStringDecrypter;
@ -2034,7 +2033,7 @@ public class MainViewerGUI extends JFrame implements FileChangeNotifier {
BytecodeViewer.showMessage("First open a class, jar, zip, apk or dex file.");
return;
}
new AllatoriStringDecrypterOptions().setVisible(true);
new AllatoriStringDecryptionOptions().setVisible(true);
}
});
mntmNewMenuItem_1.addActionListener(new ActionListener() {

View file

@ -65,7 +65,7 @@ public class ZStringArrayDecrypter extends Plugin {
if (result == 0) {
boolean needsWarning = false;
try {
for (Class<?> debug : the.bytecode.club.bytecodeviewer.api.BytecodeViewer.loadAllClassesIntoClassLoader()) {
for (Class<?> debug : the.bytecode.club.bytecodeviewer.api.BytecodeViewer.loadClassesIntoClassLoader(BytecodeViewer.getLoadedClasses())) {
try {
Field[] fields = debug.getDeclaredFields();
for ( Field field : fields ) {