Compare commits

...
7 Commits
Author SHA1 Message Date
FooIbar 70f46442c6 Prepare for release 1.11.6-RC2
Releases / build (push) Has been cancelled
2024-06-06 22:07:23 +08:00
FooIbar 13cf42437f Update Compose snapshot
https://issuetracker.google.com/343750859
2024-06-06 21:54:22 +08:00
renovate[bot] 1e29f6dcb4 Update kotlinx.serialization to v1.7.0 2024-06-06 13:52:43 +00:00
renovate[bot] f25981792f Update dependency com.google.devtools.ksp to v2.0.0-1.0.22 2024-06-06 00:09:30 +00:00
FooIbar 934c8be3e4 Anti-tamper support 2024-06-04 15:13:09 +08:00
renovate[bot] b9994eacbc Lock file maintenance 2024-06-03 01:53:41 +00:00
FooIbar 704ab0ee7e Prepare for next iteration 2024-06-02 23:38:33 +08:00
6 changed files with 23 additions and 9 deletions

No files matched your search

+7
View File
@@ -1,5 +1,12 @@
# 变更日志
## [1.11.6-RC2] - 2024-06-06
### 改进
* 下载图片时执行完整性校验以防止文件损坏/被篡改
## [1.11.6-RC1] - 2024-06-02
### 改进
+1 -1
View File
@@ -67,7 +67,7 @@ android {
targetSdk = 34
versionCode = 180056
versionName = "1.11.6"
versionNameSuffix = "-RC1"
versionNameSuffix = "-RC2"
resourceConfigurations.addAll(
listOf(
"zh",
@@ -43,6 +43,7 @@ import com.hippo.ehviewer.util.sendTo
import com.hippo.unifile.UniFile
import com.hippo.unifile.asUniFile
import com.hippo.unifile.openOutputStream
import com.hippo.unifile.sha1
import eu.kanade.tachiyomi.util.system.logcat
import io.ktor.client.plugins.onDownload
import io.ktor.client.statement.HttpResponse
@@ -195,6 +196,9 @@ class SpiderDen(val info: GalleryInfo) {
outFile.openOutputStream().use {
response.bodyAsChannel().copyTo(it.channel)
}
val expected = FileHashRegex.find(url)?.run { groupValues[0] }
val actual = outFile.sha1()
check(expected == actual) { "File hash mismatch: expected $expected, but got $actual\nURL: $url" }
}
}
@@ -275,7 +279,7 @@ class SpiderDen(val info: GalleryInfo) {
val archived = saveAsCbz && dir?.findFile(archiveName) != null
if (archived) {
dir.listFiles().parMap(concurrency = 10) {
if (it.name?.matches(filenamePattern) == true) {
if (it.name?.matches(FileNameRegex) == true) {
it.delete()
}
}
@@ -339,7 +343,8 @@ class SpiderDen(val info: GalleryInfo) {
}
}
private val filenamePattern = Regex("^\\d{8}\\.\\w{3,4}")
private val FileNameRegex = Regex("^\\d{8}\\.\\w{3,4}")
private val FileHashRegex = Regex("[0-9a-f]{40}")
fun perFilename(index: Int, extension: String = ""): String {
return "%08d.%s".format(index + 1, extension)
+2 -2
View File
@@ -207,9 +207,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = "proc-macro2"
version = "1.0.84"
version = "1.0.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6"
checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23"
dependencies = [
"unicode-ident",
]
+4 -4
View File
@@ -23,8 +23,8 @@ compose-destinations = "2.1.0-beta09"
kotlin = "2.0.0"
kotlinx-coroutines = "1.8.1"
kotlinx-datetime = "0.6.0"
kotlinx-serialization = "1.6.3"
ksp = "2.0.0-1.0.21"
kotlinx-serialization = "1.7.0"
ksp = "2.0.0-1.0.22"
ktor = "3.0.0-beta-1"
okio = "3.9.0"
splitties = "3.0.0"
@@ -66,9 +66,9 @@ coil-gif = { module = "io.coil-kt.coil3:coil-gif" }
coil-network = { module = "io.coil-kt.coil3:coil-network-ktor" }
compose-bom = { module = "dev.chrisbanes.compose:compose-bom", version.ref = "compose-bom" }
compose-foundation = { module = "androidx.compose.foundation:foundation" }
compose-foundation = { module = "androidx.compose.foundation:foundation", version = "1.8.0-SNAPSHOT" }
compose-material-icons-extended = { module = "androidx.compose.material:material-icons-extended" }
compose-material3 = { module = "androidx.compose.material3:material3" }
compose-material3 = { module = "androidx.compose.material3:material3", version = "1.3.0-SNAPSHOT" }
compose-material3-adaptive = { module = "androidx.compose.material3.adaptive:adaptive" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
+2
View File
@@ -12,6 +12,8 @@ dependencyResolutionManagement {
google()
mavenCentral()
maven("https://jitpack.io")
// TODO: Remove on Compose 1.8.0-alpha01
maven("https://androidx.dev/snapshots/builds/11925800/artifacts/repository")
}
}