java.lang.Object | |
↳ | de.robv.android.xposed.XposedBridge |
This class contains most of Xposed's central logic, such as initialization and callbacks used by the native side. It also includes methods to add new hooks.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BOOTCLASSLOADER | The system class loader which can be used to locate Android framework classes. | ||||||||||
XPOSED_BRIDGE_VERSION |
This field was deprecated
in API level 65.
Use getXposedVersion() instead.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the currently installed version of the Xposed framework.
| |||||||||||
Hook all constructors of the specified class.
| |||||||||||
Hooks all methods with a certain name that were declared in the specified class.
| |||||||||||
Hook any method (or constructor) with the specified callback.
| |||||||||||
Basically the same as
Method.invoke(Object, Object...) , but calls the original method
as it was before the interception by Xposed.
| |||||||||||
Writes a message to the Xposed error log.
| |||||||||||
Logs a stack trace to the Xposed error log.
| |||||||||||
This method was deprecated
in API level 81.
Use
XC_MethodHook.Unhook.unhook() instead. An instance of the Unhook
class is returned when you hook the method.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
The system class loader which can be used to locate Android framework classes. Application classes cannot be retrieved from it.
Returns the currently installed version of the Xposed framework.
Hook all constructors of the specified class.
hookClass | The class to check for constructors. |
---|---|
callback | The callback to be executed when the hooked constructors are called. |
Hooks all methods with a certain name that were declared in the specified class. Inherited
methods and constructors are not considered. For constructors, use
hookAllConstructors(Class>, XC_MethodHook)
instead.
hookClass | The class to check for declared methods. |
---|---|
methodName | The name of the method(s) to hook. |
callback | The callback to be executed when the hooked methods are called. |
Hook any method (or constructor) with the specified callback. See below for some wrappers that make it easier to find a method/constructor in one step.
hookMethod | The method to be hooked. |
---|---|
callback | The callback to be executed when the hooked method is called. |
XposedHelpers.findAndHookMethod(String, ClassLoader, String, Object...)
XposedHelpers.findAndHookMethod(Class, String, Object...)
hookAllMethods(Class>, String, XC_MethodHook)
XposedHelpers.findAndHookConstructor(String, ClassLoader, Object...)
XposedHelpers.findAndHookConstructor(Class, Object...)
hookAllConstructors(Class>, XC_MethodHook)
Basically the same as Method.invoke(Object, Object...)
, but calls the original method
as it was before the interception by Xposed. Also, access permissions are not checked.
There are very few cases where this method is needed. A common mistake is
to replace a method and then invoke the original one based on dynamic conditions. This
creates overhead and skips further hooks by other modules. Instead, just hook (don't replace)
the method and call param.setResult(null)
in XC_MethodHook.beforeHookedMethod(XC_MethodHook.MethodHookParam)
if the original method should be skipped.
method | The method to be called. |
---|---|
thisObject | For non-static calls, the "this" pointer, otherwise null . |
args | Arguments for the method call as Object[] array. |
NullPointerException | if receiver == null for a non-static method |
---|---|
IllegalAccessException | if this method is not accessible (see AccessibleObject ) |
IllegalArgumentException | if the number of arguments doesn't match the number of parameters, the receiver is incompatible with the declaring class, or an argument could not be unboxed or converted by a widening conversion to the corresponding parameter type |
InvocationTargetException | if an exception was thrown by the invoked method |
Writes a message to the Xposed error log.
DON'T FLOOD THE LOG!!! This is only meant for error logging. If you want to write information/debug messages, use logcat.
text | The log message. |
---|
Logs a stack trace to the Xposed error log.
DON'T FLOOD THE LOG!!! This is only meant for error logging. If you want to write information/debug messages, use logcat.
t | The Throwable object for the stack trace. |
---|
This method was deprecated
in API level 81.
Use XC_MethodHook.Unhook.unhook()
instead. An instance of the Unhook
class is returned when you hook the method.
Removes the callback for a hooked method/constructor.
hookMethod | The method for which the callback should be removed. |
---|---|
callback | The reference to the callback as specified in hookMethod(Member, XC_MethodHook) .
|