Make the app Android 8+

(cherry picked from commit dfb3091e380dda3e9bfb64bf5c9a685cf3a03d0e)

# Conflicts:
#	README.md
#	app/src/debug/res/mipmap-hdpi/ic_launcher.png
#	app/src/debug/res/mipmap-hdpi/ic_launcher_round.png
#	app/src/debug/res/mipmap-mdpi/ic_launcher.png
#	app/src/debug/res/mipmap-mdpi/ic_launcher_round.png
#	app/src/debug/res/mipmap-xhdpi/ic_launcher.png
#	app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png
#	app/src/debug/res/mipmap-xxhdpi/ic_launcher.png
#	app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png
#	app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png
#	app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png
#	app/src/main/java/eu/kanade/domain/ui/UiPreferences.kt
#	app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAdvancedScreen.kt
#	app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsReaderScreen.kt
#	app/src/main/java/eu/kanade/tachiyomi/data/coil/TachiyomiImageDecoder.kt
#	app/src/main/java/eu/kanade/tachiyomi/extension/installer/ShizukuInstaller.kt
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/loader/ZipPageLoader.kt
#	app/src/main/res/mipmap-hdpi/ic_launcher.png
#	app/src/main/res/mipmap-hdpi/ic_launcher_round.png
#	app/src/main/res/mipmap-mdpi/ic_launcher.png
#	app/src/main/res/mipmap-mdpi/ic_launcher_round.png
#	app/src/main/res/mipmap-xhdpi/ic_launcher.png
#	app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
#	app/src/main/res/mipmap-xxhdpi/ic_launcher.png
#	app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
#	app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
#	app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
#	buildSrc/src/main/kotlin/AndroidConfig.kt
This commit is contained in:
AntsyLich 2024-01-15 22:43:13 +06:00 committed by Cuong M. Tran
parent 271e78eaf1
commit cdac438f1e
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2
28 changed files with 135 additions and 305 deletions

View file

@ -4,7 +4,7 @@
# ![app icon](./.github/readme-images/app-icon.png) Komikku
Mihon/Tachiyomi is a free and open source manga reader for Android 6.0 and above. This version of Mihon/Tachiyomi, Komikku was based off TachiyomiSY. This version is meant to push forward in the ways of usability and features. TachiyomiSY tries to push forward where it can, but staying in a place where it can easily grab updates and features from the main app, it tries to make new features, or take features from other forks like SY, J2K and Neko.
Mihon/Tachiyomi is a free and open source manga reader for Android 8.0 and above. This version of Mihon/Tachiyomi, Komikku was based off TachiyomiSY. This version is meant to push forward in the ways of usability and features. TachiyomiSY tries to push forward where it can, but staying in a place where it can easily grab updates and features from the main app, it tries to make new features, or take features from other forks like SY, J2K and Neko.
![screenshots of app](./.github/readme-images/screens.png)

View file

