1
0
mirror of https://github.com/etesync/android synced 2024-11-29 11:28:19 +00:00
Commit Graph

577 Commits

Author SHA1 Message Date
Tom Hacohen
0d848f0573 Merge: Add import from local accounts
This set of commits add import from local accounts.
It's a bit rough around the edges, but it's good enough to go in, so work can continue
collaboratively.
2017-04-03 12:56:52 +01:00
Tal Hacohen
9684123f68 Use App.log instead of Log in import fragmnets 2017-04-03 14:33:04 +03:00
Tal Hacohen
6820d9d413 Change desgin of both import lists 2017-04-03 14:27:48 +03:00
Tal Hacohen
8d208b3438 Refactor calendar account to import package 2017-04-03 14:27:48 +03:00
Tal Hacohen
1e9e055924 Import - Use ResultFragment in all import framgnets 2017-04-03 14:27:47 +03:00
Tal Hacohen
56aba7c669 Extract ResultFragment from ImportFragment 2017-04-03 14:27:25 +03:00
Tal Hacohen
a7c5ccadc9 Import - Change toolbar title according to relevant fragment 2017-04-03 14:27:24 +03:00
Tal Hacohen
1629ffba9f Import - Add fragment to import all contacts from account 2017-04-03 14:27:23 +03:00
Tal Hacohen
7cac473c74 Import - Split ImportActivity to fragments and activity 2017-04-02 14:04:14 +03:00
Tal Hacohen
33a310344b Import - Add all events to selected calendar 2017-03-30 16:09:22 +03:00
Tal Hacohen
594c401038 Import - Show calendars in expandable list view 2017-03-30 16:09:22 +03:00
Tal Hacohen
466870ff50 Import - Add basic import activity 2017-03-30 16:09:22 +03:00
Tal Hacohen
2261d6e385 Import calendar: Add calendar account class.
CalendarAccount loads all different accounts and their calendar lists.
2017-03-30 10:10:32 +03:00
Tom Hacohen
1482fb01cb JournalManager: make jorunal version read-only. 2017-03-29 23:46:11 +01:00
Tom Hacohen
cd5e5487a8 JournalManager: make IntegrityException inherit from GeneralSecurityException. 2017-03-29 18:27:50 +01:00
Tom Hacohen
cf805d4e72 JournalManager: add version info to Journals and use it in crypto
The crypto class now behaves differently depending on the version of the
journal.
The current difference is in the key derivation, and that the new
version of the crypto also hmacs the version automatically whenever it
hmacs anything.

The versioning was added for better future-proofing of the code.
The derivation change was done because before we were creating the same
password for all of the journals, now we do it per-journal. This means
that we can, if needed in the future use this password as the journal
password when sharing journals without compromising the security of the
rest of the journals.
2017-03-29 18:27:39 +01:00
Tom Hacohen
7357447786 Collectioninfo: fix typo in ToString field exclusion. 2017-03-29 15:10:52 +01:00
Tom Hacohen
c3e30138dd Syncmanager: get a collection info for all sync managers. 2017-03-29 14:47:43 +01:00
Tom Hacohen
01add874dc Remove unneeded fixme. 2017-03-29 13:27:56 +01:00
Tom Hacohen
d2eaf5f434 Use the new CryptoManager instead of the main encryption password.
This will give us more flexibility in the future because now the
encryption key and derivation is all managed in one place.
2017-03-29 13:01:04 +01:00
Tom Hacohen
4004eca762 Syncmanager: use the journalId as the unique collection id. 2017-03-29 12:45:14 +01:00
Tom Hacohen
1e6fc5a9cb Crypto: rename Cipher to CryptoManager. 2017-03-29 12:35:44 +01:00
Tom Hacohen
abd13d4d3d Crypto: refactor the Cipher class.
Include the hmac in the cipher class.
Derive keys on class creation instead of on encrypt/decrypt.
2017-03-29 12:27:22 +01:00
Tom Hacohen
0fbee1ea02 JournalManager: rename Helpers to Crypto.
These are crypto helpers, this should have been named this way from the start.
2017-03-29 12:12:35 +01:00
Tom Hacohen
225d01c143 Crypto: Only create random generator as needed. 2017-03-29 12:02:13 +01:00
Tom Hacohen
de834915be Bump version. 2017-03-28 16:49:26 +01:00
Tom Hacohen
1d87de2e7a App update: set the app version on first launch if not already set.
The app update broadcast receiver is only called on the first update,
not install, which was causing EteSync to think it was updating from
version 1 on the first update, doesn't matter which version one was
updating from.
This fixes it by saving the version on the first run.
2017-03-28 16:44:53 +01:00
Tom Hacohen
784070c27c SyncManager: add remote entries to cache only after they've been processed
Before this change we were adding them to cache before they were
processed, potentially persisting malformed entries, or entries we
haven't yet processed causing issues if sync was aborted before an entry
was fully processed.
2017-03-27 16:08:45 +01:00
Tom Hacohen
987076d95e Webview: fix behaviour of toolbar back button and simplify. 2017-03-24 19:15:57 +00:00
Tom Hacohen
3a83cf8303 Collection deletion: mark as deleted in cache, but don't actually delete.
This is important for protecting against potential data loss.
2017-03-24 18:55:12 +00:00
Tom Hacohen
ba9f217d66 Webview: also open tos and about from within the app. 2017-03-24 18:42:28 +00:00
Tom Hacohen
9ba84109b2 Login: add a "forgot password" link. 2017-03-24 16:11:24 +00:00
Tom Hacohen
d21a498925 Webview: improve whitelist, and include all of the "accounts/" subpath. 2017-03-24 16:09:19 +00:00
Tom Hacohen
e7694924b4 Automatically fix non-dirty entries with null etag on upgrade
Commit 5d1c90dcba fixed a bug where
entries added from the server were marked as "local only" (null etag)
which was causing issues. That commit fixes it for newly added resources,
but existing resources remained broken.

