Clean up 0xCAFEBABE string (again)
Missed a few last time.
This commit is contained in:
parent
09d4255e2a
commit
648997c00d
2 changed files with 2 additions and 8 deletions
|
@ -833,10 +833,7 @@ public class BytecodeViewer {
|
||||||
} else if (fn.endsWith(".class")) {
|
} else if (fn.endsWith(".class")) {
|
||||||
try {
|
try {
|
||||||
byte[] bytes = JarUtils.getBytes(new FileInputStream(f));
|
byte[] bytes = JarUtils.getBytes(new FileInputStream(f));
|
||||||
String cafebabe = String.format("%02X", bytes[0])
|
String cafebabe = String.format("%02X%02X%02X%02X", bytes[0], bytes[1], bytes[2], bytes[3]);
|
||||||
+ String.format("%02X", bytes[1])
|
|
||||||
+ String.format("%02X", bytes[2])
|
|
||||||
+ String.format("%02X", bytes[3]);
|
|
||||||
if(cafebabe.toLowerCase().equals("cafebabe")) {
|
if(cafebabe.toLowerCase().equals("cafebabe")) {
|
||||||
final ClassNode cn = JarUtils.getNode(bytes);
|
final ClassNode cn = JarUtils.getNode(bytes);
|
||||||
|
|
||||||
|
|
|
@ -104,10 +104,7 @@ public class JarUtils {
|
||||||
final String name = entry.getName();
|
final String name = entry.getName();
|
||||||
if (name.endsWith(".class")) {
|
if (name.endsWith(".class")) {
|
||||||
byte[] bytes = getBytes(jis);
|
byte[] bytes = getBytes(jis);
|
||||||
String cafebabe = String.format("%02X", bytes[0])
|
String cafebabe = String.format("%02X%02X%02X%02X", bytes[0], bytes[1], bytes[2], bytes[3]);
|
||||||
+ String.format("%02X", bytes[1])
|
|
||||||
+ String.format("%02X", bytes[2])
|
|
||||||
+ String.format("%02X", bytes[3]);
|
|
||||||
if(cafebabe.toLowerCase().equals("cafebabe")) {
|
if(cafebabe.toLowerCase().equals("cafebabe")) {
|
||||||
try {
|
try {
|
||||||
final ClassNode cn = getNode(bytes);
|
final ClassNode cn = getNode(bytes);
|
||||||
|
|
Loading…
Reference in a new issue