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();