From 76974c4001710cb15bdb63ff91b19fa853cc2cdf Mon Sep 17 00:00:00 2001 From: Niharika Arora Date: Fri, 23 Dec 2022 21:21:45 +0530 Subject: [PATCH] Added backup rules to backup user preferences for both A12 & above and A11 and lower --- .idea/codeStyles/codeStyleConfig.xml | 2 +- app/build.gradle.kts | 2 +- app/demo/debug/output-metadata.json | 20 +++++++++++++++++++ app/src/main/AndroidManifest.xml | 2 ++ app/src/main/res/xml/backup_rules.xml | 25 ++++++++++++++++++++++++ app/src/main/res/xml/backup_rules_12.xml | 25 ++++++++++++++++++++++++ 6 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 app/demo/debug/output-metadata.json create mode 100644 app/src/main/res/xml/backup_rules.xml create mode 100644 app/src/main/res/xml/backup_rules_12.xml diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml index 79ee123c2..0f7bc519d 100644 --- a/.idea/codeStyles/codeStyleConfig.xml +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 10bfe9c22..70494f361 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -118,4 +118,4 @@ configurations.configureEach { // Temporary workaround for https://issuetracker.google.com/174733673 force("org.objenesis:objenesis:2.6") } -} \ No newline at end of file +} diff --git a/app/demo/debug/output-metadata.json b/app/demo/debug/output-metadata.json new file mode 100644 index 000000000..16aaf59ae --- /dev/null +++ b/app/demo/debug/output-metadata.json @@ -0,0 +1,20 @@ +{ + "version": 3, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.example.samples.apps.nowinandroid.demo.debug", + "variantName": "demoDebug", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "attributes": [], + "versionCode": 1, + "versionName": "0.0.1", + "outputFile": "app-demo-debug.apk" + } + ], + "elementType": "File" +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 858ae9b19..9cc9da019 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -24,6 +24,8 @@ android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" + android:dataExtractionRules="@xml/backup_rules_12" + android:fullBackupContent="@xml/backup_rules" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.Nia.Splash"> diff --git a/app/src/main/res/xml/backup_rules.xml b/app/src/main/res/xml/backup_rules.xml new file mode 100644 index 000000000..7a65f9818 --- /dev/null +++ b/app/src/main/res/xml/backup_rules.xml @@ -0,0 +1,25 @@ + + + + + + + + + diff --git a/app/src/main/res/xml/backup_rules_12.xml b/app/src/main/res/xml/backup_rules_12.xml new file mode 100644 index 000000000..601ed12a1 --- /dev/null +++ b/app/src/main/res/xml/backup_rules_12.xml @@ -0,0 +1,25 @@ + + + + + + + + + + +