mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-14 00:04:34 -05:00
Remove test function
This commit is contained in:
@@ -136,6 +136,7 @@ object AndroidManifestParser {
|
||||
val pathPattern: String? = null,
|
||||
)
|
||||
|
||||
@OptIn(ExperimentalXmlUtilApi::class)
|
||||
private val xml =
|
||||
XML {
|
||||
autoPolymorphic = false
|
||||
|
||||
@@ -16,36 +16,6 @@ object ResourceArscIconParser {
|
||||
val path: String,
|
||||
)
|
||||
|
||||
fun extractIcon(
|
||||
jar: Path,
|
||||
iconPath: Path,
|
||||
) {
|
||||
ZipFile
|
||||
.builder()
|
||||
.setPath(jar)
|
||||
.get()
|
||||
.use { zip ->
|
||||
val packages =
|
||||
zip
|
||||
.getInputStream(zip.getEntry("resources.arsc"))
|
||||
.use { ArscParser(it.readBytes()).parse() }
|
||||
|
||||
val icon =
|
||||
packages
|
||||
.flatMap { it.iconCandidates() }
|
||||
.maxByOrNull { it.density }
|
||||
?: return
|
||||
|
||||
val entry = zip.getEntry(icon.path) ?: return
|
||||
|
||||
zip.getInputStream(entry).use {
|
||||
iconPath.outputStream().use { out ->
|
||||
it.copyTo(out)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun extractIcon(zip: ZipFile): InputStream {
|
||||
val packages =
|
||||
zip
|
||||
|
||||
Reference in New Issue
Block a user