From c350cb0401602725daab9e483febb0003b862592 Mon Sep 17 00:00:00 2001 From: Sungyong An Date: Sat, 26 Oct 2024 18:00:16 +0900 Subject: [PATCH] Remove all codes for kakao share --- app/build.gradle | 2 - app/dependencies/releaseRuntimeClasspath.txt | 8 +-- app/proguard-rules.pro | 4 -- app/src/debug/res/values/credentials.xml | 4 -- app/src/main/AndroidManifest.xml | 9 --- .../soup/movie/startup/KakaoInitializer.kt | 32 --------- .../java/soup/movie/ui/main/MainActivity.kt | 5 -- app/src/main/res/values/credentials.xml | 2 - .../core/designsystem/icon/MovieIcons.kt | 1 - .../main/res/drawable/ic_logo_kakaotalk.xml | 30 --------- feature/deeplink/build.gradle | 2 - .../soup/movie/feature/deeplink/KakaoLink.kt | 66 ------------------- .../soup/movie/feature/detail/DetailShare.kt | 40 ----------- gradle/libs.versions.toml | 2 - 14 files changed, 1 insertion(+), 206 deletions(-) delete mode 100644 app/src/debug/res/values/credentials.xml delete mode 100644 app/src/main/java/soup/movie/startup/KakaoInitializer.kt delete mode 100644 core/designsystem/src/main/res/drawable/ic_logo_kakaotalk.xml delete mode 100644 feature/deeplink/src/main/java/soup/movie/feature/deeplink/KakaoLink.kt diff --git a/app/build.gradle b/app/build.gradle index 7bac58d61..e66096a0d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -138,8 +138,6 @@ dependencies { implementation libs.androidx.profileinstaller - implementation libs.kakao.share - testImplementation projects.testing androidTestImplementation projects.testing androidTestImplementation libs.androidx.benchmark.macro.junit4 diff --git a/app/dependencies/releaseRuntimeClasspath.txt b/app/dependencies/releaseRuntimeClasspath.txt index 3b94c776e..618ebb40e 100644 --- a/app/dependencies/releaseRuntimeClasspath.txt +++ b/app/dependencies/releaseRuntimeClasspath.txt @@ -149,7 +149,7 @@ com.google.android.gms:play-services-measurement:22.0.0 com.google.android.gms:play-services-stats:17.0.2 com.google.android.gms:play-services-tasks:18.1.0 com.google.code.findbugs:jsr305:3.0.2 -com.google.code.gson:gson:2.8.9 +com.google.code.gson:gson:2.8.6 com.google.dagger:dagger-lint-aar:2.52 com.google.dagger:dagger:2.52 com.google.dagger:hilt-android:2.52 @@ -185,18 +185,12 @@ com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava com.google.j2objc:j2objc-annotations:1.3 com.google.protobuf:protobuf-javalite:3.21.11 com.jakewharton.timber:timber:5.0.1 -com.kakao.sdk:v2-common:2.20.1 -com.kakao.sdk:v2-network:2.20.1 -com.kakao.sdk:v2-share:2.20.1 -com.kakao.sdk:v2-template:2.20.1 com.naver.maps:geometry:1.3.0 com.naver.maps:map-sdk:3.18.0 -com.squareup.okhttp3:logging-interceptor:4.9.2 com.squareup.okhttp3:okhttp-brotli:4.10.0 com.squareup.okhttp3:okhttp:4.12.0 com.squareup.okio:okio-jvm:3.8.0 com.squareup.okio:okio:3.8.0 -com.squareup.retrofit2:converter-gson:2.9.0 com.squareup.retrofit2:converter-kotlinx-serialization:2.11.0 com.squareup.retrofit2:retrofit:2.11.0 com.webtoonscorp.android:readmore-foundation:1.5.6 diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index c8d09f9d3..01cb56896 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -24,10 +24,6 @@ -dontwarn android.support.** -dontwarn androidx.** -# Kakao SDK --keep class com.kakao.sdk.**.model.* { ; } --keep class * extends com.google.gson.TypeAdapter - # Crashlytics -keep class com.crashlytics.** { *; } -dontwarn com.crashlytics.** diff --git a/app/src/debug/res/values/credentials.xml b/app/src/debug/res/values/credentials.xml deleted file mode 100644 index a6392e9cd..000000000 --- a/app/src/debug/res/values/credentials.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 1556a5cdcb6e9d3896e6a6cd4144a995 - diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4ddd96e14..0bd2c9eb7 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -38,9 +38,6 @@ - @@ -61,9 +58,6 @@ - @@ -81,9 +75,6 @@ - { - - override fun create(context: Context) { - KakaoSdk.init(context = context, appKey = context.getString(R.string.kakao_app_key)) - } - - override fun dependencies(): List>> { - return emptyList() - } -} diff --git a/app/src/main/java/soup/movie/ui/main/MainActivity.kt b/app/src/main/java/soup/movie/ui/main/MainActivity.kt index ed8f33810..8ecb6d296 100644 --- a/app/src/main/java/soup/movie/ui/main/MainActivity.kt +++ b/app/src/main/java/soup/movie/ui/main/MainActivity.kt @@ -29,7 +29,6 @@ import soup.movie.config.RemoteConfig import soup.movie.core.designsystem.theme.MovieTheme import soup.movie.core.designsystem.windowsizeclass.calculateWindowSizeClass import soup.movie.feature.deeplink.FirebaseLink -import soup.movie.feature.deeplink.KakaoLink import soup.movie.feature.tasks.RecommendMoviesTasks import javax.inject.Inject @@ -79,10 +78,6 @@ class MainActivity : AppCompatActivity() { FirebaseLink.extractMovieId(intent) { movieId -> if (movieId != null) { viewModel.requestMovie(movieId) - } else { - KakaoLink.extractMovieId(intent)?.let { - viewModel.requestMovie(it) - } } } } diff --git a/app/src/main/res/values/credentials.xml b/app/src/main/res/values/credentials.xml index 9cf87e3b3..72884dbb3 100644 --- a/app/src/main/res/values/credentials.xml +++ b/app/src/main/res/values/credentials.xml @@ -1,6 +1,4 @@ - 56edfbbe3bc2086b8a1f8eb198456ae8 - kakao56edfbbe3bc2086b8a1f8eb198456ae8 prd264z8ie diff --git a/core/designsystem/src/main/java/soup/movie/core/designsystem/icon/MovieIcons.kt b/core/designsystem/src/main/java/soup/movie/core/designsystem/icon/MovieIcons.kt index a3028e8fe..99a5af086 100644 --- a/core/designsystem/src/main/java/soup/movie/core/designsystem/icon/MovieIcons.kt +++ b/core/designsystem/src/main/java/soup/movie/core/designsystem/icon/MovieIcons.kt @@ -64,7 +64,6 @@ object MovieIcons { val LoadingLogo = R.drawable.ic_loading_logo val Facebook = R.drawable.ic_logo_facebook val Instagram = R.drawable.ic_logo_instagram - val KakaoTalk = R.drawable.ic_logo_kakaotalk val Line = R.drawable.ic_logo_line val More = R.drawable.ic_logo_more val Twitter = R.drawable.ic_logo_twitter diff --git a/core/designsystem/src/main/res/drawable/ic_logo_kakaotalk.xml b/core/designsystem/src/main/res/drawable/ic_logo_kakaotalk.xml deleted file mode 100644 index b41e3076b..000000000 --- a/core/designsystem/src/main/res/drawable/ic_logo_kakaotalk.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/feature/deeplink/build.gradle b/feature/deeplink/build.gradle index 4179bda26..d7ea47ba2 100644 --- a/feature/deeplink/build.gradle +++ b/feature/deeplink/build.gradle @@ -13,6 +13,4 @@ dependencies { implementation platform(libs.firebase.bom) implementation libs.firebase.dynamiclinks - - implementation libs.kakao.share } diff --git a/feature/deeplink/src/main/java/soup/movie/feature/deeplink/KakaoLink.kt b/feature/deeplink/src/main/java/soup/movie/feature/deeplink/KakaoLink.kt deleted file mode 100644 index 19549e9d7..000000000 --- a/feature/deeplink/src/main/java/soup/movie/feature/deeplink/KakaoLink.kt +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2021 SOUP - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package soup.movie.feature.deeplink - -import android.content.Context -import android.content.Intent -import android.widget.Toast -import com.kakao.sdk.share.ShareClient -import com.kakao.sdk.template.model.Content -import com.kakao.sdk.template.model.FeedTemplate -import com.kakao.sdk.template.model.Link -import soup.movie.log.Logger - -// TODO: Make this class to private -object KakaoLink { - - private const val MOVIE_ID = "movieId" - - fun extractMovieId(intent: Intent?): String? { - return if (intent?.action == Intent.ACTION_VIEW) { - intent.data?.getQueryParameter(MOVIE_ID) - } else { - null - } - } - - fun share( - context: Context, - movieId: String, - imageUrl: String, - title: String, - description: String, - ) { - val defaultFeed = FeedTemplate( - Content( - title = title, - description = description, - imageUrl = imageUrl, - link = Link( - androidExecutionParams = mapOf(MOVIE_ID to movieId), - ), - ), - ) - ShareClient.instance.shareDefault(context, defaultFeed) { sharingResult, error -> - if (error != null) { - Toast.makeText(context, "실행할 앱을 찾을 수 없습니다.", Toast.LENGTH_SHORT).show() - Logger.e(error) - } else if (sharingResult != null) { - context.startActivity(sharingResult.intent) - } - } - } -} diff --git a/feature/detail/src/main/java/soup/movie/feature/detail/DetailShare.kt b/feature/detail/src/main/java/soup/movie/feature/detail/DetailShare.kt index 62a597d58..25f65cba8 100644 --- a/feature/detail/src/main/java/soup/movie/feature/detail/DetailShare.kt +++ b/feature/detail/src/main/java/soup/movie/feature/detail/DetailShare.kt @@ -42,7 +42,6 @@ import androidx.core.app.ShareCompat import soup.movie.core.designsystem.icon.MovieIcons import soup.movie.core.designsystem.theme.MovieTheme import soup.movie.feature.deeplink.FirebaseLink -import soup.movie.feature.deeplink.KakaoLink import soup.movie.model.MovieModel import soup.movie.resources.R @@ -135,23 +134,6 @@ internal fun DetailShare( ) } } - IconButton( - onClick = { - context.shareToKakaoTalk(movie) - }, - modifier = Modifier.padding(top = 4.dp), - ) { - Surface( - shape = CircleShape, - modifier = Modifier.requiredSize(48.dp).padding(all = 4.dp), - ) { - Image( - painterResource(MovieIcons.KakaoTalk), - contentDescription = null, - modifier = Modifier.fillMaxSize(), - ) - } - } IconButton( onClick = { context.shareToOthers(movie) @@ -172,28 +154,6 @@ internal fun DetailShare( } } -private fun Context.shareToKakaoTalk(movie: MovieModel) { - KakaoLink.share( - context = this, - movieId = movie.id, - imageUrl = movie.posterUrl, - title = movie.title, - description = buildString { - append(movie.openDate) - val ageLabel = getString( - when { - movie.age >= 19 -> R.string.movie_age_19 - movie.age >= 15 -> R.string.movie_age_15 - movie.age >= 12 -> R.string.movie_age_12 - movie.age >= 0 -> R.string.movie_age_all - else -> R.string.movie_age_unknown - }, - ) - append(" / $ageLabel") - }, - ) -} - private fun Context.shareToFacebook(movie: MovieModel) { shareText(movie, "com.facebook.katana") } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0e3f7bc30..af2818add 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -48,7 +48,6 @@ coil = "2.6.0" dependencyGuard = "0.5.0" retrofit = "2.11.0" timber = "5.0.1" -kakao = "2.20.1" [libraries] @@ -152,7 +151,6 @@ coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" } retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } retrofit-serialization = { module = "com.squareup.retrofit2:converter-kotlinx-serialization", version.ref = "retrofit" } -kakao-share = { module = "com.kakao.sdk:v2-share", version.ref = "kakao" } timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }