Skip to content

Commit

Permalink
Release 3.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
weiqiangliu committed Oct 29, 2021
1 parent fd2808f commit 1e88d5a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugin/ext.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project.ext {
pluginVersion = '3.4.2'
pluginVersion = '3.4.3'
Properties properties = new Properties()
if (project.file('local.properties').exists()) {
properties.load(project.file('local.properties').newDataInputStream())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
boolean protectedAndNotStaticAccess
ArrayList<Integer> localIds
boolean shouldAddUCJS = false
boolean shouldAddXWalkJS = false

@Override
void visitEnd() {
Expand All @@ -235,6 +236,9 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
if (shouldAddUCJS) {
visitAnnotation("Lcom/uc/webview/export/JavascriptInterface;", true)
}
if (shouldAddXWalkJS) {
visitAnnotation("Lorg/xwalk/core/JavascriptInterface;", true)
}
}

@Override
Expand Down Expand Up @@ -824,8 +828,9 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
}
}
}
} else if (classNameAnalytics.isAppWebViewInterface && transformHelper.extension.addUCJavaScriptInterface && s == "Landroid/webkit/JavascriptInterface;") {
shouldAddUCJS = true
} else if (classNameAnalytics.isAppWebViewInterface && s == "Landroid/webkit/JavascriptInterface;") {
shouldAddUCJS = transformHelper.extension.addUCJavaScriptInterface
shouldAddXWalkJS = transformHelper.extension.addXWalkJavaScriptInterface
}

return super.visitAnnotation(s, b)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class SensorsAnalyticsExtension {
public boolean lambdaEnabled = true
public boolean autoHandleWebView = true
public boolean addUCJavaScriptInterface = false
public boolean addXWalkJavaScriptInterface = false
public boolean lambdaParamOptimize = false
public boolean disableTrackPush = false
public ArrayList<String> exclude = []
Expand Down Expand Up @@ -67,6 +68,7 @@ class SensorsAnalyticsExtension {
"\tdisableTrackPush=" + disableTrackPush + "\n" +
"\tautoHandleWebView=" + autoHandleWebView + "\n" +
"\taddUCJavaScriptInterface=" + addUCJavaScriptInterface + "\n" +
"\taddXWalkJavaScriptInterface=" + addXWalkJavaScriptInterface + "\n" +
"\tlambdaParamOptimize=" + lambdaParamOptimize + "\n" +
"\tlambdaEnabled=" + lambdaEnabled + "\n" +
"\texclude=[" + excludeBuilder.toString() + "]" + "\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import java.util.jar.JarOutputStream

class SensorsAnalyticsTransform extends Transform {
private SensorsAnalyticsTransformHelper transformHelper
public static final String VERSION = "3.4.2"
public static final String VERSION = "3.4.3"
public static final String MIN_SDK_VERSION = "5.4.3"
private WaitableExecutor waitableExecutor
private URLClassLoader urlClassLoader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ class SensorsAnalyticsTransformHelper {
classNameAnalytics.methodCells.addAll(methodCellList)
}
}
if (classNameAnalytics.methodCells.size() > 0 || classNameAnalytics.isSensorsDataAPI || (classNameAnalytics.isAppWebViewInterface && extension.addUCJavaScriptInterface)) {
if (classNameAnalytics.methodCells.size() > 0 || classNameAnalytics.isSensorsDataAPI
|| (classNameAnalytics.isAppWebViewInterface && (extension.addUCJavaScriptInterface || extension.addXWalkJavaScriptInterface))) {
classNameAnalytics.isShouldModify = true
}
} else if (!classNameAnalytics.isAndroidGenerated()) {
Expand Down

0 comments on commit 1e88d5a

Please sign in to comment.