Revert Dex2Jar (#721)

* Revert attempts to fix Dex2Jar

* Revert to v64 of Dex2Jar
This commit is contained in:
Mitchell Syer
2023-10-16 20:13:06 -04:00
committed by GitHub
parent 150416b578
commit 029f445d0a
2 changed files with 2 additions and 32 deletions

View File

@@ -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"

View File

@@ -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,
)