2014-11-12 03:57:53 +00:00
|
|
|
package org.thoughtcrime.securesms.dependencies;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
|
|
|
import org.thoughtcrime.securesms.crypto.storage.TextSecureAxolotlStore;
|
|
|
|
import org.thoughtcrime.securesms.jobs.CleanPreKeysJob;
|
|
|
|
import org.whispersystems.libaxolotl.state.SignedPreKeyStore;
|
|
|
|
|
|
|
|
import dagger.Module;
|
|
|
|
import dagger.Provides;
|
|
|
|
|
|
|
|
@Module (complete = false, injects = {CleanPreKeysJob.class})
|
|
|
|
public class AxolotlStorageModule {
|
|
|
|
|
|
|
|
private final Context context;
|
|
|
|
|
|
|
|
public AxolotlStorageModule(Context context) {
|
|
|
|
this.context = context;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Provides SignedPreKeyStoreFactory provideSignedPreKeyStoreFactory() {
|
|
|
|
return new SignedPreKeyStoreFactory() {
|
|
|
|
@Override
|
2015-07-07 00:36:49 +00:00
|
|
|
public SignedPreKeyStore create() {
|
|
|
|
return new TextSecureAxolotlStore(context);
|
2014-11-12 03:57:53 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public static interface SignedPreKeyStoreFactory {
|
2015-07-07 00:36:49 +00:00
|
|
|
public SignedPreKeyStore create();
|
2014-11-12 03:57:53 +00:00
|
|
|
}
|
|
|
|
}
|