sveinbjornt / Platypus

Create native Mac applications from command line scripts.
https://sveinbjorn.org/platypus
BSD 3-Clause "New" or "Revised" License
2.84k stars 171 forks source link

Platypus app now broken on Sonoma w warning about "Secure Coding" and "SecureRestorableState" #261

Closed paulmromer closed 1 year ago

paulmromer commented 1 year ago

I had an app that I built for macOS using Platypus that worked fine on prior versions of macOS but is broken on Sonoma.

It uses a script to run a Python program that has a tkinter GUI. After I build the app, I also include a distribution of Python as a framework that is outside of the app itself.

If I open up the app and run app/Contents/MacOS/app from the command line I get this 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:.

This is almost surely not a Platypus issue, but does anyone know if there is a way to use Platypus to implement the suggested delegation?

paulmromer commented 1 year ago

I just found what seems to be a knowledgeable response concerning this problem:

https://stackoverflow.com/questions/77283578/sonoma-and-nsapplicationdelegate-applicationsupportssecurerestorablestate

The reply says that "If you are not customizing how your app saves/restores state, you should implement this method and return true." I believe that this is the right response for my app, but I don't know how to implement this method because I rely on Platypus to generate all the ObjectiveC/Swift code.

sveinbjornt commented 1 year ago

Fixed in master 9d2cb2c, will be part of fixes in the upcoming 5.4.2 release