Skip to content

Commit

Permalink
Release 4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dengshiwei committed Nov 10, 2023
1 parent ef001b4 commit 8c951e1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ plugins {

ext {
agpVersion = '7.3.1' //used for compile
pluginVersion = '4.0.0-beta' //plugin version
pluginVersion = '4.0.1' //plugin version
}
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true

#sensorsAnalytics.isHookOnMethodEnter=true
#sensorsAnalytics.isAndroidTv=true
#sensorsAnalytics.asmVersion=ASM7
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.sensorsdata.analytics.android.plugin.common

object VersionConstant {
//Plugin Version
const val VERSION = "4.0.0-beta"
const val VERSION = "4.0.1"
// MIN SDK Version
const val MIN_SDK_VERSION = "6.6.9"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import com.sensorsdata.analytics.android.plugin.extension.SAExtension
import com.sensorsdata.analytics.android.plugin.visitor.SensorsAnalyticsMethodCell
import org.objectweb.asm.ClassVisitor
import java.util.*
import java.util.concurrent.CopyOnWriteArrayList

class SAConfigHookHelper() {
// 当前 class 文件对应的控制项,单个 class 文件共用
private var sClassInConfigCells = ArrayList<SensorsAnalyticsMethodCell>()
private var sClassInConfigCells = CopyOnWriteArrayList<SensorsAnalyticsMethodCell>()

// 扫描当前类命中的控制项
private val mHookMethodCells = ArrayList<SensorsAnalyticsMethodCell>()
private val mHookMethodCells = CopyOnWriteArrayList<SensorsAnalyticsMethodCell>()

fun initConfigCellInClass(className: String) {
sClassInConfigCells.clear()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object SAUtils {
val maxLength = Math.max(v1Array.size, v2Array.size);
var str1: String?
var str2: String?
for (index in 0..maxLength) {
for (index in 0 until maxLength) {
if (v1Array.size > index) {
str1 = v1Array[index]
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,10 @@ class SensorsAutoTrackMethodVisitor(
val sensorsAnalyticsMethodCell: SensorsAnalyticsMethodCell? =
SensorsFragmentHookConfig.FRAGMENT_METHODS[nameDesc]
localIds = ArrayList()
val types = Type.getArgumentTypes(
desc
)
for (i in 1 until sensorsAnalyticsMethodCell!!.paramsCount) {
val localId = newLocal(types[i - 1])
mMethodVisitor.visitVarInsn(sensorsAnalyticsMethodCell.opcodes.get(i), i)
val types = Type.getArgumentTypes(sensorsAnalyticsMethodCell?.agentDesc)
for (i in 0 until sensorsAnalyticsMethodCell!!.paramsCount) {
val localId = newLocal(types[i])
mMethodVisitor.visitVarInsn(sensorsAnalyticsMethodCell.opcodes[i], i)
mMethodVisitor.visitVarInsn(
SAUtils.convertOpcodes(
sensorsAnalyticsMethodCell.opcodes.get(i)
Expand Down Expand Up @@ -337,11 +335,11 @@ class SensorsAutoTrackMethodVisitor(
SensorsFragmentHookConfig.FRAGMENT_METHODS[nameDesc]
if (sensorsAnalyticsMethodCell != null) {
visitedFragMethods.add(nameDesc)
mMethodVisitor.visitVarInsn(ALOAD, 0)
for (i in 1 until sensorsAnalyticsMethodCell.paramsCount) {
// mMethodVisitor.visitVarInsn(ALOAD, 0)
for (i in 0 until sensorsAnalyticsMethodCell.paramsCount) {
mMethodVisitor.visitVarInsn(
sensorsAnalyticsMethodCell.opcodes.get(i),
localIds!![i - 1]
sensorsAnalyticsMethodCell.opcodes[i],
localIds!![i]
)
}
mMethodVisitor.visitMethodInsn(
Expand Down

0 comments on commit 8c951e1

Please sign in to comment.