Skip to content

Commit

Permalink
[feature/fix_build] sentry 제거 및 retrofit proguard 수정 (#541)
Browse files Browse the repository at this point in the history
* [feature/fix-build] Remove sentry

* [feature/fix-build] fix retrofit proguard conflict
  • Loading branch information
librarywon authored Jul 23, 2024
1 parent 433d6d7 commit 34dc5dc
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 22 deletions.
1 change: 0 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
pophory("application")
pophory("compose")
pophory("test")
alias(libs.plugins.sentry)
alias(libs.plugins.google.services)
alias(libs.plugins.app.distribution)
alias(libs.plugins.crashlytics)
Expand Down
6 changes: 6 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn com.google.auto.service.AutoService
-dontwarn net.ltgt.gradle.incap.IncrementalAnnotationProcessor
-dontwarn net.ltgt.gradle.incap.IncrementalAnnotationProcessorType

##---------------End: Retrofit ----------

##---------------Begin: OkHttp -------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import com.teampophory.pophory.ad.usecase.SetAdConstantUseCase
import com.teampophory.pophory.domain.usecase.ConfigureMeUseCase
import com.teampophory.pophory.feature.home.store.model.AlbumItem
import dagger.hilt.android.lifecycle.HiltViewModel
import io.sentry.Sentry
import io.sentry.protocol.User
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharedFlow
Expand All @@ -36,13 +34,7 @@ class HomeViewModel @Inject constructor(

init {
viewModelScope.launch {
configureMeUseCase()?.let {
val user = User().apply {
username = it.nickname
name = it.realName
}
Sentry.setUser(user)
}
configureMeUseCase()
getAdConstantUseCase("android", BuildConfig.VERSION_NAME).onSuccess {
it.forEach { adConstant ->
Timber.d("adConstant: $adConstant")
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ plugins {
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.kotlinx.serialization) apply false
alias(libs.plugins.sentry) apply false
alias(libs.plugins.junit5) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.app.distribution) apply false
Expand Down
1 change: 0 additions & 1 deletion core/network/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
pophory("feature")
alias(libs.plugins.sentry)
}

android {
Expand Down
2 changes: 0 additions & 2 deletions data/ad/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
pophory("feature")
alias(libs.plugins.sentry)
}

android {
Expand All @@ -12,5 +11,4 @@ dependencies {
implementation(projects.core.common)
implementation(projects.core.network)
implementation(libs.security)
implementation(libs.sentry)
}
2 changes: 0 additions & 2 deletions data/auth/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
pophory("feature")
alias(libs.plugins.sentry)
}

android {
Expand All @@ -13,5 +12,4 @@ dependencies {
implementation(projects.core.network)
implementation(libs.security)
implementation(libs.process.phoenix)
implementation(libs.sentry)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.teampophory.pophory.data.auth.model.SignUpRequest
import com.teampophory.pophory.data.auth.model.SocialType
import com.teampophory.pophory.data.auth.service.AuthService
import com.teampophory.pophory.network.datastore.PophoryDataStore
import io.sentry.Sentry
import javax.inject.Inject

class DefaultAuthRepository @Inject constructor(
Expand Down Expand Up @@ -45,15 +44,10 @@ class DefaultAuthRepository @Inject constructor(
override suspend fun withdraw() {
service.withdraw("Bearer ${dataStore.accessToken}")
dataStore.clear()
expireSentry()
}

override suspend fun logout() {
dataStore.clear()
expireSentry()
}

private fun expireSentry() {
Sentry.configureScope { scope -> scope.user = null }
}
}

0 comments on commit 34dc5dc

Please sign in to comment.