Skip to content

Commit ce7a6fd

Browse files
author
dengshiwei
committed
Release 3.2.2
1 parent b9c81b4 commit ce7a6fd

17 files changed

+217
-35
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.2.1'
2+
pluginVersion = '3.2.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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by renqingyou on 2018/12/01.
3-
* Copyright 2015-2019 Sensors Data Inc.
3+
* Copyright 2015-2020 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.
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
1817
package com.sensorsdata.analytics.android.plugin
1918

2019
class ClassNameAnalytics {

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Created by zhangwei on 2020/05/21.
3+
* Copyright 2015-2020 Sensors Data Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
117
package com.sensorsdata.analytics.android.plugin
218

319
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by wangzhuozhou on 2015/08/12.
3-
* Copyright 2015-2019 Sensors Data Inc.
3+
* Copyright 2015-2020 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.
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
1817
package com.sensorsdata.analytics.android.plugin
1918

2019
import org.objectweb.asm.Opcodes

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

Lines changed: 4 additions & 2 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-2019 Sensors Data Inc.
3+
* Copyright 2015-2020 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.
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
1817
package com.sensorsdata.analytics.android.plugin
1918

2019
import org.objectweb.asm.AnnotationVisitor
@@ -173,6 +172,9 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
173172
}
174173

175174
MethodVisitor methodVisitor = cv.visitMethod(access, name, desc, signature, exceptions)
175+
if (transformHelper.extension != null && transformHelper.extension.autoHandleWebView && transformHelper.urlClassLoader != null) {
176+
methodVisitor = new SensorsAnalyticsWebViewMethodVisitor(methodVisitor, transformHelper)
177+
}
176178
SensorsAnalyticsDefaultMethodVisitor sensorsAnalyticsDefaultMethodVisitor = new SensorsAnalyticsDefaultMethodVisitor(methodVisitor, access, name, desc) {
177179
boolean isSensorsDataTrackViewOnClickAnnotation = false
178180
boolean isSensorsDataIgnoreTrackOnClick = false

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by wangzhuozhou on 2015/08/12.
3-
* Copyright 2015-2019 Sensors Data Inc.
3+
* Copyright 2015-2020 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.
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
1817
package com.sensorsdata.analytics.android.plugin
1918

2019
import org.objectweb.asm.AnnotationVisitor

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by wangzhuozhou on 2015/08/12.
3-
* Copyright 2015-2019 Sensors Data Inc.
3+
* Copyright 2015-2020 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.
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
1817
package com.sensorsdata.analytics.android.plugin
1918

2019
import org.gradle.api.Action
@@ -26,6 +25,7 @@ class SensorsAnalyticsExtension {
2625
public boolean disableJar = false
2726
public boolean useInclude = false
2827
public boolean lambdaEnabled = true
28+
public boolean autoHandleWebView = true
2929

3030
public ArrayList<String> exclude = []
3131
public ArrayList<String> include = []
@@ -62,6 +62,7 @@ class SensorsAnalyticsExtension {
6262
return "\tdebug=" + debug + "\n" +
6363
"\tdisableJar=" + disableJar + "\n" +
6464
"\tuseInclude=" + useInclude + "\n" +
65+
"\tautoHandleWebView=" + autoHandleWebView + "\n" +
6566
"\tlambdaEnabled=" + lambdaEnabled + "\n" +
6667
"\texclude=[" + excludeBuilder.toString() + "]" + "\n" +
6768
"\tinclude=[" + includeBuilder.toString() + "]" + "\n" +

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

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by wangzhuozhou on 2015/08/12.
3-
* Copyright 2015-2019 Sensors Data Inc.
3+
* Copyright 2015-2020 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.
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
1817
package com.sensorsdata.analytics.android.plugin
1918

2019
import org.objectweb.asm.Opcodes
@@ -168,6 +167,38 @@ class SensorsAnalyticsHookConfig {
168167
'(Landroid/view/MenuItem;)V',
169168
1, 1,
170169
[Opcodes.ALOAD]))
170+
addInterfaceMethod(new SensorsAnalyticsMethodCell(
171+
'onNavigationItemSelected',
172+
'(Landroid/view/MenuItem;)Z',
173+
'com/google/android/material/navigation/NavigationView$OnNavigationItemSelectedListener',
174+
'trackMenuItem',
175+
'(Landroid/view/MenuItem;)V',
176+
1, 1,
177+
[Opcodes.ALOAD]))
178+
addInterfaceMethod(new SensorsAnalyticsMethodCell(
179+
'onNavigationItemSelected',
180+
'(Landroid/view/MenuItem;)Z',
181+
'android/support/design/widget/NavigationView$OnNavigationItemSelectedListener',
182+
'trackMenuItem',
183+
'(Landroid/view/MenuItem;)V',
184+
1, 1,
185+
[Opcodes.ALOAD]))
186+
addInterfaceMethod(new SensorsAnalyticsMethodCell(
187+
'onNavigationItemSelected',
188+
'(Landroid/view/MenuItem;)Z',
189+
'android/support/design/widget/BottomNavigationView$OnNavigationItemSelectedListener',
190+
'trackMenuItem',
191+
'(Landroid/view/MenuItem;)V',
192+
1, 1,
193+
[Opcodes.ALOAD]))
194+
addInterfaceMethod(new SensorsAnalyticsMethodCell(
195+
'onNavigationItemSelected',
196+
'(Landroid/view/MenuItem;)Z',
197+
'com/google/android/material/bottomnavigation/BottomNavigationView$OnNavigationItemSelectedListener',
198+
'trackMenuItem',
199+
'(Landroid/view/MenuItem;)V',
200+
1, 1,
201+
[Opcodes.ALOAD]))
171202
}
172203

173204
static void addInterfaceMethod(SensorsAnalyticsMethodCell sensorsAnalyticsMethodCell) {
@@ -302,6 +333,14 @@ class SensorsAnalyticsHookConfig {
302333
'(Ljava/lang/String;)V',
303334
1, 1,
304335
[Opcodes.ALOAD]))
336+
addLambdaMethod(new SensorsAnalyticsMethodCell(
337+
'onNavigationItemSelected',
338+
'(Landroid/view/MenuItem;)Z',
339+
'Lcom/google/android/material/navigation/NavigationView$OnNavigationItemSelectedListener;',
340+
'trackMenuItem',
341+
'(Landroid/view/MenuItem;)V',
342+
1, 1,
343+
[Opcodes.ALOAD]))
305344
addLambdaMethod(new SensorsAnalyticsMethodCell(
306345
'onNavigationItemSelected',
307346
'(Landroid/view/MenuItem;)Z',
@@ -310,6 +349,22 @@ class SensorsAnalyticsHookConfig {
310349
'(Landroid/view/MenuItem;)V',
311350
1, 1,
312351
[Opcodes.ALOAD]))
352+
addLambdaMethod(new SensorsAnalyticsMethodCell(
353+
'onNavigationItemSelected',
354+
'(Landroid/view/MenuItem;)Z',
355+
'Landroid/support/design/widget/BottomNavigationView$OnNavigationItemSelectedListener;',
356+
'trackMenuItem',
357+
'(Landroid/view/MenuItem;)V',
358+
1, 1,
359+
[Opcodes.ALOAD]))
360+
addLambdaMethod(new SensorsAnalyticsMethodCell(
361+
'onNavigationItemSelected',
362+
'(Landroid/view/MenuItem;)Z',
363+
'Lcom/google/android/material/bottomnavigation/BottomNavigationView$OnNavigationItemSelectedListener;',
364+
'trackMenuItem',
365+
'(Landroid/view/MenuItem;)V',
366+
1, 1,
367+
[Opcodes.ALOAD]))
313368
addLambdaMethod(new SensorsAnalyticsMethodCell(
314369
'onMenuItemClick',
315370
'(Landroid/view/MenuItem;)Z',

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by renqingyou on 2018/12/01.
3-
* Copyright 2015-2019 Sensors Data Inc.
3+
* Copyright 2015-2020 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.
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
1817
package com.sensorsdata.analytics.android.plugin;
1918

2019
import org.objectweb.asm.MethodVisitor;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Created by wangzhuozhou on 2015/08/12.
3-
* Copyright 2015-2019 Sensors Data Inc.
3+
* Copyright 2015-2020 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.
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
1817
package com.sensorsdata.analytics.android.plugin
1918

2019
class SensorsAnalyticsMethodCell {

0 commit comments

Comments
 (0)