Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into weblate-librepass-android
Browse files Browse the repository at this point in the history
  • Loading branch information
M3DZIK authored Mar 2, 2024
2 parents ba42cf5 + 82afc47 commit 3d08148
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ that their passwords will remain private and inaccessible to unauthorized indivi
## Install

[<img src="https://gitlab.com/IzzyOnDroid/repo/-/raw/master/assets/IzzyOnDroid.png" alt="Get it on IzzyDroid" height="70" align="center">](https://android.izzysoft.de/repo/apk/dev.medzik.librepass.android)
[<img src="https://f-droid.org/badge/get-it-on.png" alt="Get it on F-Droid" height="70" align="center">](https://f-droid.org/en/packages/dev.medzik.librepass.android)
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get it on F-Droid" height="70" align="center">](https://f-droid.org/en/packages/dev.medzik.librepass.android)

You can download and install .apk of LibrePass app from [releases](https://github.com/LibrePass/android/releases).
It will be also available in Google Play Store soon.
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId = "dev.medzik.librepass.android"
minSdk = libs.versions.android.sdk.min.get().toInt()
targetSdk = libs.versions.android.sdk.target.get().toInt()
versionCode = 13
versionName = "1.2.2"
versionCode = 15
versionName = "1.2.3"

vectorDrawables {
useSupportLibrary = true
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
android:required="false" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="android.permission.CAMERA" />

<application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fun UnlockScreen(
KeyStore.initForDecryption(
alias = KeyAlias.BiometricAesKey,
initializationVector = Hex.decode(credentials.biometricAesKeyIV!!),
deviceAuthentication = true
deviceAuthentication = false
),
onAuthenticationSucceeded = { cipher ->
viewModel.vault.aesKey = KeyStore.decrypt(cipher, credentials.biometricAesKey!!)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fun SettingsSecurityScreen(viewModel: LibrePassViewModel = hiltViewModel()) {
context as MainActivity,
KeyStore.initForEncryption(
KeyAlias.BiometricAesKey,
deviceAuthentication = true
deviceAuthentication = false
),
onAuthenticationSucceeded = { cipher ->
val encryptedData =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import dev.medzik.librepass.android.ui.Screen
import dev.medzik.librepass.android.ui.components.CipherCard
import dev.medzik.librepass.android.utils.KeyAlias
import dev.medzik.librepass.android.utils.checkIfBiometricAvailable
import dev.medzik.librepass.android.utils.haveNetworkConnection
import dev.medzik.librepass.android.utils.showBiometricPromptForSetup
import dev.medzik.librepass.android.utils.showErrorToast
import dev.medzik.librepass.client.Server
Expand Down Expand Up @@ -112,12 +113,12 @@ fun VaultScreen(
cipher =
KeyStore.initForEncryption(
KeyAlias.BiometricAesKey,
deviceAuthentication = true
deviceAuthentication = false
),
onAuthenticationSucceeded = { cipher ->
scope.launch(Dispatchers.IO) {
val encryptedData = KeyStore.encrypt(cipher, viewModel.vault.aesKey)
val encryptedData = KeyStore.encrypt(cipher, viewModel.vault.aesKey)

scope.launch(Dispatchers.IO) {
viewModel.credentialRepository.update(
credentials.copy(
biometricReSetup = false,
Expand Down Expand Up @@ -169,7 +170,9 @@ fun VaultScreen(
ciphers = viewModel.vault.sortAlphabetically()

// sync remote ciphers
updateCiphers()
if (context.haveNetworkConnection()) {
updateCiphers()
}
}

val pullRefreshState = rememberPullRefreshState(refreshing, ::updateCiphers)
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/dev/medzik/librepass/android/utils/Network.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package dev.medzik.librepass.android.utils

import android.content.Context
import android.net.ConnectivityManager

fun Context.haveNetworkConnection(): Boolean {
val connectivityManager = getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val activeNetwork = connectivityManager.activeNetwork
return activeNetwork != null
}
2 changes: 2 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/15.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Don't run keystore encryption in coroutine
* Don't show toast with "Network error" after app launch
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test-junit = "1.1.5"
zxing = "3.5.2"
zxing-android = "4.3.0"
# Plugins
android-application = "8.2.2"
android-application = "8.3.0"
kotlin-ksp = "1.9.22-1.0.17"
kotlin-android = "1.9.22"

Expand Down

0 comments on commit 3d08148

Please sign in to comment.