Commit graph

909 commits

Author SHA1 Message Date
Harsh Shandilya
b3f6fc20c4
build: prepare next development version
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-23 12:54:09 +05:30
Harsh Shandilya
9a843b08f3
build: bump version for patch release
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-23 12:52:24 +05:30
Harsh Shandilya
3d8cea5966
Improve permission handling logic (#732)
* Improve permission handling logic

Ensure we always ask for storage permissions when required

* Refactor storage permission checks and invert return value

* PasswordStore: improve permission grant flow

* strings: slightly reword permission grant request message

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

Co-authored-by: Fabian Henneke <fabian@henneke.me>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-22 21:57:52 +05:30
Fabian Henneke
00361a58c7
Fix crash when using type independent sort (#734) 2020-04-22 18:13:56 +02:00
Fabian Henneke
9c1cc8690d
Mark Autofill onboarding dialog as seen on dismiss (#731) 2020-04-22 14:44:25 +05:30
Fabian Henneke
c302d6fe58
Never obscure OK button in Autofill onboarding UI (#729) 2020-04-21 21:38:02 +02:00
Harsh Shandilya
0c0649b86d
build: prepare next development version
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21 18:39:02 +05:30
Harsh Shandilya
ec0d478b85
build: bump version to 1.7.0
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21 18:39:01 +05:30
Harsh Shandilya
3d0850fa1f
build: inline versionCode and versionName at destination
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21 18:39:01 +05:30
Harsh Shandilya
e6ea5f6a08
PasswordStore: onboard users to Oreo autofill
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21 18:39:00 +05:30
Harsh Shandilya
b0774febb1
Application: only install logging tree in debug features build
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-21 15:55:26 +05:30
Harsh Shandilya
500ab60973
treewide: switch to logging via timberkt
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21 15:55:26 +05:30
Harsh Shandilya
72166c6912
treewide: use getSystemService extension everywhere
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21 15:55:25 +05:30
Harsh Shandilya
d505151662
treewide: use edit extension and cleanup some deprecation
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21 15:55:25 +05:30
Harsh Shandilya
e1921b26e0
Remove unused import
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-21 15:55:25 +05:30
Harsh Shandilya
77096c1702
BaseGitActivity: don't remove saved password unnecessarily
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-21 15:36:30 +05:30
Harsh Shandilya
47c2875e93
Fix protocol validation (#726)
* 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-20 13:29:10 +05:30
Harsh Shandilya
99aa0d9bb2
Validate hostname protocol before saving (#723)
* 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-19 17:13:39 +05:30
Harsh Shandilya
aaeb899fb6
PgpActivity: hide category view when there's no text
Co-Authored-By: Fabian Henneke <fabian@henneke.me>
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-19 14:11:19 +05:30
Harsh Shandilya
17385892cb
PasswordFragment: Replace fab options with descriptive bottom sheet
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-19 14:11:19 +05:30
Harsh Shandilya
eb5a30c3a9
PasswordFragment: animate FAB in action mode
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-19 14:11:18 +05:30
Fabian Henneke
e5d178ea3c
Work around incompatibility between AndroidFastScroll and 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-19 10:40:49 +02:00
Harsh Shandilya
934c256edd
Resolve lint warnings
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-18 23:52:16 +05:30
Harsh Shandilya
5d884a8a74
SshKeygenTask: fix build error
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-18 23:52:15 +05:30
Harsh Shandilya
beaec159e8
Update SSH clear passphrase preference to handle HTTPS (#716)
* 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-17 20:12:48 +02:00
Harsh Shandilya
0e1dd641d2
AutofillDecryptActivity: Show toast on Main dispatcher (#717)
Without this the activity will crash rather than display the error

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-17 23:04:18 +05:30
Harsh Shandilya
b94b52a42d
Refactor Git related activities (#685)
* 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-17 18:36:07 +05:30
Harsh Shandilya
4ffd7ed9bf
Enable emulator tests (#708)
* github: Enable instrumentation testing in PRs

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* Upgrade to Gradle 6.3

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* Remove outdated and broken tests, redo PasswordEntryTest in Kotlin

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* Remove now unused test assets

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* github: Disable debug APK uploads in PR testing

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>

* Update .github/workflows/pull_request.yml

* Update .github/workflows/pull_request.yml

Switching to Ubuntu fails due to the SDK 29 missing.

Co-authored-by: Fabian Henneke <FabianHenneke@users.noreply.github.com>
2020-04-17 00:24:13 +05:30
Fabian Henneke
8b4751f825
Improve SSH private key validation (#713)
* Improve SSH private key validation

* Address review comment
2020-04-16 18:34:55 +05:30
Diogenes Molinares
f269bc7d28
See file's metadata to validate SSH key (#709)
* 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-16 17:21:24 +05:30
Fabian Henneke
e4aa673537
Reduce build warnings (#712)
* Add annotations to and reformat SearchableRepositoryViewModel.kt

* Address build warnings other than meaningful deprecations

* Deal with warnings in UserPreference.kt
2020-04-16 12:20:45 +02:00
Fabian Henneke
2a6326ec0e Address review comments 2020-04-15 22:47:41 +05:30
Fabian Henneke
7cd6f1d1cf Add a switch between Fuzzy and StrictDomain mode to Autofill search view 2020-04-15 22:47:41 +05:30
Fabian Henneke
441b4d3b68 Add support for "work/example.org.gpg" folder layout 2020-04-15 22:47:41 +05:30
Fabian Henneke
5a3220527f Respect encrypted username when filling Autofill generated entry 2020-04-15 22:47:41 +05:30
Fabian Henneke
d6db10e089 Match any path component in StrictDomain FilterMode 2020-04-15 22:47:41 +05:30
Fabian Henneke
b633cc1f3d Make existing tests buildable again 2020-04-15 22:47:41 +05:30
Fabian Henneke
db2743289d
Fix crash on Autofill save introduced by #699 (#706) 2020-04-15 21:13:31 +05:30
Fabian Henneke
75a70543b3
Improve search logic and UI (#703)
* 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-15 00:57:51 +05:30
Fabian Henneke
ec8bcae8fa
Improve Autofill enable UI and flaky browser list (#704) 2020-04-14 11:43:57 +02:00
Fabian Henneke
ef0cc9f047
Always refresh password list when navigating back (#701) 2020-04-14 14:05:06 +05:30
Fabian Henneke
b82303d5dd
Don't trigger onMenuItemActionCollapse on navigation (#702) 2020-04-14 13:09:52 +05:30
Fabian Henneke
0d54a687d6
Fix repository corruption by AutofillSaveActivity (#699) 2020-04-14 03:51:59 +05:30
Fabian Henneke
11c7e36986
Raise targetSdk to 29 (#682)
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-04-13 00:40:40 +05:30
Harsh Shandilya
4f20c49abb
Request WRITE_EXTERNAL_STORAGE for external password repository (#698)
* 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-13 00:31:25 +05:30
Harsh Shandilya
f21b6426af
Switch refactored entities to ViewBinding (#695)
* 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-11 01:07:49 +05:30
Fabian Henneke
575ef84726
Modernize legacy RecyclerView adapters (#694)
* 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-10 16:48:42 +05:30
Fabian Henneke
2738d7500f
Remove an erroneous check on directory moves (#693) 2020-04-08 18:25:44 +05:30
Hussein Al Abry
ab034a8ba3
pull translations from transifex (#691)
russian translation at 99%
2020-04-07 21:11:49 +00:00
Fabian Henneke
e3a49e2632
Modernize file listing and search in AutofillFilterActivity (#683)
* 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-07 02:26:52 +05:30