Skip to content

Commit cbe8640

Browse files
author
weiqiangliu
committed
Release 3.3.2
1 parent f356674 commit cbe8640

17 files changed

+100
-21
lines changed

plugin/ext.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project.ext {
2-
pluginVersion = '3.3.1'
2+
pluginVersion = '3.3.2'
33
Properties properties = new Properties()
44
if (project.file('local.properties').exists()) {
55
properties.load(project.file('local.properties').newDataInputStream())

plugin/src/main/groovy/com/sensorsdata/analytics/android/plugin/ClassNameAnalytics.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by renqingyou on 2018/12/01.
3-
* Copyright 2015-2020 Sensors Data Inc.
3+
* Copyright 2015-2021 Sensors Data Inc.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/src/main/groovy/com/sensorsdata/analytics/android/plugin/LogUI.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by zhangwei on 2020/05/21.
3-
* Copyright 2015-2020 Sensors Data Inc.
3+
* Copyright 2015-2021 Sensors Data Inc.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/src/main/groovy/com/sensorsdata/analytics/android/plugin/Logger.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by wangzhuozhou on 2015/08/12.
3-
* Copyright 2015-2020 Sensors Data Inc.
3+
* Copyright 2015-2021 Sensors Data Inc.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/src/main/groovy/com/sensorsdata/analytics/android/plugin/SensorsAnalyticsClassVisitor.groovy

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by wangzhuohou on 2015/08/01.
3-
* Copyright 2015-2020 Sensors Data Inc.
3+
* Copyright 2015-2021 Sensors Data Inc.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -310,6 +310,60 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
310310
methodVisitor.visitVarInsn(ALOAD, 1)
311311
methodVisitor.visitVarInsn(ASTORE, firstLocalId)
312312
localIds.add(firstLocalId)
313+
} else if (nameDesc == "onGroupClick(Landroid/widget/ExpandableListView;Landroid/view/View;IJ)Z") {
314+
localIds = new ArrayList<>()
315+
int firstLocalId = newLocal(Type.getObjectType("android/widget/ExpandableListView"))
316+
methodVisitor.visitVarInsn(ALOAD, 1)
317+
methodVisitor.visitVarInsn(ASTORE, firstLocalId)
318+
localIds.add(firstLocalId)
319+
320+
int secondLocalId = newLocal(Type.getObjectType("android/view/View"))
321+
methodVisitor.visitVarInsn(ALOAD, 2)
322+
methodVisitor.visitVarInsn(ASTORE, secondLocalId)
323+
localIds.add(secondLocalId)
324+
325+
int thirdLocalId = newLocal(Type.INT_TYPE)
326+
methodVisitor.visitVarInsn(ILOAD, 3)
327+
methodVisitor.visitVarInsn(ISTORE, thirdLocalId)
328+
localIds.add(thirdLocalId)
329+
} else if (nameDesc == "onChildClick(Landroid/widget/ExpandableListView;Landroid/view/View;IIJ)Z") {
330+
localIds = new ArrayList<>()
331+
int firstLocalId = newLocal(Type.getObjectType("android/widget/ExpandableListView"))
332+
methodVisitor.visitVarInsn(ALOAD, 1)
333+
methodVisitor.visitVarInsn(ASTORE, firstLocalId)
334+
localIds.add(firstLocalId)
335+
336+
int secondLocalId = newLocal(Type.getObjectType("android/view/View"))
337+
methodVisitor.visitVarInsn(ALOAD, 2)
338+
methodVisitor.visitVarInsn(ASTORE, secondLocalId)
339+
localIds.add(secondLocalId)
340+
341+
int thirdLocalId = newLocal(Type.INT_TYPE)
342+
methodVisitor.visitVarInsn(ILOAD, 3)
343+
methodVisitor.visitVarInsn(ISTORE, thirdLocalId)
344+
localIds.add(thirdLocalId)
345+
346+
int fourthLocalId = newLocal(Type.INT_TYPE)
347+
methodVisitor.visitVarInsn(ILOAD, 4)
348+
methodVisitor.visitVarInsn(ISTORE, fourthLocalId)
349+
localIds.add(fourthLocalId)
350+
} else if (nameDesc == "onItemSelected(Landroid/widget/AdapterView;Landroid/view/View;IJ)V"
351+
|| nameDesc == "onListItemClick(Landroid/widget/ListView;Landroid/view/View;IJ)V") {
352+
localIds = new ArrayList<>()
353+
int firstLocalId = newLocal(Type.getObjectType("java/lang/Object"))
354+
methodVisitor.visitVarInsn(ALOAD, 1)
355+
methodVisitor.visitVarInsn(ASTORE, firstLocalId)
356+
localIds.add(firstLocalId)
357+
358+
int secondLocalId = newLocal(Type.getObjectType("android/view/View"))
359+
methodVisitor.visitVarInsn(ALOAD, 2)
360+
methodVisitor.visitVarInsn(ASTORE, secondLocalId)
361+
localIds.add(secondLocalId)
362+
363+
int thirdLocalId = newLocal(Type.INT_TYPE)
364+
methodVisitor.visitVarInsn(ILOAD, 3)
365+
methodVisitor.visitVarInsn(ISTORE, thirdLocalId)
366+
localIds.add(thirdLocalId)
313367
}
314368

315369
// Lambda 参数优化部分,对现有参数进行复制
@@ -487,9 +541,9 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
487541
}
488542

