Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6ae5c11 authored by Philipp Heckel's avatar Philipp Heckel
Browse files

Merge branch 'main' into fdroid

parents b1390582 38696d41
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@ android {
        minSdkVersion 21
        targetSdkVersion 30

        versionCode 6
        versionName "1.1.3"
        versionCode 7
        versionName "1.2.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

@@ -23,7 +23,6 @@ android {
                arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }

    }

    buildTypes {
+118 −0
Original line number Diff line number Diff line
{
  "formatVersion": 1,
  "database": {
    "version": 3,
    "identityHash": "7b0ef556331f6d2dd3515425837c3d3a",
    "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, 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
          }
        ],
        "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`)"
          }
        ],
        "foreignKeys": []
      },
      {
        "tableName": "Notification",
        "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `subscriptionId` INTEGER NOT NULL, `timestamp` INTEGER NOT NULL, `message` TEXT NOT NULL, `notificationId` INTEGER NOT NULL, `deleted` INTEGER NOT NULL, PRIMARY KEY(`id`))",
        "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": "message",
            "columnName": "message",
            "affinity": "TEXT",
            "notNull": true
          },
          {
            "fieldPath": "notificationId",
            "columnName": "notificationId",
            "affinity": "INTEGER",
            "notNull": true
          },
          {
            "fieldPath": "deleted",
            "columnName": "deleted",
            "affinity": "INTEGER",
            "notNull": true
          }
        ],
        "primaryKey": {
          "columnNames": [
            "id"
          ],
          "autoGenerate": false
        },
        "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, '7b0ef556331f6d2dd3515425837c3d3a')"
    ]
  }
}
 No newline at end of file
+9 −12
Original line number Diff line number Diff line
@@ -12,10 +12,6 @@
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

    <!--
         Application
         - usesCleartextTraffic is required to support "use another server" feature
    -->
    <application
            android:name=".app.Application"
            android:allowBackup="true"
@@ -25,7 +21,6 @@
            android:supportsRtl="true"
            android:theme="@style/AppTheme"
            android:usesCleartextTraffic="true">

        <!-- Main activity -->
        <activity
                android:name=".ui.MainActivity"
@@ -50,7 +45,9 @@
        <service android:name=".msg.SubscriberService"/>

        <!-- Subscriber service restart on reboot -->
        <receiver android:enabled="true" android:name=".msg.SubscriberService$StartReceiver">
        <receiver
                android:name=".msg.SubscriberService$StartReceiver"
                android:enabled="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
            </intent-filter>
@@ -70,7 +67,7 @@
                android:value="false"/>
        <meta-data
                android:name="com.google.firebase.messaging.default_notification_icon"
                android:resource="@drawable/ic_notification_icon"/>
                android:resource="@drawable/ic_notification"/>
    </application>

</manifest>
−4.27 KiB (49.3 KiB)
Loading image diff...
+5 −1
Original line number Diff line number Diff line
package io.heckel.ntfy.app

import android.app.Application
import android.content.Context
import com.google.firebase.messaging.FirebaseMessagingService
import io.heckel.ntfy.data.Database
import io.heckel.ntfy.data.Repository
@@ -8,5 +9,8 @@ import io.heckel.ntfy.msg.ApiService

class Application : Application() {
    private val database by lazy { Database.getInstance(this) }
    val repository by lazy { Repository.getInstance(database.subscriptionDao(), database.notificationDao()) }
    val repository by lazy {
        val sharedPrefs = applicationContext.getSharedPreferences(Repository.SHARED_PREFS_ID, Context.MODE_PRIVATE)
        Repository.getInstance(sharedPrefs, database.subscriptionDao(), database.notificationDao())
    }
}
Loading