leibnitz27 / cfr

This is the public repository for the CFR Java decompiler
https://www.benf.org/other/cfr
MIT License
1.93k stars 249 forks source link

CFR can't handle recent Oracle JDBC jars #351

Open dan-blum opened 8 months ago

dan-blum commented 8 months ago

CFR version

CFR 0.152

Compiler

javac 17.0.4.1

Description

When run on an OJDBC8 jar file - for example, ojdbc8-21.1.0.0.jar - CFR produces java.lang.NullPointerException: Cannot invoke "java.io.File.getCanonicalPath()" because the return value of "java.io.File.getParentFile()" is null org.benf.cfr.reader.state.ClassFileSourceImpl.addToRelativeClassPath(ClassFileSourceImpl.java:371) org.benf.cfr.reader.state.ClassFileSourceImpl.addJarContent(ClassFileSourceImpl.java:270) org.benf.cfr.reader.state.DCCommonState.explicitlyLoadJar(DCCommonState.java:141) org.benf.cfr.reader.Driver.doJar(Driver.java:127) org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) org.benf.cfr.reader.Main.main(Main.java:54)

It's not an issue with my filesystem because it works fine on other jars (including older Oracle JDBC jars) in the same directory.

gbulfon commented 1 month ago

Had the same issue with another jar. Simply unjar the original jar into a new folder then rebuild it using "jar cvf ...", then use the new rebuilt jar file.