build: Migrate major breaking changes from all dependencies (except Placeholder)

This commit is contained in:
Pun Butrach
2025-09-23 20:11:20 +07:00
parent c9fbc8eb46
commit 8e9a564e53
7 changed files with 46 additions and 23 deletions

View File

@@ -60,7 +60,7 @@ dependencies {
implementation(libs.revanced.library)
// Downloader plugins
implementation(project(":api"))
implementation(projects.api)
// Native processes
implementation(libs.kotlin.process)

View File

@@ -16,8 +16,12 @@ import io.ktor.http.isSuccess
import io.ktor.utils.io.ByteReadChannel
import io.ktor.utils.io.core.isNotEmpty
import io.ktor.utils.io.core.readBytes
import io.ktor.utils.io.core.remaining
import io.ktor.utils.io.exhausted
import io.ktor.utils.io.readRemaining
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlinx.io.asSink
import kotlinx.serialization.json.Json
import java.io.File
import java.io.OutputStream
@@ -69,14 +73,14 @@ class HttpService(
) {
http.prepareGet(builder).execute { httpResponse ->
if (httpResponse.status.isSuccess()) {
val stream = outputStream.asSink()
val channel: ByteReadChannel = httpResponse.body()
withContext(Dispatchers.IO) {
while (!channel.isClosedForRead) {
val packet = channel.readRemaining(DEFAULT_BUFFER_SIZE.toLong())
while (packet.isNotEmpty) {
val bytes = packet.readBytes()
outputStream.write(bytes)
}
var count = 0L
stream.use {
while (!channel.exhausted()) {
val chunk = channel.readRemaining()
count += chunk.remaining
chunk.transferTo(stream)
}
}

View File

@@ -2,7 +2,9 @@ package app.revanced.manager.ui.component
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.text.TextLinkStyles
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextDecoration
import com.mikepenz.markdown.compose.Markdown
import com.mikepenz.markdown.m3.markdownColor
import com.mikepenz.markdown.m3.markdownTypography
@@ -18,15 +20,29 @@ fun Markdown(
colors = markdownColor(
text = MaterialTheme.colorScheme.onSurfaceVariant,
codeBackground = MaterialTheme.colorScheme.secondaryContainer,
codeText = MaterialTheme.colorScheme.onSecondaryContainer,
linkText = MaterialTheme.colorScheme.primary
),
typography = markdownTypography(
h1 = MaterialTheme.typography.headlineSmall.copy(fontWeight = FontWeight.Bold),
h2 = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold),
h3 = MaterialTheme.typography.titleMedium.copy(fontWeight = FontWeight.Bold),
text = MaterialTheme.typography.bodyMedium,
list = MaterialTheme.typography.bodyMedium
code = markdownTypography().code.copy(color = MaterialTheme.colorScheme.onSecondaryContainer),
list = MaterialTheme.typography.bodyMedium,
textLink = TextLinkStyles(
style = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Bold, textDecoration = TextDecoration.Underline,
color = MaterialTheme.colorScheme.primary
).toSpanStyle(),
hoveredStyle = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Bold, textDecoration = TextDecoration.Underline,
color = MaterialTheme.colorScheme.secondary
).toSpanStyle(),
pressedStyle = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Bold, textDecoration = TextDecoration.Underline,
color = MaterialTheme.colorScheme.tertiary
).toSpanStyle()
),
)
)
}

View File

@@ -87,7 +87,7 @@ class UpdateViewModel(
url(release.downloadUrl)
onDownload { bytesSentTotal, contentLength ->
downloadedSize = bytesSentTotal
totalSize = contentLength
totalSize = contentLength ?: 0
}
}
installUpdate()

View File

@@ -42,7 +42,6 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.launch
import kotlinx.datetime.Clock
import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.TimeZone
import kotlinx.datetime.format.MonthNames
@@ -53,6 +52,7 @@ import java.util.Locale
import kotlin.properties.PropertyDelegateProvider
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
import kotlin.time.ExperimentalTime
typealias PatchSelection = Map<Int, Set<String>>
typealias Options = Map<Int, Map<String, Map<String, Any?>>>
@@ -141,9 +141,10 @@ suspend fun <T> Flow<Iterable<T>>.collectEach(block: suspend (T) -> Unit) {
}
}
@OptIn(ExperimentalTime::class)
fun LocalDateTime.relativeTime(context: Context): String {
try {
val now = Clock.System.now()
val now = kotlin.time.Clock.System.now()
val duration = now - this.toInstant(TimeZone.UTC)
return when {

View File

@@ -11,22 +11,22 @@ work-runtime = "2.10.4"
compose-bom = "2025.09.00"
navigation = "2.9.4"
accompanist = "0.37.3"
placeholder = "1.1.2"
placeholder = "2.0.0"
reorderable = "2.5.1"
serialization = "1.9.0"
collection = "0.3.8"
datetime = "0.6.1"
collection = "0.4.0"
datetime = "0.7.1"
room-version = "2.8.0"
revanced-patcher = "21.0.0"
revanced-library = "3.0.2"
koin = "3.5.3"
ktor = "2.3.9"
markdown-renderer = "0.30.0"
koin = "4.1.1"
ktor = "3.3.0"
markdown-renderer = "0.37.0"
fading-edges = "1.0.4"
kotlin = "2.2.20"
android-gradle-plugin = "8.13.0"
dev-tools-gradle-plugin = "2.2.20-2.0.2"
about-libraries-gradle-plugin = "12.1.2"
about-libraries-gradle-plugin = "12.2.4"
coil = "2.7.0"
app-icon-loader-coil = "1.5.0"
libsu = "6.0.0"
@@ -34,8 +34,8 @@ scrollbars = "1.0.4"
enumutil = "1.1.1"
compose-icons = "1.2.4"
kotlin-process = "1.5.1"
hidden-api-stub = "4.3.3"
binary-compatibility-validator = "0.17.0"
hidden-api-stub = "4.4.0"
binary-compatibility-validator = "0.18.1"
[libraries]
# AndroidX Core

View File

@@ -22,5 +22,7 @@ dependencyResolutionManagement {
}
}
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
rootProject.name = "revanced-manager"
include(":app", ":api")