Skip to content

Commit

Permalink
Release 3.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
weiqiangliu committed Nov 5, 2021
1 parent 1e88d5a commit d044625
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 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.3'
pluginVersion = '3.4.4'
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 @@ -33,7 +33,7 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
private String mSuperName
private String[] mInterfaces
private HashSet<String> visitedFragMethods = new HashSet<>()// 无需判空
private Boolean isFoundOnNewIntent = null
private boolean isFoundOnNewIntent = false
private ClassVisitor classVisitor

private SensorsAnalyticsTransformHelper transformHelper
Expand Down Expand Up @@ -106,8 +106,8 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
@Override
void visitEnd() {
super.visitEnd()
if (!transformHelper.extension.disableTrackPush && isFoundOnNewIntent != null && !isFoundOnNewIntent && mSuperName == "android/app/Activity") {
SensorsPushInjected.addOnNewIntent(classVisitor);
if (!transformHelper.extension.disableTrackPush && !isFoundOnNewIntent && mSuperName == "android/app/Activity") {
SensorsPushInjected.addOnNewIntent(classVisitor)
}

if (SensorsAnalyticsUtil.isInstanceOfFragment(mSuperName)) {
Expand Down Expand Up @@ -185,11 +185,8 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
return null
}
}
if (mSuperName == "android/app/Activity") {
isFoundOnNewIntent = false
if (name == "onNewIntent" && desc == "(Landroid/content/Intent;)V") {
isFoundOnNewIntent = true
}
if (mSuperName == "android/app/Activity" && name == "onNewIntent" && desc == "(Landroid/content/Intent;)V") {
isFoundOnNewIntent = true
}

MethodVisitor methodVisitor = cv.visitMethod(access, name, desc, signature, exceptions)
Expand Down Expand Up @@ -265,7 +262,7 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
nameDesc = name + desc
// Hook Push
if (!SensorsAnalyticsUtil.isStatic(access) && !transformHelper.extension.disableTrackPush) {
SensorsPushInjected.handlePush(methodVisitor, mSuperName, mClassName, nameDesc, transformHelper.urlClassLoader)
SensorsPushInjected.handlePush(methodVisitor, mSuperName, nameDesc)
}

pubAndNoStaticAccess = SensorsAnalyticsUtil.isPublic(access) && !SensorsAnalyticsUtil.isStatic(access)
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.3"
public static final String VERSION = "3.4.4"
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 @@ -16,10 +16,9 @@ public class SensorsPushInjected {
*
* @param methodVisitor MethodVisitor
* @param superName 父类名
* @param className 类名
* @param nameDesc 描述
*/
public static void handlePush(MethodVisitor methodVisitor, String superName, String className, String nameDesc, ClassLoader classLoader) {
public static void handlePush(MethodVisitor methodVisitor, String superName, String nameDesc) {
if ("cn/jpush/android/service/JPushMessageReceiver".equals(superName)
&& "onNotifyMessageOpened(Landroid/content/Context;Lcn/jpush/android/api/NotificationMessage;)V".equals(nameDesc)) {
handleJPush(methodVisitor);
Expand Down

0 comments on commit d044625

Please sign in to comment.