* PasswordRepository: more comprehensive check for valid repository
* PasswordFragment: Give 'repo uninitialized' Snackbar some purpose in life
* GitOperationActivity: finish immediately when an unhandled request code is used
* PasswordFragment: Make uninitialized repo Snackbar indefinite
* spotless
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
if previousUrl is empty it means that this the first time the method is being called, and url
has not been built yet. We let things slide for the first pass so that the actual logic
only kicks in when it needs to.
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Work around incompatibility between AndroidFastScroll and recyclerview-selection
* move hacked recyclerview into separate package
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Make RecyclerViewHelper private static
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
* Refactor git logic into separate parts
* Extract hardcoded strings
* Add KDoc to updateHostname, remove unused field
* Cleanups
* Fix dialog message
* Wire in repository clone flow
* spotless
* Remove unused method
* Cleanup GitActivity
- Rename to GitOperationActivity.
- Ensure identityBuilder is always closed regardless of what fragment uses it.
- Remove hardcoded "Operation" strings and replace with REQUEST_ARG_OP.
- Apply a transparent theme to GitOperationActivity make the UI less jarring.
* Tweak some stupidly worded dialog messages
As pointed out in #629, these strings are shoddily worded and do not express any clear intent to the
user, leaving them confused and angry.
* GitOperationActivity: wrap Context to ensure right theme is used
* spotless
* undo build.gradle change
* Use correct parent theme, remove now useless wrapping
* GitServerConfigActivity: fix repository clone flow
* temp: disable leakcanary
framework leaks on Samsung are pissing me off
* Make system bars transparent in git activity
* Tweak HTTPS password layout
* Unhardcode wrong passphrase string
* Store SSH passphrase in EncryptedSharedPreferences
Also revamp the dialog to look a bit better
* Implement support for remembering HTTPS password
Fixes#521
* Try to patch HTTPS remote creation logic
* Update security-crypto
* Clear saved passphrase/password on auth failure
* Revert "Update security-crypto"
Broken on R DP2.1
This reverts commit 4b20371dd42c512a3dd3b759859abb6c1ffd2961.
* Revert "temp: disable leakcanary"
This reverts commit 2db7d41bd67b79c6dc8c5b359a7b27100379f45f.
* Update CHANGELOG
* Remove spacer
* Remove useless override
* Wrap git server activity in a ScrollView
* GitOperation: always finish calling activity when dialogs are dismissed
* Wipe saved password/passphrase when hostname changes
* Don't commit prefs updates
* Don't call listFiles excessively
* Finish activity after saving configuration
* Make ConnectionMode and Protocol enum classes
* Change SSH key passphrase key, don't wipe on host change
* Reimplement BaseGitActivity.updateUrl (was updateHostname)
* Use SharedPreferences.edit KTX extension
* Disable inapplicable connection modes depending on scheme
* BaseGitActivity: annotate onDestroy with CallSuper
We'll leak the identityBuilder connection otherwise
* Move input hack for AlertDialog into an extension function
We re-use this in many places
* Fix protocol/mode toggle issue and consistenly name options
* Fix a crash when opening GitServerConfigActivity without a repo
* Fix OpenKeychain callbacks by moving onActivityResult to BaseGitActivity
* Run spotlessApply
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Fabian Henneke <fabian@henneke.me>
* Add annotations to and reformat SearchableRepositoryViewModel.kt
* Address build warnings other than meaningful deprecations
* Deal with warnings in UserPreference.kt
* Don't list the current directory in search results
* Scroll to top result when search term is changed
* Match relative path in StrictDomain filter mode
* Improve and document DirectoryStructure null handling
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* PasswordStore: request WRITE_EXTERNAL_STORAGE permission instead
We wish to be able to write to our password store directory as well.
Fixes#697Fixes#365
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Reword changelog entry
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Modernize legacy RecyclerView adapters
Introduces new adapters based on the SearchableRepositoryViewModel and
using androidx.recyclerview.selection for multiselection support.
The following positive effects in behavior are observable to end-users:
- Search and navigation actions are executed on IO threads.
- RecyclerViews are now animated during searches (but not navigations).
- Exact scroll position is restored when navigating back.
- The ActionBar title is updated with the current folder name.
The following negative effects may warrant attention:
- Support for the "always search from root" setting has been removed.
- Due to a limitation of the fast scroll dependency, using the scroller
may result in unwanted multiselections. If this is not fixed in the
library, native fast scroller capabilities could be used, but these
are more limited in appearance and to not offer popups.
* Fix lint
* Fix FastScroller/SelectionTracker incompatibility
* Immediately react to settings changes
* List directory entries when search term is blank
* Use isEmpty() instead of == ""
* Replace adapter inheritance with builders and fix selection drags
* Remove dividers in password lists
* Run spotlessApply
* Use a more logical string in action mode
* Commonize and constify path bundle key
* Make lambda parameter name explicit
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
The path of a new entry created via Autofill should always be editable, even when no username is prefilled (e.g., when generating a new password or saving a form with no detected username field).
Currently, PgpActivity resets or crashes when the orientation (or
screen size) changes.
Since we do not use separate resources in landscape mode, the easiest
and only slightly hacky solution is to tell the system to not recreate
the activity in response to these changes.
The IME search button is currently without function while the
PasswordStore SearchView is focused, which means that the keyboard
hides part of the search result until back is pressed.
This commit makes the IME button function like the back key in this
situation, dismissing the keyboard.
Co-authored-by: Harsh Shandilya <msfjarvis@gmail.com>
Restoring the scroll position in the main store fragment is currently
broken since the stored state (recyclerView.verticalScrollbarPosition)
is always 0 - it is just an enum that governs where the scrollbar is
placed on the screen.
The fix is to remember the list position of the last fully visible item
and scroll to it when restoring the scroll position.
Co-authored-by: Harsh Shandilya <msfjarvis@gmail.com>
The childCount is not set explicitly for empty directories, which means
that the childCount of the entry from which the current row was
recycled is preserved. This results in empty directories being shown
with seemingly random child counts.
The fix is to always set text and visibility for the childCount view.
Co-authored-by: Harsh Shandilya <msfjarvis@gmail.com>
The current way to let the folder name EditText in the folder creation
dialog gain focus is... slightly hacky.
This commit proposes a more conceptual solution, which, if it works
reliably, could be much easier to maintain.
Currently, password files generated via the Autofill generate or save
flow are not committed to the Git repository and therefore also not
synchronized to the remote.
The root cause is that it was missed that PgpActivity relies on
PasswordStore to commit the changes when it returns an appropriate
result code.
The fix is to extract the commit code into the companion object of
PasswordStore and call it from AutofillSaveActivity's onActivityResult.
Commit fde8137b (#659) introduced a regression that results in Password Store crashing when the user tries to delete a single password file as opposed to a directory.
The root cause is a call of FileUtils.listFiles() on the selected item, which only works for directories.
The fix is to work with a list consisting only of the selected item if it happens to be a file.
An unwarranted use of the Elivs operator in Form.kt makes it such that
the restrictions of single-origin mode also apply to native apps.
This commit fixes the bug and also reduces the number of intermediate
values that can mask mistakes like this one.
It also renames saveFlag to saveFlags in BrowserAutofillSupportInfo
since this variable is not limited to contain only a single flag.
Mozilla's getPublicSuffixPlusOne is only meant to be invoked on syntactically
valid domain names. In particular, it does not give reasonable results for IP
addresses.
This commit ensures that the domain passed to getPublicSuffixPlusOne is
syntactically valid and not an IP address (the latter is unfortunately
considered a domain by the Android validation patterns).
Some users keep their password files in a directory structure such as:
/example.org/john@doe.org.gpg
while others prefer the style:
/example.org/john@doe.org/password.gpg
This commit adds a setting that allows to switch between the two. All Autofill
operations, such as search, match, generate and save, respect this setting.
Note: The first style seems to be the most widely used and is therefore kept as
the default. The second style is mentioned on the official Pass website at:
https://www.passwordstore.org/#organization
Add rules that match password/username fields even if no heuristic matches, but
only when the user explicitly requests Autofill. Since there is now a generic
way to always trigger Autofill (at least in apps), other rules no longer need
to match fields that fail the heuristics.
Along the way, the apply functions in AutofillStrategy.kt are renamed to match
in order to not conflict with the Kotlin apply() extension function.
Furthermore, named parameters are used more widely now to pass around Booleans.
Adds support for the Autofill feature first available in Android Oreo.
In compatible apps and browsers, login forms are automatically detected and
the user is presented with options to fill or generate credentials. In most apps
and certain browsers, the service will also offer to create new Password Store
entries from credentials entered into login forms.
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
This migrates the clipboard clear logic into a foreground service that allows us to also provide a notification that runs the clear task immediately on click, rather than wait for the timeout.
Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Filter against entire pathname when searching
* Add option to directly open search dialog on start
* Replace basic search filter with fuzzy search
* Update CHANGELOG
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Open search in onResume, force search icon to always show
* Add option to always search from root directory
Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
* Make navigation match window background
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Remove light navigation flag
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Use black navbar in light theme
windowLightNavigationBar is not portable across API 23 to 29 so we're better off with this solution
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Simplify folder dialog title UI
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Make night theme completely flat
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Remove unnecessary type
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Don't try to use non-existent external repo
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
* Introduce EmitExpandableTransformationBehaviour
* Implement expand transition
* More folder work
* Add icons and tweak layout clipping
Rishi again with the icon rescue
* Theming rework
* Dont set tag
* Update list and commit after creating folder
* Fix theme issues
* Add dialog title
* Fix hint text color
* Remove commit method
* Cleanup
* Update CHANGELOG
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Co-authored-by: Aditya Wasan <adityawasan55@gmail.com>
* Gradle cleanup
* Update package name
* Remove release APK from git
This should have never been here
* Move package name to dependencies.gradle
* github: Setup caching for gradle
* Update Play Store art
* gradle: Use constraints API in place of deprecated force
* Update dependencies
* Raise minSdk to 23
* Target SDK 28 for now
External storage handling changes are atrocious to support in this codebase so we'll be holding out as far as we can.
* Revert "Opt into legacy external storage handling (#595)"
Not needed on SDK 28
This reverts commit 3f249e4bff.
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* 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>
* Setup snapshot deployment
* README: Update repository links
* README: Update workflow badge link
* README: Add link to Snapshot builds
* Fix snapshot/pull-request build conflict
* Deploy from feature/deploy-snapshots as well
* Revert "Deploy from feature/deploy-snapshots as well"
Confirmed it works well
This reverts commit 06f6bc0e8c19f238643655d09ca20f83dd416283.
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
The app is too messy to migrate properly to SAF so let's just take the easier route for now.
Fixes#593
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Break SshKeyGen into multiple files
* Use tinted material button
* Convert PasswordStore to kotlin
* Remove SshKeyGen
* Remove explicit imports and other tweaks
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
* Switch out folder icon
* Switch out password icon
* Switch out 'save and copy' icon
* Switch out save icon
* Switch out move icon
* Switch out delete icon
* Switch out edit icon
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
The Kotlin DSL's API is extremely terrible and makes the simplest tasks annoying. It also introduces a very noticeable build overhead that I'd rather not have.
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
While we're here, also clarify we're strictly GPL-3.0 and not automatically
opting into future revisions of the license.
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* [WIP] Initial biometric authentication support
* Redirect decryption app shortcut to go through LaunchActivity
* UserPreference: Clear existing shortcuts when toggling password auth
Clears out any auth-bypassed entries that exist
* Fix hilarious copypasta derp
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Caveats:
- The openpgp preference had to be removed because the open-intents developers are too lazy to update their libraries. Over the coming weeks I will be reimplementing a local solution for this instead.
- The autofill dialog is broken but I since it is being worked on in #410 already I'm not going to bother fixing it.
We were previously depending on it transitively coming into
the dependency graph but AndroidX artifacts are increasingly
getting rid of transitive deps so let's start being explicit about
our dependencies.
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Add 'SHOW EXTRA CONTENT' button.
* Show the extra content after clicking the 'SHOW EXTRA CONTENT' button.
* Change the regular button to a toggle button and add text for hiding extra contents.
* Change the implementaton of showing/hiding extra contents to accomodate using a toggle button.
* Add padding to the top of the button.
* Switch to in-built RV divider
* Switch getActivity calls to requireActivity
This enforces non-null activity and throws a proper exception when it is
null for some reason.
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* use storage access framework
* UserPreference: Add back warning about using SDCard root directory
* UserPreference: Fix IDE warnings
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Configure dependencyUpdates task
Configured to emit JSON reports in build directory and to
only use stable releases.
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Update dependencies
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* Clipboard now is cleared after manual copy
* Spanish translation added
* Spanish translations for commit messages updated
* Now can generate passwords free of lowercase (for example only numbers, uppercase or symbols)
Also it makes sure that uppercase is included when the generated char is ambiguous and discarded
* Clipboard now is cleared after manual copy
* Spanish translation added
* Spanish translations for commit messages updated
* Validation of value 0 in general_show_time before start timer
The clear_after_copy preference is disabled according with that value.
* Like clear_after_copy, clear_clipboard_20x now depends on the value of general_show_time too
* Specify applicationIdSuffix for debug build type
This allows installing debug and release versions of the app
alongside each other.
* Get rid of obsolete repository declaration in app/build.gradle
Fixes the issue where starting a repository sync and then
hitting cancel in the password dialog leaves you with an empty activity
which needs to be dismissed to get back to where you were.
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
* use full password path in add/edit git commit message
* commit strings are format strings
* use format strings in other languages
* use move/rename commit message