summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2019-12-16 12:46:06 +0530
committerAditya Wasan <adityawasan55@gmail.com>2019-12-16 12:46:06 +0530
commitbfbbdecc0796fdd8e68b675e3fd8d26dd99a8d60 (patch)
treefd870a51da38d142e736e6cb1808d59e6b3b6768
parente61551bf3756a49f9eb4ee03bd726f3c6167dad7 (diff)
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 66918ca2b90dbf7629bd56606eb3d3f578d96105. Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
-rw-r--r--app/proguard-rules.pro3
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.kt7
2 files changed, 9 insertions, 1 deletions
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index 7d91e92d..4371d26b 100644
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -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
diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.kt b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.kt
index d10a5d59..e0bf9857 100644
--- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.kt
@@ -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()) {