mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2025-01-26 07:15:30 +01:00
fixes from the inspector project
This commit is contained in:
parent
760d1116a1
commit
ad2ea8095b
@ -55,25 +55,25 @@ object Extension {
|
|||||||
val reader = MultiDexFileReader.open(Files.readAllBytes(File(dexFile).toPath()))
|
val reader = MultiDexFileReader.open(Files.readAllBytes(File(dexFile).toPath()))
|
||||||
val handler = BaksmaliBaseDexExceptionHandler()
|
val handler = BaksmaliBaseDexExceptionHandler()
|
||||||
Dex2jar
|
Dex2jar
|
||||||
.from(reader)
|
.from(reader)
|
||||||
.withExceptionHandler(handler)
|
.withExceptionHandler(handler)
|
||||||
.reUseReg(false)
|
.reUseReg(false)
|
||||||
.topoLogicalSort()
|
.topoLogicalSort()
|
||||||
.skipDebug(true)
|
.skipDebug(true)
|
||||||
.optimizeSynchronized(false)
|
.optimizeSynchronized(false)
|
||||||
.printIR(false)
|
.printIR(false)
|
||||||
.noCode(false)
|
.noCode(false)
|
||||||
.skipExceptions(false)
|
.skipExceptions(false)
|
||||||
.to(jarFilePath)
|
.to(jarFilePath)
|
||||||
if (handler.hasException()) {
|
if (handler.hasException()) {
|
||||||
val errorFile: Path = File(ApplicationDirs.extensionsRoot).toPath().resolve("$fileNameWithoutType-error.txt")
|
val errorFile: Path = File(ApplicationDirs.extensionsRoot).toPath().resolve("$fileNameWithoutType-error.txt")
|
||||||
logger.error(
|
logger.error(
|
||||||
"Detail Error Information in File $errorFile\n" +
|
"Detail Error Information in File $errorFile\n" +
|
||||||
"Please report this file to one of following link if possible (any one).\n" +
|
"Please report this file to one of following link if possible (any one).\n" +
|
||||||
" https://sourceforge.net/p/dex2jar/tickets/\n" +
|
" https://sourceforge.net/p/dex2jar/tickets/\n" +
|
||||||
" https://bitbucket.org/pxb1988/dex2jar/issues\n" +
|
" https://bitbucket.org/pxb1988/dex2jar/issues\n" +
|
||||||
" https://github.com/pxb1988/dex2jar/issues\n" +
|
" https://github.com/pxb1988/dex2jar/issues\n" +
|
||||||
" dex2jar@googlegroups.com"
|
" dex2jar@googlegroups.com"
|
||||||
)
|
)
|
||||||
handler.dump(errorFile, emptyArray<String>())
|
handler.dump(errorFile, emptyArray<String>())
|
||||||
}
|
}
|
||||||
@ -90,8 +90,8 @@ object Extension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data class InstallableAPK(
|
data class InstallableAPK(
|
||||||
val apkFilePath: String,
|
val apkFilePath: String,
|
||||||
val pkgName: String
|
val pkgName: String
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun installExtension(pkgName: String): Int {
|
suspend fun installExtension(pkgName: String): Int {
|
||||||
@ -118,10 +118,12 @@ object Extension {
|
|||||||
val extensionRecord: ResultRow = transaction {
|
val extensionRecord: ResultRow = transaction {
|
||||||
ExtensionTable.select { ExtensionTable.apkName eq apkName }.firstOrNull()
|
ExtensionTable.select { ExtensionTable.apkName eq apkName }.firstOrNull()
|
||||||
} ?: {
|
} ?: {
|
||||||
ExtensionTable.insert {
|
transaction {
|
||||||
it[this.apkName] = apkName
|
ExtensionTable.insert {
|
||||||
|
it[this.apkName] = apkName
|
||||||
|
}
|
||||||
|
ExtensionTable.select { ExtensionTable.apkName eq apkName }.firstOrNull()!!
|
||||||
}
|
}
|
||||||
ExtensionTable.select { ExtensionTable.apkName eq apkName }.firstOrNull()!!
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
val extensionId = extensionRecord[ExtensionTable.id]
|
val extensionId = extensionRecord[ExtensionTable.id]
|
||||||
@ -140,7 +142,7 @@ object Extension {
|
|||||||
dex2jar(dexFilePath, jarFilePath, fileNameWithoutType)
|
dex2jar(dexFilePath, jarFilePath, fileNameWithoutType)
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
File(apkFilePath).delete()
|
// File(apkFilePath).delete()
|
||||||
File(dexFilePath).delete()
|
File(dexFilePath).delete()
|
||||||
|
|
||||||
// update sources of the extension
|
// update sources of the extension
|
||||||
@ -258,7 +260,7 @@ object Extension {
|
|||||||
|
|
||||||
return getCachedImageResponse(saveDir, apkName) {
|
return getCachedImageResponse(saveDir, apkName) {
|
||||||
network.client.newCall(
|
network.client.newCall(
|
||||||
GET(iconUrl)
|
GET(iconUrl)
|
||||||
).await()
|
).await()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user