Repository navigation
discovery: one-pass snapshot owners, search-only Containers, group roots by descriptor - #53
Merged
Merged
Conversation
…ots by descriptor - snapshot takes database roots and their owning bundle IDs from a single discovery pass (WeChatAccountDiscovery.ownedDatabaseRoots). - Owner bundle IDs are compared case-insensitively; an unknown owner still leaves the client build unverified. - When ~/Library/Containers can't be listed, it is opened search-only so the standard container is still probed. - Group-container xwechat_files roots are opened and listed through descriptors, with accounts checked by WeChatAppContainerScanner.accounts. Closes #49 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…target Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ys probe the exact standard name Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…plicate standard probe Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 24, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #49
Follow-ups from the #45 review of duplicate-container discovery.
Changes
WeChatAccountDiscovery.ownedDatabaseRoots(accountID:)returns each selected database root with the bundle ID of its owning container.greenbubbles-discover snapshotuses it, so the owner check covers the same roots that go toDatabaseSetPlanner, and each container is probed once.containerBundleIdentifiers(accountID:)stays as a wrapper so the 0.11.0 public API still compiles.ownersAllMatch(_:bundleIdentifier:): a nil owner (group container) never matches. An exact match is accepted. A match that differs only in case is accepted only when~/Library/Containers/<installed id>and~/Library/Containers/<owner>are the same real directory entry, compared withlstatso links aren't followed. This coverscom.tencent.xinwechaton a case-insensitive volume. On a case-sensitive volume, where the two spellings can be different containers, the match is rejected.~/Library/Containers. If opening it withO_RDONLYfails, the scanner reopens it withO_SEARCHand probes the standard name directly. The exact standard name is now also probed after any listed spellings of it, so a hidden or unlisted standard container isn't lost. If a listed spelling already reached that directory, the exact name is skipped before its accounts are listed.Group Containersis listed once. Each matching group and itsxwechat_filesare opened withopenat, and the identity (fstat) and the account listing both come from that onexwechat_filesdescriptor. Accounts are checked withWeChatAppContainerScanner.accounts(inFiles:at:), which skips linked accounts and linkeddb_storage. One deliberate difference from app containers: a group or itsxwechat_filesmay still be a symbolic link, because a group linked to an app container's data is a supported alias case (groupContainerLinkedToAnAppContainerIsOneAccount). Groups whose target was already seen skip the per-account checks.Also:
entryNamesnow skipsUF_HIDDENentries as well as dot-names. This restores the.skipsHiddenFilesbehaviour that account and group listings had before 0.11.0.Tests
standardAccountIsFoundWhenContainersIsSearchOnly(fails without the fix),groupContainerAccountsAreCheckedThroughDescriptors(linked, hidden, non-WeChat, and empty groups),ownerBundleIdentifiersMatchCaseInsensitivelyButUnknownOwnersNever,caseVariantOwnerInADifferentContainerDoesNotMatch(runs only on a case-sensitive volume), and an updatedreportsTheOwnerOfSelectedAccounts.GreenBubblesHistoryApp): all suites pass.swift format lint --strictis clean.Review notes not addressed
contentsOfDirectory(at: alias)after the descriptor is closed, as in Discover WeChat data in duplicated app containers #45. Only extra IDs that select an account come from that listing. The data roots come from the verified descriptor. Deriving the IDs differently could change IDs that users saved from earlier versions.Needs manual check
greenbubbles-discover accountsandsnapshot, and confirm that no "would like to access data from other apps" (App Data) prompt appears. The scan opens other apps' container folders search-only on the way down, and now also opens matching group containers by descriptor.scripts/sudo-smoke-test-acquire.shis unchanged.🤖 Generated with Claude Code