Of course, you can learn how to create a xposed module. So you can read this tutorial (the official tutorial) to learn how to solve this problem. This not only explains how to create a new module, how to write a module, we want to think more deeply, why follow these steps, why to create this class. If you are a person like Dr. Tl, you can read the section "Making the Project an xposed module" directly. If you want to read the entire tutorial then you need to have a good understanding of the skills. You will spend time reading this article, because you can't but solve any problem on your own.
here). Looking at the class Xposedbridge, you can see the main method. This is what I wrote above, this class will be invoked before the process starts. At that time, perform some initialization and module loading (I'll explain the module loading later).
Download Xposedbridgeapi-.jar here. Copy it to the subfolder named Lib directory. Then right-click on it and select Build path => Add to build path. You need to insert the version name into the Xposedminversion declaration list. Transferred from
You can choose how you want to reference the library. But make sure your API class is correctly compiled into the apk file, otherwise you'll get a illegalaccesserror. By referencing the Libs file (with "s"), you can use the simple settings of eclipse to not include the Xposedbridgeapi-.jar.
here) and browse him. But this official ROM may not be the same as yours, but in this case it is a similar or even identical implementation. First, I would like to see AOSP to see if it is the same. If I need more details, look at the actual decompile code.
You can look for the "clock" class name or the class that contains the string. The next step is to find the resources and the layout that he uses. If you download the official AOSP code, you can start looking for it here: Frameworks/base/packages/systemui. You will find a lot of places where the "clock" appears. This is normal and there are different ways to implement the changes. Keep in mind that you can only hook methods. So you have to find a place where you can insert some code before, after, or all of them. You should hook up with as specific a method as possible, instead of being called thousands of ways to avoid performance problems and unexpected side effects.
In this case, you may find that this layout layout res/layout/status_bar.xml contains a custom view class: Com.android.systemui.statusbar.policy.Clock. Multiple thoughts may now be in your mind. The text color is defined by the Textappearance property, so the easiest way to change it is to change the definition of the appearance. However, this may or may not work (because it may exist in deeper native code). Changing the layout status bar will be possible, but you can only make the smallest changes to change him, instead, look at this class. There is a call updateclock method that looks like it will be called every minute to update the time
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/
It looks like the perfect modification because it is the only very specific way to set the text clock. If we change the color or font of this clock, then any call to this method will be affected by this. We'll do what we need, and we'll do it right away.
(Separate text color, here's a better way.) See "Modify Layout" example in "replacing resources".
A method of the helper class. Note that it is statically imported and will be automatically added if you configure the link page it describes. This method finds the clock class in the ClassLoader package by ClassLoader. Then, it will find the Updateclock method inside. If this method has any arguments, then you must list the types of these parameters. Different situations are handled differently, but our method has no parameters and can skip this assumption. As the last parameter, you need to provide an implementation of the Xc_methodhook class. For minor changes, you can use an anonymous class. If you have too much code, it's a good idea to create an ordinary class and just create an instance here. Subsequently, the helper will do everything possible to hook the above function.
You can rewrite the Xc_methodhook two methods. You can overwrite at the same time, not even do the operation, but the latter is completely meaningless. These two methods are Beforehookedmethod and Afterhookedmethod. It is not too hard to guess that these two methods will be executed before and after the original method. You can use the Beforehookedmethod method to evaluate/tamper with the parameters of the method invocation (through Param.args), or even to prevent the original method from being invoked (sending your own results). The Afterhookedmethod method can be used to do things based on the results of the original method. You can also use it to manipulate the results. Of course, you can add your own code that will be executed exactly before or after the original method.
(If you want to completely replace the method, look at the subclass Xc_methodreplacement instead, you just need to overwrite Replacehookedmethod)
Xposedbridge retains a list of registered callback functions that record each function that has been hook. Those with the highest priority, such as the Hookmethod definition, are called first. The original method is always the lowest priority. So, if you hook up a function and register a callback A (Prio high) and B (prio default), then whenever the hook method is invoked, the control flow will be: A.before-> B.before-> The original Method-> B.after- > A.after. Therefore, a modified parameter, B is visible, so that you can change it more than once before passing it to the original method. The result of the original method is first processed by B, but the result of the original method's final return is determined by a.