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 00000000..6de45e18 Binary files /dev/null and b/contactsbackup/testkey.jks differ