-
-
Notifications
You must be signed in to change notification settings - Fork 43
Added a feature to hide notes #947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ee4250f
2371a25
cfc9ab8
7b4c5ac
ae98bf9
b0dffcd
eac4134
710a9ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package com.philkes.notallyx.presentation.activity.main.fragment | ||
|
|
||
| import android.os.Bundle | ||
| import android.view.View | ||
| import android.view.View.INVISIBLE | ||
| import android.view.View.VISIBLE | ||
| import android.view.WindowManager | ||
| import androidx.lifecycle.LiveData | ||
| import androidx.navigation.fragment.findNavController | ||
| import com.philkes.notallyx.R | ||
| import com.philkes.notallyx.data.model.Folder | ||
| import com.philkes.notallyx.data.model.Item | ||
| import com.philkes.notallyx.utils.security.showBiometricOrPinPromptHidden | ||
|
|
||
| open class HiddenFragment : NotallyFragment() { | ||
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
| super.onViewCreated(view, savedInstanceState) | ||
| model.folder.value = Folder.HIDDEN | ||
| requireActivity().window.addFlags(WindowManager.LayoutParams.FLAG_SECURE) | ||
| } | ||
|
|
||
| override fun onDestroyView() { | ||
| super.onDestroyView() | ||
| requireActivity().window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE) | ||
| } | ||
|
|
||
| override fun getBackground() = R.drawable.label_off | ||
|
|
||
| override fun getObservable(): LiveData<List<Item>> { | ||
| return model.hiddenNotes!! | ||
| } | ||
|
|
||
| override fun onStart() { | ||
| super.onStart() | ||
| hide() | ||
| showBiometricOrPinPromptHidden( | ||
|
Comment on lines
+33
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hide the view earlier to avoid pre-auth flash of hidden content.
Suggested patch override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
- super.onViewCreated(view, savedInstanceState)
+ view.visibility = INVISIBLE
model.folder.value = Folder.HIDDEN
+ super.onViewCreated(view, savedInstanceState)
}🤖 Prompt for AI Agents |
||
| this, | ||
| R.string.hidden_lock_title, | ||
| onSuccess = { show() }, | ||
| onFailure = { findNavController().popBackStack() }, | ||
| ) | ||
|
Comment on lines
+36
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify bypass-prone paths in LockUtils helper used by HiddenFragment.
# Expected: Identify branches where onSuccess.invoke() executes without successful authentication callback.
fd -i "LockUtils.kt" --exec nl -ba {} | sed -n '60,150p'
echo "----"
rg -n --type=kt -C3 'showBiometricOrPinPromptHidden|canAuthenticate\(|promptPinAuthentication\(|onSuccess\.invoke\('Repository: Crustack/NotallyX Length of output: 143 🏁 Script executed: #!/bin/bash
# Locate the key files
echo "=== Finding LockUtils.kt ==="
fd "LockUtils.kt" -t f
echo "=== Finding HiddenFragment.kt ==="
fd "HiddenFragment.kt" -t f
echo "=== Finding NotallyFragment.kt ==="
fd "NotallyFragment.kt" -t fRepository: Crustack/NotallyX Length of output: 412 🏁 Script executed: #!/bin/bash
# Once we locate the files, examine the LockUtils.kt showBiometricOrPinPromptHidden function
# Search for the function and surrounding code
echo "=== Searching for showBiometricOrPinPromptHidden function ==="
rg -n "showBiometricOrPinPromptHidden" --type-add 'kotlin:*.kt' -t kotlin -A 80Repository: Crustack/NotallyX Length of output: 13097 🏁 Script executed: #!/bin/bash
# Search for canAuthenticate and promptPinAuthentication patterns
echo "=== Searching for authentication helper invocations ==="
rg -n "canAuthenticate|promptPinAuthentication|onSuccess\.invoke" --type-add 'kotlin:*.kt' -t kotlin -B 2 -A 2Repository: Crustack/NotallyX Length of output: 10380 Hidden-note unlock bypassed on multiple authentication paths. In
Line 135 is the most critical: the PIN/password prompt displays but 🤖 Prompt for AI Agents |
||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| protected fun show() { | ||
| binding?.root?.visibility = VISIBLE | ||
| } | ||
|
|
||
| protected fun hide() { | ||
| binding?.root?.visibility = INVISIBLE | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.