From c3be4212fa899581ece7cb516c9a8e7f7bb067f0 Mon Sep 17 00:00:00 2001 From: Aleksey Ivanovsky Date: Sat, 20 Jul 2024 23:43:18 +0200 Subject: [PATCH 1/9] Add automation build type --- app/build.gradle | 10 ++++- app/src/automation/AndroidManifest.xml | 14 ++++++ .../passnotes/injection/DebugModuleBuilder.kt | 44 +++++++++++++++++++ .../file/entity/StorageDestinationType.kt | 6 --- .../passnotes/injection/DebugModuleBuilder.kt | 6 +-- .../file/fake}/DatabaseContentFactory.kt | 2 +- .../file/fake}/DebugFileSystemResolver.kt | 6 ++- .../file/fake}/FakeDatabaseContentFactory.kt | 2 +- .../repository/file/fake}/FakeFileFactory.kt | 20 ++++----- .../file/fake}/FakeFileOutputStream.kt | 2 +- .../repository/file/fake}/FakeFileStorage.kt | 12 ++--- .../file/fake}/FakeFileSystemAuthenticator.kt | 4 +- .../file/fake}/FakeFileSystemProvider.kt | 11 +++-- .../file/fake}/FakeFileSystemSyncProcessor.kt | 18 ++++---- .../data/repository/file/fake}/Utils.kt | 2 +- .../file/fake}/delay/ThreadThrottler.kt | 2 +- .../file/fake}/delay/ThreadThrottlerImpl.kt | 4 +- .../file/fake}/entity/FakeStorageEntry.kt | 4 +- .../fake/entity/StorageDestinationType.kt | 6 +++ .../domain/test/TestDataBroadcastReceiver.kt | 0 .../domain/test/TestDataInteractor.kt | 0 .../passnotes/domain/test/TestDataParser.kt | 0 .../biometric/ClearTextBiometricDecoder.kt | 2 +- .../biometric/ClearTextBiometricEncoder.kt | 2 +- .../FakeBiometricAuthenticatorImpl.kt | 3 +- .../biometric/FakeBiometricInteractorImpl.kt | 3 +- .../domain/test/entity/TestArguments.kt | 0 .../test/usecases/ResetAppDataUseCase.kt | 0 .../test/usecases/ResetTestDataUseCase.kt | 0 .../test/usecases/SetupFakeFileUseCase.kt | 4 +- .../usecases/SetupTestAutofillDataUseCase.kt | 0 .../extensions/FileSystemProviderExt.kt | 0 .../debug}/DebugFileSystemProvidersModule.kt | 8 ++-- .../injection/modules/debug}/DebugModule.kt | 2 +- .../modules/debug}/FakeBiometricModule.kt | 6 +-- .../navigation/NavigationMenuViewModel.kt | 2 +- 36 files changed, 143 insertions(+), 64 deletions(-) create mode 100644 app/src/automation/AndroidManifest.xml create mode 100644 app/src/automation/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt delete mode 100644 app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/entity/StorageDestinationType.kt rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/DatabaseContentFactory.kt (54%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/DebugFileSystemResolver.kt (73%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/FakeDatabaseContentFactory.kt (99%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/FakeFileFactory.kt (90%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/FakeFileOutputStream.kt (95%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/FakeFileStorage.kt (89%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/FakeFileSystemAuthenticator.kt (84%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/FakeFileSystemProvider.kt (91%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/FakeFileSystemSyncProcessor.kt (88%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/Utils.kt (92%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/delay/ThreadThrottler.kt (74%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/delay/ThreadThrottlerImpl.kt (73%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/data/repository/file => main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake}/entity/FakeStorageEntry.kt (72%) create mode 100644 app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/entity/StorageDestinationType.kt rename app/src/{debug => main}/kotlin/com/ivanovsky/passnotes/domain/test/TestDataBroadcastReceiver.kt (100%) rename app/src/{debug => main}/kotlin/com/ivanovsky/passnotes/domain/test/TestDataInteractor.kt (100%) rename app/src/{debug => main}/kotlin/com/ivanovsky/passnotes/domain/test/TestDataParser.kt (100%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/domain => main/kotlin/com/ivanovsky/passnotes/domain/test}/biometric/ClearTextBiometricDecoder.kt (85%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/domain => main/kotlin/com/ivanovsky/passnotes/domain/test}/biometric/ClearTextBiometricEncoder.kt (91%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/domain => main/kotlin/com/ivanovsky/passnotes/domain/test}/biometric/FakeBiometricAuthenticatorImpl.kt (94%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/domain => main/kotlin/com/ivanovsky/passnotes/domain/test}/biometric/FakeBiometricInteractorImpl.kt (93%) rename app/src/{debug => main}/kotlin/com/ivanovsky/passnotes/domain/test/entity/TestArguments.kt (100%) rename app/src/{debug => main}/kotlin/com/ivanovsky/passnotes/domain/test/usecases/ResetAppDataUseCase.kt (100%) rename app/src/{debug => main}/kotlin/com/ivanovsky/passnotes/domain/test/usecases/ResetTestDataUseCase.kt (100%) rename app/src/{debug => main}/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupFakeFileUseCase.kt (96%) rename app/src/{debug => main}/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupTestAutofillDataUseCase.kt (100%) rename app/src/{debug => main}/kotlin/com/ivanovsky/passnotes/extensions/FileSystemProviderExt.kt (100%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/injection/modules => main/kotlin/com/ivanovsky/passnotes/injection/modules/debug}/DebugFileSystemProvidersModule.kt (78%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/injection/modules => main/kotlin/com/ivanovsky/passnotes/injection/modules/debug}/DebugModule.kt (93%) rename app/src/{debug/kotlin/com/ivanovsky/passnotes/injection/modules => main/kotlin/com/ivanovsky/passnotes/injection/modules/debug}/FakeBiometricModule.kt (64%) diff --git a/app/build.gradle b/app/build.gradle index 42601281..9d1c9062 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -154,9 +154,15 @@ android { versionNameSuffix 'd' signingConfig signingConfigs.debug } - release { + automation { + debuggable true minifyEnabled false + signingConfig signingConfigs.debug + applicationIdSuffix '.automation' + } + release { debuggable false + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } @@ -314,7 +320,7 @@ dependencies { // KeePass implementation "com.github.anvell:kotpass:$kotpassVersion" implementation "com.github.aivanovski:keepass-tree-diff:$treeDiffVersion" - debugImplementation "com.github.aivanovski:keepass-tree-builder:$treeBuilderVersion" + implementation "com.github.aivanovski:keepass-tree-builder:$treeBuilderVersion" // Fuzzy search implementation "com.github.aivanovski:fzf4j:$fzf4jVersion" diff --git a/app/src/automation/AndroidManifest.xml b/app/src/automation/AndroidManifest.xml new file mode 100644 index 00000000..56ded63f --- /dev/null +++ b/app/src/automation/AndroidManifest.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/automation/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt b/app/src/automation/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt new file mode 100644 index 00000000..f3491b41 --- /dev/null +++ b/app/src/automation/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt @@ -0,0 +1,44 @@ +package com.ivanovsky.passnotes.injection + +import android.content.Context +import com.ivanovsky.passnotes.data.repository.settings.Settings +import com.ivanovsky.passnotes.domain.LoggerInteractor +import com.ivanovsky.passnotes.injection.modules.BiometricModule +import com.ivanovsky.passnotes.injection.modules.CoreModule +import com.ivanovsky.passnotes.injection.modules.debug.DebugFileSystemProvidersModule +import com.ivanovsky.passnotes.injection.modules.debug.DebugModule +import com.ivanovsky.passnotes.injection.modules.debug.FakeBiometricModule +import com.ivanovsky.passnotes.injection.modules.UiModule +import com.ivanovsky.passnotes.injection.modules.UseCaseModule +import org.koin.core.module.Module + +// Is loaded via reflection in App.kt +class DebugModuleBuilder( + private val context: Context, + private val loggerInteractor: LoggerInteractor, + private val settings: Settings +) : DIModuleBuilder { + + override var isExternalStorageAccessEnabled: Boolean = false + + override fun buildModules(): List { + val isLoadFakeBiometricModule = settings.testToggles?.isFakeBiometricEnabled ?: false + val isFakeFileSystemEnabled = settings.testToggles?.isFakeFileSystemEnabled ?: false + + return listOf( + CoreModule.build(loggerInteractor), + DebugModule.build(), + DebugFileSystemProvidersModule.build( + isExternalStorageAccessEnabled = isExternalStorageAccessEnabled, + isFakeFileSystemEnabled = isFakeFileSystemEnabled + ), + if (isLoadFakeBiometricModule) { + FakeBiometricModule.build() + } else { + BiometricModule.build() + }, + UseCaseModule.build(), + UiModule.build() + ) + } +} \ No newline at end of file diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/entity/StorageDestinationType.kt b/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/entity/StorageDestinationType.kt deleted file mode 100644 index 86c9b516..00000000 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/entity/StorageDestinationType.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.ivanovsky.passnotes.data.repository.file.entity - -enum class StorageDestinationType { - LOCAL, - REMOTE -} \ No newline at end of file diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt b/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt index 33fdee80..f3491b41 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt +++ b/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt @@ -5,9 +5,9 @@ import com.ivanovsky.passnotes.data.repository.settings.Settings import com.ivanovsky.passnotes.domain.LoggerInteractor import com.ivanovsky.passnotes.injection.modules.BiometricModule import com.ivanovsky.passnotes.injection.modules.CoreModule -import com.ivanovsky.passnotes.injection.modules.DebugFileSystemProvidersModule -import com.ivanovsky.passnotes.injection.modules.DebugModule -import com.ivanovsky.passnotes.injection.modules.FakeBiometricModule +import com.ivanovsky.passnotes.injection.modules.debug.DebugFileSystemProvidersModule +import com.ivanovsky.passnotes.injection.modules.debug.DebugModule +import com.ivanovsky.passnotes.injection.modules.debug.FakeBiometricModule import com.ivanovsky.passnotes.injection.modules.UiModule import com.ivanovsky.passnotes.injection.modules.UseCaseModule import org.koin.core.module.Module diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/DatabaseContentFactory.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/DatabaseContentFactory.kt similarity index 54% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/DatabaseContentFactory.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/DatabaseContentFactory.kt index 748cf3d5..a7561474 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/DatabaseContentFactory.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/DatabaseContentFactory.kt @@ -1,4 +1,4 @@ -package com.ivanovsky.passnotes.data.repository.file +package com.ivanovsky.passnotes.data.repository.file.fake fun interface DatabaseContentFactory { fun create(): ByteArray diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/DebugFileSystemResolver.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/DebugFileSystemResolver.kt similarity index 73% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/DebugFileSystemResolver.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/DebugFileSystemResolver.kt index 32dec43a..ad03e21c 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/DebugFileSystemResolver.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/DebugFileSystemResolver.kt @@ -1,9 +1,11 @@ -package com.ivanovsky.passnotes.data.repository.file +package com.ivanovsky.passnotes.data.repository.file.fake import com.ivanovsky.passnotes.data.ObserverBus import com.ivanovsky.passnotes.data.entity.FSAuthority import com.ivanovsky.passnotes.data.entity.FSType -import com.ivanovsky.passnotes.data.repository.file.delay.ThreadThrottlerImpl +import com.ivanovsky.passnotes.data.repository.file.FileSystemProvider +import com.ivanovsky.passnotes.data.repository.file.FileSystemResolver +import com.ivanovsky.passnotes.data.repository.file.fake.delay.ThreadThrottlerImpl import com.ivanovsky.passnotes.injection.GlobalInjector class DebugFileSystemResolver( diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeDatabaseContentFactory.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeDatabaseContentFactory.kt similarity index 99% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeDatabaseContentFactory.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeDatabaseContentFactory.kt index 1e275965..31e868df 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeDatabaseContentFactory.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeDatabaseContentFactory.kt @@ -1,4 +1,4 @@ -package com.ivanovsky.passnotes.data.repository.file +package com.ivanovsky.passnotes.data.repository.file.fake import android.util.Base64 import com.github.aivanovski.keepasstreebuilder.DatabaseBuilderDsl diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileFactory.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileFactory.kt similarity index 90% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileFactory.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileFactory.kt index 23f3cec4..35275221 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileFactory.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileFactory.kt @@ -1,17 +1,17 @@ -package com.ivanovsky.passnotes.data.repository.file +package com.ivanovsky.passnotes.data.repository.file.fake import com.ivanovsky.passnotes.data.entity.FSAuthority import com.ivanovsky.passnotes.data.entity.FileDescriptor import com.ivanovsky.passnotes.data.entity.SyncStatus -import com.ivanovsky.passnotes.data.repository.file.FakeDatabaseContentFactory.createDatabaseWithAttachmentsData -import com.ivanovsky.passnotes.data.repository.file.FakeDatabaseContentFactory.createDatabaseWithCombinedKey -import com.ivanovsky.passnotes.data.repository.file.FakeDatabaseContentFactory.createDatabaseWithExpiredData -import com.ivanovsky.passnotes.data.repository.file.FakeDatabaseContentFactory.createDatabaseWithHistoryData -import com.ivanovsky.passnotes.data.repository.file.FakeDatabaseContentFactory.createDatabaseWithKeyFile -import com.ivanovsky.passnotes.data.repository.file.FakeDatabaseContentFactory.createDatabaseWithOtpData -import com.ivanovsky.passnotes.data.repository.file.FakeDatabaseContentFactory.createDemoDatabase -import com.ivanovsky.passnotes.data.repository.file.FakeDatabaseContentFactory.createKeyFileData -import com.ivanovsky.passnotes.data.repository.file.entity.FakeStorageEntry +import com.ivanovsky.passnotes.data.repository.file.fake.FakeDatabaseContentFactory.createDatabaseWithAttachmentsData +import com.ivanovsky.passnotes.data.repository.file.fake.FakeDatabaseContentFactory.createDatabaseWithCombinedKey +import com.ivanovsky.passnotes.data.repository.file.fake.FakeDatabaseContentFactory.createDatabaseWithExpiredData +import com.ivanovsky.passnotes.data.repository.file.fake.FakeDatabaseContentFactory.createDatabaseWithHistoryData +import com.ivanovsky.passnotes.data.repository.file.fake.FakeDatabaseContentFactory.createDatabaseWithKeyFile +import com.ivanovsky.passnotes.data.repository.file.fake.FakeDatabaseContentFactory.createDatabaseWithOtpData +import com.ivanovsky.passnotes.data.repository.file.fake.FakeDatabaseContentFactory.createDemoDatabase +import com.ivanovsky.passnotes.data.repository.file.fake.FakeDatabaseContentFactory.createKeyFileData +import com.ivanovsky.passnotes.data.repository.file.fake.entity.FakeStorageEntry import com.ivanovsky.passnotes.util.FileUtils class FakeFileFactory( diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileOutputStream.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileOutputStream.kt similarity index 95% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileOutputStream.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileOutputStream.kt index 6cf89752..ffea1c19 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileOutputStream.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileOutputStream.kt @@ -1,4 +1,4 @@ -package com.ivanovsky.passnotes.data.repository.file +package com.ivanovsky.passnotes.data.repository.file.fake import java.io.ByteArrayOutputStream import java.io.IOException diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileStorage.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileStorage.kt similarity index 89% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileStorage.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileStorage.kt index 612c2084..b9d39b00 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileStorage.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileStorage.kt @@ -1,11 +1,13 @@ -package com.ivanovsky.passnotes.data.repository.file +package com.ivanovsky.passnotes.data.repository.file.fake import com.ivanovsky.passnotes.data.entity.FileDescriptor import com.ivanovsky.passnotes.data.entity.SyncStatus -import com.ivanovsky.passnotes.data.repository.file.entity.FakeStorageEntry -import com.ivanovsky.passnotes.data.repository.file.entity.StorageDestinationType -import com.ivanovsky.passnotes.data.repository.file.entity.StorageDestinationType.LOCAL -import com.ivanovsky.passnotes.data.repository.file.entity.StorageDestinationType.REMOTE +import com.ivanovsky.passnotes.data.repository.file.FSOptions +import com.ivanovsky.passnotes.data.repository.file.FileSystemAuthenticator +import com.ivanovsky.passnotes.data.repository.file.fake.entity.FakeStorageEntry +import com.ivanovsky.passnotes.data.repository.file.fake.entity.StorageDestinationType +import com.ivanovsky.passnotes.data.repository.file.fake.entity.StorageDestinationType.LOCAL +import com.ivanovsky.passnotes.data.repository.file.fake.entity.StorageDestinationType.REMOTE import com.ivanovsky.passnotes.util.FileUtils.getParentPath import timber.log.Timber diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileSystemAuthenticator.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileSystemAuthenticator.kt similarity index 84% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileSystemAuthenticator.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileSystemAuthenticator.kt index a23603cf..c5d1986a 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileSystemAuthenticator.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileSystemAuthenticator.kt @@ -1,8 +1,10 @@ -package com.ivanovsky.passnotes.data.repository.file +package com.ivanovsky.passnotes.data.repository.file.fake import android.content.Context import com.ivanovsky.passnotes.data.entity.FSAuthority import com.ivanovsky.passnotes.data.entity.FSCredentials +import com.ivanovsky.passnotes.data.repository.file.AuthType +import com.ivanovsky.passnotes.data.repository.file.FileSystemAuthenticator import com.ivanovsky.passnotes.data.repository.file.exception.IncorrectUseException import java.util.concurrent.atomic.AtomicReference diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileSystemProvider.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileSystemProvider.kt similarity index 91% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileSystemProvider.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileSystemProvider.kt index fad13089..3c20d367 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileSystemProvider.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileSystemProvider.kt @@ -1,4 +1,4 @@ -package com.ivanovsky.passnotes.data.repository.file +package com.ivanovsky.passnotes.data.repository.file.fake import com.ivanovsky.passnotes.data.ObserverBus import com.ivanovsky.passnotes.data.entity.FSAuthority @@ -8,8 +8,13 @@ import com.ivanovsky.passnotes.data.entity.FileDescriptor import com.ivanovsky.passnotes.data.entity.OperationError import com.ivanovsky.passnotes.data.entity.OperationError.GENERIC_MESSAGE_FAILED_TO_FIND_FILE import com.ivanovsky.passnotes.data.entity.OperationResult -import com.ivanovsky.passnotes.data.repository.file.delay.ThreadThrottler -import com.ivanovsky.passnotes.data.repository.file.entity.StorageDestinationType +import com.ivanovsky.passnotes.data.repository.file.FSOptions +import com.ivanovsky.passnotes.data.repository.file.FileSystemAuthenticator +import com.ivanovsky.passnotes.data.repository.file.FileSystemProvider +import com.ivanovsky.passnotes.data.repository.file.FileSystemSyncProcessor +import com.ivanovsky.passnotes.data.repository.file.OnConflictStrategy +import com.ivanovsky.passnotes.data.repository.file.fake.delay.ThreadThrottler +import com.ivanovsky.passnotes.data.repository.file.fake.entity.StorageDestinationType import com.ivanovsky.passnotes.util.FileUtils import java.io.ByteArrayInputStream import java.io.FileNotFoundException diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileSystemSyncProcessor.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileSystemSyncProcessor.kt similarity index 88% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileSystemSyncProcessor.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileSystemSyncProcessor.kt index 25c1dba8..eebffe9d 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/FakeFileSystemSyncProcessor.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/FakeFileSystemSyncProcessor.kt @@ -1,4 +1,4 @@ -package com.ivanovsky.passnotes.data.repository.file +package com.ivanovsky.passnotes.data.repository.file.fake import com.ivanovsky.passnotes.data.ObserverBus import com.ivanovsky.passnotes.data.entity.ConflictResolutionStrategy @@ -14,13 +14,15 @@ import com.ivanovsky.passnotes.data.entity.SyncConflictInfo import com.ivanovsky.passnotes.data.entity.SyncProgressStatus import com.ivanovsky.passnotes.data.entity.SyncResolution import com.ivanovsky.passnotes.data.entity.SyncStatus -import com.ivanovsky.passnotes.data.repository.file.FakeFileFactory.FileUid -import com.ivanovsky.passnotes.data.repository.file.delay.ThreadThrottler -import com.ivanovsky.passnotes.data.repository.file.delay.ThreadThrottler.Type.LONG_DELAY -import com.ivanovsky.passnotes.data.repository.file.delay.ThreadThrottler.Type.MEDIUM_DELAY -import com.ivanovsky.passnotes.data.repository.file.delay.ThreadThrottler.Type.SHORT_DELAY -import com.ivanovsky.passnotes.data.repository.file.entity.StorageDestinationType.LOCAL -import com.ivanovsky.passnotes.data.repository.file.entity.StorageDestinationType.REMOTE +import com.ivanovsky.passnotes.data.repository.file.FileSystemSyncProcessor +import com.ivanovsky.passnotes.data.repository.file.SyncStrategy +import com.ivanovsky.passnotes.data.repository.file.fake.FakeFileFactory.FileUid +import com.ivanovsky.passnotes.data.repository.file.fake.delay.ThreadThrottler +import com.ivanovsky.passnotes.data.repository.file.fake.delay.ThreadThrottler.Type.LONG_DELAY +import com.ivanovsky.passnotes.data.repository.file.fake.delay.ThreadThrottler.Type.MEDIUM_DELAY +import com.ivanovsky.passnotes.data.repository.file.fake.delay.ThreadThrottler.Type.SHORT_DELAY +import com.ivanovsky.passnotes.data.repository.file.fake.entity.StorageDestinationType.LOCAL +import com.ivanovsky.passnotes.data.repository.file.fake.entity.StorageDestinationType.REMOTE import com.ivanovsky.passnotes.domain.SyncStrategyResolver import timber.log.Timber diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/Utils.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/Utils.kt similarity index 92% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/Utils.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/Utils.kt index 29fb476d..078274e6 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/Utils.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/Utils.kt @@ -1,4 +1,4 @@ -package com.ivanovsky.passnotes.data.repository.file +package com.ivanovsky.passnotes.data.repository.file.fake import java.text.SimpleDateFormat import java.time.Instant diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/delay/ThreadThrottler.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/delay/ThreadThrottler.kt similarity index 74% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/delay/ThreadThrottler.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/delay/ThreadThrottler.kt index 8f7db71f..84f5e122 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/delay/ThreadThrottler.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/delay/ThreadThrottler.kt @@ -1,4 +1,4 @@ -package com.ivanovsky.passnotes.data.repository.file.delay +package com.ivanovsky.passnotes.data.repository.file.fake.delay interface ThreadThrottler { diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/delay/ThreadThrottlerImpl.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/delay/ThreadThrottlerImpl.kt similarity index 73% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/delay/ThreadThrottlerImpl.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/delay/ThreadThrottlerImpl.kt index 498ca81c..77423a41 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/delay/ThreadThrottlerImpl.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/delay/ThreadThrottlerImpl.kt @@ -1,6 +1,6 @@ -package com.ivanovsky.passnotes.data.repository.file.delay +package com.ivanovsky.passnotes.data.repository.file.fake.delay -import com.ivanovsky.passnotes.data.repository.file.delay.ThreadThrottler.Type +import com.ivanovsky.passnotes.data.repository.file.fake.delay.ThreadThrottler.Type class ThreadThrottlerImpl : ThreadThrottler { diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/entity/FakeStorageEntry.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/entity/FakeStorageEntry.kt similarity index 72% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/entity/FakeStorageEntry.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/entity/FakeStorageEntry.kt index 3afade7a..bde1c237 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/data/repository/file/entity/FakeStorageEntry.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/entity/FakeStorageEntry.kt @@ -1,8 +1,8 @@ -package com.ivanovsky.passnotes.data.repository.file.entity +package com.ivanovsky.passnotes.data.repository.file.fake.entity import com.ivanovsky.passnotes.data.entity.FileDescriptor import com.ivanovsky.passnotes.data.entity.SyncStatus -import com.ivanovsky.passnotes.data.repository.file.DatabaseContentFactory +import com.ivanovsky.passnotes.data.repository.file.fake.DatabaseContentFactory data class FakeStorageEntry( val localFile: FileDescriptor, diff --git a/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/entity/StorageDestinationType.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/entity/StorageDestinationType.kt new file mode 100644 index 00000000..da1da39d --- /dev/null +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/data/repository/file/fake/entity/StorageDestinationType.kt @@ -0,0 +1,6 @@ +package com.ivanovsky.passnotes.data.repository.file.fake.entity + +enum class StorageDestinationType { + LOCAL, + REMOTE +} \ No newline at end of file diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/TestDataBroadcastReceiver.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/TestDataBroadcastReceiver.kt similarity index 100% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/TestDataBroadcastReceiver.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/TestDataBroadcastReceiver.kt diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/TestDataInteractor.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/TestDataInteractor.kt similarity index 100% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/TestDataInteractor.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/TestDataInteractor.kt diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/TestDataParser.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/TestDataParser.kt similarity index 100% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/TestDataParser.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/TestDataParser.kt diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/ClearTextBiometricDecoder.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/ClearTextBiometricDecoder.kt similarity index 85% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/ClearTextBiometricDecoder.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/ClearTextBiometricDecoder.kt index 966fcee0..8c28f3f7 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/ClearTextBiometricDecoder.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/ClearTextBiometricDecoder.kt @@ -1,4 +1,4 @@ -package com.ivanovsky.passnotes.domain.biometric +package com.ivanovsky.passnotes.domain.test.biometric import com.ivanovsky.passnotes.data.crypto.biometric.BiometricDecoder import javax.crypto.Cipher diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/ClearTextBiometricEncoder.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/ClearTextBiometricEncoder.kt similarity index 91% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/ClearTextBiometricEncoder.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/ClearTextBiometricEncoder.kt index 888a08f5..74528d59 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/ClearTextBiometricEncoder.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/ClearTextBiometricEncoder.kt @@ -1,4 +1,4 @@ -package com.ivanovsky.passnotes.domain.biometric +package com.ivanovsky.passnotes.domain.test.biometric import com.ivanovsky.passnotes.data.crypto.biometric.BiometricEncoder import com.ivanovsky.passnotes.data.crypto.entity.SecretData diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/FakeBiometricAuthenticatorImpl.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/FakeBiometricAuthenticatorImpl.kt similarity index 94% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/FakeBiometricAuthenticatorImpl.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/FakeBiometricAuthenticatorImpl.kt index a174399d..b2cd56ea 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/FakeBiometricAuthenticatorImpl.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/FakeBiometricAuthenticatorImpl.kt @@ -1,4 +1,4 @@ -package com.ivanovsky.passnotes.domain.biometric +package com.ivanovsky.passnotes.domain.test.biometric import androidx.fragment.app.FragmentActivity import com.ivanovsky.passnotes.R @@ -6,6 +6,7 @@ import com.ivanovsky.passnotes.data.crypto.biometric.BiometricDataCipher import com.ivanovsky.passnotes.data.crypto.biometric.BiometricDecoder import com.ivanovsky.passnotes.data.crypto.biometric.BiometricEncoder import com.ivanovsky.passnotes.domain.ResourceProvider +import com.ivanovsky.passnotes.domain.biometric.BiometricAuthenticator import com.ivanovsky.passnotes.presentation.core.dialog.ConfirmationDialog import timber.log.Timber diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/FakeBiometricInteractorImpl.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/FakeBiometricInteractorImpl.kt similarity index 93% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/FakeBiometricInteractorImpl.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/FakeBiometricInteractorImpl.kt index 4b43f35e..05a982ec 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/biometric/FakeBiometricInteractorImpl.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/biometric/FakeBiometricInteractorImpl.kt @@ -1,10 +1,11 @@ -package com.ivanovsky.passnotes.domain.biometric +package com.ivanovsky.passnotes.domain.test.biometric import com.ivanovsky.passnotes.data.crypto.biometric.BiometricDecoder import com.ivanovsky.passnotes.data.crypto.biometric.BiometricEncoder import com.ivanovsky.passnotes.data.crypto.entity.BiometricData import com.ivanovsky.passnotes.data.entity.OperationError import com.ivanovsky.passnotes.data.entity.OperationResult +import com.ivanovsky.passnotes.domain.biometric.BiometricInteractor import java.util.concurrent.atomic.AtomicBoolean class FakeBiometricInteractorImpl : BiometricInteractor { diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/entity/TestArguments.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/entity/TestArguments.kt similarity index 100% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/entity/TestArguments.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/entity/TestArguments.kt diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/usecases/ResetAppDataUseCase.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/ResetAppDataUseCase.kt similarity index 100% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/usecases/ResetAppDataUseCase.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/ResetAppDataUseCase.kt diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/usecases/ResetTestDataUseCase.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/ResetTestDataUseCase.kt similarity index 100% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/usecases/ResetTestDataUseCase.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/ResetTestDataUseCase.kt diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupFakeFileUseCase.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupFakeFileUseCase.kt similarity index 96% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupFakeFileUseCase.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupFakeFileUseCase.kt index 3a196409..b3ec1a01 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupFakeFileUseCase.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupFakeFileUseCase.kt @@ -8,8 +8,8 @@ import com.ivanovsky.passnotes.data.entity.OperationResult import com.ivanovsky.passnotes.data.entity.TestToggles import com.ivanovsky.passnotes.data.entity.UsedFile import com.ivanovsky.passnotes.data.repository.UsedFileRepository -import com.ivanovsky.passnotes.data.repository.file.DebugFileSystemResolver -import com.ivanovsky.passnotes.data.repository.file.FakeFileSystemProvider +import com.ivanovsky.passnotes.data.repository.file.fake.DebugFileSystemResolver +import com.ivanovsky.passnotes.data.repository.file.fake.FakeFileSystemProvider import com.ivanovsky.passnotes.data.repository.file.FileSystemResolver import com.ivanovsky.passnotes.data.repository.settings.Settings import com.ivanovsky.passnotes.domain.DispatcherProvider diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupTestAutofillDataUseCase.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupTestAutofillDataUseCase.kt similarity index 100% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupTestAutofillDataUseCase.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupTestAutofillDataUseCase.kt diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/extensions/FileSystemProviderExt.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/extensions/FileSystemProviderExt.kt similarity index 100% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/extensions/FileSystemProviderExt.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/extensions/FileSystemProviderExt.kt diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/modules/DebugFileSystemProvidersModule.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/DebugFileSystemProvidersModule.kt similarity index 78% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/injection/modules/DebugFileSystemProvidersModule.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/DebugFileSystemProvidersModule.kt index 8e5e383c..94dc36a6 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/modules/DebugFileSystemProvidersModule.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/DebugFileSystemProvidersModule.kt @@ -1,11 +1,11 @@ -package com.ivanovsky.passnotes.injection.modules +package com.ivanovsky.passnotes.injection.modules.debug import com.ivanovsky.passnotes.data.ObserverBus import com.ivanovsky.passnotes.data.entity.FSType -import com.ivanovsky.passnotes.data.repository.file.DebugFileSystemResolver -import com.ivanovsky.passnotes.data.repository.file.FakeFileSystemProvider +import com.ivanovsky.passnotes.data.repository.file.fake.DebugFileSystemResolver +import com.ivanovsky.passnotes.data.repository.file.fake.FakeFileSystemProvider import com.ivanovsky.passnotes.data.repository.file.FileSystemResolver -import com.ivanovsky.passnotes.data.repository.file.delay.ThreadThrottlerImpl +import com.ivanovsky.passnotes.data.repository.file.fake.delay.ThreadThrottlerImpl import com.ivanovsky.passnotes.injection.GlobalInjector import org.koin.dsl.module diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/modules/DebugModule.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/DebugModule.kt similarity index 93% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/injection/modules/DebugModule.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/DebugModule.kt index c5e657d4..e52ec43b 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/modules/DebugModule.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/DebugModule.kt @@ -1,4 +1,4 @@ -package com.ivanovsky.passnotes.injection.modules +package com.ivanovsky.passnotes.injection.modules.debug import com.ivanovsky.passnotes.domain.test.TestDataInteractor import com.ivanovsky.passnotes.domain.test.usecases.ResetAppDataUseCase diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/modules/FakeBiometricModule.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/FakeBiometricModule.kt similarity index 64% rename from app/src/debug/kotlin/com/ivanovsky/passnotes/injection/modules/FakeBiometricModule.kt rename to app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/FakeBiometricModule.kt index 6ceda1c0..0b4b2e13 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/modules/FakeBiometricModule.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/FakeBiometricModule.kt @@ -1,9 +1,9 @@ -package com.ivanovsky.passnotes.injection.modules +package com.ivanovsky.passnotes.injection.modules.debug import com.ivanovsky.passnotes.domain.biometric.BiometricAuthenticator import com.ivanovsky.passnotes.domain.biometric.BiometricInteractor -import com.ivanovsky.passnotes.domain.biometric.FakeBiometricAuthenticatorImpl -import com.ivanovsky.passnotes.domain.biometric.FakeBiometricInteractorImpl +import com.ivanovsky.passnotes.domain.test.biometric.FakeBiometricAuthenticatorImpl +import com.ivanovsky.passnotes.domain.test.biometric.FakeBiometricInteractorImpl import org.koin.dsl.module object FakeBiometricModule { diff --git a/app/src/main/kotlin/com/ivanovsky/passnotes/presentation/main/navigation/NavigationMenuViewModel.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/presentation/main/navigation/NavigationMenuViewModel.kt index 7594199e..0c83a2cd 100644 --- a/app/src/main/kotlin/com/ivanovsky/passnotes/presentation/main/navigation/NavigationMenuViewModel.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/presentation/main/navigation/NavigationMenuViewModel.kt @@ -134,7 +134,7 @@ class NavigationMenuViewModel( val header = modelFactory.creteHeaderModel() val items = modelFactory.createMenuItemModels( isDatabaseOpened = isDbOpened, - isDebugMenuVisible = BuildConfig.DEBUG + isDebugMenuVisible = (BuildConfig.BUILD_TYPE == "debug") ) return viewModelFactory.createCellViewModels(header + items, eventProvider) From 476f9c1fd081308bcb3945616c9aeb81d505963e Mon Sep 17 00:00:00 2001 From: Aleksey Ivanovsky Date: Sat, 20 Jul 2024 23:49:05 +0200 Subject: [PATCH 2/9] Fix code style --- .../com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt | 4 ++-- .../com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt | 4 ++-- .../passnotes/domain/test/usecases/SetupFakeFileUseCase.kt | 2 +- .../injection/modules/debug/DebugFileSystemProvidersModule.kt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/automation/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt b/app/src/automation/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt index f3491b41..f4d0bb87 100644 --- a/app/src/automation/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt +++ b/app/src/automation/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt @@ -5,11 +5,11 @@ import com.ivanovsky.passnotes.data.repository.settings.Settings import com.ivanovsky.passnotes.domain.LoggerInteractor import com.ivanovsky.passnotes.injection.modules.BiometricModule import com.ivanovsky.passnotes.injection.modules.CoreModule +import com.ivanovsky.passnotes.injection.modules.UiModule +import com.ivanovsky.passnotes.injection.modules.UseCaseModule import com.ivanovsky.passnotes.injection.modules.debug.DebugFileSystemProvidersModule import com.ivanovsky.passnotes.injection.modules.debug.DebugModule import com.ivanovsky.passnotes.injection.modules.debug.FakeBiometricModule -import com.ivanovsky.passnotes.injection.modules.UiModule -import com.ivanovsky.passnotes.injection.modules.UseCaseModule import org.koin.core.module.Module // Is loaded via reflection in App.kt diff --git a/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt b/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt index f3491b41..f4d0bb87 100644 --- a/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt +++ b/app/src/debug/kotlin/com/ivanovsky/passnotes/injection/DebugModuleBuilder.kt @@ -5,11 +5,11 @@ import com.ivanovsky.passnotes.data.repository.settings.Settings import com.ivanovsky.passnotes.domain.LoggerInteractor import com.ivanovsky.passnotes.injection.modules.BiometricModule import com.ivanovsky.passnotes.injection.modules.CoreModule +import com.ivanovsky.passnotes.injection.modules.UiModule +import com.ivanovsky.passnotes.injection.modules.UseCaseModule import com.ivanovsky.passnotes.injection.modules.debug.DebugFileSystemProvidersModule import com.ivanovsky.passnotes.injection.modules.debug.DebugModule import com.ivanovsky.passnotes.injection.modules.debug.FakeBiometricModule -import com.ivanovsky.passnotes.injection.modules.UiModule -import com.ivanovsky.passnotes.injection.modules.UseCaseModule import org.koin.core.module.Module // Is loaded via reflection in App.kt diff --git a/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupFakeFileUseCase.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupFakeFileUseCase.kt index b3ec1a01..8832b5d7 100644 --- a/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupFakeFileUseCase.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/domain/test/usecases/SetupFakeFileUseCase.kt @@ -8,9 +8,9 @@ import com.ivanovsky.passnotes.data.entity.OperationResult import com.ivanovsky.passnotes.data.entity.TestToggles import com.ivanovsky.passnotes.data.entity.UsedFile import com.ivanovsky.passnotes.data.repository.UsedFileRepository +import com.ivanovsky.passnotes.data.repository.file.FileSystemResolver import com.ivanovsky.passnotes.data.repository.file.fake.DebugFileSystemResolver import com.ivanovsky.passnotes.data.repository.file.fake.FakeFileSystemProvider -import com.ivanovsky.passnotes.data.repository.file.FileSystemResolver import com.ivanovsky.passnotes.data.repository.settings.Settings import com.ivanovsky.passnotes.domain.DispatcherProvider import com.ivanovsky.passnotes.domain.ResourceProvider diff --git a/app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/DebugFileSystemProvidersModule.kt b/app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/DebugFileSystemProvidersModule.kt index 94dc36a6..4f3bfa97 100644 --- a/app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/DebugFileSystemProvidersModule.kt +++ b/app/src/main/kotlin/com/ivanovsky/passnotes/injection/modules/debug/DebugFileSystemProvidersModule.kt @@ -2,9 +2,9 @@ package com.ivanovsky.passnotes.injection.modules.debug import com.ivanovsky.passnotes.data.ObserverBus import com.ivanovsky.passnotes.data.entity.FSType +import com.ivanovsky.passnotes.data.repository.file.FileSystemResolver import com.ivanovsky.passnotes.data.repository.file.fake.DebugFileSystemResolver import com.ivanovsky.passnotes.data.repository.file.fake.FakeFileSystemProvider -import com.ivanovsky.passnotes.data.repository.file.FileSystemResolver import com.ivanovsky.passnotes.data.repository.file.fake.delay.ThreadThrottlerImpl import com.ivanovsky.passnotes.injection.GlobalInjector import org.koin.dsl.module From 9a19697e122f18479f5c2253e91f80b952948ea0 Mon Sep 17 00:00:00 2001 From: Aleksey Ivanovsky Date: Sun, 21 Jul 2024 21:19:24 +0200 Subject: [PATCH 3/9] Add matrix to pipeline --- .github/workflows/pipeline.yml | 221 ++++++++++++++++++--------------- 1 file changed, 124 insertions(+), 97 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 67c27aed..31033722 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -49,10 +49,13 @@ jobs: - name: Run tests run: ./gradlew app:test - build-gplay-debug: - name: Build Google Play debug + build-apks: + name: Build apks needs: [ check-code-style, run-tests ] runs-on: ubuntu-latest + strategy: + matrix: + buildType: [ GplayDebug, GplayRelease ] steps: - name: Checkout uses: actions/checkout@v3 @@ -69,98 +72,122 @@ jobs: - name: Build run: | - ./gradlew app:assembleGplayDebug - - - name: Store APK file - uses: actions/upload-artifact@v3 - with: - name: app-gplay-debug.apk - path: | - ./app/build/outputs/apk/gplay/debug/app-gplay-debug.apk - - build-gplay-release: - name: Build Google Play release - needs: [ check-code-style, run-tests ] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' - - - name: Decrypt and validate decrypted data - env: - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run: ./.github/workflows/decrypt-and-validate-data.sh - - - name: Build - run: | - ./gradlew app:assembleGplayRelease - - - name: Store APK file - uses: actions/upload-artifact@v3 - with: - name: app-gplay-release.apk - path: | - ./app/build/outputs/apk/gplay/release/app-gplay-release.apk - - build-fdroid-debug: - name: Build FDroid debug - needs: [ check-code-style, run-tests ] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' - - - name: Decrypt and validate decrypted data - env: - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run: ./.github/workflows/decrypt-and-validate-data.sh - - - name: Build - run: | - ./gradlew app:assembleFdroidDebug - - - name: Store APK file - uses: actions/upload-artifact@v3 - with: - name: app-fdroid-debug.apk - path: | - ./app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk - - build-fdroid-release: - name: Build FDroid release - needs: [ check-code-style, run-tests ] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' - - - name: Decrypt and validate decrypted data - env: - GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - run: ./.github/workflows/decrypt-and-validate-data.sh - - - name: Build - run: | - ./gradlew app:assembleFdroidRelease - - - name: Store APK file - uses: actions/upload-artifact@v3 - with: - name: app-fdroid-release.apk - path: | - ./app/build/outputs/apk/fdroid/release/app-fdroid-release.apk \ No newline at end of file + ./gradlew app:assemble${{ matrix.buildType }} + + +# +# build-gplay-debug: +# name: Build Google Play debug +# needs: [ check-code-style, run-tests ] +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - uses: actions/setup-java@v3 +# with: +# distribution: 'zulu' +# java-version: '17' +# +# - name: Decrypt and validate decrypted data +# env: +# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} +# run: ./.github/workflows/decrypt-and-validate-data.sh +# +# - name: Build +# run: | +# ./gradlew app:assembleGplayDebug +# +# - name: Store APK file +# uses: actions/upload-artifact@v3 +# with: +# name: app-gplay-debug.apk +# path: | +# ./app/build/outputs/apk/gplay/debug/app-gplay-debug.apk +# +# build-gplay-release: +# name: Build Google Play release +# needs: [ check-code-style, run-tests ] +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - uses: actions/setup-java@v3 +# with: +# distribution: 'zulu' +# java-version: '17' +# +# - name: Decrypt and validate decrypted data +# env: +# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} +# run: ./.github/workflows/decrypt-and-validate-data.sh +# +# - name: Build +# run: | +# ./gradlew app:assembleGplayRelease +# +# - name: Store APK file +# uses: actions/upload-artifact@v3 +# with: +# name: app-gplay-release.apk +# path: | +# ./app/build/outputs/apk/gplay/release/app-gplay-release.apk +# +# build-fdroid-debug: +# name: Build FDroid debug +# needs: [ check-code-style, run-tests ] +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - uses: actions/setup-java@v3 +# with: +# distribution: 'zulu' +# java-version: '17' +# +# - name: Decrypt and validate decrypted data +# env: +# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} +# run: ./.github/workflows/decrypt-and-validate-data.sh +# +# - name: Build +# run: | +# ./gradlew app:assembleFdroidDebug +# +# - name: Store APK file +# uses: actions/upload-artifact@v3 +# with: +# name: app-fdroid-debug.apk +# path: | +# ./app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk +# +# build-fdroid-release: +# name: Build FDroid release +# needs: [ check-code-style, run-tests ] +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - uses: actions/setup-java@v3 +# with: +# distribution: 'zulu' +# java-version: '17' +# +# - name: Decrypt and validate decrypted data +# env: +# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} +# run: ./.github/workflows/decrypt-and-validate-data.sh +# +# - name: Build +# run: | +# ./gradlew app:assembleFdroidRelease +# +# - name: Store APK file +# uses: actions/upload-artifact@v3 +# with: +# name: app-fdroid-release.apk +# path: | +# ./app/build/outputs/apk/fdroid/release/app-fdroid-release.apk \ No newline at end of file From 8e8673c46200bfe8e54bad623fc0e7f8003ca900 Mon Sep 17 00:00:00 2001 From: Aleksey Ivanovsky Date: Sun, 21 Jul 2024 21:38:29 +0200 Subject: [PATCH 4/9] Update --- .github/workflows/pipeline.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 31033722..49cf4b1f 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -49,8 +49,25 @@ jobs: - name: Run tests run: ./gradlew app:test + + print-matrix-data: + name: Print matrix data + runs-on: ubuntu-latest + strategy: + matrix: + include: + - command: assembleGplayDebug + filePath: ./app/build/outputs/apk/gplay/debug/app-gplay-debug.apk + steps: + - name: Print + run: | + echo "command=${{ matrix.command }}" + echo "filePath=${{ matrix.filePath }}" + + + build-apks: - name: Build apks + name: Build apk files needs: [ check-code-style, run-tests ] runs-on: ubuntu-latest strategy: @@ -74,6 +91,15 @@ jobs: run: | ./gradlew app:assemble${{ matrix.buildType }} + - name: Store APK file + uses: actions/upload-artifact@v3 + with: + name: app-gplay-debug.apk + path: | + + ./app/build/outputs/apk/gplay/debug/app-gplay-debug.apk + + # # build-gplay-debug: From d5f79e4e0774594a3d284f66c08b7a32a4d984c4 Mon Sep 17 00:00:00 2001 From: Aleksey Ivanovsky Date: Sun, 21 Jul 2024 21:41:31 +0200 Subject: [PATCH 5/9] Update --- .github/workflows/pipeline.yml | 139 +++------------------------------ 1 file changed, 13 insertions(+), 126 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 49cf4b1f..bf355276 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -64,15 +64,22 @@ jobs: echo "command=${{ matrix.command }}" echo "filePath=${{ matrix.filePath }}" - - build-apks: - name: Build apk files + name: Build and store apk files needs: [ check-code-style, run-tests ] runs-on: ubuntu-latest strategy: matrix: - buildType: [ GplayDebug, GplayRelease ] + include: + - command: assembleGplayDebug + filePath: ./app/build/outputs/apk/gplay/debug/app-gplay-debug.apk + - command: assembleGplayRelease + filePath: ./app/build/outputs/apk/gplay/release/app-gplay-release.apk + + - command: assembleFdroidDebug + filePath: ./app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk + - command: assembleFdroidRelease + filePath: ./app/build/outputs/apk/fdroid/release/app-fdroid-release.apk steps: - name: Checkout uses: actions/checkout@v3 @@ -89,131 +96,11 @@ jobs: - name: Build run: | - ./gradlew app:assemble${{ matrix.buildType }} + ./gradlew app:assemble${{ matrix.command }} - name: Store APK file uses: actions/upload-artifact@v3 with: name: app-gplay-debug.apk path: | - - ./app/build/outputs/apk/gplay/debug/app-gplay-debug.apk - - - -# -# build-gplay-debug: -# name: Build Google Play debug -# needs: [ check-code-style, run-tests ] -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# -# - uses: actions/setup-java@v3 -# with: -# distribution: 'zulu' -# java-version: '17' -# -# - name: Decrypt and validate decrypted data -# env: -# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} -# run: ./.github/workflows/decrypt-and-validate-data.sh -# -# - name: Build -# run: | -# ./gradlew app:assembleGplayDebug -# -# - name: Store APK file -# uses: actions/upload-artifact@v3 -# with: -# name: app-gplay-debug.apk -# path: | -# ./app/build/outputs/apk/gplay/debug/app-gplay-debug.apk -# -# build-gplay-release: -# name: Build Google Play release -# needs: [ check-code-style, run-tests ] -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# -# - uses: actions/setup-java@v3 -# with: -# distribution: 'zulu' -# java-version: '17' -# -# - name: Decrypt and validate decrypted data -# env: -# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} -# run: ./.github/workflows/decrypt-and-validate-data.sh -# -# - name: Build -# run: | -# ./gradlew app:assembleGplayRelease -# -# - name: Store APK file -# uses: actions/upload-artifact@v3 -# with: -# name: app-gplay-release.apk -# path: | -# ./app/build/outputs/apk/gplay/release/app-gplay-release.apk -# -# build-fdroid-debug: -# name: Build FDroid debug -# needs: [ check-code-style, run-tests ] -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# -# - uses: actions/setup-java@v3 -# with: -# distribution: 'zulu' -# java-version: '17' -# -# - name: Decrypt and validate decrypted data -# env: -# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} -# run: ./.github/workflows/decrypt-and-validate-data.sh -# -# - name: Build -# run: | -# ./gradlew app:assembleFdroidDebug -# -# - name: Store APK file -# uses: actions/upload-artifact@v3 -# with: -# name: app-fdroid-debug.apk -# path: | -# ./app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk -# -# build-fdroid-release: -# name: Build FDroid release -# needs: [ check-code-style, run-tests ] -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# -# - uses: actions/setup-java@v3 -# with: -# distribution: 'zulu' -# java-version: '17' -# -# - name: Decrypt and validate decrypted data -# env: -# GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} -# run: ./.github/workflows/decrypt-and-validate-data.sh -# -# - name: Build -# run: | -# ./gradlew app:assembleFdroidRelease -# -# - name: Store APK file -# uses: actions/upload-artifact@v3 -# with: -# name: app-fdroid-release.apk -# path: | -# ./app/build/outputs/apk/fdroid/release/app-fdroid-release.apk \ No newline at end of file + ${{ matrix.filePath }} \ No newline at end of file From 04b5b26439846d6a3a6676d750bc0d2e7bc43512 Mon Sep 17 00:00:00 2001 From: Aleksey Ivanovsky Date: Sun, 21 Jul 2024 21:54:10 +0200 Subject: [PATCH 6/9] Update CI config --- .github/workflows/pipeline.yml | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index bf355276..aefba49a 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -49,21 +49,6 @@ jobs: - name: Run tests run: ./gradlew app:test - - print-matrix-data: - name: Print matrix data - runs-on: ubuntu-latest - strategy: - matrix: - include: - - command: assembleGplayDebug - filePath: ./app/build/outputs/apk/gplay/debug/app-gplay-debug.apk - steps: - - name: Print - run: | - echo "command=${{ matrix.command }}" - echo "filePath=${{ matrix.filePath }}" - build-apks: name: Build and store apk files needs: [ check-code-style, run-tests ] @@ -72,13 +57,19 @@ jobs: matrix: include: - command: assembleGplayDebug + fileName: app-gplay-debug.apk filePath: ./app/build/outputs/apk/gplay/debug/app-gplay-debug.apk + - command: assembleGplayRelease + fileName: app-gplay-release.apk filePath: ./app/build/outputs/apk/gplay/release/app-gplay-release.apk - command: assembleFdroidDebug + fileName: app-fdroid-debug.apk filePath: ./app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk + - command: assembleFdroidRelease + fileName: app-fdroid-release.apk filePath: ./app/build/outputs/apk/fdroid/release/app-fdroid-release.apk steps: - name: Checkout @@ -96,11 +87,10 @@ jobs: - name: Build run: | - ./gradlew app:assemble${{ matrix.command }} + ./gradlew app:${{ matrix.command }} - name: Store APK file uses: actions/upload-artifact@v3 with: - name: app-gplay-debug.apk - path: | - ${{ matrix.filePath }} \ No newline at end of file + name: ${{ matrix.fileName }} + path: ${{ matrix.filePath }} \ No newline at end of file From 2365f9f5db9a3118f6c75877d771dc8f1e5be21e Mon Sep 17 00:00:00 2001 From: Aleksey Ivanovsky Date: Sat, 27 Jul 2024 13:55:28 +0200 Subject: [PATCH 7/9] Override app name and icon color for Automation build type --- app/build.gradle | 2 +- app/icons/icon-automation.svg | 74 ++++++++++++++++++++++++ app/src/automation/AndroidManifest.xml | 7 ++- app/src/automation/res/values/colors.xml | 5 ++ app/src/main/res/values/strings.xml | 1 + config.gradle | 2 +- 6 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 app/icons/icon-automation.svg create mode 100644 app/src/automation/res/values/colors.xml diff --git a/app/build.gradle b/app/build.gradle index 9d1c9062..4eec41b0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -107,7 +107,7 @@ android { } composeOptions { - kotlinCompilerExtensionVersion "1.5.4" + kotlinCompilerExtensionVersion "1.5.14" } kotlinOptions { diff --git a/app/icons/icon-automation.svg b/app/icons/icon-automation.svg new file mode 100644 index 00000000..2b0b6bb4 --- /dev/null +++ b/app/icons/icon-automation.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + diff --git a/app/src/automation/AndroidManifest.xml b/app/src/automation/AndroidManifest.xml index 56ded63f..8ae6413c 100644 --- a/app/src/automation/AndroidManifest.xml +++ b/app/src/automation/AndroidManifest.xml @@ -1,8 +1,11 @@ + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> - + + + #58e67e + #2c733f + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4844c0e8..c0c3c06e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,6 +2,7 @@ KeePassVault + KeePassVault Test WebDAV diff --git a/config.gradle b/config.gradle index 821806a0..8e7c0601 100644 --- a/config.gradle +++ b/config.gradle @@ -5,7 +5,7 @@ ext { compileSdk: 34 ] - kotlinVersion = '1.9.20' + kotlinVersion = '1.9.24' gradlePluginVersion = '8.2.2' playPublisherVersion = '3.9.1' spotlessVersion = '6.22.0' From a58442b069882dad3407259e7a531c2142cd2c24 Mon Sep 17 00:00:00 2001 From: Aleksey Ivanovsky Date: Sat, 27 Jul 2024 13:57:23 +0200 Subject: [PATCH 8/9] Update release CI pipeline --- .github/workflows/release.yml | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c129bf35..3c7f2f57 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,7 @@ jobs: runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') steps: - - name: Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: @@ -25,23 +24,15 @@ jobs: GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} run: ./.github/workflows/decrypt-and-validate-data.sh - - name: Build debug and release apk's + - name: Build apk's run: | - ./gradlew app:assembleFdroidDebug app:assembleFdroidRelease - - - name: Store debug apk - uses: actions/upload-artifact@v3 - with: - name: app-fdroid-debug.apk - path: | - ./app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk + ./gradlew app:assembleFdroidDebug app:assembleFdroidRelease app:assembleFdroidAutomation - - name: Store release apk - uses: actions/upload-artifact@v3 - with: - name: app-fdroid-release.apk - path: | - ./app/build/outputs/apk/fdroid/release/app-fdroid-release.apk + - name: Rename files + run: | + cp ./app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk ./keepassvault-debug.apk + cp ./app/build/outputs/apk/fdroid/release/app-fdroid-release.apk ./keepassvault-release.apk + cp ./app/build/outputs/apk/fdroid/automation/app-fdroid-automation.apk ./keepassvault-test.apk - name: Publish Github Release uses: softprops/action-gh-release@v2 @@ -49,8 +40,9 @@ jobs: generate_release_notes: true prerelease: true files: | - ./app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk - ./app/build/outputs/apk/fdroid/release/app-fdroid-release.apk + ./keepassvault-debug.apk + ./keepassvault-release.apk + ./keepassvault-test.apk upload-to-google-play: name: Upload App Bundle to Google Play From 820b64bae5fedd57e9bb1663c7e5d341818cccec Mon Sep 17 00:00:00 2001 From: Aleksey Ivanovsky Date: Sat, 27 Jul 2024 14:13:01 +0200 Subject: [PATCH 9/9] Add automation build to CI pipeline --- .github/workflows/pipeline.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index aefba49a..034bfdc7 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -71,6 +71,10 @@ jobs: - command: assembleFdroidRelease fileName: app-fdroid-release.apk filePath: ./app/build/outputs/apk/fdroid/release/app-fdroid-release.apk + + - command: assembleFdroidAutomation + fileName: app-fdroid-automation.apk + filePath: ./app/build/outputs/apk/fdroid/automation/app-fdroid-automation.apk steps: - name: Checkout uses: actions/checkout@v3