KEMBAR78
Sign `jfrconv` executable on macOS · Issue #1344 · async-profiler/async-profiler · GitHub
Skip to content

Sign jfrconv executable on macOS #1344

@apangin

Description

@apangin

Describe the feature

jfrconv is a self-executable JAR created by concatenating binary Java launcher with jfr-converter.jar. This makes jfrconv binary a valid executable and a valid JAR at the same time. The launcher looks for java executable at known locations and then invokes it passing itself (jfrconv) as a JAR to execute.

This works well, except that such a binary cannot be properly code-signed on macOS. Consequently, notarization of async-profiler package fails.

Use Case

When async-profiler is downloaded with Safari, launching jfrconv will result in macOS showing a warning about unidentified developer.

Proposed Solution

I'm thinking of two possible solutions:

  1. Rewrite launcher (src/launcher/launcher.cpp) in shell script. Shell scripts don't require code signing, and they can also be concatenated with .jar. Need to double-check how different macOS versions handle such executables.
  2. Embed .jar in data section of a program. It won't be possible to use the result binary as .jar directly, so a launcher will need to start the JVM by itself and provide a custom class loader for loading an embedded .jar.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions