Fix polling interval settings and add release build signing
- Fix polling interval not reflecting saved value (use SharingStarted.Eagerly) - Add release build signing configuration with keystore - Add key.properties to .gitignore for security - Add ProGuard rules for JSpecify annotations
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -19,6 +19,9 @@ captures/
|
|||||||
*.jks
|
*.jks
|
||||||
*.keystore
|
*.keystore
|
||||||
|
|
||||||
|
# Key properties (contains sensitive signing info)
|
||||||
|
app/key.properties
|
||||||
|
|
||||||
# External native build folder generated in Android Studio 2.2 and later
|
# External native build folder generated in Android Studio 2.2 and later
|
||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
.cxx/
|
.cxx/
|
||||||
|
|||||||
@@ -1,3 +1,14 @@
|
|||||||
|
import java.util.Properties
|
||||||
|
import java.io.FileInputStream
|
||||||
|
|
||||||
|
// Load keystore properties
|
||||||
|
val keystorePropertiesFile = rootProject.file("app/key.properties")
|
||||||
|
val keystoreProperties = Properties()
|
||||||
|
if (keystorePropertiesFile.exists()) {
|
||||||
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id("org.jetbrains.kotlin.android")
|
id("org.jetbrains.kotlin.android")
|
||||||
@@ -6,35 +17,45 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.hotdeal.alarm"
|
namespace = "com.hotdeal.alarm"
|
||||||
compileSdk = 35
|
compileSdk = 35
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.hotdeal.alarm"
|
applicationId = "com.hotdeal.alarm"
|
||||||
minSdk = 31
|
minSdk = 31
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 1
|
versionCode = 1
|
||||||
versionName = "1.0.0"
|
versionName = "1.0.0"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
useSupportLibrary = true
|
useSupportLibrary = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
signingConfigs {
|
||||||
release {
|
create("release") {
|
||||||
isMinifyEnabled = true
|
keyAlias = keystoreProperties["keyAlias"] as String?
|
||||||
isShrinkResources = true
|
keyPassword = keystoreProperties["keyPassword"] as String?
|
||||||
proguardFiles(
|
storeFile = keystoreProperties["storeFile"]?.let { file("$it") }
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
storePassword = keystoreProperties["storePassword"] as String?
|
||||||
"proguard-rules.pro"
|
}
|
||||||
)
|
}
|
||||||
}
|
|
||||||
debug {
|
buildTypes {
|
||||||
isMinifyEnabled = false
|
release {
|
||||||
}
|
isMinifyEnabled = true
|
||||||
}
|
isShrinkResources = true
|
||||||
|
proguardFiles(
|
||||||
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
|
"proguard-rules.pro"
|
||||||
|
)
|
||||||
|
signingConfig = signingConfigs.getByName("release")
|
||||||
|
}
|
||||||
|
debug {
|
||||||
|
isMinifyEnabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
|||||||
4
app/proguard-rules.pro
vendored
4
app/proguard-rules.pro
vendored
@@ -16,3 +16,7 @@
|
|||||||
# Kotlin Coroutines
|
# Kotlin Coroutines
|
||||||
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
|
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
|
||||||
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
|
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
|
||||||
|
|
||||||
|
# JSpecify annotations (for Jsoup compatibility)
|
||||||
|
-dontwarn org.jspecify.annotations.**
|
||||||
|
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ class MainViewModel @Inject constructor(
|
|||||||
private val _uiState = MutableStateFlow<MainUiState>(MainUiState.Loading)
|
private val _uiState = MutableStateFlow<MainUiState>(MainUiState.Loading)
|
||||||
val uiState: StateFlow<MainUiState> = _uiState.asStateFlow()
|
val uiState: StateFlow<MainUiState> = _uiState.asStateFlow()
|
||||||
|
|
||||||
// 폴<EFBFBD> 주기
|
// 폴링 주기 (저장된 값 즉시 반영)
|
||||||
val pollingInterval: StateFlow<Int> = appSettings.pollingInterval
|
val pollingInterval: StateFlow<Int> = appSettings.pollingInterval
|
||||||
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), 2)
|
.stateIn(viewModelScope, SharingStarted.Eagerly, 2)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
initializeApp()
|
initializeApp()
|
||||||
|
|||||||
Reference in New Issue
Block a user