Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70f46442c6 | ||
|
|
13cf42437f | ||
|
|
1e29f6dcb4 | ||
|
|
f25981792f | ||
|
|
934c8be3e4 | ||
|
|
b9994eacbc | ||
|
|
704ab0ee7e |
No files matched your search
@@ -1,5 +1,12 @@
|
||||
# 变更日志
|
||||
|
||||
## [1.11.6-RC2] - 2024-06-06
|
||||
|
||||
### 改进
|
||||
|
||||
* 下载图片时执行完整性校验以防止文件损坏/被篡改
|
||||
|
||||
|
||||
## [1.11.6-RC1] - 2024-06-02
|
||||
|
||||
### 改进
|
||||
|
||||
@@ -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)
|
||||
|
||||
Generated
+2
-2
@@ -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",
|
||||
]
|
||||
|
||||
@@ -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" }
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user