I have a Java Swing application that is bundled into an app bundle using jpackage. The app basically launches a newer version of itself, when there is a new version downloaded in the users installation directory. I have noticed a regression or change in behavior with how LocalNetwork privacy works now.
Previously, we would launch our Java application using the .app bundle. This is a launcher that checks for updates and will launch another JVM instance using any new jars it downloads when updating. So, it is closing the original process and spawning a new process using the downloaded jar. The new process is where the app connects to a server on the Local Network.
This new process cannot access the Local Network even when the entry in privacy and security is enabled for the parent process. I have changed the behavior of my launcher application so that it keeps the process alive after launching the client application. When doing this, Local Network access works.
So, my question is: is it required for the parent process to be running in order for a child process to have Local Network access? In previous macOS versions, this was not an issue, so something has changed with Local Network security across all the latest versions 26 and 27.
So the way that a native Mac app avoids this problem is, once the update is complete, the new app is launched by NSWorkspace rather spawned as a child process. This means that the new app behaves like it’s been launched from the Finder. This avoids exercising the specific local network privacy issue that you’ve bumped into, but it also avoids a world of other edge cases as well.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"