Skip to content

Collect existing bugreports before generating a new report - #126

Open
besendorf wants to merge 2 commits into
mainfrom
collect-existing-bugreports
Open

Collect existing bugreports before generating a new report#126
besendorf wants to merge 2 commits into
mainfrom
collect-existing-bugreports

Conversation

@besendorf

Copy link
Copy Markdown
Collaborator

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 under bugreports/ in the acquisition archive; the newly generated report remains at bugreport.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

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.

Add bugreport directory to collected paths

1 participant