Skip to content

Commit

Permalink
Merge branch 'release/v1.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
junhaesung committed Jan 10, 2023
2 parents e5a27b3 + 5c48842 commit e5e9e0c
Show file tree
Hide file tree
Showing 104 changed files with 1,498 additions and 748 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- run: echo $LOCAL_PROPERTIES_FILE | base64 -d > local.properties
env:
LOCAL_PROPERTIES_FILE: ${{ secrets.LOCAL_PROPERTIES_FILE }}
- name: Build and analyze
uses: gradle/gradle-build-action@v2
env:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- run: echo $DEBUG_KEYSTORE_FILE | base64 -d > debug.keystore
env:
DEBUG_KEYSTORE_FILE: ${{ secrets.DEBUG_KEYSTORE_FILE }}
- run: echo $LOCAL_PROPERTIES_FILE | base64 -d > local.properties
env:
LOCAL_PROPERTIES_FILE: ${{ secrets.LOCAL_PROPERTIES_FILE }}
- name: Build
run: chmod +x ./gradlew && ./gradlew :app::assembleAlpha --quiet
env:
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ captures/

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore
*.jks
*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
Expand Down
18 changes: 18 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ plugins {
id 'com.google.firebase.crashlytics'
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

android {
compileSdk 33

Expand All @@ -24,6 +27,7 @@ android {
}

signingConfigs {
// GitHub Action 으로 빌드, 배포할 때 사용함
ciDebug {
storeFile file("$project.rootDir/debug.keystore")
storePassword System.getenv('DEBUG_STORE_PASSWORD')
Expand All @@ -36,6 +40,19 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
manifestPlaceholders = [
KAKAO_APP_KEY: properties.getProperty('release.kakao.app-key')
]
buildConfigField 'String', 'BASE_URL', "\"${properties.getProperty('release.three-days.base-url')}\""
buildConfigField 'String', 'KAKAO_APP_KEY', "\"${properties.getProperty('release.kakao.app-key')}\""
}
debug {
applicationIdSuffix '.debug'
manifestPlaceholders = [
KAKAO_APP_KEY: properties.getProperty('debug.kakao.app-key')
]
buildConfigField 'String', 'BASE_URL', "\"${properties.getProperty('debug.three-days.base-url')}\""
buildConfigField 'String', 'KAKAO_APP_KEY', "\"${properties.getProperty('debug.kakao.app-key')}\""
}
alpha {
initWith debug
Expand All @@ -57,6 +74,7 @@ android {
dependencies {
implementation(project(":domain"))
implementation(project(":data"))
implementation(project(":build-property"))
implementation(project(":core"))
implementation(project(":navigator"))
implementation(project(":presentation:home"))
Expand Down
39 changes: 39 additions & 0 deletions app/src/alpha/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "1091459842156",
"project_id": "three-days-develop",
"storage_bucket": "three-days-develop.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1091459842156:android:8f8abdfe99c268fe485849",
"android_client_info": {
"package_name": "com.depromeet.threedays.debug"
}
},
"oauth_client": [
{
"client_id": "1091459842156-pjhtgjo35d6ro1ra922ngi7aabealvsc.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyB0EiDGdeC8Oxa9HvFshjg0YCZrfhzY4cs"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1091459842156-pjhtgjo35d6ro1ra922ngi7aabealvsc.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
39 changes: 39 additions & 0 deletions app/src/debug/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "1091459842156",
"project_id": "three-days-develop",
"storage_bucket": "three-days-develop.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1091459842156:android:8f8abdfe99c268fe485849",
"android_client_info": {
"package_name": "com.depromeet.threedays.debug"
}
},
"oauth_client": [
{
"client_id": "1091459842156-pjhtgjo35d6ro1ra922ngi7aabealvsc.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyB0EiDGdeC8Oxa9HvFshjg0YCZrfhzY4cs"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "1091459842156-pjhtgjo35d6ro1ra922ngi7aabealvsc.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
File renamed without changes.
23 changes: 15 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<application
android:name=".ThreeDaysApplication"
android:allowBackup="true"
android:usesCleartextTraffic="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ThreeDays"
android:usesCleartextTraffic="true"
tools:targetApi="31">

<activity
Expand Down Expand Up @@ -55,31 +55,37 @@

<activity
android:name="com.depromeet.threedays.onboarding.OnboardingActivity"
android:noHistory="true"
android:exported="false" />
android:exported="false"
android:noHistory="true" />

<activity
android:name="com.depromeet.threedays.mypage.archived_habit.ArchivedHabitActivity"
android:exported="false" />

<activity android:name=".mate.create.step1.ConnectHabitActivity"
android:exported="false"
android:taskAffinity="com.depromeet.threedays.mate"
android:exported="false" />
android:theme="@style/WhiteStatusTheme" />

<activity android:name=".mate.create.step2.ChooseMateTypeActivity"
android:exported="false"
android:taskAffinity="com.depromeet.threedays.mate"
android:exported="false" />
android:theme="@style/WhiteStatusTheme" />

<activity android:name=".mate.create.step3.SetMateNicknameActivity"
android:exported="false"
android:taskAffinity="com.depromeet.threedays.mate"
android:exported="false" />
android:theme="@style/WhiteStatusTheme" />

<activity android:name="com.depromeet.threedays.policy.PolicyActivity"
android:exported="false" />

<activity android:name=".signup.SignupActivity"
android:exported="true"/>

<activity android:name=".signup.complete.SignupCompleteActivity"
android:exported="false"/>

<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
android:exported="true">
Expand All @@ -89,8 +95,9 @@
<category android:name="android.intent.category.BROWSABLE" />

<!-- Redirect URI: "kakao${NATIVE_APP_KEY}://oauth" -->
<data android:host="oauth"
android:scheme="kakaof0c0458b5837b0f245c73b5a22908319" />
<data
android:host="oauth"
android:scheme="kakao${KAKAO_APP_KEY}" />
</intent-filter>
</activity>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package com.depromeet.threedays

import android.app.Application
import com.depromeet.threedays.buildproperty.BuildProperty
import com.depromeet.threedays.buildproperty.BuildPropertyRepository
import com.depromeet.threedays.core.analytics.AnalyticsUtil
import com.kakao.sdk.common.KakaoSdk
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber
import javax.inject.Inject

@HiltAndroidApp
class ThreeDaysApplication : Application() {
@Inject
lateinit var buildPropertyRepository: BuildPropertyRepository

override fun onCreate() {
super.onCreate()

Expand All @@ -21,7 +27,10 @@ class ThreeDaysApplication : Application() {
}

private fun initKakaoSdk() {
KakaoSdk.init(this, "f0c0458b5837b0f245c73b5a22908319")
KakaoSdk.init(
context = this,
appKey = buildPropertyRepository.get(BuildProperty.KAKAO_APP_KEY),
)
}

private fun initAnalytics() {
Expand Down
14 changes: 0 additions & 14 deletions app/src/main/java/com/depromeet/threedays/firebase/FCMService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import com.depromeet.threedays.domain.usecase.notification.token.UpdateNotificat
import com.depromeet.threedays.home.MainActivity
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import kotlinx.coroutines.runBlocking
import timber.log.Timber
import javax.inject.Inject
import com.depromeet.threedays.core_design_system.R as CoreDesignSystemResources

Expand All @@ -25,18 +23,6 @@ class FCMService @Inject constructor() : FirebaseMessagingService() {
override fun onNewToken(token: String) {
super.onNewToken(token)
Log.i(TAG, "onNewToken: $token")
try {
// FIXME:
// - useCase initialize 안되었다는 에러 발생함.
// - 앱 처음 설치하면 스플래시 화면에서 호출되는데 이 때 memberId 없음
runBlocking {
updateNotificationTokenUseCase(token)
}
} catch (e: Exception) {
Timber.w(
e, "Failed to update fcm registration token"
)
}
}

override fun onMessageReceived(message: RemoteMessage) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.depromeet.threedays.property

import com.depromeet.threedays.buildproperty.BuildPropertyRepository
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
class BuildPropertyModule {

@Singleton
@Provides
fun bindsBuildPropertyRepositoryProvide(
buildPropertyRepositoryImpl: BuildPropertyRepositoryImpl,
): BuildPropertyRepository = buildPropertyRepositoryImpl
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.depromeet.threedays.property

import com.depromeet.threedays.BuildConfig
import com.depromeet.threedays.buildproperty.BuildProperty
import com.depromeet.threedays.buildproperty.BuildPropertyRepository
import timber.log.Timber
import javax.inject.Inject

class BuildPropertyRepositoryImpl @Inject constructor() : BuildPropertyRepository {
override fun get(buildProperty: BuildProperty): String {
try {
return readProperties(buildProperty = buildProperty)
} catch (e: Exception) {
throw IllegalStateException(
"Failed to read property from local.properties. key: $buildProperty",
e
)
}
}

override fun getOrNull(buildProperty: BuildProperty): String? {
return try {
readProperties(buildProperty = buildProperty)
} catch (e: Exception) {
Timber.e(e, "Failed to read property from local.properties. key: $buildProperty")
null
}
}

private fun readProperties(buildProperty: BuildProperty): String {
return BuildConfig::class.java.getDeclaredField(buildProperty.key).get(null) as String
}
}
1 change: 1 addition & 0 deletions build-property/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
Loading

0 comments on commit e5e9e0c

Please sign in to comment.