This commit goes through the database and fixes all of the existing
broken resources. It skips dirty entries because figuring out if they
were just created or updated is complex, and the chances of doing an
update at exactly the same time there are dirty entries is quite low,
so the complexity involved is just not worth it.
2017-03-24 15:33:07 +00:00
Tom Hacohen
7562a7a76b ViewCollection: use the new LocalCalendar.findByName to get calendar. 2017-03-24 14:52:27 +00:00
Tom Hacohen
19ceab96b0 Bump version. 2017-03-24 14:48:00 +00:00
Tom Hacohen
5d1c90dcba Resource: set eTag when creating a new one from server.
Before this commit we would create new entries from the server without
an etag, essentially marking them as "local only". While the actual
value of the eTag is not currently used, null or not matters.
Because the resources were "local only", we would get weird behaviours
like having an "ADD" action when changing a resource.
2017-03-24 14:40:29 +00:00
Tom Hacohen
84244330b7 Always log deletes, even when not previously added to server.
Before this change we would only add "deletes" to the server when the
resource has been previously uploaded. This means that if a resource has
been created and then deleted before a sync, it would not be saved,
which is essentially data-loss.
This commit fixes it, so we always upload a delete entry.
2017-03-24 14:08:57 +00:00
Tom Hacohen
99fe3457fc Refresh ViewCollectionActivity when edited/deleted
Until now we were just closing it when opening a view that can cause a
change. This is nicer.
2017-03-24 13:57:25 +00:00
Tom Hacohen
0cd57851ad Journal model: call the postLoad callback on fetch too.
It's really annoying that it doesn't do it automatically as it should,
in the meanwhile, add this workaround.

