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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 10 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import java.time.Instant
plugins {
alias(libs.plugins.self.application)
alias(libs.plugins.self.compose)
alias(libs.plugins.self.room)
alias(libs.plugins.androidx.room)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.ksp)
}

val baseVersionName = "0.2.5"
Expand Down Expand Up @@ -87,9 +88,13 @@ androidComponents.onVariants { variant ->
}
}

room3 {
schemaDirectory("$projectDir/schemas")
}

dependencies {
implementation(project(":brand"))
implementation(project(":core"))
implementation(project(":logo"))

implementation(libs.androidx.activity.compose)
implementation(libs.androidx.appcompat)
Expand All @@ -106,10 +111,13 @@ dependencies {
implementation(libs.androidx.lifecycle.viewmodel.navigation3)
implementation(libs.androidx.navigation3.runtime)
implementation(libs.androidx.navigation3.ui)
implementation(libs.androidx.room.runtime)
ksp(libs.androidx.room.compiler)
implementation(libs.koin.android)
implementation(libs.koin.compose)
implementation(libs.koin.compose.navigation3)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.datetime)
implementation(libs.kotlinx.serialization.json)
implementation(libs.kotlinx.serialization.protobuf)
}
87 changes: 87 additions & 0 deletions app/schemas/dev.sanmer.authenticator.database.AppDatabase/3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"formatVersion": 1,
"database": {
"version": 3,
"identityHash": "e6844b57f2d0ab509a4ff97ac517ab00",
"entities": [
{
"tableName": "Auth",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY NOT NULL, `name` TEXT NOT NULL, `issuer` TEXT NOT NULL, `type` TEXT NOT NULL, `trashedAt` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "issuer",
"columnName": "issuer",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "trashedAt",
"columnName": "trashedAt",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"id"
],
"algorithm": "ROWID"
}
},
{
"tableName": "AuthProperty",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`authId` INTEGER NOT NULL, `key` TEXT NOT NULL, `value` TEXT NOT NULL, PRIMARY KEY(`authId`, `key`))",
"fields": [
{
"fieldPath": "authId",
"columnName": "authId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "key",
"columnName": "key",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "value",
"columnName": "value",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"authId",
"key"
]
}
}
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'e6844b57f2d0ab509a4ff97ac517ab00')"
]
}
}
52 changes: 2 additions & 50 deletions app/src/debug/res/drawable/launcher_foreground.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,10 @@
android:translateX="6.72"
android:translateY="6.72">
<path
android:pathData="M9,9v-1a3,3 0,0 1,6 0v1"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:strokeColor="@color/launcher_tint"
android:strokeLineCap="round" />
<path
android:pathData="M8,9h8a6,6 0,0 1,1 3v3a5,5 0,0 1,-10 0v-3a6,6 0,0 1,1 -3"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:strokeColor="@color/launcher_tint"
android:strokeLineCap="round" />
<path
android:pathData="M3,13l4,0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:strokeColor="@color/launcher_tint"
android:strokeLineCap="round" />
<path
android:pathData="M17,13l4,0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:strokeColor="@color/launcher_tint"
android:strokeLineCap="round" />
<path
android:pathData="M12,20l0,-6"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:strokeColor="@color/launcher_tint"
android:strokeLineCap="round" />
<path
android:pathData="M4,19l3.35,-2"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:strokeColor="@color/launcher_tint"
android:strokeLineCap="round" />
<path
android:pathData="M20,19l-3.35,-2"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:strokeColor="@color/launcher_tint"
android:strokeLineCap="round" />
<path
android:pathData="M4,7l3.75,2.4"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:strokeColor="@color/launcher_tint"
android:strokeLineCap="round" />
<path
android:pathData="M20,7l-3.75,2.4"
android:pathData="M8,22v-14a4,4 0,0 1,4 -4h0.5a3.5,3.5 0,0 1,0 7h-0.5h0.5a4.5,4.5 0,1 1,-4.5 4.5v-0.5"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:strokeColor="@color/launcher_tint"
android:strokeLineCap="round" />
</group>
</vector>
</vector>
3 changes: 0 additions & 3 deletions app/src/debug/res/drawable/launcher_splash.xml

This file was deleted.

26 changes: 8 additions & 18 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,29 @@

<application
android:name=".App"
android:enableOnBackInvokedCallback="true"
android:icon="@mipmap/launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:enableOnBackInvokedCallback="true"
tools:targetApi="36">

<activity
android:name=".ui.MainActivity"
android:launchMode="singleTask"
android:exported="true"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<activity
android:name=".ui.AuthorizeActivity"
android:theme="@style/AppTheme.Transparent"
android:exported="false"
android:noHistory="true"
android:excludeFromRecents="true"
android:windowSoftInputMode="adjustResize">
</activity>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<activity
android:name=".ui.CryptoActivity"
android:theme="@style/AppTheme.Transparent"
android:exported="false"
android:noHistory="true"
android:excludeFromRecents="true"
android:windowSoftInputMode="adjustResize">
<data android:scheme="otpauth" />
</intent-filter>
</activity>

</application>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/kotlin/dev/sanmer/authenticator/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import androidx.camera.camera2.Camera2Config
import androidx.camera.core.CameraXConfig
import dev.sanmer.authenticator.di.DataStore
import dev.sanmer.authenticator.di.Database
import dev.sanmer.authenticator.di.Navigation
import dev.sanmer.authenticator.di.Repositories
import dev.sanmer.authenticator.ui.di.Navigation
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin
Expand Down
19 changes: 19 additions & 0 deletions app/src/main/kotlin/dev/sanmer/authenticator/Const.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
package dev.sanmer.authenticator

import kotlinx.datetime.LocalDate
import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.LocalTime
import kotlinx.datetime.format.char
import kotlin.time.Instant

object Const {
const val GITHUB_URL = "https://github.com/SanmerApps/Authenticator"

val INSTANT_ZERO = Instant.fromEpochSeconds(0, 0)
inline val Instant.isZero get() = this == INSTANT_ZERO

val TIME_DISPLAY = LocalTime.Format {
hour(); char(':'); minute(); char(':'); second()
}

val DATETIME_DISPLAY = LocalDateTime.Format {
date(LocalDate.Formats.ISO)
char(' ')
time(TIME_DISPLAY)
}
}
Loading
Loading