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

User-Agent 추가 및 버전 코드 업데이트 #439

Merged
merged 4 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 4 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

android {
compileSdkVersion 33
buildToolsVersion "30.0.3"

compileOptions {
coreLibraryDesugaringEnabled true

Expand All @@ -27,9 +24,10 @@ android {
defaultConfig {
applicationId "com.hyeeyoung.wishboard"
minSdkVersion 24
targetSdkVersion 33
versionCode 36
versionName "1.2.4"
targetSdkVersion 34
versionCode 39
versionName "1.2.6"
compileSdk 34

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<uses-feature
android:name="android.hardware.camera2"
android:required="false" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<application
android:name=".WishBoardApp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ class AuthInterceptor @Inject constructor(

private fun Request.newAuthBuilder() =
this.newBuilder()
.addHeader(AUTHORIZATION, "$TOKEN_PREF${localStorage.accessToken}")
.addHeader(HEADER_KEY_AUTHORIZATION, "$TOKEN_PREF${localStorage.accessToken}")
.addHeader(HEADER_KEY_USER_AGENT, "$HEADER_VALUE_USER_AGENT_PREF${if (BuildConfig.DEBUG) "dev" else "prod"}")

companion object {
private const val AUTHORIZATION = "Authorization"
private const val HEADER_KEY_AUTHORIZATION = "Authorization"
private const val HEADER_KEY_USER_AGENT = "User-Agent"
private const val HEADER_VALUE_USER_AGENT_PREF = "wishboard-android/"
private const val TOKEN_PREF = "Bearer "
private const val REFRESH_TOKEN = "refreshToken"
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/hyeeyoung/wishboard/di/NetworkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ object NetworkModule {
interceptor: AuthInterceptor,
): OkHttpClient =
OkHttpClient.Builder().apply {
connectTimeout(10, TimeUnit.SECONDS)
writeTimeout(10, TimeUnit.SECONDS)
readTimeout(10, TimeUnit.SECONDS)
connectTimeout(30, TimeUnit.SECONDS)
writeTimeout(30, TimeUnit.SECONDS)
readTimeout(30, TimeUnit.SECONDS)
addInterceptor(interceptor)
if (DEBUG) addInterceptor(
HttpLoggingInterceptor().apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ class DayItemView @JvmOverloads constructor(
}
}

override fun onDraw(canvas: Canvas?) {
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
if (canvas == null) return

val date = date.dayOfMonth.toString()
paint.getTextBounds(date, 0, date.length, bounds)
Expand Down
Loading