From 9e5f22a8a04a5ac43bab046723ff89231c8b4e2c Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Fri, 27 Sep 2024 13:42:38 -0300 Subject: [PATCH] Install contactsbackup before restart, so default permissions get applied Also add testkey for signed builds --- .cirrus.yml | 6 +++++- contactsbackup/build.gradle.kts | 32 +++++++++++++------------------- contactsbackup/testkey.jks | Bin 0 -> 2897 bytes 3 files changed, 18 insertions(+), 20 deletions(-) create mode 100644 contactsbackup/testkey.jks diff --git a/.cirrus.yml b/.cirrus.yml index 42537515..380e5ddc 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -31,7 +31,7 @@ instrumentation_tests_task: adb remount; sleep 5; assemble_script: - ./gradlew :app:assembleRelease :app:assembleAndroidTest + ./gradlew :app:assembleRelease :contacts:assembleRelease assembleAndroidTest install_app_script: timeout 180s bash -c 'while [[ -z $(adb shell mount | grep "/system " | grep "(rw,") ]]; do sleep 1; done;'; adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'; @@ -44,7 +44,11 @@ instrumentation_tests_task: adb push app/build/outputs/apk/release/app-release.apk /system/priv-app/Seedvault/Seedvault.apk; adb push permissions_com.stevesoltys.seedvault.xml /system/etc/permissions/privapp-permissions-seedvault.xml; adb push allowlist_com.stevesoltys.seedvault.xml /system/etc/sysconfig/allowlist-seedvault.xml; + + adb shell mkdir -p /system/priv-app/ContactsBackup; + adb push contactsbackup/build/outputs/apk/release/contactsbackup-release.apk /system/priv-app/ContactsBackup/contactsbackup.apk; adb push contactsbackup/default-permissions_org.calyxos.backup.contacts.xml /system/etc/default-permissions/default-permissions_org.calyxos.backup.contacts.xml; + adb shell bmgr enable true; adb reboot; adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;'; diff --git a/contactsbackup/build.gradle.kts b/contactsbackup/build.gradle.kts index adbb4712..a59e8c0f 100644 --- a/contactsbackup/build.gradle.kts +++ b/contactsbackup/build.gradle.kts @@ -2,8 +2,6 @@ * SPDX-FileCopyrightText: 2020 The Calyx Institute * SPDX-License-Identifier: Apache-2.0 */ -import java.io.FileInputStream -import java.util.Properties plugins { alias(libs.plugins.android.application) @@ -42,23 +40,18 @@ android { isReturnDefaultValues = true } - // optional signingConfigs - // On userdebug builds, you can use the testkey here to update the system app - val keystorePropertiesFile = project.file("keystore.properties") - if (keystorePropertiesFile.exists()) { - val keystoreProperties = Properties() - keystoreProperties.load(FileInputStream(keystorePropertiesFile)) - - signingConfigs { - create("release") { - keyAlias = keystoreProperties["keyAlias"] as String - keyPassword = keystoreProperties["keyPassword"] as String - storeFile = file(keystoreProperties["storeFile"] as String) - storePassword = keystoreProperties["storePassword"] as String - } + signingConfigs { + create("aosp") { + keyAlias = "android" + keyPassword = "android" + storePassword = "android" + storeFile = file("testkey.jks") } - buildTypes.getByName("release").signingConfig = signingConfigs.getByName("release") - buildTypes.getByName("debug").signingConfig = signingConfigs.getByName("release") + } + + buildTypes { + getByName("release").signingConfig = signingConfigs.getByName("aosp") + getByName("debug").signingConfig = signingConfigs.getByName("aosp") } } @@ -74,6 +67,7 @@ dependencies { androidTestImplementation(libs.kotlin.stdlib.jdk8) androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation( - "androidx.test.espresso:espresso-core:${libs.versions.espresso.get()}") + "androidx.test.espresso:espresso-core:${libs.versions.espresso.get()}" + ) androidTestImplementation("io.mockk:mockk-android:${libs.versions.mockk.get()}") } diff --git a/contactsbackup/testkey.jks b/contactsbackup/testkey.jks new file mode 100644 index 0000000000000000000000000000000000000000..6de45e18efb93aba0df301c159254b9994d3bcfe GIT binary patch literal 2897 zcmY+EXE+;*8po56R6^~oRWVx9B4+Is)UH}ZjZ!73+BJ_6x2ajXt-UE?&-9>GQBix- z(pt4wVl@=E_dfTY^PCUw^FGi2_kZ7yKO~0M5Co(`VrU@{C<3d4J-!UQ1kA_4j;S%Q zeIy39i^PE4|AD|Z)EKbk@7V137(;0PcSQ#Sg7Pucr$`L-F;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