Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native code script #1

Merged
merged 8 commits into from
Dec 10, 2024
Merged

Conversation

maths22
Copy link

@maths22 maths22 commented Jun 16, 2023

What kind of change does this PR introduce?

Second copy of the launcher rewritten in objective-c

What is the current behavior?

The existing script as a shell script is fine. However, when compiled into a binary script with SHC it sets off my corporate antivirus (SentinelONE) (anything compiled with SHC, along with SHC itself, does). This is likely because SHC stuffs the shell script into an encrypted blob in the file and then the surrounding code is decrypting the script and running it through a shell, which is the kind of thing that malware commonly does to try to obfuscate its real purpose.

What is the new behavior?

This introduces an objective-c implementation of the script which should behave identically (other than some slightly differences in the presentation of logging/dialogs) to the shell script but is compiled as conventional native code. This creates a functionally equivalent drop-in binary, which I have tested works correctly in basic use cases with JavaPackager. (I did not port over the translations, though it wouldn't be hard to port if over if desired). It should have more guaranteed correct plist handling since it is actually parsing the plists through Apple's plist deserialization code rather than trying to string-parse the output of PlistBuddy.

Does this PR introduce a breaking change?

No breaking change since this is purely additive.

Other information:

This is definitely not 100% tested, and could very well be broken in various edge cases. In particular I have not tested JVMOptionsFile, BootstrapScript, or sdkman, though I did add and test asdf support, which functions very similarly to the sdkman support.

I don't know if this is actually worth adding to this project or if I should just maintain this independently, but I figured it was worth at least sharing and opening up the conversation.

@maths22
Copy link
Author

maths22 commented Dec 1, 2024

We have been using this in a distributed application for over a year now without issue, so I am going to mark this PR as ready for review

@maths22 maths22 marked this pull request as ready for review December 1, 2024 03:48
@fvarrui
Copy link
Collaborator

fvarrui commented Dec 10, 2024

Wow! Sorry ... I missed this PR 😞
Thanks so much!!! This is exactly what JP needs for Mac OS.

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