mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-31 22:35:17 +00:00
Fix release builds (#601)
* proguard: Don't obfuscate stacktraces
* Deploy snapshots from this branch
* PasswordRepository: Handle uninitialized settings
* Keep classes that are used in parcels
* Revert "Deploy snapshots from this branch"
This reverts commit 66918ca2b9
.
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
committed by
Aditya Wasan
parent
e61551bf37
commit
bfbbdecc07
3
app/proguard-rules.pro
vendored
3
app/proguard-rules.pro
vendored
@@ -21,3 +21,6 @@
|
||||
-dontwarn com.google.common.**
|
||||
-dontwarn org.slf4j.**
|
||||
-keep class androidx.appcompat.widget.SearchView { *; }
|
||||
-keep class org.openintents.openpgp.**
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
-dontobfuscate
|
||||
|
@@ -140,6 +140,9 @@ open class PasswordRepository protected constructor() {
|
||||
|
||||
@JvmStatic
|
||||
fun getRepositoryDirectory(context: Context): File {
|
||||
if (!::settings.isInitialized) {
|
||||
settings = PreferenceManager.getDefaultSharedPreferences(context.applicationContext)
|
||||
}
|
||||
return if (settings.getBoolean("git_external", false)) {
|
||||
val externalRepo = settings.getString("git_external_repo", null)
|
||||
File(requireNotNull(externalRepo))
|
||||
@@ -150,7 +153,9 @@ open class PasswordRepository protected constructor() {
|
||||
|
||||
@JvmStatic
|
||||
fun initialize(context: Context): Repository? {
|
||||
settings = PreferenceManager.getDefaultSharedPreferences(context.applicationContext)
|
||||
if (!::settings.isInitialized) {
|
||||
settings = PreferenceManager.getDefaultSharedPreferences(context.applicationContext)
|
||||
}
|
||||
val dir = getRepositoryDirectory(context)
|
||||
// uninitialize the repo if the dir does not exist or is absolutely empty
|
||||
if (!dir.exists() || !dir.isDirectory || dir.listFiles()!!.isEmpty()) {
|
||||
|
Reference in New Issue
Block a user