mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-27 01:17:00 +00:00
Make signed prekey generation happen through the job queue.
This commit is contained in:
@@ -29,6 +29,7 @@ import android.widget.ProgressBar;
|
||||
|
||||
import org.thoughtcrime.securesms.crypto.DecryptingQueue;
|
||||
import org.thoughtcrime.securesms.crypto.IdentityKeyUtil;
|
||||
import org.thoughtcrime.securesms.jobs.CreateSignedPreKeyJob;
|
||||
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.whispersystems.textsecure.crypto.MasterSecret;
|
||||
@@ -47,12 +48,15 @@ public class DatabaseUpgradeActivity extends Activity {
|
||||
public static final int CURVE25519_VERSION = 63;
|
||||
public static final int ASYMMETRIC_MASTER_SECRET_FIX_VERSION = 73;
|
||||
public static final int NO_V1_VERSION = 83;
|
||||
public static final int SIGNED_PREKEY_VERSION = 83;
|
||||
|
||||
private static final SortedSet<Integer> UPGRADE_VERSIONS = new TreeSet<Integer>() {{
|
||||
add(NO_MORE_KEY_EXCHANGE_PREFIX_VERSION);
|
||||
add(TOFU_IDENTITIES_VERSION);
|
||||
add(CURVE25519_VERSION);
|
||||
add(ASYMMETRIC_MASTER_SECRET_FIX_VERSION);
|
||||
add(NO_V1_VERSION);
|
||||
add(SIGNED_PREKEY_VERSION);
|
||||
}};
|
||||
|
||||
private MasterSecret masterSecret;
|
||||
@@ -155,6 +159,12 @@ public class DatabaseUpgradeActivity extends Activity {
|
||||
}
|
||||
}
|
||||
|
||||
if (params[0] < SIGNED_PREKEY_VERSION) {
|
||||
ApplicationContext.getInstance(getApplicationContext())
|
||||
.getJobManager()
|
||||
.add(new CreateSignedPreKeyJob(context, masterSecret));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user