Skip to content

Commit

Permalink
Merge pull request #223 from team-winey/develop
Browse files Browse the repository at this point in the history
[merge] v.1.0.1 ๋ฒ„์ „ ํƒœ๊ทธ ์ƒ์„ฑ
  • Loading branch information
leeeha authored Nov 5, 2023
2 parents cd334ab + fdd5a84 commit 60bac87
Show file tree
Hide file tree
Showing 20 changed files with 390 additions and 170 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/pr_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,21 @@ jobs:
AUTH_BASE_URL: ${{ secrets.AUTH_BASE_URL }}
KAKAO_NATIVE_KEY: ${{ secrets.KAKAO_NATIVE_KEY }}
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
run: |
echo auth.base.url=\"$AUTH_BASE_URL\" >> ./local.properties
echo kakao.native.key=\"$KAKAO_NATIVE_KEY\" >> ./local.properties
echo amplitude.api.key=\"$AMPLITUDE_API_KEY\" >> ./local.properties
echo kakaoNativeKey=$KAKAO_NATIVE_KEY >> ./local.properties
echo amplitude.api.key=\"AMPLITUDE_API_KEY\" >> ./local.properties
# - name: Access Firebase Service
# run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json
echo keyAlias=$KEY_ALIAS >> ./local.properties
echo keyPassword=$KEY_PASSWORD >> ./local.properties
echo storePassword=$STORE_PASSWORD >> ./local.properties
- name: Build debug APK
run: ./gradlew assembleDebug --stacktrace

# - name: Upload APK
# uses: actions/upload-artifact@v1
# with:
# name: app
# path: app/build/outputs/apk/debug

- name: Run ktlint
run: ./gradlew ktlintCheck

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ captures/
# Keystore files
*.jks
*.keystore
*.pem

# Google Services (e.g. APIs or Firebase)
# google-services.json
Expand Down Expand Up @@ -194,4 +195,4 @@ fabric.properties

!/gradle/wrapper/gradle-wrapper.jar

# End of https://www.toptal.com/developers/gitignore/api/windows,androidstudio,kotlin,java
# End of https://www.toptal.com/developers/gitignore/api/windows,androidstudio,kotlin,java
17 changes: 3 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ๐Ÿ‘‘ Winey - AOS ๐Ÿ’ธ

