Repository navigation
Description
What is broken.
The first-run confirmation screen promises that an error report never leaves the device unless the user sends it: «Если приложение поведёт себя странно, отчёт об ошибке поможет разобраться. Он остаётся на телефоне, пока вы сами его не отправите.» The switch that turns reports on sits directly under that sentence.
CrashReporter writes each report to getExternalFilesDir("crash_reports"). When external storage is unavailable it writes to filesDir/crash_reports instead. The app declares android:allowBackup="true", and Auto Backup includes getExternalFilesDir() (the external domain) and getFilesDir() by default.
The backup rules exclude only three things: database, sharedpref and file/datastore. They do this in backup_rules.xml and in both the <cloud-backup> and <device-transfer> sections of data_extraction_rules.xml. Nothing excludes the external domain or file/crash_reports. So every report on disk is uploaded to the user's Google Drive backup, and restored onto a new phone, without the user ever sending it.
Each report carries:
- the device manufacturer, model and codename
- the Android version
- the stack trace
- any note the user typed
- the last 60 lines of the app's own activity log
The rules file's own header says «Nothing here is worth restoring onto a new device», so leaving the reports out of the excludes was an oversight, not a decision.
The failure scenario.
- On the first run, on the «Подтверждение» step, the user reads «Он остаётся на телефоне, пока вы сами его не отправите.» and sets «Отчёты об ошибках» to «Вкл».
- The app crashes, or the user writes a manual report.
CrashReporter.writecreatesAndroid/data/<package>/files/crash_reports/crash_<stamp>_00.log. - Google backup is on, as it is by default on most phones. The next Auto Backup pass runs overnight, idle and charging, and sends the app's full-backup set to the cloud.
crash_reports/is in theexternaldomain and matches no<exclude>, so it is uploaded with the rest. - The report now sits in the user's Google Drive backup, although the user never sent it. After a restore onto a new phone, or a device-to-device transfer (the
<device-transfer>rules have the same gap), the old phone's reports reappear in the new install'scrash_reports/. The settings indatastoreare excluded, so on the new phone «Отчёты об ошибках» is off again, but the old reports are back anyway.
Where.
android/core/data/src/main/kotlin/com/lumenpearson/lessons/core/data/diagnostics/CrashReporter.kt:197:context.getExternalFilesDir(REPORTS_DIR) ?: File(context.filesDir, REPORTS_DIR), withREPORTS_DIR = "crash_reports"at line 68. The write happens at lines 231-232.android/app/src/main/AndroidManifest.xml:41-44:allowBackup="true", withdataExtractionRulesandfullBackupContentpointing at the two rules files.android/app/src/main/res/xml/backup_rules.xml:10-14: excludes onlydatabase,sharedprefandfile/datastore.android/app/src/main/res/xml/data_extraction_rules.xml:4-8(cloud-backup) and:9-13(device-transfer): the same three excludes.android/app/src/main/res/values/strings.xml:31(onboarding_ack_footer), with its twin atvalues-en/strings.xml:35. It is shown atandroid/app/src/main/kotlin/com/lumenpearson/lessons/ui/onboarding/OnboardingScreen.kt:397, above the reports switch at 408-416.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
Let a reader open the terms and the privacy policy from the app, onli…
lumenpearson commentedon Sep 26, 2026
Seen on an emulator (AVD
Pixel_10_Pro_XL, API 37 (google_apis_playstore, x86_64, 1344×2992 at 480 dpi), 26–27 September 2026).am crash) wrotecrash_reports/crash_…_00.log.bmgr backupnowran through the local transport, then the files were deleted andbmgr restoreran. A probe file infiles/and one in theexternaldomain came back; the report did not.is_device_transfer=true: the same result.The Google transport was put back afterwards. Google's own transport to a real account has not been asked.
BackupRulesTest's note says so, and this closes with #186.