summaryrefslogtreecommitdiffstats
path: root/app/src/main/java
AgeCommit message (Collapse)AuthorFilesLines
2020-04-21PasswordStore: onboard users to Oreo autofillHarsh Shandilya1-0/+41
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21Application: only install logging tree in debug features buildHarsh Shandilya1-1/+1
We should be at a stability level now that does not require logging in prod Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21treewide: switch to logging via timberktHarsh Shandilya11-56/+70
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21treewide: use getSystemService extension everywhereHarsh Shandilya4-7/+11
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21treewide: use edit extension and cleanup some deprecationHarsh Shandilya12-138/+139
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21Remove unused importHarsh Shandilya1-1/+0
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21BaseGitActivity: don't remove saved password unnecessarilyHarsh Shandilya1-1/+1
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>
2020-04-20Fix protocol validation (#726)Harsh Shandilya3-37/+36
* GitOperation: code cleanup * WIP: Fix validation * Fixup SSH validation * Spotless * Remove logging of MalformedURLException Co-authored-by: Fabian Henneke <fabian@henneke.me> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-19Validate hostname protocol before saving (#723)Harsh Shandilya1-4/+25
* RFC: protocol validation * Use java.net.URL for saner parsing * Improve protocol correction; handle ssh:// Co-authored-by: Fabian Henneke <fabian@henneke.me> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-19PgpActivity: hide category view when there's no textHarsh Shandilya1-1/+6
Co-Authored-By: Fabian Henneke <fabian@henneke.me> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-19PasswordFragment: Replace fab options with descriptive bottom sheetHarsh Shandilya3-160/+85
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-19PasswordFragment: animate FAB in action modeHarsh Shandilya1-2/+27
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-19Work around incompatibility between AndroidFastScroll and ↵Fabian Henneke2-5/+343
recyclerview-selection (#721) * 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>
2020-04-18Resolve lint warningsHarsh Shandilya3-2/+3
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-18SshKeygenTask: fix build errorHarsh Shandilya1-1/+1
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-17Update SSH clear passphrase preference to handle HTTPS (#716)Harsh Shandilya1-7/+33
* Update SSH clear passphrase preference to handle HTTPS Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Address review comments Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Address review comments Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Explicitly set preference to visible if it can do anything * Address review comments Co-authored-by: Fabian Henneke <FabianHenneke@users.noreply.github.com> Co-authored-by: Fabian Henneke <fabian@henneke.me>
2020-04-17AutofillDecryptActivity: Show toast on Main dispatcher (#717)Harsh Shandilya1-5/+7
Without this the activity will crash rather than display the error Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-17Refactor Git related activities (#685)Harsh Shandilya15-806/+750
* 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>
2020-04-16Improve SSH private key validation (#713)Fabian Henneke1-58/+29
* Improve SSH private key validation * Address review comment
2020-04-16See file's metadata to validate SSH key (#709)Diogenes Molinares1-8/+44
* See file's metadata to validate SSH key * See file's metadata to validate SSH key * change exception to throw and refactoring * catch IOException and IllegalArgumentException as equal * run ./gradlew spotlessApply * Apply suggestions from code review * validate BEGIN, END markers and size != 0 * Apply suggestions from code review * Update app/src/main/java/com/zeapo/pwdstore/UserPreference.kt * Don't throw on SSH key import failure * Style nits * Codestyle and copy nits Co-authored-by: Fabian Henneke <fabian@henneke.me> Co-authored-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-16Reduce build warnings (#712)Fabian Henneke12-21/+43
* Add annotations to and reformat SearchableRepositoryViewModel.kt * Address build warnings other than meaningful deprecations * Deal with warnings in UserPreference.kt
2020-04-15Address review commentsFabian Henneke1-22/+22
2020-04-15Add a switch between Fuzzy and StrictDomain mode to Autofill search viewFabian Henneke1-58/+62
2020-04-15Add support for "work/example.org.gpg" folder layoutFabian Henneke4-8/+23
2020-04-15Respect encrypted username when filling Autofill generated entryFabian Henneke1-4/+3
2020-04-15Match any path component in StrictDomain FilterModeFabian Henneke1-16/+34
2020-04-15Fix crash on Autofill save introduced by #699 (#706)Fabian Henneke1-16/+22
2020-04-15Improve search logic and UI (#703)Fabian Henneke4-26/+94
* 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>
2020-04-14Improve Autofill enable UI and flaky browser list (#704)Fabian Henneke2-7/+13
2020-04-14Always refresh password list when navigating back (#701)Fabian Henneke1-43/+9
2020-04-14Don't trigger onMenuItemActionCollapse on navigation (#702)Fabian Henneke1-1/+2
2020-04-14Fix repository corruption by AutofillSaveActivity (#699)Fabian Henneke9-37/+46
2020-04-13Raise targetSdk to 29 (#682)Fabian Henneke3-7/+7
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-13Request WRITE_EXTERNAL_STORAGE for external password repository (#698)Harsh Shandilya1-5/+5
* PasswordStore: request WRITE_EXTERNAL_STORAGE permission instead We wish to be able to write to our password store directory as well. Fixes #697 Fixes #365 Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * Reword changelog entry Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-11Switch refactored entities to ViewBinding (#695)Harsh Shandilya3-49/+64
* build: Enable ViewBinding * autofill: oreo: Switch to ViewBinding * PasswordFragment: switch to ViewBinding * AutofillPublisherChangedActivity: use with(binding) { } syntax Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-10Modernize legacy RecyclerView adapters (#694)Fabian Henneke14-704/+716
* 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>
2020-04-08Remove an erroneous check on directory moves (#693)Fabian Henneke1-1/+0
2020-04-07Modernize file listing and search in AutofillFilterActivity (#683)Fabian Henneke5-84/+362
* WIP: Modernize file listing and search * Refactor * Implement fuzzy search * Improve ViewModel API and introduce Adapter * Integrate new search into AutofillFilterActivity and dedebounce * Improve no results layout * Reformat * Highlight origin in FileBased directory structure * Extract highlighting logic into DirectoryStructure * Trim whitespace before searching * Remove debug logging * Remove more debug logging * Organize imports * Remove imports * Update app/src/main/java/com/zeapo/pwdstore/SearchableRepositoryViewModel.kt Co-Authored-By: Harsh Shandilya <me@msfjarvis.dev> * Address review comments Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-06Fix: Make path editable when generating a password (#688)Fabian Henneke1-3/+4
2020-04-05Fix: Make generated entry path editable without suggested username (#687)Fabian Henneke1-1/+1
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).
2020-03-29Significantly improve app theming (#679)Harsh Shandilya1-1/+32
* Update CHANGELOG * Use outlined box style in folder creation dialog * Add user-facing choice for app theme Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-03-29Don't inflate menu multiple times (#678)Harsh Shandilya1-1/+5
Otherwise you get this insanity https://i.imgur.com/N918NFG.png Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-03-29Workaround and potential fix for search issues (#677)Fabian Henneke1-2/+3
2020-03-28Add "alias" to the username heuristic terms (#676)Fabian Henneke1-1/+1
2020-03-27Let IME button dismiss keyboard during search (#673)Fabian Henneke1-0/+1
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>
2020-03-27Fix: Restore store scroll position on back press (#670)Fabian Henneke1-2/+2
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>
2020-03-27Fix: Set childCount correctly on recycled rows (#675)Fabian Henneke1-4/+2
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>
2020-03-27Un-hack focus gain in folder creation dialog (#672)Fabian Henneke1-15/+15
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.
2020-03-27Improve Autofill heuristic terms (#674)Fabian Henneke1-2/+2
Add "e-mail" and "login" as username terms and sort the lists. Co-authored-by: Harsh Shandilya <msfjarvis@gmail.com>
2020-03-27Make folder creation dialog cancelable (#671)Fabian Henneke1-1/+0