Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#275 [feat/fix] 오픈소스 라이선스 구현, okhttp 로깅 개선, 카카오 로그인 프로가드 설정 #281 #282 #283

Merged
merged 23 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c08bb07
#275 [build] gradle 의존성 버전 업그레이드
2zerozu Dec 9, 2023
0bc35f1
#275 [build] 오픈소스 gradle 추가
2zerozu Dec 10, 2023
6949d51
#275 [chore] 강제업데이트 패키지명 수정
2zerozu Dec 11, 2023
63e40b8
#275 [chore] anim 패키지명 수정
2zerozu Dec 12, 2023
a7558af
#275 [chore] anim 패키지명 수정
2zerozu Dec 12, 2023
a02b2c2
Revert "#275 [build] gradle 의존성 버전 업그레이드"
2zerozu Dec 21, 2023
cc15a74
#275 [feat] gitignore 추가
2zerozu Dec 13, 2023
799d4a3
#275 [feat] ci에 keystore 추가
2zerozu Dec 9, 2023
154c397
#275 [feat] 카카오 proguard 추가
2zerozu Dec 14, 2023
9363898
#275 [build] proguard 개별 설정
2zerozu Dec 15, 2023
7cdb3ca
#275 [build] 릴리즈 모드 시 keystore 추가
2zerozu Dec 17, 2023
07307ec
#275 [feat] okhttp 디버그 모드 시에만 로깅 조건 추가
2zerozu Dec 18, 2023
3921028
#275 [feat] 오픈소스뷰 스타일 구현
2zerozu Dec 19, 2023
bb60ad7
#275 [feat] 오픈소스뷰 테마 구현
2zerozu Dec 20, 2023
ba28f69
#275 [feat] 오픈소스뷰 클릭리스너 구현
2zerozu Dec 21, 2023
754b034
#275 [feat] 오픈소스/메뉴 액티비티 manifest 설정
2zerozu Dec 22, 2023
0dd45af
#275 [chore] 오픈소스 라이선스 string 수정
2zerozu Dec 22, 2023
72994cd
#275 [build] exifinterface 의존성 버전 업그레이드
2zerozu Dec 22, 2023
37c7ddc
#275 [build] cameraX 의존성 버전 업그레이드
2zerozu Dec 22, 2023
3fa41f6
#275 [build] ktx 의존성 버전 업그레이드
2zerozu Dec 22, 2023
0334902
#275 [build] navigation 의존성 버전 업그레이드
2zerozu Dec 22, 2023
056702f
#275 [feat] ci keystore 파일명 수정
2zerozu Dec 22, 2023
2c3d032
#275 [feat] ci keystore 파일명 수정
2zerozu Dec 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/pr_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,33 @@ jobs:
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }}
KAKAO_REDIRECT_SCHEME: ${{ secrets.KAKAO_REDIRECT_SCHEME }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
STORE_FILE: ${{ secrets.STORE_FILE }}
run: |
echo BASE_URI=\"$BASE_URI\" >> local.properties
echo NAVER_URL=\"$NAVER_URL\" >> local.properties
echo CLIENT_ID=\"$CLIENT_ID\" >> local.properties
echo CLIENT_SECRET=\"$CLIENT_SECRET\" >> local.properties
echo KAKAO_NATIVE_APP_KEY=\"KAKAO_NATIVE_APP_KEY\" >> local.properties
echo KAKAO_REDIRECT_SCHEME=\"KAKAO_REDIRECT_SCHEME\" >> local.properties
echo STORE_PASSWORD= $STORE_PASSWORD >> local.properties
echo KEY_PASSWORD= $KEY_PASSWORD >> local.properties
echo KEY_ALIAS= $KEY_ALIAS >> local.properties
echo STORE_FILE= $STORE_FILE >> local.properties

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Create keystore
run: |
mkdir -p app/keystore
touch app/keystore/peeka_key
2zerozu marked this conversation as resolved.
Show resolved Hide resolved

- name: decode release keystore
run: echo "${{ secrets.RELEASE_KEYSTORE_FILE_BASE_64 }}" | base64 -d > app/keystore/peeka_key
2zerozu marked this conversation as resolved.
Show resolved Hide resolved

- name: Lint Check
run: ./gradlew ktlintCheck

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
# Compiled class file
*.class

# Keystore files
*.jks
*.keystore

# Log file
*.log

Expand Down
35 changes: 26 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
id "org.jlleitschuh.gradle.ktlint" version "10.3.0"
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.0'
id 'com.google.gms.google-services'
id 'com.google.android.gms.oss-licenses-plugin'
}

