Upload via GUI (4909 Dateien)
This commit is contained in:
Binary file not shown.
@@ -1,60 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<!-- Popups bei neuen Tickets (ab Android 13 fragt die App einmal nach) -->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
|
||||
<application
|
||||
android:name=".DeskHubApplication"
|
||||
android:allowBackup="false"
|
||||
android:fullBackupContent="false"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.DeskHub">
|
||||
<meta-data
|
||||
android:name="de.deskhub.staff.creator"
|
||||
android:value="M_Viper" />
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@drawable/ic_stat_notification" />
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_channel_id"
|
||||
android:value="tickets" />
|
||||
<service
|
||||
android:name=".push.DeskHubMessagingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<receiver
|
||||
android:name=".push.PushReplyReceiver"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<receiver
|
||||
android:name=".DeskHubWidget"
|
||||
android:exported="true"
|
||||
android:label="DeskHub Tickets">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.appwidget.provider"
|
||||
android:resource="@xml/deskhub_widget_info" />
|
||||
</receiver>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<!-- Popups bei neuen Tickets (ab Android 13 fragt die App einmal nach) -->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<!-- Für „Jetzt aktualisieren“: die heruntergeladene neue Version installieren -->
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
|
||||
<application
|
||||
android:name=".DeskHubApplication"
|
||||
android:allowBackup="false"
|
||||
android:fullBackupContent="false"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:label="@string/app_name"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.DeskHub">
|
||||
<meta-data
|
||||
android:name="de.deskhub.staff.creator"
|
||||
android:value="M_Viper" />
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||
android:resource="@drawable/ic_stat_notification" />
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_channel_id"
|
||||
android:value="tickets" />
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.updates"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/update_paths" />
|
||||
</provider>
|
||||
<service
|
||||
android:name=".push.DeskHubMessagingService"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<receiver
|
||||
android:name=".push.PushReplyReceiver"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<receiver
|
||||
android:name=".DeskHubWidget"
|
||||
android:exported="true"
|
||||
android:label="DeskHub Tickets">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.appwidget.provider"
|
||||
android:resource="@xml/deskhub_widget_info" />
|
||||
</receiver>
|
||||
<receiver
|
||||
android:name=".WidgetActionReceiver"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
</manifest>
|
||||
</application>
|
||||
</manifest>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,66 @@
|
||||
package de.deskhub.staff
|
||||
|
||||
import android.content.Context
|
||||
import androidx.work.Constraints
|
||||
import androidx.work.CoroutineWorker
|
||||
import androidx.work.ExistingPeriodicWorkPolicy
|
||||
import androidx.work.NetworkType
|
||||
import androidx.work.PeriodicWorkRequestBuilder
|
||||
import androidx.work.WorkManager
|
||||
import androidx.work.WorkerParameters
|
||||
import de.deskhub.staff.data.remote.DeskHubApi
|
||||
import de.deskhub.staff.data.security.SecureSessionStore
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
/** Sends a liveness request without changing the staff member's presence status. */
|
||||
class AppConnectionWorker(context: Context, params: WorkerParameters) : CoroutineWorker(context, params) {
|
||||
override suspend fun doWork(): Result {
|
||||
val session = SecureSessionStore(applicationContext).load() ?: return Result.success()
|
||||
if (session.token.isBlank() || session.serverUrl.isBlank()) return Result.success()
|
||||
return try {
|
||||
DeskHubApi(session.serverUrl) { session.token }.me()
|
||||
Result.success()
|
||||
} catch (cancelled: CancellationException) {
|
||||
throw cancelled
|
||||
} catch (_: Exception) {
|
||||
Result.retry()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object AppConnectionPing {
|
||||
private const val WORK_NAME = "deskhub-app-connection-heartbeat"
|
||||
|
||||
/** Quick heartbeat while the app is visible. */
|
||||
fun send(context: Context) {
|
||||
val app = context.applicationContext
|
||||
thread(name = "app-connection-ping") {
|
||||
try {
|
||||
val session = SecureSessionStore(app).load() ?: return@thread
|
||||
if (session.token.isBlank() || session.serverUrl.isBlank()) return@thread
|
||||
runBlocking { DeskHubApi(session.serverUrl) { session.token }.me() }
|
||||
} catch (_: Exception) {
|
||||
// The next foreground or background heartbeat will retry.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Android schedules this network-constrained worker periodically, including in the background. */
|
||||
fun scheduleBackground(context: Context) {
|
||||
val constraints = Constraints.Builder()
|
||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
||||
.build()
|
||||
val request = PeriodicWorkRequestBuilder<AppConnectionWorker>(15, TimeUnit.MINUTES)
|
||||
.setConstraints(constraints)
|
||||
.build()
|
||||
WorkManager.getInstance(context.applicationContext)
|
||||
.enqueueUniquePeriodicWork(WORK_NAME, ExistingPeriodicWorkPolicy.UPDATE, request)
|
||||
}
|
||||
|
||||
fun cancelBackground(context: Context) {
|
||||
WorkManager.getInstance(context.applicationContext).cancelUniqueWork(WORK_NAME)
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1211,3 +1211,11 @@ data class AutoCloseSaveRequest(val action: String = "save_auto_close", val enab
|
||||
// ─── Bild-Upload (z.B. für Signaturen) ───────────────────────────────────────
|
||||
|
||||
data class UploadImageResponse(val url: String = "")
|
||||
|
||||
data class AppUpdateDto(
|
||||
val available: Boolean = false,
|
||||
val version: String = "",
|
||||
val sha256: String = "",
|
||||
val size: Long = 0,
|
||||
val notes: String = "",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user