Skip to content

Commit 5d05068

Browse files
authored
Merge pull request #16 from YAPP-Github/BOOK-62-feature/#14
feat: 클라이언트단 카카오 로그인 구현
2 parents e7e6dd4 + ee826c5 commit 5d05068

23 files changed

Lines changed: 597 additions & 7 deletions

File tree

app/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@file:Suppress("INLINE_FROM_HIGHER_PLATFORM")
22

3+
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
4+
35
plugins {
46
alias(libs.plugins.booket.android.application)
57
alias(libs.plugins.booket.android.application.compose)
@@ -9,6 +11,11 @@ plugins {
911
android {
1012
namespace = "com.ninecraft.booket"
1113

14+
defaultConfig {
15+
buildConfigField("String", "KAKAO_NATIVE_APP_KEY", getApiKey("KAKAO_NATIVE_APP_KEY"))
16+
manifestPlaceholders["KAKAO_NATIVE_APP_KEY"] = getApiKey("KAKAO_NATIVE_APP_KEY").trim('"')
17+
}
18+
1219
buildTypes {
1320
release {
1421
isMinifyEnabled = false
@@ -40,9 +47,14 @@ dependencies {
4047
libs.androidx.activity.compose,
4148
libs.androidx.startup,
4249
libs.logger,
50+
libs.kakao.auth,
4351

4452
libs.bundles.circuit,
4553
)
4654
api(libs.circuit.codegen.annotation)
4755
ksp(libs.circuit.codegen.ksp)
4856
}
57+
58+
fun getApiKey(propertyKey: String): String {
59+
return gradleLocalProperties(rootDir, providers).getProperty(propertyKey)
60+
}

app/proguard-rules.pro

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,20 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
#-renamesourcefileattribute SourceFile
22+
23+
# Kakao Login
24+
-keep class com.kakao.sdk.**.model.* { <fields>; }
25+
26+
# https://github.com/square/okhttp/pull/6792
27+
-dontwarn org.bouncycastle.jsse.**
28+
-dontwarn org.conscrypt.*
29+
-dontwarn org.openjsse.**
30+
31+
# refrofit2 (with r8 full mode)
32+
-if interface * { @retrofit2.http.* <methods>; }
33+
-keep,allowobfuscation interface <1>
34+
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
35+
-if interface * { @retrofit2.http.* public *** *(...); }
36+
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
37+
-keep,allowobfuscation,allowshrinking class retrofit2.Response

app/src/main/AndroidManifest.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5+
<uses-permission android:name="android.permission.INTERNET" />
6+
57
<application
68
android:name=".BooketApplication"
79
android:allowBackup="true"
@@ -24,8 +26,30 @@
2426
android:name="com.ninecraft.booket.initializer.LoggerInitializer"
2527
android:value="androidx.startup" />
2628

29+
<meta-data
30+
android:name="com.ninecraft.booket.initializer.KakaoSdkInitializer"
31+
android:value="androidx.startup" />
32+
2733
</provider>
2834

35+
<activity
36+
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
37+
android:exported="true">
38+
39+
<intent-filter>
40+
<action android:name="android.intent.action.VIEW" />
41+
42+
<category android:name="android.intent.category.DEFAULT" />
43+
<category android:name="android.intent.category.BROWSABLE" />
44+
45+
<data
46+
android:host="oauth"
47+
android:scheme="kakao${KAKAO_NATIVE_APP_KEY}" />
48+
49+
</intent-filter>
50+
51+
</activity>
52+
2953
</application>
3054

3155
</manifest>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.ninecraft.booket.initializer
2+
3+
import android.content.Context
4+
import androidx.startup.Initializer
5+
import com.kakao.sdk.common.KakaoSdk
6+
import com.ninecraft.booket.BuildConfig
7+
8+
class KakaoSdkInitializer : Initializer<Unit> {
9+
10+
override fun create(context: Context) {
11+
KakaoSdk.init(context, BuildConfig.KAKAO_NATIVE_APP_KEY)
12+
}
13+
14+
override fun dependencies(): List<Class<out Initializer<*>>> {
15+
return emptyList()
16+
}
17+
}

build-logic/src/main/kotlin/AndroidFeatureConventionPlugin.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ internal class AndroidFeatureConventionPlugin : Plugin<Project> {
1919

2020
dependencies {
2121
implementation(project(path = ":core:designsystem"))
22+
implementation(project(path = ":core:ui"))
2223

2324
implementation(libs.bundles.circuit)
2425

core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/theme/Color.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ val Pink80 = Color(0xFFEFB8C8)
99
val Purple40 = Color(0xFF6650a4)
1010
val PurpleGrey40 = Color(0xFF625b71)
1111
val Pink40 = Color(0xFF7D5260)
12+
13+
val Kakao = Color(0xFFFBD300)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
<resources>
22
<string name="app_name">Booket</string>
3+
<string name="network_error_message">네트워크 연결이 불안해요.\n잠시후 다시 이용해주세요.</string>
4+
<string name="server_error_message">이용에 불편을 드려 죄송합니다.\n잠시후 다시 이용해주세요.</string>
5+
<string name="unknown_error_message">알 수 없는 오류가 발생하였습니다.</string>
36
</resources>

core/network/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ android {
1717
}
1818

1919
buildTypes {
20-
getByName("debug") {
20+
debug {
2121
buildConfigField("String", "SERVER_BASE_URL", getServerBaseUrl("DEBUG_SERVER_BASE_URL"))
2222
}
2323

24-
getByName("release") {
24+
release {
2525
buildConfigField("String", "SERVER_BASE_URL", getServerBaseUrl("RELEASE_SERVER_BASE_URL"))
2626
}
2727
}

core/ui/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

core/ui/build.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@file:Suppress("INLINE_FROM_HIGHER_PLATFORM")
2+
3+
plugins {
4+
alias(libs.plugins.booket.android.library)
5+
alias(libs.plugins.booket.android.library.compose)
6+
}
7+
8+
android {
9+
namespace = "com.ninecraft.booket.core.ui"
10+
}
11+
12+
dependencies {
13+
implementations(
14+
projects.core.designsystem,
15+
16+
libs.logger,
17+
)
18+
}

0 commit comments

Comments
 (0)