Properties properties = new Properties()
Expand Down Expand Up @@ -36,11 +37,25 @@ android {
abortOnError false
}

signingConfigs {
release {
storeFile file(properties["STORE_FILE"])
keyAlias properties["KEY_ALIAS"]
keyPassword properties["KEY_PASSWORD"]
storePassword properties["STORE_PASSWORD"]
}
}

buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
proguardFile 'proguard-rules.pro'
proguardFile 'proguard-retrofit2.pro'
proguardFile 'proguard-okhttp3.pro'
proguardFile 'proguard-glide.pro'
signingConfig signingConfigs.release
}
}
compileOptions {
Expand All @@ -58,6 +73,8 @@ android {
}

dependencies {
// open source
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.1'

// hilt
implementation 'com.google.dagger:hilt-android:2.48.1'
Expand All @@ -67,7 +84,7 @@ dependencies {
implementation 'androidx.security:security-crypto-ktx:1.1.0-alpha06'

// ktx
implementation 'androidx.activity:activity-ktx:1.8.1'
implementation 'androidx.activity:activity-ktx:1.8.2'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
implementation 'androidx.fragment:fragment-ktx:1.6.2'
Expand All @@ -91,14 +108,14 @@ dependencies {
implementation 'com.jakewharton.timber:timber:5.0.1'

//navigation
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.5'
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.6'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.6'

// CameraX
implementation 'androidx.camera:camera-core:1.3.0'
implementation 'androidx.camera:camera-camera2:1.3.0'
implementation 'androidx.camera:camera-lifecycle:1.3.0'
implementation 'androidx.camera:camera-view:1.3.0'
implementation 'androidx.camera:camera-core:1.3.1'
implementation 'androidx.camera:camera-camera2:1.3.1'
implementation 'androidx.camera:camera-lifecycle:1.3.1'
implementation 'androidx.camera:camera-view:1.3.1'

// ML Kit
implementation 'com.google.android.gms:play-services-mlkit-barcode-scanning:18.3.0'
Expand All @@ -116,7 +133,7 @@ dependencies {
implementation 'com.kakao.sdk:v2-user:2.11.0'

// exifinterface
implementation 'androidx.exifinterface:exifinterface:1.3.6'
implementation 'androidx.exifinterface:exifinterface:1.3.7'

// firebase
implementation platform('com.google.firebase:firebase-bom:32.6.0')
Expand Down
6 changes: 6 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@

# https://developers.kakao.com/docs/latest/en/getting-started/sdk-android#configure-for-shrinking-and-obfuscation-(optional)
-keep class com.kakao.sdk.**.model.* { <fields>; }
-keep interface com.kakao.sdk.**.*Api
-keep class * extends com.google.gson.TypeAdapter

# https://github.com/square/okhttp/pull/6792
-dontwarn org.bouncycastle.jsse.**
-dontwarn org.conscrypt.*
-dontwarn org.openjsse.**

-keep class com.sopt.peekabookaos.domain.entity.** { *; }
-keep class com.sopt.peekabookaos.data.entity.** { *; }

Expand Down
14 changes: 12 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,19 @@
android:supportsRtl="true"
android:theme="@style/Theme.PeekabookAOS"
android:usesCleartextTraffic="true"
tools:targetApi="31">
tools:targetApi="33">
<activity
android:name=".presentation.forceUpdate.ForcedUpdateActivity"
android:name="com.google.android.gms.oss.licenses.OssLicensesActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/OpenSourceItemTheme" />
<activity
android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/OpenSourceItemTheme" />
<activity
android:name=".presentation.forcedUpdate.ForcedUpdateActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ object NaverRetrofitModule {
fun providesNaverOkHttpClient(@NaverType interceptor: Interceptor): OkHttpClient =
OkHttpClient.Builder().connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS).readTimeout(10, TimeUnit.SECONDS)
.addInterceptor(interceptor).addInterceptor(
.addInterceptor(interceptor)
.addInterceptor(
HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BODY
level =
if (BuildConfig.DEBUG) HttpLoggingInterceptor.Level.BODY else HttpLoggingInterceptor.Level.NONE
}
).build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ object RefreshRetrofitModule {
.readTimeout(5, TimeUnit.SECONDS)
.addInterceptor(interceptor)
.addInterceptor(
HttpLoggingInterceptor().apply { level = HttpLoggingInterceptor.Level.BODY }
HttpLoggingInterceptor().apply {
level =
if (BuildConfig.DEBUG) HttpLoggingInterceptor.Level.BODY else HttpLoggingInterceptor.Level.NONE
}
)
.build()

Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/sopt/peekabookaos/di/RetrofitModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ object RetrofitModule {
}
}
}

SERVER_ERROR -> {
Handler(Looper.getMainLooper()).post {
ToastMessageUtil.showToast(
Expand All @@ -138,7 +139,8 @@ object RetrofitModule {
.addInterceptor(interceptor)
.addInterceptor(
HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BODY
level =
if (BuildConfig.DEBUG) HttpLoggingInterceptor.Level.BODY else HttpLoggingInterceptor.Level.NONE
}
).build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ class BookActivity : BindingActivity<ActivityBookBinding>(R.layout.activity_book
when (intent.getStringExtra(LOCATION) ?: CREATE) {
RECOMMEND -> {
navController.navigate(R.id.action_barcodeScannerFragment_to_searchBookFragment)
activityOpenTransition(R.animator.anim_from_right, R.animator.anim_to_left)
activityOpenTransition(R.anim.anim_from_right, R.anim.anim_to_left)
}

else -> {
navController.navigate(R.id.barcodeScannerFragment)
activityOpenTransition(R.animator.anim_from_bottom, R.animator.anim_to_top)
activityOpenTransition(R.anim.anim_from_bottom, R.anim.anim_to_top)
}
}
}

override fun finish() {
super.finish()
activityCloseTransition(R.animator.anim_from_left, R.animator.anim_to_right)
activityCloseTransition(R.anim.anim_from_left, R.anim.anim_to_right)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sopt.peekabookaos.presentation.forceUpdate
package com.sopt.peekabookaos.presentation.forcedUpdate

import android.content.Intent
import android.net.Uri
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sopt.peekabookaos.presentation.forceUpdate
package com.sopt.peekabookaos.presentation.forcedUpdate

import androidx.lifecycle.ViewModel
import com.sopt.peekabookaos.domain.entity.UpdateInformation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.fragment.app.viewModels
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
import com.sopt.peekabookaos.R
import com.sopt.peekabookaos.databinding.FragmentMyPageBinding
import com.sopt.peekabookaos.presentation.block.BlockedUserActivity
Expand Down Expand Up @@ -35,6 +36,7 @@ class MyPageFragment : BindingFragment<FragmentMyPageBinding>(R.layout.fragment_
initLinkInfoClickListener()
initLinkAskClickListener()
initLinkPolicyClickListener()
initOpenSourceClickListener()
}

private fun initBlockBtnClickListener() {
Expand Down Expand Up @@ -96,6 +98,13 @@ class MyPageFragment : BindingFragment<FragmentMyPageBinding>(R.layout.fragment_
}
}

private fun initOpenSourceClickListener() {
binding.tvMyPageOpenSourceInfo.setSingleOnClickListener {
startActivity(Intent(requireActivity(), OssLicensesMenuActivity::class.java))
OssLicensesMenuActivity.setActivityTitle(getString(R.string.my_page_open_source))
}
}

companion object {
const val USER_INFO = "user_info"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.sopt.peekabookaos.R
import com.sopt.peekabookaos.databinding.ActivitySplashBinding
import com.sopt.peekabookaos.domain.entity.SplashUiState
import com.sopt.peekabookaos.domain.entity.UpdateInformation
import com.sopt.peekabookaos.presentation.forceUpdate.ForcedUpdateActivity
import com.sopt.peekabookaos.presentation.forcedUpdate.ForcedUpdateActivity
import com.sopt.peekabookaos.presentation.main.MainActivity
import com.sopt.peekabookaos.presentation.networkError.NetworkErrorActivity.Companion.LOCATION
import com.sopt.peekabookaos.presentation.networkError.NetworkErrorActivity.Companion.NETWORK_ERROR
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_forced_update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

<variable
name="viewModel"
type="com.sopt.peekabookaos.presentation.forceUpdate.ForcedUpdateViewModel" />
type="com.sopt.peekabookaos.presentation.forcedUpdate.ForcedUpdateViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/network_background"
tools:context=".presentation.forceUpdate.ForcedUpdateActivity">
tools:context=".presentation.forcedUpdate.ForcedUpdateActivity">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
Expand Down
32 changes: 16 additions & 16 deletions app/src/main/res/navigation/nav_book.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
<action
android:id="@+id/action_barcodeScannerFragment_to_searchBookFragment"
app:destination="@id/searchBookFragment"
app:enterAnim="@animator/anim_from_right"
app:exitAnim="@animator/anim_to_left"
app:popEnterAnim="@animator/anim_from_left"
app:popExitAnim="@animator/anim_to_right"
app:enterAnim="@anim/anim_from_right"
app:exitAnim="@anim/anim_to_left"
app:popEnterAnim="@anim/anim_from_left"
app:popExitAnim="@anim/anim_to_right"
app:popUpTo="@id/nav_book" />

<action
android:id="@+id/action_barcodeScannerFragment_to_createBookFragment"
app:destination="@id/createBookFragment"
app:enterAnim="@animator/anim_from_right"
app:exitAnim="@animator/anim_to_left"
app:popEnterAnim="@animator/anim_from_left"
app:popExitAnim="@animator/anim_to_right"
app:enterAnim="@anim/anim_from_right"
app:exitAnim="@anim/anim_to_left"
app:popEnterAnim="@anim/anim_from_left"
app:popExitAnim="@anim/anim_to_right"
app:popUpTo="@id/barcodeScannerFragment"
app:popUpToInclusive="true" />
</fragment>
Expand All @@ -38,20 +38,20 @@
<action
android:id="@+id/action_searchBookFragment_to_createBookFragment"
app:destination="@id/createBookFragment"
app:enterAnim="@animator/anim_from_right"
app:exitAnim="@animator/anim_to_left"
app:popEnterAnim="@animator/anim_from_left"
app:popExitAnim="@animator/anim_to_right"
app:enterAnim="@anim/anim_from_right"
app:exitAnim="@anim/anim_to_left"
app:popEnterAnim="@anim/anim_from_left"
app:popExitAnim="@anim/anim_to_right"
app:popUpTo="@id/searchBookFragment"
app:popUpToInclusive="false" />

<action
android:id="@+id/action_searchBookFragment_to_recommendationFragment"
app:destination="@id/recommendationFragment"
app:enterAnim="@animator/anim_from_right"
app:exitAnim="@animator/anim_to_left"
app:popEnterAnim="@animator/anim_from_left"
app:popExitAnim="@animator/anim_to_right" />
app:enterAnim="@anim/anim_from_right"
app:exitAnim="@anim/anim_to_left"
app:popEnterAnim="@anim/anim_from_left"
app:popExitAnim="@anim/anim_to_right" />
</fragment>

<fragment
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/res/navigation/nav_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<action
android:id="@+id/action_socialLoginFragment_to_userInputFragment"
app:destination="@id/userInputFragment"
app:enterAnim="@animator/anim_from_right"
app:exitAnim="@animator/anim_to_left"
app:popEnterAnim="@animator/anim_from_left"
app:popExitAnim="@animator/anim_to_right" />
app:enterAnim="@anim/anim_from_right"
app:exitAnim="@anim/anim_to_left"
app:popEnterAnim="@anim/anim_from_left"
app:popExitAnim="@anim/anim_to_right" />
</fragment>

<fragment
Expand All @@ -27,10 +27,10 @@
<action
android:id="@+id/action_userInputFragment_to_socialLoginFragment"
app:destination="@id/socialLoginFragment"
app:enterAnim="@animator/anim_from_left"
app:exitAnim="@animator/anim_to_right"
app:popEnterAnim="@animator/anim_from_right"
app:popExitAnim="@animator/anim_to_left"
app:enterAnim="@anim/anim_from_left"
app:exitAnim="@anim/anim_to_right"
app:popEnterAnim="@anim/anim_from_right"
app:popExitAnim="@anim/anim_to_left"
app:popUpTo="@id/socialLoginFragment"
app:popUpToInclusive="true" />
</fragment>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<string name="my_page_policy"><![CDATA[개인정보 보호 정책 & 서비스 이용 약관]]></string>
<string name="my_page_ask">문의하기</string>
<string name="my_page_info">개발자 정보</string>
<string name="my_page_open_source">오픈소스 라이브러리</string>
<string name="my_page_open_source">오픈소스 라이선스</string>
<string name="my_page_logout">로그아웃</string>
<string name="my_page_withdraw">서비스 탈퇴하기</string>
<string name="my_page_developer_info_link">https://interesting-door-b57.notion.site/About-Team-b25424073add46b9a186d69c17815bf2</string>
Expand Down
Loading
Loading