Skip to content

Commit 2bd01ef

Browse files
committed
Improve Alternative Xposed Framework compatibility
1 parent 519c284 commit 2bd01ef

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

app/src/main/java/io/github/chsbuffer/revancedxposed/Helper.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ fun injectHostClassLoaderToSelf(self: ClassLoader, classLoader: ClassLoader) {
130130
val bootClassLoader = Context::class.java.classLoader!!
131131

132132
self.setObjectField("parent", object : ClassLoader(bootClassLoader) {
133-
override fun findClass(name: String?): Class<*> {
133+
val denyList = listOf("app.revanced")
134+
override fun findClass(name: String): Class<*> {
134135
try {
135136
return bootClassLoader.loadClass(name)
136137
} catch (_: ClassNotFoundException) {
@@ -140,8 +141,10 @@ fun injectHostClassLoaderToSelf(self: ClassLoader, classLoader: ClassLoader) {
140141
return loader.loadClass(name)
141142
} catch (_: ClassNotFoundException) {
142143
}
144+
143145
try {
144-
return host.loadClass(name)
146+
if (denyList.all { !name.startsWith(it) })
147+
return host.loadClass(name)
145148
} catch (_: ClassNotFoundException) {
146149
}
147150

app/src/main/java/io/github/chsbuffer/revancedxposed/common/UpdateChecker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class UpdateChecker(private val context: Context) : CoroutineScope {
8686
fun autoCheckUpdate() {
8787
if (Random.nextInt(0, 10) != 0) return
8888
Logger.printInfo { "start auto check update." }
89-
checkUpdate()
89+
runCatching { checkUpdate() }
9090
}
9191

9292
fun checkUpdate() {

0 commit comments

Comments
 (0)