sonoma and NSApplicationDelegate.applicationSupportsSecureRestorableState – Macos

by
Maya Patel
intellij-idea java-11 jmeter macos macos-sonoma

Quick Fix: Implement the ‘applicationSupportsSecureRestorableState’ method in the app delegate and return ‘true’ if your app supports secure restorable state. Verify that you use ‘NSSecureCoding’ for all save and restore operations.

The Problem:

You are facing an issue while launching JMeter or using IntelliJ with OpenJDK versions 11, 17, or 21 on Sonoma 14.0, and receiving a warning about secure coding for restorable state. You need assistance in resolving this issue.

The Solutions:

Solution 1: Implementing `NSApplicationDelegate.applicationSupportsSecureRestorableState:`

1. Overview:

To address the warning “`WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.”` related to secure restorable state, developers can take the following steps:

2. Determine Customization of State Saving/Restoration:

– Check if your application customizes how it saves/restores its state via methods like `NSApplicationDelegate’s application(_, willEncodeRestorableState:)` and related methods.

– If your app does not customize the state handling process, proceed to step 3. If it does, proceed to step 4.

3. Implementing the Method:

– In cases where no customization is done, implement the `NSApplicationDelegate.applicationSupportsSecureRestorableState:` method in your application delegate class.

– Within the method, return `true` to explicitly opt-in to secure coding for the state saving/restoration process.

4. Verify Secure Coding Usage:

– For applications doing custom state handling, verify that all state-related operations use `NSSecureCoding`. This ensures compatibility with secure coding.

– Once verified, you can implement the `NSApplicationDelegate.applicationSupportsSecureRestorableState:` method and return `true`. This informs AppKit that your app’s custom state handling is compatible with secure coding.

5. Conclusion:

– By implementing the `NSApplicationDelegate.applicationSupportsSecureRestorableState:` method and returning `true`, developers can explicitly opt-in to secure coding for the state saving/restoration process, addressing the warning and improving the security of their macOS applications.

Q&A

I am receiving this error. What should I do?

Recommend filing an issue to the app’s developer and inform them about the issue.

What is the best practice for developers in Sonoma 14.0?

Implement NSApplicationDelegate.applicationSupportsSecureRestorableState and return true.

Where can I find more details regarding this warning?

Video Explanation:

The following video, titled "Fix Mac App Can't be Opened Because Developer Can't be Verified ...", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

... apple Mac Spotlight tips: https://youtu.be/tpz8vrUxpAc Best ... Creating a MacOS USB Installer using Windows - Solving the circle boot symbol.