mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Fix decryption corner case when passphrase is disabled.
This commit is contained in:
parent
5a3daf4846
commit
40629a3bcf
@ -215,6 +215,16 @@ public class SendReceiveService extends Service {
|
|||||||
CanonicalSessionMigrator.migrateSessions(this);
|
CanonicalSessionMigrator.migrateSessions(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private MasterSecret getPlaceholderSecret() {
|
||||||
|
try {
|
||||||
|
return MasterSecretUtil.getMasterSecret(SendReceiveService.this,
|
||||||
|
MasterSecretUtil.UNENCRYPTED_PASSPHRASE);
|
||||||
|
} catch (InvalidPassphraseException e) {
|
||||||
|
Log.w("SendReceiveService", e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void scheduleIntent(int what, Intent intent) {
|
private void scheduleIntent(int what, Intent intent) {
|
||||||
Runnable work = new SendReceiveWorkItem(intent, what);
|
Runnable work = new SendReceiveWorkItem(intent, what);
|
||||||
|
|
||||||
@ -228,6 +238,10 @@ public class SendReceiveService extends Service {
|
|||||||
Runnable work = new SendReceiveWorkItem(intent, what);
|
Runnable work = new SendReceiveWorkItem(intent, what);
|
||||||
|
|
||||||
synchronized (workQueue) {
|
synchronized (workQueue) {
|
||||||
|
if (!hasSecret && TextSecurePreferences.isPasswordDisabled(SendReceiveService.this)) {
|
||||||
|
initializeWithMasterSecret(getPlaceholderSecret());
|
||||||
|
}
|
||||||
|
|
||||||
if (hasSecret) {
|
if (hasSecret) {
|
||||||
workQueue.add(work);
|
workQueue.add(work);
|
||||||
workQueue.notifyAll();
|
workQueue.notifyAll();
|
||||||
@ -266,16 +280,6 @@ public class SendReceiveService extends Service {
|
|||||||
case DOWNLOAD_AVATAR: avatarDownloader.process(masterSecret, intent); return;
|
case DOWNLOAD_AVATAR: avatarDownloader.process(masterSecret, intent); return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private MasterSecret getPlaceholderSecret() {
|
|
||||||
try {
|
|
||||||
return MasterSecretUtil.getMasterSecret(SendReceiveService.this,
|
|
||||||
MasterSecretUtil.UNENCRYPTED_PASSPHRASE);
|
|
||||||
} catch (InvalidPassphraseException e) {
|
|
||||||
Log.w("SendReceiveService", e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ToastHandler extends Handler {
|
public class ToastHandler extends Handler {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user