Compare commits

...

4 Commits

Author SHA1 Message Date
Alex Hart
7bb4f57c13 Bump version to 6.35.5 2023-10-13 14:04:06 -03:00
Cody Henthorne
64d27b2af5 Fix deadlock in JobManager initialization. 2023-10-13 12:58:48 -04:00
Alex Hart
d19c5085ce Bump version to 6.35.4 2023-10-11 15:24:41 -03:00
Nicholas
4f20b35dfa Disable incremental MAC generation. 2023-10-11 14:20:30 -04:00
4 changed files with 28 additions and 20 deletions

View File

@@ -34,14 +34,14 @@ ktlint {
}
def canonicalVersionCode = 1341
def canonicalVersionName = "6.35.3"
def canonicalVersionName = "6.35.5"
def postFixSize = 100
def abiPostFix = ['universal' : 0,
'armeabi-v7a' : 1,
'arm64-v8a' : 2,
'x86' : 3,
'x86_64' : 4]
def abiPostFix = ['universal' : 10,
'armeabi-v7a' : 11,
'arm64-v8a' : 12,
'x86' : 13,
'x86_64' : 14]
def keystores = [ 'debug' : loadKeystoreProperties('keystore.debug.properties') ]

View File

@@ -23,9 +23,6 @@ import org.signal.core.util.update
import org.signal.core.util.withinTransaction
import org.thoughtcrime.securesms.crypto.DatabaseSecret
import org.thoughtcrime.securesms.crypto.DatabaseSecretProvider
import org.thoughtcrime.securesms.database.SignalDatabase.Companion.hasTable
import org.thoughtcrime.securesms.database.SignalDatabase.Companion.rawDatabase
import org.thoughtcrime.securesms.database.SqlCipherLibraryLoader.load
import org.thoughtcrime.securesms.jobmanager.persistence.ConstraintSpec
import org.thoughtcrime.securesms.jobmanager.persistence.DependencySpec
import org.thoughtcrime.securesms.jobmanager.persistence.FullSpec
@@ -123,19 +120,19 @@ class JobDatabase(
db.execSQL(Constraints.CREATE_TABLE)
db.execSQL(Dependencies.CREATE_TABLE)
if (hasTable("job_spec")) {
if (SignalDatabase.hasTable("job_spec")) {
Log.i(TAG, "Found old job_spec table. Migrating data.")
migrateJobSpecsFromPreviousDatabase(rawDatabase, db)
migrateJobSpecsFromPreviousDatabase(SignalDatabase.rawDatabase, db)
}
if (hasTable("constraint_spec")) {
if (SignalDatabase.hasTable("constraint_spec")) {
Log.i(TAG, "Found old constraint_spec table. Migrating data.")
migrateConstraintSpecsFromPreviousDatabase(rawDatabase, db)
migrateConstraintSpecsFromPreviousDatabase(SignalDatabase.rawDatabase, db)
}
if (hasTable("dependency_spec")) {
if (SignalDatabase.hasTable("dependency_spec")) {
Log.i(TAG, "Found old dependency_spec table. Migrating data.")
migrateDependencySpecsFromPreviousDatabase(rawDatabase, db)
migrateDependencySpecsFromPreviousDatabase(SignalDatabase.rawDatabase, db)
}
}
@@ -405,9 +402,9 @@ class JobDatabase(
}
private fun dropTableIfPresent(table: String) {
if (hasTable(table)) {
if (SignalDatabase.hasTable(table)) {
Log.i(TAG, "Dropping original $table table from the main database.")
rawDatabase.execSQL("DROP TABLE $table")
SignalDatabase.rawDatabase.execSQL("DROP TABLE $table")
}
}
@@ -425,7 +422,7 @@ class JobDatabase(
if (instance == null) {
synchronized(JobDatabase::class.java) {
if (instance == null) {
load()
SqlCipherLibraryLoader.load()
instance = JobDatabase(context, DatabaseSecretProvider.getOrCreateDatabaseSecret(context))
}
}

View File

@@ -54,7 +54,7 @@ public class JobManager implements ConstraintObserver.Notifier {
@GuardedBy("emptyQueueListeners")
private final Set<EmptyQueueListener> emptyQueueListeners = new CopyOnWriteArraySet<>();
private volatile boolean initialized;
private volatile boolean initialized = false;
public JobManager(@NonNull Application application, @NonNull Configuration configuration) {
this.application = application;
@@ -73,6 +73,7 @@ public class JobManager implements ConstraintObserver.Notifier {
executor.execute(() -> {
synchronized (this) {
Log.d(TAG, "Starting initialization: " + Thread.currentThread());
JobStorage jobStorage = configuration.getJobStorage();
jobStorage.init();
@@ -91,6 +92,10 @@ public class JobManager implements ConstraintObserver.Notifier {
initialized = true;
notifyAll();
jobController.wakeUp();
Log.d(TAG, "Initialized");
}
});
}
@@ -343,6 +348,11 @@ public class JobManager implements ConstraintObserver.Notifier {
@Override
public void onConstraintMet(@NonNull String reason) {
if (!initialized) {
Log.d(TAG, "Ignoring early onConstraintMet(" + reason + ")");
return;
}
Log.i(TAG, "onConstraintMet(" + reason + ")");
wakeUp();
}

View File

@@ -41,7 +41,7 @@ class DigestingRequestBody(
override fun writeTo(sink: BufferedSink) {
val digestStream = ByteArrayOutputStream()
val inner = SkippingOutputStream(contentStart, sink.outputStream())
val isIncremental = outputStreamFactory is AttachmentCipherOutputStreamFactory
val isIncremental = outputStreamFactory is AttachmentCipherOutputStreamFactory && INCREMENTAL_MAC_SENDING_ENABLED
val sizeChoice: ChunkSizeChoice = ChunkSizeChoice.inferChunkSize(contentLength.toInt())
val outputStream: DigestingOutputStream = if (isIncremental) {
(outputStreamFactory as AttachmentCipherOutputStreamFactory).createIncrementalFor(inner, contentLength, sizeChoice, digestStream)
@@ -95,5 +95,6 @@ class DigestingRequestBody(
companion object {
const val TAG = "DigestingRequestBody"
const val INCREMENTAL_MAC_SENDING_ENABLED = false
}
}