I reported it to upstream:
https://github.com/requery/requery/issues/487
2017-03-24 13:57:25 +00:00
Tom Hacohen
415d5d5447 Clear journal cache on account deletion (fix account re-add issue)
Clearing the cache is a good idea regardless, though because of the
unique constraints in the cache on the journal name, this was causing
issues when deleting an account and then adding it back.
2017-03-24 13:57:25 +00:00
Tom Hacohen
f984b76ec6 Add import from vCard (vcf)/iCal (ics)
This commit adds a basic UI for importing contacts and calendars from a
file.
2017-03-24 13:57:25 +00:00
Tom Hacohen
24b170a170 View collection activity: only create fragment on first load. 2017-03-24 12:49:19 +00:00
Tom Hacohen
231684e0d4 Local event/contact: Add a way to add/update as dirty 2017-03-24 12:49:11 +00:00
Tom Hacohen
d98d58360e LocalCalendar: Add a function to get calendar by name. 2017-03-23 16:42:54 +00:00
Tom Hacohen
ec39aceb1a Mark CollectionInfo id as deprecated.
This is now implemented in the ORM and not the collection info itself.
2017-03-23 15:38:08 +00:00
Tom Hacohen
e9428c6ec7 Sync manager: Fix log messages to be the state strings and not int ids. 2017-03-12 17:08:03 +00:00
Tom Hacohen
7afb086c76 Debug activity: Show the number of entries per journal. 2017-03-10 17:15:09 +00:00
Tom Hacohen
ced3d7283d Remove change journal from main page. 2017-03-10 17:15:09 +00:00
Tom Hacohen
b0b5891e40 Add a collection view activity and move the journal viewer there 2017-03-10 17:15:09 +00:00
Tom Hacohen
3d217f47af Webview: Only load pages from a whilelist, not all.
This was causing issues with the dashboard page because of stripe.
The best mitigation at the moment, is to only load pages from a whitelist.
2017-03-10 14:38:08 +00:00
Tom Hacohen
e4043642db Suppress XSS warning.
We are only loading external websites, no use controlled data.
2017-03-10 14:36:53 +00:00
Tom Hacohen
838cc2a79d Merge contacts/calendars collection handling
This also removes the "stats" from the edit collection screen.
2017-03-10 14:19:17 +00:00
Tom Hacohen
3530821ddd JournalViewer: add an activity to view the journal.
It's very raw and hacky at the moment, it's just a preview release so
people could see their data is saved, and can look at it in its raw
form until we implement a nicer view.
2017-03-09 22:25:45 +00:00
Tom Hacohen
42a644cabb EntryEntity: make content a SyncEntry instead of a string.
It was always of this type, this change just makes it so it's
automatically converted instead of manually.
2017-03-09 22:17:22 +00:00
Tom Hacohen
cee9576155 JournalModel: persist collection info inside the model instead of sqlite
This change moves the collection info away from raw sqlite in favour of
the requery ORM.
2017-03-09 22:15:08 +00:00
Tom Hacohen
bd5beaaf91 Move SyncEntry to the models package.
This unties it from the sync manager, and will let us better reuse it.
2017-03-09 22:15:08 +00:00
Tom Hacohen
a794ee35cf Remove a mention of davdroid from log. 2017-03-09 22:15:08 +00:00
Tom Hacohen
36a8edfb5d Bump version. 2017-03-09 22:15:08 +00:00
Tom Hacohen
431c54ab91 Show the number of journal entries on the collection detail screens. 2017-03-09 22:15:02 +00:00
Tom Hacohen
29fd177a95 Cache journals locally.
This is useful both as an anti-tampering mechanism, and will be used
later when interacting with the journal is implemented.
2017-03-09 22:14:22 +00:00
Tom Hacohen
afcb00e4f1 Account screen: Use translatable strings for the titles 2017-03-09 16:57:00 +00:00
Tom Hacohen
b9b930939f Allow renaming collections.
I mistakingly disallowed it when I added the edit collection ability.
There is no problem with changing the display name.
2017-03-09 16:57:00 +00:00
Tom Hacohen
4c7ae90b36 Encryption setup page: add a note about why we are asking for an additional password. 2017-03-08 18:46:12 +00:00
Tom Hacohen
83fde4b81d Use DEBUG_REMOTE_URL to also override the webUri.
Before this commit it was only used to override the api endpoint,
not it's also used to override the weburl. This is needed since we now
load the etesync website inside the app and not in an external web
browser.
2017-03-08 17:27:48 +00:00
Tom Hacohen
baff2e886c Traslation: make log authority untranslatable. 2017-03-08 17:15:50 +00:00
Tom Hacohen
f84bd386f1 Create collection: only update url after pushed to server.
Without this change, if the putting on server of a new collection fails,
the url would already be updated, and since having a url indicates it
exists on the server, trying to save it later would result in a 404.
2017-03-08 17:11:49 +00:00
Tom Hacohen
32df64000f Add stats to the collection edit page. 2017-03-08 17:11:48 +00:00
Tom Hacohen
7bb57c15a9 Add an edit collection page. 2017-03-08 17:11:48 +00:00
Tom Hacohen
ce3483cee2 Create collection: update collection if already exists (info.url is set). 2017-03-08 17:11:48 +00:00
Tom Hacohen
e7138842c8 Journal manager: Add a way to update a journal. 2017-03-08 17:11:48 +00:00
Tom Hacohen
1b3a4bf318 Add a way to count calendar events/contacts. 2017-03-08 17:11:48 +00:00
Tom Hacohen
4a196102a1 Collection info: serialize url, but not to json. 2017-03-08 17:11:48 +00:00
Tom Hacohen
c6fbecc0ff Strings-de: Fix malformed closer. 2017-03-08 11:17:28 +00:00
Tom Hacohen
9e8cfa77fa Remove another unused string. 2017-03-08 10:16:17 +00:00
Larson Maerz
f785ed77cd Update German translation. 2017-03-08 10:16:17 +00:00
Tal Hacohen
8c9ec3bcc7 Replace all etesync links to open in the webview activity. 2017-03-06 17:54:18 +01:00
Tal Hacohen
c041ddb690 Add webview activity to handle etesync link. 2017-03-06 17:54:17 +01:00
Tom Hacohen
57810cd5f5 Bump version. 2017-03-02 13:56:31 +00:00
Tom Hacohen
4fcc29c1d3 Rename Usage Guide to User Guide. 2017-03-02 13:47:32 +00:00
Tom Hacohen
9ef2ea2d54 Add a "Coming soon" section for the Change Journal
Adding this because users were asking about the history feature. While
the history is maintained, there's currently no GUI to explore it, so
I've added this stub to make it more obvious that it's not there yet.
2017-03-02 12:32:03 +00:00
Tom Hacohen
6fdf2c3d1a Remove unused resources (mainly strings). 2017-03-02 11:31:35 +00:00
Tom Hacohen
14fb5ffae8 Change username login field to 'email'. 2017-03-02 11:22:03 +00:00
Tom Hacohen
cf9ee98ead Sync interval setting: use the same string for current as selector.
Before this commit the texts were different, and odd.
For example, the text in the selector would be:
Every 4 hours
and the text in the preview would be:
Every 240 minutes
2017-03-01 18:18:10 +00:00
Tom Hacohen
711df7ed55 Bump to version 0.9.1. 2017-03-01 00:24:19 +00:00
Tom Hacohen
ae99a0f53a Change exceptions inheriting from HttpException to accept "Response"
This follows the previous change and puts more information in the
exceptions (like parts of the http request and response) for better
debugging. This also moves the handling of "retry after" to the
exception itself instead of outside.
Also improved the text of one of the exception invocations.
2017-03-01 00:24:19 +00:00
Tom Hacohen
571c585292 HttpException: add a way to override response error message.
Before this change exceptions would print the message of the error code.
For example, for 500 they would print "Internal Server Error".
With this change we can now override this message with something more
sensible we got from the serer, for example "User is inactive."
2017-03-01 00:24:18 +00:00
Tom Hacohen
fc939a3cbe Shorten notification error title so account name is visible.
The text was too long and it was impossible to see the account name.
2017-03-01 00:24:08 +00:00
Tom Hacohen
ba789da797 Add a UserInactive exception for when the user is no longer active
This is a possible error message we get when we get error code 403
(permission denied) from the server. We then handle it explicitly by
sending the user to the dashboard.
2017-02-28 23:58:47 +00:00
Tom Hacohen
8e7d363128 Refactor notifications to launch a notification handler
With this change we no can launch external urls. For all I know this
doesn't work without this trick (an intent in the middle).