@ -1,6 +1,5 @@
package eu.kanade.domain.ui
import android.os.Build
import com.materialkolor.PaletteStyle
import eu.kanade.domain.ui.model.AppTheme
import eu.kanade.domain.ui.model.TabletUiMode
@ -17,10 +16,7 @@ class UiPreferences(
private val preferenceStore: PreferenceStore,
) {
fun themeMode() = preferenceStore.getEnum(
"pref_theme_mode_key",
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { ThemeMode.SYSTEM } else { ThemeMode.LIGHT },
)
fun themeMode() = preferenceStore.getEnum("pref_theme_mode_key", ThemeMode.SYSTEM)
fun appTheme() = preferenceStore.getEnum(
"pref_app_theme",

View file

@ -2,7 +2,6 @@ package eu.kanade.presentation.manga.components
import android.graphics.Bitmap
import android.graphics.drawable.BitmapDrawable
import android.os.Build
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
@ -175,14 +174,9 @@ fun MangaCoverDialog(
// Copy bitmap in case it came from memory cache
// Because SSIV needs to thoroughly read the image
val copy = (drawable as? BitmapDrawable)?.let {
val config = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Bitmap.Config.HARDWARE
} else {
Bitmap.Config.ARGB_8888
}
BitmapDrawable(
view.context.resources,
it.bitmap.copy(config, false),
it.bitmap.copy(Bitmap.Config.HARDWARE, false),
)
} ?: drawable
view.setImage(copy, ReaderPageImageView.Config(zoomDuration = 500))

View file

@ -1,6 +1,5 @@
package eu.kanade.presentation.more.settings.widget
import android.os.Build
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MultiChoiceSegmentedButtonRow
@ -13,18 +12,11 @@ import eu.kanade.domain.ui.model.ThemeMode
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.i18n.stringResource
private val options = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mapOf(
ThemeMode.SYSTEM to MR.strings.theme_system,
ThemeMode.LIGHT to MR.strings.theme_light,
ThemeMode.DARK to MR.strings.theme_dark,
)
} else {
mapOf(
ThemeMode.LIGHT to MR.strings.theme_light,
ThemeMode.DARK to MR.strings.theme_dark,
)
}
private val options = mapOf(
ThemeMode.SYSTEM to MR.strings.theme_system,
ThemeMode.LIGHT to MR.strings.theme_light,
ThemeMode.DARK to MR.strings.theme_dark,
)
@Composable
internal fun AppThemeModePreferenceWidget(

View file

@ -1,7 +1,5 @@
package eu.kanade.presentation.util
import android.os.Build
import android.provider.Settings
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.getValue
@ -23,12 +21,7 @@ fun rememberRequestPackageInstallsPermissionState(initialValue: Boolean = false)
DisposableEffect(lifecycleOwner.lifecycle) {
val observer = object : DefaultLifecycleObserver {
override fun onResume(owner: LifecycleOwner) {
installGranted = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.packageManager.canRequestPackageInstalls()
} else {
@Suppress("DEPRECATION")
Settings.Secure.getInt(context.contentResolver, Settings.Secure.INSTALL_NON_MARKET_APPS) != 0
}
installGranted = context.packageManager.canRequestPackageInstalls()
}
}
lifecycleOwner.lifecycle.addObserver(observer)

View file

@ -248,22 +248,19 @@ class App : Application(), DefaultLifecycleObserver, SingletonImageLoader.Factor
}
override fun getPackageName(): String {
// This causes freezes in Android 6/7 for some reason
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
try {
// Override the value passed as X-Requested-With in WebView requests
val stackTrace = Looper.getMainLooper().thread.stackTrace
val chromiumElement = stackTrace.find {
it.className.equals(
"org.chromium.base.BuildInfo",
ignoreCase = true,
)
}
if (chromiumElement?.methodName.equals("getAll", ignoreCase = true)) {
return WebViewUtil.SPOOF_PACKAGE_NAME
}
} catch (_: Exception) {
try {
// Override the value passed as X-Requested-With in WebView requests
val stackTrace = Looper.getMainLooper().thread.stackTrace
val chromiumElement = stackTrace.find {
it.className.equals(
"org.chromium.base.BuildInfo",
ignoreCase = true,
)
}
if (chromiumElement?.methodName.equals("getAll", ignoreCase = true)) {
return WebViewUtil.SPOOF_PACKAGE_NAME
}
} catch (_: Exception) {
}
return super.getPackageName()
}

View file

@ -1,7 +1,6 @@
package eu.kanade.tachiyomi.data.coil
import android.graphics.Bitmap
import android.os.Build
import coil3.ImageLoader
import coil3.asCoilImage
import coil3.decode.DecodeResult
@ -68,7 +67,6 @@ class TachiyomiImageDecoder(private val resources: ImageSource, private val opti
check(bitmap != null) { "Failed to decode image" }
if (
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
options.bitmapConfig == Bitmap.Config.HARDWARE &&
maxOf(bitmap.width, bitmap.height) <= GLUtil.maxTextureSize
) {
@ -105,8 +103,7 @@ class TachiyomiImageDecoder(private val resources: ImageSource, private val opti
}
// SY <--
return when (type) {
ImageUtil.ImageType.AVIF, ImageUtil.ImageType.JXL -> true
ImageUtil.ImageType.HEIF -> Build.VERSION.SDK_INT < Build.VERSION_CODES.O
ImageUtil.ImageType.AVIF, ImageUtil.ImageType.JXL, ImageUtil.ImageType.HEIF -> true
else -> false
}
}

View file

@ -5,7 +5,6 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Build
import androidx.core.net.toUri
import eu.kanade.tachiyomi.data.backup.restore.BackupRestoreJob
import eu.kanade.tachiyomi.data.download.DownloadManager
@ -368,20 +367,18 @@ class NotificationReceiver : BroadcastReceiver() {
When programmatically dismissing this notification, the group notification is not automatically dismissed.
*/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val groupKey = context.notificationManager.activeNotifications.find {
it.id == notificationId
}?.groupKey
val groupKey = context.notificationManager.activeNotifications.find {
it.id == notificationId
}?.groupKey
if (groupId != null && groupId != 0 && !groupKey.isNullOrEmpty()) {
val notifications = context.notificationManager.activeNotifications.filter {
it.groupKey == groupKey
}
if (groupId != null && groupId != 0 && !groupKey.isNullOrEmpty()) {
val notifications = context.notificationManager.activeNotifications.filter {
it.groupKey == groupKey
}
if (notifications.size == 2) {
context.cancelNotification(groupId)
return
}
if (notifications.size == 2) {
context.cancelNotification(groupId)
return
}
}

View file

@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.extension.installer
import android.app.Service
import android.content.pm.PackageManager
import android.os.Build
import android.os.Process
import eu.kanade.tachiyomi.extension.model.InstallStep
import eu.kanade.tachiyomi.util.system.getUriSize
@ -51,12 +50,8 @@ class ShizukuInstaller(private val service: Service) : Installer(service) {
try {
val size = service.getUriSize(entry.uri) ?: throw IllegalStateException()
service.contentResolver.openInputStream(entry.uri)!!.use {
val createCommand = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val userId = Process.myUserHandle().hashCode()
"pm install-create --user $userId -r -i ${service.packageName} -S $size"
} else {
"pm install-create -r -i ${service.packageName} -S $size"
}
val userId = Process.myUserHandle().hashCode()
val createCommand = "pm install-create --user $userId -r -i ${service.packageName} -S $size"
val createResult = exec(createCommand)
sessionId = SESSION_ID_REGEX.find(createResult.out)?.value
?: throw RuntimeException("Failed to create install session")

View file

@ -2,9 +2,7 @@ package eu.kanade.tachiyomi.util.storage
import android.content.Context
import android.net.Uri
import android.os.Build
import androidx.core.content.FileProvider
import androidx.core.net.toUri
import eu.kanade.tachiyomi.BuildConfig
import java.io.File
@ -17,11 +15,7 @@ val Context.cacheImageDir: File
* @param context context of application
*/
fun File.getUriCompat(context: Context): Uri {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", this)
} else {
this.toUri()
}
return FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", this)
}
/**

View file

@ -170,12 +170,8 @@ fun Context.isInstalledFromFDroid(): Boolean {
}
fun Context.launchRequestPackageInstallsPermission() {
val intent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES).apply {
data = Uri.parse("package:$packageName")
}
} else {
Intent(Settings.ACTION_SECURITY_SETTINGS)
Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES).apply {
data = Uri.parse("package:$packageName")
startActivity(this)
}
startActivity(intent)
}

View file

@ -18,8 +18,7 @@ fun Context.isOnline(): Boolean {
val networkCapabilities = connectivityManager.getNetworkCapabilities(activeNetwork) ?: return false
val maxTransport = when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1 -> NetworkCapabilities.TRANSPORT_LOWPAN
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O -> NetworkCapabilities.TRANSPORT_WIFI_AWARE
else -> NetworkCapabilities.TRANSPORT_VPN
else -> NetworkCapabilities.TRANSPORT_WIFI_AWARE
}
return (NetworkCapabilities.TRANSPORT_CELLULAR..maxTransport).any(networkCapabilities::hasTransport)
}

View file

@ -1,14 +1,9 @@
package eu.kanade.tachiyomi.util.system
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.net.ConnectivityManager
import android.net.ConnectivityManager.NetworkCallback
import android.net.Network
import android.net.NetworkCapabilities
import android.os.Build
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.callbackFlow
@ -17,11 +12,7 @@ data class NetworkState(
val isValidated: Boolean,
val isWifi: Boolean,
) {
val isOnline = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
isConnected && isValidated
} else {
isConnected
}
val isOnline = isConnected && isValidated
}
@Suppress("DEPRECATION")
@ -34,34 +25,18 @@ fun Context.activeNetworkState(): NetworkState {
)
}
@Suppress("DEPRECATION")
fun Context.networkStateFlow() = callbackFlow {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
val networkCallback = object : NetworkCallback() {
override fun onCapabilitiesChanged(network: Network, networkCapabilities: NetworkCapabilities) {
trySend(activeNetworkState())
}
override fun onLost(network: Network) {
trySend(activeNetworkState())
}
val networkCallback = object : NetworkCallback() {
override fun onCapabilitiesChanged(network: Network, networkCapabilities: NetworkCapabilities) {
trySend(activeNetworkState())
}
connectivityManager.registerDefaultNetworkCallback(networkCallback)
awaitClose {
connectivityManager.unregisterNetworkCallback(networkCallback)
}
} else {
val receiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
if (intent.action == ConnectivityManager.CONNECTIVITY_ACTION) {
trySend(activeNetworkState())
}
}
}
registerReceiver(receiver, IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION))
awaitClose {
unregisterReceiver(receiver)
override fun onLost(network: Network) {
trySend(activeNetworkState())
}
}
connectivityManager.registerDefaultNetworkCallback(networkCallback)
awaitClose {
connectivityManager.unregisterNetworkCallback(networkCallback)
}
}

View file

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/sc_collections_bookmark_48dp">
<background android:drawable="@color/accent_blue"/>
<foreground>
<vector
android:width="120dp"
android:height="120dp"
android:viewportWidth="56.0"
android:viewportHeight="56.0">
<group
android:translateX="16"
android:translateY="16">
<path
android:fillColor="#FFF"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6z"/>
<path
android:fillColor="#FFF"
android:pathData="M20,2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,12l-2.5,-1.5L15,12L15,4h5v8z"/>
</group>
</vector>
</foreground>
</adaptive-icon>

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/sc_explore_48dp">
<background android:drawable="@color/accent_blue"/>
<foreground>
<vector
android:width="120dp"
android:height="120dp"
android:viewportWidth="56.0"
android:viewportHeight="56.0">
<group
android:translateX="16"
android:translateY="16">
<path
android:fillColor="#FFF"
android:pathData="M12,10.9c-0.61,0 -1.1,0.49 -1.1,1.1s0.49,1.1 1.1,1.1c0.61,0 1.1,-0.49 1.1,-1.1s-0.49,-1.1 -1.1,-1.1zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM14.19,14.19L6,18l3.81,-8.19L18,6l-3.81,8.19z" />
</group>
</vector>
</foreground>
</adaptive-icon>

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/sc_history_48dp">
<background android:drawable="@color/accent_blue"/>
<foreground>
<vector
android:width="120dp"
android:height="120dp"
android:viewportWidth="56.0"
android:viewportHeight="56.0">
<group
android:translateX="16"
android:translateY="16">
<path
android:fillColor="#FFF"
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z" />
</group>
</vector>
</foreground>
</adaptive-icon>

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/sc_new_releases_48dp">
<background android:drawable="@color/accent_blue"/>
<foreground>
<vector
android:width="120dp"
android:height="120dp"
android:viewportWidth="56.0"
android:viewportHeight="56.0">
<group
android:translateX="16"
android:translateY="16">
<path
android:fillColor="#FFF"
android:pathData="M23,12l-2.44,-2.78 0.34,-3.68 -3.61,-0.82 -1.89,-3.18L12,3 8.6,1.54 6.71,4.72l-3.61,0.81 0.34,3.68L1,12l2.44,2.78 -0.34,3.69 3.61,0.82 1.89,3.18L12,21l3.4,1.46 1.89,-3.18 3.61,-0.82 -0.34,-3.68L23,12zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z" />
</group>
</vector>
</foreground>
</adaptive-icon>

View file

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/sc_collections_bookmark_48dp"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="@color/accent_blue"
android:pathData="M24,24m-22,0a22,22 0,1 1,44 0a22,22 0,1 1,-44 0" />
<group
android:translateX="12"
android:translateY="12">
<path
android:fillColor="#FFF"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6z" />
<path
android:fillColor="#FFF"
android:pathData="M20,2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,12l-2.5,-1.5L15,12L15,4h5v8z" />
</group>
</vector>
tools:keep="@drawable/sc_collections_bookmark_48dp">
<background android:drawable="@color/accent_blue"/>
<foreground>
<vector
android:width="120dp"
android:height="120dp"
android:viewportWidth="56.0"
android:viewportHeight="56.0">
<group
android:translateX="16"
android:translateY="16">
<path
android:fillColor="#FFF"
android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6z"/>
<path
android:fillColor="#FFF"
android:pathData="M20,2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,12l-2.5,-1.5L15,12L15,4h5v8z"/>
</group>
</vector>
</foreground>
</adaptive-icon>

View file

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/sc_explore_48dp"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="@color/accent_blue"
android:pathData="M24,24m-22,0a22,22 0,1 1,44 0a22,22 0,1 1,-44 0" />
<group
android:translateX="12"
android:translateY="12">
<path
android:fillColor="#FFF"
android:pathData="M12,10.9c-0.61,0 -1.1,0.49 -1.1,1.1s0.49,1.1 1.1,1.1c0.61,0 1.1,-0.49 1.1,-1.1s-0.49,-1.1 -1.1,-1.1zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM14.19,14.19L6,18l3.81,-8.19L18,6l-3.81,8.19z" />
</group>
</vector>
tools:keep="@drawable/sc_explore_48dp">
<background android:drawable="@color/accent_blue"/>
<foreground>
<vector
android:width="120dp"
android:height="120dp"
android:viewportWidth="56.0"
android:viewportHeight="56.0">
<group
android:translateX="16"
android:translateY="16">
<path
android:fillColor="#FFF"
android:pathData="M12,10.9c-0.61,0 -1.1,0.49 -1.1,1.1s0.49,1.1 1.1,1.1c0.61,0 1.1,-0.49 1.1,-1.1s-0.49,-1.1 -1.1,-1.1zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM14.19,14.19L6,18l3.81,-8.19L18,6l-3.81,8.19z" />
</group>
</vector>
</foreground>
</adaptive-icon>

View file

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/sc_history_48dp"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="@color/accent_blue"
android:pathData="M24,24m-22,0a22,22 0,1 1,44 0a22,22 0,1 1,-44 0" />
<group
android:translateX="12"
android:translateY="12">
<path
android:fillColor="#FFF"
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z" />
</group>
</vector>
tools:keep="@drawable/sc_history_48dp">
<background android:drawable="@color/accent_blue"/>
<foreground>
<vector
android:width="120dp"
android:height="120dp"
android:viewportWidth="56.0"
android:viewportHeight="56.0">
<group
android:translateX="16"
android:translateY="16">
<path
android:fillColor="#FFF"
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z" />
</group>
</vector>
</foreground>
</adaptive-icon>

View file

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:keep="@drawable/sc_new_releases_48dp"
android:width="48dp"
android:height="48dp"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="@color/accent_blue"
android:pathData="M24,24m-22,0a22,22 0,1 1,44 0a22,22 0,1 1,-44 0" />
<group
android:translateX="12"
android:translateY="12">
<path
android:fillColor="#FFF"
android:pathData="M23,12l-2.44,-2.78 0.34,-3.68 -3.61,-0.82 -1.89,-3.18L12,3 8.6,1.54 6.71,4.72l-3.61,0.81 0.34,3.68L1,12l2.44,2.78 -0.34,3.69 3.61,0.82 1.89,3.18L12,21l3.4,1.46 1.89,-3.18 3.61,-0.82 -0.34,-3.68L23,12zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z" />
</group>
</vector>
tools:keep="@drawable/sc_new_releases_48dp">
<background android:drawable="@color/accent_blue"/>
<foreground>
<vector
android:width="120dp"
android:height="120dp"
android:viewportWidth="56.0"
android:viewportHeight="56.0">
<group
android:translateX="16"
android:translateY="16">
<path
android:fillColor="#FFF"
android:pathData="M23,12l-2.44,-2.78 0.34,-3.68 -3.61,-0.82 -1.89,-3.18L12,3 8.6,1.54 6.71,4.72l-3.61,0.81 0.34,3.68L1,12l2.44,2.78 -0.34,3.69 3.61,0.82 1.89,3.18L12,21l3.4,1.46 1.89,-3.18 3.61,-0.82 -0.34,-3.68L23,12zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z" />
</group>
</vector>
</foreground>
</adaptive-icon>

View file

@ -5,7 +5,7 @@ import org.gradle.api.JavaVersion as GradleJavaVersion
object AndroidConfig {
const val COMPILE_SDK = 34
const val TARGET_SDK = 34
const val MIN_SDK = 23
const val MIN_SDK = 26
const val NDK = "26.1.10909125"
val JavaVersion = GradleJavaVersion.VERSION_17
}

View file

@ -1,7 +1,5 @@
package eu.kanade.tachiyomi.util.system
import android.annotation.TargetApi
import android.os.Build
import android.webkit.WebResourceError
import android.webkit.WebResourceRequest
import android.webkit.WebResourceResponse
@ -28,7 +26,6 @@ abstract class WebViewClientCompat : WebViewClient() {
) {
}
@TargetApi(Build.VERSION_CODES.N)
final override fun shouldOverrideUrlLoading(
view: WebView,
request: WebResourceRequest,

View file

@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.util.system
import android.annotation.SuppressLint
import android.content.Context
import android.content.pm.PackageManager
import android.os.Build
import android.webkit.CookieManager
import android.webkit.WebSettings
import android.webkit.WebView
@ -35,15 +34,11 @@ object WebViewUtil {
}
fun getVersion(context: Context): String {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val webView = WebView.getCurrentWebViewPackage() ?: return "how did you get here?"
val pm = context.packageManager
val label = webView.applicationInfo.loadLabel(pm)
val version = webView.versionName
"$label $version"
} else {
"Unknown"
}
val webView = WebView.getCurrentWebViewPackage() ?: return "how did you get here?"
val pm = context.packageManager
val label = webView.applicationInfo.loadLabel(pm)
val version = webView.versionName
return "$label $version"
}
fun supportsWebView(context: Context): Boolean {