From 5fd03233e192791b66a1454ec15e550e6f2a1875 Mon Sep 17 00:00:00 2001 From: lone-cloud Date: Sun, 25 Jan 2026 15:39:34 -0800 Subject: [PATCH] no need for android app --- .env.example | 8 +- .github/workflows/android-ci.yml | 55 -- MOTIVATION.md | 38 - README.md | 26 +- .../.kotlin/errors/errors-1768368072295.log | 71 -- android/app/build.gradle.kts | 106 --- android/app/gradle.lockfile | 252 ------- android/app/proguard-rules.pro | 22 - .../com.lonecloud.sup.db.Database/17.json | 216 ------ android/app/src/main/AndroidManifest.xml | 114 --- .../com/lonecloud/sup/DistributorService.kt | 132 ---- .../sup/SignalNotificationListener.kt | 187 ----- .../java/com/lonecloud/sup/app/Application.kt | 23 - .../java/com/lonecloud/sup/db/Database.kt | 453 ------------ .../java/com/lonecloud/sup/db/Repository.kt | 493 ------------- .../java/com/lonecloud/sup/msg/ApiService.kt | 193 ------ .../com/lonecloud/sup/msg/BroadcastService.kt | 109 --- .../java/com/lonecloud/sup/msg/Message.kt | 49 -- .../sup/msg/NotificationDispatcher.kt | 79 --- .../lonecloud/sup/msg/NotificationParser.kt | 37 - .../lonecloud/sup/msg/NotificationService.kt | 225 ------ .../com/lonecloud/sup/service/Exceptions.kt | 12 - .../sup/service/SignalListenerService.kt | 84 --- .../java/com/lonecloud/sup/ui/AddFragment.kt | 466 ------------- .../main/java/com/lonecloud/sup/ui/BaseUrl.kt | 68 -- .../main/java/com/lonecloud/sup/ui/Colors.kt | 86 --- .../com/lonecloud/sup/ui/DetailViewModel.kt | 31 - .../java/com/lonecloud/sup/ui/MainActivity.kt | 652 ------------------ .../java/com/lonecloud/sup/ui/MainAdapter.kt | 154 ----- .../com/lonecloud/sup/ui/MainViewModel.kt | 53 -- .../com/lonecloud/sup/ui/PriorityAdapter.kt | 58 -- .../com/lonecloud/sup/up/BroadcastReceiver.kt | 221 ------ .../java/com/lonecloud/sup/up/Constants.kt | 21 - .../java/com/lonecloud/sup/up/Distributor.kt | 51 -- .../java/com/lonecloud/sup/up/FailedReason.kt | 23 - .../java/com/lonecloud/sup/up/LinkActivity.kt | 36 - .../lonecloud/sup/up/RaiseAppToForeground.kt | 311 --------- .../sup/up/RaiseAppToForegroundFactory.kt | 39 -- .../java/com/lonecloud/sup/util/CertUtil.kt | 98 --- .../java/com/lonecloud/sup/util/Constants.kt | 11 - .../java/com/lonecloud/sup/util/HttpUtil.kt | 75 -- .../main/java/com/lonecloud/sup/util/Log.kt | 204 ------ .../lonecloud/sup/util/ProgressRequestBody.kt | 37 - .../main/java/com/lonecloud/sup/util/Util.kt | 456 ------------ .../app/src/main/res/anim/slide_in_bottom.xml | 9 - .../src/main/res/anim/slide_out_bottom.xml | 9 - .../main/res/drawable/ic_add_black_24dp.xml | 9 - .../drawable/ic_announcement_orange_24dp.xml | 9 - .../drawable/ic_battery_alert_red_24dp.xml | 9 - .../main/res/drawable/ic_bolt_gray_24dp.xml | 9 - .../drawable/ic_bolt_outline_white_24dp.xml | 10 - .../main/res/drawable/ic_bolt_white_24dp.xml | 10 - .../main/res/drawable/ic_cancel_gray_24dp.xml | 28 - .../app/src/main/res/drawable/ic_circle.xml | 5 - .../main/res/drawable/ic_close_white_24dp.xml | 11 - .../drawable/ic_content_copy_white_24dp.xml | 9 - .../res/drawable/ic_create_white_24dp.xml | 9 - .../res/drawable/ic_delete_white_20dp.xml | 10 - .../res/drawable/ic_drop_down_gray_24dp.xml | 27 - .../res/drawable/ic_drop_up_gray_24dp.xml | 28 - .../main/res/drawable/ic_error_red_24dp.xml | 9 - .../res/drawable/ic_expand_less_gray_24dp.xml | 10 - .../res/drawable/ic_file_app_gray_24dp.xml | 9 - .../drawable/ic_file_audio_purple_24dp.xml | 9 - .../drawable/ic_file_document_blue_24dp.xml | 9 - .../res/drawable/ic_file_image_red_24dp.xml | 9 - .../drawable/ic_file_video_orange_24dp.xml | 9 - .../res/drawable/ic_launcher_monochrome.xml | 31 - .../res/drawable/ic_more_horiz_gray_24dp.xml | 9 - .../src/main/res/drawable/ic_notification.xml | 31 - ...ic_notifications_off_gray_outline_24dp.xml | 12 - ...tifications_off_time_gray_outline_24dp.xml | 15 - ...ifications_off_time_white_outline_24dp.xml | 16 - ...c_notifications_off_white_outline_24dp.xml | 13 - .../drawable/ic_notifications_white_24dp.xml | 10 - .../main/res/drawable/ic_priority_1_24dp.xml | 26 - .../main/res/drawable/ic_priority_2_24dp.xml | 19 - .../main/res/drawable/ic_priority_3_24dp.xml | 13 - .../main/res/drawable/ic_priority_4_24dp.xml | 20 - .../main/res/drawable/ic_priority_5_24dp.xml | 26 - .../main/res/drawable/ic_send_white_24dp.xml | 9 - .../main/res/drawable/ic_sms_gray_24dp.xml | 18 - .../main/res/drawable/ic_sms_gray_48dp.xml | 18 - .../res/drawable/ic_warning_amber_24dp.xml | 10 - .../res/drawable/ic_warning_white_24dp.xml | 9 - .../src/main/res/layout/activity_detail.xml | 115 --- .../app/src/main/res/layout/activity_main.xml | 304 -------- .../src/main/res/layout/app_bar_drawer.xml | 17 - .../app/src/main/res/layout/button_action.xml | 21 - .../main/res/layout/fragment_add_dialog.xml | 342 --------- .../fragment_add_dialog_dropdown_item.xml | 14 - .../main/res/layout/fragment_detail_item.xml | 210 ------ .../main/res/layout/fragment_main_item.xml | 83 --- .../res/layout/item_priority_dropdown.xml | 28 - .../src/main/res/layout/view_message_bar.xml | 83 --- .../app/src/main/res/menu/menu_add_dialog.xml | 10 - .../main/res/menu/menu_detail_action_bar.xml | 50 -- .../main/res/menu/menu_detail_action_mode.xml | 14 - .../main/res/menu/menu_detail_attachment.xml | 10 - .../main/res/menu/menu_main_action_bar.xml | 37 - .../main/res/menu/menu_main_action_mode.xml | 9 - .../res/mipmap-anydpi-v26/ic_launcher.xml | 13 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 9154 -> 0 bytes .../mipmap-hdpi/ic_launcher_background.png | Bin 299 -> 0 bytes .../mipmap-hdpi/ic_launcher_foreground.png | Bin 9154 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 5211 -> 0 bytes .../mipmap-mdpi/ic_launcher_background.png | Bin 297 -> 0 bytes .../mipmap-mdpi/ic_launcher_foreground.png | Bin 5211 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 13884 -> 0 bytes .../mipmap-xhdpi/ic_launcher_background.png | Bin 302 -> 0 bytes .../mipmap-xhdpi/ic_launcher_foreground.png | Bin 13884 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 24977 -> 0 bytes .../mipmap-xxhdpi/ic_launcher_background.png | Bin 310 -> 0 bytes .../mipmap-xxhdpi/ic_launcher_foreground.png | Bin 24977 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 37854 -> 0 bytes .../mipmap-xxxhdpi/ic_launcher_background.png | Bin 312 -> 0 bytes .../mipmap-xxxhdpi/ic_launcher_foreground.png | Bin 37854 -> 0 bytes android/app/src/main/res/values/colors.xml | 56 -- android/app/src/main/res/values/dimens.xml | 4 - .../res/values/ic_launcher_background.xml | 4 - android/app/src/main/res/values/strings.xml | 163 ----- android/app/src/main/res/values/themes.xml | 117 ---- android/app/src/main/res/xml/file_paths.xml | 5 - .../main/res/xml/network_security_config.xml | 9 - android/build.gradle.kts | 26 - android/gradle.properties | 4 - android/gradle/wrapper/gradle-wrapper.jar | Bin 45633 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 - android/gradlew | 248 ------- android/gradlew.bat | 93 --- android/settings.gradle.kts | 19 - package.json | 4 - scripts/check-android-deps.ts | 168 ----- scripts/release-android.ts | 50 -- scripts/test-android-build.ts | 33 - scripts/update-android-lockfile.ts | 12 - server/constants/config.ts | 2 - server/index.ts | 2 - server/modules/signal.ts | 12 +- server/modules/unified-push.ts | 54 -- server/routes/admin.ts | 7 +- server/routes/unified-push.ts | 47 -- 142 files changed, 8 insertions(+), 9203 deletions(-) delete mode 100644 .github/workflows/android-ci.yml delete mode 100644 MOTIVATION.md delete mode 100644 android/.kotlin/errors/errors-1768368072295.log delete mode 100644 android/app/build.gradle.kts delete mode 100644 android/app/gradle.lockfile delete mode 100644 android/app/proguard-rules.pro delete mode 100644 android/app/schemas/com.lonecloud.sup.db.Database/17.json delete mode 100644 android/app/src/main/AndroidManifest.xml delete mode 100644 android/app/src/main/java/com/lonecloud/sup/DistributorService.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/SignalNotificationListener.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/app/Application.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/db/Database.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/db/Repository.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/msg/ApiService.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/msg/BroadcastService.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/msg/Message.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/msg/NotificationDispatcher.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/msg/NotificationParser.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/msg/NotificationService.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/service/Exceptions.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/service/SignalListenerService.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/ui/AddFragment.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/ui/BaseUrl.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/ui/Colors.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/ui/DetailViewModel.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/ui/MainActivity.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/ui/MainAdapter.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/ui/MainViewModel.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/ui/PriorityAdapter.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/up/BroadcastReceiver.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/up/Constants.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/up/Distributor.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/up/FailedReason.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/up/LinkActivity.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/up/RaiseAppToForeground.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/up/RaiseAppToForegroundFactory.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/util/CertUtil.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/util/Constants.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/util/HttpUtil.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/util/Log.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/util/ProgressRequestBody.kt delete mode 100644 android/app/src/main/java/com/lonecloud/sup/util/Util.kt delete mode 100644 android/app/src/main/res/anim/slide_in_bottom.xml delete mode 100644 android/app/src/main/res/anim/slide_out_bottom.xml delete mode 100644 android/app/src/main/res/drawable/ic_add_black_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_announcement_orange_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_battery_alert_red_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_bolt_gray_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_bolt_outline_white_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_bolt_white_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_cancel_gray_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_circle.xml delete mode 100644 android/app/src/main/res/drawable/ic_close_white_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_content_copy_white_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_create_white_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_delete_white_20dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_drop_down_gray_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_drop_up_gray_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_error_red_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_expand_less_gray_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_file_app_gray_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_file_audio_purple_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_file_document_blue_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_file_image_red_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_file_video_orange_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_launcher_monochrome.xml delete mode 100644 android/app/src/main/res/drawable/ic_more_horiz_gray_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_notification.xml delete mode 100644 android/app/src/main/res/drawable/ic_notifications_off_gray_outline_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_notifications_off_time_gray_outline_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_notifications_off_time_white_outline_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_notifications_off_white_outline_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_notifications_white_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_priority_1_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_priority_2_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_priority_3_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_priority_4_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_priority_5_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_send_white_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_sms_gray_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_sms_gray_48dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_warning_amber_24dp.xml delete mode 100644 android/app/src/main/res/drawable/ic_warning_white_24dp.xml delete mode 100644 android/app/src/main/res/layout/activity_detail.xml delete mode 100644 android/app/src/main/res/layout/activity_main.xml delete mode 100644 android/app/src/main/res/layout/app_bar_drawer.xml delete mode 100644 android/app/src/main/res/layout/button_action.xml delete mode 100644 android/app/src/main/res/layout/fragment_add_dialog.xml delete mode 100644 android/app/src/main/res/layout/fragment_add_dialog_dropdown_item.xml delete mode 100644 android/app/src/main/res/layout/fragment_detail_item.xml delete mode 100644 android/app/src/main/res/layout/fragment_main_item.xml delete mode 100644 android/app/src/main/res/layout/item_priority_dropdown.xml delete mode 100644 android/app/src/main/res/layout/view_message_bar.xml delete mode 100644 android/app/src/main/res/menu/menu_add_dialog.xml delete mode 100644 android/app/src/main/res/menu/menu_detail_action_bar.xml delete mode 100644 android/app/src/main/res/menu/menu_detail_action_mode.xml delete mode 100644 android/app/src/main/res/menu/menu_detail_attachment.xml delete mode 100644 android/app/src/main/res/menu/menu_main_action_bar.xml delete mode 100644 android/app/src/main/res/menu/menu_main_action_mode.xml delete mode 100644 android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml delete mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png delete mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png delete mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png delete mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png delete mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png delete mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png delete mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png delete mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png delete mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png delete mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png delete mode 100644 android/app/src/main/res/values/colors.xml delete mode 100644 android/app/src/main/res/values/dimens.xml delete mode 100644 android/app/src/main/res/values/ic_launcher_background.xml delete mode 100644 android/app/src/main/res/values/strings.xml delete mode 100644 android/app/src/main/res/values/themes.xml delete mode 100644 android/app/src/main/res/xml/file_paths.xml delete mode 100644 android/app/src/main/res/xml/network_security_config.xml delete mode 100644 android/build.gradle.kts delete mode 100644 android/gradle.properties delete mode 100644 android/gradle/wrapper/gradle-wrapper.jar delete mode 100644 android/gradle/wrapper/gradle-wrapper.properties delete mode 100755 android/gradlew delete mode 100644 android/gradlew.bat delete mode 100644 android/settings.gradle.kts delete mode 100644 scripts/check-android-deps.ts delete mode 100644 scripts/release-android.ts delete mode 100644 scripts/test-android-build.ts delete mode 100644 scripts/update-android-lockfile.ts delete mode 100644 server/modules/unified-push.ts delete mode 100644 server/routes/unified-push.ts diff --git a/.env.example b/.env.example index 9cba50b..6cfac01 100644 --- a/.env.example +++ b/.env.example @@ -28,10 +28,4 @@ # PROTON_IMAP_PASSWORD=bridge-generated-password # PROTON_BRIDGE_HOST=protonmail-bridge # PROTON_BRIDGE_PORT=143 -# PROTON_SUP_TOPIC=Proton Mail - -# Optional: Enable Android app integration for notifications -# When enabled, messages include app launch codes that SUP Android app intercepts to open -# the relevant app (Proton Mail or Home Assistant) when notification is tapped. -# Default: false -# ENABLE_ANDROID_INTEGRATION=true \ No newline at end of file +# PROTON_SUP_TOPIC=Proton Mail \ No newline at end of file diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml deleted file mode 100644 index 8bb8d3a..0000000 --- a/.github/workflows/android-ci.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Android CI - -on: - push: - branches: [master] - paths: - - 'android/**' - - '.github/workflows/android-ci.yml' - pull_request: - branches: [master] - paths: - - 'android/**' - - '.github/workflows/android-ci.yml' - -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup JDK - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - - name: Verify lockfile is up-to-date - run: | - cd android - chmod +x gradlew - ./gradlew dependencies --write-locks - if ! git diff --exit-code app/gradle.lockfile; then - echo "Lockfile is out of date. Run: cd android && ./gradlew dependencies --write-locks" - exit 1 - fi - echo "Lockfile is up-to-date" - - - name: Decode keystore - env: - KEYSTORE_BASE64: ${{ secrets.KEYSTORE_FILE }} - run: | - echo "$KEYSTORE_BASE64" | base64 -d > android/release.keystore - - - name: Build signed APK - env: - KEYSTORE_FILE: ${{ github.workspace }}/android/release.keystore - KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} - KEY_ALIAS: ${{ secrets.KEY_ALIAS }} - KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} - run: | - cd android - ./gradlew assembleRelease --build-cache --configuration-cache diff --git a/MOTIVATION.md b/MOTIVATION.md deleted file mode 100644 index 64d8d7e..0000000 --- a/MOTIVATION.md +++ /dev/null @@ -1,38 +0,0 @@ -# The Privacy Paradox of Self-Hosting - -## Preface - -A self-proclaimed infosec nerd blew my mind with this realization on the Graphene OS forums. Since then I've stopped self-hosting my mollysocket, ntfy, Vaultwarden and FMD servers. I ended up switching back to Bitwarden and also I'm now using Molly.im with WebSockets for push notifications. I realize that self-hosting is often talked about as a great way to protect your privacy and fully own your data (and metadata). I thought this would be fun to argue that you should almost never self-host anything and especially if you intend to expose and access it on the internet. - -## Network footprinting - -As we use our devices we leave a digital footprint on the network. This footprint is composed of the requests that we make to the digital services that we interact with. Sure, there are some ways to muddy this footprint by using Tor and/or VPNs. - -There are very definite drawbacks to using such tools as Tor is dreadfully slow, which makes it very painful for everyday use especially for things like push notifications which one would expect to work quickly. VPNs shift the trust to your provider who is another party that you will need to trust to not invade your privacy and one that you will likely need to pay. - -Using either of these options can make you a target for deeper surveillance as neither of these options will fully mask your use of them. A network sniffing adversary might start to wonder what you're trying to hide by needing to use such niche tools to muddy your network footprint. - -## The network footprint of self-hosted systems - -Unless you enjoy typing out IP addresses, you will likely need to register your self-hosted system to a domain which will be registered with the DNS. This domain may very well be linked back to you either through your payment or through the registrar's KYC system. - -Even if you somehow don't use a domain name, you will be broadcasting your connection to a unique IP address that a network sniffer could pick up on. If that unique connection ever gets linked to the real you, like through your domain registration or other means, an adversary could track your location as you move around and connect to different networks like WiFi at cafes, libraries, airports, etc… - -## My experience with degoogling and using UnifiedPush - -I am fully degoogled meaning I run an Android OS (Graphene OS) without the Google Play services. The biggest challenge here is that Google Play services bundle in their Firebase Cloud Messaging, which you won't have resulting in the lack of push notifications for your apps. The community solution for this is to use the UnifiedPush system which requires you to download an UP distributor app like ntfy, which will maintain a single WebSocket connection to an UP server that will forward to you any notifications that you may get from any of the supporting apps. One such app that I frequently use is Molly which is a fork of Signal with great support for degoogled users like myself. Molly supports UP, FCM and direct WS connections to the Signal network. - -As I started tracking the connections that my phone makes, I noticed that I'm constantly making connections to a super niche UP server to await for push notifications. These connections are a technical requirement as WS must routinely confirm the client's connection by sending out heartbeat messages. In my case I was also self-hosting a private ntfy server (together with a Molly-required MollySocket server) that was served from my private domain. I realized that this is very poor privacy hygiene as anything that was sniffing my network could easily figure out that it's my requests based on the very unique URL. - -## My solution: SUP bro - -Signal UnifiedPush will consist of an Android app that will act as an UP distributor. It will listen on Signal notifications to potentially act on them like to wake an app to refresh its data. - -SUP will also consist of a strictly self-hostable server component that will proxy the UP push notifications through Signal groups instead of through an UP server like ntfy.sh. This server must be self-hosted as it will be linked as a new device to the user's Signal account to receive the notifications. After the initial setup, the server will not need to be exposed to the internet as it will only make outbound connections to the Signal servers. - -## Closing thoughts - -Self-hosting is still valuable for many use cases, especially when services don't need to be accessed over the internet. However, when it comes to services you access remotely, the privacy trade-offs are often worse than using established providers that blend your traffic with millions of other users. - -The SUP project aims to provide a middle ground: the privacy benefits of using a widely-adopted service (Signal) while maintaining the control and ownership that self-hosting provides. - diff --git a/README.md b/README.md index 534ca5a..fa7b865 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,6 @@ SUP also includes an optional Proton Mail integration, allowing you to receive e Note that you'll need to run SUP on your own server at home since it uses your personal Signal and Proton Mail credentials. A Raspberry Pi works perfectly for this, using minimal power (3-5W) while running SUP 24/7. -> **� Background:** For a detailed explanation of the privacy paradox of self-hosting that motivated this project, see [MOTIVATION.md](MOTIVATION.md). - -> **�💡 Privacy Tip:** Use [Molly.im](https://molly.im/) (hardened Signal fork) with **WebSocket** notifications instead of the official Signal app. This ensures all Signal traffic, including SUP notifications, goes through WebSockets, making it indistinguishable from regular Signal messages. - ## How? SUP functions as a UnifiedPush server to proxy http-based requests to Signal groups via [signal-cli](https://github.com/AsamK/signal-cli). @@ -36,21 +32,7 @@ For the optional Proton Mail integration, SUP requires a server that runs Proton ## Setup -### 1. Install Android App (Optional) - -> ⚠️ **Early Alpha**: The Android app is currently unavailable, but is planned for the full release of SUP. - -An Android app is optionally available to connect UnifiedPush Android apps to the SUP server. It can also provide a better experience for displaying SUP-based notifications if the `ENABLE_ANDROID_INTEGRATION` environment variable is enabled on the server. - -Download the latest APK from [GitHub Releases](https://github.com/lone-cloud/sup/releases). - -**Certificate Fingerprint:** - -```text -0D:3C:99:15:0E:12:1A:DE:0D:AE:05:CB:16:46:5E:65:31:56:DC:D6:98:87:59:4E:79:B1:0D:AE:1E:56:F2:E8 -``` - -### 2. Proton Mail Integration (Optional) +### 1. Proton Mail Integration > ⚠️ **Early Alpha**: Currently only `docker-compose.dev.yml` dev deployments are available. @@ -100,7 +82,7 @@ Your phone will now receive Signal notifications when Proton Mail receives new e Note that the bridge will first need to sync all of your old emails before you can start getting new email notifications which may take a while, but this is a one-time setup. -### 3. Install SUP Server +### 2. Install SUP Server > ⚠️ **Early Alpha**: Currently only `docker-compose.dev.yml` dev deployments are available. @@ -120,7 +102,7 @@ docker compose up -d ``` -### 4. Link Your Signal Account +### 3. Link Your Signal Account Visit and link your Signal account (one-time setup): @@ -226,5 +208,3 @@ SUP consists of two services that **MUST run together on the same machine**: - **protonmail-bridge** (Official Proton, optional): Decrypts Proton Mail emails, runs local IMAP server All services communicate over a private Docker network with no external exposure except Signal protocol. **Separating these services across multiple machines would expose plaintext IMAP traffic and compromise security.** - -**Android App** (Kotlin): Monitors Signal notifications, extracts UnifiedPush payloads, delivers to apps diff --git a/android/.kotlin/errors/errors-1768368072295.log b/android/.kotlin/errors/errors-1768368072295.log deleted file mode 100644 index 8834305..0000000 --- a/android/.kotlin/errors/errors-1768368072295.log +++ /dev/null @@ -1,71 +0,0 @@ -kotlin version: 2.0.21 -error message: org.jetbrains.kotlin.util.FileAnalysisException: While analysing /home/eggy/Projects/sup/android/app/src/main/java/com/lonecloud/sup/DistributorService.kt:29:5: java.lang.IllegalArgumentException: source must not be null - at org.jetbrains.kotlin.util.AnalysisExceptionsKt.wrapIntoFileAnalysisExceptionIfNeeded(AnalysisExceptions.kt:57) - at org.jetbrains.kotlin.fir.FirCliExceptionHandler.handleExceptionOnFileAnalysis(Utils.kt:249) - at org.jetbrains.kotlin.fir.pipeline.AnalyseKt.runCheckers(analyse.kt:46) - at org.jetbrains.kotlin.fir.pipeline.FirUtilsKt.resolveAndCheckFir(firUtils.kt:77) - at org.jetbrains.kotlin.fir.pipeline.FirUtilsKt.buildResolveAndCheckFirViaLightTree(firUtils.kt:88) - at org.jetbrains.kotlin.cli.jvm.compiler.pipeline.JvmCompilerPipelineKt.compileModuleToAnalyzedFir(jvmCompilerPipeline.kt:319) - at org.jetbrains.kotlin.cli.jvm.compiler.pipeline.JvmCompilerPipelineKt.compileModulesUsingFrontendIrAndLightTree(jvmCompilerPipeline.kt:118) - at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:148) - at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:43) - at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:103) - at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:49) - at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101) - at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:464) - at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:73) - at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.doCompile(IncrementalCompilerRunner.kt:506) - at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:423) - at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileNonIncrementally(IncrementalCompilerRunner.kt:301) - at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:129) - at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:675) - at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:92) - at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1660) - at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) - at java.base/java.lang.reflect.Method.invoke(Method.java:565) - at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:351) - at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:166) - at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:543) - at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:744) - at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:623) - at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090) - at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614) - at java.base/java.lang.Thread.run(Thread.java:1474) -Caused by: java.lang.IllegalArgumentException: source must not be null - at org.jetbrains.kotlin.diagnostics.KtDiagnosticReportHelpersKt.requireNotNull(KtDiagnosticReportHelpers.kt:68) - at org.jetbrains.kotlin.diagnostics.KtDiagnosticReportHelpersKt.reportOn(KtDiagnosticReportHelpers.kt:39) - at org.jetbrains.kotlin.diagnostics.KtDiagnosticReportHelpersKt.reportOn$default(KtDiagnosticReportHelpers.kt:31) - at org.jetbrains.kotlin.fir.analysis.checkers.expression.FirIncompatibleClassExpressionChecker.checkSourceElement(FirIncompatibleClassExpressionChecker.kt:50) - at org.jetbrains.kotlin.fir.analysis.checkers.expression.FirIncompatibleClassExpressionChecker.checkType$checkers(FirIncompatibleClassExpressionChecker.kt:42) - at org.jetbrains.kotlin.fir.analysis.checkers.type.FirIncompatibleClassTypeChecker.check(FirIncompatibleClassTypeChecker.kt:17) - at org.jetbrains.kotlin.fir.analysis.collectors.components.TypeCheckersDiagnosticComponent.check(TypeCheckersDiagnosticComponent.kt:81) - at org.jetbrains.kotlin.fir.analysis.collectors.components.TypeCheckersDiagnosticComponent.visitResolvedTypeRef(TypeCheckersDiagnosticComponent.kt:53) - at org.jetbrains.kotlin.fir.analysis.collectors.components.TypeCheckersDiagnosticComponent.visitResolvedTypeRef(TypeCheckersDiagnosticComponent.kt:19) - at org.jetbrains.kotlin.fir.types.FirResolvedTypeRef.accept(FirResolvedTypeRef.kt:28) - at org.jetbrains.kotlin.fir.analysis.collectors.CheckerRunningDiagnosticCollectorVisitor.checkElement(CheckerRunningDiagnosticCollectorVisitor.kt:24) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitResolvedTypeRef(AbstractDiagnosticCollectorVisitor.kt:248) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitResolvedTypeRef(AbstractDiagnosticCollectorVisitor.kt:30) - at org.jetbrains.kotlin.fir.types.FirResolvedTypeRef.accept(FirResolvedTypeRef.kt:28) - at org.jetbrains.kotlin.fir.declarations.impl.FirSimpleFunctionImpl.acceptChildren(FirSimpleFunctionImpl.kt:63) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitNestedElements(AbstractDiagnosticCollectorVisitor.kt:38) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitWithDeclarationAndReceiver(AbstractDiagnosticCollectorVisitor.kt:311) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitSimpleFunction(AbstractDiagnosticCollectorVisitor.kt:118) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitSimpleFunction(AbstractDiagnosticCollectorVisitor.kt:30) - at org.jetbrains.kotlin.fir.declarations.FirSimpleFunction.accept(FirSimpleFunction.kt:51) - at org.jetbrains.kotlin.fir.declarations.impl.FirRegularClassImpl.acceptChildren(FirRegularClassImpl.kt:63) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitNestedElements(AbstractDiagnosticCollectorVisitor.kt:38) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitWithDeclarationAndReceiver(AbstractDiagnosticCollectorVisitor.kt:311) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitClassAndChildren(AbstractDiagnosticCollectorVisitor.kt:87) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitRegularClass(AbstractDiagnosticCollectorVisitor.kt:92) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitRegularClass(AbstractDiagnosticCollectorVisitor.kt:30) - at org.jetbrains.kotlin.fir.declarations.FirRegularClass.accept(FirRegularClass.kt:48) - at org.jetbrains.kotlin.fir.declarations.impl.FirFileImpl.acceptChildren(FirFileImpl.kt:57) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitNestedElements(AbstractDiagnosticCollectorVisitor.kt:38) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitFile(AbstractDiagnosticCollectorVisitor.kt:1151) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollectorVisitor.visitFile(AbstractDiagnosticCollectorVisitor.kt:30) - at org.jetbrains.kotlin.fir.declarations.FirFile.accept(FirFile.kt:42) - at org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollector.collectDiagnostics(AbstractDiagnosticCollector.kt:36) - at org.jetbrains.kotlin.fir.pipeline.AnalyseKt.runCheckers(analyse.kt:34) - ... 28 more - - diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts deleted file mode 100644 index b8398ca..0000000 --- a/android/app/build.gradle.kts +++ /dev/null @@ -1,106 +0,0 @@ -plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") - id("com.google.devtools.ksp") version "2.1.0-1.0.29" -} - -android { - namespace = "com.lonecloud.sup" - compileSdk = 36 - - defaultConfig { - applicationId = "com.lonecloud.sup" - minSdk = 26 - targetSdk = 36 - versionCode = 1 - versionName = "0.1.0" - } - - signingConfigs { - create("release") { - storeFile = file(System.getenv("KEYSTORE_FILE") ?: "../release.keystore") - storePassword = System.getenv("KEYSTORE_PASSWORD") - keyAlias = System.getenv("KEY_ALIAS") ?: "sup-release" - keyPassword = System.getenv("KEYSTORE_PASSWORD") // PKCS12 uses same password - } - } - - buildTypes { - release { - isMinifyEnabled = true - isShrinkResources = true - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro" - ) - signingConfig = signingConfigs.getByName("release") - } - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - - kotlin { - compilerOptions { - jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17) - } - } - - buildFeatures { - viewBinding = true - buildConfig = true - } - - lint { - checkReleaseBuilds = false - abortOnError = false - } - - ksp { - arg("room.schemaLocation", "$projectDir/schemas") - } - - defaultConfig { - // Build config fields - buildConfigField("boolean", "FIREBASE_AVAILABLE", "false") - buildConfigField("boolean", "RATE_APP_AVAILABLE", "false") - buildConfigField("boolean", "PAYMENT_LINKS_AVAILABLE", "false") - buildConfigField("String", "FLAVOR", "\"sup\"") - } -} - -dependencies { - // AndroidX Core - implementation("androidx.appcompat:appcompat:1.7.1") - implementation("androidx.core:core-ktx:1.17.0") - implementation("androidx.constraintlayout:constraintlayout:2.2.1") - implementation("androidx.activity:activity-ktx:1.12.2") - implementation("androidx.fragment:fragment-ktx:1.8.9") - - // JSON (Gson) - implementation("com.google.code.gson:gson:2.13.1") - - // Room (SQLite) - val roomVersion = "2.8.4" - implementation("androidx.room:room-runtime:$roomVersion") - ksp("androidx.room:room-compiler:$roomVersion") - implementation("androidx.room:room-ktx:$roomVersion") - - // OkHttp - implementation("com.squareup.okhttp3:okhttp:4.12.0") - - // RecyclerView - implementation("androidx.recyclerview:recyclerview:1.4.0") - - // Material Design - implementation("com.google.android.material:material:1.13.0") - - // LiveData - implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.10.0") - - // UnifiedPush - implementation("com.github.UnifiedPush:android-connector:3.0.10") -} - diff --git a/android/app/gradle.lockfile b/android/app/gradle.lockfile deleted file mode 100644 index 865e975..0000000 --- a/android/app/gradle.lockfile +++ /dev/null @@ -1,252 +0,0 @@ -# This is a Gradle generated file for dependency locking. -# Manual edits can break the build and are not advised. -# This file is expected to be part of source control. -androidx.activity:activity-ktx:1.12.2=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.activity:activity:1.12.2=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.annotation:annotation-experimental:1.4.1=debugAndroidTestCompileClasspath,implementationDependenciesMetadata -androidx.annotation:annotation-experimental:1.5.0=debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.annotation:annotation-jvm:1.9.1=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.annotation:annotation:1.0.0=apiDependenciesMetadata -androidx.annotation:annotation:1.9.1=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.appcompat:appcompat-resources:1.7.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.appcompat:appcompat:1.7.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.arch.core:core-common:2.2.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.arch.core:core-runtime:2.2.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.cardview:cardview:1.0.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.collection:collection-jvm:1.5.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.collection:collection-ktx:1.5.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.collection:collection:1.5.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.compose.runtime:runtime-annotation-android:1.9.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.compose.runtime:runtime-annotation:1.9.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.concurrent:concurrent-futures:1.1.0=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -androidx.constraintlayout:constraintlayout-core:1.1.1=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -androidx.constraintlayout:constraintlayout:2.2.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.coordinatorlayout:coordinatorlayout:1.1.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.core:core-ktx:1.17.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.core:core-viewtree:1.0.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.core:core:1.17.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.cursoradapter:cursoradapter:1.0.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.customview:customview-poolingcontainer:1.0.0=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -androidx.customview:customview:1.1.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.databinding:viewbinding:8.9.1=apiDependenciesMetadata,debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.drawerlayout:drawerlayout:1.1.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.dynamicanimation:dynamicanimation:1.1.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.emoji2:emoji2-views-helper:1.3.0=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -androidx.emoji2:emoji2:1.3.0=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -androidx.fragment:fragment-ktx:1.8.9=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.fragment:fragment:1.8.9=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.graphics:graphics-shapes-android:1.0.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.graphics:graphics-shapes:1.0.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.interpolator:interpolator:1.0.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-common-jvm:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-common:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-livedata-core-ktx:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-livedata-core:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-livedata-ktx:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-livedata:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-process:2.10.0=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-runtime-android:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-runtime-ktx-android:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-runtime-ktx:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-runtime:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-viewmodel-android:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-viewmodel-ktx:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-viewmodel-savedstate-android:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-viewmodel-savedstate:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.lifecycle:lifecycle-viewmodel:2.10.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.loader:loader:1.0.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.navigationevent:navigationevent-android:1.0.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.navigationevent:navigationevent:1.0.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.profileinstaller:profileinstaller:1.4.0=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -androidx.recyclerview:recyclerview:1.4.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.resourceinspection:resourceinspection-annotation:1.0.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.room:room-common-jvm:2.8.4=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.room:room-common:2.8.4=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.room:room-compiler-processing:2.8.4=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -androidx.room:room-compiler:2.8.4=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -androidx.room:room-external-antlr:2.8.4=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -androidx.room:room-ktx:2.8.4=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.room:room-migration-jvm:2.8.4=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -androidx.room:room-migration:2.8.4=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -androidx.room:room-runtime-android:2.8.4=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.room:room-runtime:2.8.4=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.savedstate:savedstate-android:1.4.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.savedstate:savedstate-ktx:1.4.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.savedstate:savedstate:1.4.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.sqlite:sqlite-android:2.6.2=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.sqlite:sqlite-framework-android:2.6.2=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.sqlite:sqlite-framework:2.6.2=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.sqlite:sqlite:2.6.2=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.startup:startup-runtime:1.1.1=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -androidx.tracing:tracing:1.2.0=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -androidx.transition:transition:1.5.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.vectordrawable:vectordrawable-animated:1.1.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.vectordrawable:vectordrawable:1.1.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.versionedparcelable:versionedparcelable:1.1.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.viewpager2:viewpager2:1.0.0=debugAndroidTestCompileClasspath,implementationDependenciesMetadata -androidx.viewpager2:viewpager2:1.1.0-beta02=debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -androidx.viewpager:viewpager:1.0.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -com.android.tools.ddms:ddmlib:31.9.1=_internal-unified-test-platform-android-device-provider-ddmlib -com.android.tools.emulator:proto:31.9.1=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention -com.android.tools.utp:android-device-provider-ddmlib-proto:31.9.1=_internal-unified-test-platform-android-device-provider-ddmlib -com.android.tools.utp:android-device-provider-ddmlib:31.9.1=_internal-unified-test-platform-android-device-provider-ddmlib -com.android.tools.utp:android-device-provider-gradle-proto:31.9.1=_internal-unified-test-platform-android-device-provider-gradle -com.android.tools.utp:android-device-provider-gradle:31.9.1=_internal-unified-test-platform-android-device-provider-gradle -com.android.tools.utp:android-device-provider-profile-proto:31.9.1=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle -com.android.tools.utp:android-device-provider-profile:31.9.1=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle -com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:31.9.1=_internal-unified-test-platform-android-test-plugin-host-additional-test-output -com.android.tools.utp:android-test-plugin-host-additional-test-output:31.9.1=_internal-unified-test-platform-android-test-plugin-host-additional-test-output -com.android.tools.utp:android-test-plugin-host-apk-installer-proto:31.9.1=_internal-unified-test-platform-android-test-plugin-host-apk-installer -com.android.tools.utp:android-test-plugin-host-apk-installer:31.9.1=_internal-unified-test-platform-android-test-plugin-host-apk-installer -com.android.tools.utp:android-test-plugin-host-coverage-proto:31.9.1=_internal-unified-test-platform-android-test-plugin-host-coverage -com.android.tools.utp:android-test-plugin-host-coverage:31.9.1=_internal-unified-test-platform-android-test-plugin-host-coverage -com.android.tools.utp:android-test-plugin-host-device-info-proto:31.9.1=_internal-unified-test-platform-android-test-plugin-host-device-info -com.android.tools.utp:android-test-plugin-host-device-info:31.9.1=_internal-unified-test-platform-android-test-plugin-host-device-info -com.android.tools.utp:android-test-plugin-host-emulator-control-proto:31.9.1=_internal-unified-test-platform-android-test-plugin-host-emulator-control -com.android.tools.utp:android-test-plugin-host-emulator-control:31.9.1=_internal-unified-test-platform-android-test-plugin-host-emulator-control -com.android.tools.utp:android-test-plugin-host-logcat-proto:31.9.1=_internal-unified-test-platform-android-test-plugin-host-logcat -com.android.tools.utp:android-test-plugin-host-logcat:31.9.1=_internal-unified-test-platform-android-test-plugin-host-logcat -com.android.tools.utp:android-test-plugin-host-retention-proto:31.9.1=_internal-unified-test-platform-android-test-plugin-host-retention -com.android.tools.utp:android-test-plugin-host-retention:31.9.1=_internal-unified-test-platform-android-test-plugin-host-retention -com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:31.9.1=_internal-unified-test-platform-android-test-plugin-result-listener-gradle -com.android.tools.utp:android-test-plugin-result-listener-gradle:31.9.1=_internal-unified-test-platform-android-test-plugin-result-listener-gradle -com.android.tools.utp:utp-common:31.9.1=_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention -com.android.tools:annotations:31.9.1=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -com.android.tools:common:31.9.1=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -com.github.UnifiedPush:android-connector:3.0.10=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -com.google.android.material:material:1.13.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -com.google.android:annotations:4.1.1.4=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -com.google.api.grpc:proto-google-common-protos:2.17.0=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -com.google.auto.service:auto-service-annotations:1.1.1=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -com.google.auto.service:auto-service:1.1.1=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -com.google.auto.value:auto-value-annotations:1.6.3=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -com.google.auto:auto-common:1.2.1=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -com.google.code.findbugs:jsr305:3.0.2=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher,debugRuntimeClasspath,debugUnitTestRuntimeClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -com.google.code.gson:gson:2.10.1=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -com.google.code.gson:gson:2.13.1=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -com.google.code.gson:gson:2.8.9=_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-launcher -com.google.crypto.tink:tink:1.17.0=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -com.google.crypto.tink:tink:1.7.0=_internal-unified-test-platform-android-test-plugin-host-emulator-control -com.google.dagger:dagger:2.48=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -com.google.devtools.ksp:symbol-processing-api:2.0.10-1.0.24=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -com.google.devtools.ksp:symbol-processing-api:2.1.0-1.0.29=kotlinCompilerPluginClasspathDebug,kotlinCompilerPluginClasspathDebugAndroidTest,kotlinCompilerPluginClasspathDebugUnitTest,kotlinCompilerPluginClasspathRelease,kotlinCompilerPluginClasspathReleaseUnitTest,kspPluginClasspath,kspPluginClasspathNonEmbeddable -com.google.devtools.ksp:symbol-processing-cmdline:2.1.0-1.0.29=kspPluginClasspathNonEmbeddable -com.google.devtools.ksp:symbol-processing:2.1.0-1.0.29=kotlinCompilerPluginClasspathDebug,kotlinCompilerPluginClasspathDebugAndroidTest,kotlinCompilerPluginClasspathDebugUnitTest,kotlinCompilerPluginClasspathRelease,kotlinCompilerPluginClasspathReleaseUnitTest,kspPluginClasspath -com.google.errorprone:error_prone_annotations:2.23.0=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -com.google.errorprone:error_prone_annotations:2.26.1=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -com.google.errorprone:error_prone_annotations:2.38.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -com.google.guava:failureaccess:1.0.1=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -com.google.guava:failureaccess:1.0.2=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -com.google.guava:guava:32.0.1-jre=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -com.google.guava:guava:33.2.1-jre=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -com.google.guava:listenablefuture:1.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -com.google.j2objc:j2objc-annotations:2.8=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -com.google.protobuf:protobuf-java-util:3.22.3=_internal-unified-test-platform-core -com.google.protobuf:protobuf-java-util:3.24.4=_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-launcher -com.google.protobuf:protobuf-java:3.24.4=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -com.google.protobuf:protobuf-java:4.28.2=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -com.google.protobuf:protobuf-kotlin:3.24.4=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -com.google.testing.platform:android-device-provider-local:0.0.9-alpha03=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -com.google.testing.platform:android-driver-instrumentation:0.0.9-alpha03=_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin-host-emulator-control -com.google.testing.platform:android-test-plugin:0.0.9-alpha03=_internal-unified-test-platform-android-test-plugin -com.google.testing.platform:core-proto:0.0.9-alpha03=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -com.google.testing.platform:core:0.0.9-alpha03=_internal-unified-test-platform-core -com.google.testing.platform:launcher:0.0.9-alpha03=_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-launcher -com.intellij:annotations:12.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -com.squareup.okhttp3:okhttp:4.12.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -com.squareup.okio:okio-jvm:3.6.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -com.squareup.okio:okio:3.6.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -com.squareup:javapoet:1.13.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -com.squareup:kotlinpoet-javapoet:2.0.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -com.squareup:kotlinpoet-jvm:2.0.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -com.squareup:kotlinpoet:2.0.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -commons-codec:commons-codec:1.15=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -commons-io:commons-io:2.16.1=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention -io.grpc:grpc-api:1.57.2=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.grpc:grpc-context:1.57.2=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.grpc:grpc-core:1.57.2=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.grpc:grpc-netty:1.57.2=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.grpc:grpc-protobuf-lite:1.57.2=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.grpc:grpc-protobuf:1.57.2=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.grpc:grpc-services:1.57.2=_internal-unified-test-platform-core -io.grpc:grpc-stub:1.57.2=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.netty:netty-buffer:4.1.93.Final=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.netty:netty-codec-http2:4.1.93.Final=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.netty:netty-codec-http:4.1.93.Final=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.netty:netty-codec-socks:4.1.93.Final=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.netty:netty-codec:4.1.93.Final=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.netty:netty-common:4.1.93.Final=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.netty:netty-handler-proxy:4.1.93.Final=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.netty:netty-handler:4.1.93.Final=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.netty:netty-resolver:4.1.93.Final=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.netty:netty-transport-native-unix-common:4.1.93.Final=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.netty:netty-transport:4.1.93.Final=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -io.opencensus:opencensus-api:0.31.0=_internal-unified-test-platform-core -io.opencensus:opencensus-proto:0.2.0=_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -io.perfmark:perfmark-api:0.26.0=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -javax.annotation:javax.annotation-api:1.3.2=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -javax.inject:javax.inject:1=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -net.java.dev.jna:jna-platform:5.6.0=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -net.java.dev.jna:jna:5.6.0=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -net.sf.kxml:kxml2:2.3.0=_internal-unified-test-platform-android-device-provider-ddmlib -org.checkerframework:checker-qual:3.33.0=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -org.checkerframework:checker-qual:3.42.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.23=_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core -org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-bom:1.8.22=debugRuntimeClasspath,debugUnitTestRuntimeClasspath,releaseRuntimeClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlin:kotlin-build-common:2.1.0=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-api:2.1.0=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-impl:2.1.0=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-compiler-embeddable:2.1.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-compiler-runner:2.1.0=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-client:2.1.0=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-embeddable:2.1.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.1.0=kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-metadata-jvm:2.2.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -org.jetbrains.kotlin:kotlin-reflect:1.6.10=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-reflect:1.8.21=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -org.jetbrains.kotlin:kotlin-reflect:2.0.10=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -org.jetbrains.kotlin:kotlin-script-runtime:2.1.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-scripting-common:2.1.0=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.1.0=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.1.0=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-scripting-jvm:2.1.0=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.8.21=_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-core -org.jetbrains.kotlin:kotlin-stdlib-common:1.9.0=_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-launcher -org.jetbrains.kotlin:kotlin-stdlib-common:2.1.0=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -org.jetbrains.kotlin:kotlin-stdlib-common:2.1.20=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.20=_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.21=implementationDependenciesMetadata -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.0=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20=_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21=implementationDependenciesMetadata -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle -org.jetbrains.kotlin:kotlin-stdlib:1.8.21=_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-core -org.jetbrains.kotlin:kotlin-stdlib:1.9.0=_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-launcher -org.jetbrains.kotlin:kotlin-stdlib:2.1.0=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,apiDependenciesMetadata,kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathDebug,kotlinCompilerPluginClasspathDebugAndroidTest,kotlinCompilerPluginClasspathDebugUnitTest,kotlinCompilerPluginClasspathRelease,kotlinCompilerPluginClasspathReleaseUnitTest,kotlinKlibCommonizerClasspath,kspPluginClasspath,kspPluginClasspathNonEmbeddable -org.jetbrains.kotlin:kotlin-stdlib:2.1.20=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:2.2.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -org.jetbrains.kotlinx:atomicfu-jvm:0.22.0=_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-launcher -org.jetbrains.kotlinx:atomicfu:0.22.0=_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-launcher -org.jetbrains.kotlinx:atomicfu:0.27.0=implementationDependenciesMetadata -org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.9.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.9.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher -org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0=debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-serialization-bom:1.8.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,kotlinCompilerPluginClasspathDebug,kotlinCompilerPluginClasspathDebugAndroidTest,kotlinCompilerPluginClasspathDebugUnitTest,kotlinCompilerPluginClasspathRelease,kotlinCompilerPluginClasspathReleaseUnitTest,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspPluginClasspath,kspPluginClasspathNonEmbeddable,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-serialization-core-jvm:1.8.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,kotlinCompilerPluginClasspathDebug,kotlinCompilerPluginClasspathDebugAndroidTest,kotlinCompilerPluginClasspathDebugUnitTest,kotlinCompilerPluginClasspathRelease,kotlinCompilerPluginClasspathReleaseUnitTest,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspPluginClasspath,kspPluginClasspathNonEmbeddable,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-serialization-core:1.8.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,kotlinCompilerPluginClasspathDebug,kotlinCompilerPluginClasspathDebugAndroidTest,kotlinCompilerPluginClasspathDebugUnitTest,kotlinCompilerPluginClasspathRelease,kotlinCompilerPluginClasspathReleaseUnitTest,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspPluginClasspath,kspPluginClasspathNonEmbeddable,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.8.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kotlinCompilerPluginClasspathDebug,kotlinCompilerPluginClasspathDebugAndroidTest,kotlinCompilerPluginClasspathDebugUnitTest,kotlinCompilerPluginClasspathRelease,kotlinCompilerPluginClasspathReleaseUnitTest,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspPluginClasspath,kspPluginClasspathNonEmbeddable,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kotlinCompilerPluginClasspathDebug,kotlinCompilerPluginClasspathDebugAndroidTest,kotlinCompilerPluginClasspathDebugUnitTest,kotlinCompilerPluginClasspathRelease,kotlinCompilerPluginClasspathReleaseUnitTest,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspPluginClasspath,kspPluginClasspathNonEmbeddable,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -org.jetbrains:annotations:13.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathDebug,kotlinCompilerPluginClasspathDebugAndroidTest,kotlinCompilerPluginClasspathDebugUnitTest,kotlinCompilerPluginClasspathRelease,kotlinCompilerPluginClasspathReleaseUnitTest,kotlinKlibCommonizerClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspPluginClasspath,kspPluginClasspathNonEmbeddable,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -org.jetbrains:annotations:23.0.0=_internal-unified-test-platform-android-device-provider-ddmlib,_internal-unified-test-platform-android-device-provider-gradle,_internal-unified-test-platform-android-driver-instrumentation,_internal-unified-test-platform-android-test-plugin,_internal-unified-test-platform-android-test-plugin-host-additional-test-output,_internal-unified-test-platform-android-test-plugin-host-apk-installer,_internal-unified-test-platform-android-test-plugin-host-coverage,_internal-unified-test-platform-android-test-plugin-host-device-info,_internal-unified-test-platform-android-test-plugin-host-emulator-control,_internal-unified-test-platform-android-test-plugin-host-logcat,_internal-unified-test-platform-android-test-plugin-host-retention,_internal-unified-test-platform-android-test-plugin-result-listener-gradle,_internal-unified-test-platform-core,_internal-unified-test-platform-launcher,debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.jspecify:jspecify:1.0.0=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,debugAndroidTestCompileClasspath,debugCompileClasspath,debugRuntimeClasspath,debugUnitTestCompileClasspath,debugUnitTestRuntimeClasspath,implementationDependenciesMetadata,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath,releaseCompileClasspath,releaseRuntimeClasspath,releaseUnitTestCompileClasspath,releaseUnitTestRuntimeClasspath -org.xerial:sqlite-jdbc:3.41.2.2=_agp_internal_javaPreCompileDebug_kspClasspath,_agp_internal_javaPreCompileRelease_kspClasspath,kspDebugAndroidTestKotlinProcessorClasspath,kspDebugKotlinProcessorClasspath,kspDebugUnitTestKotlinProcessorClasspath,kspReleaseKotlinProcessorClasspath,kspReleaseUnitTestKotlinProcessorClasspath -empty=_agp_internal_javaPreCompileDebugAndroidTest_kspClasspath,_agp_internal_javaPreCompileDebugUnitTest_kspClasspath,_agp_internal_javaPreCompileReleaseUnitTest_kspClasspath,androidApis,androidJdkImage,androidTestApiDependenciesMetadata,androidTestCompileOnlyDependenciesMetadata,androidTestDebugApiDependenciesMetadata,androidTestDebugCompileOnlyDependenciesMetadata,androidTestDebugImplementationDependenciesMetadata,androidTestDebugIntransitiveDependenciesMetadata,androidTestImplementationDependenciesMetadata,androidTestIntransitiveDependenciesMetadata,androidTestReleaseApiDependenciesMetadata,androidTestReleaseCompileOnlyDependenciesMetadata,androidTestReleaseImplementationDependenciesMetadata,androidTestReleaseIntransitiveDependenciesMetadata,androidTestUtil,compileOnlyDependenciesMetadata,coreLibraryDesugaring,debugAndroidTestAnnotationProcessorClasspath,debugAndroidTestApiDependenciesMetadata,debugAndroidTestCompileOnlyDependenciesMetadata,debugAndroidTestImplementationDependenciesMetadata,debugAndroidTestIntransitiveDependenciesMetadata,debugAndroidTestRuntimeClasspath,debugAnnotationProcessorClasspath,debugApiDependenciesMetadata,debugCompileOnlyDependenciesMetadata,debugImplementationDependenciesMetadata,debugIntransitiveDependenciesMetadata,debugReverseMetadataValues,debugUnitTestAnnotationProcessorClasspath,debugUnitTestApiDependenciesMetadata,debugUnitTestCompileOnlyDependenciesMetadata,debugUnitTestImplementationDependenciesMetadata,debugUnitTestIntransitiveDependenciesMetadata,debugWearBundling,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,lintChecks,lintPublish,releaseAnnotationProcessorClasspath,releaseApiDependenciesMetadata,releaseCompileOnlyDependenciesMetadata,releaseImplementationDependenciesMetadata,releaseIntransitiveDependenciesMetadata,releaseReverseMetadataValues,releaseUnitTestAnnotationProcessorClasspath,releaseUnitTestApiDependenciesMetadata,releaseUnitTestCompileOnlyDependenciesMetadata,releaseUnitTestImplementationDependenciesMetadata,releaseUnitTestIntransitiveDependenciesMetadata,releaseWearBundling,testApiDependenciesMetadata,testCompileOnlyDependenciesMetadata,testDebugApiDependenciesMetadata,testDebugCompileOnlyDependenciesMetadata,testDebugImplementationDependenciesMetadata,testDebugIntransitiveDependenciesMetadata,testFixturesApiDependenciesMetadata,testFixturesCompileOnlyDependenciesMetadata,testFixturesDebugApiDependenciesMetadata,testFixturesDebugCompileOnlyDependenciesMetadata,testFixturesDebugImplementationDependenciesMetadata,testFixturesDebugIntransitiveDependenciesMetadata,testFixturesImplementationDependenciesMetadata,testFixturesIntransitiveDependenciesMetadata,testFixturesReleaseApiDependenciesMetadata,testFixturesReleaseCompileOnlyDependenciesMetadata,testFixturesReleaseImplementationDependenciesMetadata,testFixturesReleaseIntransitiveDependenciesMetadata,testImplementationDependenciesMetadata,testIntransitiveDependenciesMetadata,testReleaseApiDependenciesMetadata,testReleaseCompileOnlyDependenciesMetadata,testReleaseImplementationDependenciesMetadata,testReleaseIntransitiveDependenciesMetadata diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro deleted file mode 100644 index cb56b27..0000000 --- a/android/app/proguard-rules.pro +++ /dev/null @@ -1,22 +0,0 @@ --dontwarn okhttp3.** --dontwarn okio.** --keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase - --keepattributes *Annotation*, InnerClasses --dontnote kotlinx.serialization.AnnotationsKt --keepclassmembers class kotlinx.serialization.json.** { - *** Companion; -} --keepclasseswithmembers class kotlinx.serialization.json.** { - kotlinx.serialization.KSerializer serializer(...); -} --keep,includedescriptorclasses class com.lonecloud.sup.**$$serializer { *; } --keepclassmembers class com.lonecloud.sup.** { - *** Companion; -} --keepclasseswithmembers class com.lonecloud.sup.** { - kotlinx.serialization.KSerializer serializer(...); -} - --keep class org.unifiedpush.android.connector.** { *; } - diff --git a/android/app/schemas/com.lonecloud.sup.db.Database/17.json b/android/app/schemas/com.lonecloud.sup.db.Database/17.json deleted file mode 100644 index 39be46d..0000000 --- a/android/app/schemas/com.lonecloud.sup.db.Database/17.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "formatVersion": 1, - "database": { - "version": 18, - "identityHash": "35364cf175ffcf5aa672eabaabe12397", - "entities": [ - { - "tableName": "Subscription", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `baseUrl` TEXT NOT NULL, `topic` TEXT NOT NULL, `mutedUntil` INTEGER NOT NULL, `minPriority` INTEGER NOT NULL, `autoDelete` INTEGER NOT NULL, `insistent` INTEGER NOT NULL, `upAppId` TEXT, `upConnectorToken` TEXT, `displayName` TEXT, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "baseUrl", - "columnName": "baseUrl", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "topic", - "columnName": "topic", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "mutedUntil", - "columnName": "mutedUntil", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "minPriority", - "columnName": "minPriority", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "autoDelete", - "columnName": "autoDelete", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "insistent", - "columnName": "insistent", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "upAppId", - "columnName": "upAppId", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "upConnectorToken", - "columnName": "upConnectorToken", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "displayName", - "columnName": "displayName", - "affinity": "TEXT", - "notNull": false - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": ["id"] - }, - "indices": [ - { - "name": "index_Subscription_baseUrl_topic", - "unique": true, - "columnNames": ["baseUrl", "topic"], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_Subscription_baseUrl_topic` ON `${TABLE_NAME}` (`baseUrl`, `topic`)" - }, - { - "name": "index_Subscription_upConnectorToken", - "unique": true, - "columnNames": ["upConnectorToken"], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_Subscription_upConnectorToken` ON `${TABLE_NAME}` (`upConnectorToken`)" - } - ], - "foreignKeys": [] - }, - { - "tableName": "Notification", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `subscriptionId` INTEGER NOT NULL, `timestamp` INTEGER NOT NULL, `title` TEXT NOT NULL, `message` TEXT NOT NULL, `notificationId` INTEGER NOT NULL, `priority` INTEGER NOT NULL DEFAULT 3, `tags` TEXT NOT NULL, `deleted` INTEGER NOT NULL, PRIMARY KEY(`id`, `subscriptionId`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "subscriptionId", - "columnName": "subscriptionId", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "timestamp", - "columnName": "timestamp", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "message", - "columnName": "message", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "notificationId", - "columnName": "notificationId", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "priority", - "columnName": "priority", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "3" - }, - { - "fieldPath": "tags", - "columnName": "tags", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "deleted", - "columnName": "deleted", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": ["id", "subscriptionId"] - }, - "indices": [], - "foreignKeys": [] - }, - { - "tableName": "Log", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `timestamp` INTEGER NOT NULL, `tag` TEXT NOT NULL, `level` INTEGER NOT NULL, `message` TEXT NOT NULL, `exception` TEXT)", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "timestamp", - "columnName": "timestamp", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "tag", - "columnName": "tag", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "level", - "columnName": "level", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "message", - "columnName": "message", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "exception", - "columnName": "exception", - "affinity": "TEXT", - "notNull": false - } - ], - "primaryKey": { - "autoGenerate": true, - "columnNames": ["id"] - }, - "indices": [], - "foreignKeys": [] - } - ], - "views": [], - "setupQueries": [ - "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", - "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '35364cf175ffcf5aa672eabaabe12397')" - ] - } -} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index dad32e5..0000000 --- a/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/app/src/main/java/com/lonecloud/sup/DistributorService.kt b/android/app/src/main/java/com/lonecloud/sup/DistributorService.kt deleted file mode 100644 index a469b8c..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/DistributorService.kt +++ /dev/null @@ -1,132 +0,0 @@ -package com.lonecloud.sup - -import android.app.Service -import android.content.Intent -import android.os.IBinder -import android.util.Log -import okhttp3.MediaType.Companion.toMediaType -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.RequestBody.Companion.toRequestBody -import org.json.JSONObject - -class DistributorService : Service() { - private val client = OkHttpClient() - private val prefs by lazy { - getSharedPreferences("sup_prefs", MODE_PRIVATE) - } - - override fun onBind(intent: Intent?): IBinder? = null - - override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { - when (intent?.action) { - "org.unifiedpush.android.distributor.REGISTER" -> handleRegister(intent) - "org.unifiedpush.android.distributor.UNREGISTER" -> handleUnregister(intent) - } - return START_NOT_STICKY - } - - private fun handleRegister(intent: Intent) { - val token = intent.getStringExtra("token") ?: return - val appId = intent.getStringExtra("application") ?: return - - Log.d("SUP", "Registering: app=$appId, token=$token") - - val serverUrl = prefs.getString("server_url", null) - val apiKey = prefs.getString("api_key", null) - - if (serverUrl == null) { - sendRegistrationRefused(token, "Server not configured") - return - } - - Thread { - try { - val json = JSONObject().apply { - put("appName", appId) - } - - val request = Request.Builder() - .url("$serverUrl/up/$appId") - .post(json.toString().toRequestBody("application/json".toMediaType())) - .apply { - if (apiKey != null) { - addHeader("Authorization", "Bearer $apiKey") - } - } - .build() - - val response = client.newCall(request).execute() - val responseBody = response.body?.string() - - if (response.isSuccessful && responseBody != null) { - val jsonResponse = JSONObject(responseBody) - val endpoint = jsonResponse.getString("endpoint") - - prefs.edit() - .putString("endpoint_$appId", endpoint) - .putString("token_$appId", token) - .apply() - - sendEndpoint(token, endpoint) - Log.d("SUP", "Registered successfully: $endpoint") - } else { - sendRegistrationRefused(token, "Server error: ${response.code}") - } - } catch (e: Exception) { - Log.e("SUP", "Registration failed", e) - sendRegistrationRefused(token, "Failed: ${e.message}") - } - }.start() - } - - private fun handleUnregister(intent: Intent) { - val token = intent.getStringExtra("token") ?: return - Log.d("SUP", "Unregistering: token=$token") - - val allPrefs = prefs.all - for ((key, value) in allPrefs) { - if (key.startsWith("token_") && value == token) { - val appId = key.removePrefix("token_") - prefs.edit() - .remove("endpoint_$appId") - .remove("token_$appId") - .apply() - - sendUnregistered(token) - Log.d("SUP", "Unregistered: $appId") - return - } - } - } - - private fun sendEndpoint(token: String, endpoint: String) { - val intent = Intent("org.unifiedpush.android.connector.MESSAGE").apply { - putExtra("token", token) - putExtra("endpoint", endpoint) - `package` = getAppPackageFromToken(token) - } - sendBroadcast(intent) - } - - private fun sendRegistrationRefused(token: String, message: String) { - val intent = Intent("org.unifiedpush.android.connector.REGISTRATION_REFUSED").apply { - putExtra("token", token) - putExtra("message", message) - `package` = getAppPackageFromToken(token) - } - sendBroadcast(intent) - } - - private fun sendUnregistered(token: String) { - val intent = Intent("org.unifiedpush.android.connector.UNREGISTERED").apply { - putExtra("token", token) - `package` = getAppPackageFromToken(token) - } - sendBroadcast(intent) - } - - private fun getAppPackageFromToken(token: String): String { - return token.split(":").firstOrNull() ?: "" - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/SignalNotificationListener.kt b/android/app/src/main/java/com/lonecloud/sup/SignalNotificationListener.kt deleted file mode 100644 index b1aff9e..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/SignalNotificationListener.kt +++ /dev/null @@ -1,187 +0,0 @@ -package com.lonecloud.sup - -import android.app.NotificationChannel -import android.app.NotificationManager -import android.app.PendingIntent -import android.content.Context -import android.content.Intent -import android.net.Uri -import android.service.notification.NotificationListenerService -import android.service.notification.StatusBarNotification -import android.util.Log -import androidx.core.app.NotificationCompat -import com.lonecloud.sup.db.Database -import com.lonecloud.sup.db.Notification -import com.lonecloud.sup.ui.MainActivity -import kotlinx.coroutines.* -import kotlin.random.Random - -class SignalNotificationListener : NotificationListenerService() { - - private val TAG = "SUP_Listener" - private val prefs by lazy { - getSharedPreferences("sup_prefs", MODE_PRIVATE) - } - private val db by lazy { Database.getInstance(this) } - private val serviceScope = CoroutineScope(Dispatchers.IO + SupervisorJob()) - - companion object { - private const val CHANNEL_ID = "sup_notifications" - private const val CHANNEL_NAME = "SUP Notifications" - private const val CHANNEL_ID_PROTON = "sup_email" - private const val CHANNEL_NAME_PROTON = "Email Notifications" - private const val SUP_ENDPOINT_PREFIX = "[SUP:" - private const val LAUNCH_PREFIX = "[LAUNCH:" - - private val SIGNAL_PACKAGES = setOf( - "org.thoughtcrime.securesms", // Signal - "im.molly.app" // Molly - ) - } - - override fun onCreate() { - super.onCreate() - createNotificationChannels() - } - - override fun onDestroy() { - super.onDestroy() - serviceScope.cancel() - } - - override fun onNotificationPosted(sbn: StatusBarNotification?) { - if (sbn?.packageName !in SIGNAL_PACKAGES) return - - val notification = sbn?.notification ?: return - val extras = notification.extras - - val title = extras.getString("android.title") ?: "" - val text = extras.getCharSequence("android.text")?.toString() ?: "" - - Log.d(TAG, "Signal notification: title=$title, text=$text") - - when { - text.startsWith(SUP_ENDPOINT_PREFIX) -> { - parseAndDeliverUnifiedPush(text) - cancelNotification(sbn?.key ?: return) - } - text.startsWith(LAUNCH_PREFIX) -> { - parseAndShowLaunchNotification(text) - cancelNotification(sbn?.key ?: return) - } - } - } - - private fun parseAndDeliverUnifiedPush(message: String) { - try { - val endpointMatch = Regex("""\[SUP:([^\]]+)\]""").find(message) - val endpointId = endpointMatch?.groupValues?.get(1) ?: run { - Log.w(TAG, "No endpoint ID found in message") - return - } - - val subscription = runBlocking { - db.subscriptionDao().getByUpAppId(endpointId) - } ?: run { - Log.w(TAG, "No subscription found for upAppId: $endpointId") - return - } - - val payload = message.substringAfter("]").trim() - - val intent = Intent("org.unifiedpush.android.connector.MESSAGE").apply { - putExtra("token", subscription.upConnectorToken) - putExtra("message", payload) - `package` = subscription.upAppId - } - sendBroadcast(intent) - - Log.d(TAG, "Delivered UnifiedPush notification to app: ${subscription.upAppId}") - } catch (e: Exception) { - Log.e(TAG, "Failed to parse/deliver UnifiedPush notification", e) - } - } - - private fun parseAndShowLaunchNotification(message: String) { - try { - val packageMatch = Regex("""\[LAUNCH:([^\]]+)\]""").find(message) - val packageName = packageMatch?.groupValues?.get(1) ?: run { - Log.w(TAG, "No package name found in LAUNCH message") - return - } - - val content = message.substringAfter("]").trim() - - // Parse title and body (format: **Title**\nBody) - val titleMatch = Regex("""\*\*([^*]+)\*\*""").find(content) - val title = titleMatch?.groupValues?.get(1) ?: "Email" - val body = content.substringAfter("**", "").substringAfter("**", "").trim() - - // Check if target app is installed - val isInstalled = try { - packageManager.getPackageInfo(packageName, 0) - true - } catch (e: Exception) { - false - } - - val clickIntent = if (isInstalled) { - packageManager.getLaunchIntentForPackage(packageName)?.let { intent -> - PendingIntent.getActivity( - this, - Random.nextInt(), - intent.apply { - addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) - }, - PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT - ) - } - } else { - null - } - - val notification = NotificationCompat.Builder(this, CHANNEL_ID_PROTON) - .setContentTitle(title) - .setContentText(body) - .setSmallIcon(android.R.drawable.ic_dialog_email) - .setPriority(NotificationCompat.PRIORITY_DEFAULT) - .setAutoCancel(true) - .apply { - if (clickIntent != null) { - setContentIntent(clickIntent) - } - } - .build() - - val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager - notificationManager.notify(Random.nextInt(), notification) - - Log.d(TAG, "Showed app launch notification") - } catch (e: Exception) { - Log.e(TAG, "Failed to parse/show app launch notification", e) - } - } - - private fun createNotificationChannels() { - val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager - - val channel = NotificationChannel( - CHANNEL_ID, - CHANNEL_NAME, - NotificationManager.IMPORTANCE_DEFAULT - ).apply { - description = "Notifications from SUP topics" - } - notificationManager.createNotificationChannel(channel) - - val protonChannel = NotificationChannel( - CHANNEL_ID_PROTON, - CHANNEL_NAME_PROTON, - NotificationManager.IMPORTANCE_DEFAULT - ).apply { - description = "Email notifications" - } - notificationManager.createNotificationChannel(protonChannel) - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/app/Application.kt b/android/app/src/main/java/com/lonecloud/sup/app/Application.kt deleted file mode 100644 index 08230d4..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/app/Application.kt +++ /dev/null @@ -1,23 +0,0 @@ -package com.lonecloud.sup.app - -import android.app.Application -import com.google.android.material.color.DynamicColors -import com.lonecloud.sup.db.Repository -import com.lonecloud.sup.util.Log - -class Application : Application() { - val repository by lazy { - val repository = Repository.getInstance(applicationContext) - if (repository.getRecordLogs()) { - Log.setRecord(true) - } - repository - } - - override fun onCreate() { - super.onCreate() - if (repository.getDynamicColorsEnabled()) { - DynamicColors.applyToActivitiesIfAvailable(this) - } - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/db/Database.kt b/android/app/src/main/java/com/lonecloud/sup/db/Database.kt deleted file mode 100644 index c7decf3..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/db/Database.kt +++ /dev/null @@ -1,453 +0,0 @@ -package com.lonecloud.sup.db - -import android.content.Context -import androidx.room.ColumnInfo -import androidx.room.Dao -import androidx.room.Entity -import androidx.room.Ignore -import androidx.room.Index -import androidx.room.Insert -import androidx.room.OnConflictStrategy -import androidx.room.PrimaryKey -import androidx.room.Query -import androidx.room.Room -import androidx.room.RoomDatabase -import androidx.room.Update -import androidx.room.migration.Migration -import androidx.sqlite.db.SupportSQLiteDatabase -import com.lonecloud.sup.service.NotAuthorizedException -import com.lonecloud.sup.service.hasCause -import kotlinx.coroutines.flow.Flow -import java.net.ConnectException - -@Entity(indices = [Index(value = ["baseUrl", "topic"], unique = true), Index(value = ["upConnectorToken"], unique = true)]) -data class Subscription( - @PrimaryKey val id: Long, - @ColumnInfo(name = "baseUrl") val baseUrl: String, - @ColumnInfo(name = "topic") val topic: String, - @ColumnInfo(name = "mutedUntil") val mutedUntil: Long, - @ColumnInfo(name = "minPriority") val minPriority: Int, - @ColumnInfo(name = "autoDelete") val autoDelete: Long, // Seconds - @ColumnInfo(name = "insistent") val insistent: Int, // Ring constantly for max priority notifications (-1 = use global, 0 = off, 1 = on) - @ColumnInfo(name = "upAppId") val upAppId: String?, // UnifiedPush application package name - @ColumnInfo(name = "upConnectorToken") val upConnectorToken: String?, // UnifiedPush connector token - @ColumnInfo(name = "displayName") val displayName: String?, - @Ignore val totalCount: Int = 0, // Total notifications - @Ignore val newCount: Int = 0, // New notifications - @Ignore val lastActive: Long = 0, // Unix timestamp - @Ignore val connectionDetails: ConnectionDetails = ConnectionDetails() -) { - constructor( - id: Long, - baseUrl: String, - topic: String, - mutedUntil: Long, - minPriority: Int, - autoDelete: Long, - insistent: Int, - upAppId: String?, - upConnectorToken: String?, - displayName: String? - ) : - this( - id, - baseUrl, - topic, - mutedUntil, - minPriority, - autoDelete, - insistent, - upAppId, - upConnectorToken, - displayName, - totalCount = 0, - newCount = 0, - lastActive = 0, - connectionDetails = ConnectionDetails() - ) -} - -enum class ConnectionState { - NOT_APPLICABLE, CONNECTING, CONNECTED -} - -data class ConnectionDetails( - val state: ConnectionState = ConnectionState.NOT_APPLICABLE, - val error: Throwable? = null, - val nextRetryTime: Long = 0L -) { - fun getStackTraceString(): String { - return error?.stackTraceToString() ?: "" - } - - fun hasError(): Boolean { - return error != null - } - - fun isConnectionRefused(): Boolean { - return error?.hasCause(ConnectException::class.java) ?: false - } - - fun isNotAuthorized(): Boolean { - return error?.hasCause(NotAuthorizedException::class.java) ?: false - } -} - -data class SubscriptionWithMetadata( - val id: Long, - val baseUrl: String, - val topic: String, - val mutedUntil: Long, - val autoDelete: Long, - val minPriority: Int, - val insistent: Int, - val upAppId: String?, - val upConnectorToken: String?, - val displayName: String?, - val totalCount: Int, - val newCount: Int, - val lastActive: Long -) - -@Entity(primaryKeys = ["id", "subscriptionId"]) -data class Notification( - @ColumnInfo(name = "id") val id: String, - @ColumnInfo(name = "subscriptionId") val subscriptionId: Long, - @ColumnInfo(name = "timestamp") val timestamp: Long, // Unix timestamp - @ColumnInfo(name = "title") val title: String, - @ColumnInfo(name = "message") val message: String, - @ColumnInfo(name = "notificationId") val notificationId: Int, // Android notification popup ID - @ColumnInfo(name = "priority", defaultValue = "3") val priority: Int, // 1=min, 3=default, 5=max - @ColumnInfo(name = "tags") val tags: String, - @ColumnInfo(name = "deleted") val deleted: Boolean, -) - -@Entity(tableName = "Log") -data class LogEntry( - @PrimaryKey(autoGenerate = true) val id: Long, - @ColumnInfo(name = "timestamp") val timestamp: Long, - @ColumnInfo(name = "tag") val tag: String, - @ColumnInfo(name = "level") val level: Int, - @ColumnInfo(name = "message") val message: String, - @ColumnInfo(name = "exception") val exception: String? -) { - @Ignore constructor(timestamp: Long, tag: String, level: Int, message: String, exception: String?) : - this(0, timestamp, tag, level, message, exception) -} - -@androidx.room.Database( - version = 17, - entities = [ - Subscription::class, - Notification::class, - LogEntry::class - ] -) -abstract class Database : RoomDatabase() { - abstract fun subscriptionDao(): SubscriptionDao - abstract fun notificationDao(): NotificationDao - abstract fun logDao(): LogDao - - companion object { - @Volatile - private var instance: Database? = null - - fun getInstance(context: Context): Database { - return instance ?: synchronized(this) { - val instance = Room - .databaseBuilder(context.applicationContext, Database::class.java, "AppDatabase") - .addMigrations(MIGRATION_1_2) - .addMigrations(MIGRATION_2_3) - .addMigrations(MIGRATION_3_4) - .addMigrations(MIGRATION_4_5) - .addMigrations(MIGRATION_5_6) - .addMigrations(MIGRATION_6_7) - .addMigrations(MIGRATION_7_8) - .addMigrations(MIGRATION_8_9) - .addMigrations(MIGRATION_9_10) - .addMigrations(MIGRATION_10_11) - .addMigrations(MIGRATION_11_12) - .addMigrations(MIGRATION_12_13) - .addMigrations(MIGRATION_13_14) - .addMigrations(MIGRATION_14_15) - .addMigrations(MIGRATION_15_16) - .addMigrations(MIGRATION_16_17) - .fallbackToDestructiveMigration(true) - .build() - this.instance = instance - instance - } - } - - private val MIGRATION_1_2 = object : Migration(1, 2) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("CREATE TABLE Subscription_New (id INTEGER NOT NULL, baseUrl TEXT NOT NULL, topic TEXT NOT NULL, instant INTEGER NOT NULL DEFAULT('0'), PRIMARY KEY(id))") - db.execSQL("INSERT INTO Subscription_New SELECT id, baseUrl, topic, 0 FROM Subscription") - db.execSQL("DROP TABLE Subscription") - db.execSQL("ALTER TABLE Subscription_New RENAME TO Subscription") - db.execSQL("CREATE UNIQUE INDEX index_Subscription_baseUrl_topic ON Subscription (baseUrl, topic)") - - db.execSQL("ALTER TABLE Notification ADD COLUMN notificationId INTEGER NOT NULL DEFAULT('0')") - db.execSQL("ALTER TABLE Notification ADD COLUMN deleted INTEGER NOT NULL DEFAULT('0')") - } - } - - private val MIGRATION_2_3 = object : Migration(2, 3) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("ALTER TABLE Subscription ADD COLUMN mutedUntil INTEGER NOT NULL DEFAULT('0')") - } - } - - private val MIGRATION_3_4 = object : Migration(3, 4) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("CREATE TABLE Notification_New (id TEXT NOT NULL, subscriptionId INTEGER NOT NULL, timestamp INTEGER NOT NULL, title TEXT NOT NULL, message TEXT NOT NULL, notificationId INTEGER NOT NULL, priority INTEGER NOT NULL DEFAULT(3), tags TEXT NOT NULL, deleted INTEGER NOT NULL, PRIMARY KEY(id, subscriptionId))") - db.execSQL("INSERT INTO Notification_New SELECT id, subscriptionId, timestamp, '', message, notificationId, 3, '', deleted FROM Notification") - db.execSQL("DROP TABLE Notification") - db.execSQL("ALTER TABLE Notification_New RENAME TO Notification") - } - } - - private val MIGRATION_4_5 = object : Migration(4, 5) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("ALTER TABLE Subscription ADD COLUMN upAppId TEXT") - db.execSQL("ALTER TABLE Subscription ADD COLUMN upConnectorToken TEXT") - db.execSQL("CREATE UNIQUE INDEX index_Subscription_upConnectorToken ON Subscription (upConnectorToken)") - } - } - - private val MIGRATION_5_6 = object : Migration(5, 6) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("ALTER TABLE Notification ADD COLUMN click TEXT NOT NULL DEFAULT('')") - db.execSQL("ALTER TABLE Notification ADD COLUMN attachment_name TEXT") - db.execSQL("ALTER TABLE Notification ADD COLUMN attachment_type TEXT") - db.execSQL("ALTER TABLE Notification ADD COLUMN attachment_size INT") - db.execSQL("ALTER TABLE Notification ADD COLUMN attachment_expires INT") - db.execSQL("ALTER TABLE Notification ADD COLUMN attachment_url TEXT") - db.execSQL("ALTER TABLE Notification ADD COLUMN attachment_contentUri TEXT") - db.execSQL("ALTER TABLE Notification ADD COLUMN attachment_progress INT") - } - } - - private val MIGRATION_6_7 = object : Migration(6, 7) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("CREATE TABLE Log (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, timestamp INT NOT NULL, tag TEXT NOT NULL, level INT NOT NULL, message TEXT NOT NULL, exception TEXT)") - } - } - - private val MIGRATION_7_8 = object : Migration(7, 8) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("CREATE TABLE User (baseUrl TEXT NOT NULL, username TEXT NOT NULL, password TEXT NOT NULL, PRIMARY KEY(baseUrl))") - } - } - - private val MIGRATION_8_9 = object : Migration(8, 9) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("ALTER TABLE Notification ADD COLUMN encoding TEXT NOT NULL DEFAULT('')") - } - } - - private val MIGRATION_9_10 = object : Migration(9, 10) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("ALTER TABLE Notification ADD COLUMN actions TEXT") - } - } - - private val MIGRATION_10_11 = object : Migration(10, 11) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("ALTER TABLE Subscription ADD COLUMN minPriority INT NOT NULL DEFAULT (0)") - db.execSQL("ALTER TABLE Subscription ADD COLUMN autoDelete INT NOT NULL DEFAULT (-1)") - db.execSQL("ALTER TABLE Subscription ADD COLUMN icon TEXT") - } - } - - private val MIGRATION_11_12 = object : Migration(11, 12) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("ALTER TABLE Subscription ADD COLUMN lastNotificationId TEXT") - db.execSQL("ALTER TABLE Subscription ADD COLUMN displayName TEXT") - db.execSQL("ALTER TABLE Notification ADD COLUMN icon_url TEXT") - db.execSQL("ALTER TABLE Notification ADD COLUMN icon_contentUri TEXT") - } - } - - private val MIGRATION_12_13 = object : Migration(12, 13) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("ALTER TABLE Subscription ADD COLUMN insistent INTEGER NOT NULL DEFAULT (-1)") - db.execSQL("ALTER TABLE Subscription ADD COLUMN dedicatedChannels INTEGER NOT NULL DEFAULT (0)") - } - } - - private val MIGRATION_13_14 = object : Migration(13, 14) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("ALTER TABLE Notification ADD COLUMN contentType TEXT NOT NULL DEFAULT ('')") - } - } - - private val MIGRATION_14_15 = object : Migration(14, 15) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("CREATE TABLE CustomHeader (baseUrl TEXT NOT NULL, name TEXT NOT NULL, value TEXT NOT NULL, PRIMARY KEY(baseUrl, name))") - } - } - - private val MIGRATION_15_16 = object : Migration(15, 16) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("CREATE TABLE TrustedCertificate (baseUrl TEXT NOT NULL, pem TEXT NOT NULL, PRIMARY KEY(baseUrl))") - db.execSQL("CREATE TABLE ClientCertificate (baseUrl TEXT NOT NULL, p12Base64 TEXT NOT NULL, password TEXT NOT NULL, PRIMARY KEY(baseUrl))") - } - } - - private val MIGRATION_16_17 = object : Migration(16, 17) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL("UPDATE Notification SET icon_contentUri = NULL WHERE icon_url IS NULL AND icon_contentUri IS NOT NULL") - } - } - - - } -} - -@Dao -interface SubscriptionDao { - @Query(""" - SELECT - s.id, s.baseUrl, s.topic, s.mutedUntil, s.minPriority, s.autoDelete, s.insistent, s.upAppId, s.upConnectorToken, s.displayName, - COUNT(n.id) totalCount, - COUNT(CASE n.notificationId WHEN 0 THEN NULL ELSE n.id END) newCount, - IFNULL(MAX(n.timestamp),0) AS lastActive - FROM Subscription AS s - LEFT JOIN Notification AS n ON s.id=n.subscriptionId AND n.deleted != 1 - GROUP BY s.id - ORDER BY s.upAppId ASC, MAX(n.timestamp) DESC - """) - fun listFlow(): Flow> - - @Query(""" - SELECT - s.id, s.baseUrl, s.topic, s.mutedUntil, s.minPriority, s.autoDelete, s.insistent, s.upAppId, s.upConnectorToken, s.displayName, - COUNT(n.id) totalCount, - COUNT(CASE n.notificationId WHEN 0 THEN NULL ELSE n.id END) newCount, - IFNULL(MAX(n.timestamp),0) AS lastActive - FROM Subscription AS s - LEFT JOIN Notification AS n ON s.id=n.subscriptionId AND n.deleted != 1 - GROUP BY s.id - ORDER BY s.upAppId ASC, MAX(n.timestamp) DESC - """) - suspend fun list(): List - - @Query(""" - SELECT - s.id, s.baseUrl, s.topic, s.mutedUntil, s.minPriority, s.autoDelete, s.insistent, s.upAppId, s.upConnectorToken, s.displayName, - COUNT(n.id) totalCount, - COUNT(CASE n.notificationId WHEN 0 THEN NULL ELSE n.id END) newCount, - IFNULL(MAX(n.timestamp),0) AS lastActive - FROM Subscription AS s - LEFT JOIN Notification AS n ON s.id=n.subscriptionId AND n.deleted != 1 - WHERE s.baseUrl = :baseUrl AND s.topic = :topic - GROUP BY s.id - """) - fun get(baseUrl: String, topic: String): SubscriptionWithMetadata? - - @Query(""" - SELECT - s.id, s.baseUrl, s.topic, s.mutedUntil, s.minPriority, s.autoDelete, s.insistent, s.upAppId, s.upConnectorToken, s.displayName, - COUNT(n.id) totalCount, - COUNT(CASE n.notificationId WHEN 0 THEN NULL ELSE n.id END) newCount, - IFNULL(MAX(n.timestamp),0) AS lastActive - FROM Subscription AS s - LEFT JOIN Notification AS n ON s.id=n.subscriptionId AND n.deleted != 1 - WHERE s.id = :subscriptionId - GROUP BY s.id - """) - fun get(subscriptionId: Long): SubscriptionWithMetadata? - - @Query(""" - SELECT - s.id, s.baseUrl, s.topic, s.mutedUntil, s.minPriority, s.autoDelete, s.insistent, s.upAppId, s.upConnectorToken, s.displayName, - COUNT(n.id) totalCount, - COUNT(CASE n.notificationId WHEN 0 THEN NULL ELSE n.id END) newCount, - IFNULL(MAX(n.timestamp),0) AS lastActive - FROM Subscription AS s - LEFT JOIN Notification AS n ON s.id=n.subscriptionId AND n.deleted != 1 - WHERE s.upConnectorToken = :connectorToken - GROUP BY s.id - """) - fun getByConnectorToken(connectorToken: String): SubscriptionWithMetadata? - - @Query(""" - SELECT - s.id, s.baseUrl, s.topic, s.mutedUntil, s.minPriority, s.autoDelete, s.insistent, s.upAppId, s.upConnectorToken, s.displayName, - COUNT(n.id) totalCount, - COUNT(CASE n.notificationId WHEN 0 THEN NULL ELSE n.id END) newCount, - IFNULL(MAX(n.timestamp),0) AS lastActive - FROM Subscription AS s - LEFT JOIN Notification AS n ON s.id=n.subscriptionId AND n.deleted != 1 - WHERE s.upAppId = :upAppId - GROUP BY s.id - """) - fun getByUpAppId(upAppId: String): SubscriptionWithMetadata? - - @Insert - fun add(subscription: Subscription) - - @Update - fun update(subscription: Subscription) - - @Query("DELETE FROM subscription WHERE id = :subscriptionId") - fun remove(subscriptionId: Long) -} - -@Dao -interface NotificationDao { - @Query("SELECT * FROM notification") - suspend fun list(): List - - @Query("SELECT * FROM notification WHERE subscriptionId = :subscriptionId AND deleted != 1 ORDER BY timestamp DESC") - fun listFlow(subscriptionId: Long): Flow> - - @Query("SELECT id FROM notification WHERE subscriptionId = :subscriptionId") - fun listIds(subscriptionId: Long): List - - @Insert(onConflict = OnConflictStrategy.IGNORE) - fun add(notification: Notification) - - @Update(onConflict = OnConflictStrategy.IGNORE) - fun update(notification: Notification) - - @Query("SELECT * FROM notification WHERE id = :notificationId") - fun get(notificationId: String): Notification? - - @Query("UPDATE notification SET notificationId = 0 WHERE subscriptionId = :subscriptionId") - fun clearAllNotificationIds(subscriptionId: Long) - - @Query("UPDATE notification SET deleted = 1 WHERE id = :notificationId") - fun markAsDeleted(notificationId: String) - - @Query("UPDATE notification SET deleted = 1 WHERE subscriptionId = :subscriptionId") - fun markAllAsDeleted(subscriptionId: Long) - - @Query("UPDATE notification SET deleted = 1 WHERE subscriptionId = :subscriptionId AND timestamp < :olderThanTimestamp") - fun markAsDeletedIfOlderThan(subscriptionId: Long, olderThanTimestamp: Long) - - @Query("UPDATE notification SET deleted = 0 WHERE id = :notificationId") - fun undelete(notificationId: String) - - @Query("DELETE FROM notification WHERE subscriptionId = :subscriptionId AND timestamp < :olderThanTimestamp") - fun removeIfOlderThan(subscriptionId: Long, olderThanTimestamp: Long) - - @Query("DELETE FROM notification WHERE subscriptionId = :subscriptionId") - fun removeAll(subscriptionId: Long) -} - -@Dao -interface LogDao { - @Insert - suspend fun insert(entry: LogEntry) - - @Query("DELETE FROM log WHERE id NOT IN (SELECT id FROM log ORDER BY timestamp DESC, id DESC LIMIT :keepCount)") - suspend fun prune(keepCount: Int) - - @Query("SELECT * FROM log ORDER BY timestamp ASC, id ASC") - fun getAll(): List - - @Query("DELETE FROM log") - fun deleteAll() -} diff --git a/android/app/src/main/java/com/lonecloud/sup/db/Repository.kt b/android/app/src/main/java/com/lonecloud/sup/db/Repository.kt deleted file mode 100644 index 258c2ea..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/db/Repository.kt +++ /dev/null @@ -1,493 +0,0 @@ -package com.lonecloud.sup.db - -import android.content.Context -import android.content.SharedPreferences -import android.media.MediaPlayer -import android.os.Build -import androidx.annotation.WorkerThread -import androidx.appcompat.app.AppCompatDelegate -import androidx.core.content.edit -import androidx.lifecycle.LiveData -import androidx.lifecycle.MediatorLiveData -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.asLiveData -import androidx.lifecycle.map -import com.lonecloud.sup.util.Log -import com.lonecloud.sup.util.validUrl -import java.util.concurrent.ConcurrentHashMap -import java.util.concurrent.atomic.AtomicLong - -class Repository(private val sharedPrefs: SharedPreferences, database: Database) { - private val subscriptionDao = database.subscriptionDao() - private val notificationDao = database.notificationDao() - - private val connectionDetails = ConcurrentHashMap() - private val connectionDetailsLiveData = MutableLiveData>(connectionDetails) - private val connectionForceReconnectVersions = ConcurrentHashMap() - - // TODO Move these into an ApplicationState singleton - val detailViewSubscriptionId = AtomicLong(0L) // Omg, what a hack ... - val mediaPlayer = MediaPlayer() - - init { - Log.d(TAG, "Created $this") - } - - fun getSubscriptionsLiveData(): LiveData> { - return subscriptionDao - .listFlow() - .asLiveData() - .combineWith(connectionDetailsLiveData) { subscriptionsWithMetadata, _ -> - toSubscriptionList(subscriptionsWithMetadata.orEmpty()) - } - } - - fun getSubscriptionIdsWithInstantStatusLiveData(): LiveData>> { - return subscriptionDao - .listFlow() - .asLiveData() - .map { list -> list.map { Pair(it.id, false) }.toSet() } - } - - suspend fun getSubscriptions(): List { - return toSubscriptionList(subscriptionDao.list()) - } - - fun getSubscription(subscriptionId: Long): Subscription? { - return toSubscription(subscriptionDao.get(subscriptionId)) - } - - @Suppress("RedundantSuspendModifier") - @WorkerThread - suspend fun getSubscription(baseUrl: String, topic: String): Subscription? { - return toSubscription(subscriptionDao.get(baseUrl, topic)) - } - - @Suppress("RedundantSuspendModifier") - @WorkerThread - suspend fun getSubscriptionByConnectorToken(connectorToken: String): Subscription? { - return toSubscription(subscriptionDao.getByConnectorToken(connectorToken)) - } - - @Suppress("RedundantSuspendModifier") - @WorkerThread - suspend fun addSubscription(subscription: Subscription) { - subscriptionDao.add(subscription) - } - - @Suppress("RedundantSuspendModifier") - @WorkerThread - suspend fun updateSubscription(subscription: Subscription) { - subscriptionDao.update(subscription) - } - - @Suppress("RedundantSuspendModifier") - @WorkerThread - suspend fun removeSubscription(subscriptionId: Long) { - subscriptionDao.remove(subscriptionId) - } - - suspend fun getNotifications(): List { - return notificationDao.list() - } - - fun getNotificationsLiveData(subscriptionId: Long): LiveData> { - return notificationDao.listFlow(subscriptionId).asLiveData() - } - - fun clearAllNotificationIds(subscriptionId: Long) { - return notificationDao.clearAllNotificationIds(subscriptionId) - } - - fun getNotification(notificationId: String): Notification? { - return notificationDao.get(notificationId) - } - - fun onlyNewNotifications(subscriptionId: Long, notifications: List): List { - val existingIds = notificationDao.listIds(subscriptionId) - return notifications.filterNot { existingIds.contains(it.id) } - } - - @Suppress("RedundantSuspendModifier") - @WorkerThread - suspend fun addNotification(notification: Notification): Boolean { - val maybeExistingNotification = notificationDao.get(notification.id) - if (maybeExistingNotification != null) { - return false - } - notificationDao.add(notification) - return true - } - - fun updateNotification(notification: Notification) { - notificationDao.update(notification) - } - - fun undeleteNotification(notificationId: String) { - notificationDao.undelete(notificationId) - } - - fun markAsDeleted(notificationId: String) { - notificationDao.markAsDeleted(notificationId) - } - - fun markAllAsDeleted(subscriptionId: Long) { - notificationDao.markAllAsDeleted(subscriptionId) - } - - fun markAsDeletedIfOlderThan(subscriptionId: Long, olderThanTimestamp: Long) { - notificationDao.markAsDeletedIfOlderThan(subscriptionId, olderThanTimestamp) - } - - fun removeNotificationsIfOlderThan(subscriptionId: Long, olderThanTimestamp: Long) { - notificationDao.removeIfOlderThan(subscriptionId, olderThanTimestamp) - } - - fun removeAllNotifications(subscriptionId: Long) { - notificationDao.removeAll(subscriptionId) - } - - fun setMinPriority(minPriority: Int) { - if (minPriority <= MIN_PRIORITY_ANY) { - sharedPrefs.edit { - remove(SHARED_PREFS_MIN_PRIORITY) - } - } else { - sharedPrefs.edit { - putInt(SHARED_PREFS_MIN_PRIORITY, minPriority) - } - } - } - - fun getMinPriority(): Int { - return sharedPrefs.getInt(SHARED_PREFS_MIN_PRIORITY, MIN_PRIORITY_ANY) - } - - fun getAutoDownloadMaxSize(): Long { - val defaultValue = if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) { - AUTO_DOWNLOAD_NEVER // Need to request permission on older versions - } else { - AUTO_DOWNLOAD_DEFAULT - } - return sharedPrefs.getLong(SHARED_PREFS_AUTO_DOWNLOAD_MAX_SIZE, defaultValue) - } - - fun setAutoDownloadMaxSize(maxSize: Long) { - sharedPrefs.edit { - putLong(SHARED_PREFS_AUTO_DOWNLOAD_MAX_SIZE, maxSize) - } - } - - fun getAutoDeleteSeconds(): Long { - return sharedPrefs.getLong(SHARED_PREFS_AUTO_DELETE_SECONDS, AUTO_DELETE_DEFAULT_SECONDS) - } - - fun setAutoDeleteSeconds(seconds: Long) { - sharedPrefs.edit { - putLong(SHARED_PREFS_AUTO_DELETE_SECONDS, seconds) - } - } - - fun setDarkMode(mode: Int) { - if (mode == AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) { - sharedPrefs.edit { - remove(SHARED_PREFS_DARK_MODE) - } - } else { - sharedPrefs.edit { - putInt(SHARED_PREFS_DARK_MODE, mode) - } - } - } - - fun getDarkMode(): Int { - return sharedPrefs.getInt(SHARED_PREFS_DARK_MODE, AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM) - } - - fun setDynamicColorsEnabled(enabled: Boolean) { - sharedPrefs.edit(commit = true) { - putBoolean(SHARED_PREFS_DYNAMIC_COLORS, enabled) - } - } - - fun getDynamicColorsEnabled(): Boolean { - return sharedPrefs.getBoolean(SHARED_PREFS_DYNAMIC_COLORS, false) - } - - fun getBroadcastEnabled(): Boolean { - return sharedPrefs.getBoolean(SHARED_PREFS_BROADCAST_ENABLED, true) // Enabled by default - } - - fun setBroadcastEnabled(enabled: Boolean) { - sharedPrefs.edit { - putBoolean(SHARED_PREFS_BROADCAST_ENABLED, enabled) - } - } - - fun getUnifiedPushEnabled(): Boolean { - return sharedPrefs.getBoolean(SHARED_PREFS_UNIFIEDPUSH_ENABLED, true) // Enabled by default - } - - fun setUnifiedPushEnabled(enabled: Boolean) { - sharedPrefs.edit { - putBoolean(SHARED_PREFS_UNIFIEDPUSH_ENABLED, enabled) - } - } - - fun getInsistentMaxPriorityEnabled(): Boolean { - return sharedPrefs.getBoolean(SHARED_PREFS_INSISTENT_MAX_PRIORITY_ENABLED, false) // Disabled by default - } - - fun setInsistentMaxPriorityEnabled(enabled: Boolean) { - sharedPrefs.edit { - putBoolean(SHARED_PREFS_INSISTENT_MAX_PRIORITY_ENABLED, enabled) - } - } - - fun getRecordLogs(): Boolean { - return sharedPrefs.getBoolean(SHARED_PREFS_RECORD_LOGS_ENABLED, false) // Disabled by default - } - - fun setRecordLogsEnabled(enabled: Boolean) { - sharedPrefs.edit { - putBoolean(SHARED_PREFS_RECORD_LOGS_ENABLED, enabled) - } - } - - fun getMessageBarEnabled(): Boolean { - return sharedPrefs.getBoolean(SHARED_PREFS_MESSAGE_BAR_ENABLED, true) // Enabled by default - } - - fun setMessageBarEnabled(enabled: Boolean) { - sharedPrefs.edit { - putBoolean(SHARED_PREFS_MESSAGE_BAR_ENABLED, enabled) - } - } - - fun getBatteryOptimizationsRemindTime(): Long { - return sharedPrefs.getLong(SHARED_PREFS_BATTERY_OPTIMIZATIONS_REMIND_TIME, BATTERY_OPTIMIZATIONS_REMIND_TIME_ALWAYS) - } - - fun setBatteryOptimizationsRemindTime(timeMillis: Long) { - sharedPrefs.edit { - putLong(SHARED_PREFS_BATTERY_OPTIMIZATIONS_REMIND_TIME, timeMillis) - } - } - - fun getDefaultBaseUrl(): String? { - return sharedPrefs.getString(SHARED_PREFS_DEFAULT_BASE_URL, null) ?: - sharedPrefs.getString(SHARED_PREFS_UNIFIED_PUSH_BASE_URL, null) // Fall back to UP URL, removed when default is set! - } - - fun setDefaultBaseUrl(baseUrl: String) { - if (baseUrl == "") { - sharedPrefs.edit { - remove(SHARED_PREFS_UNIFIED_PUSH_BASE_URL) // Remove legacy key - .remove(SHARED_PREFS_DEFAULT_BASE_URL) - } - } else { - sharedPrefs.edit { - remove(SHARED_PREFS_UNIFIED_PUSH_BASE_URL) // Remove legacy key - .putString(SHARED_PREFS_DEFAULT_BASE_URL, baseUrl) - } - } - } - - fun isGlobalMuted(): Boolean { - val mutedUntil = getGlobalMutedUntil() - return mutedUntil == 1L || (mutedUntil > 1L && mutedUntil > System.currentTimeMillis()/1000) - } - - fun getGlobalMutedUntil(): Long { - return sharedPrefs.getLong(SHARED_PREFS_MUTED_UNTIL_TIMESTAMP, 0L) - } - - fun setGlobalMutedUntil(mutedUntilTimestamp: Long) { - sharedPrefs.edit { - putLong(SHARED_PREFS_MUTED_UNTIL_TIMESTAMP, mutedUntilTimestamp) - } - } - - fun checkGlobalMutedUntil(): Boolean { - val mutedUntil = sharedPrefs.getLong(SHARED_PREFS_MUTED_UNTIL_TIMESTAMP, 0L) - val expired = mutedUntil > 1L && System.currentTimeMillis()/1000 > mutedUntil - if (expired) { - sharedPrefs.edit { - putLong(SHARED_PREFS_MUTED_UNTIL_TIMESTAMP, 0L) - } - return true - } - return false - } - - fun getLastShareTopics(): List { - val topics = sharedPrefs.getString(SHARED_PREFS_LAST_TOPICS, "") ?: "" - return topics.split("\n").filter { validUrl(it) } - } - - fun addLastShareTopic(topic: String) { - val topics = (getLastShareTopics().filterNot { it == topic } + topic).takeLast(LAST_TOPICS_COUNT) - sharedPrefs.edit { - putString(SHARED_PREFS_LAST_TOPICS, topics.joinToString(separator = "\n")) - } - } - - private fun toSubscriptionList(list: List): List { - return list.map { s -> - Subscription( - id = s.id, - baseUrl = s.baseUrl, - topic = s.topic, - mutedUntil = s.mutedUntil, - minPriority = s.minPriority, - autoDelete = s.autoDelete, - insistent = s.insistent, - upAppId = s.upAppId, - upConnectorToken = s.upConnectorToken, - displayName = s.displayName, - totalCount = s.totalCount, - newCount = s.newCount, - lastActive = s.lastActive, - connectionDetails = connectionDetails[s.baseUrl] ?: ConnectionDetails() - ) - } - } - - private fun toSubscription(s: SubscriptionWithMetadata?): Subscription? { - if (s == null) { - return null - } - return Subscription( - id = s.id, - baseUrl = s.baseUrl, - topic = s.topic, - mutedUntil = s.mutedUntil, - minPriority = s.minPriority, - autoDelete = s.autoDelete, - insistent = s.insistent, - upAppId = s.upAppId, - upConnectorToken = s.upConnectorToken, - displayName = s.displayName, - totalCount = s.totalCount, - newCount = s.newCount, - lastActive = s.lastActive, - connectionDetails = connectionDetails[s.baseUrl] ?: ConnectionDetails() - ) - } - - fun updateConnectionDetails(baseUrl: String, state: ConnectionState, error: Throwable? = null, nextRetryTime: Long = 0L) { - val details = ConnectionDetails(state, error, nextRetryTime) - val current = connectionDetails[baseUrl] - if (current != details) { - if (state == ConnectionState.NOT_APPLICABLE && error == null) { - connectionDetails.remove(baseUrl) - } else { - connectionDetails[baseUrl] = details - } - connectionDetailsLiveData.postValue(connectionDetails.toMap()) - Log.d(TAG, "Connection details updated for $baseUrl: state=$state, error=${error?.message}, nextRetry=$nextRetryTime") - } - } - - fun getConnectionDetailsLiveData(): LiveData> { - return connectionDetailsLiveData - } - - fun getConnectionDetails(): Map { - return connectionDetails.toMap() - } - - fun getConnectionDetailsForBaseUrl(baseUrl: String): ConnectionDetails? { - return connectionDetails[baseUrl] - } - - fun getConnectionForceReconnectVersion(baseUrl: String): Long { - return connectionForceReconnectVersions[baseUrl] ?: 0L - } - - fun incrementConnectionForceReconnectVersion(baseUrl: String) { - connectionForceReconnectVersions.compute(baseUrl) { _, current -> (current ?: 0L) + 1 } - Log.d(TAG, "Connection force reconnect version incremented for $baseUrl: ${connectionForceReconnectVersions[baseUrl]}") - } - - companion object { - const val SHARED_PREFS_ID = "MainPreferences" - const val SHARED_PREFS_MUTED_UNTIL_TIMESTAMP = "MutedUntil" - const val SHARED_PREFS_MIN_PRIORITY = "MinPriority" - const val SHARED_PREFS_AUTO_DOWNLOAD_MAX_SIZE = "AutoDownload" - const val SHARED_PREFS_AUTO_DELETE_SECONDS = "AutoDelete" - const val SHARED_PREFS_DARK_MODE = "DarkMode" - const val SHARED_PREFS_DYNAMIC_COLORS = "DynamicColors" - const val SHARED_PREFS_BROADCAST_ENABLED = "BroadcastEnabled" - const val SHARED_PREFS_UNIFIEDPUSH_ENABLED = "UnifiedPushEnabled" - const val SHARED_PREFS_INSISTENT_MAX_PRIORITY_ENABLED = "InsistentMaxPriority" - const val SHARED_PREFS_RECORD_LOGS_ENABLED = "RecordLogs" - const val SHARED_PREFS_MESSAGE_BAR_ENABLED = "MessageBarEnabled" - const val SHARED_PREFS_BATTERY_OPTIMIZATIONS_REMIND_TIME = "BatteryOptimizationsRemindTime" - const val SHARED_PREFS_UNIFIED_PUSH_BASE_URL = "UnifiedPushBaseURL" // Legacy key required for migration to DefaultBaseURL - const val SHARED_PREFS_DEFAULT_BASE_URL = "DefaultBaseURL" - const val SHARED_PREFS_LAST_TOPICS = "LastTopics" - - private const val LAST_TOPICS_COUNT = 3 - - const val MIN_PRIORITY_USE_GLOBAL = 0 - const val MIN_PRIORITY_ANY = 1 - - const val MUTED_UNTIL_SHOW_ALL = 0L - const val MUTED_UNTIL_FOREVER = 1L - const val MUTED_UNTIL_TOMORROW = 2L - - private const val ONE_MB = 1024 * 1024L - const val AUTO_DOWNLOAD_NEVER = 0L // Values must match values.xml - const val AUTO_DOWNLOAD_ALWAYS = 1L - const val AUTO_DOWNLOAD_DEFAULT = ONE_MB - - private const val ONE_DAY_SECONDS = 24 * 60 * 60L - const val AUTO_DELETE_USE_GLOBAL = -1L // Values must match values.xml - const val AUTO_DELETE_NEVER = 0L - const val AUTO_DELETE_ONE_DAY_SECONDS = ONE_DAY_SECONDS - const val AUTO_DELETE_THREE_DAYS_SECONDS = 3 * ONE_DAY_SECONDS - const val AUTO_DELETE_ONE_WEEK_SECONDS = 7 * ONE_DAY_SECONDS - const val AUTO_DELETE_ONE_MONTH_SECONDS = 30 * ONE_DAY_SECONDS - const val AUTO_DELETE_THREE_MONTHS_SECONDS = 90 * ONE_DAY_SECONDS - const val AUTO_DELETE_DEFAULT_SECONDS = AUTO_DELETE_ONE_MONTH_SECONDS - - const val INSISTENT_MAX_PRIORITY_USE_GLOBAL = -1 // Values must match values.xml - const val INSISTENT_MAX_PRIORITY_ENABLED = 1 // 0 = Disabled (but not needed in code) - - const val BATTERY_OPTIMIZATIONS_REMIND_TIME_ALWAYS = 1L - const val BATTERY_OPTIMIZATIONS_REMIND_TIME_NEVER = Long.MAX_VALUE - - private const val TAG = "NtfyRepository" - private var instance: Repository? = null - - fun getInstance(context: Context): Repository { - val database = Database.getInstance(context.applicationContext) - val sharedPrefs = context.getSharedPreferences(SHARED_PREFS_ID, Context.MODE_PRIVATE) - return getInstance(sharedPrefs, database) - } - - private fun getInstance(sharedPrefs: SharedPreferences, database: Database): Repository { - return synchronized(Repository::class) { - val newInstance = instance ?: Repository(sharedPrefs, database) - instance = newInstance - newInstance - } - } - } -} - -/* https://stackoverflow.com/a/57079290/1440785 */ -fun LiveData.combineWith( - liveData: LiveData, - block: (T?, K?) -> R -): LiveData { - val result = MediatorLiveData() - result.addSource(this) { - result.value = block(this.value, liveData.value) - } - result.addSource(liveData) { - result.value = block(this.value, liveData.value) - } - return result -} diff --git a/android/app/src/main/java/com/lonecloud/sup/msg/ApiService.kt b/android/app/src/main/java/com/lonecloud/sup/msg/ApiService.kt deleted file mode 100644 index 16914eb..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/msg/ApiService.kt +++ /dev/null @@ -1,193 +0,0 @@ -package com.lonecloud.sup.msg - -import android.content.Context -import com.google.gson.Gson -import com.lonecloud.sup.db.Notification -import com.lonecloud.sup.db.Repository -import com.lonecloud.sup.service.NotAuthorizedException -import com.lonecloud.sup.util.ALL_PRIORITIES -import com.lonecloud.sup.util.HttpUtil -import com.lonecloud.sup.util.Log -import com.lonecloud.sup.util.PRIORITY_DEFAULT -import com.lonecloud.sup.util.topicUrl -import com.lonecloud.sup.util.topicUrlAuth -import com.lonecloud.sup.util.topicUrlJson -import com.lonecloud.sup.util.topicUrlJsonPoll -import okhttp3.Call -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okio.BufferedSource -import java.io.IOException -import java.net.URLEncoder -import kotlin.random.Random - -class ApiService(private val context: Context) { - private val repository = Repository.getInstance(context) - private val gson = Gson() - private val parser = NotificationParser() - - suspend fun publish( - baseUrl: String, - topic: String, - message: String, - title: String = "", - priority: Int = PRIORITY_DEFAULT, - tags: List = emptyList(), - delay: String = "", - body: RequestBody? = null, - filename: String = "", - click: String = "", - attach: String = "", - email: String = "", - call: String = "", - markdown: Boolean = false, - onCancelAvailable: ((cancel: () -> Unit) -> Unit)? = null // Called when the HTTP request was started and cancellable (caller can cancel) - ) { - val url = topicUrl(baseUrl, topic) - val query = mutableListOf() - if (priority in ALL_PRIORITIES) { - query.add("priority=$priority") - } - if (tags.isNotEmpty()) { - query.add("tags=${URLEncoder.encode(tags.joinToString(","), "UTF-8")}") - } - if (title.isNotEmpty()) { - query.add("title=${URLEncoder.encode(title, "UTF-8")}") - } - if (delay.isNotEmpty()) { - query.add("delay=${URLEncoder.encode(delay, "UTF-8")}") - } - if (filename.isNotEmpty()) { - query.add("filename=${URLEncoder.encode(filename, "UTF-8")}") - } - if (click.isNotEmpty()) { - query.add("click=${URLEncoder.encode(click, "UTF-8")}") - } - if (attach.isNotEmpty()) { - query.add("attach=${URLEncoder.encode(attach, "UTF-8")}") - } - if (email.isNotEmpty()) { - query.add("email=${URLEncoder.encode(email, "UTF-8")}") - } - if (call.isNotEmpty()) { - query.add("call=${URLEncoder.encode(call, "UTF-8")}") - } - if (markdown) { - query.add("markdown=true") - } - if (body != null) { - query.add("message=${URLEncoder.encode(message.replace("\n", "\\n"), "UTF-8")}") - } - val urlWithQuery = if (query.isNotEmpty()) { - url + "?" + query.joinToString("&") - } else { - url - } - val request = HttpUtil.requestBuilder(urlWithQuery) - .put(body ?: message.toRequestBody()) - .build() - Log.d(TAG, "Publishing to $request") - val httpCall = HttpUtil.longCallClient(context, baseUrl).newCall(request) - onCancelAvailable?.invoke { httpCall.cancel() } // Notify caller that HTTP request can now be canceled - httpCall.execute().use { response -> - if (response.code == 401 || response.code == 403) { - throw UnauthorizedException() - } else if (response.code == 413) { - throw EntityTooLargeException() - } else if (!response.isSuccessful) { - // Try to parse error response from server - val errorBody = response.body?.string() ?: "" - val apiError = try { - gson.fromJson(errorBody, ErrorResponse::class.java) - } catch (e: Exception) { - null - } - if (apiError?.error != null && apiError.code != null) { - throw ApiException(apiError.error, apiError.code) - } - throw Exception("Unexpected response ${response.code} when publishing to $url") - } - Log.d(TAG, "Successfully published to $url") - } - } - - suspend fun poll(subscriptionId: Long, baseUrl: String, topic: String, since: String? = null): List { - val sinceVal = since ?: "all" - val url = topicUrlJsonPoll(baseUrl, topic, sinceVal) - Log.d(TAG, "Polling topic $url") - - val request = HttpUtil.requestBuilder(url).build() - HttpUtil.defaultClient(context, baseUrl).newCall(request).execute().use { response -> - if (!response.isSuccessful) { - throw Exception("Unexpected response ${response.code} when polling topic $url") - } - val body = response.body?.string()?.trim() ?: "" - if (body.isEmpty()) return emptyList() - val notifications = body.lines().mapNotNull { line -> - parser.parse(line, subscriptionId = subscriptionId, notificationId = 0) // No notification when we poll - } - - Log.d(TAG, "Notifications: $notifications") - return notifications - } - } - - suspend fun subscribe( - baseUrl: String, - topics: String, - since: String? - ): Pair { - val sinceVal = since ?: "all" - val url = topicUrlJson(baseUrl, topics, sinceVal) - Log.d(TAG, "Opening subscription connection to $url") - val request = HttpUtil.requestBuilder(url).build() - val call = HttpUtil.subscriberClient(context, baseUrl).newCall(request) - val response = call.execute() - if (!response.isSuccessful) { - val code = response.code - val message = response.message - response.close() - if (code == 401 || code == 403) { - throw NotAuthorizedException("$code $message") - } - throw IOException("Unexpected response $code when subscribing to $url") - } - return Pair(call, response.body?.source() ?: throw IOException("Empty response body")) - } - - suspend fun checkAuth(baseUrl: String, topic: String): Boolean { - Log.d(TAG, "Checking anonymous read against ${topicUrl(baseUrl, topic)}") - val url = topicUrlAuth(baseUrl, topic) - val request = HttpUtil.requestBuilder(url).build() - HttpUtil.defaultClient(context, baseUrl).newCall(request).execute().use { response -> - if (response.isSuccessful) { - return true - } else if (response.code == 404) { - return true // Special case: Anonymous login to old servers return 404 since //auth doesn't exist - } else if (response.code == 401 || response.code == 403) { // See server/server.go - return false - } - throw Exception("Unexpected server response ${response.code}") - } - } - - class UnauthorizedException : Exception() - class EntityTooLargeException : Exception() - class ApiException(val error: String, val code: Int) : Exception(error) - - private data class ErrorResponse( - val code: Int?, - val http: Int?, - val error: String? - ) - - companion object { - private const val TAG = "NtfyApiService" - - // These constants have corresponding values in the server codebase! - const val CONTROL_TOPIC = "~control" - const val EVENT_MESSAGE = "message" - const val EVENT_KEEPALIVE = "keepalive" - const val EVENT_POLL_REQUEST = "poll_request" - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/msg/BroadcastService.kt b/android/app/src/main/java/com/lonecloud/sup/msg/BroadcastService.kt deleted file mode 100644 index 89a347d..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/msg/BroadcastService.kt +++ /dev/null @@ -1,109 +0,0 @@ -package com.lonecloud.sup.msg - -import android.content.Context -import android.content.Intent -import com.lonecloud.sup.R -import com.lonecloud.sup.db.Notification -import com.lonecloud.sup.db.Repository -import com.lonecloud.sup.db.Subscription -import com.lonecloud.sup.util.* -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.GlobalScope -import kotlinx.coroutines.launch - -/** - * The broadcast service is responsible for sending and receiving broadcast intents - * in order to facilitate tasks app integrations. - */ -class BroadcastService(private val ctx: Context) { - fun sendMessage(subscription: Subscription, notification: Notification, muted: Boolean) { - val intent = Intent() - intent.action = MESSAGE_RECEIVED_ACTION - intent.putExtra("id", notification.id) - intent.putExtra("base_url", subscription.baseUrl) - intent.putExtra("topic", subscription.topic) - intent.putExtra("time", notification.timestamp.toInt()) - intent.putExtra("title", notification.title) - intent.putExtra("message", decodeMessage(notification)) - intent.putExtra("message_bytes", decodeBytesMessage(notification)) - intent.putExtra("tags", notification.tags) - intent.putExtra("tags_map", joinTagsMap(splitTags(notification.tags))) - intent.putExtra("priority", notification.priority) - intent.putExtra("muted", muted) - intent.putExtra("muted_str", muted.toString()) - - Log.d(TAG, "Sending message intent broadcast: ${intent.action} with extras ${intent.extras}") - ctx.sendBroadcast(intent) - } - - /** - * This receiver is triggered when the SEND_MESSAGE intent is received. - * See AndroidManifest.xml for details. - */ - class BroadcastReceiver : android.content.BroadcastReceiver() { - override fun onReceive(context: Context, intent: Intent) { - Log.d(TAG, "Broadcast received: $intent") - when (intent.action) { - MESSAGE_SEND_ACTION -> send(context, intent) - } - } - - private fun send(ctx: Context, intent: Intent) { - val api = ApiService(ctx) - val baseUrl = getStringExtra(intent, "base_url") ?: ctx.getString(R.string.app_base_url) - val topic = getStringExtra(intent, "topic") ?: return - val message = getStringExtra(intent, "message") ?: return - val title = getStringExtra(intent, "title") ?: "" - val tags = getStringExtra(intent,"tags") ?: "" - val priority = when (getStringExtra(intent, "priority")) { - "min", "1" -> 1 - "low", "2" -> 2 - "default", "3" -> 3 - "high", "4" -> 4 - "urgent", "max", "5" -> 5 - else -> 0 - } - val delay = getStringExtra(intent,"delay") ?: "" - GlobalScope.launch(Dispatchers.IO) { - try { - Log.d(TAG, "Publishing message $intent") - api.publish( - baseUrl = baseUrl, - topic = topic, - message = message, - title = title, - priority = priority, - tags = splitTags(tags), - delay = delay - ) - } catch (e: Exception) { - Log.w(TAG, "Unable to publish message: ${e.message}", e) - } - } - } - - /** - * Gets an extra as a String value, even if the extra may be an int or a long. - */ - private fun getStringExtra(intent: Intent, name: String): String? { - if (intent.getStringExtra(name) != null) { - return intent.getStringExtra(name) - } else if (intent.getIntExtra(name, DOES_NOT_EXIST) != DOES_NOT_EXIST) { - return intent.getIntExtra(name, DOES_NOT_EXIST).toString() - } else if (intent.getLongExtra(name, DOES_NOT_EXIST.toLong()) != DOES_NOT_EXIST.toLong()) { - return intent.getLongExtra(name, DOES_NOT_EXIST.toLong()).toString() - } - return null - } - } - - companion object { - private const val TAG = "NtfyBroadcastService" - private const val DOES_NOT_EXIST = -2586000 - - // These constants cannot be changed without breaking the contract; also see manifest - private const val MESSAGE_RECEIVED_ACTION = "io.heckel.ntfy.MESSAGE_RECEIVED" - private const val MESSAGE_SEND_ACTION = "io.heckel.ntfy.SEND_MESSAGE" - private const val USER_ACTION_ACTION = "io.heckel.ntfy.USER_ACTION" - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/msg/Message.kt b/android/app/src/main/java/com/lonecloud/sup/msg/Message.kt deleted file mode 100644 index 2da5381..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/msg/Message.kt +++ /dev/null @@ -1,49 +0,0 @@ -package com.lonecloud.sup.msg - -import androidx.annotation.Keep -import com.google.gson.annotations.SerializedName - -/* This annotation ensures that proguard still works in production builds, - * see https://stackoverflow.com/a/62753300/1440785 */ -@Keep -data class Message( - val id: String, - val time: Long, - val event: String, - val topic: String, - val priority: Int?, - val tags: List?, - val click: String?, - val icon: String?, - val actions: List?, - val title: String?, - val message: String, - @SerializedName("content_type") val contentType: String?, - val encoding: String?, - val attachment: MessageAttachment?, -) - -@Keep -data class MessageAttachment( - val name: String, - val type: String?, - val size: Long?, - val expires: Long?, - val url: String, -) - -@Keep -data class MessageAction( - val id: String, - val action: String, - val label: String, // "view", "broadcast" or "http" - val clear: Boolean?, // clear notification after successful execution - val url: String?, // used in "view" and "http" actions - val method: String?, // used in "http" action, default is POST (!) - val headers: Map?, // used in "http" action - val body: String?, // used in "http" action - val intent: String?, // used in "broadcast" action - val extras: Map?, // used in "broadcast" action -) - -const val MESSAGE_ENCODING_BASE64 = "base64" diff --git a/android/app/src/main/java/com/lonecloud/sup/msg/NotificationDispatcher.kt b/android/app/src/main/java/com/lonecloud/sup/msg/NotificationDispatcher.kt deleted file mode 100644 index 410f2fb..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/msg/NotificationDispatcher.kt +++ /dev/null @@ -1,79 +0,0 @@ -package com.lonecloud.sup.msg - -import android.content.Context -import com.lonecloud.sup.db.Notification -import com.lonecloud.sup.db.Repository -import com.lonecloud.sup.db.Subscription -import com.lonecloud.sup.util.Log -import com.lonecloud.sup.up.Distributor -import com.lonecloud.sup.util.decodeBytesMessage -import com.lonecloud.sup.util.safeLet - -/** - * The notification dispatcher figures out what to do with a notification. - * It may display a notification, send out a broadcast, or forward via UnifiedPush. - */ -class NotificationDispatcher(val context: Context, val repository: Repository) { - private val notifier = NotificationService(context) - private val broadcaster = BroadcastService(context) - private val distributor = Distributor(context) - - fun init() { - notifier.createNotificationChannels() - } - - fun dispatch(subscription: Subscription, notification: Notification) { - Log.d(TAG, "Dispatching $notification for subscription $subscription") - - val muted = getMuted(subscription) - val notify = shouldNotify(subscription, notification, muted) - val broadcast = shouldBroadcast(subscription) - val distribute = shouldDistribute(subscription) - if (notify) { - notifier.display(subscription, notification) - } - if (broadcast) { - broadcaster.sendMessage(subscription, notification, muted) - } - if (distribute) { - safeLet(subscription.upAppId, subscription.upConnectorToken) { appId, connectorToken -> - distributor.sendMessage(appId, connectorToken, decodeBytesMessage(notification)) - } - } - } - - private fun shouldNotify(subscription: Subscription, notification: Notification, muted: Boolean): Boolean { - if (subscription.upAppId != null) { - return false - } - val priority = if (notification.priority > 0) notification.priority else 3 - val minPriority = if (subscription.minPriority > 0) subscription.minPriority else repository.getMinPriority() - if (priority < minPriority) { - return false - } - val detailsVisible = repository.detailViewSubscriptionId.get() == notification.subscriptionId - return !detailsVisible && !muted - } - - private fun shouldBroadcast(subscription: Subscription): Boolean { - if (subscription.upAppId != null) { // Never broadcast for UnifiedPush subscriptions - return false - } - return repository.getBroadcastEnabled() - } - - private fun shouldDistribute(subscription: Subscription): Boolean { - return subscription.upAppId != null // Only distribute for UnifiedPush subscriptions - } - - private fun getMuted(subscription: Subscription): Boolean { - if (repository.isGlobalMuted()) { - return true - } - return subscription.mutedUntil == 1L || (subscription.mutedUntil > 1L && subscription.mutedUntil > System.currentTimeMillis()/1000) - } - - companion object { - private const val TAG = "NtfyNotifDispatch" - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/msg/NotificationParser.kt b/android/app/src/main/java/com/lonecloud/sup/msg/NotificationParser.kt deleted file mode 100644 index 0444b39..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/msg/NotificationParser.kt +++ /dev/null @@ -1,37 +0,0 @@ -package com.lonecloud.sup.msg - -import com.google.gson.Gson -import com.lonecloud.sup.db.Notification -import com.lonecloud.sup.util.joinTags -import com.lonecloud.sup.util.toPriority -import java.lang.reflect.Type - -class NotificationParser { - private val gson = Gson() - - fun parse(s: String, subscriptionId: Long = 0, notificationId: Int = 0): Notification? { - val notificationWithTopic = parseWithTopic(s, subscriptionId = subscriptionId, notificationId = notificationId) - return notificationWithTopic?.notification - } - - fun parseWithTopic(s: String, subscriptionId: Long = 0, notificationId: Int = 0): NotificationWithTopic? { - val message = gson.fromJson(s, Message::class.java) - if (message.event != ApiService.EVENT_MESSAGE) { - return null - } - val notification = Notification( - id = message.id, - subscriptionId = subscriptionId, - timestamp = message.time, - title = message.title ?: "", - message = message.message, - priority = toPriority(message.priority), - tags = joinTags(message.tags), - notificationId = notificationId, - deleted = false - ) - return NotificationWithTopic(message.topic, notification) - } - - data class NotificationWithTopic(val topic: String, val notification: Notification) -} diff --git a/android/app/src/main/java/com/lonecloud/sup/msg/NotificationService.kt b/android/app/src/main/java/com/lonecloud/sup/msg/NotificationService.kt deleted file mode 100644 index b29cb6b..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/msg/NotificationService.kt +++ /dev/null @@ -1,225 +0,0 @@ -package com.lonecloud.sup.msg - -import android.app.* -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -import android.media.AudioAttributes -import android.media.AudioManager -import android.media.RingtoneManager -import android.net.Uri -import androidx.core.app.NotificationCompat -import com.lonecloud.sup.R -import com.lonecloud.sup.db.* -import com.lonecloud.sup.db.Notification -import com.lonecloud.sup.ui.Colors - -import com.lonecloud.sup.ui.MainActivity -import com.lonecloud.sup.util.* -import java.util.* - -class NotificationService(val context: Context) { - private val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager - private val repository = Repository.getInstance(context) - private val appBaseUrl = context.getString(R.string.app_base_url) - - fun display(subscription: Subscription, notification: Notification) { - displayInternal(subscription, notification, update = false) - } - - fun update(subscription: Subscription, notification: Notification, isNew: Boolean) { - displayInternal(subscription, notification, update = !isNew) - } - - fun cancel(notificationId: Int) { - notificationManager.cancel(notificationId) - } - - fun cancel(subscription: Subscription, notification: Notification) { - notificationManager.cancel(notification.notificationId) - } - - fun createNotificationChannels() { - val groupId = DEFAULT_GROUP - val groupName = context.getString(R.string.channel_notifications_group_default_name) - maybeCreateNotificationGroup(groupId, groupName) - (PRIORITY_MIN..PRIORITY_MAX).forEach { priority -> - maybeCreateNotificationChannel(groupId, priority) - } - } - - private fun displayInternal(subscription: Subscription, notification: Notification, update: Boolean = false) { - val title = formatTitle(appBaseUrl, subscription, notification) - val groupId = DEFAULT_GROUP - val channelId = toChannelId(groupId, notification.priority) - val insistent = notification.priority == PRIORITY_MAX && - (repository.getInsistentMaxPriorityEnabled() || subscription.insistent == Repository.INSISTENT_MAX_PRIORITY_ENABLED) - val builder = NotificationCompat.Builder(context, channelId) - .setSmallIcon(R.drawable.ic_notification) - .setColor(Colors.notificationIcon(context)) - .setContentTitle(title) - .setOnlyAlertOnce(true) - .setAutoCancel(true) - setStyleAndText(builder, notification) - setClickAction(builder, subscription) - maybeSetDeleteIntent(builder, insistent) - maybeSetSound(builder, insistent, update) - - maybeCreateNotificationGroup(groupId, subscriptionGroupName(subscription)) - maybeCreateNotificationChannel(groupId, notification.priority) - maybePlayInsistentSound(groupId, insistent) - - notificationManager.notify(notification.notificationId, builder.build()) - } - - private fun maybeSetDeleteIntent(builder: NotificationCompat.Builder, insistent: Boolean) { - if (!insistent) { - return - } - val intent = Intent(context, DeleteBroadcastReceiver::class.java) - val pendingIntent = PendingIntent.getBroadcast(context, Random().nextInt(), intent, PendingIntent.FLAG_IMMUTABLE) - builder.setDeleteIntent(pendingIntent) - } - - private fun maybeSetSound(builder: NotificationCompat.Builder, insistent: Boolean, update: Boolean) { - val hasSound = !update && !insistent - if (hasSound) { - val defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION) - builder.setSound(defaultSoundUri) - } else { - builder.setSound(null) - } - } - - private fun setStyleAndText(builder: NotificationCompat.Builder, notification: Notification) { - val message = formatMessage(notification) - builder - .setContentText(message) - .setStyle(NotificationCompat.BigTextStyle().bigText(message)) - } - - private fun setClickAction(builder: NotificationCompat.Builder, subscription: Subscription) { - val intent = Intent(context, MainActivity::class.java) - val pendingIntent = PendingIntent.getActivity( - context, - kotlin.random.Random.nextInt(), - intent, - PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT - ) - builder.setContentIntent(pendingIntent) - } - - private fun subscriptionGroupName(subscription: Subscription): String { - return displayName(appBaseUrl, subscription) - } - - private fun displayName(appBaseUrl: String?, subscription: Subscription): String { - return subscription.displayName ?: subscriptionTopicShortUrl(subscription) - } - - class DeleteBroadcastReceiver : BroadcastReceiver() { - override fun onReceive(context: Context, intent: Intent) { - Log.d(TAG, "Media player: Stopping insistent ring") - val mediaPlayer = Repository.getInstance(context).mediaPlayer - mediaPlayer.stop() - } - } - - private fun maybeCreateNotificationChannel(group: String, priority: Int) { - val channelId = toChannelId(group, priority) - val pause = 300L - val channel = when (priority) { - PRIORITY_MIN -> NotificationChannel(channelId, context.getString(R.string.common_priority_min_name), NotificationManager.IMPORTANCE_MIN) - PRIORITY_LOW -> NotificationChannel(channelId, context.getString(R.string.common_priority_low_name), NotificationManager.IMPORTANCE_LOW) - PRIORITY_HIGH -> { - val channel = NotificationChannel(channelId, context.getString(R.string.common_priority_high_name), NotificationManager.IMPORTANCE_HIGH) - channel.enableVibration(true) - channel.vibrationPattern = longArrayOf( - pause, 100, pause, 100, pause, 100, - pause, 2000 - ) - channel - } - PRIORITY_MAX -> { - val channel = NotificationChannel(channelId, context.getString(R.string.common_priority_max_name), NotificationManager.IMPORTANCE_HIGH) - channel.enableLights(true) - channel.enableVibration(true) - channel.setBypassDnd(true) - channel.vibrationPattern = longArrayOf( - pause, 100, pause, 100, pause, 100, - pause, 2000, - pause, 100, pause, 100, pause, 100, - pause, 2000, - pause, 100, pause, 100, pause, 100, - pause, 2000 - ) - channel - } - else -> NotificationChannel(channelId, context.getString(R.string.common_priority_default_name), NotificationManager.IMPORTANCE_DEFAULT) - } - channel.group = group - notificationManager.createNotificationChannel(channel) - } - - private fun maybeDeleteNotificationChannel(group: String, priority: Int) { - notificationManager.deleteNotificationChannel(toChannelId(group, priority)) - } - - private fun maybeCreateNotificationGroup(id: String, name: String) { - notificationManager.createNotificationChannelGroup(NotificationChannelGroup(id, name)) - } - - private fun maybeDeleteNotificationGroup(id: String) { - notificationManager.deleteNotificationChannelGroup(id) - } - - private fun toChannelId(groupId: String, priority: Int): String { - return when (priority) { - PRIORITY_MIN -> groupId + GROUP_SUFFIX_PRIORITY_MIN - PRIORITY_LOW -> groupId + GROUP_SUFFIX_PRIORITY_LOW - PRIORITY_HIGH -> groupId + GROUP_SUFFIX_PRIORITY_HIGH - PRIORITY_MAX -> groupId + GROUP_SUFFIX_PRIORITY_MAX - else -> groupId + GROUP_SUFFIX_PRIORITY_DEFAULT - } - } - - private fun maybePlayInsistentSound(groupId: String, insistent: Boolean) { - if (!insistent) { - return - } - try { - val mediaPlayer = repository.mediaPlayer - val audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager - if (audioManager.getStreamVolume(AudioManager.STREAM_ALARM) != 0) { - Log.d(TAG, "Media player: Playing insistent alarm on alarm channel") - mediaPlayer.reset() - mediaPlayer.setDataSource(context, getInsistentSound(groupId)) - mediaPlayer.setAudioAttributes(AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_ALARM).build()) - mediaPlayer.isLooping = true - mediaPlayer.prepare() - mediaPlayer.start() - } else { - Log.d(TAG, "Media player: Alarm volume is 0; not playing insistent alarm") - } - } catch (e: Exception) { - Log.w(TAG, "Media player: Failed to play insistent alarm", e) - } - } - - private fun getInsistentSound(groupId: String): Uri { - val channelId = toChannelId(groupId, PRIORITY_MAX) - val channel = notificationManager.getNotificationChannel(channelId) - return channel.sound - } - - companion object { - private const val TAG = "NtfyNotifService" - private const val DEFAULT_GROUP = "ntfy" - private const val SUBSCRIPTION_GROUP_PREFIX = "ntfy-subscription-" - private const val GROUP_SUFFIX_PRIORITY_MIN = "-min" - private const val GROUP_SUFFIX_PRIORITY_LOW = "-low" - private const val GROUP_SUFFIX_PRIORITY_DEFAULT = "" - private const val GROUP_SUFFIX_PRIORITY_HIGH = "-high" - private const val GROUP_SUFFIX_PRIORITY_MAX = "-max" - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/service/Exceptions.kt b/android/app/src/main/java/com/lonecloud/sup/service/Exceptions.kt deleted file mode 100644 index 8d3b06e..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/service/Exceptions.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.lonecloud.sup.service - -class NotAuthorizedException(message: String, val user: Any? = null) : Exception(message) - -fun Throwable.hasCause(causeClass: Class): Boolean { - var current: Throwable? = this - while (current != null) { - if (causeClass.isInstance(current)) return true - current = current.cause - } - return false -} diff --git a/android/app/src/main/java/com/lonecloud/sup/service/SignalListenerService.kt b/android/app/src/main/java/com/lonecloud/sup/service/SignalListenerService.kt deleted file mode 100644 index b443ca3..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/service/SignalListenerService.kt +++ /dev/null @@ -1,84 +0,0 @@ -package com.lonecloud.sup.service - -import android.app.NotificationChannel -import android.app.NotificationManager -import android.app.Service -import android.content.Intent -import android.os.Build -import android.os.IBinder -import androidx.core.app.NotificationCompat -import com.lonecloud.sup.R -import com.lonecloud.sup.app.Application -import com.lonecloud.sup.db.Notification -import com.lonecloud.sup.msg.NotificationDispatcher -import com.lonecloud.sup.util.Log -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.SupervisorJob -import kotlinx.coroutines.launch - -/** - * Service that listens for Signal notifications and processes them. - * This replaces ntfy's SubscriberService which polls HTTP/WebSocket. - * We get notifications pushed via Signal instead. - */ -class SignalListenerService : Service() { - private val repository by lazy { (application as Application).repository } - private val dispatcher by lazy { NotificationDispatcher(this, repository) } - private val scope = CoroutineScope(Dispatchers.IO + SupervisorJob()) - - override fun onCreate() { - super.onCreate() - Log.d(TAG, "Service created") - createForegroundNotification() - } - - override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { - Log.d(TAG, "Service started") - - intent?.getStringExtra(EXTRA_NOTIFICATION_DATA)?.let { data -> - scope.launch { - processNotification(data) - } - } - - return START_STICKY - } - - override fun onBind(intent: Intent?): IBinder? = null - - private fun createForegroundNotification() { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - val channel = NotificationChannel( - NOTIFICATION_CHANNEL_ID, - getString(R.string.channel_subscriber_service_name), - NotificationManager.IMPORTANCE_LOW - ) - val notificationManager = getSystemService(NotificationManager::class.java) - notificationManager.createNotificationChannel(channel) - } - - val notification = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID) - .setContentTitle(getString(R.string.app_name)) - .setContentText("Listening for notifications via Signal") - .setSmallIcon(R.drawable.ic_notification) - .build() - - startForeground(NOTIFICATION_ID, notification) - } - - private suspend fun processNotification(data: String) { - try { - Log.d(TAG, "Processing notification: $data") - } catch (e: Exception) { - Log.e(TAG, "Error processing notification: ${e.message}", e) - } - } - - companion object { - private const val TAG = "NtfySignalListener" - private const val NOTIFICATION_CHANNEL_ID = "ntfy-signal" - private const val NOTIFICATION_ID = 1 - const val EXTRA_NOTIFICATION_DATA = "notification_data" - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/ui/AddFragment.kt b/android/app/src/main/java/com/lonecloud/sup/ui/AddFragment.kt deleted file mode 100644 index 9a402cd..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/ui/AddFragment.kt +++ /dev/null @@ -1,466 +0,0 @@ -package com.lonecloud.sup.ui - -import android.app.Activity -import android.app.Dialog -import android.content.Context -import android.os.Bundle -import android.view.MenuItem -import android.view.View -import android.view.ViewGroup -import android.view.inputmethod.InputMethodManager -import android.widget.* -import androidx.fragment.app.DialogFragment -import androidx.lifecycle.lifecycleScope -import com.google.android.material.appbar.MaterialToolbar -import com.google.android.material.textfield.TextInputEditText -import com.google.android.material.textfield.TextInputLayout -import com.lonecloud.sup.BuildConfig -import com.lonecloud.sup.R -import com.lonecloud.sup.db.Repository -import com.lonecloud.sup.msg.ApiService -import com.lonecloud.sup.util.CertUtil -import com.lonecloud.sup.util.* -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch -import androidx.core.view.isVisible -import androidx.core.view.isGone -import java.security.cert.CertificateException -import java.security.cert.X509Certificate -import javax.net.ssl.SSLHandshakeException -import javax.net.ssl.SSLPeerUnverifiedException - -class AddFragment : DialogFragment() { - private lateinit var repository: Repository - private lateinit var api: ApiService - private lateinit var subscribeListener: SubscribeListener - private lateinit var appBaseUrl: String - private var defaultBaseUrl: String? = null - - private lateinit var toolbar: MaterialToolbar - private lateinit var actionMenuItem: MenuItem - private lateinit var subscribeView: View - private lateinit var loginView: View - - // Subscribe page - private lateinit var subscribeTopicText: TextInputEditText - private lateinit var subscribeBaseUrlLayout: TextInputLayout - private lateinit var subscribeBaseUrlText: AutoCompleteTextView - private lateinit var subscribeUseAnotherServerCheckbox: CheckBox - private lateinit var subscribeUseAnotherServerDescription: TextView - private lateinit var subscribeInstantDeliveryBox: View - private lateinit var subscribeInstantDeliveryCheckbox: CheckBox - private lateinit var subscribeInstantDeliveryDescription: View - private lateinit var subscribeForegroundDescription: TextView - private lateinit var subscribeProgress: ProgressBar - private lateinit var subscribeErrorText: TextView - private lateinit var subscribeErrorTextImage: View - - // Login page - private lateinit var loginUsernameText: TextInputEditText - private lateinit var loginPasswordText: TextInputEditText - private lateinit var loginProgress: ProgressBar - private lateinit var loginErrorText: TextView - private lateinit var loginErrorTextImage: View - - interface SubscribeListener { - fun onSubscribe(topic: String, baseUrl: String, instant: Boolean) - } - - override fun onAttach(context: Context) { - super.onAttach(context) - subscribeListener = activity as SubscribeListener - } - - override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { - if (activity == null) { - throw IllegalStateException("Activity cannot be null") - } - - // Dependencies (Fragments need a default constructor) - repository = Repository.getInstance(requireActivity()) - api = ApiService(requireContext()) - appBaseUrl = getString(R.string.app_base_url) - defaultBaseUrl = repository.getDefaultBaseUrl() - - // Build root view - val view = requireActivity().layoutInflater.inflate(R.layout.fragment_add_dialog, null) - - // Setup toolbar - toolbar = view.findViewById(R.id.add_dialog_toolbar) - toolbar.setNavigationOnClickListener { - dismiss() - } - toolbar.setOnMenuItemClickListener { menuItem -> - if (menuItem.itemId == R.id.add_dialog_action_button) { - onActionButtonClick() - true - } else { - false - } - } - actionMenuItem = toolbar.menu.findItem(R.id.add_dialog_action_button) - - // Main "pages" - subscribeView = view.findViewById(R.id.add_dialog_subscribe_view) - subscribeView.visibility = View.VISIBLE - loginView = view.findViewById(R.id.add_dialog_login_view) - loginView.visibility = View.GONE - - // Fields for "subscribe page" - subscribeTopicText = view.findViewById(R.id.add_dialog_subscribe_topic_text) - subscribeBaseUrlLayout = view.findViewById(R.id.add_dialog_subscribe_base_url_layout) - subscribeBaseUrlLayout.background = view.background - subscribeBaseUrlLayout.makeEndIconSmaller(resources) // Hack! - subscribeBaseUrlText = view.findViewById(R.id.add_dialog_subscribe_base_url_text) - subscribeBaseUrlText.background = view.background - subscribeBaseUrlText.hint = defaultBaseUrl ?: appBaseUrl - subscribeInstantDeliveryBox = view.findViewById(R.id.add_dialog_subscribe_instant_delivery_box) - subscribeInstantDeliveryCheckbox = view.findViewById(R.id.add_dialog_subscribe_instant_delivery_checkbox) - subscribeInstantDeliveryDescription = view.findViewById(R.id.add_dialog_subscribe_instant_delivery_description) - subscribeUseAnotherServerCheckbox = view.findViewById(R.id.add_dialog_subscribe_use_another_server_checkbox) - subscribeUseAnotherServerDescription = view.findViewById(R.id.add_dialog_subscribe_use_another_server_description) - subscribeForegroundDescription = view.findViewById(R.id.add_dialog_subscribe_foreground_description) - subscribeProgress = view.findViewById(R.id.add_dialog_subscribe_progress) - subscribeErrorText = view.findViewById(R.id.add_dialog_subscribe_error_text) - subscribeErrorText.visibility = View.GONE - subscribeErrorTextImage = view.findViewById(R.id.add_dialog_subscribe_error_text_image) - subscribeErrorTextImage.visibility = View.GONE - - // Fields for "login page" - loginUsernameText = view.findViewById(R.id.add_dialog_login_username) - loginPasswordText = view.findViewById(R.id.add_dialog_login_password) - loginProgress = view.findViewById(R.id.add_dialog_login_progress) - loginErrorText = view.findViewById(R.id.add_dialog_login_error_text) - loginErrorTextImage = view.findViewById(R.id.add_dialog_login_error_text_image) - - // Set foreground description text - subscribeForegroundDescription.text = getString(R.string.add_dialog_foreground_description, shortUrl(appBaseUrl)) - - // Hide instant delivery UI (no Firebase) - subscribeInstantDeliveryBox.visibility = View.GONE - - // Add baseUrl auto-complete behavior - lifecycleScope.launch(Dispatchers.IO) { - val baseUrlsRaw = repository.getSubscriptions() - .groupBy { it.baseUrl } - .map { it.key } - .filterNot { it == appBaseUrl } - val baseUrls = if (defaultBaseUrl != null) { - (baseUrlsRaw.filterNot { it == defaultBaseUrl } + appBaseUrl).sorted() - } else { - baseUrlsRaw.sorted() - } - val activity = activity ?: return@launch // We may have pressed "Cancel" - activity.runOnUiThread { - initBaseUrlDropdown(baseUrls, subscribeBaseUrlText, subscribeBaseUrlLayout) - } - } - - // Subscribe view validation - val subscribeTextWatcher = AfterChangedTextWatcher { - validateInputSubscribeView() - } - subscribeTopicText.addTextChangedListener(subscribeTextWatcher) - subscribeBaseUrlText.addTextChangedListener(subscribeTextWatcher) - subscribeInstantDeliveryCheckbox.setOnCheckedChangeListener { _, _ -> - validateInputSubscribeView() - } - subscribeUseAnotherServerCheckbox.setOnCheckedChangeListener { _, _ -> - validateInputSubscribeView() - } - - // Username/password validation on type - val loginTextWatcher = AfterChangedTextWatcher { - validateInputLoginView() - } - loginUsernameText.addTextChangedListener(loginTextWatcher) - loginPasswordText.addTextChangedListener(loginTextWatcher) - - // Build dialog - val dialog = Dialog(requireContext(), R.style.Theme_App_FullScreenDialog) - dialog.setContentView(view) - - // Initial validation - validateInputSubscribeView() - - return dialog - } - - override fun onStart() { - super.onStart() - dialog?.window?.apply { - setLayout( - ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.MATCH_PARENT - ) - } - } - - override fun onResume() { - super.onResume() - // Show keyboard after the dialog is fully visible - subscribeTopicText.postDelayed({ - subscribeTopicText.requestFocus() - val imm = requireContext().getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager - imm?.showSoftInput(subscribeTopicText, InputMethodManager.SHOW_IMPLICIT) - }, 200) - } - - private fun onActionButtonClick() { - val topic = subscribeTopicText.text.toString() - val baseUrl = getBaseUrl() - if (subscribeView.isVisible) { - checkReadAndMaybeShowLogin(baseUrl, topic) - } else if (loginView.isVisible) { - loginAndMaybeDismiss(baseUrl, topic) - } - } - - private fun checkReadAndMaybeShowLogin(baseUrl: String, topic: String) { - subscribeProgress.visibility = View.VISIBLE - subscribeErrorText.visibility = View.GONE - subscribeErrorTextImage.visibility = View.GONE - enableSubscribeView(false) - lifecycleScope.launch(Dispatchers.IO) { - try { - val authorized = api.checkAuth(baseUrl, topic) - if (authorized) { - Log.d(TAG, "Access granted to topic ${topicUrl(baseUrl, topic)}") - dismissDialog() - } else { - Log.w(TAG, "Access not allowed to topic ${topicUrl(baseUrl, topic)}, showing login dialog") - val activity = activity ?: return@launch // We may have pressed "Cancel" - activity.runOnUiThread { - showLoginView(activity) - } - } - } catch (e: Exception) { - Log.w(TAG, "Connection to topic failed: ${e.message}", e) - - // If this is an SSL certificate error, show the trust cert dialog - // Never show the dialog for the app base URL - if (isSSLException(e) && baseUrl != appBaseUrl) { - Log.d(TAG, "SSL certificate error detected, attempting to fetch certificate for user review") - handleSSLException(baseUrl) - } else { - showErrorAndReenableSubscribeView(e.message) - } - } - } - } - - private fun isSSLException(e: Exception): Boolean { - var cause: Throwable? = e - while (cause != null) { - if (cause is SSLHandshakeException || cause is SSLPeerUnverifiedException || cause is CertificateException) { - return true - } - cause = cause.cause - } - return false - } - - private fun handleSSLException(baseUrl: String) { - // Try to fetch the server's certificate - val activity = activity ?: return - val certUtil = CertUtil.getInstance(requireContext()) - val certificate = certUtil.fetchServerCertificate(baseUrl) - activity.runOnUiThread { - if (certificate != null) { - showCertificateTrustDialog(baseUrl, certificate) - } else { - // Could not fetch certificate, show generic SSL error - showErrorAndReenableSubscribeView(getString(R.string.add_dialog_error_ssl_untrusted)) - } - } - } - - private fun showCertificateTrustDialog(baseUrl: String, certificate: X509Certificate) { - subscribeProgress.visibility = View.GONE - enableSubscribeView(true) - showErrorAndReenableSubscribeView(getString(R.string.add_dialog_error_ssl_untrusted)) - } - - private fun showErrorAndReenableSubscribeView(message: String?) { - val activity = activity ?: return // We may have pressed "Cancel" - activity.runOnUiThread { - subscribeProgress.visibility = View.GONE - subscribeErrorText.visibility = View.VISIBLE - subscribeErrorText.text = message - subscribeErrorTextImage.visibility = View.VISIBLE - enableSubscribeView(true) - } - } - - private fun loginAndMaybeDismiss(baseUrl: String, topic: String) { - loginProgress.visibility = View.VISIBLE - loginErrorText.visibility = View.GONE - loginErrorTextImage.visibility = View.GONE - enableLoginView(false) - val username = loginUsernameText.text.toString() - val password = loginPasswordText.text.toString() - lifecycleScope.launch(Dispatchers.IO) { - Log.d(TAG, "Checking read access for user $username to topic ${topicUrl(baseUrl, topic)}") - try { - val authorized = api.checkAuth(baseUrl, topic) - if (authorized) { - Log.d(TAG, "Access granted for user $username to topic ${topicUrl(baseUrl, topic)}") - dismissDialog() - } else { - Log.w(TAG, "Access not allowed for user $username to topic ${topicUrl(baseUrl, topic)}") - showErrorAndReenableLoginView(getString(R.string.add_dialog_login_error_not_authorized, username)) - } - } catch (e: Exception) { - Log.w(TAG, "Connection to topic failed during login: ${e.message}", e) - showErrorAndReenableLoginView(e.message) - } - } - } - - private fun showErrorAndReenableLoginView(message: String?) { - val activity = activity ?: return // We may have pressed "Cancel" - activity.runOnUiThread { - loginProgress.visibility = View.GONE - loginErrorText.visibility = View.VISIBLE - loginErrorText.text = message - loginErrorTextImage.visibility = View.VISIBLE - enableLoginView(true) - } - } - - private fun validateInputSubscribeView() { - if (!this::actionMenuItem.isInitialized) return // As per crash seen in Google Play - - // Show/hide server selection UI - if (subscribeUseAnotherServerCheckbox.isChecked) { - subscribeUseAnotherServerDescription.visibility = View.VISIBLE - subscribeBaseUrlLayout.visibility = View.VISIBLE - } else { - subscribeUseAnotherServerDescription.visibility = View.GONE - subscribeBaseUrlLayout.visibility = View.GONE - } - - // Enable/disable "Subscribe" button - lifecycleScope.launch(Dispatchers.IO) { - val baseUrl = getBaseUrl() - val topic = subscribeTopicText.text.toString() - val subscription = repository.getSubscription(baseUrl, topic) - - activity?.let { - it.runOnUiThread { - if (subscription != null || DISALLOWED_TOPICS.contains(topic)) { - actionMenuItem.isEnabled = false - } else if (subscribeUseAnotherServerCheckbox.isChecked) { - actionMenuItem.isEnabled = validTopic(topic) && validUrl(baseUrl) - } else { - actionMenuItem.isEnabled = validTopic(topic) - } - } - } - } - } - - private fun validateInputLoginView() { - if (!this::actionMenuItem.isInitialized || !this::loginUsernameText.isInitialized || !this::loginPasswordText.isInitialized) { - return // As per crash seen in Google Play - } - if (loginUsernameText.isGone) { - actionMenuItem.isEnabled = true - } else { - actionMenuItem.isEnabled = (loginUsernameText.text?.isNotEmpty() ?: false) - && (loginPasswordText.text?.isNotEmpty() ?: false) - } - } - - private fun dismissDialog() { - Log.d(TAG, "Closing dialog and calling onSubscribe handler") - val activity = activity?: return // We may have pressed "Cancel" - activity.runOnUiThread { - val baseUrl = getBaseUrl() - val topic = subscribeTopicText.text.toString() - val instant = true // Always use foreground service (no Firebase) - subscribeListener.onSubscribe(topic, baseUrl, instant) - dialog?.dismiss() - } - } - - private fun getBaseUrl(): String { - return if (subscribeUseAnotherServerCheckbox.isChecked) { - subscribeBaseUrlText.text.toString() - } else { - return defaultBaseUrl ?: appBaseUrl - } - } - - private fun showSubscribeView() { - resetSubscribeView() - toolbar.setTitle(R.string.add_dialog_title) - actionMenuItem.setTitle(R.string.add_dialog_button_subscribe) - toolbar.setNavigationOnClickListener { - dismiss() - } - loginView.visibility = View.GONE - subscribeView.visibility = View.VISIBLE - if (subscribeTopicText.requestFocus()) { - val imm = activity?.getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager - imm?.showSoftInput(subscribeTopicText, InputMethodManager.SHOW_IMPLICIT) - } - } - - private fun showLoginView(activity: Activity) { - resetLoginView() - loginProgress.visibility = View.INVISIBLE - toolbar.setTitle(R.string.add_dialog_login_title) - actionMenuItem.setTitle(R.string.add_dialog_button_login) - toolbar.setNavigationOnClickListener { - showSubscribeView() - } - subscribeView.visibility = View.GONE - loginView.visibility = View.VISIBLE - if (loginUsernameText.requestFocus()) { - val imm = activity.getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager - imm?.showSoftInput(loginUsernameText, InputMethodManager.SHOW_IMPLICIT) - } - } - - private fun enableSubscribeView(enable: Boolean) { - subscribeTopicText.isEnabled = enable - subscribeBaseUrlText.isEnabled = enable - subscribeInstantDeliveryCheckbox.isEnabled = enable - subscribeUseAnotherServerCheckbox.isEnabled = enable - actionMenuItem.isEnabled = enable - } - - private fun resetSubscribeView() { - subscribeProgress.visibility = View.GONE - subscribeErrorText.visibility = View.GONE - subscribeErrorTextImage.visibility = View.GONE - enableSubscribeView(true) - } - - private fun enableLoginView(enable: Boolean) { - loginUsernameText.isEnabled = enable - loginPasswordText.isEnabled = enable - actionMenuItem.isEnabled = enable - if (enable && loginUsernameText.requestFocus()) { - val imm = activity?.getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager - imm?.showSoftInput(loginUsernameText, InputMethodManager.SHOW_IMPLICIT) - } - } - - private fun resetLoginView() { - loginProgress.visibility = View.GONE - loginErrorText.visibility = View.GONE - loginErrorTextImage.visibility = View.GONE - loginUsernameText.visibility = View.VISIBLE - loginUsernameText.text?.clear() - loginPasswordText.visibility = View.VISIBLE - loginPasswordText.text?.clear() - enableLoginView(true) - } - - companion object { - const val TAG = "NtfyAddFragment" - private val DISALLOWED_TOPICS = listOf("docs", "static", "file") // If updated, also update in server - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/ui/BaseUrl.kt b/android/app/src/main/java/com/lonecloud/sup/ui/BaseUrl.kt deleted file mode 100644 index 5cc5e51..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/ui/BaseUrl.kt +++ /dev/null @@ -1,68 +0,0 @@ -package com.lonecloud.sup.ui - -import android.text.Editable -import android.text.TextWatcher -import android.widget.ArrayAdapter -import android.widget.AutoCompleteTextView -import com.google.android.material.textfield.TextInputLayout -import com.lonecloud.sup.R - -fun initBaseUrlDropdown(baseUrls: List, textView: AutoCompleteTextView, layout: TextInputLayout) { - // Base URL dropdown behavior; Oh my, why is this so complicated?! - val context = layout.context - val toggleEndIcon = { - if (textView.text.isNotEmpty()) { - layout.setEndIconDrawable(R.drawable.ic_cancel_gray_24dp) - layout.endIconContentDescription = context.getString(R.string.add_dialog_base_urls_dropdown_clear) - } else if (baseUrls.isEmpty()) { - layout.setEndIconDrawable(0) - layout.endIconContentDescription = "" - } else { - layout.setEndIconDrawable(R.drawable.ic_drop_down_gray_24dp) - layout.endIconContentDescription = context.getString(R.string.add_dialog_base_urls_dropdown_choose) - } - } - layout.setEndIconOnClickListener { - if (textView.text.isNotEmpty()) { - textView.text.clear() - if (baseUrls.isEmpty()) { - layout.setEndIconDrawable(0) - layout.endIconContentDescription = "" - } else { - layout.setEndIconDrawable(R.drawable.ic_drop_down_gray_24dp) - layout.endIconContentDescription = context.getString(R.string.add_dialog_base_urls_dropdown_choose) - } - } else if (textView.text.isEmpty() && baseUrls.isNotEmpty()) { - layout.setEndIconDrawable(R.drawable.ic_drop_up_gray_24dp) - layout.endIconContentDescription = context.getString(R.string.add_dialog_base_urls_dropdown_choose) - textView.showDropDown() - } - } - textView.setOnDismissListener { toggleEndIcon() } - textView.addTextChangedListener(object : TextWatcher { - override fun afterTextChanged(s: Editable?) { - toggleEndIcon() - } - override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { - // Nothing - } - override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { - // Nothing - } - }) - - val adapter = ArrayAdapter(textView.context, R.layout.fragment_add_dialog_dropdown_item, baseUrls) - textView.threshold = 1 - textView.setAdapter(adapter) - if (baseUrls.count() == 1) { - layout.setEndIconDrawable(R.drawable.ic_cancel_gray_24dp) - layout.endIconContentDescription = context.getString(R.string.add_dialog_base_urls_dropdown_clear) - textView.setText(baseUrls.first()) - } else if (baseUrls.count() > 1) { - layout.setEndIconDrawable(R.drawable.ic_drop_down_gray_24dp) - layout.endIconContentDescription = context.getString(R.string.add_dialog_base_urls_dropdown_choose) - } else { - layout.setEndIconDrawable(0) - layout.endIconContentDescription = "" - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/ui/Colors.kt b/android/app/src/main/java/com/lonecloud/sup/ui/Colors.kt deleted file mode 100644 index 00ce6c5..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/ui/Colors.kt +++ /dev/null @@ -1,86 +0,0 @@ -package com.lonecloud.sup.ui - -import android.content.Context -import android.graphics.Color -import androidx.core.content.ContextCompat -import com.google.android.material.color.MaterialColors -import com.lonecloud.sup.R -import com.lonecloud.sup.util.isDarkThemeOn - -class Colors { - companion object { - fun primary(context: Context): Int { - return MaterialColors.getColor(context, android.R.attr.colorPrimary, Color.GREEN) - } - - fun onPrimary(context: Context): Int { - return MaterialColors.getColor(context, com.google.android.material.R.attr.colorOnPrimary, Color.GREEN) - } - - fun notificationIcon(context: Context): Int { - return MaterialColors.getColor(context, android.R.attr.colorPrimary, Color.GREEN) - } - - fun linkColor(context: Context): Int { - return MaterialColors.getColor(context, android.R.attr.colorPrimary, Color.GREEN) - } - - fun itemSelectedBackground(context: Context): Int { - return ContextCompat.getColor(context, R.color.md_theme_surfaceContainerHigh) - } - - fun cardBackgroundColor(context: Context): Int { - return if (isDarkThemeOn(context)) { - MaterialColors.getColor(context, com.google.android.material.R.attr.colorSurfaceContainer, Color.GRAY) - } else { - MaterialColors.getColor(context, com.google.android.material.R.attr.colorSurface, Color.WHITE) - } - } - - fun cardSelectedBackgroundColor(context: Context): Int { - return if (isDarkThemeOn(context)) { - MaterialColors.getColor(context, com.google.android.material.R.attr.colorSurfaceContainerHigh, Color.GRAY) - } else { - MaterialColors.getColor(context, com.google.android.material.R.attr.colorSurfaceContainerHighest, Color.GRAY) - } - } - - fun statusBarNormal(context: Context, dynamicColors: Boolean, darkMode: Boolean): Int { - val default = context.resources.getColor(R.color.action_bar, null) - return if (dynamicColors) { - // Use colorSurface for both light and dark mode when dynamic colors are enabled - MaterialColors.getColor(context, com.google.android.material.R.attr.colorSurface, default) - } else { - default - } - } - - fun shouldUseLightStatusBar(dynamicColors: Boolean, darkMode: Boolean): Boolean { - // Use light status bar (dark icons) when dynamic colors are enabled in light mode - return dynamicColors && !darkMode - } - - fun toolbarTextColor(context: Context, dynamicColors: Boolean, darkMode: Boolean): Int { - return if (dynamicColors) { - // Use colorOnSurface (dark on light, light on dark) when dynamic colors are enabled - MaterialColors.getColor(context, com.google.android.material.R.attr.colorOnSurface, Color.BLACK) - } else { - if (darkMode) { - // In dark mode, toolbar is gray (surfaceContainer), so use light text - MaterialColors.getColor(context, com.google.android.material.R.attr.colorOnSurface, Color.WHITE) - } else { - // In light mode, toolbar is teal (primary), so use white text - MaterialColors.getColor(context, com.google.android.material.R.attr.colorOnPrimary, Color.WHITE) - } - } - } - - fun dangerText(context: Context): Int { - return ContextCompat.getColor(context, android.R.color.holo_red_dark) - } - - fun swipeToRefreshColor(context: Context): Int { - return MaterialColors.getColor(context, android.R.attr.colorPrimary, Color.GREEN) - } - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/ui/DetailViewModel.kt b/android/app/src/main/java/com/lonecloud/sup/ui/DetailViewModel.kt deleted file mode 100644 index 44754b6..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/ui/DetailViewModel.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.lonecloud.sup.ui - -import androidx.lifecycle.LiveData -import androidx.lifecycle.ViewModel -import androidx.lifecycle.ViewModelProvider -import androidx.lifecycle.viewModelScope -import com.lonecloud.sup.db.Notification -import com.lonecloud.sup.db.Repository -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.launch - -class DetailViewModel(private val repository: Repository) : ViewModel() { - fun list(subscriptionId: Long): LiveData> { - return repository.getNotificationsLiveData(subscriptionId) - } - - fun markAsDeleted(notificationId: String) = viewModelScope.launch(Dispatchers.IO) { - repository.markAsDeleted(notificationId) - } -} - -class DetailViewModelFactory(private val repository: Repository) : ViewModelProvider.Factory { - @Suppress("UNCHECKED_CAST") - override fun create(modelClass: Class): T = - with(modelClass){ - when { - isAssignableFrom(DetailViewModel::class.java) -> DetailViewModel(repository) as T - else -> throw IllegalArgumentException("Unknown viewModel class $modelClass") - } - } -} diff --git a/android/app/src/main/java/com/lonecloud/sup/ui/MainActivity.kt b/android/app/src/main/java/com/lonecloud/sup/ui/MainActivity.kt deleted file mode 100644 index a7f1238..0000000 --- a/android/app/src/main/java/com/lonecloud/sup/ui/MainActivity.kt +++ /dev/null @@ -1,652 +0,0 @@ -package com.lonecloud.sup.ui - -import android.Manifest -import android.animation.Animator -import android.animation.AnimatorListenerAdapter -import android.app.AlarmManager -import android.app.AlertDialog -import android.content.ActivityNotFoundException -import android.content.Intent -import android.content.pm.PackageManager -import android.os.Build -import android.os.Bundle -import android.provider.Settings -import android.provider.Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM -import android.text.method.LinkMovementMethod -import android.view.Menu -import android.view.MenuItem -import android.view.View -import android.widget.Button -import android.widget.TextView -import android.widget.Toast -import androidx.activity.enableEdgeToEdge -import androidx.activity.viewModels -import androidx.appcompat.app.AppCompatActivity -import androidx.appcompat.app.AppCompatDelegate -import androidx.appcompat.view.ActionMode -import androidx.core.app.ActivityCompat -import androidx.core.content.ContextCompat -import androidx.core.content.res.ResourcesCompat -import androidx.core.text.HtmlCompat -import androidx.core.view.ViewCompat -import androidx.core.view.WindowInsetsCompat -import androidx.core.view.WindowInsetsControllerCompat -import androidx.core.view.updatePadding -import androidx.core.view.isVisible -import androidx.lifecycle.lifecycleScope -import androidx.recyclerview.widget.RecyclerView -import com.google.android.material.appbar.AppBarLayout -import com.google.android.material.dialog.MaterialAlertDialogBuilder -import com.google.android.material.floatingactionbutton.FloatingActionButton -import com.lonecloud.sup.BuildConfig -import com.lonecloud.sup.R -import com.lonecloud.sup.app.Application -import com.lonecloud.sup.db.Repository -import com.lonecloud.sup.db.Subscription -import com.lonecloud.sup.msg.ApiService -import com.lonecloud.sup.msg.NotificationDispatcher -import com.lonecloud.sup.util.Log -import com.lonecloud.sup.util.dangerButton -import com.lonecloud.sup.util.displayName -import com.lonecloud.sup.util.formatDateShort -import com.lonecloud.sup.util.isDarkThemeOn -import com.lonecloud.sup.util.isIgnoringBatteryOptimizations -import com.lonecloud.sup.util.maybeSplitTopicUrl -import com.lonecloud.sup.util.randomSubscriptionId -import com.lonecloud.sup.util.shortUrl -import com.lonecloud.sup.util.topicShortUrl -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.delay -import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext -import kotlinx.coroutines.isActive -import java.util.Date -import java.util.concurrent.TimeUnit -import kotlin.random.Random -import androidx.core.view.size -import androidx.core.view.get -import androidx.core.net.toUri - -class MainActivity : AppCompatActivity(), AddFragment.SubscribeListener { - private val viewModel by viewModels { - SubscriptionsViewModelFactory((application as Application).repository) - } - private val repository by lazy { (application as Application).repository } - private val api by lazy { ApiService(this) } - - // UI elements - private lateinit var menu: Menu - private lateinit var mainList: RecyclerView - private lateinit var adapter: MainAdapter - private lateinit var fab: FloatingActionButton - - // Other stuff - private var dispatcher: NotificationDispatcher? = null // Context-dependent - private var appBaseUrl: String? = null // Context-dependent - - // Action mode stuff - private var actionMode: ActionMode? = null - private val actionModeCallback = object : ActionMode.Callback { - override fun onCreateActionMode(mode: ActionMode?, menu: Menu?): Boolean { - actionMode = mode - if (mode != null) { - mode.menuInflater.inflate(R.menu.menu_main_action_mode, menu) - mode.title = "1" // One item selected - } - return true - } - - override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?) = false - - override fun onActionItemClicked(mode: ActionMode?, item: MenuItem): Boolean { - return when (item.itemId) { - R.id.main_action_mode_delete -> { - onMultiDeleteClick() - true - } - else -> false - } - } - - override fun onDestroyActionMode(mode: ActionMode?) { - endActionModeAndRedraw() - } - } - - override fun onCreate(savedInstanceState: Bundle?) { - enableEdgeToEdge() - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - - Log.init(this) // Init logs in all entry points - Log.d(TAG, "Create $this") - - // Dependencies that depend on Context - dispatcher = NotificationDispatcher(this, repository) - appBaseUrl = getString(R.string.app_base_url) - - // Action bar - val toolbarLayout = findViewById(R.id.app_bar_drawer) - val dynamicColors = repository.getDynamicColorsEnabled() - val darkMode = isDarkThemeOn(this) - val statusBarColor = Colors.statusBarNormal(this, dynamicColors, darkMode) - val toolbarTextColor = Colors.toolbarTextColor(this, dynamicColors, darkMode) - toolbarLayout.setBackgroundColor(statusBarColor) - - val toolbar = toolbarLayout.findViewById(R.id.toolbar) - toolbar.setTitleTextColor(toolbarTextColor) - toolbar.setNavigationIconTint(toolbarTextColor) - toolbar.overflowIcon?.setTint(toolbarTextColor) - setSupportActionBar(toolbar) - title = getString(R.string.main_action_bar_title) - - // Set system status bar appearance - WindowInsetsControllerCompat(window, window.decorView).isAppearanceLightStatusBars = - Colors.shouldUseLightStatusBar(dynamicColors, darkMode) - - // Floating action button ("+") - fab = findViewById(R.id.fab) - fab.setOnClickListener { - onSubscribeButtonClick() - } - - // Add bottom padding to FAB to account for navigation bar - ViewCompat.setOnApplyWindowInsetsListener(fab) { view, insets -> - val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) - val layoutParams = view.layoutParams as androidx.constraintlayout.widget.ConstraintLayout.LayoutParams - layoutParams.bottomMargin = systemBars.bottom - view.layoutParams = layoutParams - insets - } - - // Update main list based on viewModel (& its datasource/livedata) - val noEntries: View = findViewById(R.id.main_no_subscriptions) - val onSubscriptionClick = { s: Subscription -> onSubscriptionItemClick(s) } - val onSubscriptionLongClick = { s: Subscription -> onSubscriptionItemLongClick(s) } - - mainList = findViewById(R.id.main_subscriptions_list) - adapter = MainAdapter( - repository, - onSubscriptionClick, - onSubscriptionLongClick, - ResourcesCompat.getDrawable(resources, R.drawable.ic_circle, theme)!!.apply { - setTint(Colors.primary(this@MainActivity)) - }, - Colors.onPrimary(this) - ) - mainList.adapter = adapter - - // Apply window insets to ensure content is not covered by navigation bar - mainList.clipToPadding = false - ViewCompat.setOnApplyWindowInsetsListener(mainList) { v, insets -> - val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) - v.updatePadding(bottom = systemBars.bottom) - insets - } - - viewModel.list().observe(this) { - it?.let { subscriptions -> - // Update main list - adapter.submitList(subscriptions as MutableList) - if (it.isEmpty()) { - mainList.visibility = View.GONE - noEntries.visibility = View.VISIBLE - } else { - mainList.visibility = View.VISIBLE - noEntries.visibility = View.GONE - } - - // Add scrub terms to log (in case it gets exported) - subscriptions.forEach { s -> - Log.addScrubTerm(shortUrl(s.baseUrl), Log.TermType.Domain) - Log.addScrubTerm(s.topic) - } - - // Update battery banner - showHideBatteryBanner(subscriptions) - } - } - - - // Scrub terms for last topics // FIXME this should be in Log.getFormatted - repository.getLastShareTopics().forEach { topicUrl -> - maybeSplitTopicUrl(topicUrl)?.let { - Log.addScrubTerm(shortUrl(it.first), Log.TermType.Domain) - Log.addScrubTerm(shortUrl(it.second), Log.TermType.Term) - } - } - - // React to changes in instant delivery setting - viewModel.listIdsWithInstantStatus().observe(this) { - // Signal pushes to us, no service to refresh - } - - // Observe connection details and update menu item visibility - repository.getConnectionDetailsLiveData().observe(this) { details -> - showHideConnectionErrorMenuItem(details) - } - - // Battery banner - val batteryBanner = findViewById(R.id.main_banner_battery) // Banner visibility is toggled in onResume() - val dontAskAgainButton = findViewById