From bec459d486785808b46ab10db6ba67ae47483010 Mon Sep 17 00:00:00 2001 From: JJUYAAA Date: Sun, 31 Aug 2025 23:26:20 +0900 Subject: [PATCH 1/9] =?UTF-8?q?[Refactor]:=20=EC=B9=B4=EC=B9=B4=EC=98=A4?= =?UTF-8?q?=20=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=20=EB=B0=A9=EC=8B=9D=20?= =?UTF-8?q?-=20unlink=EC=97=90=EC=84=9C=20logout=EC=9C=BC=EB=A1=9C=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 --- .../com/texthip/thip/ui/mypage/viewmodel/MyPageViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/texthip/thip/ui/mypage/viewmodel/MyPageViewModel.kt b/app/src/main/java/com/texthip/thip/ui/mypage/viewmodel/MyPageViewModel.kt index 4cb77adc..84bcf07a 100644 --- a/app/src/main/java/com/texthip/thip/ui/mypage/viewmodel/MyPageViewModel.kt +++ b/app/src/main/java/com/texthip/thip/ui/mypage/viewmodel/MyPageViewModel.kt @@ -71,7 +71,7 @@ class MyPageViewModel @Inject constructor( viewModelScope.launch { tokenManager.clearTokens() // 2. 카카오 SDK에서 로그아웃 - UserApiClient.instance.unlink { error -> + UserApiClient.instance.logout { error -> if (error != null) { Log.e("MyPageViewModel", "카카오 로그아웃 실패", error) } else { From 366a66c9d234a66c66f021b030096454f355c5f9 Mon Sep 17 00:00:00 2001 From: JJUYAAA Date: Tue, 2 Sep 2025 15:35:13 +0900 Subject: [PATCH 2/9] =?UTF-8?q?[Refactor]:=20=EA=B5=AC=EA=B8=80=20provider?= =?UTF-8?q?Id=20-=20sub=20=EB=B3=80=EC=88=98=EB=AA=85=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EA=B0=80=EC=A0=B8=EC=98=A4=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 8 +++++-- .../thip/data/repository/AuthRepository.kt | 23 +++++++++++++++---- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d6d11a6d..433dab54 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -108,9 +108,13 @@ dependencies { //implementation ("androidx.datastore:datastore-preferences:1.1.1") // 구글 로그인 - implementation(platform("com.google.firebase:firebase-bom:34.1.0")) - implementation("com.google.firebase:firebase-auth") + //implementation(platform("com.google.firebase:firebase-bom:34.1.0")) + //implementation("com.google.firebase:firebase-auth") implementation("com.google.android.gms:play-services-auth:21.2.0") + + implementation("androidx.credentials:credentials:1.2.2") + implementation("androidx.credentials:credentials-play-services-auth:1.2.2") + } kapt { diff --git a/app/src/main/java/com/texthip/thip/data/repository/AuthRepository.kt b/app/src/main/java/com/texthip/thip/data/repository/AuthRepository.kt index 4b9dbd58..f534fd5f 100644 --- a/app/src/main/java/com/texthip/thip/data/repository/AuthRepository.kt +++ b/app/src/main/java/com/texthip/thip/data/repository/AuthRepository.kt @@ -1,9 +1,6 @@ package com.texthip.thip.data.repository import android.content.Context -import com.google.firebase.Firebase -import com.google.firebase.auth.GoogleAuthProvider -import com.google.firebase.auth.auth import com.kakao.sdk.user.UserApiClient import com.texthip.thip.data.model.auth.request.AuthRequest import com.texthip.thip.data.model.auth.response.AuthResponse @@ -11,7 +8,10 @@ import com.texthip.thip.data.model.base.handleBaseResponse import com.texthip.thip.data.service.AuthService import kotlinx.coroutines.CancellableContinuation import kotlinx.coroutines.suspendCancellableCoroutine -import kotlinx.coroutines.tasks.await +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.jsonObject +import kotlinx.serialization.json.jsonPrimitive +import java.util.Base64 import javax.inject.Inject import javax.inject.Singleton import kotlin.coroutines.resume @@ -35,7 +35,7 @@ class AuthRepository @Inject constructor( } } suspend fun loginWithGoogle(idToken: String): Result { - return runCatching { + /*return runCatching { //Firebase에 구글 ID 토큰으로 로그인 val credential = GoogleAuthProvider.getCredential(idToken, null) val authResult = Firebase.auth.signInWithCredential(credential).await() @@ -46,6 +46,19 @@ class AuthRepository @Inject constructor( authService.checkNewUser(request) .handleBaseResponse() .getOrThrow() + }*/ + return runCatching { + val payload = idToken.split('.')[1]//ID 토큰을 .기준 분리 + val decodedJson = String(Base64.getUrlDecoder().decode(payload))//디코딩 해서 JSON 문자열 반환 + + val jsonObject = Json.parseToJsonElement(decodedJson).jsonObject + val googleSubId = jsonObject["sub"]?.jsonPrimitive?.content ?: throw IllegalStateException("구글 userID (sub)값이 없습니다.")//sub 값 추출 + + //받아온 UID로 신규/기존 유저인지 확인 요청 + val request = AuthRequest(oauth2Id = "google_$googleSubId") + authService.checkNewUser(request) + .handleBaseResponse() + .getOrThrow() } } From 31cbf2fede4ce786e303a47d06659c5e90fd4ebd Mon Sep 17 00:00:00 2001 From: JJUYAAA Date: Tue, 2 Sep 2025 21:55:57 +0900 Subject: [PATCH 3/9] =?UTF-8?q?[Refactor]:=20=ED=9A=8C=EC=9B=90=EA=B0=80?= =?UTF-8?q?=EC=9E=85=20=EC=8B=9C=20=EB=8B=89=EB=84=A4=EC=9E=84=20=EC=86=8C?= =?UTF-8?q?=EB=AC=B8=EC=9E=90=20=EC=9E=85=EB=A0=A5=20=EC=95=88=EB=90=98?= =?UTF-8?q?=EA=B2=8C=EB=81=94=20(#124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/texthip/thip/ui/signin/screen/SignupNicknameScreen.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/texthip/thip/ui/signin/screen/SignupNicknameScreen.kt b/app/src/main/java/com/texthip/thip/ui/signin/screen/SignupNicknameScreen.kt index 3033a780..9b27f717 100644 --- a/app/src/main/java/com/texthip/thip/ui/signin/screen/SignupNicknameScreen.kt +++ b/app/src/main/java/com/texthip/thip/ui/signin/screen/SignupNicknameScreen.kt @@ -100,7 +100,7 @@ fun SignupNicknameContent( WarningTextField( containerColor = colors.DarkGrey02, value = nickname, - onValueChange = onNicknameChange, + onValueChange = { newNickname -> onNicknameChange(newNickname.lowercase()) },//소문자로 즉시 변경 hint = stringResource(R.string.nickname_condition), showWarning = warningMessageResId != null, showIcon = false, From 4cd2380755b8e1fb138e3e1f5af8af27915264fc Mon Sep 17 00:00:00 2001 From: JJUYAAA Date: Tue, 2 Sep 2025 22:09:24 +0900 Subject: [PATCH 4/9] =?UTF-8?q?[Refactor]:=20google-services.json=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=9E=AC=EB=B0=9C=EA=B8=89=20(#124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/google-services.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/google-services.json b/app/google-services.json index c3a720e4..4c8b48d6 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -38,11 +38,11 @@ } }, { - "client_id": "353417813537-lovs0p2tb9kjnjlp493a7098ov0cb2bu.apps.googleusercontent.com", + "client_id": "353417813537-ninddce15lovs82nrklf00hr6hbl1bl0.apps.googleusercontent.com", "client_type": 1, "android_info": { "package_name": "com.texthip.thip", - "certificate_hash": "99315de9382f8b2903131eb4ae926a4739803ef1" + "certificate_hash": "b77b447ac3b50ede99a93a84e79ca867b984a5fa" } }, { From 50cad195e8bedf5a51c0e1daa4a4742d596d355f Mon Sep 17 00:00:00 2001 From: JJUYAAA Date: Tue, 2 Sep 2025 22:12:29 +0900 Subject: [PATCH 5/9] =?UTF-8?q?[Refactor]:=20=EB=8B=89=EB=84=A4=EC=9E=84?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD=20=EC=8B=9C=EC=97=90=EB=8F=84=20=EB=8C=80?= =?UTF-8?q?=EB=AC=B8=EC=9E=90=20=EC=9E=85=EB=A0=A5=20=EC=95=88=20=EB=90=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20(#124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/texthip/thip/ui/mypage/screen/MypageEditScreen.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/texthip/thip/ui/mypage/screen/MypageEditScreen.kt b/app/src/main/java/com/texthip/thip/ui/mypage/screen/MypageEditScreen.kt index 12599855..c749cc1b 100644 --- a/app/src/main/java/com/texthip/thip/ui/mypage/screen/MypageEditScreen.kt +++ b/app/src/main/java/com/texthip/thip/ui/mypage/screen/MypageEditScreen.kt @@ -114,7 +114,7 @@ fun EditProfileContent( WarningTextField( containerColor = colors.DarkGrey02, value = uiState.nickname, - onValueChange = onNicknameChange, + onValueChange = { newNickname -> onNicknameChange(newNickname.lowercase()) }, hint = stringResource(R.string.nickname_condition), showWarning = uiState.nicknameWarningMessageResId != null, showIcon = false, From 10e338a97ecdc669289b6c9680b205dc64624d3d Mon Sep 17 00:00:00 2001 From: JJUYAAA Date: Tue, 2 Sep 2025 23:00:57 +0900 Subject: [PATCH 6/9] =?UTF-8?q?[Chore]:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0=20(#124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 433dab54..1d79ed0c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -108,8 +108,6 @@ dependencies { //implementation ("androidx.datastore:datastore-preferences:1.1.1") // 구글 로그인 - //implementation(platform("com.google.firebase:firebase-bom:34.1.0")) - //implementation("com.google.firebase:firebase-auth") implementation("com.google.android.gms:play-services-auth:21.2.0") implementation("androidx.credentials:credentials:1.2.2") From aafc4134bd66066962f9887abc7610605769b396 Mon Sep 17 00:00:00 2001 From: JJUYAAA Date: Tue, 2 Sep 2025 23:02:00 +0900 Subject: [PATCH 7/9] =?UTF-8?q?[Chore]:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0=20(#124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../texthip/thip/data/repository/AuthRepository.kt | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/app/src/main/java/com/texthip/thip/data/repository/AuthRepository.kt b/app/src/main/java/com/texthip/thip/data/repository/AuthRepository.kt index f534fd5f..ff69d8f5 100644 --- a/app/src/main/java/com/texthip/thip/data/repository/AuthRepository.kt +++ b/app/src/main/java/com/texthip/thip/data/repository/AuthRepository.kt @@ -35,18 +35,6 @@ class AuthRepository @Inject constructor( } } suspend fun loginWithGoogle(idToken: String): Result { - /*return runCatching { - //Firebase에 구글 ID 토큰으로 로그인 - val credential = GoogleAuthProvider.getCredential(idToken, null) - val authResult = Firebase.auth.signInWithCredential(credential).await() - val googleUid = authResult.user?.uid ?: throw IllegalStateException("Google User UID is null") - - //받아온 UID로 신규/기존 유저인지 확인 요청 - val request = AuthRequest(oauth2Id = "google_$googleUid") - authService.checkNewUser(request) - .handleBaseResponse() - .getOrThrow() - }*/ return runCatching { val payload = idToken.split('.')[1]//ID 토큰을 .기준 분리 val decodedJson = String(Base64.getUrlDecoder().decode(payload))//디코딩 해서 JSON 문자열 반환 From 992ffb3ab5f5ed95a17b1682d0ad52c2bbfc30a1 Mon Sep 17 00:00:00 2001 From: JJUYAAA Date: Thu, 4 Sep 2025 16:43:46 +0900 Subject: [PATCH 8/9] =?UTF-8?q?[Refactor]:=20google-services.json=20gitign?= =?UTF-8?q?ore=20=EC=B6=94=EA=B0=80=20(#124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d33521..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml From e12595e8d3e2d2d525e453ee1e986d13e850344d Mon Sep 17 00:00:00 2001 From: JJUYAAA Date: Thu, 4 Sep 2025 19:06:08 +0900 Subject: [PATCH 9/9] =?UTF-8?q?[Refactor]:=20google-services.json=20gitign?= =?UTF-8?q?ore=20=EC=B6=94=EA=B0=80=20(#124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- app/google-services.json | 71 ----------------------------- app/src/main/res/values/strings.xml | 2 +- 3 files changed, 3 insertions(+), 73 deletions(-) delete mode 100644 app/google-services.json diff --git a/.gitignore b/.gitignore index 4a76db27..97174e4e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ local.properties .idea/deploymentTargetSelector.xml .idea/misc.xml .idea/gradle.xml -.idea/appInsightsSettings.xml \ No newline at end of file +.idea/appInsightsSettings.xml +/app/google-services.json \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json deleted file mode 100644 index 4c8b48d6..00000000 --- a/app/google-services.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "project_info": { - "project_number": "353417813537", - "project_id": "thip-3a698", - "storage_bucket": "thip-3a698.firebasestorage.app" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:353417813537:android:69029c2bc957df7fab4d60", - "android_client_info": { - "package_name": "com.texthip.thip" - } - }, - "oauth_client": [ - { - "client_id": "353417813537-1q82ucn3u64be1idm53dqecqh65jqr8b.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.texthip.thip", - "certificate_hash": "c5598e96d1aface5acbc3b1a82d94b57ed7979f5" - } - }, - { - "client_id": "353417813537-gqd3v6turdn9l26rfeorapgj55pe4nd4.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.texthip.thip", - "certificate_hash": "1f2681ba8d7a53b61b3a10214109763221ed6150" - } - }, - { - "client_id": "353417813537-ihcvubi6dsbsbq1psgbr1sqj0g4i4c17.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.texthip.thip", - "certificate_hash": "673c2d448182cb54e88248b18ba155fb25891115" - } - }, - { - "client_id": "353417813537-ninddce15lovs82nrklf00hr6hbl1bl0.apps.googleusercontent.com", - "client_type": 1, - "android_info": { - "package_name": "com.texthip.thip", - "certificate_hash": "b77b447ac3b50ede99a93a84e79ca867b984a5fa" - } - }, - { - "client_id": "353417813537-ck9g1v0qprlb5nf4dvasinim403eng0f.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyCFzpbeT-8JQCGxiSKuVXMvcNNYFtl6Fuo" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "353417813537-ck9g1v0qprlb5nf4dvasinim403eng0f.apps.googleusercontent.com", - "client_type": 3 - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 24c043da..8976d38e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -445,6 +445,6 @@ 과학/IT - 353417813537-ck9g1v0qprlb5nf4dvasinim403eng0f.apps.googleusercontent.com + 211189590640-a2ul4bnsvislm12ov7k8eu61mtketl8d.apps.googleusercontent.com \ No newline at end of file