Skip to content

Commit

Permalink
2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mcxinyu committed Jun 8, 2023
1 parent f8b6d8f commit 785cae6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ android.useAndroidX=true
#android.enableJetifier=true
ANDROID_GRADLE_VERSION=8.0.2
#SO_PLUGIN_VERSION=2.0.0
SO_PLUGIN_VERSION=2.0.0-fix-local
SO_PLUGIN_VERSION=2.0.0-fix-local111
userPlugin=true

GROUP_ID=com.imf.so
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import org.gradle.api.tasks.Input
import java.io.Serializable

open class SoLoadHookExtensions : InstrumentationParameters, Serializable {
@get:Input
var enable: Boolean = true

@get:Input
var excludePackage: Set<String> = emptySet()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ open class SoLoadHookPlugin : Plugin<Project> {
val config = create("SoLoadHookConfig", SoLoadHookExtensions::class.java)
val androidComponents = findByType(AndroidComponentsExtension::class.java)
androidComponents?.onVariants { variant ->
variant.instrumentation.transformClassesWith(
SoLoadHookClassVisitorFactory::class.java,
InstrumentationScope.ALL
) {
it.skipRAndBuildConfig = config.skipRAndBuildConfig
it.excludePackage = config.excludePackage
if (config.enable) {
variant.instrumentation.transformClassesWith(
SoLoadHookClassVisitorFactory::class.java,
InstrumentationScope.ALL
) {
it.enable = config.enable
it.skipRAndBuildConfig = config.skipRAndBuildConfig
it.excludePackage = config.excludePackage
}
variant.instrumentation.setAsmFramesComputationMode(FramesComputationMode.COPY_FRAMES)
}
variant.instrumentation.setAsmFramesComputationMode(FramesComputationMode.COPY_FRAMES)
}
}
}
Expand Down

0 comments on commit 785cae6

Please sign in to comment.