mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-03 10:54:38 -05:00
improve logging
This commit is contained in:
@@ -42,7 +42,7 @@ import java.nio.file.Path
|
|||||||
object Extension {
|
object Extension {
|
||||||
private val logger = KotlinLogging.logger {}
|
private val logger = KotlinLogging.logger {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert dex to jar, a wrapper for the dex2jar library
|
* Convert dex to jar, a wrapper for the dex2jar library
|
||||||
*/
|
*/
|
||||||
private fun dex2jar(dexFile: String, jarFile: String, fileNameWithoutType: String) {
|
private fun dex2jar(dexFile: String, jarFile: String, fileNameWithoutType: String) {
|
||||||
@@ -77,7 +77,7 @@ object Extension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* loads the extension main class called $className from the jar located at $jarPath
|
* loads the extension main class called $className from the jar located at $jarPath
|
||||||
* It may return an instance of HttpSource or SourceFactory depending on the extension.
|
* It may return an instance of HttpSource or SourceFactory depending on the extension.
|
||||||
*/
|
*/
|
||||||
@@ -106,8 +106,8 @@ object Extension {
|
|||||||
downloadAPKFile(apkToDownload, apkFilePath)
|
downloadAPKFile(apkToDownload, apkFilePath)
|
||||||
|
|
||||||
val className: String = APKExtractor.extractDexAndReadClassname(apkFilePath, dexFilePath)
|
val className: String = APKExtractor.extractDexAndReadClassname(apkFilePath, dexFilePath)
|
||||||
logger.debug(className)
|
logger.debug("Main class for extension is $className")
|
||||||
// dex -> jar
|
|
||||||
dex2jar(dexFilePath, jarFilePath, fileNameWithoutType)
|
dex2jar(dexFilePath, jarFilePath, fileNameWithoutType)
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
@@ -180,6 +180,7 @@ object Extension {
|
|||||||
downloadedFile.sink().buffer().use { sink ->
|
downloadedFile.sink().buffer().use { sink ->
|
||||||
response.body!!.source().use { source ->
|
response.body!!.source().use { source ->
|
||||||
sink.writeAll(source)
|
sink.writeAll(source)
|
||||||
|
sink.flush()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user