Skip to content
Open
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
36 changes: 19 additions & 17 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.devtools.ksp' version "$ksp_version"
id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlin_version"
id 'org.jetbrains.kotlin.plugin.compose' version "$kotlin_version"
Expand All @@ -18,22 +17,23 @@ android {
namespace = 'com.hegocre.nextcloudpasswords'
compileSdk = 36

def vCode = 38
def vName = "1.0.12"

defaultConfig {
applicationId "com.hegocre.nextcloudpasswords"
minSdk 24
targetSdk 36
versionCode 38
versionName "1.0.12"
versionCode vCode
versionName vName

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}

applicationVariants.configureEach { variant ->
variant.resValue "string", "version_name", variant.versionName
variant.resValue "string", "version_code", variant.versionCode.toString()
}
resValue "string", "version_name", vName
resValue "string", "version_code", vCode.toString()
}

androidResources {
Expand All @@ -53,6 +53,7 @@ android {
debuggable true
applicationIdSuffix ".debug"
versionNameSuffix "-DEBUG"
resValue "string", "version_name", "${vName}-DEBUG"
}
}
splits {
Expand All @@ -65,6 +66,7 @@ android {
buildFeatures {
compose = true
buildConfig = true
resValues = true
}
packagingOptions {
resources {
Expand All @@ -77,46 +79,46 @@ android {
}

dependencies {
implementation 'androidx.core:core-ktx:1.17.0'
implementation 'androidx.core:core-ktx:1.18.0'
implementation 'dev.spght:encryptedprefs-ktx:1.1.1'
implementation 'androidx.datastore:datastore-preferences:1.2.0'
implementation 'androidx.datastore:datastore-preferences:1.2.1'

implementation 'com.squareup.okhttp3:okhttp:5.3.2'

implementation 'com.goterl:lazysodium-android:5.2.0@aar'
implementation 'net.java.dev.jna:jna:5.18.1@aar'

implementation 'org.commonmark:commonmark:0.27.0'
implementation 'org.commonmark:commonmark:0.28.0'
implementation 'io.coil-kt:coil-compose:2.7.0'

//Compose dependencies
implementation platform('androidx.compose:compose-bom:2025.12.01')
implementation platform('androidx.compose:compose-bom:2026.03.01')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.material3:material3'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material:material-icons-extended'
implementation 'androidx.compose.runtime:runtime-livedata'
implementation 'androidx.compose.foundation:foundation'

implementation 'androidx.navigation:navigation-compose:2.9.6'
implementation 'androidx.activity:activity-compose:1.12.2'
implementation 'androidx.navigation:navigation-compose:2.9.7'
implementation 'androidx.activity:activity-compose:1.13.0'
implementation 'androidx.biometric:biometric:1.1.0'
implementation 'androidx.autofill:autofill:1.3.0'
implementation 'androidx.work:work-runtime-ktx:2.11.0'
implementation 'androidx.work:work-runtime-ktx:2.11.2'

//Room dependencies
implementation "androidx.room:room-ktx:$room_version"
ksp "androidx.room:room-compiler:$room_version"

implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.10.0'

implementation 'com.materialkolor:material-kolor:4.0.5'
implementation 'com.materialkolor:material-kolor:4.1.1'

testImplementation 'junit:junit:4.13.2'

androidTestImplementation 'androidx.arch.core:core-testing:2.2.0'

androidTestImplementation platform('androidx.compose:compose-bom:2025.12.01')
androidTestImplementation platform('androidx.compose:compose-bom:2026.03.01')
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.platform.LocalViewConfiguration
import androidx.compose.ui.platform.LocalWindowInfo
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -122,6 +123,9 @@ fun NextcloudPasswordsAppLock(
.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_STRONG) == BiometricManager.BIOMETRIC_SUCCESS
}

val biometricPromptTitle = stringResource(R.string.biometric_prompt_title)
val biometricPromptDescription = stringResource(R.string.biometric_prompt_description)

LaunchedEffect(key1 = inputPassword) {
if (onCheckPasscode(inputPassword).await()) {
onCorrectPasscode()
Expand All @@ -139,8 +143,8 @@ fun NextcloudPasswordsAppLock(
if (hasBiometricAppLock && canAuthenticateBiometric) {
showBiometricPrompt(
context = context,
title = context.getString(R.string.biometric_prompt_title),
description = context.getString(R.string.biometric_prompt_description),
title = biometricPromptTitle,
description = biometricPromptDescription,
onBiometricUnlock = onCorrectPasscode
)
}
Expand Down Expand Up @@ -202,8 +206,8 @@ fun NextcloudPasswordsAppLock(
onBiometricClick = {
showBiometricPrompt(
context = context,
title = context.getString(R.string.biometric_prompt_title),
description = context.getString(R.string.biometric_prompt_description),
title = biometricPromptTitle,
description = biometricPromptDescription,
onBiometricUnlock = onCorrectPasscode
)
},
Expand Down Expand Up @@ -235,8 +239,8 @@ fun NextcloudPasswordsAppLock(
onBiometricClick = {
showBiometricPrompt(
context = context,
title = context.getString(R.string.biometric_prompt_title),
description = context.getString(R.string.biometric_prompt_description),
title = biometricPromptTitle,
description = biometricPromptDescription,
onBiometricUnlock = onCorrectPasscode
)
},
Expand Down Expand Up @@ -474,11 +478,11 @@ fun KeyboardDigitIndicator(

@Composable
fun screenHeight(): Float =
LocalConfiguration.current.screenHeightDp.toFloat()
LocalWindowInfo.current.containerDpSize.height.value

@Composable
fun screenWidth(): Float =
LocalConfiguration.current.screenWidthDp.toFloat()
LocalWindowInfo.current.containerDpSize.width.value

@Composable
fun buttonSize(): Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.res.ColorStateList
import android.os.Build
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.DrawableCompat
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
Expand Down Expand Up @@ -299,13 +301,16 @@ class PasswordsViewModel(application: Application) : AndroidViewModel(applicatio
addHeader("OCS-APIRequest", "true")
addHeader("Authorization", Credentials.basic(server.username, server.password))
crossfade(true)
val lockDrawable = context.getDrawable(R.drawable.ic_lock)?.apply {
setTintList(
ColorStateList.valueOf(
MaterialTheme.colorScheme.primary.toArgb()
)
)

val tintColor = MaterialTheme.colorScheme.primary.toArgb()
val lockDrawable = remember(context, tintColor) {
ContextCompat.getDrawable(context, R.drawable.ic_lock)?.let { drawable ->
val wrappedDrawable = DrawableCompat.wrap(drawable).mutate()
DrawableCompat.setTint(wrappedDrawable, tintColor)
wrappedDrawable
}
}

placeholder(lockDrawable)
fallback(lockDrawable)
error(lockDrawable)
Expand All @@ -324,13 +329,16 @@ class PasswordsViewModel(application: Application) : AndroidViewModel(applicatio
addHeader("OCS-APIRequest", "true")
addHeader("Authorization", Credentials.basic(server.username, server.password))
crossfade(true)
val accountDrawable = context.getDrawable(R.drawable.ic_account_circle)?.apply {
setTintList(
ColorStateList.valueOf(
MaterialTheme.colorScheme.primary.toArgb()
)
)

val tintColor = MaterialTheme.colorScheme.primary.toArgb()
val accountDrawable = remember(context, tintColor) {
ContextCompat.getDrawable(context, R.drawable.ic_account_circle)?.let { drawable ->
val wrappedDrawable = DrawableCompat.wrap(drawable).mutate()
DrawableCompat.setTint(wrappedDrawable, tintColor)
wrappedDrawable
}
}

placeholder(accountDrawable)
fallback(accountDrawable)
error(accountDrawable)
Expand Down
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
kotlin_version = '2.2.21'
kotlin_version = '2.3.10'
room_version = '2.8.4'
ksp_version = '2.3.3'
ksp_version = '2.3.6'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.13.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:9.1.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ android.enableJetifier=false
kotlin.code.style=official
android.nonTransitiveRClass=true
android.nonFinalResIds=true
org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache=true
android.uniquePackageNames=false
android.dependency.useConstraints=false
android.r8.strictFullModeForKeepRules=false
13 changes: 13 additions & 0 deletions gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/ecd23fd7707c683afbcd6052998cb6a9/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/ecd23fd7707c683afbcd6052998cb6a9/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/10fc3bf1ee0001078a473afe6e43cfdb/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/9c55677aff3966382f3d853c0959bfb2/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/ecd23fd7707c683afbcd6052998cb6a9/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/248ffb1098f61659502d0c09aa348294/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/ac151d55def6b6a9a159dc4cb4642851/redirect
toolchainVendor=JETBRAINS
toolchainVersion=21
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionSha256Sum=b266d5ff6b90eada6dc3b20cb090e3731302e553a27c5d3e4df1f0d76beaff06
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading