mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2026-01-20 09:53:55 +00:00
Compare commits
2 Commits
v20.0.1-de
...
v20.0.1-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2875d1d64 | ||
|
|
2be6e97817 |
@@ -1,3 +1,10 @@
|
|||||||
|
## [20.0.1-dev.4](https://github.com/ReVanced/revanced-patcher/compare/v20.0.1-dev.3...v20.0.1-dev.4) (2024-10-07)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Make it work on Android by not using APIs from JVM unavailable to Android. ([2be6e97](https://github.com/ReVanced/revanced-patcher/commit/2be6e97817437f40e17893dfff3bea2cd4c3ff9e))
|
||||||
|
|
||||||
## [20.0.1-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v20.0.1-dev.2...v20.0.1-dev.3) (2024-10-03)
|
## [20.0.1-dev.3](https://github.com/ReVanced/revanced-patcher/compare/v20.0.1-dev.2...v20.0.1-dev.3) (2024-10-03)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
version = 20.0.1-dev.3
|
version = 20.0.1-dev.4
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ import lanchon.multidexlib2.BasicDexFileNamer
|
|||||||
import lanchon.multidexlib2.MultiDexIO
|
import lanchon.multidexlib2.MultiDexIO
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
|
import java.lang.reflect.Member
|
||||||
|
import java.lang.reflect.Method
|
||||||
|
import java.lang.reflect.Modifier
|
||||||
import java.net.URLClassLoader
|
import java.net.URLClassLoader
|
||||||
import java.util.jar.JarFile
|
import java.util.jar.JarFile
|
||||||
import kotlin.reflect.KProperty
|
import kotlin.reflect.KProperty
|
||||||
@@ -636,7 +639,7 @@ sealed class PatchLoader private constructor(
|
|||||||
*/
|
*/
|
||||||
private val Class<*>.patchFields
|
private val Class<*>.patchFields
|
||||||
get() = fields.filter { field ->
|
get() = fields.filter { field ->
|
||||||
field.type.isPatch && field.canAccess(null)
|
field.type.isPatch && field.canAccess()
|
||||||
}.map { field ->
|
}.map { field ->
|
||||||
field.get(null) as Patch<*>
|
field.get(null) as Patch<*>
|
||||||
}
|
}
|
||||||
@@ -646,7 +649,7 @@ sealed class PatchLoader private constructor(
|
|||||||
*/
|
*/
|
||||||
private val Class<*>.patchMethods
|
private val Class<*>.patchMethods
|
||||||
get() = methods.filter { method ->
|
get() = methods.filter { method ->
|
||||||
method.returnType.isPatch && method.parameterCount == 0 && method.canAccess(null)
|
method.returnType.isPatch && method.parameterCount == 0 && method.canAccess()
|
||||||
}.map { method ->
|
}.map { method ->
|
||||||
method.invoke(null) as Patch<*>
|
method.invoke(null) as Patch<*>
|
||||||
}
|
}
|
||||||
@@ -670,6 +673,12 @@ sealed class PatchLoader private constructor(
|
|||||||
it.name != null
|
it.name != null
|
||||||
}.toSet()
|
}.toSet()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun Member.canAccess(): Boolean {
|
||||||
|
if (this is Method && parameterCount != 0) return false
|
||||||
|
|
||||||
|
return Modifier.isStatic(modifiers) && Modifier.isPublic(modifiers)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user