Skip to content

Add jrt:/ file system data entry source - #186

Merged
piazzesiNiccolo-GS merged 1 commit into
Guardsquare:masterfrom
Marcono1234:jrt-data-entry-source
Oct 27, 2026
Merged

piazzesiNiccolo-GS merged 1 commit into
Guardsquare:masterfrom
Marcono1234:jrt-data-entry-source

Conversation

@Marcono1234

@Marcono1234 Marcono1234 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Needed by Guardsquare/proguard#541, see also original POC Guardsquare/proguard#504

Comment on lines +89 to +92
// Note: Closing the class loader might not be thread-safe because by default the JDK caches the
// underlying JarFile, so closing it implicitly here might affect other users of that jar
// See https://bugs.openjdk.org/browse/JDK-8246714 and potentially also
// https://bugs.openjdk.org/browse/JDK-8205976

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not ideal that there are (potential) issues with URLClassLoader#close, but I am not sure if ProGuard should really try to work around JDK bugs (by not calling close()).

Not sure if or how often issues with this would occur in reality.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah not ideal, but given it's a fallback and when it happens it is treated like a bug I am willing to let it slide, it is documented in code at least.

@piazzesiNiccolo-GS

Copy link
Copy Markdown
Contributor

Failure is due to the PHP CVE I think, in any case code looks good. Can you use kotest to write the tests though for consistency? See the tests in #171

@Marcono1234

Copy link
Copy Markdown
Contributor Author

Have converted the test to Kotest now. But I did not have a closer look at your PR before, sorry.

Should I adjust the implementation and tests to match what you have in #171 (e.g. adding new ErrorId entries and throwing ProguardCoreException), or do you want to do that?

@Marcono1234 Marcono1234 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @piazzesiNiccolo-GS for your improvements to my PR!

I have added a few suggestion comments regarding your changes, if you want I can implement them, except for the duplicate ErrorId (not sure which solution you prefer there), or feel free to do it yourself if you think the suggestions are useful.

@piazzesiNiccolo-GS

Copy link
Copy Markdown
Contributor

Yeah thanks for the comments, what I get for just copypasting 🤦 I'll fix those and merge this in

@piazzesiNiccolo-GS
piazzesiNiccolo-GS force-pushed the jrt-data-entry-source branch 6 times, most recently from 615cf7d to 5b2d51a Compare October 26, 2026 13:18
@piazzesiNiccolo-GS

Copy link
Copy Markdown
Contributor

@Marcono1234 can you rebase your fork and the diff? I tried to add a release note on current status, and I also fixed the merge conflicts but GH is still complaining and it doesn't let me merge (seems like a bug honestly but idk).

@Marcono1234

Copy link
Copy Markdown
Contributor Author

Thanks for updating the PR! Yes I can try rebasing on master; should I also squash the commits?
I have one remaining question though: #186 (comment)

@piazzesiNiccolo-GS
piazzesiNiccolo-GS force-pushed the jrt-data-entry-source branch 3 times, most recently from c00eccd to c0e2148 Compare October 26, 2026 18:29
@piazzesiNiccolo-GS

piazzesiNiccolo-GS commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for updating the PR! Yes I can try rebasing on master; should I also squash the commits? I have one remaining question though: #186 (comment)

I ended up rebasing everything myself (I will squash merge but keeps everything tidier in any case). It should all be good to go (after you double check I didn't forget something else again 😄 ), thanks again. After merge I'll plan a release so we can use it in PG.

@Marcono1234

Copy link
Copy Markdown
Contributor Author

Does the GitHub UI still prevent the merge, and is there something I can do, or does the UI allow the merge now?

@piazzesiNiccolo-GS
piazzesiNiccolo-GS merged commit 41be3bb into Guardsquare:master Oct 27, 2026
2 checks passed
@Marcono1234
Marcono1234 deleted the jrt-data-entry-source branch October 29, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants