Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion FlowCrypt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ android {
ndkVersion "22.0.7026061"
}

configurations {
devDebugImplementation {}
}

easylauncher {
buildTypes {
debug {
Expand All @@ -325,7 +329,7 @@ dependencies {
kapt 'androidx.annotation:annotation:1.2.0'
kapt "androidx.room:room-compiler:$roomVersion"

debugImplementation "com.squareup.leakcanary:leakcanary-android:${rootProject.ext.leakcanaryVersion}"
devDebugImplementation "com.squareup.leakcanary:leakcanary-android:${rootProject.ext.leakcanaryVersion}"

androidTestImplementation "androidx.test.espresso:espresso-core:${rootProject.ext.espressoVersion}"
androidTestImplementation "androidx.test.espresso:espresso-contrib:${rootProject.ext.espressoVersion}"
Expand Down
1 change: 0 additions & 1 deletion FlowCrypt/src/main/java/com/flowcrypt/email/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class Constants {
* The preference keys.
*/
const val PREF_KEY_IS_WRITE_LOGS_TO_FILE_ENABLED = "preferences_key_is_write_logs_to_file_enabled"
const val PREF_KEY_IS_DETECT_MEMORY_LEAK_ENABLED = "pref_key_is_detect_memory_leak_enabled"
const val PREF_KEY_IS_ACRA_ENABLED = "pref_key_is_acra_enabled"
const val PREF_KEY_IS_MAIL_DEBUG_ENABLED = "preferences_key_is_mail_debug_enabled"
const val PREF_KEY_IS_HTTP_LOG_ENABLED = "pref_key_is_http_log_enabled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import com.flowcrypt.email.util.CacheManager
import com.flowcrypt.email.util.GeneralUtil
import com.flowcrypt.email.util.SharedPreferencesHelper
import com.flowcrypt.email.util.acra.CustomReportSenderFactory
import leakcanary.LeakCanary
import org.acra.ACRA
import org.acra.ReportField
import org.acra.annotation.ReportsCrashes
Expand Down Expand Up @@ -79,7 +78,6 @@ class FlowCryptApplication : Application(), Configuration.Provider {
MsgsCacheManager.init(this)
NotificationChannelManager.registerNotificationChannels(this)
IMAPStoreManager.init(this)
initLeakCanary()
SyncInboxWorker.enqueuePeriodic(this)
enqueueMsgsCacheCleanerWorker()
}
Expand Down Expand Up @@ -112,19 +110,6 @@ class FlowCryptApplication : Application(), Configuration.Provider {
Constants.PREF_KEY_INSTALL_VERSION.toUpperCase(Locale.getDefault()), installVersion)
}

/**
* Init the LeakCanary tools if the current build is debug and detect memory leaks enabled.
*/
private fun initLeakCanary() {
if (GeneralUtil.isDebugBuild()) {
val isEnabled = SharedPreferencesHelper.getBoolean(
PreferenceManager.getDefaultSharedPreferences(this),
Constants.PREF_KEY_IS_DETECT_MEMORY_LEAK_ENABLED, false)
LeakCanary.config = LeakCanary.config.copy(dumpHeap = isEnabled)
LeakCanary.showLeakDisplayActivityLauncherIcon(showLauncherIcon = isEnabled)
}
}

private fun initPerInstallationSharedPrefs() {
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
if (sharedPreferences.all.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class MainDevPreferencesFragment : BaseDevPreferencesFragment(), SharedPreferenc
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
when (key) {
Constants.PREF_KEY_IS_WRITE_LOGS_TO_FILE_ENABLED,
Constants.PREF_KEY_IS_DETECT_MEMORY_LEAK_ENABLED,
Constants.PREF_KEY_IS_ACRA_ENABLED,
Constants.PREF_KEY_IS_NODE_HTTP_DEBUG_ENABLED,
Constants.PREF_KEY_NODE_HTTP_LOG_LEVEL,
Expand Down
4 changes: 0 additions & 4 deletions FlowCrypt/src/main/res/values/strings_dev_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
<!-- Preference keys -->
<string name="preferences_key_build_config_info">pref_key_build_config_info</string>
<string name="preferences_key_is_write_logs_to_file_enabled">preferences_key_is_write_logs_to_file_enabled</string>
<string name="preferences_key_is_detect_memory_leak_enable" tools:ignore="UnusedResources">preferences_key_is_detect_memory_leak_enable</string>
<string name="preferences_key_is_acra_enable" tools:ignore="UnusedResources">preferences_key_is_acra_enable</string>
<string name="preferences_key_is_mail_debug_enabled">preferences_key_is_mail_debug_enabled</string>
<string name="pref_key_is_http_log_enabled">pref_key_is_http_log_enabled</string>
<string name="pref_key_http_log_level">pref_key_http_log_level</string>
<string name="pref_key_is_node_http_debug_enabled">pref_key_is_node_http_debug_enabled</string>
<string name="pref_key_node_http_log_level">pref_key_node_http_log_level</string>
<string name="pref_key_is_native_node_debug_enabled">pref_key_is_native_node_debug_enabled</string>
<string name="pref_key_is_detect_memory_leak_enabled">pref_key_is_detect_memory_leak_enabled</string>
<string name="pref_key_is_acra_enabled">pref_key_is_acra_enabled</string>

<!-- Strings related to Settings -->
Expand All @@ -25,7 +23,6 @@
<string name="pref_title_build_config_info">Build config info</string>
<string name="toast_message_press_force_stop_to_apply_changes">Please press "Force stop" to apply changes</string>
<string name="pref_title_write_api_logs_to_file">Write API logs to a file</string>
<string name="pref_title_enable_detect_memory_leak" tools:ignore="UnusedResources">Enable detect memory leak</string>
<string name="pref_title_enable_acra" tools:ignore="UnusedResources">Enable ACRA(App Crash Reports)</string>
<string name="pref_title_imap_debug">IMAP debug</string>
<string name="action_dev_settings">Dev Settings</string>
Expand All @@ -38,6 +35,5 @@
<string name="pref_summary_disabled">Disabled</string>
<string name="pref_title_node_http">Node HTTP</string>
<string name="pref_title_native_node_logs">Native Node logs</string>
<string name="pref_title_detect_memory_leaks">Detect memory leaks</string>
<string name="pref_title_acra">Application Crash Reports</string>
</resources>
7 changes: 0 additions & 7 deletions FlowCrypt/src/main/res/xml/dev_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@
android:summaryOff="@string/pref_summary_disabled"
android:summaryOn="@string/pref_summary_enabled"
android:title="@string/pref_title_acra" />

<SwitchPreference
android:defaultValue="false"
android:key="@string/pref_key_is_detect_memory_leak_enabled"
android:summaryOff="@string/pref_summary_disabled"
android:summaryOn="@string/pref_summary_enabled"
android:title="@string/pref_title_detect_memory_leaks" />
</PreferenceCategory>

<PreferenceCategory android:title="@string/pref_title_http">
Expand Down
2 changes: 1 addition & 1 deletion ext.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ext {
/*https://mvnrepository.com/artifact/com.squareup.okio/okio*/
okioVersion = '2.10.0'
/*https://mvnrepository.com/artifact/com.squareup.leakcanary/leakcanary-android*/
leakcanaryVersion = '2.6'
leakcanaryVersion = '2.7'
/*https://mvnrepository.com/artifact/com.sun.mail/android-mail*/
javaMailVersion = '1.6.6'
/*https://mvnrepository.com/artifact/com.github.bumptech.glide/glide*/
Expand Down