First version bumps for Android 12

This commit is contained in:
Torsten Grote 2021-10-07 13:44:55 -03:00 committed by Chirayu Desai
parent b029b0b029
commit 7f4b565d2a
41 changed files with 130 additions and 136 deletions

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

View file

@ -27,6 +27,7 @@ android_app {
"kotlin-stdlib-jdk8",
"androidx.core_core-ktx",
"androidx.preference_preference",
"androidx.documentfile_documentfile",
"androidx.lifecycle_lifecycle-viewmodel-ktx",
"androidx.lifecycle_lifecycle-livedata-ktx",
"androidx-constraintlayout_constraintlayout",
@ -37,9 +38,8 @@ android_app {
"androidx.room_room-runtime",
"libprotobuf-java-lite",
// koin
"seedvault-lib-koin-core", // did not manage to add this as transitive dependency
"seedvault-lib-koin-core-jvm", // did not manage to add this as transitive dependency
"seedvault-lib-koin-android",
"seedvault-lib-koin-androidx-viewmodel",
// bip39
"seedvault-lib-kotlin-bip39",
],

View file

@ -1,9 +1,7 @@
import groovy.xml.XmlUtil
plugins {
id "com.android.application"
id "kotlin-android"
id "org.jlleitschuh.gradle.ktlint" version "9.4.0"
id "org.jlleitschuh.gradle.ktlint" version "10.2.0"
}
def gitDescribe = { ->
@ -34,7 +32,9 @@ android {
}
lintOptions {
disable "CheckedExceptions"
disable "DialogFragmentCallbacksDetector",
"InvalidFragmentVersionForActivityResult",
"CheckedExceptions"
abortOnError true
}
compileOptions {
@ -43,7 +43,7 @@ android {
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
languageVersion = "1.3"
languageVersion = "1.4"
}
testOptions {
unitTests.all {
@ -98,6 +98,7 @@ dependencies {
implementation rootProject.ext.std_libs.androidx_core
// A newer version gets pulled in with AOSP via core, so we include fragment here explicitly
implementation rootProject.ext.std_libs.androidx_fragment
implementation rootProject.ext.std_libs.androidx_activity
implementation rootProject.ext.std_libs.androidx_preference
implementation rootProject.ext.std_libs.androidx_lifecycle_viewmodel_ktx
implementation rootProject.ext.std_libs.androidx_lifecycle_livedata_ktx
@ -119,12 +120,15 @@ dependencies {
* If the dependencies below are updated,
* please make sure to update the prebuilt libraries and the Android.bp files
* in the top-level `libs` folder to reflect that.
* You can copy these libraries from ~/.gradle/caches/modules-2
* You can copy these libraries from ~/.gradle/caches/modules-2/files-2.1
*/
// later versions than 2.1.1 require newer kotlin version
// implementation "io.insert-koin:koin-core-jvm:3.1.2"
// implementation "io.insert-koin:koin-android:3.1.2"
implementation fileTree(include: ['*.jar'], dir: "${rootProject.rootDir}/libs/koin-android")
implementation fileTree(include: ['*.aar'], dir: "${rootProject.rootDir}/libs/koin-android")
// implementation "cash.z.ecc.android:kotlin-bip39:1.0.2"
implementation fileTree(include: ['kotlin-bip39-1.0.2.jar'], dir: "${rootProject.rootDir}/libs")
/**
@ -134,7 +138,7 @@ dependencies {
// anything less than 'implementation' fails tests run with gradlew
testImplementation rootProject.ext.aosp_libs
testImplementation 'androidx.test.ext:junit:1.1.2'
testImplementation 'androidx.test.ext:junit:1.1.3'
testImplementation('org.robolectric:robolectric:4.3.1') { // 4.4 has issue with non-idle Looper
// https://github.com/robolectric/robolectric/issues/5245
exclude group: "com.google.auto.service", module: "auto-service"
@ -146,9 +150,9 @@ dependencies {
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit5_version"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:$junit5_version"
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation "io.mockk:mockk-android:$mockk_version"
}
@ -163,30 +167,6 @@ gradle.projectsEvaluated {
}
}
// http://www.31mins.com/android-studio-build-system-application/
preBuild.doLast {
def imlFile = file(project.name + ".iml")
try {
def parsedXml = (new XmlParser()).parse(imlFile)
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
parsedXml.component[1].remove(jdkNode)
def apiString = android.compileSdkVersion.substring("android-".length())
def sdkString = "Android API " + apiString + " Platform"
//noinspection GroovyResultOfObjectAllocationIgnored // the note gets inserted
new Node(parsedXml.component[1], 'orderEntry', [
'type' : 'jdk',
'jdkName': sdkString,
'jdkType': 'Android SDK'
])
XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile))
} catch (NullPointerException | FileNotFoundException ex) {
ex.printStackTrace()
}
}
configurations {
all {
resolutionStrategy {

Binary file not shown.

Binary file not shown.

View file

@ -23,8 +23,8 @@ import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.koin.core.KoinComponent
import org.koin.core.inject
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
@RunWith(AndroidJUnit4::class)
@Suppress("BlockingMethodInNonBlockingContext")

View file

@ -32,8 +32,8 @@ import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.koin.core.KoinComponent
import org.koin.core.inject
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
import java.io.IOException
import kotlin.random.Random

View file

@ -4,8 +4,8 @@ import android.util.Log
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.koin.core.KoinComponent
import org.koin.core.inject
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
@RunWith(AndroidJUnit4::class)
class PackageServiceTest : KoinComponent {

View file

@ -129,7 +129,8 @@
</receiver>
<receiver
android:name=".SecretCodeReceiver">
android:name=".SecretCodeReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.telephony.action.SECRET_CODE" />
<!-- *#*#RESTORE#*#* -->

View file

@ -7,6 +7,7 @@ import android.content.Context.BACKUP_SERVICE
import android.os.Build
import android.os.ServiceManager.getService
import android.os.StrictMode
import org.koin.core.logger.Level
import com.stevesoltys.seedvault.crypto.cryptoModule
import com.stevesoltys.seedvault.header.headerModule
import com.stevesoltys.seedvault.metadata.MetadataManager
@ -77,7 +78,7 @@ open class App : Application() {
}
protected open fun startKoin() = startKoin {
androidLogger()
androidLogger(Level.ERROR)
androidContext(this@App)
modules(
listOf(

View file

@ -22,7 +22,7 @@ import com.stevesoltys.seedvault.storage.StorageBackupService
import com.stevesoltys.seedvault.storage.StorageBackupService.Companion.EXTRA_START_APP_BACKUP
import com.stevesoltys.seedvault.transport.requestBackup
import com.stevesoltys.seedvault.ui.storage.AUTHORITY_STORAGE
import org.koin.core.context.KoinContextHandler.get
import org.koin.core.context.GlobalContext.get
import java.util.concurrent.TimeUnit.HOURS
private val TAG = UsbIntentReceiver::class.java.simpleName
@ -32,8 +32,8 @@ private const val HOURS_AUTO_BACKUP: Long = 24
class UsbIntentReceiver : UsbMonitor() {
// using KoinComponent would crash robolectric tests :(
private val settingsManager: SettingsManager by lazy { get().get<SettingsManager>() }
private val metadataManager: MetadataManager by lazy { get().get<MetadataManager>() }
private val settingsManager: SettingsManager by lazy { get().get() }
private val metadataManager: MetadataManager by lazy { get().get() }
override fun shouldMonitorStatus(context: Context, action: String, device: UsbDevice): Boolean {
if (action != ACTION_USB_DEVICE_ATTACHED) return false

View file

@ -6,7 +6,7 @@ import android.content.Intent
import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
import androidx.core.net.toUri
import com.stevesoltys.seedvault.ui.notification.BackupNotificationManager
import org.koin.core.context.KoinContextHandler.get
import org.koin.core.context.GlobalContext.get
internal const val ACTION_RESTORE_ERROR_UNINSTALL = "com.stevesoltys.seedvault.action.UNINSTALL"
internal const val EXTRA_PACKAGE_NAME = "com.stevesoltys.seedvault.extra.PACKAGE_NAME"

View file

@ -14,8 +14,8 @@ import com.stevesoltys.seedvault.settings.SettingsActivity
import com.stevesoltys.seedvault.transport.backup.BackupCoordinator
import com.stevesoltys.seedvault.transport.restore.RestoreCoordinator
import kotlinx.coroutines.runBlocking
import org.koin.core.KoinComponent
import org.koin.core.inject
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
// If we ever change this, we should use a ComponentName like the other backup transports.
val TRANSPORT_ID: String = ConfigurableBackupTransport::class.java.name

View file

@ -14,9 +14,9 @@ import com.stevesoltys.seedvault.crypto.KeyManager
import com.stevesoltys.seedvault.transport.backup.PackageService
import com.stevesoltys.seedvault.ui.notification.BackupNotificationManager
import com.stevesoltys.seedvault.ui.notification.NotificationBackupObserver
import org.koin.core.KoinComponent
import org.koin.core.context.KoinContextHandler.get
import org.koin.core.inject
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
import org.koin.core.context.GlobalContext.get
private val TAG = ConfigurableBackupTransportService::class.java.simpleName

View file

@ -11,8 +11,8 @@ import com.stevesoltys.seedvault.MAGIC_PACKAGE_MANAGER
import com.stevesoltys.seedvault.R
import com.stevesoltys.seedvault.metadata.MetadataManager
import com.stevesoltys.seedvault.transport.backup.ExpectedAppTotals
import org.koin.core.KoinComponent
import org.koin.core.inject
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
private val TAG = NotificationBackupObserver::class.java.simpleName

View file

@ -166,6 +166,7 @@ class RecoveryCodeInputFragment : Fragment() {
@RequiresApi(30)
private fun storeNewCodeAfterAuth(input: List<CharSequence>) {
val context = requireContext()
val biometricPrompt = BiometricPrompt.Builder(context)
.setConfirmationRequired(true)
.setTitle(getString(R.string.recovery_code_auth_title))

View file

@ -10,11 +10,11 @@
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="16dp"
android:tint="?android:colorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_cloud_restore"
app:tint="?android:colorAccent"
tools:ignore="ContentDescription" />
<TextView

View file

@ -23,11 +23,11 @@
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="16dp"
android:tint="?android:colorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressBar"
app:srcCompat="@drawable/ic_cloud_download"
app:tint="?android:colorAccent"
tools:ignore="ContentDescription" />
<TextView

View file

@ -10,11 +10,11 @@
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="16dp"
android:tint="?android:colorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_cloud_download"
app:tint="?android:colorAccent"
tools:ignore="ContentDescription" />
<TextView

View file

@ -10,11 +10,11 @@
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="16dp"
android:tint="?android:colorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_storage"
app:tint="?android:colorAccent"
tools:ignore="ContentDescription" />
<TextView

View file

@ -10,11 +10,11 @@
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="16dp"
android:tint="?android:colorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_storage"
app:tint="?android:colorAccent"
tools:ignore="ContentDescription" />
<TextView

View file

@ -10,11 +10,11 @@
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_margin="16dp"
android:tint="?android:colorAccent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_cloud_download"
app:tint="?android:colorAccent"
tools:ignore="ContentDescription" />
<TextView

View file

@ -1,29 +1,31 @@
buildscript {
// 1.3.21 Android 10
// 1.3.61 Android 11
// 1.4.30 Android 12
// Check:
// https://android.googlesource.com/platform/external/kotlinc/+/refs/tags/android-11.0.0_r3/build.txt
ext.aosp_kotlin_version = '1.3.61'
// https://android.googlesource.com/platform/external/kotlinc/+/refs/tags/android-12.0.0_r2/build.txt
ext.aosp_kotlin_version = '1.4.31' // 1.4.30 breaks Kotlin plugin in Android Studio
ext.kotlin_version = '1.4.31'
repositories {
mavenCentral()
//noinspection JcenterRepositoryObsolete
jcenter()
google()
}
dependencies {
//noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.14"
classpath 'com.android.tools.build:gradle:4.2.1'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.17"
classpath 'com.android.tools.build:gradle:7.0.2'
}
}
ext {
buildToolsVersion = '30.0.2'
compileSdkVersion = 30
buildToolsVersion = '31.0.0'
compileSdkVersion = 31
minSdkVersion = 29
targetSdkVersion = 30
targetSdkVersion = 31
}
apply from: 'gradle/dependencies.gradle'
@ -31,6 +33,7 @@ apply from: 'gradle/dependencies.gradle'
allprojects {
repositories {
mavenCentral()
//noinspection JcenterRepositoryObsolete
jcenter()
google()
maven { url 'https://jitpack.io' }

View file

@ -2,15 +2,16 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "org.calyxos.backup.contacts"
minSdkVersion 30
targetSdkVersion 30
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments disableAnalytics: 'true'
}
compileOptions {
@ -18,6 +19,10 @@ android {
targetCompatibility = 1.8
}
kotlinOptions {
jvmTarget = '1.8'
}
testOptions {
unitTests.returnDefaultValues = true
}
@ -55,7 +60,7 @@ dependencies {
testImplementation "io.mockk:mockk:$mockk_version"
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
androidTestImplementation "io.mockk:mockk-android:$mockk_version"
}

View file

@ -1,12 +1,12 @@
ext {
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/androidx/Android.bp#2713
ext.room_version = "2.3.0-alpha02"
// http://aosp.opersys.com/xref/android-11.0.0_r27/xref/external/protobuf/java/pom.xml#7
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-12.0.0_r2/current/androidx/Android.bp#2943
ext.room_version = "2.3.0-beta02"
// https://android.googlesource.com/platform/external/protobuf/+/refs/tags/android-12.0.0_r2/java/pom.xml#7
ext.protobuf_version = "3.9.1"
junit4_version = "4.13.2"
junit5_version = "5.5.2" // careful, upgrading this can change a Cipher's IV size in tests!?
mockk_version = "1.10.2" // higher versions get us a kotlin version conflict
espresso_version = "3.3.0"
mockk_version = "1.12.0"
espresso_version = "3.4.0"
}
// To produce these binaries, in latest AOSP source tree, run
@ -19,7 +19,7 @@ ext.aosp_libs = fileTree(include: [
//
// out/target/common/obj/JAVA_LIBRARIES/framework-minus-apex_intermediates/classes.jar
'android.jar',
// out/target/common/obj/JAVA_LIBRARIES/core-libart.com.android.art.release_intermediates/classes.jar
// out/target/common/obj/JAVA_LIBRARIES/core-libart.com.android.art_intermediates/classes.jar
'libcore.jar',
], dir: "$projectDir/app/libs")
@ -36,66 +36,74 @@ ext.kotlin_libs = [
},
],
coroutines: [
dependencies.create('org.jetbrains.kotlinx:kotlinx-coroutines-core') {
// https://android.googlesource.com/platform/prebuilts/tools/+/refs/tags/android-11.0.0_r3/common/m2/Android.bp#326
version { strictly '1.3.0' }
dependencies.create('org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm') {
// https://android.googlesource.com/platform/prebuilts/tools/+/refs/tags/android-12.0.0_r2/common/m2/Android.bp#273
version { strictly '1.4.2' }
},
dependencies.create('org.jetbrains.kotlinx:kotlinx-coroutines-android') {
// https://android.googlesource.com/platform/prebuilts/tools/+/refs/tags/android-11.0.0_r3/common/m2/Android.bp#340
// https://android.googlesource.com/platform/prebuilts/tools/+/refs/tags/android-12.0.0_r2/common/m2/Android.bp#288
version { strictly '1.3.0' }
},
],
]
ext.std_libs = [
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/androidx/Android.bp#610
androidx_core: dependencies.create('androidx.core:core-ktx') {
version { strictly '1.5.0-alpha01' }
},
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/androidx/Android.bp#930
androidx_core: [
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-12.0.0_r2/current/androidx/Android.bp#867
dependencies.create('androidx.core:core') {
version { strictly '1.6.0' } // should be 1.6.0-beta03, but that is not even released, yet
},
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-12.0.0_r2/current/androidx/Android.bp#833
dependencies.create('androidx.core:core-ktx') {
version { strictly '1.5.0-beta02' }
},
],
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-12.0.0_r2/current/androidx/Android.bp#1189
androidx_fragment: dependencies.create('androidx.fragment:fragment-ktx') {
version { strictly '1.3.0-alpha07' }
version { strictly '1.4.0-alpha01' }
},
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/androidx/Android.bp#2412
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-12.0.0_r2/current/androidx/Android.bp#20
androidx_activity: dependencies.create('androidx.activity:activity-ktx') {
version { strictly '1.3.0-alpha03' }
},
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-12.0.0_r2/current/androidx/Android.bp#2695
androidx_preference: dependencies.create('androidx.preference:preference') {
version { strictly '1.1.1' } // should be 1.2.0-alpha01, but that is not even released, yet
},
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/androidx/Android.bp#1553
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-12.0.0_r2/current/androidx/Android.bp#1820
androidx_lifecycle_viewmodel_ktx: dependencies.create('androidx.lifecycle:lifecycle-viewmodel-ktx') {
version { strictly '2.3.0-alpha05' }
version { strictly '2.4.0-alpha01' }
},
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/androidx/Android.bp#1353
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-12.0.0_r2/current/androidx/Android.bp#1618
androidx_lifecycle_livedata_ktx: dependencies.create('androidx.lifecycle:lifecycle-livedata-ktx') {
version { strictly '2.3.0-alpha05' }
version { strictly '2.4.0-alpha01' }
},
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/extras/constraint-layout-x/Android.bp#30
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-12.0.0_r2/current/extras/constraint-layout-x/Android.bp#39
androidx_constraintlayout: dependencies.create('androidx.constraintlayout:constraintlayout') {
version { strictly '2.0.0-beta7' }
},
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/androidx/Android.bp#708
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-12.0.0_r2/current/androidx/Android.bp#969
androidx_documentfile: dependencies.create('androidx.documentfile:documentfile') {
version { strictly '1.0.1' } // should be 1.1.0-alpha01, but that is not even released, yet
version { strictly '1.1.0-alpha01' }
},
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/extras/material-design-x/Android.bp#6
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-12.0.0_r2/current/extras/material-design-x/Android.bp#6
com_google_android_material: dependencies.create('com.google.android.material:material') {
version { strictly '1.1.0-alpha05' }
version { strictly '1.4.0' }
},
]
ext.lint_libs = [
exceptions: 'com.github.thirdegg:lint-rules:0.0.7-beta'
exceptions: 'com.github.thirdegg:lint-rules:0.0.6-beta'
]
ext.storage_libs = [
// https://android.googlesource.com/platform/prebuilts/sdk/+/refs/tags/android-11.0.0_r3/current/androidx/Android.bp#2711
androidx_room_runtime: dependencies.create('androidx.room:room-runtime') {
version { strictly "$room_version" }
},
// http://aosp.opersys.com/xref/android-11.0.0_r27/xref/external/protobuf/java/pom.xml#7
com_google_protobuf_javalite: dependencies.create('com.google.protobuf:protobuf-javalite') {
version { strictly "$protobuf_version" }
},
com_google_crypto_tink_android: dependencies.create('com.google.crypto.tink:tink-android') {
version { strictly '1.5.0' }
version { strictly '1.6.1' }
},
]

View file

@ -1,11 +1,11 @@
ktlint {
version = "0.40.0"
version = "0.42.1"
android = true
enableExperimentalRules = false
verbose = true
disabledRules = [
"import-ordering",
"no-blank-line-before-rbrace",
"indent", // remove in 0.41 https://github.com/pinterest/ktlint/issues/764
"indent",
]
}

View file

@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
distributionSha256Sum=22449f5231796abd892c98b2a07c9ceebe4688d192cd2d6763f8e3bf8acbedeb
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionSha256Sum=a8da5b02437a60819cad23e10fc7e9cf32bcb57029d9cb277e26eeff76ce014b

View file

@ -1,17 +1,11 @@
android_library_import {
name: "seedvault-lib-koin-androidx-viewmodel",
aars: ["koin-androidx-viewmodel-2.1.1.aar"],
sdk_version: "current",
}
android_library_import {
name: "seedvault-lib-koin-android",
aars: ["koin-android-2.1.1.aar"],
aars: ["koin-android-3.1.2.aar"],
sdk_version: "current",
}
java_import {
name: "seedvault-lib-koin-core",
jars: ["koin-core-2.1.1.jar"],
name: "seedvault-lib-koin-core-jvm",
jars: ["koin-core-jvm-3.1.2.jar"],
sdk_version: "current",
}

Binary file not shown.

Binary file not shown.

View file

@ -34,6 +34,10 @@ android {
jvmTarget = '1.8'
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
lintOptions {
disable "DialogFragmentCallbacksDetector",
"InvalidFragmentVersionForActivityResult"
}
packagingOptions {
exclude 'META-INF/*.kotlin_module'
exclude 'META-INF/androidx.*.version'
@ -45,9 +49,12 @@ android {
dependencies {
implementation project(':storage:lib')
implementation rootProject.ext.kotlin_libs.std
implementation rootProject.ext.std_libs.androidx_core
// A newer version gets pulled in with AOSP via core, so we include fragment here explicitly
implementation rootProject.ext.std_libs.androidx_fragment
implementation rootProject.ext.std_libs.androidx_activity
implementation rootProject.ext.std_libs.androidx_lifecycle_viewmodel_ktx
implementation rootProject.ext.std_libs.androidx_lifecycle_livedata_ktx
implementation rootProject.ext.std_libs.androidx_constraintlayout

View file

@ -11,7 +11,9 @@
android:supportsRtl="true"
android:theme="@style/Theme.StorageBackupTester">
<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

View file

@ -10,6 +10,6 @@ android_library_import {
java_import {
name: "seedvault-lib-tink-android",
jars: ["libs/tink-android-1.5.0.jar"],
jars: ["libs/tink-android-1.6.1.jar"],
sdk_version: "current",
}

View file

@ -3,7 +3,7 @@ plugins {
id 'com.google.protobuf'
id 'kotlin-android'
id 'kotlin-kapt'
id "org.jlleitschuh.gradle.ktlint" version "9.4.0"
id "org.jlleitschuh.gradle.ktlint" version "10.2.0"
id 'org.jetbrains.dokka' version '1.4.20'
}
@ -14,8 +14,6 @@ android {
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "0.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments disableAnalytics: 'true'
@ -40,6 +38,7 @@ android {
}
kotlinOptions {
jvmTarget = '1.8'
languageVersion = "1.4"
freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn'
freeCompilerArgs += '-Xexplicit-api=strict'
}
@ -57,6 +56,11 @@ android {
}
}
}
lintOptions {
disable "DialogFragmentCallbacksDetector",
"InvalidFragmentVersionForActivityResult",
"CheckedExceptions"
}
}
kotlin {
@ -64,11 +68,12 @@ kotlin {
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation rootProject.ext.kotlin_libs.std
implementation rootProject.ext.std_libs.androidx_core
// A newer version gets pulled in with AOSP via core, so we include fragment here explicitly
implementation rootProject.ext.std_libs.androidx_fragment
implementation rootProject.ext.std_libs.androidx_activity
implementation rootProject.ext.std_libs.androidx_lifecycle_viewmodel_ktx
implementation rootProject.ext.std_libs.androidx_lifecycle_livedata_ktx
implementation rootProject.ext.std_libs.androidx_constraintlayout
@ -88,7 +93,7 @@ dependencies {
testImplementation "io.mockk:mockk:$mockk_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version"
}

Binary file not shown.