[Mac Sonoma] "WARNING: Secure coding is not enabled for restorable state" warning message
The issue When running Eclipse or an RCP app on macOS Sonoma a warning message is written to the console:
eclipse[4647:170325] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.
I've Googled this and it seems that this could lead to a vulnerabilty and needs to be addressed. For example see here:
https://stackoverflow.com/questions/77283578/sonoma-and-nsapplicationdelegate-applicationsupportssecurerestorablestate?rq=2
I'm reporting this against SWT because SWT provides the native implementations of Mac classes such as NSApplicationDelegate.
@lshanmug what do you think? Can SWT implement applicationSupportsSecureRestorableState in NSApplicationDelegate?
To Reproduce The only way to see this warning message is to run Eclipse on Mac Sonoma from the command line so the message is written to the console in the Terminal app:
- Open the Mac Terminal app and run the following command:
Eclipse.app/Contents/MacOS/eclipse - The warning message is written to the terminal window
Expected behavior The warning message should not appear.
Environment: macOS Sonoma 14.5 MacBook M2 aarch64 Temurin JDK 17.0.11+9 Eclipse 4.31 and latest 4.32 I builds
Actually, after debugging this some more, the warning message appears before any SWT components are created. It occurs in equinox:
https://github.com/eclipse-equinox/equinox/tree/master/features/org.eclipse.equinox.executable.feature/library/cocoa
And so, if it is possible to implement this, it will be in the native JNI code here:
https://github.com/eclipse-equinox/equinox/tree/master/features/org.eclipse.equinox.executable.feature/library/cocoa
Could someone transfer this issue to https://github.com/eclipse-equinox/equinox please? This is not SWT.
You could just copy it there since the issue is new and no discussion really happened :)
Copied to https://github.com/eclipse-equinox/equinox/issues/630
Re-opening this. PR for SWT incoming...
PR https://github.com/eclipse-platform/eclipse.platform.swt/pull/1231 will fix the issue for SWT, but as Equinox JNI also creates a NSApplication when creating its splash screen a similar fix needs to be applied there, too. See https://github.com/eclipse-equinox/equinox/issues/630
Edit - https://github.com/eclipse-platform/eclipse.platform.swt/pull/1231 causes a CTD.
@lshanmug @Phillipus as you both seem to be knowing something about Mac and the launcher I have some question, currently SWT requires to pass the -XstartOnFirstThread (FYI @akurtakov ) but for example AWT seem to include some code to not require this, do you probabbly have any idea how the JDK is doing that so we can probably incooperate that as well (either Equinox or SWT)?
-XstartOnFirstThread is a Mac only parameter AFAIK thus I can't help more here.
I can;t help with -XstartOnFirstThread maybe @lshanmug knows?
I found this:
https://stackoverflow.com/questions/28149634/what-does-the-xstartonfirstthread-vm-argument-do-mean