mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-10 06:42:07 +01:00
Revert Dex2Jar (#721)
* Revert attempts to fix Dex2Jar * Revert to v64 of Dex2Jar
This commit is contained in:
@@ -6,7 +6,7 @@ okhttp = "5.0.0-alpha.11" # Major version is locked by Tachiyomi extensions
|
||||
javalin = "4.6.8" # Javalin 5.0.0+ requires Java 11
|
||||
jackson = "2.13.3" # jackson version locked by javalin, ref: `io.javalin.core.util.OptionalDependency`
|
||||
exposed = "0.40.1"
|
||||
dex2jar = "v74"
|
||||
dex2jar = "v64" # Stuck until https://github.com/ThexXTURBOXx/dex2jar/issues/27 is fixed
|
||||
rhino = "1.7.14"
|
||||
settings = "1.0.0-RC"
|
||||
twelvemonkeys = "3.9.4"
|
||||
|
||||
@@ -119,36 +119,6 @@ object BytecodeEditor {
|
||||
return classReference
|
||||
}
|
||||
|
||||
/**
|
||||
* List of methods that will be fixed. Remove once https://github.com/ThexXTURBOXx/dex2jar/issues/27
|
||||
* is fixed.
|
||||
*/
|
||||
private val methodsToFix =
|
||||
mapOf(
|
||||
("kotlin/time/Duration" to "getInWholeMilliseconds_impl") to "getInWholeMilliseconds-impl",
|
||||
("kotlin/Result" to "constructor_impl") to "constructor-impl",
|
||||
("kotlin/Result" to "isFailure_impl") to "isFailure-impl",
|
||||
)
|
||||
|
||||
/**
|
||||
* Replace references to the method, used in places that have
|
||||
* other text around the class references
|
||||
*
|
||||
* @param clazz Class the method is in
|
||||
*
|
||||
* @return [String] with method reference replaced, or null if [String] or [clazz] was null
|
||||
*/
|
||||
private fun String?.replaceMethodIndirectly(clazz: String?): String? {
|
||||
if (clazz == null || this == null) return this
|
||||
var method: String = this
|
||||
methodsToFix.forEach {
|
||||
if (clazz == it.key.first) {
|
||||
method = method.replace(it.key.second, it.value)
|
||||
}
|
||||
}
|
||||
return method
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace all references to certain classes inside the class file
|
||||
* with ones that behave more like Androids
|
||||
@@ -254,7 +224,7 @@ object BytecodeEditor {
|
||||
super.visitMethodInsn(
|
||||
opcode,
|
||||
owner.replaceDirectly(),
|
||||
name.replaceMethodIndirectly(owner),
|
||||
name,
|
||||
desc.replaceIndirectly(),
|
||||
itf,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user