File tree Expand file tree Collapse file tree 5 files changed +13
-5
lines changed
src/main/groovy/com/sensorsdata/analytics/android/plugin Expand file tree Collapse file tree 5 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 11project. ext {
2- pluginVersion = ' 3.4.2 '
2+ pluginVersion = ' 3.4.3 '
33 Properties properties = new Properties ()
44 if (project. file(' local.properties' ). exists()) {
55 properties. load(project. file(' local.properties' ). newDataInputStream())
Original file line number Diff line number Diff line change @@ -221,6 +221,7 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
221221 boolean protectedAndNotStaticAccess
222222 ArrayList<Integer > localIds
223223 boolean shouldAddUCJS = false
224+ boolean shouldAddXWalkJS = false
224225
225226 @Override
226227 void visitEnd () {
@@ -235,6 +236,9 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
235236 if (shouldAddUCJS) {
236237 visitAnnotation(" Lcom/uc/webview/export/JavascriptInterface;" , true )
237238 }
239+ if (shouldAddXWalkJS) {
240+ visitAnnotation(" Lorg/xwalk/core/JavascriptInterface;" , true )
241+ }
238242 }
239243
240244 @Override
@@ -824,8 +828,9 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
824828 }
825829 }
826830 }
827- } else if (classNameAnalytics. isAppWebViewInterface && transformHelper. extension. addUCJavaScriptInterface && s == " Landroid/webkit/JavascriptInterface;" ) {
828- shouldAddUCJS = true
831+ } else if (classNameAnalytics. isAppWebViewInterface && s == " Landroid/webkit/JavascriptInterface;" ) {
832+ shouldAddUCJS = transformHelper. extension. addUCJavaScriptInterface
833+ shouldAddXWalkJS = transformHelper. extension. addXWalkJavaScriptInterface
829834 }
830835
831836 return super . visitAnnotation(s, b)
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class SensorsAnalyticsExtension {
2727 public boolean lambdaEnabled = true
2828 public boolean autoHandleWebView = true
2929 public boolean addUCJavaScriptInterface = false
30+ public boolean addXWalkJavaScriptInterface = false
3031 public boolean lambdaParamOptimize = false
3132 public boolean disableTrackPush = false
3233 public ArrayList<String > exclude = []
@@ -67,6 +68,7 @@ class SensorsAnalyticsExtension {
6768 " \t disableTrackPush=" + disableTrackPush + " \n " +
6869 " \t autoHandleWebView=" + autoHandleWebView + " \n " +
6970 " \t addUCJavaScriptInterface=" + addUCJavaScriptInterface + " \n " +
71+ " \t addXWalkJavaScriptInterface=" + addXWalkJavaScriptInterface + " \n " +
7072 " \t lambdaParamOptimize=" + lambdaParamOptimize + " \n " +
7173 " \t lambdaEnabled=" + lambdaEnabled + " \n " +
7274 " \t exclude=[" + excludeBuilder. toString() + " ]" + " \n " +
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ import java.util.jar.JarOutputStream
4848
4949class SensorsAnalyticsTransform extends Transform {
5050 private SensorsAnalyticsTransformHelper transformHelper
51- public static final String VERSION = " 3.4.2 "
51+ public static final String VERSION = " 3.4.3 "
5252 public static final String MIN_SDK_VERSION = " 5.4.3"
5353 private WaitableExecutor waitableExecutor
5454 private URLClassLoader urlClassLoader
Original file line number Diff line number Diff line change @@ -121,7 +121,8 @@ class SensorsAnalyticsTransformHelper {
121121 classNameAnalytics. methodCells. addAll(methodCellList)
122122 }
123123 }
124- if (classNameAnalytics. methodCells. size() > 0 || classNameAnalytics. isSensorsDataAPI || (classNameAnalytics. isAppWebViewInterface && extension. addUCJavaScriptInterface)) {
124+ if (classNameAnalytics. methodCells. size() > 0 || classNameAnalytics. isSensorsDataAPI
125+ || (classNameAnalytics. isAppWebViewInterface && (extension. addUCJavaScriptInterface || extension. addXWalkJavaScriptInterface))) {
125126 classNameAnalytics. isShouldModify = true
126127 }
127128 } else if (! classNameAnalytics. isAndroidGenerated()) {
You can’t perform that action at this time.
0 commit comments