mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 12:35:17 +00:00
35 lines
1001 B
Java
35 lines
1001 B
Java
|
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
|
||
|
public SignedPreKeyStore create(MasterSecret masterSecret) {
|
||
|
return new TextSecureAxolotlStore(context, masterSecret);
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public static interface SignedPreKeyStoreFactory {
|
||
|
public SignedPreKeyStore create(MasterSecret masterSecret);
|
||
|
}
|
||
|
}
|