mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 13:49:53 +01:00
Semi-encapsulated the core/api dependency graphs and created a proper structure to load eager singletons
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package org.briarproject.android;
|
package org.briarproject.android;
|
||||||
|
|
||||||
|
import org.briarproject.CoreComponent;
|
||||||
import org.briarproject.android.contact.ContactListFragment;
|
import org.briarproject.android.contact.ContactListFragment;
|
||||||
import org.briarproject.android.contact.ConversationActivity;
|
import org.briarproject.android.contact.ConversationActivity;
|
||||||
import org.briarproject.android.forum.AvailableForumsActivity;
|
import org.briarproject.android.forum.AvailableForumsActivity;
|
||||||
@@ -14,38 +15,12 @@ import org.briarproject.android.identity.CreateIdentityActivity;
|
|||||||
import org.briarproject.android.invitation.AddContactActivity;
|
import org.briarproject.android.invitation.AddContactActivity;
|
||||||
import org.briarproject.android.panic.PanicPreferencesActivity;
|
import org.briarproject.android.panic.PanicPreferencesActivity;
|
||||||
import org.briarproject.android.panic.PanicResponderActivity;
|
import org.briarproject.android.panic.PanicResponderActivity;
|
||||||
import org.briarproject.clients.ClientsModule;
|
|
||||||
import org.briarproject.contact.ContactModule;
|
|
||||||
import org.briarproject.crypto.CryptoModule;
|
|
||||||
import org.briarproject.data.DataModule;
|
|
||||||
import org.briarproject.db.DatabaseModule;
|
|
||||||
import org.briarproject.event.EventModule;
|
|
||||||
import org.briarproject.forum.ForumModule;
|
|
||||||
import org.briarproject.identity.IdentityModule;
|
|
||||||
import org.briarproject.invitation.InvitationModule;
|
|
||||||
import org.briarproject.lifecycle.LifecycleModule;
|
|
||||||
import org.briarproject.messaging.MessagingModule;
|
|
||||||
import org.briarproject.plugins.AndroidPluginsModule;
|
|
||||||
import org.briarproject.properties.PropertiesModule;
|
|
||||||
import org.briarproject.reliability.ReliabilityModule;
|
|
||||||
import org.briarproject.settings.SettingsModule;
|
|
||||||
import org.briarproject.sync.SyncModule;
|
|
||||||
import org.briarproject.system.AndroidSystemModule;
|
|
||||||
import org.briarproject.transport.TransportModule;
|
|
||||||
|
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
import dagger.Component;
|
import dagger.Component;
|
||||||
@Singleton
|
@ApplicationScope
|
||||||
@Component(
|
@Component(
|
||||||
modules = {AppModule.class, AndroidModule.class, DatabaseModule.class,
|
dependencies = {CoreComponent.class},
|
||||||
CryptoModule.class, LifecycleModule.class,
|
modules = {AppModule.class, AndroidModule.class})
|
||||||
ReliabilityModule.class, MessagingModule.class,
|
|
||||||
InvitationModule.class, ForumModule.class, IdentityModule.class,
|
|
||||||
EventModule.class, DataModule.class, ContactModule.class,
|
|
||||||
AndroidSystemModule.class, AndroidPluginsModule.class,
|
|
||||||
PropertiesModule.class, TransportModule.class, SyncModule.class,
|
|
||||||
SettingsModule.class, ClientsModule.class})
|
|
||||||
public interface AndroidComponent {
|
public interface AndroidComponent {
|
||||||
void inject(SplashScreenActivity activity);
|
void inject(SplashScreenActivity activity);
|
||||||
void inject(SetupActivity activity);
|
void inject(SetupActivity activity);
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package org.briarproject.android;
|
||||||
|
|
||||||
|
public class AndroidEagerSingletons {
|
||||||
|
|
||||||
|
public static void initEagerSingletons(AndroidComponent c) {
|
||||||
|
c.inject(new AndroidModule.EagerSingletons());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,138 +1,37 @@
|
|||||||
package org.briarproject.android;
|
package org.briarproject.android;
|
||||||
|
|
||||||
import android.app.Application;
|
|
||||||
|
|
||||||
import org.briarproject.api.android.AndroidExecutor;
|
|
||||||
import org.briarproject.api.android.AndroidNotificationManager;
|
import org.briarproject.api.android.AndroidNotificationManager;
|
||||||
import org.briarproject.api.android.ReferenceManager;
|
import org.briarproject.api.android.ReferenceManager;
|
||||||
import org.briarproject.api.contact.ContactManager;
|
|
||||||
import org.briarproject.api.crypto.SecretKey;
|
|
||||||
import org.briarproject.api.db.DatabaseConfig;
|
|
||||||
import org.briarproject.api.event.EventBus;
|
import org.briarproject.api.event.EventBus;
|
||||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
import org.briarproject.api.messaging.MessagingManager;
|
|
||||||
import org.briarproject.api.plugins.PluginManager;
|
|
||||||
import org.briarproject.api.properties.TransportPropertyManager;
|
|
||||||
import org.briarproject.api.sync.ValidationManager;
|
|
||||||
import org.briarproject.api.transport.KeyManager;
|
|
||||||
import org.briarproject.api.ui.UiCallback;
|
|
||||||
import org.briarproject.messaging.PrivateMessageValidator;
|
|
||||||
import org.briarproject.properties.TransportPropertyValidator;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
|
|
||||||
import static android.content.Context.MODE_PRIVATE;
|
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
public class AndroidModule {
|
public class AndroidModule {
|
||||||
|
|
||||||
static class EagerSingletons {
|
static class EagerSingletons {
|
||||||
// Load all relevant eager singletons and their references
|
|
||||||
@Inject
|
|
||||||
KeyManager keyManager;
|
|
||||||
@Inject
|
|
||||||
ValidationManager validationManager;
|
|
||||||
@Inject
|
|
||||||
PluginManager pluginManager;
|
|
||||||
@Inject
|
@Inject
|
||||||
AndroidNotificationManager androidNotificationManager;
|
AndroidNotificationManager androidNotificationManager;
|
||||||
@Inject
|
|
||||||
TransportPropertyManager transportPropertyManager;
|
|
||||||
@Inject
|
|
||||||
MessagingManager messagingManager;
|
|
||||||
@Inject
|
|
||||||
PrivateMessageValidator privateMessageValidator;
|
|
||||||
@Inject
|
|
||||||
TransportPropertyValidator transportPropertyValidator;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static void injectEager(AndroidComponent c) {
|
|
||||||
c.inject(new EagerSingletons());
|
|
||||||
}
|
|
||||||
|
|
||||||
private final UiCallback uiCallback;
|
|
||||||
|
|
||||||
public AndroidModule() {
|
|
||||||
// Use a dummy UI callback
|
|
||||||
uiCallback = new UiCallback() {
|
|
||||||
|
|
||||||
public int showChoice(String[] options, String... message) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean showConfirmationMessage(String... message) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void showMessage(String... message) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
UiCallback provideUICallback() {
|
@ApplicationScope
|
||||||
return uiCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Provides
|
|
||||||
@Singleton
|
|
||||||
ReferenceManager provideReferenceManager() {
|
ReferenceManager provideReferenceManager() {
|
||||||
return new ReferenceManagerImpl();
|
return new ReferenceManagerImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@ApplicationScope
|
||||||
AndroidExecutor provideAndroidExecutor(
|
|
||||||
AndroidExecutorImpl androidExecutor) {
|
|
||||||
return androidExecutor;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Provides
|
|
||||||
@Singleton
|
|
||||||
DatabaseConfig provideDatabaseConfig(final Application app) {
|
|
||||||
final File dir = app.getApplicationContext().getDir("db", MODE_PRIVATE);
|
|
||||||
return new DatabaseConfig() {
|
|
||||||
|
|
||||||
private volatile SecretKey key = null;
|
|
||||||
|
|
||||||
public boolean databaseExists() {
|
|
||||||
return dir.isDirectory() && dir.listFiles().length > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public File getDatabaseDirectory() {
|
|
||||||
return dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEncryptionKey(SecretKey key) {
|
|
||||||
this.key = key;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SecretKey getEncryptionKey() {
|
|
||||||
return key;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getMaxSize() {
|
|
||||||
return Long.MAX_VALUE;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Provides
|
|
||||||
@Singleton
|
|
||||||
AndroidNotificationManager provideAndroidNotificationManager(
|
AndroidNotificationManager provideAndroidNotificationManager(
|
||||||
LifecycleManager lifecycleManager, EventBus eventBus,
|
LifecycleManager lifecycleManager, EventBus eventBus,
|
||||||
AndroidNotificationManagerImpl notificationManager) {
|
AndroidNotificationManagerImpl notificationManager) {
|
||||||
lifecycleManager.register(notificationManager);
|
lifecycleManager.register(notificationManager);
|
||||||
eventBus.addListener(notificationManager);
|
eventBus.addListener(notificationManager);
|
||||||
|
|
||||||
return notificationManager;
|
return notificationManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import android.support.v4.app.TaskStackBuilder;
|
|||||||
import org.briarproject.R;
|
import org.briarproject.R;
|
||||||
import org.briarproject.android.contact.ConversationActivity;
|
import org.briarproject.android.contact.ConversationActivity;
|
||||||
import org.briarproject.android.forum.ForumActivity;
|
import org.briarproject.android.forum.ForumActivity;
|
||||||
import org.briarproject.api.android.AndroidExecutor;
|
import org.briarproject.api.android.PlatformExecutor;
|
||||||
import org.briarproject.api.android.AndroidNotificationManager;
|
import org.briarproject.api.android.AndroidNotificationManager;
|
||||||
import org.briarproject.api.db.DatabaseExecutor;
|
import org.briarproject.api.db.DatabaseExecutor;
|
||||||
import org.briarproject.api.db.DbException;
|
import org.briarproject.api.db.DbException;
|
||||||
@@ -65,7 +65,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
|||||||
private final SettingsManager settingsManager;
|
private final SettingsManager settingsManager;
|
||||||
private final MessagingManager messagingManager;
|
private final MessagingManager messagingManager;
|
||||||
private final ForumManager forumManager;
|
private final ForumManager forumManager;
|
||||||
private final AndroidExecutor androidExecutor;
|
private final PlatformExecutor platformExecutor;
|
||||||
private final Context appContext;
|
private final Context appContext;
|
||||||
|
|
||||||
// The following must only be accessed on the main UI thread
|
// The following must only be accessed on the main UI thread
|
||||||
@@ -82,13 +82,13 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
|||||||
@Inject
|
@Inject
|
||||||
public AndroidNotificationManagerImpl(@DatabaseExecutor Executor dbExecutor,
|
public AndroidNotificationManagerImpl(@DatabaseExecutor Executor dbExecutor,
|
||||||
SettingsManager settingsManager, MessagingManager messagingManager,
|
SettingsManager settingsManager, MessagingManager messagingManager,
|
||||||
ForumManager forumManager, AndroidExecutor androidExecutor,
|
ForumManager forumManager, PlatformExecutor platformExecutor,
|
||||||
Application app) {
|
Application app) {
|
||||||
this.dbExecutor = dbExecutor;
|
this.dbExecutor = dbExecutor;
|
||||||
this.settingsManager = settingsManager;
|
this.settingsManager = settingsManager;
|
||||||
this.messagingManager = messagingManager;
|
this.messagingManager = messagingManager;
|
||||||
this.forumManager = forumManager;
|
this.forumManager = forumManager;
|
||||||
this.androidExecutor = androidExecutor;
|
this.platformExecutor = platformExecutor;
|
||||||
appContext = app.getApplicationContext();
|
appContext = app.getApplicationContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void clearNotifications() {
|
private void clearNotifications() {
|
||||||
androidExecutor.execute(new Runnable() {
|
platformExecutor.execute(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
clearPrivateMessageNotification();
|
clearPrivateMessageNotification();
|
||||||
clearForumPostNotification();
|
clearForumPostNotification();
|
||||||
@@ -155,7 +155,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showPrivateMessageNotification(final GroupId g) {
|
public void showPrivateMessageNotification(final GroupId g) {
|
||||||
androidExecutor.execute(new Runnable() {
|
platformExecutor.execute(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
Integer count = contactCounts.get(g);
|
Integer count = contactCounts.get(g);
|
||||||
if (count == null) contactCounts.put(g, 1);
|
if (count == null) contactCounts.put(g, 1);
|
||||||
@@ -168,7 +168,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clearPrivateMessageNotification(final GroupId g) {
|
public void clearPrivateMessageNotification(final GroupId g) {
|
||||||
androidExecutor.execute(new Runnable() {
|
platformExecutor.execute(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
Integer count = contactCounts.remove(g);
|
Integer count = contactCounts.remove(g);
|
||||||
if (count == null) return; // Already cleared
|
if (count == null) return; // Already cleared
|
||||||
@@ -239,7 +239,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showForumPostNotification(final GroupId g) {
|
public void showForumPostNotification(final GroupId g) {
|
||||||
androidExecutor.execute(new Runnable() {
|
platformExecutor.execute(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
Integer count = forumCounts.get(g);
|
Integer count = forumCounts.get(g);
|
||||||
if (count == null) forumCounts.put(g, 1);
|
if (count == null) forumCounts.put(g, 1);
|
||||||
@@ -252,7 +252,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clearForumPostNotification(final GroupId g) {
|
public void clearForumPostNotification(final GroupId g) {
|
||||||
androidExecutor.execute(new Runnable() {
|
platformExecutor.execute(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
Integer count = forumCounts.remove(g);
|
Integer count = forumCounts.remove(g);
|
||||||
if (count == null) return; // Already cleared
|
if (count == null) return; // Already cleared
|
||||||
@@ -311,7 +311,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void blockNotification(final GroupId g) {
|
public void blockNotification(final GroupId g) {
|
||||||
androidExecutor.execute(new Runnable() {
|
platformExecutor.execute(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
visibleGroup = g;
|
visibleGroup = g;
|
||||||
}
|
}
|
||||||
@@ -319,7 +319,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void unblockNotification(final GroupId g) {
|
public void unblockNotification(final GroupId g) {
|
||||||
androidExecutor.execute(new Runnable() {
|
platformExecutor.execute(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
if (g.equals(visibleGroup)) visibleGroup = null;
|
if (g.equals(visibleGroup)) visibleGroup = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
package org.briarproject.android;
|
package org.briarproject.android;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
@@ -18,7 +15,7 @@ public class AppModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@ApplicationScope
|
||||||
Application providesApplication() {
|
Application providesApplication() {
|
||||||
return application;
|
return application;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package org.briarproject.android;
|
||||||
|
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
|
||||||
|
import javax.inject.Scope;
|
||||||
|
|
||||||
|
@Scope
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface ApplicationScope {
|
||||||
|
}
|
||||||
@@ -6,6 +6,13 @@ import java.util.logging.Logger;
|
|||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
import org.briarproject.CoreComponent;
|
||||||
|
import org.briarproject.CoreEagerSingletons;
|
||||||
|
import org.briarproject.DaggerCoreComponent;
|
||||||
|
import org.briarproject.plugins.PluginsModuleExtension;
|
||||||
|
import org.briarproject.system.PlatformModuleExtension;
|
||||||
|
import org.briarproject.system.SystemModuleExtension;
|
||||||
|
|
||||||
public class BriarApplication extends Application {
|
public class BriarApplication extends Application {
|
||||||
|
|
||||||
private static final Logger LOG =
|
private static final Logger LOG =
|
||||||
@@ -23,14 +30,21 @@ public class BriarApplication extends Application {
|
|||||||
CrashHandler newHandler = new CrashHandler(ctx, oldHandler);
|
CrashHandler newHandler = new CrashHandler(ctx, oldHandler);
|
||||||
Thread.setDefaultUncaughtExceptionHandler(newHandler);
|
Thread.setDefaultUncaughtExceptionHandler(newHandler);
|
||||||
|
|
||||||
|
CoreComponent coreComponent = DaggerCoreComponent.builder()
|
||||||
|
.systemModule(new SystemModuleExtension(this))
|
||||||
|
.platformModule(new PlatformModuleExtension(this))
|
||||||
|
.pluginsModule(new PluginsModuleExtension(this))
|
||||||
|
.build();
|
||||||
|
|
||||||
applicationComponent = DaggerAndroidComponent.builder()
|
applicationComponent = DaggerAndroidComponent.builder()
|
||||||
.appModule(new AppModule(this))
|
.appModule(new AppModule(this))
|
||||||
.androidModule(new AndroidModule())
|
.coreComponent(coreComponent)
|
||||||
.build();
|
.build();
|
||||||
// We need to load the eager singletons directly after making the
|
|
||||||
// dependency graph
|
|
||||||
AndroidModule.injectEager(applicationComponent);
|
|
||||||
|
|
||||||
|
// We need to load the eager singletons directly after making the
|
||||||
|
// dependency graphs
|
||||||
|
CoreEagerSingletons.initEagerSingletons(coreComponent);
|
||||||
|
AndroidEagerSingletons.initEagerSingletons(applicationComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AndroidComponent getApplicationComponent() {
|
public AndroidComponent getApplicationComponent() {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import android.os.IBinder;
|
|||||||
import android.support.v4.app.NotificationCompat;
|
import android.support.v4.app.NotificationCompat;
|
||||||
|
|
||||||
import org.briarproject.R;
|
import org.briarproject.R;
|
||||||
import org.briarproject.api.android.AndroidExecutor;
|
import org.briarproject.api.android.PlatformExecutor;
|
||||||
import org.briarproject.api.db.DatabaseConfig;
|
import org.briarproject.api.db.DatabaseConfig;
|
||||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
import org.briarproject.api.lifecycle.LifecycleManager.StartResult;
|
import org.briarproject.api.lifecycle.LifecycleManager.StartResult;
|
||||||
@@ -48,7 +48,7 @@ public class BriarService extends Service {
|
|||||||
|
|
||||||
// Fields that are accessed from background threads must be volatile
|
// Fields that are accessed from background threads must be volatile
|
||||||
@Inject protected volatile LifecycleManager lifecycleManager;
|
@Inject protected volatile LifecycleManager lifecycleManager;
|
||||||
@Inject protected volatile AndroidExecutor androidExecutor;
|
@Inject protected volatile PlatformExecutor platformExecutor;
|
||||||
private volatile boolean started = false;
|
private volatile boolean started = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -106,7 +106,7 @@ public class BriarService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showStartupFailureNotification(final StartResult result) {
|
private void showStartupFailureNotification(final StartResult result) {
|
||||||
androidExecutor.execute(new Runnable() {
|
platformExecutor.execute(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
NotificationCompat.Builder b =
|
NotificationCompat.Builder b =
|
||||||
new NotificationCompat.Builder(BriarService.this);
|
new NotificationCompat.Builder(BriarService.this);
|
||||||
|
|||||||
@@ -4,14 +4,12 @@ import android.app.Application;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
|
||||||
import org.briarproject.api.android.AndroidExecutor;
|
import org.briarproject.api.android.PlatformExecutor;
|
||||||
import org.briarproject.api.event.EventBus;
|
import org.briarproject.api.event.EventBus;
|
||||||
import org.briarproject.api.lifecycle.IoExecutor;
|
import org.briarproject.api.lifecycle.IoExecutor;
|
||||||
import org.briarproject.api.plugins.BackoffFactory;
|
import org.briarproject.api.plugins.BackoffFactory;
|
||||||
import org.briarproject.api.plugins.duplex.DuplexPluginConfig;
|
import org.briarproject.api.plugins.duplex.DuplexPluginConfig;
|
||||||
import org.briarproject.api.plugins.duplex.DuplexPluginFactory;
|
import org.briarproject.api.plugins.duplex.DuplexPluginFactory;
|
||||||
import org.briarproject.api.plugins.simplex.SimplexPluginConfig;
|
|
||||||
import org.briarproject.api.plugins.simplex.SimplexPluginFactory;
|
|
||||||
import org.briarproject.api.system.LocationUtils;
|
import org.briarproject.api.system.LocationUtils;
|
||||||
import org.briarproject.plugins.droidtooth.DroidtoothPluginFactory;
|
import org.briarproject.plugins.droidtooth.DroidtoothPluginFactory;
|
||||||
import org.briarproject.plugins.tcp.AndroidLanTcpPluginFactory;
|
import org.briarproject.plugins.tcp.AndroidLanTcpPluginFactory;
|
||||||
@@ -20,32 +18,22 @@ import org.briarproject.plugins.tor.TorPluginFactory;
|
|||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
public class AndroidPluginsModule extends PluginsModule {
|
public class AndroidPluginsModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
SimplexPluginConfig getSimplexPluginConfig() {
|
DuplexPluginConfig provideDuplexPluginConfig(@IoExecutor Executor ioExecutor,
|
||||||
return new SimplexPluginConfig() {
|
PlatformExecutor platformExecutor, Application app,
|
||||||
public Collection<SimplexPluginFactory> getFactories() {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Provides
|
|
||||||
DuplexPluginConfig getDuplexPluginConfig(@IoExecutor Executor ioExecutor,
|
|
||||||
AndroidExecutor androidExecutor, Application app,
|
|
||||||
SecureRandom random, BackoffFactory backoffFactory,
|
SecureRandom random, BackoffFactory backoffFactory,
|
||||||
LocationUtils locationUtils, EventBus eventBus) {
|
LocationUtils locationUtils, EventBus eventBus) {
|
||||||
Context appContext = app.getApplicationContext();
|
Context appContext = app.getApplicationContext();
|
||||||
DuplexPluginFactory bluetooth = new DroidtoothPluginFactory(ioExecutor,
|
DuplexPluginFactory bluetooth = new DroidtoothPluginFactory(ioExecutor,
|
||||||
androidExecutor, appContext, random, backoffFactory);
|
platformExecutor, appContext, random, backoffFactory);
|
||||||
DuplexPluginFactory tor = new TorPluginFactory(ioExecutor, appContext,
|
DuplexPluginFactory tor = new TorPluginFactory(ioExecutor, appContext,
|
||||||
locationUtils, eventBus);
|
locationUtils, eventBus);
|
||||||
DuplexPluginFactory lan = new AndroidLanTcpPluginFactory(ioExecutor,
|
DuplexPluginFactory lan = new AndroidLanTcpPluginFactory(ioExecutor,
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package org.briarproject.plugins;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import org.briarproject.api.android.PlatformExecutor;
|
||||||
|
import org.briarproject.api.event.EventBus;
|
||||||
|
import org.briarproject.api.lifecycle.IoExecutor;
|
||||||
|
import org.briarproject.api.plugins.BackoffFactory;
|
||||||
|
import org.briarproject.api.plugins.duplex.DuplexPluginConfig;
|
||||||
|
import org.briarproject.api.plugins.duplex.DuplexPluginFactory;
|
||||||
|
import org.briarproject.api.system.LocationUtils;
|
||||||
|
import org.briarproject.plugins.droidtooth.DroidtoothPluginFactory;
|
||||||
|
import org.briarproject.plugins.tcp.AndroidLanTcpPluginFactory;
|
||||||
|
import org.briarproject.plugins.tor.TorPluginFactory;
|
||||||
|
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
|
public class PluginsModuleExtension extends PluginsModule {
|
||||||
|
|
||||||
|
private final Application app;
|
||||||
|
|
||||||
|
public PluginsModuleExtension(Application app) {
|
||||||
|
this.app = app;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DuplexPluginConfig provideDuplexPluginConfig(
|
||||||
|
@IoExecutor Executor ioExecutor, PlatformExecutor platformExecutor,
|
||||||
|
SecureRandom random, BackoffFactory backoffFactory,
|
||||||
|
LocationUtils locationUtils, EventBus eventBus) {
|
||||||
|
Context appContext = app.getApplicationContext();
|
||||||
|
DuplexPluginFactory bluetooth = new DroidtoothPluginFactory(ioExecutor,
|
||||||
|
platformExecutor, appContext, random, backoffFactory);
|
||||||
|
DuplexPluginFactory tor = new TorPluginFactory(ioExecutor, appContext,
|
||||||
|
locationUtils, eventBus);
|
||||||
|
DuplexPluginFactory lan = new AndroidLanTcpPluginFactory(ioExecutor,
|
||||||
|
backoffFactory, appContext);
|
||||||
|
final Collection<DuplexPluginFactory> factories =
|
||||||
|
Arrays.asList(bluetooth, tor, lan);
|
||||||
|
return new DuplexPluginConfig() {
|
||||||
|
public Collection<DuplexPluginFactory> getFactories() {
|
||||||
|
return factories;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package org.briarproject.android;
|
package org.briarproject.system;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -6,7 +6,7 @@ import android.os.Handler;
|
|||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
|
||||||
import org.briarproject.api.android.AndroidExecutor;
|
import org.briarproject.api.android.PlatformExecutor;
|
||||||
|
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
@@ -14,11 +14,10 @@ import java.util.concurrent.FutureTask;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
class AndroidExecutorImpl implements AndroidExecutor {
|
class AndroidExecutorImpl implements PlatformExecutor {
|
||||||
|
|
||||||
private final Handler handler;
|
private final Handler handler;
|
||||||
|
|
||||||
@Inject
|
|
||||||
AndroidExecutorImpl(Application app) {
|
AndroidExecutorImpl(Application app) {
|
||||||
Context ctx = app.getApplicationContext();
|
Context ctx = app.getApplicationContext();
|
||||||
handler = new FutureTaskHandler(ctx.getMainLooper());
|
handler = new FutureTaskHandler(ctx.getMainLooper());
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package org.briarproject.system;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import org.briarproject.PlatformModule;
|
||||||
|
import org.briarproject.android.ApplicationScope;
|
||||||
|
import org.briarproject.api.android.PlatformExecutor;
|
||||||
|
import org.briarproject.api.crypto.SecretKey;
|
||||||
|
import org.briarproject.api.db.DatabaseConfig;
|
||||||
|
import org.briarproject.api.ui.UiCallback;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class PlatformModuleExtension extends PlatformModule {
|
||||||
|
|
||||||
|
private final UiCallback uiCallback;
|
||||||
|
private final Application app;
|
||||||
|
|
||||||
|
public PlatformModuleExtension(Application app) {
|
||||||
|
this.app = app;
|
||||||
|
// Use a dummy UI callback
|
||||||
|
uiCallback = new UiCallback() {
|
||||||
|
|
||||||
|
public int showChoice(String[] options, String... message) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean showConfirmationMessage(String... message) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showMessage(String... message) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UiCallback provideUICallback() {
|
||||||
|
return uiCallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@ApplicationScope
|
||||||
|
public DatabaseConfig provideDatabaseConfig() {
|
||||||
|
final File dir = app.getApplicationContext().getDir("db", Context.MODE_PRIVATE);
|
||||||
|
return new DatabaseConfig() {
|
||||||
|
|
||||||
|
private volatile SecretKey key = null;
|
||||||
|
|
||||||
|
public boolean databaseExists() {
|
||||||
|
return dir.isDirectory() && dir.listFiles().length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public File getDatabaseDirectory() {
|
||||||
|
return dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEncryptionKey(SecretKey key) {
|
||||||
|
this.key = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SecretKey getEncryptionKey() {
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getMaxSize() {
|
||||||
|
return Long.MAX_VALUE;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PlatformExecutor providePlatformExecutor() {
|
||||||
|
return new AndroidExecutorImpl(app);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package org.briarproject.system;
|
||||||
|
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
|
||||||
|
import org.briarproject.api.system.Clock;
|
||||||
|
import org.briarproject.api.system.LocationUtils;
|
||||||
|
import org.briarproject.api.system.SeedProvider;
|
||||||
|
import org.briarproject.api.system.Timer;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.Provides;
|
||||||
|
|
||||||
|
public class SystemModuleExtension extends SystemModule {
|
||||||
|
|
||||||
|
private final Application app;
|
||||||
|
|
||||||
|
public SystemModuleExtension(final Application app) {
|
||||||
|
this.app = app;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SeedProvider provideSeedProvider() {
|
||||||
|
return new AndroidSeedProvider(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LocationUtils provideLocationUtils() {
|
||||||
|
return new AndroidLocationUtils(app);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ import java.util.concurrent.Future;
|
|||||||
* Enables background threads to make Android API calls that must be made from
|
* Enables background threads to make Android API calls that must be made from
|
||||||
* a thread with a message queue.
|
* a thread with a message queue.
|
||||||
*/
|
*/
|
||||||
public interface AndroidExecutor {
|
public interface PlatformExecutor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs the given task on the main UI thread and returns a Future for
|
* Runs the given task on the main UI thread and returns a Future for
|
||||||
103
briar-core/src/org/briarproject/CoreComponent.java
Normal file
103
briar-core/src/org/briarproject/CoreComponent.java
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
package org.briarproject;
|
||||||
|
|
||||||
|
import org.briarproject.api.android.PlatformExecutor;
|
||||||
|
import org.briarproject.api.android.ReferenceManager;
|
||||||
|
import org.briarproject.api.contact.ContactManager;
|
||||||
|
import org.briarproject.api.crypto.CryptoComponent;
|
||||||
|
import org.briarproject.api.crypto.CryptoExecutor;
|
||||||
|
import org.briarproject.api.crypto.PasswordStrengthEstimator;
|
||||||
|
import org.briarproject.api.db.DatabaseConfig;
|
||||||
|
import org.briarproject.api.db.DatabaseExecutor;
|
||||||
|
import org.briarproject.api.event.EventBus;
|
||||||
|
import org.briarproject.api.forum.ForumManager;
|
||||||
|
import org.briarproject.api.forum.ForumPostFactory;
|
||||||
|
import org.briarproject.api.forum.ForumSharingManager;
|
||||||
|
import org.briarproject.api.identity.AuthorFactory;
|
||||||
|
import org.briarproject.api.identity.IdentityManager;
|
||||||
|
import org.briarproject.api.invitation.InvitationTaskFactory;
|
||||||
|
import org.briarproject.api.lifecycle.IoExecutor;
|
||||||
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
|
import org.briarproject.api.messaging.MessagingManager;
|
||||||
|
import org.briarproject.api.messaging.PrivateMessageFactory;
|
||||||
|
import org.briarproject.api.plugins.ConnectionRegistry;
|
||||||
|
import org.briarproject.api.plugins.PluginManager;
|
||||||
|
import org.briarproject.api.properties.TransportPropertyManager;
|
||||||
|
import org.briarproject.api.settings.SettingsManager;
|
||||||
|
import org.briarproject.api.sync.ValidationManager;
|
||||||
|
import org.briarproject.api.transport.KeyManager;
|
||||||
|
import org.briarproject.clients.ClientsModule;
|
||||||
|
import org.briarproject.contact.ContactModule;
|
||||||
|
import org.briarproject.crypto.CryptoModule;
|
||||||
|
import org.briarproject.data.DataModule;
|
||||||
|
import org.briarproject.db.DatabaseModule;
|
||||||
|
import org.briarproject.event.EventModule;
|
||||||
|
import org.briarproject.forum.ForumModule;
|
||||||
|
import org.briarproject.identity.IdentityModule;
|
||||||
|
import org.briarproject.invitation.InvitationModule;
|
||||||
|
import org.briarproject.lifecycle.LifecycleModule;
|
||||||
|
import org.briarproject.messaging.MessagingModule;
|
||||||
|
import org.briarproject.messaging.PrivateMessageValidator;
|
||||||
|
import org.briarproject.plugins.PluginsModule;
|
||||||
|
import org.briarproject.properties.PropertiesModule;
|
||||||
|
import org.briarproject.properties.TransportPropertyValidator;
|
||||||
|
import org.briarproject.reliability.ReliabilityModule;
|
||||||
|
import org.briarproject.settings.SettingsModule;
|
||||||
|
import org.briarproject.sync.SyncModule;
|
||||||
|
import org.briarproject.system.SystemModule;
|
||||||
|
import org.briarproject.transport.TransportModule;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import dagger.Component;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
@Component(modules = {DatabaseModule.class,
|
||||||
|
CryptoModule.class, LifecycleModule.class, PlatformModule.class,
|
||||||
|
ReliabilityModule.class, MessagingModule.class,
|
||||||
|
InvitationModule.class, ForumModule.class, IdentityModule.class,
|
||||||
|
EventModule.class, DataModule.class, ContactModule.class,
|
||||||
|
PropertiesModule.class, TransportModule.class, SyncModule.class,
|
||||||
|
SettingsModule.class, ClientsModule.class, SystemModule.class,
|
||||||
|
PluginsModule.class})
|
||||||
|
public interface CoreComponent {
|
||||||
|
@IoExecutor
|
||||||
|
Executor ioExecutor();
|
||||||
|
ContactManager contactManager();
|
||||||
|
@CryptoExecutor Executor cryptoExecutor();
|
||||||
|
DatabaseConfig databaseConfig();
|
||||||
|
PasswordStrengthEstimator passwordStrengthEstimator();
|
||||||
|
CryptoComponent cryptoComponent();
|
||||||
|
@DatabaseExecutor Executor dbExecutor();
|
||||||
|
LifecycleManager lifecycleManager();
|
||||||
|
AuthorFactory authFactory();
|
||||||
|
EventBus eventBus();
|
||||||
|
KeyManager keyManager();
|
||||||
|
ValidationManager validationManager();
|
||||||
|
ForumManager forumManager();
|
||||||
|
IdentityManager identityManager();
|
||||||
|
PluginManager pluginManager();
|
||||||
|
SettingsManager settingsManater();
|
||||||
|
InvitationTaskFactory invitationTaskFactory();
|
||||||
|
MessagingManager messagingManager();
|
||||||
|
TransportPropertyManager transportPropertyManager();
|
||||||
|
ConnectionRegistry connectionRegistry();
|
||||||
|
ForumSharingManager forumSharingManager();
|
||||||
|
PrivateMessageFactory privateMessageFactory();
|
||||||
|
ForumPostFactory forumPostFactory();
|
||||||
|
PrivateMessageValidator privateMessageValidator();
|
||||||
|
TransportPropertyValidator transportPropertyValidator();
|
||||||
|
PlatformExecutor platformExecutor();
|
||||||
|
// Eager singletons
|
||||||
|
void inject(ContactModule.EagerSingletons init);
|
||||||
|
void inject(CryptoModule.EagerSingletons init);
|
||||||
|
void inject(DatabaseModule.EagerSingletons init);
|
||||||
|
void inject(ForumModule.EagerSingletons init);
|
||||||
|
void inject(LifecycleModule.EagerSingletons init);
|
||||||
|
void inject(MessagingModule.EagerSingletons init);
|
||||||
|
void inject(PluginsModule.EagerSingletons init);
|
||||||
|
void inject(PropertiesModule.EagerSingletons init);
|
||||||
|
void inject(SyncModule.EagerSingletons init);
|
||||||
|
void inject(TransportModule.EagerSingletons init);
|
||||||
|
}
|
||||||
28
briar-core/src/org/briarproject/CoreEagerSingletons.java
Normal file
28
briar-core/src/org/briarproject/CoreEagerSingletons.java
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
package org.briarproject;
|
||||||
|
|
||||||
|
import org.briarproject.contact.ContactModule;
|
||||||
|
import org.briarproject.crypto.CryptoModule;
|
||||||
|
import org.briarproject.db.DatabaseModule;
|
||||||
|
import org.briarproject.forum.ForumModule;
|
||||||
|
import org.briarproject.lifecycle.LifecycleModule;
|
||||||
|
import org.briarproject.messaging.MessagingModule;
|
||||||
|
import org.briarproject.plugins.PluginsModule;
|
||||||
|
import org.briarproject.properties.PropertiesModule;
|
||||||
|
import org.briarproject.sync.SyncModule;
|
||||||
|
import org.briarproject.transport.TransportModule;
|
||||||
|
|
||||||
|
public class CoreEagerSingletons {
|
||||||
|
|
||||||
|
public static void initEagerSingletons(CoreComponent c) {
|
||||||
|
c.inject(new ContactModule.EagerSingletons());
|
||||||
|
c.inject(new CryptoModule.EagerSingletons());
|
||||||
|
c.inject(new DatabaseModule.EagerSingletons());
|
||||||
|
c.inject(new ForumModule.EagerSingletons());
|
||||||
|
c.inject(new LifecycleModule.EagerSingletons());
|
||||||
|
c.inject(new MessagingModule.EagerSingletons());
|
||||||
|
c.inject(new PluginsModule.EagerSingletons());
|
||||||
|
c.inject(new PropertiesModule.EagerSingletons());
|
||||||
|
c.inject(new SyncModule.EagerSingletons());
|
||||||
|
c.inject(new TransportModule.EagerSingletons());
|
||||||
|
}
|
||||||
|
}
|
||||||
36
briar-core/src/org/briarproject/PlatformModule.java
Normal file
36
briar-core/src/org/briarproject/PlatformModule.java
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
package org.briarproject;
|
||||||
|
|
||||||
|
import org.briarproject.api.android.PlatformExecutor;
|
||||||
|
import org.briarproject.api.db.DatabaseConfig;
|
||||||
|
import org.briarproject.api.ui.UiCallback;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.Provides;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class contains methods that MUST(!) be overridden in platform specific
|
||||||
|
* modules that use the core.
|
||||||
|
*/
|
||||||
|
@Module
|
||||||
|
public class PlatformModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
public DatabaseConfig provideDatabaseConfig() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
public UiCallback provideUICallback() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
public PlatformExecutor providePlatformExecutor() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,9 +3,8 @@ package org.briarproject.contact;
|
|||||||
import org.briarproject.api.contact.ContactManager;
|
import org.briarproject.api.contact.ContactManager;
|
||||||
import org.briarproject.api.identity.IdentityManager;
|
import org.briarproject.api.identity.IdentityManager;
|
||||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
import org.briarproject.identity.IdentityModule;
|
|
||||||
import org.briarproject.lifecycle.LifecycleModule;
|
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
@@ -14,6 +13,10 @@ import dagger.Provides;
|
|||||||
@Module
|
@Module
|
||||||
public class ContactModule {
|
public class ContactModule {
|
||||||
|
|
||||||
|
public static class EagerSingletons {
|
||||||
|
@Inject ContactManager contactManager;
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ContactManager getContactManager(LifecycleManager lifecycleManager,
|
ContactManager getContactManager(LifecycleManager lifecycleManager,
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import org.briarproject.api.crypto.StreamDecrypterFactory;
|
|||||||
import org.briarproject.api.crypto.StreamEncrypterFactory;
|
import org.briarproject.api.crypto.StreamEncrypterFactory;
|
||||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
import org.briarproject.api.system.SeedProvider;
|
import org.briarproject.api.system.SeedProvider;
|
||||||
import org.briarproject.lifecycle.LifecycleModule;
|
|
||||||
|
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.concurrent.BlockingQueue;
|
import java.util.concurrent.BlockingQueue;
|
||||||
@@ -17,6 +16,7 @@ import java.util.concurrent.LinkedBlockingQueue;
|
|||||||
import java.util.concurrent.RejectedExecutionHandler;
|
import java.util.concurrent.RejectedExecutionHandler;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.inject.Provider;
|
import javax.inject.Provider;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
@@ -28,6 +28,11 @@ import static java.util.concurrent.TimeUnit.SECONDS;
|
|||||||
@Module
|
@Module
|
||||||
public class CryptoModule {
|
public class CryptoModule {
|
||||||
|
|
||||||
|
public static class EagerSingletons {
|
||||||
|
@Inject
|
||||||
|
@CryptoExecutor Executor cryptoExecutor;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum number of executor threads.
|
* The maximum number of executor threads.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ import org.briarproject.api.event.EventBus;
|
|||||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
import org.briarproject.api.lifecycle.ShutdownManager;
|
import org.briarproject.api.lifecycle.ShutdownManager;
|
||||||
import org.briarproject.api.system.Clock;
|
import org.briarproject.api.system.Clock;
|
||||||
import org.briarproject.data.DataModule;
|
|
||||||
import org.briarproject.event.EventModule;
|
|
||||||
import org.briarproject.lifecycle.LifecycleModule;
|
|
||||||
|
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
@@ -21,7 +18,6 @@ import java.util.concurrent.RejectedExecutionHandler;
|
|||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Named;
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
@@ -32,6 +28,11 @@ import static java.util.concurrent.TimeUnit.SECONDS;
|
|||||||
@Module
|
@Module
|
||||||
public class DatabaseModule {
|
public class DatabaseModule {
|
||||||
|
|
||||||
|
public static class EagerSingletons {
|
||||||
|
@Inject
|
||||||
|
@DatabaseExecutor ExecutorService executorService;
|
||||||
|
}
|
||||||
|
|
||||||
private final ExecutorService databaseExecutor;
|
private final ExecutorService databaseExecutor;
|
||||||
|
|
||||||
public DatabaseModule() {
|
public DatabaseModule() {
|
||||||
|
|||||||
@@ -4,25 +4,17 @@ import org.briarproject.api.clients.ClientHelper;
|
|||||||
import org.briarproject.api.contact.ContactManager;
|
import org.briarproject.api.contact.ContactManager;
|
||||||
import org.briarproject.api.crypto.CryptoComponent;
|
import org.briarproject.api.crypto.CryptoComponent;
|
||||||
import org.briarproject.api.data.BdfReaderFactory;
|
import org.briarproject.api.data.BdfReaderFactory;
|
||||||
import org.briarproject.api.data.BdfWriterFactory;
|
|
||||||
import org.briarproject.api.data.MetadataEncoder;
|
import org.briarproject.api.data.MetadataEncoder;
|
||||||
import org.briarproject.api.data.MetadataParser;
|
import org.briarproject.api.data.MetadataParser;
|
||||||
import org.briarproject.api.data.ObjectReader;
|
|
||||||
import org.briarproject.api.db.DatabaseComponent;
|
import org.briarproject.api.db.DatabaseComponent;
|
||||||
import org.briarproject.api.forum.ForumManager;
|
import org.briarproject.api.forum.ForumManager;
|
||||||
import org.briarproject.api.forum.ForumPostFactory;
|
import org.briarproject.api.forum.ForumPostFactory;
|
||||||
import org.briarproject.api.forum.ForumSharingManager;
|
import org.briarproject.api.forum.ForumSharingManager;
|
||||||
import org.briarproject.api.identity.Author;
|
|
||||||
import org.briarproject.api.identity.AuthorFactory;
|
import org.briarproject.api.identity.AuthorFactory;
|
||||||
import org.briarproject.api.sync.MessageFactory;
|
|
||||||
import org.briarproject.api.sync.ValidationManager;
|
import org.briarproject.api.sync.ValidationManager;
|
||||||
import org.briarproject.api.system.Clock;
|
import org.briarproject.api.system.Clock;
|
||||||
import org.briarproject.contact.ContactModule;
|
|
||||||
import org.briarproject.crypto.CryptoModule;
|
|
||||||
import org.briarproject.data.DataModule;
|
|
||||||
import org.briarproject.db.DatabaseModule;
|
|
||||||
import org.briarproject.sync.SyncModule;
|
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
@@ -31,6 +23,15 @@ import dagger.Provides;
|
|||||||
@Module
|
@Module
|
||||||
public class ForumModule {
|
public class ForumModule {
|
||||||
|
|
||||||
|
public static class EagerSingletons {
|
||||||
|
@Inject
|
||||||
|
ForumListValidator forumListValidator;
|
||||||
|
@Inject
|
||||||
|
ForumPostValidator forumPostValidator;
|
||||||
|
@Inject
|
||||||
|
ForumSharingManager forumSharingManager;
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ForumManager provideForumManager(DatabaseComponent db,
|
ForumManager provideForumManager(DatabaseComponent db,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import java.util.concurrent.RejectedExecutionHandler;
|
|||||||
import java.util.concurrent.SynchronousQueue;
|
import java.util.concurrent.SynchronousQueue;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import org.briarproject.api.db.DatabaseComponent;
|
import org.briarproject.api.db.DatabaseComponent;
|
||||||
@@ -17,7 +18,6 @@ import org.briarproject.api.lifecycle.IoExecutor;
|
|||||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
import org.briarproject.api.lifecycle.ShutdownManager;
|
import org.briarproject.api.lifecycle.ShutdownManager;
|
||||||
import org.briarproject.api.system.Clock;
|
import org.briarproject.api.system.Clock;
|
||||||
import org.briarproject.event.EventModule;
|
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
@@ -25,6 +25,11 @@ import dagger.Provides;
|
|||||||
@Module
|
@Module
|
||||||
public class LifecycleModule {
|
public class LifecycleModule {
|
||||||
|
|
||||||
|
public static class EagerSingletons {
|
||||||
|
@Inject
|
||||||
|
@IoExecutor Executor executor;
|
||||||
|
}
|
||||||
|
|
||||||
private final ExecutorService ioExecutor;
|
private final ExecutorService ioExecutor;
|
||||||
|
|
||||||
public LifecycleModule() {
|
public LifecycleModule() {
|
||||||
|
|||||||
@@ -2,18 +2,13 @@ package org.briarproject.messaging;
|
|||||||
|
|
||||||
import org.briarproject.api.clients.ClientHelper;
|
import org.briarproject.api.clients.ClientHelper;
|
||||||
import org.briarproject.api.contact.ContactManager;
|
import org.briarproject.api.contact.ContactManager;
|
||||||
import org.briarproject.api.data.BdfReaderFactory;
|
|
||||||
import org.briarproject.api.data.BdfWriterFactory;
|
|
||||||
import org.briarproject.api.data.MetadataEncoder;
|
import org.briarproject.api.data.MetadataEncoder;
|
||||||
import org.briarproject.api.messaging.MessagingManager;
|
import org.briarproject.api.messaging.MessagingManager;
|
||||||
import org.briarproject.api.messaging.PrivateMessageFactory;
|
import org.briarproject.api.messaging.PrivateMessageFactory;
|
||||||
import org.briarproject.api.sync.MessageFactory;
|
|
||||||
import org.briarproject.api.sync.ValidationManager;
|
import org.briarproject.api.sync.ValidationManager;
|
||||||
import org.briarproject.api.system.Clock;
|
import org.briarproject.api.system.Clock;
|
||||||
import org.briarproject.contact.ContactModule;
|
|
||||||
import org.briarproject.data.DataModule;
|
|
||||||
import org.briarproject.sync.SyncModule;
|
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
@@ -24,13 +19,17 @@ import static org.briarproject.messaging.MessagingManagerImpl.CLIENT_ID;
|
|||||||
@Module
|
@Module
|
||||||
public class MessagingModule {
|
public class MessagingModule {
|
||||||
|
|
||||||
|
public static class EagerSingletons {
|
||||||
|
@Inject MessagingManager messagingManager;
|
||||||
|
@Inject PrivateMessageValidator privateMessageValidator;
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
PrivateMessageFactory providePrivateMessageFactory(
|
PrivateMessageFactory providePrivateMessageFactory(
|
||||||
ClientHelper clientHelper) {
|
ClientHelper clientHelper) {
|
||||||
return new PrivateMessageFactoryImpl(clientHelper);
|
return new PrivateMessageFactoryImpl(clientHelper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
PrivateMessageValidator getValidator(ValidationManager validationManager,
|
PrivateMessageValidator getValidator(ValidationManager validationManager,
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package org.briarproject.plugins;
|
package org.briarproject.plugins;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import org.briarproject.api.android.PlatformExecutor;
|
||||||
import org.briarproject.api.event.EventBus;
|
import org.briarproject.api.event.EventBus;
|
||||||
import org.briarproject.api.lifecycle.IoExecutor;
|
import org.briarproject.api.lifecycle.IoExecutor;
|
||||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
@@ -9,13 +11,19 @@ import org.briarproject.api.plugins.BackoffFactory;
|
|||||||
import org.briarproject.api.plugins.ConnectionManager;
|
import org.briarproject.api.plugins.ConnectionManager;
|
||||||
import org.briarproject.api.plugins.ConnectionRegistry;
|
import org.briarproject.api.plugins.ConnectionRegistry;
|
||||||
import org.briarproject.api.plugins.PluginManager;
|
import org.briarproject.api.plugins.PluginManager;
|
||||||
|
import org.briarproject.api.plugins.duplex.DuplexPluginConfig;
|
||||||
|
import org.briarproject.api.plugins.simplex.SimplexPluginConfig;
|
||||||
|
import org.briarproject.api.plugins.simplex.SimplexPluginFactory;
|
||||||
import org.briarproject.api.sync.SyncSessionFactory;
|
import org.briarproject.api.sync.SyncSessionFactory;
|
||||||
|
import org.briarproject.api.system.LocationUtils;
|
||||||
import org.briarproject.api.system.Timer;
|
import org.briarproject.api.system.Timer;
|
||||||
import org.briarproject.api.transport.KeyManager;
|
import org.briarproject.api.transport.KeyManager;
|
||||||
import org.briarproject.api.transport.StreamReaderFactory;
|
import org.briarproject.api.transport.StreamReaderFactory;
|
||||||
import org.briarproject.api.transport.StreamWriterFactory;
|
import org.briarproject.api.transport.StreamWriterFactory;
|
||||||
|
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
@@ -25,6 +33,11 @@ import dagger.Provides;
|
|||||||
@Module
|
@Module
|
||||||
public class PluginsModule {
|
public class PluginsModule {
|
||||||
|
|
||||||
|
public static class EagerSingletons {
|
||||||
|
@Inject
|
||||||
|
PluginManager pluginManager;
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
BackoffFactory provideBackoffFactory() {
|
BackoffFactory provideBackoffFactory() {
|
||||||
return new BackoffFactoryImpl();
|
return new BackoffFactoryImpl();
|
||||||
@@ -62,4 +75,21 @@ public class PluginsModule {
|
|||||||
lifecycleManager.register(pluginManager);
|
lifecycleManager.register(pluginManager);
|
||||||
return pluginManager;
|
return pluginManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
SimplexPluginConfig provideSimplexPluginConfig() {
|
||||||
|
return new SimplexPluginConfig() {
|
||||||
|
public Collection<SimplexPluginFactory> getFactories() {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
public DuplexPluginConfig provideDuplexPluginConfig(@IoExecutor Executor ioExecutor,
|
||||||
|
PlatformExecutor platformExecutor, /*Application app,*/
|
||||||
|
SecureRandom random, BackoffFactory backoffFactory,
|
||||||
|
LocationUtils locationUtils, EventBus eventBus) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,12 @@ package org.briarproject.properties;
|
|||||||
|
|
||||||
import org.briarproject.api.clients.ClientHelper;
|
import org.briarproject.api.clients.ClientHelper;
|
||||||
import org.briarproject.api.contact.ContactManager;
|
import org.briarproject.api.contact.ContactManager;
|
||||||
import org.briarproject.api.data.BdfReaderFactory;
|
|
||||||
import org.briarproject.api.data.MetadataEncoder;
|
import org.briarproject.api.data.MetadataEncoder;
|
||||||
import org.briarproject.api.properties.TransportPropertyManager;
|
import org.briarproject.api.properties.TransportPropertyManager;
|
||||||
import org.briarproject.api.sync.ValidationManager;
|
import org.briarproject.api.sync.ValidationManager;
|
||||||
import org.briarproject.api.system.Clock;
|
import org.briarproject.api.system.Clock;
|
||||||
import org.briarproject.contact.ContactModule;
|
|
||||||
import org.briarproject.data.DataModule;
|
|
||||||
import org.briarproject.sync.SyncModule;
|
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
@@ -21,6 +18,11 @@ import static org.briarproject.properties.TransportPropertyManagerImpl.CLIENT_ID
|
|||||||
@Module
|
@Module
|
||||||
public class PropertiesModule {
|
public class PropertiesModule {
|
||||||
|
|
||||||
|
public static class EagerSingletons {
|
||||||
|
@Inject TransportPropertyValidator transportPropertyValidator;
|
||||||
|
@Inject TransportPropertyManager transportPropertyManager;
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
TransportPropertyValidator getValidator(ValidationManager validationManager,
|
TransportPropertyValidator getValidator(ValidationManager validationManager,
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
package org.briarproject.sync;
|
package org.briarproject.sync;
|
||||||
|
|
||||||
import org.briarproject.api.crypto.CryptoComponent;
|
import org.briarproject.api.crypto.CryptoComponent;
|
||||||
import org.briarproject.api.data.BdfWriterFactory;
|
|
||||||
import org.briarproject.api.data.ObjectReader;
|
|
||||||
import org.briarproject.api.db.DatabaseComponent;
|
import org.briarproject.api.db.DatabaseComponent;
|
||||||
import org.briarproject.api.db.DatabaseExecutor;
|
import org.briarproject.api.db.DatabaseExecutor;
|
||||||
import org.briarproject.api.event.EventBus;
|
import org.briarproject.api.event.EventBus;
|
||||||
import org.briarproject.api.identity.Author;
|
|
||||||
import org.briarproject.api.identity.AuthorFactory;
|
|
||||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
import org.briarproject.api.sync.GroupFactory;
|
import org.briarproject.api.sync.GroupFactory;
|
||||||
import org.briarproject.api.sync.MessageFactory;
|
import org.briarproject.api.sync.MessageFactory;
|
||||||
@@ -16,10 +12,6 @@ import org.briarproject.api.sync.PacketWriterFactory;
|
|||||||
import org.briarproject.api.sync.SyncSessionFactory;
|
import org.briarproject.api.sync.SyncSessionFactory;
|
||||||
import org.briarproject.api.sync.ValidationManager;
|
import org.briarproject.api.sync.ValidationManager;
|
||||||
import org.briarproject.api.system.Clock;
|
import org.briarproject.api.system.Clock;
|
||||||
import org.briarproject.crypto.CryptoModule;
|
|
||||||
import org.briarproject.db.DatabaseModule;
|
|
||||||
import org.briarproject.event.EventModule;
|
|
||||||
import org.briarproject.lifecycle.LifecycleModule;
|
|
||||||
|
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
@@ -32,6 +24,10 @@ import dagger.Provides;
|
|||||||
@Module
|
@Module
|
||||||
public class SyncModule {
|
public class SyncModule {
|
||||||
|
|
||||||
|
public static class EagerSingletons {
|
||||||
|
@Inject ValidationManager validationManager;
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
GroupFactory provideGroupFactory(CryptoComponent crypto) {
|
GroupFactory provideGroupFactory(CryptoComponent crypto) {
|
||||||
return new GroupFactoryImpl(crypto);
|
return new GroupFactoryImpl(crypto);
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
package org.briarproject.system;
|
package org.briarproject.system;
|
||||||
|
|
||||||
|
|
||||||
import android.app.Application;
|
|
||||||
|
|
||||||
import org.briarproject.api.system.Clock;
|
import org.briarproject.api.system.Clock;
|
||||||
import org.briarproject.api.system.LocationUtils;
|
import org.briarproject.api.system.LocationUtils;
|
||||||
import org.briarproject.api.system.SeedProvider;
|
import org.briarproject.api.system.SeedProvider;
|
||||||
@@ -12,8 +9,7 @@ import dagger.Module;
|
|||||||
import dagger.Provides;
|
import dagger.Provides;
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
public class AndroidSystemModule {
|
public class SystemModule {
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
Clock provideClock() {
|
Clock provideClock() {
|
||||||
return new SystemClock();
|
return new SystemClock();
|
||||||
@@ -25,13 +21,12 @@ public class AndroidSystemModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
SeedProvider provideSeedProvider(final Application app) {
|
public SeedProvider provideSeedProvider() {
|
||||||
return new AndroidSeedProvider(app);
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
LocationUtils provideLocationUtils(final Application app) {
|
public LocationUtils provideLocationUtils() {
|
||||||
return new AndroidLocationUtils(app);
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,9 +7,8 @@ import org.briarproject.api.lifecycle.LifecycleManager;
|
|||||||
import org.briarproject.api.transport.KeyManager;
|
import org.briarproject.api.transport.KeyManager;
|
||||||
import org.briarproject.api.transport.StreamReaderFactory;
|
import org.briarproject.api.transport.StreamReaderFactory;
|
||||||
import org.briarproject.api.transport.StreamWriterFactory;
|
import org.briarproject.api.transport.StreamWriterFactory;
|
||||||
import org.briarproject.event.EventModule;
|
|
||||||
import org.briarproject.lifecycle.LifecycleModule;
|
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
@@ -18,6 +17,10 @@ import dagger.Provides;
|
|||||||
@Module
|
@Module
|
||||||
public class TransportModule {
|
public class TransportModule {
|
||||||
|
|
||||||
|
public static class EagerSingletons {
|
||||||
|
@Inject KeyManager keyManager;
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
StreamReaderFactory provideStreamReaderFactory(
|
StreamReaderFactory provideStreamReaderFactory(
|
||||||
StreamDecrypterFactory streamDecrypterFactory) {
|
StreamDecrypterFactory streamDecrypterFactory) {
|
||||||
|
|||||||
Reference in New Issue
Block a user