GO SOPT 32๊ธฐ ์•ฑ์žผ Winey Android ํŒ€ ๋ ˆํฌ์ž…๋‹ˆ๋‹ค.
[GO SOPT](https://www.sopt.org/) 32๊ธฐ ์•ฑ์žผ Winey Android ํŒ€ ๋ ˆํฌ์ž…๋‹ˆ๋‹ค.

<img width="250" src="https://github.com/team-winey/Winey-AOS/assets/68090939/d9f94086-84f5-4ef2-80b4-acf27b59c21b"/>
<img src="https://github.com/team-winey/Winey-AOS/assets/68090939/a44c2b4e-68e2-40c1-b687-535f323cead8"/>

## ๐Ÿ’ Introduction

Expand All @@ -15,9 +15,7 @@ GO SOPT 32๊ธฐ ์•ฑ์žผ Winey Android ํŒ€ ๋ ˆํฌ์ž…๋‹ˆ๋‹ค.

ํ•œ๋งˆ๋””๋กœ ์œ„๋‹ˆ๋Š” '์ขŒ์ถฉ์šฐ๋Œ ๋‚˜๋งŒ์˜ ์ ˆ์•ฝ ๋ฐฉ๋ฒ•์„ ๊ณต์œ ํ•˜๋Š” ๊ฒŒ์ž„ํ˜• ์ ˆ์•ฝ SNS' ์„œ๋น„์Šค์ž…๋‹ˆ๋‹ค.

## ๐ŸŽ‰ Play Store Download (v1.0.0)

[๊ตฌ๊ธ€ ํ”Œ๋ ˆ์ด ์Šคํ† ์–ด์—์„œ ๋ฐ”๋กœ ๋งŒ๋‚˜๋ณด์„ธ์š” โœ”](https://play.google.com/store/apps/details?id=org.go.sopt.winey)
[๐ŸŽ‰ ๊ตฌ๊ธ€ ํ”Œ๋ ˆ์ด ์Šคํ† ์–ด์—์„œ ๋ฐ”๋กœ ๋งŒ๋‚˜๋ณด์„ธ์š”! ๐ŸŽ‰](https://play.google.com/store/apps/details?id=org.go.sopt.winey)

## ๐ŸŒฑ Contributors

Expand Down Expand Up @@ -113,13 +111,4 @@ https://github.com/team-winey/Winey-AOS/assets/68090939/d190e491-efe5-4a02-89d1-
โ”ƒ โ”ƒ โ”ฃ ๐Ÿ“‚ story
โ”ƒ โ”ฃ ๐Ÿ“‚ splash
โ”ฃ ๐Ÿ“‚ util
โ”ƒ โ”ฃ ๐Ÿ“‚ activity
โ”ƒ โ”ฃ ๐Ÿ“‚ amplitude
โ”ƒ โ”ฃ ๐Ÿ“‚ binding
โ”ƒ โ”ฃ ๐Ÿ“‚ code
โ”ƒ โ”ฃ ๐Ÿ“‚ context
โ”ƒ โ”ฃ ๐Ÿ“‚ fragment
โ”ƒ โ”ฃ ๐Ÿ“‚ intent
โ”ƒ โ”ฃ ๐Ÿ“‚ multipart
โ”ƒ โ”ฃ ๐Ÿ“‚ view
```
17 changes: 14 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,20 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
create("release") {
keyAlias = gradleLocalProperties(rootDir).getProperty("keyAlias")
keyPassword = gradleLocalProperties(rootDir).getProperty("keyPassword")
storeFile = file("winey.jks")
storePassword = gradleLocalProperties(rootDir).getProperty("storePassword")
}
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
release {
signingConfig = signingConfigs.getByName("release")
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand All @@ -62,9 +73,9 @@ android {
}

buildFeatures {
buildConfig = true
viewBinding = true
dataBinding = true
buildConfig = true
}
}

Expand Down
73 changes: 72 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,77 @@
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

##---------------Begin: Kakao SDK ----------
-keep class com.kakao.sdk.**.model.* { <fields>; }
-keep class * extends com.google.gson.TypeAdapter
-keep interface com.kakao.sdk.**.*Api
##---------------END: Kakao SDK ----------

##---------------Begin: Retrofit ----------
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
# EnclosingMethod is required to use InnerClasses.
-keepattributes Signature, InnerClasses, EnclosingMethod

# Retrofit does reflection on method and parameter annotations.
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations

# Keep annotation default values (e.g., retrofit2.http.Field.encoded).
-keepattributes AnnotationDefault

# Retain service method parameters when optimizing.
-keepclassmembers,allowshrinking,allowobfuscation interface * {
@retrofit2.http.* <methods>;
}

# Ignore JSR 305 annotations for embedding nullability information.
-dontwarn javax.annotation.**

# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath.
-dontwarn kotlin.Unit

# Top-level functions that can only be used by Kotlin.
-dontwarn retrofit2.KotlinExtensions
-dontwarn retrofit2.KotlinExtensions$*

# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy
# and replaces all potential values with null. Explicitly keeping the interfaces prevents this.
-if interface * { @retrofit2.http.* <methods>; }
-keep,allowobfuscation interface <1>

# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

# R8 full mode strips generic signatures from return types if not kept.
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>

# With R8 full mode generic signatures are stripped for classes that are not kept.
-keep,allowobfuscation,allowshrinking class retrofit2.Response
-keep,allowobfuscation,allowshrinking interface retrofit2.Call

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

##---------------Begin: OkHttp -------------

# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**

# A resource is loaded with a relative path so the package of this class must be preserved.
-adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz

# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*

# OkHttp platform used only on JVM and when Conscrypt and other security providers are available.
-dontwarn okhttp3.internal.platform.**
-dontwarn org.conscrypt.**
-dontwarn org.bouncycastle.**
-dontwarn org.openjsse.**

##---------------End : OkHttp --------------

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
Expand All @@ -18,4 +89,4 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 7,
"versionName": "1.0.0",
"versionCode": 17,
"versionName": "1.0.1",
"outputFile": "app-release.apk"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,52 @@ package org.go.sopt.winey.data.source

import android.content.Context
import com.kakao.sdk.auth.model.OAuthToken
import com.kakao.sdk.user.UserApiClient
import org.go.sopt.winey.data.service.KakaoLoginService
import javax.inject.Inject

class KakaoLoginDataSource @Inject constructor(
private val kakaoLoginService: KakaoLoginService
) {
fun loginKakao(kakaoLoginCallBack: (OAuthToken?, Throwable?) -> Unit, context: Context) =
kakaoLoginService.loginKakao(kakaoLoginCallBack, context)
private val client: UserApiClient
) : KakaoLoginService {

fun logoutKakao(kakaoLogoutCallBack: (Throwable?) -> Unit) =
kakaoLoginService.logoutKakao(kakaoLogoutCallBack)
override fun loginKakao(
kakaoLoginCallBack: (OAuthToken?, Throwable?) -> Unit,
context: Context
) {
val kakaoLoginState =
if (client.isKakaoTalkLoginAvailable(context)) {
KAKAO_TALK_LOGIN
} else {
KAKAO_ACCOUNT_LOGIN
}

fun deleteKakaoAccount(kakaoLogoutCallBack: (Throwable?) -> Unit) =
kakaoLoginService.deleteKakaoAccount(kakaoLogoutCallBack)
when (kakaoLoginState) {
KAKAO_TALK_LOGIN -> {
client.loginWithKakaoTalk(
context,
callback = kakaoLoginCallBack
)
}

KAKAO_ACCOUNT_LOGIN -> {
client.loginWithKakaoAccount(
context,
callback = kakaoLoginCallBack
)
}
}
}

override fun logoutKakao(kakaoLogoutCallBack: (Throwable?) -> Unit) {
client.logout(kakaoLogoutCallBack)
}

override fun deleteKakaoAccount(kakaoLogoutCallBack: (Throwable?) -> Unit) {
client.unlink(kakaoLogoutCallBack)
}

companion object {
private const val KAKAO_TALK_LOGIN = 0
private const val KAKAO_ACCOUNT_LOGIN = 1
}
}
50 changes: 0 additions & 50 deletions app/src/main/java/org/go/sopt/winey/di/ServiceModule.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
package org.go.sopt.winey.di

import android.content.Context
import com.kakao.sdk.auth.model.OAuthToken
import com.kakao.sdk.user.UserApiClient
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import org.go.sopt.winey.data.service.AuthService
import org.go.sopt.winey.data.service.FeedService
import org.go.sopt.winey.data.service.KakaoLoginService
import org.go.sopt.winey.data.service.NotificationService
import org.go.sopt.winey.data.service.RecommendService
import retrofit2.Retrofit
Expand All @@ -18,9 +14,6 @@ import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object ServiceModule {
private const val KAKAO_TALK_LOGIN = 0
private const val KAKAO_ACCOUNT_LOGIN = 1

@Provides
@Singleton
fun provideAuthService(retrofit: Retrofit): AuthService =
Expand All @@ -40,47 +33,4 @@ object ServiceModule {
@Singleton
fun provideNotificationService(retrofit: Retrofit): NotificationService =
retrofit.create(NotificationService::class.java)

@Provides
fun provideKakaoLoginService(
client: UserApiClient
): KakaoLoginService {
return object : KakaoLoginService {
override fun loginKakao(
kakaoLoginCallBack: (OAuthToken?, Throwable?) -> Unit,
context: Context
) {
val kakaoLoginState =
if (client.isKakaoTalkLoginAvailable(context)) {
KAKAO_TALK_LOGIN
} else {
KAKAO_ACCOUNT_LOGIN
}

when (kakaoLoginState) {
KAKAO_TALK_LOGIN -> {
client.loginWithKakaoTalk(
context,
callback = kakaoLoginCallBack
)
}

KAKAO_ACCOUNT_LOGIN -> {
client.loginWithKakaoAccount(
context,
callback = kakaoLoginCallBack
)
}
}
}

override fun logoutKakao(kakaoLogoutCallBack: (Throwable?) -> Unit) {
client.logout(kakaoLogoutCallBack)
}

override fun deleteKakaoAccount(kakaoLogoutCallBack: (Throwable?) -> Unit) {
client.unlink(kakaoLogoutCallBack)
}
}
}
}
Loading

0 comments on commit 60bac87

Please sign in to comment.