Skip to content

feat: import settings and tidy up when switching from the App Store build - #474

Merged
tieubao merged 2 commits into
developfrom
feat/migrate-from-app-store
Nov 15, 2026
Merged

tieubao merged 2 commits into
developfrom
feat/migrate-from-app-store

Conversation

@tieubao

@tieubao tieubao commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Why

Both builds use com.dwarvesv.minimalbar, but the App Store build is sandboxed and keeps its prefs in ~/Library/Containers/com.dwarvesv.minimalbar/Data/Library/Preferences/, while the direct build reads ~/Library/Preferences/. Switching builds resets every setting (#464). App Review 2.4.5 forbids the App Store build from fetching or installing the other build, so all migration logic lives in the direct build.

What (direct build only, #if HIDDENBAR_NATIVE_VISIBILITY)

launch ─▶ 1. import offer ─▶ 2. trash offer ─▶ 3. move-to-/Applications offer
           container has custom   a bundle with _MASReceipt,   running copy not in
           keys, direct has none  same bundle id, not us       /Applications or ~/Applications
           Import │ Not now        Move to Trash │ Not now      Move │ Not now
           each answer is remembered; each offer shows at most once
  • Import: copies only the keys in UserDefaults.Key, type-checked. SU*, window frames, status item positions, internal flags and unknown keys are dropped. After an import the app re-applies login item and hotkey and posts the prefs notifications.
  • Trash: candidates from Launch Services plus /Applications and ~/Applications; NSWorkspace.recycle only after the click.
  • Move: written fresh (no LetsMove code). Copies to /Applications (an existing direct copy there goes to the Trash first), trashes the original unless translocated, then relaunches from a /bin/sh waiter after this process exits, so the new instance does not quit as a duplicate. Not offered when /Applications is not writable or holds the App Store copy (the Trash offer goes first).
  • Debug builds skip all of this unless launched with -forceAppStoreMigration YES.

App Store build: macOS 27 notice

  • Adds brew install --cask hiddenbar as selectable monospaced text.
  • The button still opens dwarves.foundation/opensource, not the zip. 2.4.5(iv): "may not download or install standalone apps"; 2.4.5(vii): "must use the Mac App Store to distribute updates; other update mechanisms are not allowed." A button that downloads a newer build of the same app reads as an outside update channel, even though the browser does the download. Also, releases/latest/download/<asset> is not stable: assets are versioned (Hidden-Bar-v1.11.2-macos.zip resolves today; an unversioned name 404s), so the link would break on the next release. A test pins this (page, not .zip).

Proof

Check Result
scripts/test.sh on develop Direct 209 passed, App Store 165 passed
scripts/test.sh on this branch Direct 224 passed (+15), App Store 167 passed (+2), 0 failed
Negative control: 5 mutations (whitelist accepts all, ledger never answered, running copy not excluded, receipt not checked, direct-customized ignored) plus notice URL set to the zip and the brew field made non-selectable 8 tests fail: 6 Direct, 2 App Store
Release-Direct and Release builds, develop vs branch same warning set (pre-existing SMLoginItemSetEnabled deprecation and two shim selectors), no new warnings
On screen Harness runs the real AppStoreMigration against a fake HOME (CFFIXED_USER_HOME, fake container plist, fake App Store bundle with _MASReceipt) and the real notice through its menu path; each alert is captured, then dismissed with abortModal (no pointer or key input; no answer recorded)

Notes

  • If feat: pinned sections beta (macOS 27) and legacy recovery fixes (#366) #473 lands first, add its new keys to AppStoreSettingsImport.importableKeys and the whitelist test.
  • Reading the container from the unsandboxed build should not trigger the macOS 14+ "access data from other apps" prompt, since both builds come from the same team. This is not checked on a real App Store install yet.
  • New strings are English only, the same as the existing macOS 27 notice strings.

tieubao and others added 2 commits November 15, 2026 17:06
…uild

The App Store build keeps its prefs in its sandbox container, so users who
switch to the direct build start from scratch (#464). The direct build now
offers, once each and only on a click:

- importing the App Store settings, whitelisted to the keys the app defines
  (no SU*, window frames, status item positions or unknown keys), when the
  container has custom settings and this build has none yet;
- moving a leftover App Store copy (a bundle with _MASReceipt and the same
  bundle id, not the running one) to the Trash via NSWorkspace.recycle;
- moving itself into /Applications, then relaunching once this process exits.

All of it is compiled only with HIDDENBAR_NATIVE_VISIBILITY; Debug builds skip
it unless launched with -forceAppStoreMigration YES.

The App Store build's macOS 27 notice also shows
`brew install --cask hiddenbar` as selectable text. Its button keeps opening
the web page, not the release zip: App Review 2.4.5(iv) and (vii) make an
in-app download of a newer build read as an outside update channel.
@tieubao
tieubao merged commit 96cd1f0 into develop Nov 15, 2026
1 check passed
tieubao added a commit that referenced this pull request Nov 15, 2026
Bump MARKETING_VERSION to 1.11.3 and CURRENT_PROJECT_VERSION to 18 in
all eight app configurations (App Store and Direct targets), add the
1.11.3 CHANGELOG entry (#475, #474), and add a runbook step that uploads
a byte-identical Hidden-Bar-macos.zip so the
releases/latest/download/Hidden-Bar-macos.zip URL stays stable.
tieubao added a commit that referenced this pull request Nov 15, 2026
MARKETING_VERSION 1.12.0 and CURRENT_PROJECT_VERSION 19 in all 8 app
configurations (Direct x4, App Store x4).

CHANGELOG: the Unreleased section becomes v1.12.0 (2026-11-15) and folds in
the unshipped 1.11.3 entry (#475, #474, #479); there is no separate 1.11.3
section. The microphone checkbox is named as the redesigned Settings window
labels it.

RUNBOOK: step 5 uploads a byte-identical Hidden-Bar-macos.zip, so
releases/latest/download/Hidden-Bar-macos.zip stays stable (carried over
from #476).
tieubao added a commit that referenced this pull request Nov 15, 2026
MARKETING_VERSION 1.12.0 and CURRENT_PROJECT_VERSION 19 in all 8 app
configurations (Direct x4, App Store x4).

CHANGELOG: the Unreleased section becomes v1.12.0 (2026-11-15) and folds in
the unshipped 1.11.3 entry (#475, #474, #479); there is no separate 1.11.3
section. The microphone checkbox is named as the redesigned Settings window
labels it.

RUNBOOK: step 5 uploads a byte-identical Hidden-Bar-macos.zip, so
releases/latest/download/Hidden-Bar-macos.zip stays stable (carried over
from #476).
@tieubao
tieubao deleted the feat/migrate-from-app-store branch November 15, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant