Native iCloud apps for Windows and Linux, built in Rust. Notes, Reminders, Calendar, Contacts, Drive and Photos, offline and in sync with your iPhone.
Rust apple-notesapple-reminderscloudkitcrdtdesktop-appicloudicloud-calendaricloud-driveicloud-notesicloud-photosiphonelinuxlinux-desktoplocal-firstoffline-firstprivacyrusttauritauri-appwindows
Advanced Data Protection: one plain answer when web access is off
Yashwanth Kamireddia420b3e3ebee
diff --git a/.uiverify/settings.mjs b/.uiverify/settings.mjsindex 98ab26f..d78b674 100644--- a/.uiverify/settings.mjs+++ b/.uiverify/settings.mjs@@ -82,5 +82,16 @@ await page.waitForTimeout(300);const asked = await page.evaluate(() => window.__imgs);ok(asked.some((s) => s?.includes("me-card")), `the account shows the photo on the person's own card [${asked.join(", ")}]`);ok((await page.locator(".sidebar-account .account-avatar").innerText()).trim() === "AR", "and its initials hold the place where the photo cannot be had");+// An account that keeps its data from the web gets one plain answer, with Apple's switch.+{+ const c2 = await b.newContext({ viewport: { width: 1180, height: 820 } });+ await c2.addInitScript(() => { window.__webAccess = false; });+ await c2.addInitScript(installStub, { screen: "library", services: SERVICES, twoFactor: null, remindersFixture: true });+ const p2 = await c2.newPage();+ await p2.goto("http://localhost:4173", { waitUntil: "networkidle" });+ await p2.waitForTimeout(500);+ ok(await p2.getByText("Access iCloud Data on the Web").first().isVisible(), "web access off says how to turn it on, instead of failing screen by screen");+ await c2.close();+}await b.close();process.exitCode = failures ? 1 : 0;diff --git a/.uiverify/stub.mjs b/.uiverify/stub.mjsindex 8c83edc..5e70e77 100644--- a/.uiverify/stub.mjs+++ b/.uiverify/stub.mjs@@ -290,7 +290,7 @@ export function installStub({ screen, services, twoFactor, calendarFixture, notecase "drive_thumbnails": return driveFixture ? { "FILE::d": "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='60'><rect width='80' height='60' fill='%23eee'/></svg>" } : {};case "drive_duplicate": (window.__dups ??= []).push(args.drivewsid); return null;case "storage_info": return { usedBytes: 182196857, totalBytes: 5368709120 };- case "account_info": return { name: "Asha Rao", email: "[email protected]", photoContact: window.__mePhoto ?? null };+ case "account_info": return { name: "Asha Rao", email: "[email protected]", photoContact: window.__mePhoto ?? null, webAccessAllowed: window.__webAccess ?? true, dataProtection: false };case "settings_get": return { reminderAlerts: true, eventAlerts: true, ...(window.__settings ?? {}) };case "settings_set":if (window.__settingsFail) throw "Couldn't save that setting.";diff --git a/src/screens/Library.tsx b/src/screens/Library.tsxindex e5908f7..6cb6d6e 100644--- a/src/screens/Library.tsx+++ b/src/screens/Library.tsx@@ -52,6 +52,8 @@ export function Library({ onSignOut }: { onSignOut: () => void }) {const [selected, setSelected] = useState<string | null>(null);const [error, setError] = useState<string | null>(null);const [ready, setReady] = useState(false);+ /** False when the account keeps its data from the web: nothing here can be read. */+ const [webAccess, setWebAccess] = useState<boolean | null>(null);/** In a narrow window the sidebar slides over the content, and only when asked for. */const [sidebarOpen, setSidebarOpen] = useState(false);/** A wide window can fold the sidebar to its icons, as Finder and Mail can; remembered. */@@ -104,6 +106,10 @@ export function Library({ onSignOut }: { onSignOut: () => void }) {return !was;});+ useEffect(() => {+ api.accountInfo().then((a) => setWebAccess(a?.webAccessAllowed ?? null), () => {});+ }, []);+useEffect(() => {api.services()@@ -248,7 +254,23 @@ export function Library({ onSignOut }: { onSignOut: () => void }) {</nav><main className="content" ref={content}>- {selected === "settings" ? (+ {webAccess === false && selected !== "settings" ? (+ // Advanced Data Protection with web access off: every read would fail, and each+ // screen would say so its own way. One plain answer, with Apple's own switch.+ <div className="web-access-off" role="alert">+ <h1>Your iCloud data is kept off the web</h1>+ <p>+ Your Apple Account uses Advanced Data Protection with “Access iCloud Data on the Web”+ turned off, so Apple doesn’t let any app outside your devices — Quince included —+ read your iCloud.+ </p>+ <p>+ To use Quince, turn it on: on your iPhone, open <b>Settings</b>, tap your name, then+ <b> iCloud</b>, and turn on <b>Access iCloud Data on the Web</b>. Then sign in to Quince+ again.+ </p>+ </div>+ ) : selected === "settings" ? (<ScreenBoundary key="settings" name="Settings"><Suspense fallback={null}><SettingsView onSignOut={onSignOut} />diff --git a/src/screens/SettingsView.tsx b/src/screens/SettingsView.tsxindex 85f153b..b0a9aff 100644--- a/src/screens/SettingsView.tsx+++ b/src/screens/SettingsView.tsx@@ -83,6 +83,15 @@ export function SettingsView({ onSignOut }: { onSignOut: () => void }) {</p>)}+ {account?.dataProtection != null && (+ <section className="settings-group settings-gap">+ <div className="settings-row">+ <span className="settings-label">Advanced Data Protection</span>+ <span className="settings-value">{account.dataProtection ? "On" : "Off"}</span>+ </div>+ </section>+ )}+<h2 className="settings-heading">iCloud Storage</h2><section className="settings-group"><div className="settings-row is-stacked">diff --git a/src/styles/app.css b/src/styles/app.cssindex 512b96a..452e563 100644--- a/src/styles/app.css+++ b/src/styles/app.css@@ -2021,3 +2021,10 @@.switch[aria-checked="true"] .switch-knob { translate: 16px 0; }.switch:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }.switch:disabled { opacity: 0.5; }++/* Advanced Data Protection with web access off: one plain answer, Apple's own switch. */+.web-access-off { max-width: 520px; margin: 12vh auto 0; text-align: center; }+.web-access-off h1 { font-size: var(--t-22); font-weight: 700; margin: 0 0 12px; }+.web-access-off p { color: var(--text-2); font-size: var(--t-15); line-height: 1.5; margin: 0 0 12px; }+.web-access-off b { color: var(--text); font-weight: 600; }+.settings-gap { margin-top: 12px; }