Skip to content

Commit 0ae50e5

Browse files
committed
A few quick updates
1 parent 60c14f9 commit 0ae50e5

File tree

5 files changed

+107
-6
lines changed

5 files changed

+107
-6
lines changed

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package the.bytecode.club.bytecodeviewer;
22

33
import java.awt.Desktop;
4+
import java.awt.Font;
5+
import java.awt.Graphics;
46
import java.awt.event.ActionEvent;
57
import java.awt.event.ActionListener;
68
import java.awt.event.KeyEvent;
9+
import java.awt.image.BufferedImage;
710
import java.io.ByteArrayOutputStream;
811
import java.io.File;
912
import java.io.FileInputStream;
@@ -102,6 +105,7 @@
102105
*
103106
* before 3.0.0:
104107
* EVERYTHING ON THE FUCKING GITHUB ISSUES LOL
108+
* EVERYTHING ON THE BYTECODE CLUB ISSUES LOL
105109
* make it use that global last used inside of export as jar
106110
* Spiffy up the plugin console with hilighted lines
107111
* Take https://github.com/ptnkjke/Java-Bytecode-Editor visualize
@@ -111,9 +115,10 @@
111115
* make ez-injection plugin console show all sys.out calls
112116
* add JEB decompiler optionally, requires them to add jeb library jar externally and disable update check ?
113117
* add decompile as zip for krakatau-bytecode, jd-gui and smali for CLI
114-
* fix hook inject for EZ-Injection
118+
* fix hook inject for EZ-Injection < Move to JVMCommand?
115119
* fix classfile searcher
116120
* make the decompilers launch in a separate process?
121+
* figure out a way to deploy kratau/enjarify versions without downstreaming the latest version via internet for fatjar mode
117122
*
118123
* -----2.9.9-----:
119124
* 08/01/2015 - Fixed a pingback concurrency exception issue.
@@ -123,6 +128,7 @@
123128
* 08/07/2015 - FernFlower & CFR Decompiler now launch in their own process with the 'slimjar' version.
124129
* 08/07/2015 - Switched the ClassViewer up slightly so it utilizes the event dispatch thread.
125130
* 08/07/2015 - Fixed? CFIDE's Bytecode Decompiler on TableSwitchs
131+
* 11/08/2015 - A bunch of changes have been implemented, thanks to all the developers who've helped <3.
126132
*
127133
* @author Konloch
128134
*
@@ -498,6 +504,17 @@ public static void main(String[] args) {
498504
System.setSecurityManager(sm);
499505
try {
500506
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
507+
508+
// HIGHDPI FIX
509+
Font font = UIManager.getFont("Tree.font");
510+
BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
511+
Graphics g = image.getGraphics();
512+
int fontHeight = g.getFontMetrics(font).getHeight();
513+
int rowHeight = (int) UIManager.get("Tree.rowHeight");
514+
if (rowHeight < fontHeight) {
515+
UIManager.getDefaults().put("Tree.rowHeight", fontHeight);
516+
}
517+
501518
if(previewCopy && !CommandLineInput.containsCommand(args))
502519
showMessage("WARNING: This is a preview/dev copy, you WON'T be alerted when "+version+" is actually out if you use this."+nl+
503520
"Make sure to watch the repo: https://github.com/Konloch/bytecode-viewer for "+version+"'s release");
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
package the.bytecode.club.bytecodeviewer.gui;
2+
3+
import java.awt.Dimension;
4+
import java.awt.event.ActionEvent;
5+
import java.awt.event.ActionListener;
6+
7+
import javax.swing.JButton;
8+
import javax.swing.JFrame;
9+
import javax.swing.JLabel;
10+
import javax.swing.JTextField;
11+
12+
import the.bytecode.club.bytecodeviewer.Resources;
13+
import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
14+
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.AllatoriStringDecrypter;
15+
16+
/***************************************************************************
17+
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
18+
* Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com *
19+
* *
20+
* This program is free software: you can redistribute it and/or modify *
21+
* it under the terms of the GNU General Public License as published by *
22+
* the Free Software Foundation, either version 3 of the License, or *
23+
* (at your option) any later version. *
24+
* *
25+
* This program is distributed in the hope that it will be useful, *
26+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
27+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
28+
* GNU General Public License for more details. *
29+
* *
30+
* You should have received a copy of the GNU General Public License *
31+
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
32+
***************************************************************************/
33+
34+
/**
35+
* The UI for replace strings plugin.
36+
*
37+
* @author Konloch
38+
*
39+
*/
40+
41+
public class AllatoriStringDecryptionOptions extends JFrame {
42+
43+
public AllatoriStringDecryptionOptions() {
44+
this.setIconImages(Resources.iconList);
45+
setSize(new Dimension(250, 120));
46+
setResizable(false);
47+
setTitle("Allatori decrypter");
48+
getContentPane().setLayout(null);
49+
50+
JButton btnNewButton = new JButton("Decrypt");
51+
btnNewButton.setBounds(6, 56, 232, 23);
52+
getContentPane().add(btnNewButton);
53+
54+
55+
JLabel lblNewLabel = new JLabel("Class:");
56+
lblNewLabel.setBounds(6, 20, 67, 14);
57+
getContentPane().add(lblNewLabel);
58+
59+
textField = new JTextField();
60+
textField.setToolTipText("* will search all classes");
61+
textField.setText("*");
62+
textField.setBounds(80, 17, 158, 20);
63+
getContentPane().add(textField);
64+
textField.setColumns(10);
65+
66+
67+
btnNewButton.addActionListener(new ActionListener() {
68+
public void actionPerformed(ActionEvent arg0) {
69+
PluginManager.runPlugin(new AllatoriStringDecrypter(textField.getText()));
70+
dispose();
71+
}
72+
});
73+
this.setLocationRelativeTo(null);
74+
}
75+
76+
private static final long serialVersionUID = -2662514582647810868L;
77+
private JTextField textField;
78+
}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public class FileNavigationPane extends VisibleComponent implements
7979
JButton open = new JButton("+");
8080
JButton close = new JButton("-");
8181

82+
boolean doNothing = false;
83+
8284
MyTreeNode treeRoot = new MyTreeNode("Loaded Files:");
8385
MyTree tree = new MyTree(treeRoot);
8486
final String quickSearchText = "Quick file search (no file extension)";
@@ -195,16 +197,19 @@ public void actionPerformed(ActionEvent e) {
195197
this.close.addActionListener(new ActionListener() {
196198
@Override
197199
public void actionPerformed(ActionEvent e) {
200+
doNothing = true;
198201
final TreeNode root = (TreeNode) tree.getModel().getRoot();
199202
expandAll(tree, new TreePath(root), false);
200203
tree.expandPath(new TreePath(root));
204+
doNothing = false;
201205
}
202206
});
203207

204208
this.tree.addMouseListener(new MouseAdapter() {
205209
@Override
206210
public void mousePressed(MouseEvent e) {
207-
openPath(tree.getPathForLocation(e.getX(), e.getY()));
211+
if(!doNothing)
212+
openPath(tree.getPathForLocation(e.getX(), e.getY()));
208213
}
209214
});
210215

@@ -215,7 +220,9 @@ public void valueChanged(final TreeSelectionEvent arg0) {
215220
cancel = false;
216221
return;
217222
}
218-
openPath(arg0.getPath());
223+
224+
if(!doNothing)
225+
openPath(arg0.getPath());
219226
}
220227
});
221228

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
import the.bytecode.club.bytecodeviewer.obfuscators.rename.RenameMethods;
4949
import the.bytecode.club.bytecodeviewer.plugin.PluginManager;
5050
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.CodeSequenceDiagram;
51-
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.AllatoriStringDecrypter;
5251
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ShowAllStrings;
5352
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ShowMainMethods;
5453
import the.bytecode.club.bytecodeviewer.plugin.preinstalled.ZKMStringDecrypter;
@@ -2034,7 +2033,7 @@ public void actionPerformed(ActionEvent arg0) {
20342033
BytecodeViewer.showMessage("First open a class, jar, zip, apk or dex file.");
20352034
return;
20362035
}
2037-
new AllatoriStringDecrypterOptions().setVisible(true);
2036+
new AllatoriStringDecryptionOptions().setVisible(true);
20382037
}
20392038
});
20402039
mntmNewMenuItem_1.addActionListener(new ActionListener() {

src/the/bytecode/club/bytecodeviewer/plugin/preinstalled/ZStringArrayDecrypter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void execute(ArrayList<ClassNode> classNodeList) {
6565
if (result == 0) {
6666
boolean needsWarning = false;
6767
try {
68-
for (Class<?> debug : the.bytecode.club.bytecodeviewer.api.BytecodeViewer.loadAllClassesIntoClassLoader()) {
68+
for (Class<?> debug : the.bytecode.club.bytecodeviewer.api.BytecodeViewer.loadClassesIntoClassLoader(BytecodeViewer.getLoadedClasses())) {
6969
try {
7070
Field[] fields = debug.getDeclaredFields();
7171
for ( Field field : fields ) {

0 commit comments

Comments
 (0)