From 9758607482ffcf067adbfaf0329d7db74e5bb22f Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Tue, 30 Jan 2024 04:21:58 +0900 Subject: [PATCH 01/11] =?UTF-8?q?[FEAT]=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EA=B4=80=EB=A0=A8=20=ED=99=98?= =?UTF-8?q?=EA=B2=BD=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/android.yml | 1 + app/build.gradle.kts | 6 ++++++ app/src/main/AndroidManifest.xml | 4 ++++ .../android/initializer/KakaoSdkInitializer.kt | 17 +++++++++++++++++ gradle/libs.versions.toml | 2 ++ settings.gradle.kts | 1 + 6 files changed, 31 insertions(+) create mode 100644 app/src/main/kotlin/com/nexters/ilab/android/initializer/KakaoSdkInitializer.kt diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 1f9ff216..a0f3aac5 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -35,6 +35,7 @@ jobs: - name: Generate secrets.properties run: | echo "SERVER_BASE_URL=${{ secrets.SERVER_BASE_URL }}" >> secrets.properties + echo "KAKAO_NATIVE_APP_KEY=${{ secrets.KAKAO_NATIVE_APP_KEY }}" >> secrets.properties - name: test Detekt run: ./gradlew detekt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b04d3568..5875f920 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -4,6 +4,7 @@ plugins { alias(libs.plugins.ilab.android.application) alias(libs.plugins.ilab.android.application.compose) alias(libs.plugins.ilab.android.hilt) + alias(libs.plugins.google.secrets) } android { @@ -44,5 +45,10 @@ dependencies { libs.androidx.splash, libs.androidx.startup, libs.timber, + libs.kakao.auth, ) } + +secrets { + defaultPropertiesFileName = "secrets.properties" +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b9c07384..76f47e4f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -26,6 +26,10 @@ android:name="com.nexters.ilab.android.initializer.TimberInitializer" android:value="androidx.startup" /> + + diff --git a/app/src/main/kotlin/com/nexters/ilab/android/initializer/KakaoSdkInitializer.kt b/app/src/main/kotlin/com/nexters/ilab/android/initializer/KakaoSdkInitializer.kt new file mode 100644 index 00000000..e529c02c --- /dev/null +++ b/app/src/main/kotlin/com/nexters/ilab/android/initializer/KakaoSdkInitializer.kt @@ -0,0 +1,17 @@ +package com.nexters.ilab.android.initializer + +import android.content.Context +import androidx.startup.Initializer +import com.kakao.sdk.common.KakaoSdk +import com.nexters.ilab.android.BuildConfig + +class KakaoSDKInitializer: Initializer { + + override fun create(context: Context) { + KakaoSdk.init(context, BuildConfig.KAKAO_NATIVE_APP_KEY) + } + + override fun dependencies(): List>> { + return emptyList() + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a4236765..f9e372e3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -43,6 +43,7 @@ firebase-crashlytics = "2.9.9" ksp = "1.9.22-1.0.16" orbit-core = "4.6.1" kotest = "5.8.0" +kakao-auth = "2.19.0" [libraries] @@ -94,6 +95,7 @@ orbit-viewmodel = { group = "org.orbit-mvi", name = "orbit-viewmodel", version.r orbit-compose = { group = "org.orbit-mvi", name = "orbit-compose", version.ref = "orbit-core" } coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil-compose" } compose-shimmer = { group = "com.valentinilk.shimmer", name = "compose-shimmer", version.ref = "compose-shimmer" } +kakao-auth = { group = "com.kakao.sdk", name = "v2-user", version.ref = "kakao-auth" } kotest-runner = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "kotest" } kotest-assertion = { module = "io.kotest:kotest-assertions-core-jvm", version.ref = "kotest" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 60777f27..8da24929 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,6 +17,7 @@ dependencyResolutionManagement { repositories { google() mavenCentral() + maven { url = uri("https://devrepo.kakao.com/nexus/content/groups/public/") } } } From e6503c2140227beee608ef67273bff59d1fd765a Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Tue, 30 Jan 2024 10:40:14 +0900 Subject: [PATCH 02/11] =?UTF-8?q?[FEAT]=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20?= =?UTF-8?q?=EC=86=8C=EC=85=9C=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=EC=9D=84=20?= =?UTF-8?q?=ED=86=B5=ED=95=9C=20=EC=97=91=EC=84=B8=EC=8A=A4=20=ED=86=A0?= =?UTF-8?q?=ED=81=B0=20=EB=B0=8F=20=EB=B0=8F=20=EC=9C=A0=EC=A0=80=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EB=B0=9B=EC=95=84=EC=98=A4=EB=8A=94=20?= =?UTF-8?q?=ED=8C=8C=ED=8A=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 16 +++++ .../initializer/KakaoSdkInitializer.kt | 2 +- .../com/nexters/ilab/android/Android.kt | 2 +- .../src/main/res/values/strings.xml | 9 ++- feature/login/build.gradle.kts | 1 + .../android/feature/login/LoginActivity.kt | 3 +- .../ilab/android/feature/login/LoginScreen.kt | 72 +++++++++++++++++-- .../android/feature/login/LoginSideEffect.kt | 9 +++ .../ilab/android/feature/login/LoginState.kt | 5 ++ .../android/feature/login/LoginViewModel.kt | 30 +++++++- feature/main/src/main/AndroidManifest.xml | 6 -- gradle/libs.versions.toml | 4 +- 12 files changed, 139 insertions(+), 20 deletions(-) create mode 100644 feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginSideEffect.kt create mode 100644 feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginState.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 76f47e4f..b263954d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -32,6 +32,22 @@ + + + + + + + + + + + + diff --git a/app/src/main/kotlin/com/nexters/ilab/android/initializer/KakaoSdkInitializer.kt b/app/src/main/kotlin/com/nexters/ilab/android/initializer/KakaoSdkInitializer.kt index e529c02c..e37fc669 100644 --- a/app/src/main/kotlin/com/nexters/ilab/android/initializer/KakaoSdkInitializer.kt +++ b/app/src/main/kotlin/com/nexters/ilab/android/initializer/KakaoSdkInitializer.kt @@ -5,7 +5,7 @@ import androidx.startup.Initializer import com.kakao.sdk.common.KakaoSdk import com.nexters.ilab.android.BuildConfig -class KakaoSDKInitializer: Initializer { +class KakaoSDKInitializer : Initializer { override fun create(context: Context) { KakaoSdk.init(context, BuildConfig.KAKAO_NATIVE_APP_KEY) diff --git a/build-logic/src/main/kotlin/com/nexters/ilab/android/Android.kt b/build-logic/src/main/kotlin/com/nexters/ilab/android/Android.kt index d1be9c42..f7f965aa 100644 --- a/build-logic/src/main/kotlin/com/nexters/ilab/android/Android.kt +++ b/build-logic/src/main/kotlin/com/nexters/ilab/android/Android.kt @@ -34,7 +34,7 @@ internal fun Project.configureAndroid(extension: CommonExtension<*, *, *, *, *>) isMinifyEnabled = true proguardFiles( getDefaultProguardFile("proguard-android.txt"), - "proguard-rules.pro" + "proguard-rules.pro", ) } } diff --git a/core/designsystem/src/main/res/values/strings.xml b/core/designsystem/src/main/res/values/strings.xml index f4587d80..bf8dad6d 100644 --- a/core/designsystem/src/main/res/values/strings.xml +++ b/core/designsystem/src/main/res/values/strings.xml @@ -1,8 +1,13 @@ + 네트워크 연결이 원활하지 않습니다. + 알 수 없는 오류가 발생하였습니다. + 카메라 마이페이지 - 네트워크 연결이 원활하지 않습니다. - 알 수 없는 오류가 발생하였습니다. + + + 카카오 로그인 + diff --git a/feature/login/build.gradle.kts b/feature/login/build.gradle.kts index 621ad628..aca99daa 100644 --- a/feature/login/build.gradle.kts +++ b/feature/login/build.gradle.kts @@ -12,5 +12,6 @@ dependencies { implementations( libs.androidx.core, libs.timber, + libs.kakao.auth, ) } diff --git a/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginActivity.kt b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginActivity.kt index 2e337fe8..1ffcb75f 100644 --- a/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginActivity.kt +++ b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginActivity.kt @@ -21,13 +21,12 @@ class LoginActivity : ComponentActivity() { setContent { ILabTheme { LoginRoute( - onLoginClick = { + navigateToHome = { mainNavigator.navigateFrom( activity = this, withFinish = true, ) }, - onShowErrorSnackBar = {}, viewModel = viewModel, ) } diff --git a/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginScreen.kt b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginScreen.kt index 97f5720b..83d5aaab 100644 --- a/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginScreen.kt +++ b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginScreen.kt @@ -1,34 +1,96 @@ package com.nexters.ilab.android.feature.login +import android.widget.Toast import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.height import androidx.compose.material3.Button +import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.kakao.sdk.auth.model.OAuthToken +import com.kakao.sdk.common.model.AuthError +import com.kakao.sdk.user.UserApiClient +import com.nexters.ilab.android.core.common.UiText +import com.nexters.ilab.android.core.designsystem.R +import timber.log.Timber -@Suppress("unused") @Composable internal fun LoginRoute( - onLoginClick: () -> Unit, - onShowErrorSnackBar: (throwable: Throwable?) -> Unit, + navigateToHome: () -> Unit, viewModel: LoginViewModel = hiltViewModel(), ) { + val uiState by viewModel.container.stateFlow.collectAsStateWithLifecycle() + val context = LocalContext.current + + val kakaoCallback: (OAuthToken?, Throwable?) -> Unit = { token, error -> + when { + error != null -> when { + (error is AuthError && error.response.error == "ProtocolError") -> { + Timber.e("로그인 실패: ${error.response.error}, ${error.response.errorDescription}") + viewModel.setErrorMessage(UiText.StringResource(R.string.error_message_network)) + } + + else -> { + Timber.e("로그인 실패: ${error.message}") + viewModel.setErrorMessage(UiText.StringResource(R.string.error_message_unknown)) + } + } + + token != null -> UserApiClient.instance.me { user, _ -> + user?.let { + Timber.d("로그인 성공: ${token.accessToken}, ${it.kakaoAccount?.name}, ${it.kakaoAccount?.profile?.profileImageUrl}") + viewModel.kakaoLogin() + } ?: viewModel.setErrorMessage(UiText.StringResource(R.string.error_message_unknown)) + } + + else -> viewModel.setErrorMessage(UiText.StringResource(R.string.error_message_unknown)) + } + } + + LaunchedEffect(viewModel) { + viewModel.container.sideEffectFlow.collect { sideEffect -> + when (sideEffect) { + is LoginSideEffect.KakaoLogin -> { + if (UserApiClient.instance.isKakaoTalkLoginAvailable(context)) { + UserApiClient.instance.loginWithKakaoTalk(context, callback = kakaoCallback) + } else { + UserApiClient.instance.loginWithKakaoAccount(context, callback = kakaoCallback) + } + } + + is LoginSideEffect.LoginSuccess -> navigateToHome() + is LoginSideEffect.ShowToast -> Toast.makeText(context, sideEffect.message.asString(context), Toast.LENGTH_SHORT).show() + } + } + } + LoginScreen( - onLoginClick = onLoginClick, + uiState = uiState, + onLoginClick = viewModel::onLoginButtonClick, ) } @Composable internal fun LoginScreen( + uiState: LoginState, onLoginClick: () -> Unit, ) { + if (uiState.isLoading) { + CircularProgressIndicator() + } + Column( modifier = Modifier.fillMaxSize(), verticalArrangement = Arrangement.Center, @@ -39,7 +101,7 @@ internal fun LoginScreen( Button( onClick = onLoginClick, ) { - Text(text = "Login") + Text(text = stringResource(id = R.string.kakao_login)) } } } diff --git a/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginSideEffect.kt b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginSideEffect.kt new file mode 100644 index 00000000..23e48f5c --- /dev/null +++ b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginSideEffect.kt @@ -0,0 +1,9 @@ +package com.nexters.ilab.android.feature.login + +import com.nexters.ilab.android.core.common.UiText + +sealed interface LoginSideEffect { + data object KakaoLogin : LoginSideEffect + data object LoginSuccess : LoginSideEffect + data class ShowToast(val message: UiText) : LoginSideEffect +} diff --git a/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginState.kt b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginState.kt new file mode 100644 index 00000000..e4e2331d --- /dev/null +++ b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginState.kt @@ -0,0 +1,5 @@ +package com.nexters.ilab.android.feature.login + +data class LoginState( + val isLoading: Boolean = false, +) diff --git a/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginViewModel.kt b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginViewModel.kt index b2df1708..d177a3de 100644 --- a/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginViewModel.kt +++ b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginViewModel.kt @@ -1,8 +1,36 @@ package com.nexters.ilab.android.feature.login import androidx.lifecycle.ViewModel +import com.nexters.ilab.android.core.common.UiText import dagger.hilt.android.lifecycle.HiltViewModel +import org.orbitmvi.orbit.ContainerHost +import org.orbitmvi.orbit.syntax.simple.intent +import org.orbitmvi.orbit.syntax.simple.postSideEffect +import org.orbitmvi.orbit.syntax.simple.reduce +import org.orbitmvi.orbit.viewmodel.container import javax.inject.Inject @HiltViewModel -class LoginViewModel @Inject constructor() : ViewModel() +class LoginViewModel @Inject constructor() : ViewModel(), ContainerHost { + + override val container = container(LoginState()) + + fun onLoginButtonClick() = intent { + postSideEffect(LoginSideEffect.KakaoLogin) + } + + fun kakaoLogin() = intent { + reduce { + state.copy(isLoading = true) + } + // TODO repository function call + reduce { + state.copy(isLoading = false) + } + postSideEffect(LoginSideEffect.LoginSuccess) + } + + fun setErrorMessage(message: UiText) = intent { + postSideEffect(LoginSideEffect.ShowToast(message)) + } +} diff --git a/feature/main/src/main/AndroidManifest.xml b/feature/main/src/main/AndroidManifest.xml index 1c51eb10..1705e95c 100644 --- a/feature/main/src/main/AndroidManifest.xml +++ b/feature/main/src/main/AndroidManifest.xml @@ -8,12 +8,6 @@ android:exported="false" android:theme="@style/Theme.Ilab"> - - - - - - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f9e372e3..736a51a3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -43,7 +43,7 @@ firebase-crashlytics = "2.9.9" ksp = "1.9.22-1.0.16" orbit-core = "4.6.1" kotest = "5.8.0" -kakao-auth = "2.19.0" +kakao-core = "2.19.0" [libraries] @@ -95,7 +95,7 @@ orbit-viewmodel = { group = "org.orbit-mvi", name = "orbit-viewmodel", version.r orbit-compose = { group = "org.orbit-mvi", name = "orbit-compose", version.ref = "orbit-core" } coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil-compose" } compose-shimmer = { group = "com.valentinilk.shimmer", name = "compose-shimmer", version.ref = "compose-shimmer" } -kakao-auth = { group = "com.kakao.sdk", name = "v2-user", version.ref = "kakao-auth" } +kakao-auth = { group = "com.kakao.sdk", name = "v2-user", version.ref = "kakao-core" } kotest-runner = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "kotest" } kotest-assertion = { module = "io.kotest:kotest-assertions-core-jvm", version.ref = "kotest" } From 6d3c1daee11455a38ced8465b266850f8839cd32 Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Wed, 31 Jan 2024 00:29:33 +0900 Subject: [PATCH 03/11] =?UTF-8?q?[CHORE]=20=EC=A3=BC=EC=84=9D=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b263954d..3dd6d168 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -41,7 +41,6 @@ - From 70cd9d45a60c0162301fb129fe4acc2f19b83e6f Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Wed, 31 Jan 2024 00:46:39 +0900 Subject: [PATCH 04/11] =?UTF-8?q?[FEAT]=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20Ac?= =?UTF-8?q?cessToken,=20nickname,=20profileUrl=20=EA=B0=80=EC=A0=B8?= =?UTF-8?q?=EC=98=A4=EA=B8=B0=20=EC=84=B1=EA=B3=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit email 을 비지니스 앱으로 등록해야하기 얻어올 수 있기 때문에 닉네임을 가져오는 것으로 변경 --- .../com/nexters/ilab/android/feature/login/LoginScreen.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginScreen.kt b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginScreen.kt index 83d5aaab..1eb728bb 100644 --- a/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginScreen.kt +++ b/feature/login/src/main/kotlin/com/nexters/ilab/android/feature/login/LoginScreen.kt @@ -50,7 +50,7 @@ internal fun LoginRoute( token != null -> UserApiClient.instance.me { user, _ -> user?.let { - Timber.d("로그인 성공: ${token.accessToken}, ${it.kakaoAccount?.name}, ${it.kakaoAccount?.profile?.profileImageUrl}") + Timber.d("로그인 성공: ${token.accessToken}, ${it.kakaoAccount?.profile?.nickname}, ${it.kakaoAccount?.profile?.profileImageUrl}") viewModel.kakaoLogin() } ?: viewModel.setErrorMessage(UiText.StringResource(R.string.error_message_unknown)) } From 565fb6dec5a47b7a946331ca634f71966f817492 Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Wed, 31 Jan 2024 13:48:01 +0900 Subject: [PATCH 05/11] =?UTF-8?q?[DOCS]=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20SD?= =?UTF-8?q?K=20=EB=82=9C=EB=8F=85=ED=99=94=EC=97=90=EC=84=9C=20=EC=A0=9C?= =?UTF-8?q?=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/proguard-rules.pro | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 481bb434..f04e6592 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -18,4 +18,8 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +# kakao login +-keep class com.kakao.sdk.**.model.* { ; } +-keep class * extends com.google.gson.TypeAdapter From d49046ea5d0ab64e8ee0bc41b4dd3c77dad29617 Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Wed, 31 Jan 2024 14:00:56 +0900 Subject: [PATCH 06/11] =?UTF-8?q?[DOCS]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EB=AA=A8=EB=93=88=EC=97=90=EB=8F=84=20=EC=B9=B4=EC=B9=B4?= =?UTF-8?q?=EC=98=A4=20SDK=20=EB=82=9C=EB=8F=85=ED=99=94=EC=97=90=EC=84=9C?= =?UTF-8?q?=20=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/login/proguard-rules.pro | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 feature/login/proguard-rules.pro diff --git a/feature/login/proguard-rules.pro b/feature/login/proguard-rules.pro new file mode 100644 index 00000000..f04e6592 --- /dev/null +++ b/feature/login/proguard-rules.pro @@ -0,0 +1,25 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +# kakao login +-keep class com.kakao.sdk.**.model.* { ; } +-keep class * extends com.google.gson.TypeAdapter From 8b92777c37f472457c28b6b351dc28ee34a463eb Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Wed, 31 Jan 2024 14:10:05 +0900 Subject: [PATCH 07/11] =?UTF-8?q?[DOCS]=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20SD?= =?UTF-8?q?K=20=EB=82=9C=EB=8F=85=ED=99=94=20=EA=B4=80=EB=A0=A8=20proguard?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/proguard-rules.pro | 1 + feature/login/proguard-rules.pro | 1 + 2 files changed, 2 insertions(+) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index f04e6592..5881a406 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -23,3 +23,4 @@ # kakao login -keep class com.kakao.sdk.**.model.* { ; } -keep class * extends com.google.gson.TypeAdapter +-keep interface com.kakao.sdk.**.*Api diff --git a/feature/login/proguard-rules.pro b/feature/login/proguard-rules.pro index f04e6592..5881a406 100644 --- a/feature/login/proguard-rules.pro +++ b/feature/login/proguard-rules.pro @@ -23,3 +23,4 @@ # kakao login -keep class com.kakao.sdk.**.model.* { ; } -keep class * extends com.google.gson.TypeAdapter +-keep interface com.kakao.sdk.**.*Api From 769e0f976d8f45026edb9ac83be013a09f222a55 Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Wed, 31 Jan 2024 14:28:46 +0900 Subject: [PATCH 08/11] =?UTF-8?q?[DOCS]=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20SD?= =?UTF-8?q?K=20=EB=82=9C=EB=8F=85=ED=99=94=20=EA=B4=80=EB=A0=A8=20proguard?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/proguard-rules.pro | 2 +- feature/login/proguard-rules.pro | 26 -------------------------- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 feature/login/proguard-rules.pro diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 5881a406..816a5f32 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -21,6 +21,6 @@ #-renamesourcefileattribute SourceFile # kakao login --keep class com.kakao.sdk.**.model.* { ; } +-keep class com.kakao.sdk.**.model.* { *; } -keep class * extends com.google.gson.TypeAdapter -keep interface com.kakao.sdk.**.*Api diff --git a/feature/login/proguard-rules.pro b/feature/login/proguard-rules.pro deleted file mode 100644 index 5881a406..00000000 --- a/feature/login/proguard-rules.pro +++ /dev/null @@ -1,26 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile - -# kakao login --keep class com.kakao.sdk.**.model.* { ; } --keep class * extends com.google.gson.TypeAdapter --keep interface com.kakao.sdk.**.*Api From 96a54b580fd81dc4fb33ec52fa88eb56ed3c49b0 Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:12:51 +0900 Subject: [PATCH 09/11] =?UTF-8?q?[DOCS]=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20sd?= =?UTF-8?q?k=20=EA=B4=80=EB=A0=A8=20proguard=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/proguard-rules.pro | 8 +++++--- feature/login/proguard-rules.pro | 24 ++++++++++++++++++++++++ gradle.properties | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 feature/login/proguard-rules.pro diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 816a5f32..e1c04d21 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -21,6 +21,8 @@ #-renamesourcefileattribute SourceFile # kakao login --keep class com.kakao.sdk.**.model.* { *; } --keep class * extends com.google.gson.TypeAdapter --keep interface com.kakao.sdk.**.*Api +-keep class com.kakao.sdk.**.model.* { ; } + +#R8 full mode strips generic signatures from return types if not kept. +-if interface * { @retrofit2.http.* public *** *(...); } +-keep,allowoptimization,allowshrinking,allowobfuscation class <3> diff --git a/feature/login/proguard-rules.pro b/feature/login/proguard-rules.pro new file mode 100644 index 00000000..9b342448 --- /dev/null +++ b/feature/login/proguard-rules.pro @@ -0,0 +1,24 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile + +-dontwarn java.lang.invoke.StringConcatFactory + diff --git a/gradle.properties b/gradle.properties index 3c5031eb..2cbd6d19 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,4 +20,4 @@ kotlin.code.style=official # Enables namespacing of each library's R class so that its R class includes only the # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library -android.nonTransitiveRClass=true \ No newline at end of file +android.nonTransitiveRClass=true From 34acaea403a65b1bbde8c67a7b29289da36512ef Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:34:11 +0900 Subject: [PATCH 10/11] =?UTF-8?q?[FEAT]=20release,=20debug=20=EB=A1=9C=20?= =?UTF-8?q?=EC=95=B1=EC=9D=84=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit release -> I'Lab debug -> I'Lab.dev --- app/build.gradle.kts | 18 ++++++++++++++++++ app/src/main/AndroidManifest.xml | 2 +- app/src/main/res/values/strings.xml | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 470c1211..289924a7 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -19,6 +19,24 @@ android { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } + + buildTypes { + getByName("debug") { + isDebuggable = true + applicationIdSuffix = ".dev" + manifestPlaceholders += mapOf( + "appName" to "@string/app_name_dev", + ) + } + + getByName("release") { + isDebuggable = false + signingConfig = signingConfigs.getByName("debug") + manifestPlaceholders += mapOf( + "appName" to "@string/app_name", + ) + } + } } dependencies { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 209c2a23..1664bfab 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,7 +15,7 @@ android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="@xml/backup_rules" android:icon="@mipmap/ic_launcher" - android:label="@string/app_name" + android:label="${appName}" android:roundIcon="@mipmap/ic_launcher_round" android:screenOrientation="portrait" android:supportsRtl="true" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 83ed740f..36f55c76 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ I\'Lab + I\'Lab.dev From 279717f273ea12a6086c56910cd09b79ef360a61 Mon Sep 17 00:00:00 2001 From: JI HUN LEE <51016231+easyhooon@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:38:43 +0900 Subject: [PATCH 11/11] =?UTF-8?q?[DOCS]=20proguard-rules.pro=20=EC=A3=BC?= =?UTF-8?q?=EC=84=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/proguard-rules.pro | 3 ++- feature/login/proguard-rules.pro | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index e1c04d21..0cbdb7df 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -23,6 +23,7 @@ # kakao login -keep class com.kakao.sdk.**.model.* { ; } -#R8 full mode strips generic signatures from return types if not kept. +# https://devtalk.kakao.com/t/method-authapi-issueaccesstoken/130860/4 +# R8 full mode strips generic signatures from return types if not kept. -if interface * { @retrofit2.http.* public *** *(...); } -keep,allowoptimization,allowshrinking,allowobfuscation class <3> diff --git a/feature/login/proguard-rules.pro b/feature/login/proguard-rules.pro index 9b342448..1f7bbad8 100644 --- a/feature/login/proguard-rules.pro +++ b/feature/login/proguard-rules.pro @@ -20,5 +20,6 @@ # hide the original source file name. #-renamesourcefileattribute SourceFile +# https://stackoverflow.com/questions/70037537/proguard-missing-classes-detected-while-running-r8-after-adding-package-names-in -dontwarn java.lang.invoke.StringConcatFactory