489543
if (nameDesc == 'onItemSelected(Landroid/widget/AdapterView;Landroid/view/View;IJ)V' || nameDesc == "onListItemClick(Landroid/widget/ListView;Landroid/view/View;IJ)V") {
490-
methodVisitor.visitVarInsn(ALOAD, 1)
491-
methodVisitor.visitVarInsn(ALOAD, 2)
492-
methodVisitor.visitVarInsn(ILOAD, 3)
544+
methodVisitor.visitVarInsn(ALOAD, localIds.get(0))
545+
methodVisitor.visitVarInsn(ALOAD, localIds.get(1))
546+
methodVisitor.visitVarInsn(ILOAD, localIds.get(2))
493547
methodVisitor.visitMethodInsn(INVOKESTATIC, SensorsAnalyticsHookConfig.SENSORS_ANALYTICS_API, "trackListView", "(Landroid/widget/AdapterView;Landroid/view/View;I)V", false)
494548
isHasTracked = true
495549
return
@@ -549,6 +603,31 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
549603
isHasTracked = true
550604
return
551605
}
606+
} else if (mInterfaces.contains('android/widget/ExpandableListView$OnGroupClickListener')
607+
&& nameDesc == 'onGroupClick(Landroid/widget/ExpandableListView;Landroid/view/View;IJ)Z') {
608+
SensorsAnalyticsMethodCell sensorsAnalyticsMethodCell = SensorsAnalyticsHookConfig.INTERFACE_METHODS
609+
.get('android/widget/ExpandableListView$OnGroupClickListeneronGroupClick(Landroid/widget/ExpandableListView;Landroid/view/View;IJ)Z')
610+
if (sensorsAnalyticsMethodCell != null) {
611+
methodVisitor.visitVarInsn(ALOAD, localIds.get(0))
612+
methodVisitor.visitVarInsn(ALOAD, localIds.get(1))
613+
methodVisitor.visitVarInsn(ILOAD, localIds.get(2))
614+
methodVisitor.visitMethodInsn(INVOKESTATIC, SensorsAnalyticsHookConfig.SENSORS_ANALYTICS_API, sensorsAnalyticsMethodCell.agentName, sensorsAnalyticsMethodCell.agentDesc, false)
615+
isHasTracked = true
616+
return
617+
}
618+
} else if (mInterfaces.contains('android/widget/ExpandableListView$OnChildClickListener')
619+
&& nameDesc == 'onChildClick(Landroid/widget/ExpandableListView;Landroid/view/View;IIJ)Z') {
620+
SensorsAnalyticsMethodCell sensorsAnalyticsMethodCell = SensorsAnalyticsHookConfig.INTERFACE_METHODS
621+
.get('android/widget/ExpandableListView$OnChildClickListeneronChildClick(Landroid/widget/ExpandableListView;Landroid/view/View;IIJ)Z')
622+
if (sensorsAnalyticsMethodCell != null) {
623+
methodVisitor.visitVarInsn(ALOAD, localIds.get(0))
624+
methodVisitor.visitVarInsn(ALOAD, localIds.get(1))
625+
methodVisitor.visitVarInsn(ILOAD, localIds.get(2))
626+
methodVisitor.visitVarInsn(ILOAD, localIds.get(3))
627+
methodVisitor.visitMethodInsn(INVOKESTATIC, SensorsAnalyticsHookConfig.SENSORS_ANALYTICS_API, sensorsAnalyticsMethodCell.agentName, sensorsAnalyticsMethodCell.agentDesc, false)
628+
isHasTracked = true
629+
return
630+
}
552631
} else if (nameDesc == 'onMenuItemClick(Landroid/view/MenuItem;)Z') {
553632
for (interfaceName in mInterfaces) {
554633
SensorsAnalyticsMethodCell sensorsAnalyticsMethodCell = SensorsAnalyticsHookConfig.INTERFACE_METHODS.get(interfaceName + nameDesc)

plugin/src/main/groovy/com/sensorsdata/analytics/android/plugin/SensorsAnalyticsDefaultMethodVisitor.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by wangzhuozhou on 2015/08/12.
3-
* Copyright 2015-2020 Sensors Data Inc.
3+
* Copyright 2015-2021 Sensors Data Inc.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/src/main/groovy/com/sensorsdata/analytics/android/plugin/SensorsAnalyticsExtension.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by wangzhuozhou on 2015/08/12.
3-
* Copyright 2015-2020 Sensors Data Inc.
3+
* Copyright 2015-2021 Sensors Data Inc.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/src/main/groovy/com/sensorsdata/analytics/android/plugin/SensorsAnalyticsHookConfig.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by wangzhuozhou on 2015/08/12.
3-
* Copyright 2015-2020 Sensors Data Inc.
3+
* Copyright 2015-2021 Sensors Data Inc.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/src/main/groovy/com/sensorsdata/analytics/android/plugin/SensorsAnalyticsJSRAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by renqingyou on 2018/12/01.
3-
* Copyright 2015-2020 Sensors Data Inc.
3+
* Copyright 2015-2021 Sensors Data Inc.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

plugin/src/main/groovy/com/sensorsdata/analytics/android/plugin/SensorsAnalyticsMethodCell.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by wangzhuozhou on 2015/08/12.
3-
* Copyright 2015-2020 Sensors Data Inc.
3+
* Copyright 2015-2021 Sensors Data Inc.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)