Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Keep 1Password 7's standalone vaults unselected

Țugui Dragoșb7577394b292
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 17bf7514..2b9f0c55 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -77,6 +77,8 @@ its changes the way [Keep a Changelog](https://keepachangelog.com/) suggests.
listed and never selected, since logging in again brings it back.
- ZeroTier's identity on its networks and Tunnelblick's shared VPN configurations, both kept in
`/Library/Application Support`, are listed and never selected, like a VPN's connections in your home folder.
+- The group folder where 1Password 7 kept its standalone vaults and their daily backups is listed and never selected,
+ also when you uninstall 1Password 8, which uses it too.
#### Space
diff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/KeptOnlyHere.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/KeptOnlyHere.swift
index bd0050d0..ee150bae 100644
--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/KeptOnlyHere.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/KeptOnlyHere.swift
@@ -29,6 +29,10 @@ enum KeptOnlyHere {
// WhatsApp's "How to restore your chat history": chats on WhatsApp on Mac can't be backed up or restored
// there, and aren't on its servers. The app's entitlements name this group, where it keeps them.
("Library/Group Containers/group.net.whatsapp.WhatsApp.shared", nil, .holdsMessageHistory),
+ // 1Password's "Migrate your existing 1Password data from standalone vaults" and "1Password backups":
+ // 1Password 7 and earlier kept standalone vaults, and a backup of them each day, in this group, which
+ // 1Password 8's signature names too.
+ ("Library/Group Containers/2BUA8C4S2C.com.agilebits", nil, .holdsPasswordsOrCodes),
// Strongbox's "Where are Strongbox local backups stored on my Mac".
("Library/Group Containers/group.strongbox.mac.mcguill", "backups", .holdsPasswordsOrCodes),
// Ente's "Offline mode": the codes are stored only on that device.
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/KeptOnlyHereTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/KeptOnlyHereTests.swift
index 3fb4945c..1bb99f17 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/KeptOnlyHereTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/KeptOnlyHereTests.swift
@@ -15,6 +15,9 @@ struct KeptOnlyHereTests {
("Library/Group Containers/6N38VWS5BX.ru.keepcoder.Telegram", .holdsMessageHistory),
("Library/Group Containers/group.net.whatsapp.WhatsApp.shared", .holdsMessageHistory),
("Library/Group Containers/group.net.whatsapp.WhatsApp.shared/ChatStorage.sqlite", .holdsMessageHistory),
+ ("Library/Group Containers/2BUA8C4S2C.com.agilebits", .holdsPasswordsOrCodes),
+ ("Library/Group Containers/2BUA8C4S2C.com.agilebits/Library/Application Support/1Password/Backups",
+ .holdsPasswordsOrCodes),
("Library/Group Containers/group.strongbox.mac.mcguill", .holdsPasswordsOrCodes),
("Library/Containers/io.ente.auth.mac", .holdsPasswordsOrCodes),
("Library/Application Support/Tunnelblick/Configurations/work.tblk", .holdsVPNConnections),
@@ -53,7 +56,7 @@ struct KeptOnlyHereTests {
"Library/Application Support/Signal Beta", "Library/Thunderbird/Crash Reports",
"Library/Group Containers/group.strongbox.mac.mcguill/Library/Caches",
"Library/Application Support/Tunnelblick/Logs", "Library/Logs/Viscosity",
- "Library/Group Containers/group.net.whatsapp.family",
+ "Library/Group Containers/group.net.whatsapp.family", "Library/Group Containers/2BUA8C4S2C.com.1password",
"Library/Application Support/Steam Link", "Library/Caches/Postgres", "Library/Application Support/Backupify",
"Library/Application Support/obs-studio/logs",
".docker/contexts", ".cargo/registry", ".config", ".local/share", ".terraform.d/plugins",
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift
index 1c305884..5fd65556 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverScannerTests.swift
@@ -729,6 +729,23 @@ struct LeftoverScannerTests {
}
}
+ @Test func theStandaloneVaultsOfAnEarlierVersionAreNotSelectedWithTheOneThatReadsThem() async throws {
+ let directory = try TemporaryDirectory()
+ let groups = ["2BUA8C4S2C.com.agilebits", "2BUA8C4S2C.com.1password"]
+ try directory.file("home/Library/Group Containers/\(groups[0])/Library/Application Support/1Password/Data/B5.sqlite")
+ try directory.file("home/Library/Group Containers/\(groups[1])/Library/Application Support/1Password/Data/1password.sqlite")
+ let app = InstalledApp(
+ url: URL(filePath: "/Applications/Vault.app"), bundleIdentifier: "org.example.vault", name: "Vault",
+ teamIdentifier: "2BUA8C4S2C", applicationGroups: groups
+ )
+
+ let leftovers = await LeftoverScanner(environment: environment(in: directory))
+ .scan(app, installedApps: [app]).leftovers
+ let heldBack = Dictionary(uniqueKeysWithValues: leftovers.map { ($0.url.lastPathComponent, $0.match.heldBack) })
+
+ #expect(heldBack == [groups[0]: .holdsPasswordsOrCodes, groups[1]: nil])
+ }
+
@Test(.permissionsHold) func flagsItemsInReadOnlyLocationsAsRequiringPrivileges() async throws {
let directory = try TemporaryDirectory()
try directory.file("root/Library/LaunchDaemons/net.example.client.helper.plist")