fix bug that allowed user to bypass warning slide during onboarding
Auto Tag on Version Change / check-version (push) Successful in 4s
Auto Tag on Version Change / check-version (push) Successful in 4s
This commit is contained in:
@@ -31,9 +31,14 @@ class OnboardingActivity : AppCompatActivity(), SecuritySetupFragment.Callback {
|
|||||||
ThemeHelper.applyAccent(this)
|
ThemeHelper.applyAccent(this)
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
// If security is already configured, onboarding is complete. Redirect to lock screen
|
prefs = getSharedPreferences("prefs", MODE_PRIVATE)
|
||||||
// to prevent overwriting an existing PIN/pattern via direct activity launch.
|
|
||||||
if (CredentialStore(this).loadSecurityHash() != null) {
|
// Only redirect to the lock screen if onboarding is fully complete. Checking the
|
||||||
|
// security hash alone is not sufficient — the hash is written during the PIN/pattern
|
||||||
|
// setup step (page 1) which happens *before* the user clicks "Get Started", so a
|
||||||
|
// theme change or process restart mid-onboarding would otherwise trigger this guard
|
||||||
|
// and strand the user in the lock flow without finishing onboarding.
|
||||||
|
if (prefs.getBoolean("onboarding_done", false) && CredentialStore(this).loadSecurityHash() != null) {
|
||||||
startActivity(Intent(this, LockActivity::class.java))
|
startActivity(Intent(this, LockActivity::class.java))
|
||||||
finish()
|
finish()
|
||||||
return
|
return
|
||||||
@@ -50,7 +55,6 @@ class OnboardingActivity : AppCompatActivity(), SecuritySetupFragment.Callback {
|
|||||||
val ta = obtainStyledAttributes(intArrayOf(android.R.attr.colorBackground))
|
val ta = obtainStyledAttributes(intArrayOf(android.R.attr.colorBackground))
|
||||||
window.statusBarColor = ta.getColor(0, if (isLight) android.graphics.Color.WHITE else android.graphics.Color.BLACK)
|
window.statusBarColor = ta.getColor(0, if (isLight) android.graphics.Color.WHITE else android.graphics.Color.BLACK)
|
||||||
ta.recycle()
|
ta.recycle()
|
||||||
prefs = getSharedPreferences("prefs", MODE_PRIVATE)
|
|
||||||
val originalBottomPadding = binding.bottomBar.paddingBottom
|
val originalBottomPadding = binding.bottomBar.paddingBottom
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(binding.bottomBar) { view, insets ->
|
ViewCompat.setOnApplyWindowInsetsListener(binding.bottomBar) { view, insets ->
|
||||||
val navBar = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
val navBar = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class OnboardingFragment : Fragment() {
|
|||||||
|
|
||||||
private fun notifyScrolledToBottom() {
|
private fun notifyScrolledToBottom() {
|
||||||
if (scrolledToBottom) return
|
if (scrolledToBottom) return
|
||||||
|
if (!isAdded) return
|
||||||
scrolledToBottom = true
|
scrolledToBottom = true
|
||||||
parentFragmentManager.setFragmentResult(RESULT_SCROLLED_TO_BOTTOM, Bundle.EMPTY)
|
parentFragmentManager.setFragmentResult(RESULT_SCROLLED_TO_BOTTOM, Bundle.EMPTY)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user