695c54f03c
- onResume() no longer triggers a refresh every time — only fetches when data is >5 min stale, so returning to app shows cached data instantly without a loading spinner - Fix CancellationException being swallowed by catch(Exception) in refreshUsage(), which caused updates to run on a destroyed activity - EncryptedSharedPreferences key invalidation (caused by enabling/changing biometrics or screen lock) now deletes the stale encrypted file and recreates it cleanly, rather than silently using empty fallback prefs - Wrap all securePrefs read/write ops in try-catch so a mid-session Keystore failure degrades gracefully instead of crashing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
75 lines
1.9 KiB
Kotlin
75 lines
1.9 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
}
|
|
|
|
android {
|
|
namespace = "me.khodak.claudeusage"
|
|
compileSdk = 34
|
|
|
|
defaultConfig {
|
|
applicationId = "me.khodak.claudeusage"
|
|
minSdk = 26
|
|
targetSdk = 34
|
|
versionCode = 9
|
|
versionName = "1.8"
|
|
}
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
storeFile = file("claude-widget-release.keystore")
|
|
storePassword = "ClaudeWidget2026!"
|
|
keyAlias = "claudewidget"
|
|
keyPassword = "ClaudeWidget2026!"
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
|
signingConfig = signingConfigs.getByName("release")
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
|
|
buildFeatures {
|
|
viewBinding = true
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation("androidx.core:core-ktx:1.12.0")
|
|
implementation("androidx.appcompat:appcompat:1.6.1")
|
|
implementation("com.google.android.material:material:1.11.0")
|
|
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
|
|
|
// HTTP
|
|
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
|
|
|
// JSON
|
|
implementation("com.google.code.gson:gson:2.10.1")
|
|
|
|
// Background work
|
|
implementation("androidx.work:work-runtime-ktx:2.9.0")
|
|
|
|
// Secure storage
|
|
implementation("androidx.security:security-crypto:1.1.0-alpha06")
|
|
|
|
// Coroutines
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
|
|
|
|
// Lifecycle
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
|
|
}
|