put setting defaults in one place

notable exceptions: color settings
they will be re-done anyway...
This commit is contained in:
Helium314 2025-02-09 19:01:57 +01:00
parent ecf7aabdb1
commit d807e08195
39 changed files with 473 additions and 481 deletions

View file

@ -13,6 +13,7 @@ import android.text.TextUtils;
import helium314.keyboard.latin.App;
import helium314.keyboard.latin.BuildConfig;
import helium314.keyboard.latin.settings.Defaults;
import helium314.keyboard.latin.settings.Settings;
import java.io.File;
@ -62,7 +63,7 @@ public final class JniUtils {
// we want the default preferences, because storing the checksum in device protected storage is discouraged
// see https://developer.android.com/reference/android/content/Context#createDeviceProtectedStorageContext()
// if device is locked, this will throw an IllegalStateException
wantedChecksum = KtxKt.protectedPrefs(app).getString(Settings.PREF_LIBRARY_CHECKSUM, wantedChecksum);
wantedChecksum = KtxKt.protectedPrefs(app).getString(Settings.PREF_LIBRARY_CHECKSUM, Defaults.PREF_LIBRARY_CHECKSUM);
}
final FileInputStream libStream = new FileInputStream(userSuppliedLibrary);
final String checksum = ChecksumCalculator.INSTANCE.checksum(libStream);