Skip to content

Commit

Permalink
[fix]: Fix Kakao Api Key
Browse files Browse the repository at this point in the history
  • Loading branch information
kez-lab committed Jan 3, 2024
1 parent 3e804a1 commit dcb394e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/develop_PR_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ jobs:
- name: Change gradlew permissions
run: chmod +x ./gradlew

- name: Add Local Properties
env:
KAKAO_API_KEY: ${{ secrets.KAKAO_API_KEY }}
run: |
echo kakaoApiKey=$KAKAO_API_KEY >> ./local.properties
- name: Access Firebase Service
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json

Expand Down
10 changes: 0 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties

plugins {
hmh("application")
hmh("compose")
Expand All @@ -16,14 +14,6 @@ android {
applicationId = "com.hmh.hamyeonham"
versionCode = libs.versions.versionCode.get().toInt()
versionName = libs.versions.appVersion.get()

buildConfigField(
"String",
"KAKAO_NATIVE_APP_KEY",
gradleLocalProperties(rootDir).getProperty("kakao.native.app.key"),
)
manifestPlaceholders["KAKAO_NATIVE_APP_KEY"] =
gradleLocalProperties(rootDir).getProperty("kakao.native.app.key")
}

signingConfigs {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<category android:name="android.intent.category.BROWSABLE" />

<data android:host="oauth"
android:scheme="kakao${KAKAO_NATIVE_APP_KEY}" />
android:scheme="kakao${kakaoApiKey}" />
</intent-filter>
</activity>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/hmh/hamyeonham/SampleActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SampleActivity : AppCompatActivity() {
}

private fun initKakaoSdk() {
KakaoSdk.init(this, BuildConfig.KAKAO_NATIVE_APP_KEY)
KakaoSdk.init(this, BuildConfig.KAKAO_API_KEY)
}

private fun initSplashAnimation(splashScreen: SplashScreen) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import java.util.Properties

internal fun Project.configureAndroidCommonPlugin() {

Expand All @@ -18,7 +17,13 @@ internal fun Project.configureAndroidCommonPlugin() {
apply<AndroidHiltPlugin>()

extensions.getByType<BaseExtension>().apply {
defaultConfig {}
defaultConfig {
val kakaoApiKey = properties["kakaoApiKey"] as? String ?: ""

manifestPlaceholders["kakaoApiKey"] = properties["kakaoApiKey"] as? String ?: ""

buildConfigField("String", "KAKAO_API_KEY", "\"${kakaoApiKey}\"")
}
buildFeatures.apply {
viewBinding = true
buildConfig = true
Expand Down

0 comments on commit dcb394e

Please sign in to comment.