Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ngcook into an/feat/280
  • Loading branch information
ii2001 committed Aug 31, 2024
2 parents 6cac077 + 7e33ef8 commit 5095fd1
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 16 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/an-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
cache: 'gradle'

- name: Set Up Gradlew Permissions
run: chmod +x gradlew
run: chmod +x ./android/gradlew

- name: Create google-services.json
env:
Expand Down Expand Up @@ -56,34 +56,51 @@ jobs:
java-version: 17
cache: 'gradle'

- name: Create google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
echo $GOOGLE_SERVICES_JSON > ./android/app/google-services.json
- name: Set up environment variable for BuildConfig
env:
GOOGLE_WEB_CLIENT_ID: ${{ secrets.GOOGLE_WEB_CLIENT_ID }}
BASE_URL_DEV: ${{ secrets.BASE_URL_DEV }}
BASE_URL_API: ${{ secrets.BASE_URL_API }}
run: |
echo google_web_client_id=\"$GOOGLE_WEB_CLIENT_ID\" > ./android/local.properties
echo base_url_dev=\"$BASE_URL_DEV\" >> ./android/local.properties
echo base_url_release=\"$BASE_URL_API\" >> ./android/local.properties
- name: Bumping Version
uses: chkfung/android-version-actions@1.2.3
uses: chkfung/android-version-actions@v1.2.3
with:
gradlePath: ./android/app/build.gradle.kts
versionCode: ${{ github.run_number }}

- name: Assemble Release Bundle
run: ./gradlew bundleRelease
working-directory: ./android

- name: Sign app aab
uses: Tlaster/android-sign@v1
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: ./android/app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }} # Keystore file base64
output: ./android/build/release/signed
signingKeyBase64: ${{ secrets.ANDROID_SIGNING_KEY }}
alias: ${{ secrets.ANDROID_ALIAS }}
keyStorePassword: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "30.0.2"
BUILD_TOOLS_VERSION: "34.0.0"

- name: Set Up Authorization with Google Play
run: echo '${{ secrets.ANDROID_PLAY_AUTH }}' > ./android/service_account.json
run: echo '${{ secrets.ANDROID_PLAY_AUTH }}' > service_account.json

- name: Deploy AAB to Google Play Console
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ./android/service_account.json
serviceAccountJsonPlainText: ${{ secrets.ANDROID_PLAY_AUTH }}
packageName: net.pengcook.android
releaseFiles: ./android/app/build/outputs/bundle/release/app-release.aab
track: internal
track: alpha
status: draft
14 changes: 11 additions & 3 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ android {
applicationId = "net.pengcook.android"
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "0.2"
versionCode = 18
versionName = "0.0.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -38,7 +38,9 @@ android {

buildTypes {
release {
isMinifyEnabled = false
isDebuggable = false
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
Expand All @@ -51,6 +53,12 @@ android {
}

debug {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
buildConfigField("String", "BASE_URL", properties.getProperty("base_url_dev"))
}
}
Expand Down
64 changes: 63 additions & 1 deletion android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,66 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

# Keep the model classes
-keep class net.pengcook.android.data.model.**{ *; }

# -keep class net.pengcook.android.presentation.** { *; } # Fragment 클래스가 있는 패키지
# -keep class net.pengcook.android.presentation.main.MainActivity { *; } # MainActivity 클래스
# -keep class net.pengcook.android.presentation.BindingAdaptersKt { *; } # BindingAdaptersKt 클래스

-keep class net.pengcook.android.presentation.core.model.** { *; }
#-keep class net.pengcook.android.presentation.core.model.User { *; }
#-keep class net.pengcook.android.presentation.core.model.Recipe { *; }
# -keep class net.pengcook.android.presentation.main.** { *; }
# -keep class net.pengcook.android.presentation.onboarding.** { *; }
# -keep class net.pengcook.android.presentation.home.** { *; }

# Keep resource IDs
-keepclassmembers class **.R$* {
public static <fields>;
}

# Keep all Firebase classes
-keep class com.google.firebase.** { *; }
-keep class com.google.android.gms.** { *; }

# Suppress warnings for Firebase packages
-dontwarn com.google.android.gms.**
-dontwarn com.google.firebase.**

# Keep all Google Cloud Platform classes
-keep class com.google.cloud.** { *; }

# Suppress warnings for Google Cloud Platform packages
-dontwarn com.google.cloud.**
-dontwarn com.google.api.**
-dontwarn com.google.auth.**
-dontwarn com.google.protobuf.**

# Keep Google authentication classes
-keep class com.google.android.gms.auth.** { *; }
-keep class com.google.android.gms.common.** { *; }

# Suppress warnings for Google authentication packages
-dontwarn com.google.android.gms.auth.**
-dontwarn com.google.android.gms.common.**

# Keep Retrofit classes
-keep class retrofit2.** { *; }

# Suppress warnings for Retrofit packages
-dontwarn retrofit2.**

# Keep OkHttp classes
-keep class okhttp3.** { *; }

# Suppress warnings for OkHttp packages
-dontwarn okhttp3.**

# Keep Gson classes
-keep class com.google.gson.** { *; }

# Keep Glide classes
-keep class com.bumptech.glide.** { *; }
Binary file modified android/app/release/app-release.aab
Binary file not shown.
6 changes: 3 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,27 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">


<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- 이미지 저장 폴더 읽기/쓰기 권한 -->
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<!--카메라 권한 -->
<uses-permission android:name="android.permission.CAMERA" />

<application
android:name=".presentation.DefaultPengcookApplication"
android:networkSecurityConfig="@xml/network_security_config"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@drawable/logo_image"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_pengcook_round"
android:supportsRtl="true"
android:theme="@style/Theme.Pengcook"
Expand All @@ -32,6 +31,7 @@
<activity
android:name=".presentation.main.MainActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@style/Theme.Pengcook.Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down

0 comments on commit 5095fd1

Please sign in to comment.