Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ android {
release {
isDebuggable = false
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("release")
}
}
Expand Down Expand Up @@ -259,9 +258,11 @@ dependencies {
androidTestImplementation(libs.truth)
androidTestImplementation(libs.kotlin.reflect)

// DI
implementation(libs.koin.android)
implementation(libs.koin.core)

// Room
implementation(libs.room.runtime)
ksp(libs.room.compiler)
androidTestImplementation(libs.room.testing)
Expand Down Expand Up @@ -289,29 +290,37 @@ dependencies {
implementation(libs.androidx.compose.ui.tooling.preview)
debugImplementation(libs.androidx.compose.ui.tooling)

implementation(libs.apache.commons.lang3)
implementation(libs.apache.commons.lang3) // TODO: Remove
implementation(libs.kotlin.stdlib)
implementation(libs.kotlin.reflect)
implementation(libs.kotlinx.coroutines.android)

// Network
implementation(libs.okhttp)
implementation(libs.okhttp.logging.interceptor)

implementation(libs.sardine.android)

// Git
implementation(libs.jgit)
implementation(libs.jgit.ssh.jsch)

// Routing
implementation(libs.cicerone)

// Logging
implementation(libs.timber)
implementation(libs.treessence)

implementation(libs.jgit)
implementation(libs.jgit.ssh.jsch)

// KeePass
implementation(libs.kotpass)
implementation(libs.keepass.tree.diff)
implementation(libs.keepass.tree.builder)

implementation(libs.fzf4j)
// Arrow
implementation(libs.arrowCore)
implementation(libs.arrowCoroutines)

// Other
implementation(libs.fzf4j)
implementation(libs.totp.kt)
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
package com.ivanovsky.passnotes.data.entity

import android.os.Parcelable
import java.util.Date
import java.util.UUID
import kotlinx.parcelize.Parcelize

/**
* Interface for [Group] and [Note]
*/
interface EncryptedDatabaseEntry : EncryptedDatabaseElement
sealed interface EncryptedDatabaseEntry : EncryptedDatabaseElement

@Parcelize
data class Note(
val uid: UUID? = null,
val groupUid: UUID,
val created: Date,
val modified: Date,
val expiration: Date?,
val title: String,
val properties: List<Property> = emptyList(),
val attachments: List<Attachment> = emptyList()
) : EncryptedDatabaseEntry, Parcelable

// TODO(Refactor): Remove groupCount and noteCount, it should be in standalone entity
@Parcelize
data class Group(
val uid: UUID,
val parentUid: UUID?,
val title: String,
val groupCount: Int,
val noteCount: Int,
val autotypeEnabled: InheritableBooleanOption,
val searchEnabled: InheritableBooleanOption
) : EncryptedDatabaseEntry, Parcelable
17 changes: 0 additions & 17 deletions app/src/main/kotlin/com/ivanovsky/passnotes/data/entity/Group.kt

This file was deleted.

18 changes: 0 additions & 18 deletions app/src/main/kotlin/com/ivanovsky/passnotes/data/entity/Note.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.ivanovsky.passnotes.data.repository.encdb

import java.util.UUID

interface EncryptedDatabaseConfig {
val isRecycleBinEnabled: Boolean
val recycleBinUid: UUID?
val maxHistoryItems: Int
fun toMutableConfig(): MutableEncryptedDatabaseConfig
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.ivanovsky.passnotes.data.repository.encdb

import java.util.UUID

data class MutableEncryptedDatabaseConfig(
override var isRecycleBinEnabled: Boolean,
override val recycleBinUid: UUID?,
override var maxHistoryItems: Int
) : EncryptedDatabaseConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,36 @@ object FakeDatabaseContentFactory {
return DatabaseBuilderDsl.newBuilder(KotpassDatabaseConverter())
.key(PASSWORD_KEY)
.content(ROOT) {
group(GROUP_EMAIL)
group(GROUP_EMAIL) {
entry(ENTRY_PROTON_MAIL)
entry(ENTRY_OUTLOOK)
}
group(GROUP_INTERNET) {
group(GROUP_CODING) {
entry(ENTRY_LEETCODE)
entry(ENTRY_NEETCODE)
entry(ENTRY_GITHUB)
entry(ENTRY_STACK_OVERFLOW)
entry(ENTRY_BITBUCKET)
}
group(GROUP_GAMING) {
entry(ENTRY_STADIA)
entry(ENTRY_STEAM)
}
group(GROUP_SHOPPING) {
entry(ENTRY_AMAZON)
entry(ENTRY_EBAY)
entry(ENTRY_ETSY)
}
group(GROUP_SOCIAL) {
entry(ENTRY_LINKEDIN)
entry(ENTRY_REDDIT)
}
group(GROUP_SOCIAL)

entry(ENTRY_GOOGLE)
entry(ENTRY_APPLE)
entry(ENTRY_MICROSOFT)
entry(ENTRY_DROPBOX)
}
entry(ENTRY_NAS_LOGIN)
entry(ENTRY_LAPTOP_LOGIN)
Expand Down Expand Up @@ -159,24 +171,36 @@ object FakeDatabaseContentFactory {
return DatabaseBuilderDsl.newBuilder(KotpassDatabaseConverter())
.key(PASSWORD_KEY)
.content(ROOT) {
group(GROUP_EMAIL)
group(GROUP_EMAIL) {
entry(ENTRY_PROTON_MAIL)
entry(ENTRY_OUTLOOK)
}
group(GROUP_INTERNET) {
group(GROUP_CODING) {
entry(ENTRY_LEETCODE)
entry(ENTRY_NEETCODE)
entry(ENTRY_GITHUB)
entry(ENTRY_STACK_OVERFLOW)
entry(ENTRY_BITBUCKET)
}
group(GROUP_GAMING) {
entry(ENTRY_STADIA)
entry(ENTRY_STEAM)
}
group(GROUP_SHOPPING) {
entry(newDemoAmazonEntry())
entry(ENTRY_EBAY)
entry(ENTRY_ETSY)
}
group(GROUP_SOCIAL) {
entry(ENTRY_LINKEDIN)
entry(ENTRY_REDDIT)
}
group(GROUP_SOCIAL)

entry(ENTRY_GOOGLE)
entry(ENTRY_APPLE)
entry(ENTRY_MICROSOFT)
entry(ENTRY_DROPBOX)
}
entry(ENTRY_NAS_LOGIN)
entry(ENTRY_LAPTOP_LOGIN)
Expand Down Expand Up @@ -504,6 +528,96 @@ object FakeDatabaseContentFactory {
)
)

private val ENTRY_PROTON_MAIL = newEntry(
title = "Proton Mail",
username = "john.doe@protonmail.com",
password = "abc123",
url = "https://mail.proton.me",
created = parseDate("2020-01-10"),
modified = parseDate("2020-01-10")
)

private val ENTRY_OUTLOOK = newEntry(
title = "Outlook",
username = "john.doe@outlook.com",
password = "abc123",
url = "https://outlook.live.com",
created = parseDate("2020-01-11"),
modified = parseDate("2020-01-11")
)

private val ENTRY_STACK_OVERFLOW = newEntry(
title = "Stack Overflow",
username = "john.doe@example.com",
password = "abc123",
url = "https://stackoverflow.com",
created = parseDate("2020-01-12"),
modified = parseDate("2020-01-12")
)

private val ENTRY_BITBUCKET = newEntry(
title = "Bitbucket",
username = "john.doe@example.com",
password = "abc123",
url = "https://bitbucket.org",
created = parseDate("2020-01-13"),
modified = parseDate("2020-01-13")
)

private val ENTRY_STEAM = newEntry(
title = "Steam",
username = "john.doe",
password = "abc123",
url = "https://store.steampowered.com",
created = parseDate("2020-01-14"),
modified = parseDate("2020-01-14")
)

private val ENTRY_EBAY = newEntry(
title = "eBay",
username = "john.doe@example.com",
password = "abc123",
url = "https://ebay.com",
created = parseDate("2020-01-15"),
modified = parseDate("2020-01-15")
)

private val ENTRY_ETSY = newEntry(
title = "Etsy",
username = "john.doe@example.com",
password = "abc123",
url = "https://etsy.com",
created = parseDate("2020-01-16"),
modified = parseDate("2020-01-16")
)

private val ENTRY_LINKEDIN = newEntry(
title = "LinkedIn",
username = "john.doe@example.com",
password = "abc123",
url = "https://linkedin.com",
created = parseDate("2020-01-17"),
modified = parseDate("2020-01-17")
)

private val ENTRY_REDDIT = newEntry(
title = "Reddit",
username = "john.doe",
password = "abc123",
url = "https://reddit.com",
created = parseDate("2020-01-18"),
modified = parseDate("2020-01-18")
)

private val ENTRY_DROPBOX = newEntry(
title = "Dropbox",
username = "john.doe@example.com",
password = "abc123",
url = "https://dropbox.com",
created = parseDate("2020-01-19"),
modified = parseDate("2020-01-19")
)

private val ENTRY_TOTP = newEntry(
title = "TOTP Entry",
username = "john.doe@example.com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class FakeFileFactory(
newEntry(
localFile = newFile(Path.DEMO, Time.NO_CHANGES),
syncStatus = SyncStatus.NO_CHANGES,
localContentFactory = LOCAL_CONTENT_FACTORY,
remoteContentFactory = LOCAL_CONTENT_FACTORY
localContentFactory = { createDemoDatabase() },
remoteContentFactory = { createDemoDatabase() }
),

newEntry(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class KotpassDatabase(

val config = MutableEncryptedDatabaseConfig(
isRecycleBinEnabled = rawDatabase.content.meta.recycleBinEnabled,
recycleBinUid = rawDatabase.content.meta.recycleBinUuid,
maxHistoryItems = rawDatabase.content.meta.historyMaxItems
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.ivanovsky.passnotes.data.entity.PasswordGeneratorSettings
import com.ivanovsky.passnotes.data.entity.TestAutofillData
import com.ivanovsky.passnotes.data.entity.TestToggles
import com.ivanovsky.passnotes.data.repository.settings.SettingsImpl.Pref
import com.ivanovsky.passnotes.domain.entity.SearchType
import com.ivanovsky.passnotes.domain.entity.SearchOptions
import com.ivanovsky.passnotes.domain.entity.SortDirection
import com.ivanovsky.passnotes.domain.entity.SortType

Expand All @@ -18,7 +18,7 @@ interface Settings {
var isLockNotificationDialogEnabled: Boolean
var isLockDatabaseOnBack: Boolean
var isFileLogEnabled: Boolean
var searchType: SearchType
var searchOptions: SearchOptions
var isActivateSearchOnStart: Boolean
var sortType: SortType
var sortDirection: SortDirection
Expand Down
Loading
Loading