From 8fcef8ddeebce0b2e39b6edfe497f50f4ff37931 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Tue, 18 Jan 2022 14:28:48 -0500 Subject: [PATCH] Rename database namespace --- app/schemas/io.heckel.ntfy.db.Database/7.json | 256 ++++++++++++++++++ .../java/io/heckel/ntfy/app/Application.kt | 4 +- .../io/heckel/ntfy/{data => db}/Database.kt | 2 +- .../io/heckel/ntfy/{data => db}/Repository.kt | 2 +- app/src/main/java/io/heckel/ntfy/log/Log.kt | 6 +- .../java/io/heckel/ntfy/msg/ApiService.kt | 2 +- .../io/heckel/ntfy/msg/BroadcastService.kt | 4 +- .../java/io/heckel/ntfy/msg/DownloadWorker.kt | 2 +- .../heckel/ntfy/msg/NotificationDispatcher.kt | 6 +- .../io/heckel/ntfy/msg/NotificationParser.kt | 4 +- .../io/heckel/ntfy/msg/NotificationService.kt | 4 +- .../io/heckel/ntfy/service/JsonConnection.kt | 8 +- .../heckel/ntfy/service/SubscriberService.kt | 8 +- .../io/heckel/ntfy/service/WsConnection.kt | 8 +- .../java/io/heckel/ntfy/ui/AddFragment.kt | 2 +- .../java/io/heckel/ntfy/ui/DetailActivity.kt | 2 +- .../java/io/heckel/ntfy/ui/DetailAdapter.kt | 2 +- .../java/io/heckel/ntfy/ui/DetailViewModel.kt | 4 +- .../java/io/heckel/ntfy/ui/MainActivity.kt | 2 +- .../java/io/heckel/ntfy/ui/MainAdapter.kt | 6 +- .../java/io/heckel/ntfy/ui/MainViewModel.kt | 2 +- .../io/heckel/ntfy/ui/NotificationFragment.kt | 4 +- .../io/heckel/ntfy/ui/SettingsActivity.kt | 2 +- .../io/heckel/ntfy/up/BroadcastReceiver.kt | 2 +- app/src/main/java/io/heckel/ntfy/util/Util.kt | 4 +- .../java/io/heckel/ntfy/work/PollWorker.kt | 4 +- .../heckel/ntfy/firebase/FirebaseService.kt | 9 +- .../metadata/android/en-US/changelog/17.txt | 7 + 28 files changed, 316 insertions(+), 52 deletions(-) create mode 100644 app/schemas/io.heckel.ntfy.db.Database/7.json rename app/src/main/java/io/heckel/ntfy/{data => db}/Database.kt (99%) rename app/src/main/java/io/heckel/ntfy/{data => db}/Repository.kt (99%) create mode 100644 fastlane/metadata/android/en-US/changelog/17.txt diff --git a/app/schemas/io.heckel.ntfy.db.Database/7.json b/app/schemas/io.heckel.ntfy.db.Database/7.json new file mode 100644 index 0000000..096ca25 --- /dev/null +++ b/app/schemas/io.heckel.ntfy.db.Database/7.json @@ -0,0 +1,256 @@ +{ + "formatVersion": 1, + "database": { + "version": 7, + "identityHash": "ecb1b85b2ae822dc62b2843620368477", + "entities": [ + { + "tableName": "Subscription", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `baseUrl` TEXT NOT NULL, `topic` TEXT NOT NULL, `instant` INTEGER NOT NULL, `mutedUntil` INTEGER NOT NULL, `upAppId` TEXT, `upConnectorToken` 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": "instant", + "columnName": "instant", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "mutedUntil", + "columnName": "mutedUntil", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "upAppId", + "columnName": "upAppId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "upConnectorToken", + "columnName": "upConnectorToken", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "index_Subscription_baseUrl_topic", + "unique": true, + "columnNames": [ + "baseUrl", + "topic" + ], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_Subscription_baseUrl_topic` ON `${TABLE_NAME}` (`baseUrl`, `topic`)" + }, + { + "name": "index_Subscription_upConnectorToken", + "unique": true, + "columnNames": [ + "upConnectorToken" + ], + "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, `click` TEXT NOT NULL, `deleted` INTEGER NOT NULL, `attachment_name` TEXT, `attachment_type` TEXT, `attachment_size` INTEGER, `attachment_expires` INTEGER, `attachment_url` TEXT, `attachment_contentUri` TEXT, `attachment_progress` INTEGER, 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": "click", + "columnName": "click", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "deleted", + "columnName": "deleted", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "attachment.name", + "columnName": "attachment_name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "attachment.type", + "columnName": "attachment_type", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "attachment.size", + "columnName": "attachment_size", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "attachment.expires", + "columnName": "attachment_expires", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "attachment.url", + "columnName": "attachment_url", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "attachment.contentUri", + "columnName": "attachment_contentUri", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "attachment.progress", + "columnName": "attachment_progress", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id", + "subscriptionId" + ], + "autoGenerate": false + }, + "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": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "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, 'ecb1b85b2ae822dc62b2843620368477')" + ] + } +} \ No newline at end of file diff --git a/app/src/main/java/io/heckel/ntfy/app/Application.kt b/app/src/main/java/io/heckel/ntfy/app/Application.kt index 7d24470..95e3fd3 100644 --- a/app/src/main/java/io/heckel/ntfy/app/Application.kt +++ b/app/src/main/java/io/heckel/ntfy/app/Application.kt @@ -2,8 +2,8 @@ package io.heckel.ntfy.app import android.app.Application import android.content.Context -import io.heckel.ntfy.data.Database -import io.heckel.ntfy.data.Repository +import io.heckel.ntfy.db.Database +import io.heckel.ntfy.db.Repository import io.heckel.ntfy.log.Log class Application : Application() { diff --git a/app/src/main/java/io/heckel/ntfy/data/Database.kt b/app/src/main/java/io/heckel/ntfy/db/Database.kt similarity index 99% rename from app/src/main/java/io/heckel/ntfy/data/Database.kt rename to app/src/main/java/io/heckel/ntfy/db/Database.kt index 10a81f6..94aa942 100644 --- a/app/src/main/java/io/heckel/ntfy/data/Database.kt +++ b/app/src/main/java/io/heckel/ntfy/db/Database.kt @@ -1,4 +1,4 @@ -package io.heckel.ntfy.data +package io.heckel.ntfy.db import android.content.Context import androidx.room.* diff --git a/app/src/main/java/io/heckel/ntfy/data/Repository.kt b/app/src/main/java/io/heckel/ntfy/db/Repository.kt similarity index 99% rename from app/src/main/java/io/heckel/ntfy/data/Repository.kt rename to app/src/main/java/io/heckel/ntfy/db/Repository.kt index 144f690..bf3f0c1 100644 --- a/app/src/main/java/io/heckel/ntfy/data/Repository.kt +++ b/app/src/main/java/io/heckel/ntfy/db/Repository.kt @@ -1,4 +1,4 @@ -package io.heckel.ntfy.data +package io.heckel.ntfy.db import android.app.Activity import android.content.Context diff --git a/app/src/main/java/io/heckel/ntfy/log/Log.kt b/app/src/main/java/io/heckel/ntfy/log/Log.kt index f36d037..ce6bfd3 100644 --- a/app/src/main/java/io/heckel/ntfy/log/Log.kt +++ b/app/src/main/java/io/heckel/ntfy/log/Log.kt @@ -1,9 +1,9 @@ package io.heckel.ntfy.log import android.content.Context -import io.heckel.ntfy.data.Database -import io.heckel.ntfy.data.LogDao -import io.heckel.ntfy.data.LogEntry +import io.heckel.ntfy.db.Database +import io.heckel.ntfy.db.LogDao +import io.heckel.ntfy.db.LogEntry import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/heckel/ntfy/msg/ApiService.kt b/app/src/main/java/io/heckel/ntfy/msg/ApiService.kt index f0561a4..5d87215 100644 --- a/app/src/main/java/io/heckel/ntfy/msg/ApiService.kt +++ b/app/src/main/java/io/heckel/ntfy/msg/ApiService.kt @@ -2,7 +2,7 @@ package io.heckel.ntfy.msg import android.os.Build import io.heckel.ntfy.BuildConfig -import io.heckel.ntfy.data.Notification +import io.heckel.ntfy.db.Notification import io.heckel.ntfy.log.Log import io.heckel.ntfy.util.* import okhttp3.* diff --git a/app/src/main/java/io/heckel/ntfy/msg/BroadcastService.kt b/app/src/main/java/io/heckel/ntfy/msg/BroadcastService.kt index 2943b3f..ee35ac5 100644 --- a/app/src/main/java/io/heckel/ntfy/msg/BroadcastService.kt +++ b/app/src/main/java/io/heckel/ntfy/msg/BroadcastService.kt @@ -3,8 +3,8 @@ package io.heckel.ntfy.msg import android.content.Context import android.content.Intent import io.heckel.ntfy.R -import io.heckel.ntfy.data.Notification -import io.heckel.ntfy.data.Subscription +import io.heckel.ntfy.db.Notification +import io.heckel.ntfy.db.Subscription import io.heckel.ntfy.log.Log import io.heckel.ntfy.util.joinTagsMap import io.heckel.ntfy.util.splitTags diff --git a/app/src/main/java/io/heckel/ntfy/msg/DownloadWorker.kt b/app/src/main/java/io/heckel/ntfy/msg/DownloadWorker.kt index eeb2b8f..bd0b050 100644 --- a/app/src/main/java/io/heckel/ntfy/msg/DownloadWorker.kt +++ b/app/src/main/java/io/heckel/ntfy/msg/DownloadWorker.kt @@ -16,7 +16,7 @@ import androidx.work.WorkerParameters import io.heckel.ntfy.BuildConfig import io.heckel.ntfy.R import io.heckel.ntfy.app.Application -import io.heckel.ntfy.data.* +import io.heckel.ntfy.db.* import io.heckel.ntfy.log.Log import io.heckel.ntfy.util.queryFilename import okhttp3.OkHttpClient diff --git a/app/src/main/java/io/heckel/ntfy/msg/NotificationDispatcher.kt b/app/src/main/java/io/heckel/ntfy/msg/NotificationDispatcher.kt index 51b3b04..e1eafdb 100644 --- a/app/src/main/java/io/heckel/ntfy/msg/NotificationDispatcher.kt +++ b/app/src/main/java/io/heckel/ntfy/msg/NotificationDispatcher.kt @@ -1,9 +1,9 @@ package io.heckel.ntfy.msg import android.content.Context -import io.heckel.ntfy.data.Notification -import io.heckel.ntfy.data.Repository -import io.heckel.ntfy.data.Subscription +import io.heckel.ntfy.db.Notification +import io.heckel.ntfy.db.Repository +import io.heckel.ntfy.db.Subscription import io.heckel.ntfy.log.Log import io.heckel.ntfy.up.Distributor import io.heckel.ntfy.util.safeLet diff --git a/app/src/main/java/io/heckel/ntfy/msg/NotificationParser.kt b/app/src/main/java/io/heckel/ntfy/msg/NotificationParser.kt index a44e45a..150b8ca 100644 --- a/app/src/main/java/io/heckel/ntfy/msg/NotificationParser.kt +++ b/app/src/main/java/io/heckel/ntfy/msg/NotificationParser.kt @@ -2,8 +2,8 @@ package io.heckel.ntfy.msg import android.util.Base64 import com.google.gson.Gson -import io.heckel.ntfy.data.Attachment -import io.heckel.ntfy.data.Notification +import io.heckel.ntfy.db.Attachment +import io.heckel.ntfy.db.Notification import io.heckel.ntfy.util.joinTags import io.heckel.ntfy.util.toPriority diff --git a/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt b/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt index 3791a8e..e4f7546 100644 --- a/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt +++ b/app/src/main/java/io/heckel/ntfy/msg/NotificationService.kt @@ -9,8 +9,8 @@ import android.os.Build import androidx.core.app.NotificationCompat import androidx.core.content.ContextCompat import io.heckel.ntfy.R -import io.heckel.ntfy.data.* -import io.heckel.ntfy.data.Notification +import io.heckel.ntfy.db.* +import io.heckel.ntfy.db.Notification import io.heckel.ntfy.log.Log import io.heckel.ntfy.ui.DetailActivity import io.heckel.ntfy.ui.MainActivity diff --git a/app/src/main/java/io/heckel/ntfy/service/JsonConnection.kt b/app/src/main/java/io/heckel/ntfy/service/JsonConnection.kt index 29666fa..b1fa2c7 100644 --- a/app/src/main/java/io/heckel/ntfy/service/JsonConnection.kt +++ b/app/src/main/java/io/heckel/ntfy/service/JsonConnection.kt @@ -1,9 +1,9 @@ package io.heckel.ntfy.service -import io.heckel.ntfy.data.ConnectionState -import io.heckel.ntfy.data.Notification -import io.heckel.ntfy.data.Repository -import io.heckel.ntfy.data.Subscription +import io.heckel.ntfy.db.ConnectionState +import io.heckel.ntfy.db.Notification +import io.heckel.ntfy.db.Repository +import io.heckel.ntfy.db.Subscription import io.heckel.ntfy.log.Log import io.heckel.ntfy.msg.ApiService import io.heckel.ntfy.util.topicUrl diff --git a/app/src/main/java/io/heckel/ntfy/service/SubscriberService.kt b/app/src/main/java/io/heckel/ntfy/service/SubscriberService.kt index 3e41e14..81e7c2d 100644 --- a/app/src/main/java/io/heckel/ntfy/service/SubscriberService.kt +++ b/app/src/main/java/io/heckel/ntfy/service/SubscriberService.kt @@ -13,9 +13,9 @@ import androidx.core.content.ContextCompat import io.heckel.ntfy.BuildConfig import io.heckel.ntfy.R import io.heckel.ntfy.app.Application -import io.heckel.ntfy.data.ConnectionState -import io.heckel.ntfy.data.Repository -import io.heckel.ntfy.data.Subscription +import io.heckel.ntfy.db.ConnectionState +import io.heckel.ntfy.db.Repository +import io.heckel.ntfy.db.Subscription import io.heckel.ntfy.log.Log import io.heckel.ntfy.msg.ApiService import io.heckel.ntfy.msg.NotificationDispatcher @@ -227,7 +227,7 @@ class SubscriberService : Service() { repository.updateState(subscriptionIds, state) } - private fun onNotificationReceived(subscription: Subscription, notification: io.heckel.ntfy.data.Notification) { + private fun onNotificationReceived(subscription: Subscription, notification: io.heckel.ntfy.db.Notification) { // If permanent wakelock is not enabled, still take the wakelock while notifications are being dispatched if (!repository.getWakelockEnabled()) { // Wakelocks are reference counted by default so that should work neatly here diff --git a/app/src/main/java/io/heckel/ntfy/service/WsConnection.kt b/app/src/main/java/io/heckel/ntfy/service/WsConnection.kt index 2c937c3..9ea00a5 100644 --- a/app/src/main/java/io/heckel/ntfy/service/WsConnection.kt +++ b/app/src/main/java/io/heckel/ntfy/service/WsConnection.kt @@ -4,10 +4,10 @@ import android.app.AlarmManager import android.os.Build import android.os.Handler import android.os.Looper -import io.heckel.ntfy.data.ConnectionState -import io.heckel.ntfy.data.Notification -import io.heckel.ntfy.data.Repository -import io.heckel.ntfy.data.Subscription +import io.heckel.ntfy.db.ConnectionState +import io.heckel.ntfy.db.Notification +import io.heckel.ntfy.db.Repository +import io.heckel.ntfy.db.Subscription import io.heckel.ntfy.log.Log import io.heckel.ntfy.msg.NotificationParser import io.heckel.ntfy.util.topicUrl diff --git a/app/src/main/java/io/heckel/ntfy/ui/AddFragment.kt b/app/src/main/java/io/heckel/ntfy/ui/AddFragment.kt index e7f726a..ce62a4c 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/AddFragment.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/AddFragment.kt @@ -14,7 +14,7 @@ import com.google.android.material.textfield.TextInputEditText import com.google.android.material.textfield.TextInputLayout import io.heckel.ntfy.BuildConfig import io.heckel.ntfy.R -import io.heckel.ntfy.data.Repository +import io.heckel.ntfy.db.Repository import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt index b44ac0e..186e7c9 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt @@ -21,7 +21,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import io.heckel.ntfy.BuildConfig import io.heckel.ntfy.R import io.heckel.ntfy.app.Application -import io.heckel.ntfy.data.Notification +import io.heckel.ntfy.db.Notification import io.heckel.ntfy.firebase.FirebaseMessenger import io.heckel.ntfy.log.Log import io.heckel.ntfy.msg.ApiService diff --git a/app/src/main/java/io/heckel/ntfy/ui/DetailAdapter.kt b/app/src/main/java/io/heckel/ntfy/ui/DetailAdapter.kt index 84af1ed..84f9426 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/DetailAdapter.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/DetailAdapter.kt @@ -19,7 +19,7 @@ import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView import com.stfalcon.imageviewer.StfalconImageViewer import io.heckel.ntfy.R -import io.heckel.ntfy.data.* +import io.heckel.ntfy.db.* import io.heckel.ntfy.log.Log import io.heckel.ntfy.msg.DownloadManager import io.heckel.ntfy.util.* diff --git a/app/src/main/java/io/heckel/ntfy/ui/DetailViewModel.kt b/app/src/main/java/io/heckel/ntfy/ui/DetailViewModel.kt index effdcd6..c1ac041 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/DetailViewModel.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/DetailViewModel.kt @@ -4,8 +4,8 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.viewModelScope -import io.heckel.ntfy.data.Notification -import io.heckel.ntfy.data.Repository +import io.heckel.ntfy.db.Notification +import io.heckel.ntfy.db.Repository import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt index 31d751c..7d43540 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt @@ -20,7 +20,7 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import androidx.work.* import io.heckel.ntfy.R import io.heckel.ntfy.app.Application -import io.heckel.ntfy.data.Subscription +import io.heckel.ntfy.db.Subscription import io.heckel.ntfy.firebase.FirebaseMessenger import io.heckel.ntfy.log.Log import io.heckel.ntfy.msg.ApiService diff --git a/app/src/main/java/io/heckel/ntfy/ui/MainAdapter.kt b/app/src/main/java/io/heckel/ntfy/ui/MainAdapter.kt index 8aa0928..2e11bc0 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/MainAdapter.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/MainAdapter.kt @@ -10,9 +10,9 @@ import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView import io.heckel.ntfy.BuildConfig import io.heckel.ntfy.R -import io.heckel.ntfy.data.ConnectionState -import io.heckel.ntfy.data.Repository -import io.heckel.ntfy.data.Subscription +import io.heckel.ntfy.db.ConnectionState +import io.heckel.ntfy.db.Repository +import io.heckel.ntfy.db.Subscription import io.heckel.ntfy.util.topicShortUrl import java.text.DateFormat import java.util.* diff --git a/app/src/main/java/io/heckel/ntfy/ui/MainViewModel.kt b/app/src/main/java/io/heckel/ntfy/ui/MainViewModel.kt index 9c24520..a0d17e6 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/MainViewModel.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/MainViewModel.kt @@ -5,7 +5,7 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.viewModelScope -import io.heckel.ntfy.data.* +import io.heckel.ntfy.db.* import io.heckel.ntfy.up.Distributor import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/heckel/ntfy/ui/NotificationFragment.kt b/app/src/main/java/io/heckel/ntfy/ui/NotificationFragment.kt index 987c56d..af1a36f 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/NotificationFragment.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/NotificationFragment.kt @@ -8,8 +8,8 @@ import android.widget.RadioButton import androidx.fragment.app.DialogFragment import androidx.lifecycle.lifecycleScope import io.heckel.ntfy.R -import io.heckel.ntfy.data.Database -import io.heckel.ntfy.data.Repository +import io.heckel.ntfy.db.Database +import io.heckel.ntfy.db.Repository import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.launch diff --git a/app/src/main/java/io/heckel/ntfy/ui/SettingsActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/SettingsActivity.kt index 47221ce..d248798 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/SettingsActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/SettingsActivity.kt @@ -20,7 +20,7 @@ import androidx.preference.* import androidx.preference.Preference.OnPreferenceClickListener import io.heckel.ntfy.BuildConfig import io.heckel.ntfy.R -import io.heckel.ntfy.data.Repository +import io.heckel.ntfy.db.Repository import io.heckel.ntfy.log.Log import io.heckel.ntfy.service.SubscriberService import io.heckel.ntfy.util.formatBytes diff --git a/app/src/main/java/io/heckel/ntfy/up/BroadcastReceiver.kt b/app/src/main/java/io/heckel/ntfy/up/BroadcastReceiver.kt index b704749..9df1c54 100644 --- a/app/src/main/java/io/heckel/ntfy/up/BroadcastReceiver.kt +++ b/app/src/main/java/io/heckel/ntfy/up/BroadcastReceiver.kt @@ -4,7 +4,7 @@ import android.content.Context import android.content.Intent import io.heckel.ntfy.R import io.heckel.ntfy.app.Application -import io.heckel.ntfy.data.Subscription +import io.heckel.ntfy.db.Subscription import io.heckel.ntfy.log.Log import io.heckel.ntfy.service.SubscriberServiceManager import io.heckel.ntfy.util.randomString diff --git a/app/src/main/java/io/heckel/ntfy/util/Util.kt b/app/src/main/java/io/heckel/ntfy/util/Util.kt index 8b6e7e2..8949c7e 100644 --- a/app/src/main/java/io/heckel/ntfy/util/Util.kt +++ b/app/src/main/java/io/heckel/ntfy/util/Util.kt @@ -6,8 +6,8 @@ import android.content.Context import android.net.Uri import android.provider.OpenableColumns import android.view.Window -import io.heckel.ntfy.data.Notification -import io.heckel.ntfy.data.Subscription +import io.heckel.ntfy.db.Notification +import io.heckel.ntfy.db.Subscription import java.security.SecureRandom import java.text.DateFormat import java.text.StringCharacterIterator diff --git a/app/src/main/java/io/heckel/ntfy/work/PollWorker.kt b/app/src/main/java/io/heckel/ntfy/work/PollWorker.kt index 2c680f5..9afd91a 100644 --- a/app/src/main/java/io/heckel/ntfy/work/PollWorker.kt +++ b/app/src/main/java/io/heckel/ntfy/work/PollWorker.kt @@ -4,8 +4,8 @@ import android.content.Context import androidx.work.CoroutineWorker import androidx.work.WorkerParameters import io.heckel.ntfy.BuildConfig -import io.heckel.ntfy.data.Database -import io.heckel.ntfy.data.Repository +import io.heckel.ntfy.db.Database +import io.heckel.ntfy.db.Repository import io.heckel.ntfy.log.Log import io.heckel.ntfy.msg.ApiService import io.heckel.ntfy.msg.NotificationDispatcher diff --git a/app/src/play/java/io/heckel/ntfy/firebase/FirebaseService.kt b/app/src/play/java/io/heckel/ntfy/firebase/FirebaseService.kt index 096b731..57c02df 100644 --- a/app/src/play/java/io/heckel/ntfy/firebase/FirebaseService.kt +++ b/app/src/play/java/io/heckel/ntfy/firebase/FirebaseService.kt @@ -6,11 +6,12 @@ import com.google.firebase.messaging.FirebaseMessagingService import com.google.firebase.messaging.RemoteMessage import io.heckel.ntfy.R import io.heckel.ntfy.app.Application -import io.heckel.ntfy.data.Attachment -import io.heckel.ntfy.data.Notification -import io.heckel.ntfy.data.PROGRESS_NONE +import io.heckel.ntfy.db.Attachment +import io.heckel.ntfy.db.Notification import io.heckel.ntfy.log.Log -import io.heckel.ntfy.msg.* +import io.heckel.ntfy.msg.ApiService +import io.heckel.ntfy.msg.MESSAGE_ENCODING_BASE64 +import io.heckel.ntfy.msg.NotificationDispatcher import io.heckel.ntfy.service.SubscriberService import io.heckel.ntfy.util.toPriority import kotlinx.coroutines.CoroutineScope diff --git a/fastlane/metadata/android/en-US/changelog/17.txt b/fastlane/metadata/android/en-US/changelog/17.txt new file mode 100644 index 0000000..451328d --- /dev/null +++ b/fastlane/metadata/android/en-US/changelog/17.txt @@ -0,0 +1,7 @@ +New features: +* Report logs: Copy/export logs to help troubleshooting (#94) +* WebSockets (experimental): Use WebSockets to subscribe to topics (#96, #100, #97) + +Bug fixes: +* Support for binary UnifiedPush messages (#101) +