I also applied a transparent theme to the activity to avoid seeing the
launched activity briefly before opening external urls.

This is based on my experience working on "Share To Clipboard".
2017-02-28 23:26:19 +00:00
Tom Hacohen
d918622ba2 Fix issue with only one of the notifications being clickable. 2017-02-28 23:23:03 +00:00
Tom Hacohen
5d712c72d0 Add links to the usage guide. 2017-02-28 17:43:03 +00:00
Tom Hacohen
8c01e64ff4 Change the "delete collection" string to "Delete" 2017-02-28 17:42:51 +00:00
Tom Hacohen
3195c91e11 Bump version to 0.9.0. 2017-02-27 13:27:43 +00:00
Tom Hacohen
abc15f01d8 Rename the Android package to EteSync
I was trying to avoid it, and keep it as davdroid both for attribution,
and making it easy to cherry-pick fixes from DAVdroid.
However, it seems to be causing clashes with the davdroid app, although
every piece of documentation claims otherwise.[1]

At least it seems like cherry-picks can still be achieved using:

git cherry-pick -s recursive -X find-renames=30 COMMIT

1. https://developer.android.com/studio/build/application-id.html
(one such doc)
2017-02-27 13:23:24 +00:00
Tom Hacohen
94b29e86ac Implement sha256 using bouncy-castle. 2017-02-22 18:52:20 +00:00
Tom Hacohen
7a80b37818 Optimise proguard rules and fix warnings
We don't need to specify classes we don't use dynamically, so remove all
of the explicitly mentioned ones.

Fix a few warnings.
2017-02-22 18:52:20 +00:00
Tom Hacohen
0ebfa9cfbd Bump version to 0.8.1 and update changelog. 2017-02-22 18:52:20 +00:00
Tom Hacohen
116094c7b9 Ask for permissions on app launch. 2017-02-22 17:50:24 +00:00
Ricki Hirner
36ee584e6a Fetch translations from Transifex 2017-02-22 15:57:54 +00:00