Compare commits
245 Commits
acebf2c908
...
1.3b
| Author | SHA1 | Date | |
|---|---|---|---|
| 0593eb8fbf | |||
| 54dadd5bf2 | |||
| c191eb6248 | |||
| 35366a5a09 | |||
| 07eb4eefdd | |||
|
|
2a76ef340b
|
||
|
|
249b281ae1
|
||
| 82ab401862 | |||
|
|
1cc4533617 | ||
| 9b903ce12b | |||
| 122d03c971 | |||
|
|
25c993354e | ||
|
|
6eefb809d8 | ||
| 3ae56fdbdf | |||
| e4a7413534 | |||
|
|
6c8cfaf128 | ||
|
|
3c71988d12 | ||
| beca592f01 | |||
|
|
ecfaa44756 | ||
| 1e12c6e0db | |||
|
|
cb71570834 | ||
| 1a2d785d82 | |||
| 8e0c8b7eaa | |||
|
|
f96363306d | ||
|
|
ab32a2ecd2 | ||
| 85ae80696e | |||
|
|
41bba56d5b | ||
| 6e1466f1a3 | |||
|
|
d082c6b1bd | ||
| dfa97108d4 | |||
| ef1f4d071e | |||
|
|
9a64cd2cb6 | ||
|
|
9971360e7e | ||
| 7c30df4436 | |||
| 6bde0f2129 | |||
|
|
28d23034b0 | ||
| 962bf1ca7c | |||
|
|
9364cced34 | ||
|
|
9916804e36 | ||
| 7764b1aa06 | |||
|
|
355a5342f4 | ||
| 29b28d4935 | |||
|
|
a7833beb8d | ||
| 1984406048 | |||
|
|
5224337b13 | ||
| 1d15f25cd7 | |||
|
|
d7ffbc40ae | ||
| 3f1d809855 | |||
|
|
db9bd281d7 | ||
| 1b217ef01d | |||
|
|
6e3487f905 | ||
| e25d6da3aa | |||
|
|
57ab225705 | ||
| 43147f0600 | |||
| bdd1fe2323 | |||
|
|
de62af173f | ||
|
|
c9c5009092 | ||
| fa8e9f390f | |||
| 7ce9d0f36a | |||
|
|
6066b25d15 | ||
| 9262c737c3 | |||
|
|
5b03dc4c7b | ||
|
|
f32ae1a8e8 | ||
| 4220a334fd | |||
|
|
c2be61f1a6 | ||
| c8bae4838e | |||
|
|
e60c4cd35b | ||
| c230c8ea72 | |||
|
|
4e2a3de7d2 | ||
| 1b7f068976 | |||
|
|
4e24f9e73e | ||
| 4b471f5e56 | |||
|
|
463007c80e | ||
| aedb9d0ab4 | |||
|
|
a48fc9a374 | ||
| 541c79db7f | |||
|
|
7cad346bb7 | ||
| dc5237652e | |||
|
|
f0bd4100dc | ||
| 9903790e87 | |||
| 06053b7ec8 | |||
| ab6073d415 | |||
|
|
4f1897af2f | ||
| 867e438857 | |||
|
|
b41ff5868e | ||
| ca84a36630 | |||
| 5736164692 | |||
|
|
864927e8eb | ||
|
|
8d4267608b | ||
| 7e41b10394 | |||
| 0f9bfa8f29 | |||
|
|
2322a02e0d | ||
|
|
b73cd5e9f7 | ||
| bcf848f667 | |||
|
|
01a627af79 | ||
| e542c38eb9 | |||
|
|
f1fdd91025 | ||
| 741c8eeb80 | |||
| f3c5b80122 | |||
|
|
dd03b7797f | ||
|
|
a705efbeb9 | ||
| 6865c0513f | |||
| 385484eb5c | |||
|
|
8cc07d2570 | ||
|
|
e876d470ed | ||
| f2a8a9b179 | |||
| a03e9553c3 | |||
|
|
6f5fc5733e | ||
|
|
0cff562c76 | ||
| a9e5e0c969 | |||
|
|
ee1ef7b2de | ||
| b22c24aa54 | |||
| 0ceee3ab67 | |||
|
|
5c4b20d57c | ||
|
|
5c4b3c7df0 | ||
| 933578fca0 | |||
|
|
ec12827b21 | ||
| 3655987082 | |||
|
|
28ec153a0c | ||
| f3d7059221 | |||
|
|
c83ef3d3c4 | ||
| 4dfb171d41 | |||
| ee6a8dc35a | |||
|
|
8e22babdc2 | ||
|
|
a770f0d381 | ||
| 7976c05e76 | |||
|
|
af8d718058 | ||
| ccf9da6e98 | |||
|
|
6c27af1404 | ||
| daef958340 | |||
|
|
1cea5b6c3f | ||
| 4d52634e18 | |||
| 6f6d220f4f | |||
|
|
34858d23d5 | ||
|
|
8ddd042579 | ||
| 7136f8c883 | |||
|
|
372274cfc3 | ||
| 54ff955670 | |||
| f4f18258d1 | |||
|
|
b43d1a53e2 | ||
|
|
63c1bd1d7e | ||
| 4e33f88f4f | |||
|
|
9893c8ddae | ||
| 3a5a9ca273 | |||
|
|
2b4823206c | ||
| 60bc918153 | |||
|
|
9454b612ce | ||
| f5f472d39e | |||
|
|
58182a51db | ||
| 1db246eab9 | |||
| 67ade9909c | |||
|
|
e412cee462 | ||
|
|
46c9aedb7c | ||
| 089de53398 | |||
| dcc18bc26e | |||
|
|
89d9f0274e | ||
|
|
126cfe08a3 | ||
| 7866c074ed | |||
|
|
d8d91f091a | ||
| 2b3d01a680 | |||
|
|
99ffa3226e | ||
| a0af4a3d24 | |||
|
|
aacedd40e0 | ||
| d9e0cb0502 | |||
| 08cfbc1e53 | |||
|
|
f24e15a9f3 | ||
|
|
adcd5f50f3 | ||
| bb4dd58bbb | |||
| 25c7ddae1c | |||
|
|
40f28ceca9 | ||
|
|
6622ef0d94 | ||
| 950678e279 | |||
| 5544289d0f | |||
|
|
d7f32d0841 | ||
|
|
b1fc257786 | ||
| 140ef2cb64 | |||
| 55b730f73e | |||
|
|
41d6ba0e87 | ||
|
|
8124ff0f55 | ||
| 0c862b4756 | |||
|
|
6453e56e18 | ||
| ddf56d86ba | |||
|
|
5cc072921d | ||
| 247da0b8b6 | |||
|
|
993524e641 | ||
| c17026509c | |||
|
|
595524f2d1 | ||
| f322e35fcb | |||
| 045ad6eb89 | |||
|
|
8c5f9b988d | ||
|
|
4803c2d59a | ||
| ce827e9c0d | |||
| 4ee6bf0bcf | |||
|
|
80fbb71bfd | ||
|
|
c4d5eb2831 | ||
| 958f23803e | |||
|
|
78afa1163a | ||
| 767723f642 | |||
|
|
43e462256b | ||
| 9986b58fc4 | |||
|
|
86cd3e89eb | ||
| 36ad7a18b3 | |||
| aa29f61e8f | |||
|
|
7412fef388 | ||
|
|
8d5cccf821 | ||
| 1ba0fe6ff4 | |||
| ebba515605 | |||
|
|
bb9f9b2a3f | ||
|
|
8506c7a50d | ||
| 31b91351b1 | |||
|
|
6cffa3ac85 | ||
| 0cc9912b03 | |||
| 7f76089bd9 | |||
|
|
12d85e1d0c | ||
|
|
00edab363c | ||
| 3d5f57ef4a | |||
|
|
1a01e1ffdf | ||
| 456f14d7d3 | |||
|
|
f7babb188a | ||
| 94ead96c5f | |||
|
|
f3aac29466 | ||
| b37cfb9315 | |||
|
|
4a8b8a1f9c | ||
| 826d9c8a4c | |||
|
|
33394d895b | ||
| deb8b238bd | |||
|
|
07b4b9d375 | ||
| 3987ac3a93 | |||
|
|
419a2e2442 | ||
| d30fe7ed7e | |||
|
|
9c45359e6e | ||
| 83670603a0 | |||
|
|
a4bf5e7c39 | ||
| d179407451 | |||
| 5c2b13dc38 | |||
|
|
2cf38db3fe | ||
|
|
63606f8565 | ||
| 9759aab12b | |||
| 31175fb738 | |||
|
|
e6d24eef24 | ||
|
|
188d5c770a | ||
| c3fadc7224 | |||
|
|
1e0e5e8aca | ||
| cda5fcd90f | |||
|
|
09ec6500bd |
19
.github/workflows/build.yml
vendored
19
.github/workflows/build.yml
vendored
@@ -23,9 +23,14 @@ jobs:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
- name: Make script executable
|
||||
run: chmod +x ./patch_submodule.sh
|
||||
- name: Run patch submodule script
|
||||
run: ./patch_submodule.sh
|
||||
- name: set up secrets
|
||||
run: |
|
||||
echo "${{ secrets.RELEASE_KEYSTORE }}" > keystore.asc
|
||||
@@ -33,8 +38,6 @@ jobs:
|
||||
gpg -d --passphrase "${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" --batch keystore.asc > app/keystore.properties
|
||||
gpg -d --passphrase "${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" --batch key.asc > app/key.jks
|
||||
|
||||
- uses: gradle/wrapper-validation-action@v3
|
||||
|
||||
- name: create and checkout branch
|
||||
if: github.event_name == 'pull_request'
|
||||
env:
|
||||
@@ -44,12 +47,16 @@ jobs:
|
||||
- name: set up JDK
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version: 17
|
||||
java-version: 21
|
||||
distribution: "temurin"
|
||||
cache: 'gradle'
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v6
|
||||
|
||||
- name: Build APK
|
||||
run: ./gradlew assemble
|
||||
run: |
|
||||
VERSION_CODE=$(git rev-list --count HEAD)
|
||||
./gradlew assemble -PVERSION_CODE=$VERSION_CODE
|
||||
|
||||
# - name: Upload APK
|
||||
# uses: actions/upload-artifact@v4
|
||||
@@ -58,7 +65,7 @@ jobs:
|
||||
# path: app/build/outputs/apk/release/app-release.apk
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
uses: softprops/action-gh-release@v3
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: |
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
<h1>Keepass Fidelity</h1>
|
||||
<img width="100px" src="./metadata/en-US/images/icon.png" alt="Logo">
|
||||
|
||||
<p>A minimalist fidelity/loyalty card plugin</p>
|
||||
<p>A minimalist fidelity/loyalty card app with Keepass Database storage</p>
|
||||
|
||||
<img src="https://forthebadge.com/images/badges/built-for-android.svg" alt="Built for Android">
|
||||
<img src="https://forthebadge.com/images/badges/built-with-love.svg" alt="Built with love">
|
||||
<br>
|
||||
<a href="https://github.com/choelzl/keepass-fidelity/actions/workflows/build.yml">
|
||||
<img src="https://github.com/choelzl/keepass-fidelity/actions/workflows/build.yml/badge.svg?branch=main" alt="Build Status">
|
||||
<a href="https://github.com/helcel-net/keepass-fidelity/actions/workflows/build.yml">
|
||||
<img src="https://github.com/helcel-net/keepass-fidelity/actions/workflows/build.yml/badge.svg?branch=main" alt="Build Status">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
## ⭐ Features
|
||||
|
||||
- Search entries in [Keepass2Android](https://github.com/PhilippC/keepass2android/)
|
||||
- Search entries in Keepass Database
|
||||
- Scan & Create entries
|
||||
- Recently used history for fast access
|
||||
- Protect entries from caching
|
||||
|
||||
@@ -1,27 +1,38 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'org.jetbrains.kotlin.plugin.serialization' version '2.2.20'
|
||||
id 'org.jetbrains.kotlin.plugin.compose' version '2.2.20'
|
||||
def getCommitCount() {
|
||||
try {
|
||||
def stdout = new ByteArrayOutputStream()
|
||||
exec {
|
||||
commandLine 'git', 'rev-list', '--count', 'HEAD'
|
||||
standardOutput = stdout
|
||||
}
|
||||
return stdout.toString().trim().toInteger()
|
||||
} catch (ignored) {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.plugin.serialization' version '2.3.21'
|
||||
id 'org.jetbrains.kotlin.plugin.compose' version '2.3.21'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'net.helcel.fidelity'
|
||||
compileSdk 36
|
||||
compileSdk = 37
|
||||
|
||||
defaultConfig {
|
||||
applicationId 'net.helcel.fidelity'
|
||||
versionName "1.0d"
|
||||
versionName "1.3b"
|
||||
versionCode project.hasProperty('VERSION_CODE') ? project.property('VERSION_CODE').toInteger() : 1
|
||||
buildConfigField("String", "APP_NAME", "\"Keepass Fidelity\"")
|
||||
manifestPlaceholders["APP_NAME"] = "Keepass Fidelity"
|
||||
minSdk 28
|
||||
targetSdk 36
|
||||
minSdk = 28
|
||||
targetSdk = 37
|
||||
}
|
||||
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
register("release") {
|
||||
try {
|
||||
def keystorePropertiesFile = rootProject.file("app/keystore.properties")
|
||||
def keystoreProperties = new Properties()
|
||||
@@ -41,10 +52,12 @@ android {
|
||||
buildTypes {
|
||||
debug {
|
||||
debuggable true
|
||||
initWith(buildTypes.release)
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
release {
|
||||
minifyEnabled true
|
||||
shrinkResources false
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
signedRelease {
|
||||
@@ -86,43 +99,41 @@ android {
|
||||
disable 'UsingMaterialAndMaterial3Libraries'
|
||||
disable 'PreviewAnnotationInFunctionWithParameters'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.compose.ui:ui'
|
||||
implementation 'androidx.compose.material3:material3:1.4.0'
|
||||
implementation 'androidx.compose.material:material:1.9.3'
|
||||
implementation 'androidx.compose.material:material:1.11.2'
|
||||
implementation 'androidx.compose.material:material-icons-extended:1.7.8'
|
||||
implementation 'androidx.navigation:navigation-compose:2.9.5'
|
||||
implementation 'androidx.navigation:navigation-compose:2.9.8'
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
|
||||
implementation "androidx.biometric:biometric:1.2.0-alpha05"
|
||||
implementation "androidx.security:security-crypto:1.1.0"
|
||||
implementation "androidx.datastore:datastore-preferences:1.1.7"
|
||||
implementation "androidx.datastore:datastore-preferences:1.2.1"
|
||||
implementation "androidx.security:security-crypto:1.1.0"
|
||||
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.1.5'
|
||||
|
||||
implementation 'androidx.camera:camera-lifecycle:1.5.1'
|
||||
implementation 'androidx.camera:camera-view:1.5.1'
|
||||
runtimeOnly 'androidx.camera:camera-camera2:1.5.1'
|
||||
implementation 'androidx.camera:camera-lifecycle:1.6.1'
|
||||
implementation 'androidx.camera:camera-view:1.6.1'
|
||||
runtimeOnly 'androidx.camera:camera-camera2:1.6.1'
|
||||
|
||||
implementation 'com.google.android.material:material:1.13.0'
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0'
|
||||
implementation 'com.google.zxing:core:3.5.3'
|
||||
implementation 'com.google.android.material:material:1.14.0'
|
||||
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.11.0'
|
||||
implementation 'com.google.zxing:core:3.5.4'
|
||||
|
||||
implementation project(":database")
|
||||
implementation project(":crypto")
|
||||
|
||||
implementation platform('androidx.compose:compose-bom:2025.10.00')
|
||||
implementation 'androidx.compose.ui:ui-tooling:1.9.3'
|
||||
implementation platform('androidx.compose:compose-bom:2026.05.01')
|
||||
implementation 'androidx.compose.ui:ui-tooling:1.11.2'
|
||||
implementation 'androidx.compose.ui:ui-tooling-preview'
|
||||
|
||||
//Submodule
|
||||
//noinspection NewerVersionAvailable
|
||||
implementation 'joda-time:joda-time:2.14.0'
|
||||
implementation 'org.joda:joda-convert:2.2.4'
|
||||
implementation 'joda-time:joda-time:2.14.2'
|
||||
implementation 'org.joda:joda-convert:3.0.1'
|
||||
|
||||
}
|
||||
|
||||
1
app/proguard-rules.pro
vendored
1
app/proguard-rules.pro
vendored
@@ -3,5 +3,6 @@
|
||||
-keepattributes Signature
|
||||
|
||||
-keep class org.joda.convert.** { *; }
|
||||
-dontwarn org.threeten.bp.**
|
||||
# Optional. For using GSON @Expose annotation
|
||||
-keepattributes AnnotationDefault,RuntimeVisibleAnnotations
|
||||
@@ -62,6 +62,7 @@ import net.helcel.fidelity.tools.FidelityEntry
|
||||
import net.helcel.fidelity.tools.FidelityRepository
|
||||
import net.helcel.fidelity.tools.FidelityRepository.activeEntry
|
||||
import net.helcel.fidelity.tools.FidelityRepository.addEntry
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
|
||||
|
||||
@Preview
|
||||
@@ -81,7 +82,7 @@ fun CreateEntryScreen(navController: NavHostController?) {
|
||||
|
||||
LaunchedEffect(entry) {
|
||||
isValidBarcode = false
|
||||
delay(500)
|
||||
delay(500.milliseconds)
|
||||
if (entry.code.isEmpty()) return@LaunchedEffect
|
||||
try {
|
||||
val bmp = generateBarcode(entry.code, entry.format, 600)
|
||||
@@ -158,8 +159,9 @@ fun CreateEntryScreen(navController: NavHostController?) {
|
||||
),
|
||||
label = { Text("Code") },
|
||||
isError = errorCode.isNotEmpty(),
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
singleLine = true
|
||||
maxLines = 5,
|
||||
singleLine = false,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
)
|
||||
if (errorCode.isNotEmpty()) {
|
||||
Text(errorCode, color = MaterialTheme.colors.error)
|
||||
@@ -358,7 +360,13 @@ private fun onSubmitIfValid(
|
||||
object CreateEntryEventHandler {
|
||||
fun onSubmit(navController: NavHostController){
|
||||
navController.popBackStack()
|
||||
activeEntry.value = activeEntry.value.copy(null,"","","",false)
|
||||
activeEntry.value = activeEntry.value.copy(
|
||||
uid = null,
|
||||
title = "",
|
||||
code = "",
|
||||
format = "",
|
||||
protected = false
|
||||
)
|
||||
}
|
||||
|
||||
fun onFileScan(navController: NavHostController){
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package net.helcel.fidelity.activity.fragment
|
||||
|
||||
import android.content.Context
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.combinedClickable
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
@@ -24,9 +26,12 @@ import androidx.compose.material.ExperimentalMaterialApi
|
||||
import androidx.compose.material.FloatingActionButton
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.OutlinedTextField
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.TextFieldDefaults
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material.icons.filled.Edit
|
||||
import androidx.compose.material.icons.filled.HideSource
|
||||
import androidx.compose.material.icons.filled.PushPin
|
||||
@@ -36,6 +41,7 @@ import androidx.compose.material3.CardDefaults
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.pulltorefresh.PullToRefreshBox
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.derivedStateOf
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
@@ -44,6 +50,8 @@ import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
@@ -51,6 +59,8 @@ import androidx.navigation.NavHostController
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import net.helcel.fidelity.activity.ToastHelper
|
||||
import net.helcel.fidelity.activity.fragment.LauncherEventHandlers.isSearchVisible
|
||||
import net.helcel.fidelity.activity.fragment.LauncherEventHandlers.onAdd
|
||||
import net.helcel.fidelity.activity.fragment.LauncherEventHandlers.onEdit
|
||||
import net.helcel.fidelity.activity.fragment.LauncherEventHandlers.onHide
|
||||
@@ -58,6 +68,7 @@ import net.helcel.fidelity.activity.fragment.LauncherEventHandlers.onPin
|
||||
import net.helcel.fidelity.activity.fragment.LauncherEventHandlers.onQuery
|
||||
import net.helcel.fidelity.activity.fragment.LauncherEventHandlers.onRefresh
|
||||
import net.helcel.fidelity.activity.fragment.LauncherEventHandlers.onView
|
||||
import net.helcel.fidelity.activity.fragment.LauncherEventHandlers.searchQuery
|
||||
import net.helcel.fidelity.tools.CredentialResult
|
||||
import net.helcel.fidelity.tools.FidelityEntry
|
||||
import net.helcel.fidelity.tools.FidelityRepository.activeEntry
|
||||
@@ -79,9 +90,18 @@ fun LauncherScreen(
|
||||
var showHidden by remember { mutableStateOf(false) }
|
||||
val context = LocalContext.current
|
||||
val scope = rememberCoroutineScope()
|
||||
val sortedEntries = remember(entries) {
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
|
||||
BackHandler(enabled = isSearchVisible) {
|
||||
onQuery()
|
||||
}
|
||||
|
||||
val sortedEntries = remember(entries, showHidden, searchQuery) {
|
||||
derivedStateOf {
|
||||
entries.filter{showHidden || !it.hidden}.sortedWith(
|
||||
entries.filter {
|
||||
(showHidden || !it.hidden) &&
|
||||
(searchQuery.isEmpty() || it.title.contains(searchQuery, ignoreCase = true))
|
||||
}.sortedWith(
|
||||
compareByDescending<FidelityEntry> { it.pinned }
|
||||
.thenBy { it.hidden }
|
||||
.thenByDescending { it.lastUse }
|
||||
@@ -105,17 +125,47 @@ fun LauncherScreen(
|
||||
isRefreshing = isRefreshingState,
|
||||
modifier = Modifier.fillMaxSize()
|
||||
) {
|
||||
LazyVerticalGrid(
|
||||
columns = GridCells.Fixed(2),
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.fillMaxSize()
|
||||
.padding(16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
items(sortedEntries.value) { entry ->
|
||||
FidelityRow(navController, entry)
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
if (isSearchVisible) {
|
||||
LaunchedEffect(Unit) {
|
||||
focusRequester.requestFocus()
|
||||
}
|
||||
OutlinedTextField(
|
||||
value = searchQuery,
|
||||
onValueChange = { searchQuery = it },
|
||||
colors = TextFieldDefaults.textFieldColors(
|
||||
textColor = MaterialTheme.colors.onBackground
|
||||
),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(16.dp)
|
||||
.focusRequester(focusRequester),
|
||||
label = { Text("Search") },
|
||||
singleLine = true,
|
||||
trailingIcon = {
|
||||
Icon(
|
||||
Icons.Default.Close,
|
||||
contentDescription = "Clear",
|
||||
modifier = Modifier.clickable {
|
||||
searchQuery = ""
|
||||
onQuery()
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
LazyVerticalGrid(
|
||||
columns = GridCells.Fixed(2),
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.fillMaxSize()
|
||||
.padding(16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
items(sortedEntries.value) { entry ->
|
||||
FidelityRow(navController, entry)
|
||||
}
|
||||
}
|
||||
}
|
||||
FloatingActionButton(
|
||||
@@ -262,21 +312,24 @@ fun FidelityRow(
|
||||
|
||||
|
||||
object LauncherEventHandlers {
|
||||
var isSearchVisible by mutableStateOf(false)
|
||||
var searchQuery by mutableStateOf("")
|
||||
var CRED: CredentialResult.Success? = null
|
||||
|
||||
fun onAdd(navController: NavHostController) {
|
||||
navController.navigate("edit")
|
||||
}
|
||||
|
||||
fun onQuery() {
|
||||
//TODO
|
||||
isSearchVisible = !isSearchVisible
|
||||
if (!isSearchVisible) searchQuery = ""
|
||||
}
|
||||
var CRED: CredentialResult.Success? = null
|
||||
|
||||
suspend fun onSave(context: Context, navController: NavHostController){
|
||||
try {
|
||||
if (CRED == null) {
|
||||
val res = loadCredentials(context)
|
||||
when (res) {
|
||||
CredentialResult.AuthFailed, CredentialResult.NoData -> null
|
||||
when (val res = loadCredentials(context)) {
|
||||
CredentialResult.AuthFailed, CredentialResult.NoData -> ToastHelper.show(context, "Unable to Load Credentials")
|
||||
is CredentialResult.Success -> CRED = res
|
||||
}
|
||||
}
|
||||
@@ -297,11 +350,9 @@ object LauncherEventHandlers {
|
||||
suspend fun onRefresh(context: Context, navController: NavHostController) {
|
||||
try {
|
||||
if (CRED == null) {
|
||||
val res = loadCredentials(context)
|
||||
when (res) {
|
||||
CredentialResult.AuthFailed, CredentialResult.NoData -> null
|
||||
when (val res = loadCredentials(context)) {
|
||||
CredentialResult.AuthFailed, CredentialResult.NoData -> ToastHelper.show(context, "Unable to Load Credentials")
|
||||
is CredentialResult.Success -> CRED = res
|
||||
|
||||
}
|
||||
}
|
||||
CRED!!
|
||||
@@ -309,8 +360,8 @@ object LauncherEventHandlers {
|
||||
genCredentials(context, CRED!!)
|
||||
}
|
||||
if (withContext(Dispatchers.IO) {
|
||||
start(context, CRED!!.db, cred)
|
||||
})
|
||||
start(context, CRED!!.db, cred)
|
||||
})
|
||||
importDB(context)
|
||||
} catch (e: Exception) {
|
||||
println(e.toString())
|
||||
|
||||
@@ -53,6 +53,7 @@ import net.helcel.fidelity.activity.ToastHelper
|
||||
import net.helcel.fidelity.activity.fragment.SetupEventHandlers.onOpen
|
||||
import net.helcel.fidelity.tools.CredentialResult
|
||||
import net.helcel.fidelity.tools.FidelityRepository.genCredentials
|
||||
import net.helcel.fidelity.tools.FidelityRepository.importDB
|
||||
import net.helcel.fidelity.tools.FidelityRepository.start
|
||||
import net.helcel.fidelity.tools.KeePassStore.loadCredentials
|
||||
import net.helcel.fidelity.tools.KeePassStore.packCredentials
|
||||
@@ -116,8 +117,8 @@ fun InitialScreen(
|
||||
LaunchedEffect(Unit) {
|
||||
scope.launch(Dispatchers.Main) {
|
||||
when(val res = loadCredentials(context)) {
|
||||
CredentialResult.AuthFailed -> null
|
||||
CredentialResult.NoData -> null
|
||||
CredentialResult.AuthFailed -> ToastHelper.show(context, "Unable to Load Credentials")
|
||||
CredentialResult.NoData -> ToastHelper.show(context, "Unable to Load Credentials")
|
||||
is CredentialResult.Success -> {
|
||||
if (res.db != null) dbFile = res.db
|
||||
if (res.key != null) keyFile = res.key
|
||||
@@ -219,13 +220,17 @@ fun InitialScreen(
|
||||
onClick = {
|
||||
loading = true
|
||||
scope.launch {
|
||||
if(onOpen(context, dbFile!!, password, keyFile)){
|
||||
val res = onOpen(context, dbFile!!, password, keyFile)
|
||||
if(res != null){
|
||||
ToastHelper.show(context, "Successful... Importing")
|
||||
withContext(Dispatchers.IO) {
|
||||
start(context, dbFile!!,genCredentials(context, res))
|
||||
}
|
||||
importDB(context)
|
||||
navController!!.popBackStack()
|
||||
navController.navigate("init")
|
||||
navController.navigate("launcher")
|
||||
}else{
|
||||
ToastHelper.show(context, "Auth failed...")
|
||||
navController!!.popBackStack()
|
||||
navController.navigate("exit")
|
||||
ToastHelper.show(context, "Failed... Retry")
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -249,7 +254,7 @@ fun InitialScreen(
|
||||
}
|
||||
|
||||
object SetupEventHandlers {
|
||||
suspend fun onOpen(context: Context, db: Uri, p: String, key: Uri?): Boolean {
|
||||
suspend fun onOpen(context: Context, db: Uri, p: String, key: Uri?): CredentialResult.Success? {
|
||||
try {
|
||||
val packCred = packCredentials(db, p, key)
|
||||
withContext(Dispatchers.IO) {
|
||||
@@ -261,14 +266,14 @@ object SetupEventHandlers {
|
||||
saveCredentials(context, packCred)
|
||||
}
|
||||
return when (res) {
|
||||
CredentialResult.AuthFailed, CredentialResult.NoData -> false
|
||||
is CredentialResult.Success -> true
|
||||
CredentialResult.AuthFailed, CredentialResult.NoData -> null
|
||||
is CredentialResult.Success -> res
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
ToastHelper.show(context, e.message.toString())
|
||||
println("Err${e.toString()}")
|
||||
println(e.message)
|
||||
return false
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,6 @@ import com.google.zxing.common.HybridBinarizer
|
||||
import net.helcel.fidelity.tools.BarcodeFormatConverter.formatToString
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
|
||||
@OptIn(ExperimentalGetImage::class)
|
||||
object BarcodeScanner {
|
||||
|
||||
@@ -56,6 +55,4 @@ object BarcodeScanner {
|
||||
fun bitmapUseCase(bitmap: Bitmap, cb: (String?, String?) -> Unit) {
|
||||
processImage(bitmap, cb)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -113,13 +113,21 @@ suspend fun showBiometricPrompt(activity: FragmentActivity, enc: Boolean): Ciphe
|
||||
activity,
|
||||
executor,
|
||||
object : BiometricPrompt.AuthenticationCallback() {
|
||||
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) { cont.resume(result.cryptoObject?.cipher) {} }
|
||||
override fun onAuthenticationError(code: Int, msg: CharSequence) { cont.resume(null) {} }
|
||||
override fun onAuthenticationFailed() { cont.resume(null) {} }
|
||||
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
|
||||
cont.resume(result.cryptoObject?.cipher) { _, _, _ -> }
|
||||
}
|
||||
override fun onAuthenticationError(code: Int, msg: CharSequence) {
|
||||
cont.resume(null) { _, _, _ -> }
|
||||
}
|
||||
override fun onAuthenticationFailed() {
|
||||
cont.resume(null) { _, _, _ -> }
|
||||
}
|
||||
}
|
||||
)
|
||||
val iv = if(enc) null else prefs[KeePassKeys.IV]?.let { Base64.decode(it, Base64.DEFAULT) }
|
||||
if (!enc && iv == null) { cont.resume(null) {} }
|
||||
if (!enc && iv == null) {
|
||||
cont.resume(null) { _, _, _ -> }
|
||||
}
|
||||
val cipher = getCipherForDecryption(getOrCreateBiometricKey(), iv)
|
||||
val promptInfo = BiometricPrompt.PromptInfo.Builder()
|
||||
.setTitle("Unlock KeePass")
|
||||
|
||||
@@ -59,7 +59,7 @@ object FidelityRepository {
|
||||
db.loadData(
|
||||
bitStream, c,
|
||||
{ hardwareKey, seed -> retrieveResponseFromChallenge(hardwareKey, seed) },
|
||||
false, binaryDir!!,
|
||||
readOnly=false, allowUserVerification = false,binaryDir!!,
|
||||
{ BinaryData.canMemoryBeAllocatedInRAM(ctx, it) },
|
||||
false, null
|
||||
)
|
||||
@@ -84,7 +84,7 @@ object FidelityRepository {
|
||||
hardwareKey: HardwareKey? = null
|
||||
): MasterCredential {
|
||||
return MasterCredential(
|
||||
cred.password,
|
||||
cred.password.toCharArray(),
|
||||
cred.key?.let { ctx.contentResolver.openInputStream(cred.key)?.readBytes() },
|
||||
hardwareKey
|
||||
)
|
||||
@@ -103,8 +103,8 @@ object FidelityRepository {
|
||||
val newEntry = FidelityEntry(
|
||||
uid=it.nodeId.id.toString(),
|
||||
title=it.title,
|
||||
code=code.protectedValue.stringValue,
|
||||
format=format.protectedValue.stringValue,
|
||||
code=code.protectedValue.toString(),
|
||||
format=format.protectedValue.toString(),
|
||||
protected=code.protectedValue.isProtected,
|
||||
)
|
||||
val idx = entries.indexOfFirst { e -> e.uid == newEntry.uid }
|
||||
@@ -172,7 +172,7 @@ object FidelityRepository {
|
||||
putExtraField(
|
||||
Field(
|
||||
FidelityKeepassFields.FIDELITYFORMAT,
|
||||
ProtectedString(string= entry.format)
|
||||
ProtectedString(true, entry.format.toCharArray())
|
||||
)
|
||||
)
|
||||
if(dbParent!=null) title = entry.title
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
16
build.gradle
16
build.gradle
@@ -1,16 +1,14 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
// ext.kotlin_version = '1.8.20'
|
||||
// ext.android_core_version = '1.10.1'
|
||||
// ext.android_appcompat_version = '1.6.1'
|
||||
// ext.android_material_version = '1.9.0'
|
||||
ext.android_test_version = '1.5.2'
|
||||
ext.joda_time_version = '2.14.1'
|
||||
ext.commons_io_version = '2.21.0'
|
||||
ext.android_test_version = '1.7.0'
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.android.application' version '8.13.0' apply false
|
||||
id 'com.android.library' version '8.13.0' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '2.2.20' apply false
|
||||
id 'com.autonomousapps.dependency-analysis' version '3.1.0' apply true
|
||||
id 'com.android.application' version '9.2.1' apply false
|
||||
id 'com.android.library' version '9.2.1' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '2.3.21' apply false
|
||||
id 'com.autonomousapps.dependency-analysis' version '3.13.0' apply true
|
||||
}
|
||||
2
external/KeePassDX
vendored
2
external/KeePassDX
vendored
Submodule external/KeePassDX updated: 1b98bd740c...581df551ea
@@ -22,3 +22,7 @@ kotlin.code.style=official
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
android.onlyEnableUnitTestForTheTestedBuildType=false
|
||||
android.uniquePackageNames=false
|
||||
android.r8.strictFullModeForKeepRules=false
|
||||
android.dependency.useConstraints=false
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
2
gradlew
vendored
2
gradlew
vendored
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
31
gradlew.bat
vendored
31
gradlew.bat
vendored
@@ -23,8 +23,8 @@
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -65,7 +65,7 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
@@ -73,21 +73,10 @@ goto fail
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
|
||||
@@ -1 +1 @@
|
||||
<p><i>Keepass-Fidelity</i> adds an interface to view/save barcodes (QR included) to Keepass through the plugin interface of the Keepass2Android app.</p><p><br></p><ul><li><b>Launcher:</b> view and launch recent entries (a per entry flag can disable this behaviour)</li><li><b>View:</b> view entries from the history or queried from Keepass2Android</li><li><b>Create:</b> add entries from the camera, an image of by filling out a form. The entry is then created in the Keepass2Android app</li><li><b>Data:</b> the app uses the following data Title (entry name), barcode type (QR, UPC, ...), barcode content (number/text content) and a "secure" flag (enable/disable caching the entry).</li></ul>
|
||||
<p><i>Keepass-Fidelity</i> adds an interface to view&save barcodes (QR included) with a Keepass Database.</p><p><br></p><ul><li><b>Launcher:</b> view and launch recent entries (a per entry flag can disable this behaviour)</li><li><b>View:</b> view entries from loaded from the database</li><li><b>Create:</b> add entries from the camera, an image of by filling out a form. The entry is then created in the database</li><li><b>Data:</b> the app uses the following data Title (entry name), barcode type (QR, UPC, ...), barcode content (number/text content) and a "secure" flag (enable/disable caching the entry).</li></ul>
|
||||
@@ -1 +1 @@
|
||||
Fidelity (Membership/Loyalty) Card plugin for Keepass2Android
|
||||
Fidelity (Membership/Loyalty) Card app with Keepass Database Storage
|
||||
9
patch_submodule.sh
Executable file
9
patch_submodule.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
for file in external/KeePassDX/{crypto,database}/build.gradle; do
|
||||
if [ -f "$file" ]; then
|
||||
sed -i "/id 'kotlin-android'/d" "$file"
|
||||
sed -i "/apply plugin: 'kotlin-android'/d" "$file"
|
||||
sed -i '/kotlinOptions {/,/}/d' "$file"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user