From dd45ac9e8acbd1c3ced8e1a2f53bb330a611af16 Mon Sep 17 00:00:00 2001
From: LagradOst <11805592+LagradOst@users.noreply.github.com>
Date: Tue, 10 Oct 2023 20:49:04 +0200
Subject: [PATCH] reverted to android 14 -> 13
---
app/build.gradle.kts | 22 +++++++++++--------
app/src/main/AndroidManifest.xml | 4 ++++
.../utils/PackageInstallerService.kt | 8 +++++--
3 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 639932c4..3b5e8f11 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -50,13 +50,14 @@ android {
}
}
- compileSdk = 34
+ // https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading
+ compileSdk = 33 // android 14 is fucked
buildToolsVersion = "34.0.0"
defaultConfig {
applicationId = "com.lagradost.cloudstream3"
minSdk = 21
- targetSdk = 34
+ targetSdk = 33
versionCode = 62
versionName = "4.2.1"
@@ -156,16 +157,19 @@ dependencies {
implementation("androidx.test.ext:junit-ktx:1.1.5")
testImplementation("org.json:json:20230618")
- implementation("androidx.core:core-ktx:1.12.0")
+ implementation("androidx.core:core-ktx:1.10.1") // need 34 for higher
implementation("androidx.appcompat:appcompat:1.6.1") // need target 32 for 1.5.0
// dont change this to 1.6.0 it looks ugly af
- implementation("com.google.android.material:material:1.10.0")
+ implementation("com.google.android.material:material:1.5.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
- implementation("androidx.navigation:navigation-fragment-ktx:2.7.4")
- implementation("androidx.navigation:navigation-ui-ktx:2.7.4")
- implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.2")
- implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
+
+ // need 34 for higher
+ implementation("androidx.navigation:navigation-fragment-ktx:2.6.0")
+ implementation("androidx.navigation:navigation-ui-ktx:2.6.0")
+ implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.1")
+ implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
+
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
@@ -175,7 +179,7 @@ dependencies {
// implementation("org.jsoup:jsoup:1.13.1")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.15.2")
- implementation("androidx.preference:preference-ktx:1.2.1")
+ implementation("androidx.preference:preference-ktx:1.2.0")
implementation("com.github.bumptech.glide:glide:4.13.1")
kapt("com.github.bumptech.glide:compiler:4.13.1")
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 503cd76b..e0d43338 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -15,6 +15,8 @@
+
+
@@ -186,6 +189,7 @@
android:exported="false" />
diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/PackageInstallerService.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/PackageInstallerService.kt
index dcb1e047..7ff7b067 100644
--- a/app/src/main/java/com/lagradost/cloudstream3/utils/PackageInstallerService.kt
+++ b/app/src/main/java/com/lagradost/cloudstream3/utils/PackageInstallerService.kt
@@ -1,12 +1,12 @@
package com.lagradost.cloudstream3.utils
-import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.Service
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
+import android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
import android.os.Build
import android.os.IBinder
import android.util.Log
@@ -54,7 +54,11 @@ class PackageInstallerService : Service() {
UPDATE_CHANNEL_NAME,
UPDATE_CHANNEL_DESCRIPTION
)
- startForeground(UPDATE_NOTIFICATION_ID, baseNotification.build())
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
+ startForeground(UPDATE_NOTIFICATION_ID, baseNotification.build(), FOREGROUND_SERVICE_TYPE_DATA_SYNC)
+ } else{
+ startForeground(UPDATE_NOTIFICATION_ID, baseNotification.build())
+ }
}
private val updateLock = Mutex()