Disable screenshots on more recovery code screens
* Basically try to cover all screens that may have a recovery code
Fixes: #506
Change-Id: If0143b71596ff470a04982d8f87b7a622d362309
diff --git a/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeInputFragment.kt b/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeInputFragment.kt
index a0d507a..76ee2d6 100644
--- a/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeInputFragment.kt
+++ b/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeInputFragment.kt
@@ -14,6 +14,7 @@
import android.view.View.OnFocusChangeListener
import android.view.View.VISIBLE
import android.view.ViewGroup
+import android.view.WindowManager.LayoutParams.FLAG_SECURE
import android.widget.ArrayAdapter
import android.widget.AutoCompleteTextView
import android.widget.Button
@@ -70,6 +71,8 @@
): View {
val v: View = inflater.inflate(R.layout.fragment_recovery_code_input, container, false)
+ if (!isDebugBuild()) getActivity()?.window?.addFlags(FLAG_SECURE)
+
introText = v.findViewById(R.id.introText)
doneButton = v.findViewById(R.id.doneButton)
newCodeButton = v.findViewById(R.id.newCodeButton)
diff --git a/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeOutputFragment.kt b/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeOutputFragment.kt
index 9cb65d4..012ce09 100644
--- a/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeOutputFragment.kt
+++ b/app/src/main/java/com/stevesoltys/seedvault/ui/recoverycode/RecoveryCodeOutputFragment.kt
@@ -5,11 +5,13 @@
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import android.view.WindowManager.LayoutParams.FLAG_SECURE
import android.widget.Button
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.stevesoltys.seedvault.R
+import com.stevesoltys.seedvault.isDebugBuild
import org.koin.androidx.viewmodel.ext.android.sharedViewModel
class RecoveryCodeOutputFragment : Fragment() {
@@ -26,6 +28,8 @@
): View {
val v: View = inflater.inflate(R.layout.fragment_recovery_code_output, container, false)
+ if (!isDebugBuild()) getActivity()?.window?.addFlags(FLAG_SECURE)
+
wordList = v.findViewById(R.id.wordList)
confirmCodeButton = v.findViewById(R.id.confirmCodeButton)