mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 00:20:37 +00:00
committed by
Moxie Marlinspike
parent
2016fa315b
commit
b4634f30e6
@@ -18,6 +18,11 @@ package org.thoughtcrime.securesms;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.os.StrictMode;
|
||||
import android.os.StrictMode.ThreadPolicy;
|
||||
import android.os.StrictMode.VmPolicy;
|
||||
|
||||
import com.squareup.leakcanary.LeakCanary;
|
||||
|
||||
import org.thoughtcrime.securesms.crypto.PRNGFixes;
|
||||
import org.thoughtcrime.securesms.dependencies.AxolotlStorageModule;
|
||||
@@ -34,8 +39,6 @@ import org.whispersystems.jobqueue.requirements.NetworkRequirementProvider;
|
||||
import org.whispersystems.libaxolotl.logging.AxolotlLoggerProvider;
|
||||
import org.whispersystems.libaxolotl.util.AndroidAxolotlLogger;
|
||||
|
||||
import java.security.Security;
|
||||
|
||||
import dagger.ObjectGraph;
|
||||
|
||||
/**
|
||||
@@ -57,6 +60,8 @@ public class ApplicationContext extends Application implements DependencyInjecto
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
initializeDeveloperBuild();
|
||||
initializeRandomNumberFix();
|
||||
initializeLogging();
|
||||
initializeDependencyInjection();
|
||||
@@ -75,6 +80,16 @@ public class ApplicationContext extends Application implements DependencyInjecto
|
||||
return jobManager;
|
||||
}
|
||||
|
||||
private void initializeDeveloperBuild() {
|
||||
if (BuildConfig.DEV_BUILD) {
|
||||
LeakCanary.install(this);
|
||||
StrictMode.setThreadPolicy(new ThreadPolicy.Builder().detectAll()
|
||||
.penaltyLog()
|
||||
.build());
|
||||
StrictMode.setVmPolicy(new VmPolicy.Builder().detectAll().penaltyLog().build());
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeRandomNumberFix() {
|
||||
PRNGFixes.apply();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user