Skip to content

Commit

Permalink
fix: set accessible for field
Browse files Browse the repository at this point in the history
  • Loading branch information
Mufanc committed May 24, 2024
1 parent 70506fb commit 2529869
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion app/src/main/java/xyz/mufanc/applock/core/ClassMagic.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package xyz.mufanc.applock.core

import android.util.ArrayMap
import xyz.mufanc.applock.core.util.ClassUtil
import xyz.mufanc.applock.core.util.GraftClassLoader
import xyz.mufanc.applock.core.util.Log
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/xyz/mufanc/applock/core/ModuleMain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package xyz.mufanc.applock.core

import android.os.Handler
import android.os.Looper
import android.util.ArrayMap
import androidx.annotation.Keep
import io.github.libxposed.api.XposedInterface
import io.github.libxposed.api.XposedModule
Expand All @@ -11,7 +10,6 @@ import io.github.libxposed.api.XposedModuleInterface.ModuleLoadedParam
import xyz.mufanc.applock.core.process.KillProcessMonitor
import xyz.mufanc.applock.core.process.guard.ProcessGuard
import xyz.mufanc.applock.core.scope.ScopeManager
import xyz.mufanc.applock.core.util.ClassUtil
import xyz.mufanc.applock.core.util.GraftClassLoader
import xyz.mufanc.applock.core.util.Log
import xyz.mufanc.applock.util.Configs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data object PowerManagerProvider : ScopeProvider() {
field.name.matches("this\\$\\d+".toRegex())
} ?: return false

val controller = controllerField.get(binderService)
val controller = controllerField.apply { isAccessible = true }.get(binderService)
whitelistApps = Reflect.on(controller).get("mPowerSaveWhitelistUserApps")

return whitelistApps != null
Expand Down

0 comments on commit 2529869

Please sign in to comment.