Collect existing bugreports before generating a new report - #126
Open
besendorf wants to merge 2 commits into
Open
Collect existing bugreports before generating a new report#126besendorf wants to merge 2 commits into
besendorf wants to merge 2 commits into
Conversation
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.
AndroidQF currently generates a new bugreport but does not copy reports already retained on the device. Those older reports may contain useful historical evidence, and generating another report can trigger Android's retention cleanup.
This change collects existing files accessible through
/bugreports/before generating the fresh report. Existing reports and companion files retain their relative names underbugreports/in the acquisition archive; the newly generated report remains atbugreport.zip.Collection follows the top-level directory alias but does not follow symlinks inside it. Files are staged before archiving so failed transfers do not leave truncated entries. Missing or empty directories are accepted; listing or transfer failures mark the collection partial while still allowing fresh bugreport generation. Existing source files are not deleted.
The scope is intentionally limited to
/bugreports/. The issue discussion confirms that this aliases the longer shell-app directory on a tested Samsung device. Exported copies in shared storage and vendor-specific locations are not searched. The README documents that Android may already have deleted older reports, so an empty directory does not establish that no reports were generated.Validation:
go test -race -tags unbundle ./...passed. Tests cover collection before generation, the top-level directory symlink, skipping internal symlinks, filenames containing spaces/newlines/quotes, absent and empty directories, unsafe paths, and listing, transfer, and generation failures. No physical-device test was performed.Fixes #50