From 5e99a481dab678a2966639825cbd4876f4d604ac Mon Sep 17 00:00:00 2001 From: Kirill Kamakin Date: Sun, 12 Jun 2022 19:52:00 +0200 Subject: [PATCH 1/6] Disable jetifier --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 26b218d..fa1a3cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,5 +3,5 @@ org.gradle.parallel=true org.gradle.caching=true org.gradle.unsafe.configuration-cache=true android.useAndroidX=true -android.enableJetifier=true +android.enableJetifier=false kotlin.code.style=official \ No newline at end of file From daac06fa1f24cc47797c4af54218085bd7700878 Mon Sep 17 00:00:00 2001 From: Kirill Kamakin Date: Sun, 12 Jun 2022 19:56:14 +0200 Subject: [PATCH 2/6] Disable crashlytics for debug builds --- app/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/app/build.gradle b/app/build.gradle index 6fe09c4..1eba495 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -50,6 +50,7 @@ android { buildTypes { debug { + ext.enableCrashlytics = false testCoverageEnabled true } release { From 564d088085baf6205987afd30debc2250b7bf733 Mon Sep 17 00:00:00 2001 From: Kirill Kamakin Date: Sun, 12 Jun 2022 19:58:37 +0200 Subject: [PATCH 3/6] Disable cache on CI Right now it takes more time to download cache than it is to actually build from scratch --- .github/workflows/check.yml | 16 +--------------- .github/workflows/sign.yml | 16 +--------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 6399a1b..99402d8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -10,25 +10,11 @@ jobs: with: fetch-depth: 0 - - name: Cache SonarCloud packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Cache Gradle packages - uses: actions/cache@v1 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - name: Run tests env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew check coverageReport sonarqube --no-daemon --no-configuration-cache + run: ./gradlew check coverageReport sonarqube --no-daemon --no-configuration-cache --no-build-cache - name: Publish test reports uses: mikepenz/action-junit-report@v2 diff --git a/.github/workflows/sign.yml b/.github/workflows/sign.yml index 7bd8504..b9f92e7 100644 --- a/.github/workflows/sign.yml +++ b/.github/workflows/sign.yml @@ -13,20 +13,6 @@ jobs: with: fetch-depth: 0 - - name: Cache SonarCloud packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Cache Gradle packages - uses: actions/cache@v1 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - name: Sign APK env: MEALIENT_KEY_STORE: ${{ secrets.MEALIENT_KEY_STORE }} @@ -42,7 +28,7 @@ jobs: echo "storePassword=$MEALIENT_KEY_STORE_PASSWORD" >> keystore.properties echo "keyAlias=$MEALIENT_KEY_ALIAS" >> keystore.properties echo "keyPassword=$MEALIENT_KEY_PASSWORD" >> keystore.properties - ./gradlew build coverageReport sonarqube uploadToAppSweepRelease --no-daemon --no-configuration-cache + ./gradlew build coverageReport sonarqube uploadToAppSweepRelease --no-daemon --no-configuration-cache --no-build-cache cp app/build/outputs/apk/release/*.apk mealient-release.apk - name: Upload signed APK From f87f694724b9fe56a5fbb7cf63b832d839ed9624 Mon Sep 17 00:00:00 2001 From: Kirill Kamakin Date: Sun, 12 Jun 2022 19:59:41 +0200 Subject: [PATCH 4/6] Ignore API level warnings in manifest --- app/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5f54aab..1d2163d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,7 +16,7 @@ android:roundIcon="@mipmap/ic_launcher" android:supportsRtl="true" android:theme="@style/AppTheme" - tools:targetApi="s"> + tools:ignore="UnusedAttribute"> From 02fd24367b0a7f3e3c713e10436265249627ce89 Mon Sep 17 00:00:00 2001 From: Kirill Kamakin Date: Sun, 12 Jun 2022 20:00:22 +0200 Subject: [PATCH 5/6] Remove unused resource --- app/src/main/res/values/dimens.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 49dcb38..01d1f49 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -3,7 +3,6 @@ 8dp 182dp @dimen/height_view_holder_recipe_image - 30dp 32dp 15dp \ No newline at end of file From 442b0e78c64de7d33398eea52d5bb4c6d95b191f Mon Sep 17 00:00:00 2001 From: Kirill Kamakin Date: Sun, 12 Jun 2022 20:11:52 +0200 Subject: [PATCH 6/6] Fix crashes due to protobuf obfuscation --- app/proguard-rules.pro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 977a91b..76a24f3 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -20,6 +20,10 @@ # hide the original source file name. #-renamesourcefileattribute SourceFile +### Keep Protobuf classes https://github.com/protocolbuffers/protobuf/issues/6463#issuecomment-632884075 ### +-keep class * extends com.google.protobuf.GeneratedMessageLite { *; } +### Keep Protobuf classes https://github.com/protocolbuffers/protobuf/issues/6463#issuecomment-632884075 ### + ### Remove logging https://www.guardsquare.com/manual/configuration/examples#logging ### -assumenosideeffects class android.util.Log { public static int v(...);