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
19 changes: 16 additions & 3 deletions SPOTeam_android/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.util.Properties

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
Expand All @@ -6,6 +8,10 @@ plugins {
id("com.google.devtools.ksp")
}

val properties = Properties().apply {
load(project.rootProject.file("local.properties").inputStream())
}

android {
namespace = "com.example.spoteam_android"
compileSdk = 34
Expand All @@ -17,6 +23,12 @@ android {
versionCode = 1
versionName = "1.0"

buildConfigField("String", "BASE_URL", properties["base.url"].toString())
buildConfigField("String", "KAKAO_NATIVE_KEY", "\"${properties["kakao.native.key"]}\"")
buildConfigField("String", "NAVER_CLIENT_ID", "\"${properties["naver.client.id"]}\"")
buildConfigField("String", "NAVER_CLIENT_SECRET", "\"${properties["naver.client.secret"]}\"")
buildConfigField("String", "PUBLIC_API_KEY", "\"${properties["public.api.key"]}\"")

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -30,15 +42,16 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}
buildFeatures {
viewBinding = true
dataBinding = true
buildConfig = true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AuthInterceptor(private val context: Context) : Interceptor {
// 새로운 액세스 및 리프레시 토큰 요청
private fun getNewTokens(refreshToken: String): TokenResult? {
val retrofit = Retrofit.Builder()
.baseUrl("https://www.teamspot.site/")
.baseUrl(BuildConfig.BASE_URL)
.addConverterFactory(GsonConverterFactory.create())
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import dagger.hilt.android.HiltAndroidApp
class GlobalApplication: Application() {
override fun onCreate() {
super.onCreate()
KakaoSdk.init(this, "7878cb24cec56458df067991de5e7786")
KakaoSdk.init(this, BuildConfig.KAKAO_NATIVE_KEY)
NaverIdLoginSDK.initialize(
this,
"PgLxwOn8SAdjXBkdilNA",
"jx5U6lWiCq",
"SPOT",
BuildConfig.NAVER_CLIENT_ID,
BuildConfig.NAVER_CLIENT_SECRET,
"SPOT"
)
var keyHash = Utility.getKeyHash(this)

Log.i("GlobalApplication", "$keyHash")

if (BuildConfig.DEBUG) {
val keyHash = Utility.getKeyHash(this)
Log.i("SpotApplication", "KeyHash: $keyHash")
}
RetrofitInstance.initialize(this)

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import java.util.concurrent.TimeUnit

object RetrofitInstance {

private const val BASE_URL = "https://www.teamspot.site/"
private var authToken: String? = null
private var isInitialized = false
private lateinit var appContext: Context
Expand Down Expand Up @@ -100,7 +99,7 @@ object RetrofitInstance {
throw IllegalStateException("RetrofitInstance.initialize()를 먼저 호출하세요!")
}
Retrofit.Builder()
.baseUrl(BASE_URL)
.baseUrl(BuildConfig.BASE_URL)
.client(okHttpClient)
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.example.spoteam_android.util

import com.example.spoteam_android.BuildConfig

class ApiKey {
companion object{
const val API_KEY = "FvYRzkfj%2B6KF9%2BCJT9ic2wJkmTwSS9xG9XVtwxMbqVEEu6z%2FR4gzSWKeIJgEXjLQhuIyc3v5bDbsz3wfDz%2FX7Q%3D%3D"
const val API_KEY = BuildConfig.PUBLIC_API_KEY
}
}