From 5f90d4ab57e41e4ec6a49169b5bbdde164a76ab7 Mon Sep 17 00:00:00 2001 From: maxli Date: Fri, 12 Jan 2024 15:13:55 +0800 Subject: [PATCH] feat(android): add ENABLE_BUGLY_REPORT config --- android/sdk/build.gradle | 1 + android/sdk/gradle.properties | 2 ++ .../src/main/java/com/tencent/mtt/hippy/utils/BuglyUtils.java | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/android/sdk/build.gradle b/android/sdk/build.gradle index 8173ea6cb66..71738fa5ddd 100644 --- a/android/sdk/build.gradle +++ b/android/sdk/build.gradle @@ -55,6 +55,7 @@ android { consumerProguardFiles 'proguard-rules.pro' buildConfigField("boolean", "ENABLE_SO_DOWNLOAD", ENABLE_SO_DOWNLOAD) + buildConfigField("boolean", "ENABLE_BUGLY_REPORT", ENABLE_BUGLY_REPORT) buildConfigField("String", "LIBRARY_VERSION", "String.valueOf(\"$VERSION_NAME\")") packagingOptions { diff --git a/android/sdk/gradle.properties b/android/sdk/gradle.properties index b676e78026f..c20448de192 100644 --- a/android/sdk/gradle.properties +++ b/android/sdk/gradle.properties @@ -120,6 +120,8 @@ EXCLUDE_LIBRARY_FILES= #features ENABLE_SO_DOWNLOAD=false +ENABLE_BUGLY_REPORT=false + # # Specifies maven publish artifact ID # diff --git a/android/sdk/src/main/java/com/tencent/mtt/hippy/utils/BuglyUtils.java b/android/sdk/src/main/java/com/tencent/mtt/hippy/utils/BuglyUtils.java index 06b42d716f5..9997a8ef5fc 100644 --- a/android/sdk/src/main/java/com/tencent/mtt/hippy/utils/BuglyUtils.java +++ b/android/sdk/src/main/java/com/tencent/mtt/hippy/utils/BuglyUtils.java @@ -28,7 +28,7 @@ public class BuglyUtils { private static boolean sHasCommitted = false; public static void registerSdkAppIdIfNeeded(@Nullable Context context) { - if (sHasCommitted || context == null) { + if (!BuildConfig.ENABLE_BUGLY_REPORT || sHasCommitted || context == null) { return; } Context appContext = context.getApplicationContext();