Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassNotFoundException android.view.WindowManager.LayoutParams #38

Open
GauriSpears opened this issue Jan 2, 2025 · 1 comment
Open

Comments

@GauriSpears
Copy link

GauriSpears commented Jan 2, 2025

I try to prevent applications from creating windows over all other applications, original XPrivacy could handle this: https://github.com/M66B/XPrivacy/blob/b88626cde79f3b2d249298292902ba02678ec1af/src/biz/bokhorst/xprivacy/XWindowManager.java#L56
As an example target I took DevInfoOverlay: https://play.google.com/store/apps/details?id=ru.andr7e.devinfooverlay
A try to hijack WindowManager.addView - here is my definition:
addView.json
As a result - class of the second argument not found:

PrivacyEx.addView

java.lang.ClassNotFoundException: android.view.WindowManager.LayoutParams
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:607)
at eu.faircode.xlua.utilities.ReflectUtilEx.resolveClass(SourceFile:33)
at eu.faircode.xlua.hooks.XHookUtil.getParameterTypes(SourceFile:3)
at eu.faircode.xlua.hooks.XHookUtil.resolveTargetHook(SourceFile:11)
at eu.faircode.xlua.XLua.hookPackage(SourceFile:20)
at eu.faircode.xlua.XLua$4.afterHookedMethod(SourceFile:9)
at j.TcFZoj.Om.q.v.nd.orP.XposedBridge$LegacyApiSupport.handleAfter(Unknown Source:33)
at org.lsposed.lspd.impl.LSPosedBridge$NativeHooker.callback(Unknown Source:279)
at LSPHooker_.newApplication(Unknown Source:17)
at android.app.LoadedApk.makeApplicationInner(LoadedApk.java:1467)
at android.app.LoadedApk.makeApplicationInner(LoadedApk.java:1399)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7270)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2337)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8498)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
Caused by: java.lang.ClassNotFoundException: android.view.WindowManager.LayoutParams
... 22 more

I also tried android.view.ViewGroup.LayoutParams instead of android.view.WindowManager.LayoutParams - result is the same.

@GauriSpears
Copy link
Author

I found that it was a common Xposed issue when it was needed to load class from classes2.dex of multi-dex apk. But it's not that case: given target has only one classes.dex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant