diff --git a/README.md b/README.md
index eb057b3..e3d5b3d 100644
--- a/README.md
+++ b/README.md
@@ -117,6 +117,12 @@ installer per platform: a DMG for macOS (Apple silicon), an `.exe` for Windows x
`.deb` for Linux x64, plus portable archives for Windows and Linux. They bundle their own
Java runtime. See [packaging/README.md](packaging/README.md) for how releases are built.
+On macOS, the toolbar highlights **Access** the first time you run each version.
+Open it for shortcuts to macOS settings for protected files, local networking, the Phone
+page firewall, app automation, accessibility, and screen recording. Grant access in
+macOS as needed. **Done** clears the highlight for that version, and **Later** keeps the
+reminder. You can reopen the dialog any time.
+
## Run from source
diff --git a/app/src/main/java/io/github/ghosthack/microhm/app/settings/AppSettings.java b/app/src/main/java/io/github/ghosthack/microhm/app/settings/AppSettings.java
index 33d04e8..8fe9ac9 100644
--- a/app/src/main/java/io/github/ghosthack/microhm/app/settings/AppSettings.java
+++ b/app/src/main/java/io/github/ghosthack/microhm/app/settings/AppSettings.java
@@ -218,6 +218,15 @@ public static void saveToolbarLabels(boolean on) {
save(p -> p.setProperty("toolbar.labels", on ? "on" : "off"));
}
+ /** Records which app versions the user has reviewed in the macOS permissions dialog. */
+ public static boolean macPermissionsReviewed(String version) {
+ return Boolean.parseBoolean(load().getProperty("mac.permissions-reviewed." + version));
+ }
+
+ public static void saveMacPermissionsReviewed(String version) {
+ save(p -> p.setProperty("mac.permissions-reviewed." + version, "true"));
+ }
+
/**
* Whether the toolbar shows its Page Up/Down controls:
* {@code toolbar.page-buttons=on|off}. Off (unset, or anything but {@code on} —
diff --git a/app/src/main/java/io/github/ghosthack/microhm/app/ui/LucidIcon.java b/app/src/main/java/io/github/ghosthack/microhm/app/ui/LucidIcon.java
index 1fbd9a7..1e85d37 100644
--- a/app/src/main/java/io/github/ghosthack/microhm/app/ui/LucidIcon.java
+++ b/app/src/main/java/io/github/ghosthack/microhm/app/ui/LucidIcon.java
@@ -23,6 +23,10 @@
*/
final class LucidIcon implements Icon {
+ static LucidIcon shield(int size) {
+ return new LucidIcon("M12 2 20 5v7a11 11 0 0 1-8 10 11 11 0 0 1-8-10V5z", size);
+ }
+
/** The kotlin-mosaic {@code Icon.Screensaver} crescent, path data verbatim. */
static LucidIcon moon(int size) {
return new LucidIcon("M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z", size);
diff --git a/app/src/main/java/io/github/ghosthack/microhm/app/ui/MacPermissionsDialog.java b/app/src/main/java/io/github/ghosthack/microhm/app/ui/MacPermissionsDialog.java
new file mode 100644
index 0000000..63ff2f4
--- /dev/null
+++ b/app/src/main/java/io/github/ghosthack/microhm/app/ui/MacPermissionsDialog.java
@@ -0,0 +1,187 @@
+package io.github.ghosthack.microhm.app.ui;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
+import java.awt.GridBagConstraints;
+import java.awt.Window;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+/** Shortcuts to the macOS settings that affect sessions and the Phone page. */
+final class MacPermissionsDialog {
+
+ private static final String SETTINGS_SCHEME = "x-apple.systempreferences:";
+ private static final String PRIVACY_SETTINGS = "com.apple.settings.PrivacySecurity.extension";
+ private static final String NETWORK_SETTINGS = "com.apple.Network-Settings.extension";
+ private static final String LEGACY_SECURITY = "com.apple.preference.security";
+
+ enum Pane {
+ FILES("Files & Folders", "Use projects in protected folders such as Desktop or Documents.",
+ "Privacy_FilesAndFolders"),
+ DISK("Full Disk Access", "Add the app if your workflow needs broader access to protected files.",
+ "Privacy_AllFiles"),
+ LOCAL_NETWORK("Local Network", "Let a session connect to devices on your local network.",
+ "Privacy_LocalNetwork"),
+ FIREWALL("Firewall", "Allow incoming connections for the Phone page if the firewall blocks them.",
+ "Firewall"),
+ AUTOMATION("Automation", "Allow a tool in a session to control specific apps through Apple Events.",
+ "Privacy_Automation"),
+ ACCESSIBILITY("Accessibility", "Let a UI automation tool interact with other apps.",
+ "Privacy_Accessibility"),
+ SCREEN_RECORDING("Screen & System Audio Recording", "Allow a tool to capture the Mac screen or system audio.",
+ "Privacy_ScreenCapture");
+
+ private final String title;
+ private final String description;
+ private final String anchor;
+
+ Pane(String title, String description, String anchor) {
+ this.title = title;
+ this.description = description;
+ this.anchor = anchor;
+ }
+
+ String title(int macVersion) {
+ // Sequoia (15) renamed the pane. Sonoma (14) still calls it Screen Recording.
+ return this == SCREEN_RECORDING && macVersion < 15 ? "Screen Recording" : title;
+ }
+
+ String settingsUrl(int macVersion) {
+ String section = macVersion < 13 ? LEGACY_SECURITY
+ : this == FIREWALL ? NETWORK_SETTINGS : PRIVACY_SETTINGS;
+ return SETTINGS_SCHEME + section + "?" + anchor;
+ }
+
+ String settingsPath(int macVersion) {
+ if (this == FIREWALL) {
+ return macVersion < 13 ? "Security & Privacy › Firewall › Firewall Options"
+ : "Network › Firewall › Options";
+ }
+ String section = macVersion < 13 ? "Security & Privacy › Privacy" : "Privacy & Security";
+ return section + " › " + title(macVersion);
+ }
+ }
+
+ /** Returns true only when the user marks this version's review done. */
+ static boolean show(Window parent, boolean reviewPending) {
+ int macVersion = macMajorVersion();
+ String settingsName = macVersion < 13 ? "System Preferences" : "System Settings";
+ JDialog dialog = DialogChrome.newDialog(parent, "macOS Permissions");
+ DialogChrome.Form form = DialogChrome.form();
+ JLabel guidance = new JLabel(html(450, "Grant the access your workflow needs in " + settingsName
+ + ". Some entries appear after you use a feature that requests access. "
+ + "Use the app named in the macOS prompt."));
+ guidance.setBorder(BorderFactory.createEmptyBorder(0, 0, 8, 0));
+ addFullWidth(form, guidance);
+ JLabel path = new JLabel(html(450, "Some changes take effect after you quit and reopen the app."));
+ for (Pane pane : Pane.values()) {
+ if (pane == Pane.LOCAL_NETWORK && macVersion < 15) {
+ continue;
+ }
+ String title = pane.title(macVersion);
+ JLabel details = new JLabel(html(325, "" + title.replace("&", "&") + "
" + pane.description));
+ JButton open = new JButton("Open Settings");
+ open.getAccessibleContext().setAccessibleName("Open " + title + " settings");
+ String settingsPath = pane.settingsPath(macVersion);
+ open.setToolTipText(settingsPath);
+ open.addActionListener(e -> {
+ path.setText(html(450, "If needed, choose " + settingsPath.replace("&", "&") + "."));
+ openSettings(dialog, pane.settingsUrl(macVersion), settingsName, settingsPath);
+ });
+ int row = form.reserveRow();
+ form.constraints.gridy = row;
+ form.constraints.gridx = 0;
+ form.constraints.gridwidth = 1;
+ form.constraints.weightx = 1;
+ form.panel.add(details, form.constraints);
+ form.constraints.gridx = 1;
+ form.constraints.weightx = 0;
+ form.panel.add(open, form.constraints);
+ }
+ path.setBorder(BorderFactory.createEmptyBorder(7, 0, 0, 0));
+ addFullWidth(form, path);
+
+ boolean[] reviewed = {false};
+ JButton close = new JButton(reviewPending ? "Later" : "Close");
+ close.addActionListener(e -> dialog.dispose());
+ JButton done = new JButton("Done");
+ done.addActionListener(e -> {
+ reviewed[0] = true;
+ dialog.dispose();
+ });
+ DialogChrome.layout(dialog, form.panel,
+ reviewPending ? DialogChrome.buttons(close, done) : DialogChrome.buttons(close));
+ DialogChrome.show(dialog, parent, reviewPending ? done : close, close);
+ return reviewed[0];
+ }
+
+ private static void addFullWidth(DialogChrome.Form form, JLabel label) {
+ GridBagConstraints constraints = form.constraints;
+ constraints.gridy = form.reserveRow();
+ constraints.gridx = 0;
+ constraints.gridwidth = 2;
+ constraints.weightx = 1;
+ form.panel.add(label, constraints);
+ }
+
+ private static String html(int width, String text) {
+ return "