Skip to content

Commit

Permalink
Update SQLCipher to 4.5.3-FTS-S1
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Feb 14, 2023
1 parent cf250b4 commit ffbebe0
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,14 @@ private static final class Dependencies {
if (instance == null) {
SqlCipherLibraryLoader.load();
instance = new JobDatabase(context, DatabaseSecretProvider.getOrCreateDatabaseSecret(context));
instance.setWriteAheadLoggingEnabled(true);
}
}
}
return instance;
}

public JobDatabase(@NonNull Application application, @NonNull DatabaseSecret databaseSecret) {
super(application, DATABASE_NAME, databaseSecret.asString(), null, DATABASE_VERSION, 0, new SqlCipherErrorHandler(DATABASE_NAME), new SqlCipherDatabaseHook());
super(application, DATABASE_NAME, databaseSecret.asString(), null, DATABASE_VERSION, 0, new SqlCipherErrorHandler(DATABASE_NAME), new SqlCipherDatabaseHook(), true);

this.application = application;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public class KeyValueDatabase extends SQLiteOpenHelper implements SignalDatabase
if (instance == null) {
SqlCipherLibraryLoader.load();
instance = new KeyValueDatabase(context, DatabaseSecretProvider.getOrCreateDatabaseSecret(context));
instance.setWriteAheadLoggingEnabled(true);
}
}
}
Expand All @@ -68,7 +67,7 @@ public static boolean exists(Context context) {


private KeyValueDatabase(@NonNull Application application, @NonNull DatabaseSecret databaseSecret) {
super(application, DATABASE_NAME, databaseSecret.asString(), null, DATABASE_VERSION, 0,new SqlCipherErrorHandler(DATABASE_NAME), new SqlCipherDatabaseHook());
super(application, DATABASE_NAME, databaseSecret.asString(), null, DATABASE_VERSION, 0,new SqlCipherErrorHandler(DATABASE_NAME), new SqlCipherDatabaseHook(), true);

this.application = application;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class LocalMetricsDatabase private constructor(
DATABASE_VERSION,
0,
SqlCipherDeletingErrorHandler(DATABASE_NAME),
SqlCipherDatabaseHook()
SqlCipherDatabaseHook(),
true
),
SignalDatabaseOpenHelper {

Expand Down Expand Up @@ -83,7 +84,6 @@ class LocalMetricsDatabase private constructor(
if (instance == null) {
SqlCipherLibraryLoader.load()
instance = LocalMetricsDatabase(context, DatabaseSecretProvider.getOrCreateDatabaseSecret(context))
instance!!.setWriteAheadLoggingEnabled(true)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class LogDatabase private constructor(
DATABASE_VERSION,
0,
SqlCipherDeletingErrorHandler(DATABASE_NAME),
SqlCipherDatabaseHook()
SqlCipherDatabaseHook(),
true
),
SignalDatabaseOpenHelper {

Expand Down Expand Up @@ -87,7 +88,6 @@ class LogDatabase private constructor(
if (instance == null) {
SqlCipherLibraryLoader.load()
instance = LogDatabase(context, DatabaseSecretProvider.getOrCreateDatabaseSecret(context))
instance!!.setWriteAheadLoggingEnabled(true)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,14 @@ public class MegaphoneDatabase extends SQLiteOpenHelper implements SignalDatabas
if (instance == null) {
SqlCipherLibraryLoader.load();
instance = new MegaphoneDatabase(context, DatabaseSecretProvider.getOrCreateDatabaseSecret(context));
instance.setWriteAheadLoggingEnabled(true);
}
}
}
return instance;
}

public MegaphoneDatabase(@NonNull Application application, @NonNull DatabaseSecret databaseSecret) {
super(application, DATABASE_NAME, databaseSecret.asString(), null, DATABASE_VERSION, 0, new SqlCipherErrorHandler(DATABASE_NAME), new SqlCipherDatabaseHook());
super(application, DATABASE_NAME, databaseSecret.asString(), null, DATABASE_VERSION, 0, new SqlCipherErrorHandler(DATABASE_NAME), new SqlCipherDatabaseHook(), true);

this.application = application;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ open class SignalDatabase(private val context: Application, databaseSecret: Data
SignalDatabaseMigrations.DATABASE_VERSION,
0,
SqlCipherErrorHandler(DATABASE_NAME),
SqlCipherDatabaseHook()
SqlCipherDatabaseHook(),
true
),
SignalDatabaseOpenHelper {

Expand Down Expand Up @@ -227,7 +228,6 @@ open class SignalDatabase(private val context: Application, databaseSecret: Data
synchronized(SignalDatabase::class.java) {
if (instance == null) {
instance = SignalDatabase(application, databaseSecret, attachmentSecret)
instance!!.setWriteAheadLoggingEnabled(true)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ dependencyResolutionManagement {
alias('signal-aesgcmprovider').to('org.signal:aesgcmprovider:0.0.3')
alias('signal-argon2').to('org.signal:argon2:13.1')
alias('signal-ringrtc').to('org.signal:ringrtc-android:2.24.0')
alias('signal-android-database-sqlcipher').to('org.signal:android-database-sqlcipher:4.5.1-S1')
alias('signal-android-database-sqlcipher').to('org.signal:sqlcipher-android:4.5.3-FTS-S1')

// Third Party
alias('greenrobot-eventbus').to('org.greenrobot:eventbus:3.0.0')
Expand Down
5 changes: 5 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5038,6 +5038,11 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
<sha256 value="961945cdd47d8dea84914729a733d2cd55e65fd3d14d958691e455568da303d6" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.signal" name="sqlcipher-android" version="4.5.3-FTS-S1">
<artifact name="sqlcipher-android-4.5.3-FTS-S1.aar">
<sha256 value="8a85a63c5c38b906f6c9ed10d073b6a4235d9c163bb792083cdcf4e79825a958" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.slf4j" name="slf4j-api" version="1.6.4">
<artifact name="slf4j-api-1.6.4.jar">
<sha256 value="367b909030f714ee1176ab096b681e06348f03385e98d1bce0ed801b5452357e" origin="Generated by Gradle"/>
Expand Down

0 comments on commit ffbebe0

Please sign in to comment.