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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
According to the latest Android documentation, doesandroid:allowBackup="false"fully disable both cloud backup and device-to-device transfer on Android 12+? If not, what exact combination ofallowBackup,fullBackupContent, anddataExtractionRulesis recommended to guarantee no app data backup/transfer?💡 Result:
No, according to the latest Android documentation, setting android:allowBackup="false" does not fully disable both cloud backup and device-to-device (D2D) transfer on Android 12+. On devices from some manufacturers, android:allowBackup="false" disables cloud backups (e.g., Google Drive) but does not disable D2D transfers. To guarantee no app data backup or transfer on Android 12+, use the following combination in the AndroidManifest.xml element: android:allowBackup="false" android:dataExtractionRules="@xml/data_extraction_rules" Create res/xml/data_extraction_rules.xml with excludes for all domains in both and : For compatibility with Android 11 and lower, also add android:fullBackupContent="@xml/backup_rules" with similar excludes in a backup_rules.xml file using syntax. This configuration explicitly excludes all app data from both cloud backups and D2D transfers while disabling legacy backups.
Citations:
Add explicit data extraction rules to fully disable backups on Android 12+.
Setting
android:allowBackup="false"alone does not prevent device-to-device transfers on some Android 12+ devices. Addandroid:dataExtractionRules="@xml/data_extraction_rules"with explicit excludes for all data domains, andandroid:fullBackupContent="@xml/backup_rules"for Android 11 compatibility.Manifest and configuration files required
Update AndroidManifest.xml:
<application android:label="RepForge" android:name="${applicationName}" android:icon="@mipmap/ic_launcher" - android:allowBackup="false">+ android:allowBackup="false"+ android:fullBackupContent="@xml/backup_rules"+ android:dataExtractionRules="@xml/data_extraction_rules">Create
res/xml/data_extraction_rules.xml:Create
res/xml/backup_rules.xml:🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai is there any specific reason why we are disabling backups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Devasy, great question! Here are the key reasons why disablingandroid:allowBackupis a security best practice:Sensitive data exposure: Android's Auto Backup (enabled by default) automatically uploads app data — including databases, shared preferences, and files — to the user's Google Drive. If that Google account is compromised, an attacker could restore the backup onto another device and access all of your app's stored data (e.g., workout history, user credentials, session tokens).
Unintended data retention: Even after a user uninstalls the app, backed-up data can persist in the cloud and be restored when the app is reinstalled, potentially on a different device. This creates unintended data retention that may conflict with privacy expectations.
ADB backup attack vector: On older Android versions,
allowBackup="true"also enables backup via ADB (adb backup), meaning anyone with physical USB access to an unlocked device could extract app data — a significant risk for apps handling personal health/fitness data.Google Play compliance: Google's Privacy and Security guidelines recommend explicitly controlling backup behavior for apps that handle personal or sensitive data.
For a workout logger storing personal health/fitness data, disabling backups is the right call. However, as my review comment noted,
android:allowBackup="false"alone is not sufficient on Android 12+ — you also needandroid:dataExtractionRulesto block device-to-device transfers, andandroid:fullBackupContentfor Android 11 and below compatibility. The fix suggested in the review comment addresses all of these cases comprehensively.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can clarify this since I authored the change: We are disabling backups as a security measure to prevent potential data leakage. By default, Android automatically backs up application data to Google Drive, which could expose sensitive application data or user information if the user's backup account is compromised. Setting
android:allowBackup="false"ensures that the app's data stays securely on the device.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.