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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .gradle/8.13/checksums/checksums.lock
Binary file not shown.
Binary file modified .gradle/8.13/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/8.13/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/8.13/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/8.13/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/8.13/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions .gradle/config.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Fri Oct 10 14:17:17 KST 2025
java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
#Mon Oct 13 17:27:02 KST 2025
java.home=C\:\\Program Files\\Android\\Android Studio\\jbr
Comment on lines +1 to +2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Remove this file from version control.

.gradle/config.properties contains machine-specific configuration (Java home path) and should not be committed to the repository. This file is automatically generated by Gradle and differs across development environments.

Add this file to .gitignore:

+# Gradle cache
+.gradle/

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In .gradle/config.properties lines 1-2: this file contains machine-specific
Gradle/Java configuration and must be removed from version control; stop
tracking it and add a pattern to .gitignore. Remove the tracked file using git
rm --cached .gradle/config.properties (do not delete local file), add an entry
".gradle/config.properties" or simply ".gradle/" to .gitignore, and commit the
changes so the file remains local but is no longer in the repo.

Binary file modified .gradle/file-system.probe
Binary file not shown.
324 changes: 312 additions & 12 deletions .idea/caches/deviceStreaming.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

154 changes: 137 additions & 17 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 42 additions & 19 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
import java.util.Properties

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.devtools.ksp)
alias(libs.plugins.dagger.hilt)


}

val properties = Properties().apply {
load(project.rootProject.file("local.properties").inputStream())
}
Comment on lines +14 to +16
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: BASE_URL loading will fail in other environments.

Loading BASE_URL from local.properties (which should not be in VCS) will cause build failures on other developers' machines and in CI/CD pipelines.

Consider these alternatives:

Option 1: BuildConfig with flavor-specific defaults

 android {
     namespace = "com.hsLink.hslink"
     compileSdk = libs.versions.compileSdk.get().toInt()
 
+    flavorDimensions += "environment"
+    productFlavors {
+        create("dev") {
+            dimension = "environment"
+            buildConfigField("String", "BASE_URL", "\"https://dev-api.example.com\"")
+        }
+        create("prod") {
+            dimension = "environment"
+            buildConfigField("String", "BASE_URL", "\"https://api.example.com\"")
+        }
+    }
+
     defaultConfig {
         applicationId = "com.hsLink.hslink"
         minSdk = libs.versions.minSdk.get().toInt()
         targetSdk = libs.versions.targetSdk.get().toInt()
         versionCode = libs.versions.versionCode.get().toInt()
         versionName = libs.versions.versionName.get()
 
         testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
-        buildConfigField("String", "BASE_URL", properties["base.url"].toString())
     }

Option 2: Environment variables with local.properties fallback

-val properties = Properties().apply {
-    load(project.rootProject.file("local.properties").inputStream())
-}
+val localProperties = Properties()
+val localPropertiesFile = rootProject.file("local.properties")
+if (localPropertiesFile.exists()) {
+    localProperties.load(localPropertiesFile.inputStream())
+}
+val baseUrl = System.getenv("BASE_URL") 
+    ?: localProperties.getProperty("base.url") 
+    ?: "\"https://api.example.com\""

 android {
     // ...
     defaultConfig {
         // ...
-        buildConfigField("String", "BASE_URL", properties["base.url"].toString())
+        buildConfigField("String", "BASE_URL", baseUrl)
     }

Also applies to: 29-29

🤖 Prompt for AI Agents
In app/build.gradle.kts around lines 14-16 (also applies to line 29), loading
BASE_URL directly from local.properties will break builds on other machines and
CI; instead add a robust fallback strategy: define BASE_URL in the Android
buildConfig (or flavor-specific BuildConfig fields) with a safe default, and
modify the gradle script to first read from an environment variable
(System.getenv("BASE_URL")) and only if absent read local.properties as a
fallback; ensure the BuildConfig field is set from that resolved value so CI and
other devs can override via env var without requiring local.properties in VCS.

android {
namespace = "com.hsLink.hslink"
compileSdk = 36
compileSdk = libs.versions.compileSdk.get().toInt()

defaultConfig {
applicationId = "com.hsLink.hslink"
minSdk = 24
targetSdk = 36
versionCode = 1
versionName = "1.0"
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
versionCode = libs.versions.versionCode.get().toInt()
versionName = libs.versions.versionName.get()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
buildConfigField("String", "BASE_URL", properties["base.url"].toString())
}

buildTypes {
Expand All @@ -36,24 +47,36 @@ android {
}
buildFeatures {
compose = true
buildConfig = true
}

}

dependencies {

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.test.manifest)
androidTestImplementation(libs.bundles.test)

debugImplementation(libs.bundles.debug)

implementation(libs.bundles.androidx)
implementation(platform(libs.androidx.compose.bom))

implementation(libs.kotlinx.immutable)

implementation(platform(libs.okhttp.bom))
implementation(libs.bundles.okhttp)
implementation(libs.bundles.retrofit)
implementation(libs.kotlinx.serialization.json)

implementation(libs.bundles.hilt)
ksp(libs.hilt.compiler)

implementation(libs.coil.compose)

implementation(libs.timber)

implementation(libs.accompanist.systemuicontroller)

}
8 changes: 5 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

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

<application
android:name=".HsuConnectApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand All @@ -12,7 +14,7 @@
android:supportsRtl="true"
android:theme="@style/Theme.HsLink">
<activity
android:name=".MainActivity"
android:name=".presentation.main.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.HsLink">
Expand Down
25 changes: 25 additions & 0 deletions app/src/main/java/com/hsLink/hslink/HsuConnectApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.hsLink.hslink

import android.app.Application
import androidx.appcompat.app.AppCompatDelegate
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber


@HiltAndroidApp
class HsuConnectApplication : Application() {
override fun onCreate() {
super.onCreate()

setTimber()
setDarkMode()
}

private fun setTimber() {
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree())
}

private fun setDarkMode() {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
}
}
Loading