Skip to content

Commit

Permalink
Merge pull request #132 from BCSDLab/feature/#130-Add-proguard-and-se…
Browse files Browse the repository at this point in the history
…rialized-name

#130 proguard 추가 및 SerializedName 추가
  • Loading branch information
wnehdals authored Jan 17, 2024
2 parents 93379ef + a0aa95e commit c6de2b9
Show file tree
Hide file tree
Showing 49 changed files with 312 additions and 9 deletions.
10 changes: 6 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ android {
signingConfigs {

create("release") {
keyAlias = "jjbaksa_release_key"
keyPassword = ""
keyAlias = "jjbaksk_release_key"
keyPassword = getPropertyKey("keyPassword")
storeFile = file("./jjbaksa.jks")
storePassword = ""
storePassword = getPropertyKey("storePassword")
}
}

Expand All @@ -46,14 +46,16 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
isDebuggable = true
}
getByName("release") {
isMinifyEnabled = true
signingConfig = signingConfigs.getByName("release")
// signingConfig = signingConfigs.getByName("release")
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
isDebuggable = false
}
}

Expand Down
30 changes: 29 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,32 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
# Don't note duplicate definition (Legacy Apche Http Client)
-dontnote android.net.http.*
-dontnote org.apache.http.**

# Add when compile with JDK 1.7
-keepattributes EnclosingMethod

# Firebase Authentication
-keepattributes *Annotation*

# Firebase Realtime database
-keepattributes Signature

-dontwarn okhttp3.**
-dontwarn okio.**

-dontnote okhttp3.**

# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on RoboVM on iOS. Will not be used at runtime.
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
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": 1,
"versionName": "1.0.0",
"versionCode": 2,
"versionName": "1.0.1",
"outputFile": "app-release.apk"
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ object RefreshManager {
level = if (BuildConfig.DEBUG) {
HttpLoggingInterceptor.Level.BODY
} else {
HttpLoggingInterceptor.Level.HEADERS
HttpLoggingInterceptor.Level.BODY
}
}
val refreshHeaderInterceptor = Interceptor { chain: Interceptor.Chain ->
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ object KotlinDependencies {
const val coroutine =
"org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.coroutineVersion}"
const val inject = "javax.inject:javax.inject:1"
const val kotlin_serialization = "org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.kotlinSerializationVersion}"
}

object AndroidXDependencies {
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ object Versions {
const val datastoreVersion = "1.0.0"

const val glideVersion = "4.15.1"
const val kotlinSerializationVersion = "1.3.2"
}
30 changes: 29 additions & 1 deletion data/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,32 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
# Don't note duplicate definition (Legacy Apche Http Client)
-dontnote android.net.http.*
-dontnote org.apache.http.**

# Add when compile with JDK 1.7
-keepattributes EnclosingMethod

# Firebase Authentication
-keepattributes *Annotation*

# Firebase Realtime database
-keepattributes Signature

-dontwarn okhttp3.**
-dontwarn okio.**

-dontnote okhttp3.**

# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on RoboVM on iOS. Will not be used at runtime.
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
3 changes: 3 additions & 0 deletions domain/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import ThirdPartyDependencies.gson

plugins {
id("java-library")
kotlin("jvm")
Expand All @@ -14,6 +16,7 @@ dependencies {
implementation(kotlin)
implementation(inject)
implementation(coroutine)
implementation(gson)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.jjbaksa.domain.model.inquiry

import com.google.gson.annotations.SerializedName

data class Inquiry(
@SerializedName("content")
val content: List<InquiryContent> = emptyList()
)
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
package com.jjbaksa.domain.model.inquiry

import com.google.gson.annotations.SerializedName

data class InquiryContent(
@SerializedName("id")
val id: Long = 0,
@SerializedName("answer")
val answer: String = "",
@SerializedName("content")
val content: String = "",
@SerializedName("createdAt")
val createdAt: String = "",
@SerializedName("createdBy")
val createdBy: String = "",
@SerializedName("inquiryImages")
val inquiryImages: List<InquiryImages> = emptyList(),
@SerializedName("isSecreted")
val isSecreted: Int = 0,
@SerializedName("title")
var title: String = "",
@SerializedName("expandable")
var expandable: Boolean = false
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package com.jjbaksa.domain.model.inquiry

import com.google.gson.annotations.SerializedName

data class InquiryImages(
@SerializedName("imageUrl")
val imageUrl: String = "",
@SerializedName("originalName")
val originalName: String = "",
@SerializedName("path")
val path: String = ""
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.jjbaksa.domain.model.mainpage

import com.google.gson.annotations.SerializedName

data class UserLocation(
@SerializedName("latitude")
val latitude: Double = 37.toDouble(),
@SerializedName("longitude")
val longitude: Double = 127.toDouble(),
)
3 changes: 3 additions & 0 deletions domain/src/main/java/com/jjbaksa/domain/model/post/Post.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.jjbaksa.domain.model.post

import com.google.gson.annotations.SerializedName

data class Post(
@SerializedName("content")
val content: List<PostContent> = emptyList()
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package com.jjbaksa.domain.model.post

import com.google.gson.annotations.SerializedName

data class PostContent(
@SerializedName("id")
val id: Int = 0,
@SerializedName("title")
val title: String = "",
@SerializedName("createdAt")
val createdAt: String = ""
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
package com.jjbaksa.domain.model.post

import com.google.gson.annotations.SerializedName

data class PostDetail(
@SerializedName("id")
val id: Int = 0,
@SerializedName("title")
val title: String = "",
@SerializedName("content")
val content: String = "",
@SerializedName("createdAt")
val createdAt: String = ""
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.jjbaksa.domain.model.review

import com.google.gson.annotations.SerializedName

data class FollowerReviewShops(
@SerializedName("content")
val content: List<FollowerReviewShopsContent> = emptyList()
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
package com.jjbaksa.domain.model.review

import com.google.gson.annotations.SerializedName

data class FollowerReviewShopsContent(
@SerializedName("id")
val id: Int = 0,
@SerializedName("content")
val content: String = "",
@SerializedName("rate")
val rate: Int = 0,
@SerializedName("createdAt")
val createdAt: String = "",
@SerializedName("userReviewResponse")
val userReviewResponse: UserReview = UserReview(),
@SerializedName("shopPlaceId")
val shopPlaceId: String = ""
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.jjbaksa.domain.model.review

import com.google.gson.annotations.SerializedName

data class MyReviewShops(
@SerializedName("content")
val content: List<MyReviewShopsContent> = emptyList()
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
package com.jjbaksa.domain.model.review

import com.google.gson.annotations.SerializedName

data class MyReviewShopsContent(
@SerializedName("id")
val id: Int = 0,
@SerializedName("content")
val content: String = "",
@SerializedName("rate")
val rate: Int = 0,
@SerializedName("createdAt")
val createdAt: String = ""
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.jjbaksa.domain.model.review

import com.google.gson.annotations.SerializedName

data class ReviewImages(
@SerializedName("originalName")
val originalName: String? = "",
@SerializedName("imageUrl")
val imageUrl: String? = ""
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.jjbaksa.domain.model.review

import com.google.gson.annotations.SerializedName

data class ReviewShop(
@SerializedName("content")
val content: List<ReviewShopContent> = emptyList()
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
package com.jjbaksa.domain.model.review

import com.google.gson.annotations.SerializedName

data class ReviewShopContent(
@SerializedName("shopId")
val shopId: Int = 0,
@SerializedName("placeId")
val placeId: String = "",
@SerializedName("name")
val name: String = "",
@SerializedName("category")
val category: String = "",
@SerializedName("scrap")
val scrap: Int = 0,
@SerializedName("photos")
val photos: List<String> = emptyList()
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
package com.jjbaksa.domain.model.review

import com.google.gson.annotations.SerializedName

data class ReviewShopDetail(
@SerializedName("id")
val id: Int? = 0,
@SerializedName("content")
val content: String? = "",
@SerializedName("rate")
val rate: Int? = 0,
@SerializedName("createdAt")
val createdAt: String? = "",
@SerializedName("reviewImages")
val reviewImages: List<ReviewImages>? = emptyList(),
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.jjbaksa.domain.model.review

import com.google.gson.annotations.SerializedName

data class ReviewShopLastDate(
@SerializedName("lastDate")
val lastDate: String = ""
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package com.jjbaksa.domain.model.review

import com.google.gson.annotations.SerializedName
import com.jjbaksa.domain.model.user.UserProfileImage

data class UserReview(
@SerializedName("id")
val id: Int = 0,
@SerializedName("account")
val account: String = "",
@SerializedName("nickname")
val nickname: String = "",
@SerializedName("profileImage")
val profileImage: UserProfileImage = UserProfileImage()
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
package com.jjbaksa.domain.model.scrap

import com.google.gson.annotations.SerializedName

data class AddShopScrap(
@SerializedName("id")
val id: Int = 0,
@SerializedName("createdAt")
val createdAt: Long = 0,
@SerializedName("updatedAt")
val updatedAt: Long = 0,
@SerializedName("directory")
val directory: Int = 0,
@SerializedName("shopId")
val shopId: Int = 0
)
Loading

0 comments on commit c6de2b9

Please sign in to comment.