From 63c28efa3b2e5112b5406002bcd036346a7b4ed2 Mon Sep 17 00:00:00 2001 From: udenr <98773052+udenr@users.noreply.github.com> Date: Tue, 13 Feb 2024 18:10:34 +0100 Subject: [PATCH 01/10] Update android test workflow (#61) - Use ubuntu-latest instead of macos-latest - Check it tests exist before running - Test on multiple api levels --- .github/workflows/android-test.yml | 94 +++++++++++++++++++----------- 1 file changed, 61 insertions(+), 33 deletions(-) diff --git a/.github/workflows/android-test.yml b/.github/workflows/android-test.yml index ed479cf..ed29655 100644 --- a/.github/workflows/android-test.yml +++ b/.github/workflows/android-test.yml @@ -2,18 +2,59 @@ name: Android Emulator Tests on: [ push, pull_request ] jobs: - connected-tests: - runs-on: macos-latest + check-if-tests-exist: + runs-on: ubuntu-latest + outputs: + status: ${{ steps.check-androidTest.outputs.NOT_EMPTY }} + min-sdk-version: ${{ steps.get-sdk-version.outputs.MIN_SDK_VERSION }} + target-sdk-version: ${{ steps.get-sdk-version.outputs.TARGET_SDK_VERSION }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: "recursive" + - name: Check if androidTest folder is not empty + run: | + echo "NOT_EMPTY=$([ "$(ls -A app/src/androidTest)" ] && echo 'true' || echo 'false')" + echo "NOT_EMPTY=$([ "$(ls -A app/src/androidTest)" ] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT + id: check-androidTest + - name: Get min and target sdk + if: steps.check-androidTest.outputs.NOT_EMPTY == 'true' + id: get-sdk-version + run: | + echo "MIN_SDK_VERSION=$(cat app/build.gradle | grep minSdkVersion | rev | cut -d' ' -f 1 | rev)" >> $GITHUB_OUTPUT + echo "TARGET_SDK_VERSION=$(cat app/build.gradle | grep targetSdkVersion | rev | cut -d' ' -f 1 | rev)" >> $GITHUB_OUTPUT + + test: + needs: check-if-tests-exist + if: needs.check-if-tests-exist.outputs.status == 'true' + runs-on: ubuntu-latest strategy: matrix: - api-level: [29] - target: [default] - arch: [x86_64] + api-level: [34, "${{ needs.check-if-tests-exist.outputs.min-sdk-version }}", "${{ needs.check-if-tests-exist.outputs.target-sdk-version }}"] steps: - name: Checkout uses: actions/checkout@v3 with: submodules: 'recursive' + + - name: Enable KVM group perms + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: Gradle cache + uses: gradle/gradle-build-action@v3 + + - name: AVD cache + uses: actions/cache@v4 + id: avd-cache + with: + path: | + ~/.android/avd/* + ~/.android/adb* + key: avd-${{ matrix.api-level }} - name: Set up JDK environment uses: actions/setup-java@v3 @@ -21,38 +62,25 @@ jobs: distribution: 'zulu' java-version: 17 - - name: Gradle cache - uses: gradle/gradle-build-action@v2 - -# - name: AVD cache -# uses: actions/cache@v3 -# id: avd-cache -# with: -# path: | -# ~/.android/avd/* -# ~/.android/adb* -# key: avd-${{ matrix.api-level }}-${{ matrix.target }}-${{ matrix.arch }} - -# - name: create AVD and generate snapshot for caching -# if: steps.avd-cache.outputs.cache-hit != 'true' -# uses: reactivecircus/android-emulator-runner@v2 -# with: -# api-level: ${{ matrix.api-level }} -# target: ${{ matrix.target }} -# arch: ${{ matrix.arch }} -# force-avd-creation: false -# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -# disable-animations: false -# script: echo "Generated AVD snapshot for caching." + - name: create AVD and generate snapshot for caching + if: steps.avd-cache.outputs.cache-hit != 'true' + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + target: ${{ matrix.api-level >= 30 && 'google_apis' || 'default' }} + arch: ${{ matrix.api-level < 21 && 'x86' || 'x86_64' }} + force-avd-creation: false + emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: false + script: echo "Generated AVD snapshot for caching." - name: Run connected tests uses: ReactiveCircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} - target: ${{ matrix.target }} - arch: ${{ matrix.arch }} - profile: Nexus 6 -# force-avd-creation: false -# emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + target: ${{ matrix.api-level >= 30 && 'google_apis' || 'default' }} + arch: ${{ matrix.api-level < 21 && 'x86' || 'x86_64' }} + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true script: ./gradlew :app:connectedCheck --stacktrace From 2d272ded87343845abe7d33459540372836747d3 Mon Sep 17 00:00:00 2001 From: Patrick Schneider Date: Mon, 19 Feb 2024 15:01:06 +0100 Subject: [PATCH 02/10] Updates copyright in app strings. --- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values-ja/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index de050b5..a334e21 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -64,7 +64,7 @@ Version Authors: In Zusammenarbeit mit - Diese App gehört zur Gruppe der Privacy Friendly Apps entwickelt von der Technischen Universität Darmstadt. Quellcode lizenziert unter GPLv3. Bilder copyright TU Darmstadt und Google Inc. + Diese App gehört zur Gruppe der Privacy Friendly Apps entwickelt vom Karlsruher Institut für Technologie. Quellcode lizenziert unter GPLv3. Bilder copyright KIT und Google Inc. Mehr Informationen unter: und Mitwirkende. diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index e6a1933..b184990 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -65,7 +65,7 @@ 作者: と貢献者。 提携 - このアプリケーションは、ダルムシュタット工科大学 (Technische Universität Darmstadt, Germany) が開発したプライバシーフレンドリーアプリのグループに属しています。ソースコードは GPLv3 の下でライセンスされます。画像の著作権は TU Darmstadt および Google Inc. + このアプリケーションは、ダルムシュタット工科大学 (Karlsruhe Institute of Technology, Germany) が開発したプライバシーフレンドリーアプリのグループに属しています。ソースコードは GPLv3 の下でライセンスされます。画像の著作権は KIT および Google Inc. さらに詳しい情報は以下でご覧ください: ヘルプ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2da636a..06abc25 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -81,7 +81,7 @@ Karola Marky and contributors. In affiliation with - This application belongs to the group of Privacy Friendly Apps developed by Technische Universität Darmstadt. Sourcecode licensed under GPLv3. Images copyright TU Darmstadt and Google Inc. + This application belongs to the group of Privacy Friendly Apps developed by Karlsruhe Institute of Technology. Sourcecode licensed under GPLv3. Images copyright KIT and Google Inc. More information can be found on: Github-Repo SECUSO-Website From c96936f727990aaad2f47d585d07538ea7d349f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Fri, 16 Aug 2024 17:53:47 +0200 Subject: [PATCH 03/10] Update backup api to v1.3.0 --- libs/privacy-friendly-backup-api | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/privacy-friendly-backup-api b/libs/privacy-friendly-backup-api index 2548856..8687a8d 160000 --- a/libs/privacy-friendly-backup-api +++ b/libs/privacy-friendly-backup-api @@ -1 +1 @@ -Subproject commit 254885602ee4501a572f56306fbf2b3712cfc834 +Subproject commit 8687a8dbd170866707dc41bcb879375400ef697a From 37c8a1aa0aa176979cb40fcd4527208ce7ec7daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Fri, 16 Aug 2024 18:04:01 +0200 Subject: [PATCH 04/10] Update ci workflows --- .github/workflows/android-test.yml | 14 +++++++++++++- .github/workflows/changelog.yml | 3 ++- .github/workflows/ci.yml | 30 +++++++++++++++++++++++++----- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/.github/workflows/android-test.yml b/.github/workflows/android-test.yml index ed29655..f666cb8 100644 --- a/.github/workflows/android-test.yml +++ b/.github/workflows/android-test.yml @@ -8,6 +8,7 @@ jobs: status: ${{ steps.check-androidTest.outputs.NOT_EMPTY }} min-sdk-version: ${{ steps.get-sdk-version.outputs.MIN_SDK_VERSION }} target-sdk-version: ${{ steps.get-sdk-version.outputs.TARGET_SDK_VERSION }} + app-id: ${{ steps.get-app-id.outputs.APP_ID }} steps: - name: Checkout uses: actions/checkout@v3 @@ -24,6 +25,10 @@ jobs: run: | echo "MIN_SDK_VERSION=$(cat app/build.gradle | grep minSdkVersion | rev | cut -d' ' -f 1 | rev)" >> $GITHUB_OUTPUT echo "TARGET_SDK_VERSION=$(cat app/build.gradle | grep targetSdkVersion | rev | cut -d' ' -f 1 | rev)" >> $GITHUB_OUTPUT + - name: Get app ID + id: get-app-id + run: | + echo "APP_ID=$(cat app/build.gradle | grep applicationId | rev | cut -d' ' -f 1 | rev | tr -d '"')" >> $GITHUB_OUTPUT test: needs: check-if-tests-exist @@ -83,4 +88,11 @@ jobs: force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true - script: ./gradlew :app:connectedCheck --stacktrace + script: | + adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}} || true + adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}}.test || true + adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}}.androidTest || true + ./gradlew :app:connectedCheck --stacktrace + adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}} || true + adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}}.test || true + adb uninstall ${{needs.check-if-tests-exist.outputs.app-id}}.androidTest || true \ No newline at end of file diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index ad4099a..6e50db1 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -2,7 +2,7 @@ name: Changelog Generation on: release: - types: [published, released] + types: [published] workflow_dispatch: jobs: @@ -16,6 +16,7 @@ jobs: - uses: rhysd/changelog-from-release/action@v3 with: file: CHANGELOG.md + pull_request: true github_token: ${{ secrets.GITHUB_TOKEN }} commit_summary_template: 'update changelog for %s changes' args: -l 2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44e06f7..99f0199 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,19 +1,19 @@ -name: Build Test -on: [ push, pull_request ] +name: Continuous Integration +on: [push, pull_request] jobs: - build: + test: runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v3 with: - submodules: 'recursive' + submodules: "recursive" - name: Set up JDK environment uses: actions/setup-java@v3 with: - distribution: 'zulu' + distribution: "zulu" java-version: 17 - name: Make gradlew executable @@ -25,5 +25,25 @@ jobs: - name: Run local unit tests run: bash ./gradlew test --stacktrace + build: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: "recursive" + + - name: Set up JDK environment + uses: actions/setup-java@v3 + with: + distribution: "zulu" + java-version: 17 + + - name: Make gradlew executable + run: chmod +x ./gradlew + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + - name: Build the app run: bash ./gradlew build --stacktrace \ No newline at end of file From 1462f7a298107bd23eebe4f117dfa8a9879ffb30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Fri, 16 Aug 2024 18:26:11 +0200 Subject: [PATCH 05/10] Fix JCenter dependency --- app/build.gradle | 2 +- build.gradle | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1f395d4..a222f27 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -53,7 +53,7 @@ dependencies { implementation 'androidx.legacy:legacy-support-core-utils:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.3.1' implementation 'androidx.cardview:cardview:1.0.0' - implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1' + implementation 'com.github.amulyakhare:TextDrawable:558677ea31' implementation 'androidx.security:security-crypto-ktx:1.1.0-alpha06' def work_version = "2.8.1" diff --git a/build.gradle b/build.gradle index 4925a63..434575f 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,6 @@ buildscript { ext.kotlin_version = "1.8.10" repositories { - jcenter() mavenCentral() google() } @@ -19,9 +18,9 @@ buildscript { allprojects { repositories { - jcenter() mavenCentral() google() + maven { url('https://jitpack.io') } } } From 97dba7af8f52715defe96b63d0dae13ce40286da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Fri, 16 Aug 2024 18:27:39 +0200 Subject: [PATCH 06/10] Update target sdk and dependencies --- app/build.gradle | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a222f27..2ddd5c6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,11 +2,11 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { - compileSdkVersion 33 defaultConfig { applicationId "org.secuso.privacyfriendlypasswordgenerator" minSdkVersion 21 - targetSdkVersion 33 + targetSdkVersion 34 + compileSdk 34 versionCode 7 versionName "1.3.0" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' @@ -38,25 +38,25 @@ repositories { dependencies { implementation project(path: ':backup-api') implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.sqlite:sqlite:2.3.1' + implementation 'androidx.sqlite:sqlite:2.4.0' androidTestImplementation('androidx.test.espresso:espresso-core:3.5.1', { exclude group: 'com.android.support', module: 'support-annotations' }) - androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.ext:junit:1.2.1' androidTestImplementation('com.android.support.test.espresso:espresso-contrib:3.0.2') { exclude group: 'com.android.support', module: 'appcompat' exclude group: 'com.android.support', module: 'support-v4' exclude module: 'recyclerview-v7' } - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.9.0' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'com.google.android.material:material:1.12.0' implementation 'androidx.legacy:legacy-support-core-utils:1.0.0' - implementation 'androidx.recyclerview:recyclerview:1.3.1' + implementation 'androidx.recyclerview:recyclerview:1.3.2' implementation 'androidx.cardview:cardview:1.0.0' implementation 'com.github.amulyakhare:TextDrawable:558677ea31' implementation 'androidx.security:security-crypto-ktx:1.1.0-alpha06' - def work_version = "2.8.1" + def work_version = "2.9.1" implementation "androidx.work:work-runtime:$work_version" implementation "androidx.work:work-runtime-ktx:$work_version" androidTestImplementation "androidx.work:work-testing:$work_version" From 2b2ff7952875a79774cb59e8a3f6dedb07430175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Fri, 16 Aug 2024 18:36:06 +0200 Subject: [PATCH 07/10] Change severity of missing translations to warning --- app/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 2ddd5c6..78c079b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -24,7 +24,8 @@ android { } } lint { - abortOnError false + abortOnError true + warning 'MissingTranslation' } namespace 'org.secuso.privacyfriendlypasswordgenerator' } From ca6364bd97c14ef6d26eefc40ae641613d4adc00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Fri, 16 Aug 2024 18:48:07 +0200 Subject: [PATCH 08/10] Remove WorkManagerInitializer --- app/src/main/AndroidManifest.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4429813..2dc611e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -24,11 +24,6 @@ tools:node="remove"> - - Date: Fri, 16 Aug 2024 18:50:57 +0200 Subject: [PATCH 09/10] Downgrade appcompat version to fix build errors --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 78c079b..2beac2d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -49,7 +49,7 @@ dependencies { exclude group: 'com.android.support', module: 'support-v4' exclude module: 'recyclerview-v7' } - implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.12.0' implementation 'androidx.legacy:legacy-support-core-utils:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.3.2' From d767394b26dc428b3d00a00346dfb29745c15a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=A4nge?= Date: Fri, 16 Aug 2024 18:55:51 +0200 Subject: [PATCH 10/10] Bump version to v1.3.1 (8) --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2beac2d..fc994b2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { minSdkVersion 21 targetSdkVersion 34 compileSdk 34 - versionCode 7 - versionName "1.3.0" + versionCode 8 + versionName "1.3.1" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' } buildTypes {