Skip to content

Commit

Permalink
Release 3.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
weiqiangliu committed Feb 8, 2022
1 parent 6b3bfa4 commit 871c0fa
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 4 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.6'
pluginVersion = '3.4.7'
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 @@ -22,6 +22,7 @@ class ClassNameAnalytics {
boolean isShouldModify = false
boolean isSensorsDataAPI = false
boolean isSensorsDataUtils = false
boolean isOAIDHelper = false
boolean isSALog = false
def methodCells = new ArrayList<SensorsAnalyticsMethodCell>()
boolean isAppWebViewInterface = false
Expand All @@ -30,13 +31,14 @@ class ClassNameAnalytics {
this.className = className
isSensorsDataAPI = (className == 'com.sensorsdata.analytics.android.sdk.SensorsDataAPI')
isSensorsDataUtils = (className == 'com.sensorsdata.analytics.android.sdk.util.SensorsDataUtils')
isOAIDHelper = (className == 'com.sensorsdata.analytics.android.sdk.advert.utils.OaidHelper')
isSALog = (className == 'com.sensorsdata.analytics.android.sdk.SALog')
isAppWebViewInterface = ((className == 'com.sensorsdata.analytics.android.sdk.AppWebViewInterface')
|| (className == 'com.sensorsdata.analytics.android.sdk.visual.WebViewVisualInterface'))
}

boolean isSDKFile() {
return isSALog || isSensorsDataAPI || isSensorsDataUtils || isAppWebViewInterface
return isSALog || isSensorsDataAPI || isSensorsDataUtils || isAppWebViewInterface || isOAIDHelper
}

boolean isLeanback() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ class SensorsAnalyticsClassVisitor extends ClassVisitor {
* android/support/v4/app/Fragment,android/support/v4/app/ListFragment,android/support/v4/app/DialogFragment,
* androidx/appcompat/app/AppCompatDialogFragment
* androidx/fragment/app/Fragment,androidx/fragment/app/ListFragment,androidx/fragment/app/DialogFragment
* com/google/android/material/bottomsheet/BottomSheetDialogFragment
*/
if (SensorsAnalyticsUtil.isInstanceOfFragment(mSuperName)) {
SensorsAnalyticsMethodCell sensorsAnalyticsMethodCell = SensorsFragmentHookConfig.FRAGMENT_METHODS.get(nameDesc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class SensorsAnalyticsSDKExtension {
boolean disableAndroidID = false
boolean disableMacAddress = false
boolean disableCarrier = false
boolean disableOAID = false

@Override
String toString() {
Expand All @@ -32,7 +33,8 @@ class SensorsAnalyticsSDKExtension {
"\t\tdisableJsInterface=" + disableJsInterface + "\n" +
"\t\tdisableAndroidID=" + disableAndroidID + "\n" +
"\t\tdisableMacAddress=" + disableMacAddress + "\n" +
"\t\tdisableCarrier=" + disableCarrier
"\t\tdisableCarrier=" + disableCarrier + "\n" +
"\t\tdisableOAID=" + disableOAID
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ class SensorsAnalyticsSDKHookConfig {
methodCells.put(methodName, macMethodCells)
}

void disableOAID(String methodName) {
def oaid = new SensorsAnalyticsMethodCell('getOAID', '(Landroid/content/Context;)Ljava/lang/String;', 'createGetOAID')
def methods = [oaid]
def oaidMethodCells = new HashMap<String, ArrayList<SensorsAnalyticsMethodCell>>()
oaidMethodCells.put("com/sensorsdata/analytics/android/sdk/advert/utils/OaidHelper", methods)
methodCells.put(methodName, oaidMethodCells)
}

//todo 扩展

void createGetIMEI(ClassVisitor classVisitor, SensorsAnalyticsMethodCell methodCell) {
Expand Down Expand Up @@ -163,6 +171,15 @@ class SensorsAnalyticsSDKHookConfig {
mv.visitEnd()
}

void createGetOAID(ClassVisitor classVisitor, SensorsAnalyticsMethodCell methodCell) {
def mv = classVisitor.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_STATIC, methodCell.name, methodCell.desc, null, null)
mv.visitCode()
mv.visitLdcInsn("")
mv.visitInsn(Opcodes.ARETURN)
mv.visitMaxs(1, 1)
mv.visitEnd()
}

//todo 扩展

}
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.6"
public static final String VERSION = "3.4.7"
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 @@ -59,6 +59,8 @@ class SensorsAnalyticsUtil {
targetFragmentClass.add('androidx/fragment/app/DialogFragment')
targetFragmentClass.add('androidx/appcompat/app/AppCompatDialogFragment')

targetFragmentClass.add('com/google/android/material/bottomsheet/BottomSheetDialogFragment')

targetActivityClass.add('android/app/Activity')
targetActivityClass.add('android/support/v7/app/AppCompatActivity')
targetActivityClass.add('androidx/appcompat/app/AppCompatActivity')
Expand Down

0 comments on commit 871c0fa

Please sign in to comment.