AOP-Code Helper
1. Description¶
This "assistant" is a plug-in for Android Studio, which is equivalent to a small helper when you use this library. It only helps you generate some AOP code, and has no effect on your code.
The plug-in generates AOP auxiliary code for the target class, including the following functions:
- @AndroidAopReplaceClass
- @AndroidAopMatchClassMethod
- @AndroidAopModifyExtendsClass
- @AndroidAopCollectMethod
Although there is such a plug-in, you also need to understand how to use this library to identify and select the generated code, and don't copy it blindly~
2. Install the plug-in¶
-
Plugin Market, search for the plug-in AndroidAOP Code Viewer in Android Studio and install it
-
👆The plug-in market needs to be reviewed and may not be the latest version
-
Click here to download the plugin, then search for how to install the local plugin
-
👆Download link here to keep up with the latest features
-
After installation, a plug-in named AOPCode will be displayed on the right side of the IDE
3. Use¶
Right-click the mouse on the code you want to cut into -> Click AndroidAOP Code -> Click AOPCode on the right to view the generated code, as shown in the figure:
4. Special instructions¶
- The generated
@AndroidAopReplaceClass
,@AndroidAopReplaceMethod
and The class name and function signature in the@AndroidAopMatchClassMethod
code are absolutely correct (Please correct me if you have any questions). - The generated
@AndroidAopReplaceMethod
Java method does not include the suspend function of the Kotlin source code - The generated
@AndroidAopReplaceMethod
method may have some deviations, so you need to compare it yourself. For example:nullable?
,Is it the type of Kotlin source code
,variable parameter type becomes array type
, etc., these cannot be guaranteed to be accurately copied