diff --git a/framework/android/build.gradle b/framework/android/build.gradle index e83dffc6d65..e1501eb6b89 100644 --- a/framework/android/build.gradle +++ b/framework/android/build.gradle @@ -66,6 +66,7 @@ android { consumerProguardFiles 'proguard-rules.pro' buildConfigField("boolean", "ENABLE_SO_LOAD_EXTERNAL", ENABLE_SO_LOAD_EXTERNAL) + buildConfigField("boolean", "ENABLE_BUGLY_REPORT", ENABLE_BUGLY_REPORT) buildConfigField("String", "LIBRARY_VERSION", "String.valueOf(\"$VERSION_NAME\")") packagingOptions { diff --git a/framework/android/gradle.properties b/framework/android/gradle.properties index 5182f9e96a5..ecf75727ea2 100644 --- a/framework/android/gradle.properties +++ b/framework/android/gradle.properties @@ -103,6 +103,8 @@ EXCLUDE_LIBRARY_FILES= #features ENABLE_SO_LOAD_EXTERNAL=false +ENABLE_BUGLY_REPORT=false + # # Specifies maven publish artifact ID # diff --git a/framework/android/src/main/java/com/tencent/mtt/hippy/utils/BuglyUtils.java b/framework/android/src/main/java/com/tencent/mtt/hippy/utils/BuglyUtils.java index 3c121f11d1c..bff2a636dc0 100644 --- a/framework/android/src/main/java/com/tencent/mtt/hippy/utils/BuglyUtils.java +++ b/framework/android/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();