类 AbsMainProcessPlugin<E extends BaseExtension>
- java.lang.Object
-
- com.ss.android.ugc.bytex.common.AbsPlugin<E>
-
- com.ss.android.ugc.bytex.common.flow.main.AbsMainProcessPlugin<E>
-
- 所有已实现的接口:
MainProcessHandler,IPlugin,org.gradle.api.Plugin<org.gradle.api.Project>
- 直接已知子类:
CommonPlugin
public abstract class AbsMainProcessPlugin<E extends BaseExtension> extends AbsPlugin<E> implements MainProcessHandler
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 com.ss.android.ugc.bytex.common.IPlugin
IPlugin.HookType
-
-
构造器概要
构造器 构造器 说明 AbsMainProcessPlugin()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterExecute()插件执行执行结束后的回调,不管成功和失败都会执行.做一些数据回收处理工作voidafterTransform(TransformEngine engine)用于transform完成后,进行各种illegal check It's usually used for plugin's custom illegal check after transform.voidbeforeTransform(TransformEngine engine)用于transform前的准备工作 Prepare for real transform.TransformFlowgetTransformFlow()voidinit()booleanneedPreVerify()这个Handler是不是要求在真正执行前进行一次校验 Verify bytecode before transform.booleanneedVerify()在执行完这个Handler后是否需要进行一次校验 Verify bytecode after transform.java.util.List<FileProcessor>process(Process process)在traverse和transform的过程中,加入自定义的FileProcessor,提供更大的灵活性。protected TransformFlowprovideTransformFlow(MainTransformFlow mainFlow, TransformContext transformContext)create a new transformFlow or just return mainFlow and append a handler.TransformFlowregisterTransformFlow(MainTransformFlow mainFlow, TransformContext transformContext)Each ByteX plugin can have its own TransformFlow, and the return value of this method determines which flow the plugin runs in.
We mark it as final because TransformFlow should register only oncebooleantransform(java.lang.String relativePath, ClassVisitorChain chain)handle 工程中的所有class To process all classed in the whole project.booleantransform(java.lang.String relativePath, org.objectweb.asm.tree.ClassNode node)handle 工程中的所有class To process all classed in the whole project.voidtraverse(java.lang.String relativePath, ClassVisitorChain chain)遍历工程中所有的class Traverse all classes in the whole project.voidtraverse(java.lang.String relativePath, org.objectweb.asm.tree.ClassNode node)遍历工程中所有的class Traverse all classes in the whole project.voidtraverseAndroidJar(java.lang.String relativePath, ClassVisitorChain chain)遍历android.jar中所有的class Traverse all classes in android.jar.voidtraverseAndroidJar(java.lang.String relativePath, org.objectweb.asm.tree.ClassNode node)遍历android.jar中所有的class Traverse all classes in android.jar.-
从类继承的方法 com.ss.android.ugc.bytex.common.AbsPlugin
alone, apply, createExtension, enable, getExtension, getExtensionClass, getTransform, isRunningAlone, name, onApply, startExecute
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 com.ss.android.ugc.bytex.common.IPlugin
hookTask, hookTask, hookTransformName, shouldSaveCache, transformConfiguration
-
从接口继承的方法 com.ss.android.ugc.bytex.common.flow.main.MainProcessHandler
beforeTraverse, flagForClassReader, flagForClassWriter, init, isOnePassEnough, startRunning, traverseIncremental, traverseIncremental
-
-
-
-
方法详细资料
-
init
public void init()
从接口复制的说明:MainProcessHandler- 指定者:
init在接口中MainProcessHandler
-
traverse
public void traverse(@Nonnull java.lang.String relativePath, @Nonnull ClassVisitorChain chain)从接口复制的说明:MainProcessHandler遍历工程中所有的class Traverse all classes in the whole project.- 指定者:
traverse在接口中MainProcessHandler- 参数:
relativePath- class的相对路径。 relative path of classchain- ClassVisitorChain用于加入自定义的ClassVisitor。 ASM visitor api. ClassVisitorChain is used for appending your custom ClassVisitor.
-
traverseAndroidJar
public void traverseAndroidJar(@Nonnull java.lang.String relativePath, @Nonnull ClassVisitorChain chain)从接口复制的说明:MainProcessHandler遍历android.jar中所有的class Traverse all classes in android.jar.- 指定者:
traverseAndroidJar在接口中MainProcessHandler- 参数:
relativePath- class的相对路径。 relative path of classchain- ClassVisitorChain用于加入自定义的ClassVisitor。 ASM visitor api. ClassVisitorChain is used for appending your custom ClassVisitor.
-
traverse
public void traverse(@Nonnull java.lang.String relativePath, @Nonnull org.objectweb.asm.tree.ClassNode node)从接口复制的说明:MainProcessHandler遍历工程中所有的class Traverse all classes in the whole project.- 指定者:
traverse在接口中MainProcessHandler- 参数:
relativePath- class的相对路径。 relative path of classnode- class的数据结构(照顾喜欢用tree api的同学)。 ASM tree api.
-
traverseAndroidJar
public void traverseAndroidJar(@Nonnull java.lang.String relativePath, @Nonnull org.objectweb.asm.tree.ClassNode node)从接口复制的说明:MainProcessHandler遍历android.jar中所有的class Traverse all classes in android.jar.- 指定者:
traverseAndroidJar在接口中MainProcessHandler- 参数:
relativePath- class的相对路径。 relative path of classnode- class的数据结构(照顾喜欢用tree api的同学)。 ASM tree api.
-
beforeTransform
public void beforeTransform(@Nonnull TransformEngine engine)从接口复制的说明:MainProcessHandler用于transform前的准备工作 Prepare for real transform.- 指定者:
beforeTransform在接口中MainProcessHandler- 参数:
engine- from TransformEngine
-
transform
public boolean transform(@Nonnull java.lang.String relativePath, @Nonnull ClassVisitorChain chain)从接口复制的说明:MainProcessHandlerhandle 工程中的所有class To process all classed in the whole project.- 指定者:
transform在接口中MainProcessHandler- 参数:
relativePath- class的相对路径。 relative path of classchain- ClassVisitorChain用于注册自定义的ClassVisitor。 ASM visitor api. ClassVisitorChain is used for appending your custom ClassVisitor.- 返回:
- if false, this class file would be deleted, otherwise it would be output after transform.
-
transform
public boolean transform(@Nonnull java.lang.String relativePath, @Nonnull org.objectweb.asm.tree.ClassNode node)从接口复制的说明:MainProcessHandlerhandle 工程中的所有class To process all classed in the whole project.- 指定者:
transform在接口中MainProcessHandler- 参数:
relativePath- class的相对路径。 relative path of classnode- class的数据结构(照顾喜欢用tree api的同学)。。 ASM tree api.- 返回:
- if false, this class file would be deleted, otherwise it would be output after transform.
-
afterTransform
public void afterTransform(@Nonnull TransformEngine engine)从接口复制的说明:MainProcessHandler用于transform完成后,进行各种illegal check It's usually used for plugin's custom illegal check after transform.- 指定者:
afterTransform在接口中MainProcessHandler- 参数:
engine- from TransformEngine
-
registerTransformFlow
@Nonnull public final TransformFlow registerTransformFlow(@Nonnull MainTransformFlow mainFlow, @Nonnull TransformContext transformContext)
Each ByteX plugin can have its own TransformFlow, and the return value of this method determines which flow the plugin runs in.
We mark it as final because TransformFlow should register only once- 指定者:
registerTransformFlow在接口中IPlugin- 参数:
mainFlow- 全局的MainTransformFlow。The global MainTransformFlow- 返回:
- 当前插件关联的TransformFlow,通常返回mainFlow就可以。如果想让插件通过单独一个TransformFlow处理class文件, 这个方法需要另外return 新的TransformFlow(可以是自定义的TransformFlow,也可以new 一个MainTransformFlow)。 If this plugin is related to the global MainTransformFlow, just return `mainFlow` is OK. If you want to handle class files with a single TransformFlow, you should return a new TransformFlow. If so, this new TransformFlow would only contain this plugin.
-
getTransformFlow
public final TransformFlow getTransformFlow()
- 指定者:
getTransformFlow在接口中IPlugin- 返回:
- get the TransformFlow that the current plugin runs on
-
provideTransformFlow
protected TransformFlow provideTransformFlow(@Nonnull MainTransformFlow mainFlow, @Nonnull TransformContext transformContext)
create a new transformFlow or just return mainFlow and append a handler. It will be called byIPlugin.registerTransformFlow(MainTransformFlow, TransformContext)when handle start.- 参数:
mainFlow- main TransformFlowtransformContext- handle context- 返回:
- return a new TransformFlow object if you want make a new flow for current plugin
-
process
public java.util.List<FileProcessor> process(Process process)
从接口复制的说明:MainProcessHandler在traverse和transform的过程中,加入自定义的FileProcessor,提供更大的灵活性。 Add custom FileProcessor during traverse or transform.- 指定者:
process在接口中MainProcessHandler- 参数:
process- enum- 返回:
- list of FileProcessor
-
needPreVerify
public boolean needPreVerify()
从接口复制的说明:MainProcessHandler这个Handler是不是要求在真正执行前进行一次校验 Verify bytecode before transform.- 指定者:
needPreVerify在接口中MainProcessHandler- 返回:
- if true, indicate that need to verify bytecode. Default is false.
-
needVerify
public boolean needVerify()
从接口复制的说明:MainProcessHandler在执行完这个Handler后是否需要进行一次校验 Verify bytecode after transform.- 指定者:
needVerify在接口中MainProcessHandler- 返回:
- if true, indicate that need to verify bytecode. Default is false.
-
afterExecute
public void afterExecute() throws java.lang.Throwable从接口复制的说明:IPlugin插件执行执行结束后的回调,不管成功和失败都会执行.做一些数据回收处理工作- 指定者:
afterExecute在接口中IPlugin- 覆盖:
afterExecute在类中AbsPlugin<E extends BaseExtension>- 抛出:
java.lang.Throwable
-
-