fix build

This commit is contained in:
AwkwardPeak7 2024-11-19 08:35:28 +05:00
parent d18742354e
commit cf266ce9fb
No known key found for this signature in database

View File

@ -21,13 +21,11 @@ import java.io.InputStream
import java.lang.reflect.Method import java.lang.reflect.Method
import java.util.zip.ZipInputStream import java.util.zip.ZipInputStream
open class ZipInterceptor { object ImageDecoderWrapper {
private var decodeMethod: Method private var decodeMethod: Method
private var newInstanceMethod: Method private var newInstanceMethod: Method
private var classSignature = ClassSignature.Newest private var classSignature = ClassSignature.Newest
private val dataUriRegex = Regex("""base64,([0-9a-zA-Z/+=\s]+)""")
private enum class ClassSignature { private enum class ClassSignature {
Old, New, Newest Old, New, Newest
} }
@ -40,7 +38,6 @@ open class ZipInterceptor {
val inputStreamClass = InputStream::class.java val inputStreamClass = InputStream::class.java
try { try {
// Mihon Preview r6595+
classSignature = ClassSignature.Newest classSignature = ClassSignature.Newest
// decode(region, sampleSize) // decode(region, sampleSize)
@ -59,7 +56,6 @@ open class ZipInterceptor {
) )
} catch (_: NoSuchMethodException) { } catch (_: NoSuchMethodException) {
try { try {
// Mihon Stable & forks
classSignature = ClassSignature.New classSignature = ClassSignature.New
// decode(region, rgb565, sampleSize, applyColorManagement, displayProfile) // decode(region, rgb565, sampleSize, applyColorManagement, displayProfile)
@ -79,7 +75,6 @@ open class ZipInterceptor {
booleanClass, booleanClass,
) )
} catch (_: NoSuchMethodException) { } catch (_: NoSuchMethodException) {
// Tachiyomi J2k
classSignature = ClassSignature.Old classSignature = ClassSignature.Old
// decode(region, rgb565, sampleSize) // decode(region, rgb565, sampleSize)
@ -126,7 +121,10 @@ open class ZipInterceptor {
return bitmap return bitmap
} }
}
open class ZipInterceptor {
private val dataUriRegex = Regex("""base64,([0-9a-zA-Z/+=\s]+)""")
open fun zipGetByteStream(request: Request, response: Response): InputStream { open fun zipGetByteStream(request: Request, response: Response): InputStream {
return response.body.byteStream() return response.body.byteStream()
@ -165,7 +163,7 @@ open class ZipInterceptor {
Base64.decode(b64, Base64.DEFAULT) Base64.decode(b64, Base64.DEFAULT)
} }
entryIndex to decodeImage(imageData, isLowRamDevice, filename, entryName) entryIndex to ImageDecoderWrapper.decodeImage(imageData, isLowRamDevice, filename, entryName)
} }
.sortedBy { it.first } .sortedBy { it.first }
.toList() .toList()