Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<groupId>me.coley</groupId>
<artifactId>recaf</artifactId>
<url>https://github.com/Col-E/Recaf/</url>
<version>2.21.9</version>
<version>2.21.10</version>
<name>Recaf</name>
<description>A modern java bytecode editor</description>
<!-- Variables -->
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/coley/recaf/Recaf.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author Matt
*/
public class Recaf {
public static final String VERSION = "2.21.9";
public static final String VERSION = "2.21.10";
public static final String DOC_URL = "https://col-e.github.io/Recaf-documentation/";
public static final int ASM_VERSION = Opcodes.ASM9;
private static Controller currentController;
Expand Down
23 changes: 12 additions & 11 deletions src/main/java/me/coley/recaf/workspace/JarResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,20 @@ protected Map<String, byte[]> loadClasses() throws IOException {
// This may not always be ideal, but this way has one major bonus. It totally ignores CRC validity.
// It also ignores a few other zip entry values.
// Since somebody can intentionally write bogus data there to crash "ZipInputStream" this way works.
ZipFile zf = new ZipFile(getPath().toString());
Enumeration<? extends ZipEntry> entries = zf.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
try (ZipFile zf = new ZipFile(getPath().toString())) {
Enumeration<? extends ZipEntry> entries = zf.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();

if (shouldSkip(entry.getName()))
continue;
if (!loader.isValidClassEntry(entry))
continue;
if (shouldSkip(entry.getName()))
continue;
if (!loader.isValidClassEntry(entry))
continue;

InputStream zis = zf.getInputStream(entry);
byte[] in = IOUtil.toByteArray(zis);
loader.onClass(entry.getName(), in);
InputStream zis = zf.getInputStream(entry);
byte[] in = IOUtil.toByteArray(zis);
loader.onClass(entry.getName(), in);
}
}
}
}
Expand Down