Compare commits

...

261 Commits

Author SHA1 Message Date
Neeraj Gupta
a46fff91c2 bump version to 1.0.37+37 2023-04-15 13:51:08 +05:30
Neeraj Gupta
6277bd8e7a Merge pull request #97 from ente-io/minor_fixes
minor fixes
2023-04-15 12:50:36 +05:30
vishnukvmd
7cc3ed8fa5 Update string 2023-04-15 12:50:21 +05:30
Neeraj Gupta
0d59263422 Logout: Add warning for unsycned changes 2023-04-15 12:25:52 +05:30
Neeraj Gupta
5e21a077cf Extract more strings 2023-04-15 11:56:01 +05:30
Neeraj Gupta
aa558fd35d Extract strings 2023-04-15 11:42:05 +05:30
Neeraj Gupta
20f50e4dba Extract strings 2023-04-15 11:23:45 +05:30
Neeraj Gupta
48828d095f Remove unused lint skip 2023-04-15 11:23:04 +05:30
Neeraj Gupta
727d53bb8f Lang: Allow fr and es 2023-04-15 11:22:36 +05:30
Neeraj Gupta
6892d029aa Fix social section 2023-04-15 11:11:20 +05:30
Neeraj Gupta
91d78cd83e Merge pull request #96 from ente-io/l10n_translations
New Translations
2023-04-15 10:59:41 +05:30
Crowdin Bot
76cf109433 New Crowdin translations by GitHub Action 2023-04-15 00:28:13 +00:00
Neeraj Gupta
22b05da6bf Update README.md 2023-04-14 16:35:38 +05:30
Neeraj Gupta
b0e9cd49ae Update uri scheme from ente to ente-auth 2023-04-13 12:19:27 +05:30
Neeraj Gupta
f47e0fe1c7 Merge pull request #93 from ente-io/l10n_translations
New Translations
2023-04-12 11:28:44 +05:30
Crowdin Bot
553f8555de New Crowdin translations by GitHub Action 2023-04-12 00:25:31 +00:00
Neeraj Gupta
ca53f5127e Merge pull request #92 from ente-io/l10n_translations
New Translations
2023-04-10 10:03:40 +05:30
Crowdin Bot
30d1238e09 New Crowdin translations by GitHub Action 2023-04-10 04:27:15 +00:00
Neeraj Gupta
11d6e672b1 Merge pull request #90 from ente-io/update_pages
Nullsafety + string extractions
2023-04-10 09:56:36 +05:30
Neeraj Gupta
8f7226cb02 Complete null-safety migration 2023-04-10 09:47:45 +05:30
Neeraj Gupta
fc2db578a8 Add more components 2023-04-09 19:10:34 +05:30
Neeraj Gupta
bb86c023cc Merge pull request #91 from ente-io/l10n_translations
New Translations
2023-04-09 19:00:04 +05:30
Crowdin Bot
cefd663921 New Crowdin translations by GitHub Action 2023-04-09 12:07:51 +00:00
Neeraj Gupta
84bf988de4 Null safety migration 2023-04-08 17:26:28 +05:30
Neeraj Gupta
537b3d2e4d Copy more common components 2023-04-08 17:10:10 +05:30
Neeraj Gupta
33b141916f Remove unused widgets 2023-04-08 17:08:53 +05:30
Neeraj Gupta
c10655e353 NullSafety migration: app_lock.dart 2023-04-08 17:08:16 +05:30
Neeraj Gupta
8e3c766468 NullSafety+ String extraction for LoginPage 2023-04-08 15:34:32 +05:30
Neeraj Gupta
646c64372c Fix validate fillColor 2023-04-08 14:11:11 +05:30
Neeraj Gupta
cc8139341b NullSafety+ String extraction for EmailEntryPage 2023-04-08 14:08:15 +05:30
Neeraj Gupta
b12043ae13 Merge pull request #89 from ente-io/lang_change
Support for changing language
2023-04-08 10:32:27 +05:30
Neeraj Gupta
cc15def963 Show language names 2023-04-08 10:23:55 +05:30
Neeraj Gupta
e0fe0833fb Update recovery_key_page 2023-04-08 09:48:39 +05:30
Neeraj Gupta
624ca39fff l10n: extract strings 2023-04-08 09:38:10 +05:30
Neeraj Gupta
33292657b9 l10n: extract strings 2023-04-08 09:33:12 +05:30
Neeraj Gupta
24c97c56a0 l10n: extract strings 2023-04-08 09:25:34 +05:30
Neeraj Gupta
2ffe79b9b3 Merge branch 'main' into lang_change 2023-04-07 17:43:49 +05:30
Neeraj Gupta
66ee9ef1a6 Add support for changing language 2023-04-07 17:40:47 +05:30
Neeraj Gupta
0629789a22 [design] Update components 2023-04-07 15:11:37 +05:30
Neeraj Gupta
1e0e5c3ff5 [design] Update components 2023-04-07 15:06:57 +05:30
Neeraj Gupta
bff5205dda [design] Update components 2023-04-07 15:02:11 +05:30
Neeraj Gupta
5cd08622ff Add de, fr, and fi as support locales 2023-04-07 14:29:27 +05:30
Neeraj Gupta
f478014c64 Merge pull request #88 from ente-io/l10n_translations
New Translations
2023-04-07 10:57:42 +05:30
Crowdin Bot
d932d7c6b8 New Crowdin translations by GitHub Action 2023-04-07 00:24:00 +00:00
Neeraj Gupta
8d734b761e Merge pull request #86 from ente-io/l10n_translations
New Translations
2023-04-06 10:38:43 +05:30
Crowdin Bot
790985663f New Crowdin translations by GitHub Action 2023-04-06 00:25:18 +00:00
Neeraj Gupta
f5e1319f1b Merge pull request #83 from ente-io/l10n_translations
New Translations
2023-04-04 21:32:56 +05:30
Crowdin Bot
a71f7b78ca New Crowdin translations by GitHub Action 2023-04-04 12:08:51 +00:00
Neeraj Gupta
a5eb5c4cb8 Merge pull request #85 from ente-io/ua741-patch-1
README: Add link to view codes on web
2023-04-04 16:26:24 +05:30
Neeraj Gupta
6f80ded657 README: Add link to view codes on web 2023-04-04 16:22:14 +05:30
Neeraj Gupta
33c3b997ed Merge pull request #84 from ente-io/handle_logout
Handle invalid sessions
2023-04-04 16:14:38 +05:30
Neeraj Gupta
b841d5ecd7 Fix string 2023-04-04 16:12:18 +05:30
Neeraj Gupta
abf4afe76e Fix: Remove synced codes on logout 2023-04-04 16:06:51 +05:30
Neeraj Gupta
873da725f9 l10n: remove @@locale 2023-04-04 16:00:39 +05:30
Neeraj Gupta
c9ce4b662a l10n: extract strings 2023-04-04 15:59:28 +05:30
Neeraj Gupta
e140e9dfa7 Handle logged out sessions 2023-04-04 15:46:18 +05:30
Neeraj Gupta
1551842886 Fix: throw UnauthorizedError on 401 status 2023-04-04 15:25:19 +05:30
Neeraj Gupta
153998763e Fix format for importing codes 2023-04-04 14:53:26 +05:30
Neeraj Gupta
d66a5db998 Merge pull request #82 from ente-io/minor_fixes
Minor fixes
2023-04-03 12:31:05 +05:30
Neeraj Gupta
ea20e1b155 Fix locales 2023-04-03 12:28:36 +05:30
Neeraj Gupta
0963ea7129 Fix parsing and add tests 2023-04-03 12:28:27 +05:30
Neeraj Gupta
1c3ebd026b Fix: Parsing of account name 2023-04-03 12:13:43 +05:30
Neeraj Gupta
d1e1cb983e Handle bad issuerName 2023-04-03 12:10:32 +05:30
Vishnu Mohandas
ad8fd6224a Merge pull request #64 from ente-io/vishnukvmd-patch-1 2023-04-03 11:53:51 +05:30
Neeraj Gupta
2893eb45fa Merge branch 'main' into vishnukvmd-patch-1 2023-04-03 11:53:09 +05:30
Neeraj Gupta
2ea4d2c614 Merge pull request #78 from ente-io/l10n_translations
New Translations
2023-04-03 09:30:03 +05:30
Crowdin Bot
259461cf8b New Crowdin translations by GitHub Action 2023-04-03 00:26:40 +00:00
Vishnu Mohandas
2109c912fe Merge pull request #80 from ente-io/minor_fixes
Minor fixes
2023-03-29 11:44:40 +05:30
vishnukvmd
54b3b3ecb6 v1.0.36 2023-03-29 11:27:50 +05:30
vishnukvmd
766742abf2 Cache fetched subscription 2023-03-29 11:27:21 +05:30
vishnukvmd
a2216fe145 Minor copy change 2023-03-29 11:25:45 +05:30
Neeraj Gupta
29d6012fde Merge pull request #79 from ente-io/upgrade_store 2023-03-29 08:59:57 +05:30
vishnukvmd
983496e711 Fix i18n 2023-03-28 17:24:12 +05:30
vishnukvmd
a16aace96a Update deps 2023-03-28 17:24:04 +05:30
vishnukvmd
e2a1b429e2 Upgrade SecureStorage 2023-03-28 17:21:49 +05:30
Neeraj Gupta
4906f980f7 Merge pull request #76 from ente-io/l10n_translations
New Translations
2023-03-21 15:13:55 +05:30
Neeraj Gupta
f17275071c Merge pull request #77 from ente-io/fixes
fixes
2023-03-21 14:44:10 +05:30
Neeraj Gupta
abb51d09ac Read issuer name from query params 2023-03-21 14:37:47 +05:30
Neeraj Gupta
5ca06c12d7 Fix typo 2023-03-21 14:16:40 +05:30
Crowdin Bot
e91deee8fe New Crowdin translations by GitHub Action 2023-03-21 00:26:29 +00:00
Neeraj Gupta
8571c024f7 Update README.md 2023-03-18 19:24:55 +05:30
Neeraj Gupta
d621e2fd74 Merge pull request #75 from ente-io/crowdin_ci 2023-03-18 12:39:33 +05:30
Neeraj Gupta
b06649b9c9 Add CI config for crowdin action 2023-03-18 11:41:33 +05:30
Neeraj Gupta
862bea5a18 Add crowdin config 2023-03-18 11:39:47 +05:30
Neeraj Gupta
81740bb549 bump version 2023-03-15 20:34:21 +05:30
Neeraj Gupta
4bf0c5d4bb Merge pull request #73 from ente-io/ente_photos_upgrade
Hook for development support
2023-03-15 18:17:36 +05:30
vishnukvmd
e7a2c671e1 Minor fixes 2023-03-15 18:15:10 +05:30
Neeraj Gupta
099be22598 Hide discount for iOS users 2023-03-15 14:08:37 +05:30
Neeraj Gupta
34200b702a Add nudget to upgrade 2023-03-15 14:05:30 +05:30
Neeraj Gupta
719585f74b Merge pull request #72 from ente-io/timer_animation
Fix timer animation
2023-03-14 06:43:21 +05:30
Neeraj Gupta
4b003cb91f Merge pull request #71 from ente-io/monochrome_icon
Android: Add support for theme icon
2023-03-14 06:42:40 +05:30
Neeraj Gupta
b9fa6f3094 remove unused pkg 2023-03-14 06:23:15 +05:30
Neeraj Gupta
835e8d01bd Switch to simple progress widget with no animation 2023-03-14 06:19:49 +05:30
Neeraj Gupta
3d2dabc288 Add linear progress bar widget 2023-03-14 06:19:08 +05:30
Neeraj Gupta
2ed8684cc1 bump version : 1.0.33 2023-03-14 05:12:38 +05:30
Neeraj Gupta
2eb7542293 Improve time counter animation 2023-03-14 05:12:10 +05:30
Neeraj Gupta
96dc8adf46 Android: Add support for theme icon 2023-03-14 05:02:36 +05:30
Vishnu Mohandas
0650889afa Merge pull request #68 from ente-io/f-droid
Add link to F-Droid to README
2023-03-12 12:34:49 +05:30
vishnukvmd
65a78ae4b1 Update description 2023-03-12 11:25:15 +05:30
vishnukvmd
060ae5571f Add link to F-Droid to README 2023-03-12 11:17:53 +05:30
Vishnu Mohandas
875df67a5e Update README.md 2023-02-23 20:59:06 +05:30
Vishnu Mohandas
74f2d70000 Update README.md 2023-02-23 20:46:40 +05:30
Manav
64ff5d91b9 Merge pull request #63 from ente-io/update-cla
Update to cla-assistant.io for CLA shared across ente
2023-02-16 21:04:36 +05:30
Manav
317ba39f46 Update to cla-assistant.io for CLA shared across ente
Replace the manual per-repository integration with the standard cla-assistant.io
setup for integrating a single CLA across all ente repositories.

Updated CLA: https://gist.github.com/enteio/f3b9abc4e047425da3e1538cde903b4d
2023-02-16 20:26:27 +05:30
Neeraj Gupta
cf3a9f9d8f Merge Upgrade flutter: 3.7.3 #62
Upgrade flutter: 3.7.3
2023-02-16 10:24:04 +05:30
Neeraj Gupta
e6fb1d6fc0 Upgrade flutter: 3.7.3 2023-02-16 09:07:39 +05:30
Neeraj Gupta
001077dd97 Merge pull request #61 from ente-io/fix_code_generation
Fix: Wrap decode in try catch
2023-02-16 08:22:54 +05:30
Neeraj Gupta
e82e7634d4 Improve logging 2023-02-16 07:56:20 +05:30
Neeraj Gupta
d20eb65645 bump version to 1.0.32+32 2023-02-16 07:47:35 +05:30
Neeraj Gupta
bf86dac10f Fix: Wrap decode in try catch 2023-02-16 07:47:08 +05:30
Neeraj Gupta
c5d68b4a94 Merge pull request #60 from ente-io/fix_change_email
Fix change email
2023-02-13 13:01:10 +05:30
Neeraj Gupta
dd558cb008 bump version to 1.0.31+31 2023-02-13 12:56:09 +05:30
Neeraj Gupta
ea9b0d01ba Fix change email 2023-02-13 12:40:33 +05:30
Manav
6582c3b3dc Merge pull request #59 from ente-io/fix_build
Fix iOS build by configuring the Flutter script to be run for all builds
2023-02-13 12:34:44 +05:30
vishnukvmd
5fdc475386 Fix iOS build by configuring the Flutter script to be run for all builds 2023-02-13 12:33:38 +05:30
Vishnu Mohandas
806fe8a916 Merge pull request #58 from ente-io/add_logs
Log error while rendering code widgets
2023-02-13 11:51:35 +05:30
Neeraj Gupta
161a990c17 Log error while rendering code widgets 2023-02-13 11:48:40 +05:30
Neeraj Gupta
3fc716d474 Merge pull request #56 from ente-io/ui_fresh
Fix: Reduce UI rebuilds
2023-02-11 17:02:07 +05:30
Neeraj Gupta
d7d61f2699 bump version to 1.0.30+30 2023-02-11 16:53:07 +05:30
Neeraj Gupta
37f5c23169 Reduce UI rebuilds 2023-02-11 16:52:08 +05:30
Neeraj Gupta
7c5d95d8e3 Merge pull request #55 from ente-io/fix_locale
Fix locale detection for AppLock
2023-02-07 12:57:08 +05:30
Neeraj Gupta
4f3dff44fc bump version to 1.0.29+29 2023-02-07 12:54:03 +05:30
Neeraj Gupta
3b2f886ae1 Fix locale detection for AppLock 2023-02-07 12:53:04 +05:30
Vishnu Mohandas
bad2bafbe9 Merge pull request #53 from ente-io/search_ux
Improve UX for search
2023-02-06 15:48:13 +05:30
Neeraj Gupta
4f7b6e9f8e Merge pull request #52 from ente-io/low_end_key_derivation
Be verbose about the key derivation limits on low end devices
2023-02-06 15:39:20 +05:30
Neeraj Gupta
120fee358b bump version to 1.0.28+28 2023-02-06 15:38:18 +05:30
Neeraj Gupta
85cc5d7d18 bump version to 1.0.27+27 2023-02-06 15:37:53 +05:30
vishnukvmd
660b370d72 Be verbose about the key derivation limits on low end devices 2023-02-06 14:57:25 +05:30
Vishnu Mohandas
a23fd97f83 Merge pull request #51 from ente-io/handle_empty_account
Allow empty account name + bump version
2023-02-06 12:11:16 +05:30
Neeraj Gupta
1f83456b2b bump version to 1.0.27+27 2023-02-06 12:09:28 +05:30
Neeraj Gupta
28ea0d1b06 Allow adding code without account info 2023-02-06 12:08:55 +05:30
Neeraj Gupta
1584a23936 Merge pull request #49 from ente-io/handle_low_end_device
Fix: Attempt to avoid crash on low-spec devices
2023-02-06 11:39:37 +05:30
Neeraj Gupta
7fd0b8f407 Refactor and start with 256MB as memLimit for lowSpecDevices 2023-02-06 11:29:45 +05:30
Neeraj Gupta
bbe7525882 Switch to maxOpsLimit for low end devices 2023-02-06 10:21:49 +05:30
Neeraj Gupta
a9182577c0 Fix typo in comparision 2023-02-06 10:21:49 +05:30
Neeraj Gupta
7d6d3fe0f2 Switch to device_info_plus 2023-02-06 10:20:57 +05:30
Neeraj Gupta
303cdc92e7 Merge pull request #50 from ente-io/basic_search
Support for searching by account or issuer
2023-02-05 22:54:51 +05:30
Neeraj Gupta
3b39a34045 Support for searching by account or issuer 2023-02-05 22:33:37 +05:30
Vishnu Mohandas
2435c9ddef Merge pull request #48 from ente-io/fix_incorrect_scanning 2023-02-05 01:03:11 +05:30
Neeraj Gupta
35bb9284d6 Fix incorrect 2fa type detection 2023-02-05 01:02:16 +05:30
Neeraj Gupta
0c34cfcc5e Merge pull request #46 from ente-io/20_secret_with_spaces
Trim whitespaces from manual secret input
2023-01-28 18:44:56 +05:30
Neeraj Gupta
a0c2db5315 Merge pull request #45 from ente-io/34_url_decode
Fix: Url decode the path value
2023-01-28 18:44:46 +05:30
Neeraj Gupta
b8f1f00d2f Trim whitespaces from manual secret input 2023-01-28 18:42:32 +05:30
Neeraj Gupta
41c33003ac Fix: Url decode the path value 2023-01-28 18:27:59 +05:30
Neeraj Gupta
4103b776c4 Merge pull request #44 from ente-io/flutter_as_module
Add flutter as submodule
2023-01-28 15:46:06 +05:30
Manav
ae1986d7d3 Merge pull request #43 from ente-io/bump-build-number
1.0.25 (26)
2023-01-28 15:43:00 +05:30
Manav
3b6648074a 1.0.25 (26) 2023-01-28 15:42:03 +05:30
Neeraj Gupta
d5249d40cb Add flutter as submodule 2023-01-28 15:41:14 +05:30
Manav
a90f7e6abc Merge pull request #42 from ente-io/document-releases
Document automated releases
2023-01-28 15:37:37 +05:30
Manav
55722dd818 Merge pull request #41 from ente-io/playstore-submit
Upload to Google Play from GitHub action
2023-01-28 15:37:25 +05:30
Manav
7666c4e053 Document automated releases 2023-01-28 15:34:21 +05:30
Manav
cb93a0658f Use direct path
Removes the dependency of this build step on the previous build step.
2023-01-28 14:58:47 +05:30
Manav
97f665e8cf Remove unneeded mapping files 2023-01-28 14:57:55 +05:30
Manav
99516650fe Fix path 2023-01-28 14:01:10 +05:30
Manav
3928ccc6b7 Build a playstore variants 2023-01-28 13:49:42 +05:30
Manav
699f906843 Skeleton for upload-google-play 2023-01-28 13:39:24 +05:30
Manav
ca809a0e0b Merge pull request #40 from ente-io/apply-bis
Enable the BIS self classification flag
2023-01-28 13:02:18 +05:30
Manav
d52e0ed04a Enable the BIS self classification flag
We've submitted the BIS self classification report for the auth app alongwith
the photos app. More details: https://github.com/ente-io/photos-app/issues/427
2023-01-28 12:59:19 +05:30
Neeraj Gupta
c9936d68c1 Merge pull request #38 from ente-io/use_en_as_default
Restrict to en locale
2023-01-28 12:30:40 +05:30
Neeraj Gupta
59cfc88b4e Merge pull request #39 from ente-io/ua741-patch-1
Fix typo in read me
2023-01-28 12:14:15 +05:30
Neeraj Gupta
39f9385c74 Fix typo in read me 2023-01-28 12:13:16 +05:30
Neeraj Gupta
2017506b28 bump version to 1.0.25+25 2023-01-28 12:06:01 +05:30
Neeraj Gupta
1497866597 Restrict locale to en 2023-01-28 12:05:31 +05:30
Neeraj Gupta
78c12b5ee2 Merge pull request #35 from ente-io/24 2023-01-27 17:22:51 +05:30
Vishnu Mohandas
64159434d0 Merge pull request #36 from ente-io/xcloud 2023-01-26 16:39:23 +05:30
vishnukvmd
8bd1c1ec50 Update build script 2023-01-26 14:57:24 +05:30
vishnukvmd
409e9c39ca Update build file 2023-01-26 14:51:06 +05:30
vishnukvmd
73bd24da95 Add post clone CI script 2023-01-26 14:51:00 +05:30
vishnukvmd
aeb2f46a4f v1.0.24 2023-01-26 14:04:13 +05:30
vishnukvmd
cc9f8db288 Update build files 2023-01-26 14:04:06 +05:30
Vishnu Mohandas
83c70f0f6b Merge pull request #32 from ente-io/recents
Remove option to remove app from recents
2023-01-08 16:51:01 +05:30
Vishnu Mohandas
91fffc8b04 Merge pull request #31 from ente-io/tweak-trailing-margin-theme-picker
Increase trailing margin for the theme picker selection checkmark
2023-01-08 16:47:31 +05:30
Vishnu Mohandas
50b583c2d7 Merge pull request #30 from ente-io/use-newer-alternative
Use `AppLocalizations.localizationsDelegates` in other MaterialApp
2023-01-08 16:47:07 +05:30
vishnukvmd
0034da064f Remove option to remove app from recents 2023-01-08 16:38:04 +05:30
Manav
4fa61f0997 Use AppLocalizations.localizationsDelegates in other MaterialApp
Smoke tested by running the app on iOS simulator
2023-01-08 16:26:36 +05:30
Vishnu Mohandas
29bc7bb78f Merge pull request #29 from ente-io/fix-change-email-i18n-crash
Fix the crash on opening change email dialog
2023-01-08 16:16:55 +05:30
Manav
1df7d8de46 Fix the crash on opening change email dialog
The crash was happening in the `context.l10n` line in the
change_email_dialog.dart. This was because the root MaterialApp created by
AppLock wasn't being passed the AppLocalizations object.

Tested:
- Was able to reproduce the crash on iOS simulator (null check assertion)
- After the change, the crash doesn't happen
2023-01-08 16:05:40 +05:30
Manav
435fd6a1e7 Increase trailing margin for the theme picker selection checkmark 2023-01-08 15:26:05 +05:30
Vishnu Mohandas
c0f450d380 Merge pull request #27 from ente-io/reduce-cla-spam 2023-01-06 15:17:31 +05:30
Manav
9f686d38ed Run the CLA bot only on comments to PR
Right now, it unnecessarily runs and sends an email when customers open issues.

Not tested, but can test it by opening an issue after this is merged.

Reference:
- https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#issue_comment
2023-01-06 15:15:10 +05:30
Vishnu Mohandas
8ade294d7a Merge pull request #26 from ente-io/fix_typo
Fix copy
2022-12-31 11:30:57 +05:30
vishnukvmd
b5f3694805 Fix copy 2022-12-31 11:30:19 +05:30
Manav
1b1df0aa37 Merge pull request #25 from MalteKiefer/hotfix/german_language
fixed a forgotten string
2022-12-28 12:37:10 +05:30
Malte Kiefer
25dd92bdf0 fixed a forgotten string 2022-12-28 08:05:26 +01:00
Manav
e3ddc10a00 Merge pull request #24 from MalteKiefer/feature/language_german
translate app to german
2022-12-28 12:24:16 +05:30
Malte Kiefer
d0ae1ce566 translate app to german 2022-12-28 07:36:07 +01:00
Neeraj Gupta
b0eb0413f0 Separate icon config for fdroid 2022-12-18 08:59:05 +05:30
Neeraj Gupta
60a66efa79 Add fdroid flavor 2022-12-18 07:11:55 +05:30
Neeraj Gupta
e7c8437478 Merge branch 'main' of github.com:ente-io/auth 2022-12-18 06:43:35 +05:30
Neeraj Gupta
21ca31c1f3 Add fastlane details 2022-12-18 06:42:54 +05:30
Vishnu Mohandas
0330982eb0 Merge pull request #19 from ente-io/fix_window_manager_warning
Update warning dialog when "Hide from recents" is enabled
2022-12-15 22:36:19 +05:30
vishnukvmd
5fec321267 Update the warning copy since not all ROMs may block capturing of screenshots once FLAG_SECURE is set 2022-12-15 22:34:48 +05:30
Vishnu Mohandas
ca378d31d2 Merge pull request #17 from ente-io/ua741-patch-1 2022-12-15 14:08:33 +05:30
Neeraj Gupta
aedde8e447 Readme: Fix link to issues 2022-12-15 13:47:24 +05:30
Vishnu Mohandas
1f090ce3af Merge pull request #16 from ente-io/independent
Merge Independent APK track
2022-12-14 14:55:27 +05:30
vishnukvmd
308cf250fd v1.0.23 2022-12-14 14:43:20 +05:30
vishnukvmd
9ef9c3b9fd Migrate to open_filex 2022-12-14 14:43:05 +05:30
vishnukvmd
8e39b6f359 Merge branch 'main' into independent 2022-12-14 14:24:04 +05:30
vishnukvmd
05955e2e76 Update .gitignore 2022-12-14 14:23:51 +05:30
vishnukvmd
3bc9b46d4d Merge branch 'main' into independent 2022-12-14 14:16:39 +05:30
Vishnu Mohandas
38a6e5a99c Merge pull request #15 from ente-io/upgrade_dependencies
Upgrade dependencies
2022-12-14 14:16:03 +05:30
vishnukvmd
89dc0f81ed v1.0.22 2022-12-14 13:46:33 +05:30
vishnukvmd
24de1c6af7 Upgrade file_picker and flutter_sodium 2022-12-14 13:46:14 +05:30
Vishnu Mohandas
ee6c4d3744 Fix hyperlink to Download 2022-12-12 20:29:50 +05:30
Vishnu Mohandas
4e46a6f222 Merge pull request #14 from ente-io/readme-tweaks 2022-12-12 18:34:28 +05:30
Manav
563fb2fb7c README tweaks 2022-12-12 18:30:32 +05:30
Manav
216499d0a6 Merge pull request #13 from ente-io/extract-more-strings
Extract more strings into ARB files for localization
2022-12-12 18:11:02 +05:30
Manav
daf48befff Merge pull request #12 from ente-io/remove-test-file
Remove test file
2022-12-12 17:31:47 +05:30
Manav
359dc09d6a Extract more strings into ARB files for localization 2022-12-12 17:30:37 +05:30
Neeraj Gupta
73989998e9 Remove test file 2022-12-12 14:44:54 +05:30
Manav
0894a7eb36 Merge pull request #11 from ente-io/add-cla
Add CLA
2022-12-12 14:20:57 +05:30
Manav
550a955c1a Add CLA 2022-12-12 14:17:14 +05:30
Manav
598fb7856c Merge pull request #9 from ente-io/test-clabot
Testing CLA bot
2022-12-12 13:27:51 +05:30
Manav
b0d89cc568 Configure cla-assistant 2022-12-12 11:58:26 +05:30
Manav
e4eacb684f Test commit 2022-12-12 10:48:18 +05:30
Manav
6717f739ae Testing CLA bot 2022-12-12 10:40:15 +05:30
Vishnu Mohandas
00372208a4 Update Architecture folder structure 2022-12-09 21:50:36 +05:30
Vishnu Mohandas
7c093ec8c8 Update README 2022-12-09 21:46:31 +05:30
Vishnu Mohandas
ed3aafa7fc Fix licence to GPL-3.0 2022-12-09 21:42:35 +05:30
Vishnu Mohandas
6505ed37fc Add info about desktop support 2022-12-09 14:47:19 +05:30
vishnukvmd
6dd3903c78 Add screenshots 2022-12-05 10:50:38 +05:30
vishnukvmd
6996650ad5 Add links to both stores 2022-12-05 10:37:31 +05:30
vishnukvmd
86be8482b7 Merge branch 'main' into independent 2022-11-28 13:07:08 +05:30
vishnukvmd
26930f2760 v1.0.21 2022-11-28 13:06:57 +05:30
vishnukvmd
3e49cfbe5f Merge branch 'main' into independent 2022-11-28 13:06:41 +05:30
vishnukvmd
17fc973bfb Pause and resume camera on Android 2022-11-28 13:06:27 +05:30
vishnukvmd
0aae349509 Update POD file 2022-11-28 13:05:13 +05:30
vishnukvmd
bacca876ae Remove usages of IAP 2022-11-28 13:05:07 +05:30
vishnukvmd
d7e1998fbd v1.0.20 2022-11-24 16:23:47 +05:30
vishnukvmd
f53b44ec97 Remove unused library 2022-11-24 16:23:41 +05:30
vishnukvmd
338efb1eba v1.0.19 2022-11-24 16:15:58 +05:30
vishnukvmd
02ffe72cca Revert "Disable OpenFile to please PlayStore overlords"
This reverts commit a5cac1579b.
2022-11-24 16:15:24 +05:30
vishnukvmd
a5cac1579b Disable OpenFile to please PlayStore overlords 2022-11-24 16:14:57 +05:30
vishnukvmd
7a90a09d0c Format README 2022-11-24 13:23:07 +05:30
vishnukvmd
9508b30353 Update readme 2022-11-24 13:21:40 +05:30
vishnukvmd
7207921838 v1.0.18 2022-11-23 17:23:06 +05:30
vishnukvmd
56a741b2ac Update copy 2022-11-23 17:23:02 +05:30
vishnukvmd
e52aa78fae v1.0.17 2022-11-23 16:26:47 +05:30
vishnukvmd
9bcd107de8 Display a coach mark to nudge the user to swipe left 2022-11-23 16:26:29 +05:30
vishnukvmd
8e5488eaf9 v1.0.16 2022-11-22 15:00:08 +05:30
vishnukvmd
b20139f3b8 Provide option to opt in to crash analytics 2022-11-22 14:59:25 +05:30
vishnukvmd
21b139687d Disable Sentry tunnel 2022-11-22 14:58:59 +05:30
vishnukvmd
385731196f Remove code for setting anonymous user ID from Configuration 2022-11-22 14:44:27 +05:30
vishnukvmd
71c2958078 Improve warning while sharing logs 2022-11-22 14:06:46 +05:30
vishnukvmd
7a25da3927 Simplify email to share logs with 2022-11-22 14:06:36 +05:30
vishnukvmd
34c9ee76b3 Improve logging 2022-11-22 14:06:25 +05:30
vishnukvmd
3fbad241b1 Remove irrelevant link 2022-11-22 13:57:38 +05:30
vishnukvmd
9143634000 Execute remote sync if local items were pushed 2022-11-22 13:56:00 +05:30
vishnukvmd
a573c012e0 Rename variable 2022-11-22 13:37:09 +05:30
vishnukvmd
94debda2c7 Add the ability to add and edit issuers 2022-11-22 13:24:37 +05:30
vishnukvmd
c9f37b4f5a Add ability to edit an existing code 2022-11-22 13:24:37 +05:30
Neeraj Gupta
05652656ae Update README.md 2022-11-16 16:15:13 +05:30
vishnukvmd
8e715b4cf9 v1.0.15 2022-11-15 17:44:18 +05:30
vishnukvmd
e264d3456b Add indicator for codes that haven't synced to remote yet 2022-11-15 17:44:04 +05:30
vishnukvmd
56a73ab7ee Send stack trace on error capture 2022-11-15 17:27:12 +05:30
vishnukvmd
963d18b501 Gracefully parse errors 2022-11-15 17:26:59 +05:30
vishnukvmd
b35d3bda16 Reset cache on logout 2022-11-15 17:21:44 +05:30
vishnukvmd
7ad76adcaa v1.0.14 2022-11-15 14:04:26 +05:30
vishnukvmd
691eaabf50 Switch to FlutterFragmentActivity 2022-11-15 14:04:17 +05:30
vishnukvmd
7ab16df330 Update readme 2022-11-14 22:46:08 +05:30
vishnukvmd
3c16cfd829 Update podfile 2022-11-14 22:46:02 +05:30
160 changed files with 7906 additions and 2889 deletions

View File

@@ -2,69 +2,85 @@ name: Flutter CI
# This workflow is triggered on pushes to the repository.
on:
workflow_dispatch:
# Enable manual run
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v4.2.0
workflow_dispatch:
# Enable manual run
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v4.2.0
jobs:
build:
# This job will run on ubuntu virtual machine
runs-on: ubuntu-latest
steps:
build:
# This job will run on ubuntu virtual machine
runs-on: ubuntu-latest
steps:
# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: "11"
# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
# Setup the flutter environment.
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.7.3"
# Setup the flutter environment.
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.3.8'
# Fetch sub modules
- run: git submodule update --init --recursive
# Fetch sub modules
- run: git submodule update --init --recursive
# Get flutter dependencies.
- run: flutter pub get
# Get flutter dependencies.
- run: flutter pub get
- name: Setup keys
uses: timheuer/base64-to-file@v1
with:
fileName: "keystore/ente_auth_key.jks"
encodedString: ${{ secrets.SIGNING_KEY }}
- name: Setup keys
uses: timheuer/base64-to-file@v1
with:
fileName: 'keystore/ente_auth_key.jks'
encodedString: ${{ secrets.SIGNING_KEY }}
# Build independent apk.
- name: Build
run: flutter build apk --release --flavor independent && mv build/app/outputs/flutter-apk/app-independent-release.apk build/app/outputs/flutter-apk/ente-auth.apk
env:
SIGNING_KEY_PATH: "/home/runner/work/_temp/keystore/ente_auth_key.jks"
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
# Build independent apk.
- name: Build
run: flutter build apk --release --flavor independent && mv build/app/outputs/flutter-apk/app-independent-release.apk build/app/outputs/flutter-apk/ente-auth.apk
env:
SIGNING_KEY_PATH: '/home/runner/work/_temp/keystore/ente_auth_key.jks'
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
# Build Play store aab.
- name: Build
run: flutter build appbundle --release --flavor playstore
env:
SIGNING_KEY_PATH: "/home/runner/work/_temp/keystore/ente_auth_key.jks"
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
- name: Checksum
run: sha256sum build/app/outputs/flutter-apk/ente-auth.apk > build/app/outputs/flutter-apk/sha256sum
- name: Checksum
run: sha256sum build/app/outputs/flutter-apk/ente-auth.apk > build/app/outputs/flutter-apk/sha256sum
# Upload generated apk to the artifacts.
- uses: actions/upload-artifact@v2
with:
name: release-apk
path: build/app/outputs/flutter-apk/ente-auth.apk
# Upload generated apk to the artifacts.
- uses: actions/upload-artifact@v2
with:
name: release-apk
path: build/app/outputs/flutter-apk/ente-auth.apk
- uses: actions/upload-artifact@v2
with:
name: release-checksum
path: build/app/outputs/flutter-apk/sha256sum
- uses: actions/upload-artifact@v2
with:
name: release-checksum
path: build/app/outputs/flutter-apk/sha256sum
# Create a Github release
- uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/ente-auth.apk,build/app/outputs/flutter-apk/sha256sum"
token: ${{ secrets.GITHUB_TOKEN }}
# Create a Github release
- uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/ente-auth.apk,build/app/outputs/flutter-apk/sha256sum"
token: ${{ secrets.GITHUB_TOKEN }}
# Upload to Play store
- uses: ente-io/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: io.ente.auth
releaseFiles: build/app/outputs/bundle/playstoreRelease/app-playstore-release.aab
track: internal

35
.github/workflows/l18n-crowdin.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Sync crowdin translation
on:
push:
paths: # run action automatically when app_en.arb file is changed
- 'lib/l10n/arb/app_en.arb'
branches: [ main ]
schedule:
- cron: '0 */12 * * *' # Every 12 hours - https://crontab.guru/#0_*/12_*_*_*
workflow_dispatch: # for manually running the action
jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: crowdin action
uses: crowdin/github-action@v1
with:
upload_sources: true
upload_translations: true
download_translations: true
localization_branch_name: l10n_translations
create_pull_request: true
skip_untranslated_strings: true
pull_request_title: 'New Translations'
pull_request_body: 'New translations via [Crowdin GH Action](https://github.com/crowdin/github-action)'
pull_request_base_branch_name: 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}

4
.gitmodules vendored
View File

@@ -2,3 +2,7 @@
path = thirdparty/sentry-dart
url = https://github.com/ente-io/sentry-dart.git
branch = sentry_flutter_ente
[submodule "flutter"]
path = flutter
url = https://github.com/flutter/flutter.git
branch = stable

687
LICENSE
View File

@@ -1,21 +1,674 @@
MIT License
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (c) 2021 Very Good Ventures
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Preamble
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -1,15 +1,19 @@
# ente Authenticator
ente's Authenticator helps you generate and store 2 step verification (2FA)
ente's Authenticator app helps you generate and store 2 step verification (2FA)
tokens on your mobile devices.
[Download now](#-download)
![App Screenshots](./screenshots/screenshots.png)
## ✨ Features
### Secure Backups
ente provides end-to-end encrypted cloud backups so that you don't have to worry
about losing your tokens. We use the same protocols [ente
Photos](https://ente.io/photos) uses to encrypt and preserve your data.
Photos](https://ente.io) uses to encrypt and preserve your data.
### Multi Device Synchronization
@@ -31,22 +35,59 @@ You can add tokens to ente by one of the following methods:
3. Bulk importing from a file that contains a list of codes in the following
format:
```
otpauth://totp/ACCOUNT?secret=SUPERSECRET&issuer=SERVICE
otpauth://totp/provider.com:you@email.com?secret=YOUR_SECRET
```
The codes maybe separated by new lines or commas.
You can also export the codes you have added to ente, to an **unencrypted** text
file, that adheres to the above format.
<br/>
## 🙋‍♂️ Support
## 📲 Download
If you need help, please reach out to support@ente.io, and a human will get in touch with you.
### Android
On the other hand, if you wish to support us, please [star](https://github.com/ente-io/auth/stargazers) this project.
This repository's [GitHub
releases](https://github.com/ente-io/auth/releases/latest/download/ente-auth.apk)
contains APKs, built straight from source. These builds keep themselves updated,
without relying on third party stores.
You can alternatively install the build from PlayStore or F-Droid.
<a href="https://play.google.com/store/apps/details?id=io.ente.auth"> <img
width="197" alt="Get it on Google Play"
src="https://ente.io/static/ed265c3abdcd3efa5e29f64b927bcb44/e230a/play-store-badge.webp">
</a>
<a href="https://f-droid.org/packages/io.ente.auth/">
<img width="197" alt="Get it on F-Droid" src="https://ente.io/static/5378d3de690a04a5011268b9caf739f5/e230a/f-droid-badge.webp">
</a>
### iPhone / Apple Silicon
<a href="https://apps.apple.com/us/app/ente-authenticator/id6444121398"> <img
width="197" alt="Download on AppStore"
src="https://user-images.githubusercontent.com/1161789/154795157-c4468ff9-97fd-46f3-87fe-dca789d8733a.png">
</a>
### Web
You can view your 2FA codes at [https://auth.ente.io](https://auth.ente.io). For adding or managing your secrets, you will need to use our mobile app.
### Desktop
Support for desktop platforms (Linux, Windows and older Macs) is a [work in
progress](https://github.com/ente-io/auth/tree/desktop).
Please ⭐ this repo to be notified of updates.
## 🔩 Architecture
The architecture that powers end-to-end encrypted storage and sync of your
tokens has been documented [here](architecture/README.md).
<br/>
## 🧑‍💻 Building from source
@@ -56,8 +97,26 @@ On the other hand, if you wish to support us, please [star](https://github.com/e
4. For Android, run `flutter build apk --release --flavor independent`
5. For iOS, run `flutter build ios`
<br/>
For maintainers, there is [additional documentation](RELEASES.md) on
automatically publishing the main branch to App store, Play store and GitHub
releases.
## 🙋‍♂️ Support
If you need help, please reach out to support@ente.io, and a human will get in
touch with you.
If you have feature requests, please create a [GitHub issue](https://github.com/ente-io/auth/issues/).
If you wish to support us, please ⭐
[star](https://github.com/ente-io/auth/stargazers) this project.
## 🙌 Translation
[![Crowdin](https://badges.crowdin.net/ente-authenticator-app/localized.svg)](https://crowdin.com/project/ente-authenticator-app)
If you're interested in helping out with translation, please visit our [Crowdin project](https://crowdin.com/project/ente-authenticator-app) to get started. Thank you for your support.
## 💜 Community
- Follow us on [Twitter](https://twitter.com/enteio)
- Join us on [Discord](https://ente.io/discord)
- Follow us on [Twitter](https://twitter.com/enteio) / [Mastodon](https://mstdn.social/@ente)
- Join us on [Discord](https://ente.io/discord) / [Matrix](https://ente.io/matrix)

12
RELEASES.md Normal file
View File

@@ -0,0 +1,12 @@
# Releases
1. Create a PR to bump up the version number in `pubspec.yaml`.
2. Once that is merged, tag main. This'll trigger the
[workflow](.github/workflows/ci.yml) to (a) create a new GitHub release with
the independently distributed APK, and (b) build and upload a release to
Google Play.
3. Xcode Cloud has already been configured and will automatically build and
release to TestFlight when step 1 was merged to main (you can see logs under
the PR checks).

View File

@@ -72,6 +72,9 @@ android {
playstore {
dimension "default"
}
fdroid {
dimension "default"
}
}
buildTypes {

View File

@@ -25,7 +25,7 @@
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="ente"/>
<data android:scheme="ente-auth"/>
</intent-filter>
</activity>
@@ -54,4 +54,4 @@
tools:ignore="ScopedStorage"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
</manifest>
</manifest>

View File

@@ -1,6 +1,6 @@
package io.ente.auth
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterFragmentActivity
class MainActivity: FlutterActivity() {
class MainActivity: FlutterFragmentActivity() {
}

View File

@@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>

View File

@@ -8,7 +8,7 @@ specifications of the underlying cryptography.
Your data is end-to-end encrypted with **ente**. Meaning, they are encrypted
with your `keys` before they leave your device.
<img src="e2ee.svg" class="architecture-svg" style="max-width: 600px"
<img src="assets/e2ee.svg" class="architecture-svg" style="max-width: 600px"
title="End-to-end encryption in ente" />
<br/>
@@ -39,7 +39,7 @@ leaves your device.
During registration, your `masterKey` is encrypted with your`keyEncryptionKey`,
and the resultant `encryptedMasterKey` is then sent to our servers for storage.
<img src="key-derivation.svg" class="architecture-svg" title="Key derivation" />
<img src="assets/key-derivation.svg" class="architecture-svg" title="Key derivation" />
#### <a id="key-encryption-flows-secondary-device"></a> Secondary Device
@@ -92,7 +92,7 @@ leave your device unencrypted.
- All of the above mentioned encrypted data is then pushed to the server for
storage.
<img src="token-encryption.svg" class="architecture-svg" title="Token
<img src="assets/token-encryption.svg" class="architecture-svg" title="Token
encryption" />
#### Download
@@ -149,7 +149,7 @@ the server (as discussed in [Key Encryption](#key-encryption), and decrypts it
with the entered `recoveryKey`. If the decryption succeeds, the client will know
that you have entered the correct `recoveryKey`.
<img src="recovery.svg" class="architecture-svg" title="Recovery" />
<img src="assets/recovery.svg" class="architecture-svg" title="Recovery" />
Now that you have your `masterKey`, the client will prompt you to set a new
password, using which it will derive a new `keyEncryptionKey`. This is then used
@@ -204,12 +204,12 @@ your `publicKey`. This `encryptedAuthToken` can only be decrypted with your
- This decrypted `authToken` can then from there on be used to authenticate all
API calls against our servers.
<img src="authentication.svg" class="architecture-svg" title="Authentication" />
<img src="assets/authentication.svg" class="architecture-svg" title="Authentication" />
### Security
Only by verifying access to your email and knowing your password can you obtain
an`authToken` that can be used to authenticate yourself against our servers.
an `authToken` that can be used to authenticate yourself against our servers.
---

View File

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 119 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

View File

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 105 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 123 KiB

6
crowdin.yml Normal file
View File

@@ -0,0 +1,6 @@
project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN
files:
- source: /lib/l10n/arb/app_en.arb
translation: /lib/l10n/arb/app_%two_letters_code%.arb

View File

@@ -0,0 +1 @@
- Hello, FDroid!

View File

@@ -0,0 +1,37 @@
ente's Authenticator app helps you generate and store 2 step verification (2FA)
tokens on your mobile devices.
FEATURES
- Secure Backups
ente provides end-to-end encrypted cloud backups so that you don't have to worry
about losing your tokens. We use the same protocols ente Photos uses to encrypt
and preserve your data.
- Multi Device Synchronization
ente will automatically sync the 2FA tokens you add to your account, across all
your devices. Every new device you sign into will have access to these tokens.
- Offline Mode
ente generates 2FA tokens offline, so your network connectivity will not get in
the way of your workflow.
- Import and Export Tokens
You can add tokens to ente by one of the following methods:
1. Scanning a QR code
2. Manually entering (copy-pasting) a 2FA secret
3. Bulk importing from a file that contains a list of codes in the following format:
otpauth://totp/ACCOUNT?secret=SUPERSECRET&issuer=SERVICE
The codes maybe separated by new lines or commas.
You can also export the codes you have added to ente, to an **unencrypted** text
file, that adheres to the above format.
SUPPORT
If you need help, please reach out to support@ente.io, and a human will get in touch with you.
If you have feature requests, please create an issue @ https://github.com/ente-io/auth

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@@ -0,0 +1 @@
ente is an end-to-end encrypted authenticator app

View File

@@ -0,0 +1 @@
ente Authenticator

View File

@@ -0,0 +1,6 @@
flutter_icons:
android: "launcher_icon"
image_path: "assets/icon-light.png"
adaptive_icon_foreground: "assets/icon-light-adaptive-fg.png"
adaptive_icon_background: "#ffffff"

1
flutter Submodule

Submodule flutter added at b06b8b2710

1
ios/.gitignore vendored
View File

@@ -8,6 +8,7 @@
.tags*
**/.vagrant/
**/DerivedData/
build/
Icon?
**/Pods/
**/.symlinks/

View File

@@ -2,7 +2,7 @@ PODS:
- connectivity (0.0.1):
- Flutter
- Reachability
- device_info (0.0.1):
- device_info_plus (0.0.1):
- Flutter
- DKImagePickerController/Core (4.3.4):
- DKImagePickerController/ImageDataManager
@@ -50,9 +50,11 @@ PODS:
- flutter_inappwebview/Core (0.0.1):
- Flutter
- OrderedSet (~> 5.0)
- flutter_local_notifications (0.0.1):
- Flutter
- flutter_native_splash (0.0.1):
- Flutter
- flutter_secure_storage (3.3.1):
- flutter_secure_storage (6.0.0):
- Flutter
- flutter_sodium (0.0.1):
- Flutter
@@ -62,63 +64,66 @@ PODS:
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- in_app_purchase (0.0.1):
- Flutter
- local_auth (0.0.1):
- Flutter
- move_to_background (0.0.1):
- Flutter
- MTBBarcodeScanner (5.0.11)
- open_filex (0.0.2):
- Flutter
- OrderedSet (5.0.0)
- package_info_plus (0.4.5):
- Flutter
- path_provider_ios (0.0.1):
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- qr_code_scanner (0.2.0):
- Flutter
- MTBBarcodeScanner
- Reachability (3.2)
- SDWebImage (5.13.4):
- SDWebImage/Core (= 5.13.4)
- SDWebImage/Core (5.13.4)
- Sentry/HybridSDK (7.30.2)
- SDWebImage (5.15.0):
- SDWebImage/Core (= 5.15.0)
- SDWebImage/Core (5.15.0)
- Sentry/HybridSDK (7.31.5)
- sentry_flutter (0.0.1):
- Flutter
- FlutterMacOS
- Sentry/HybridSDK (= 7.30.2)
- Sentry/HybridSDK (= 7.31.5)
- share_plus (0.0.1):
- Flutter
- shared_preferences_ios (0.0.1):
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite (0.0.2):
- Flutter
- FMDB (>= 2.7.5)
- SwiftyGif (5.4.3)
- SwiftyGif (5.4.4)
- Toast (4.0.0)
- url_launcher_ios (0.0.1):
- Flutter
DEPENDENCIES:
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- device_info (from `.symlinks/plugins/device_info/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- fk_user_agent (from `.symlinks/plugins/fk_user_agent/ios`)
- Flutter (from `Flutter`)
- flutter_email_sender (from `.symlinks/plugins/flutter_email_sender/ios`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
- flutter_sodium (from `.symlinks/plugins/flutter_sodium/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- in_app_purchase (from `.symlinks/plugins/in_app_purchase/ios`)
- local_auth (from `.symlinks/plugins/local_auth/ios`)
- move_to_background (from `.symlinks/plugins/move_to_background/ios`)
- open_filex (from `.symlinks/plugins/open_filex/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
- sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
@@ -138,8 +143,8 @@ SPEC REPOS:
EXTERNAL SOURCES:
connectivity:
:path: ".symlinks/plugins/connectivity/ios"
device_info:
:path: ".symlinks/plugins/device_info/ios"
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
file_picker:
:path: ".symlinks/plugins/file_picker/ios"
fk_user_agent:
@@ -150,6 +155,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_email_sender/ios"
flutter_inappwebview:
:path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_native_splash:
:path: ".symlinks/plugins/flutter_native_splash/ios"
flutter_secure_storage:
@@ -158,24 +165,24 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_sodium/ios"
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
in_app_purchase:
:path: ".symlinks/plugins/in_app_purchase/ios"
local_auth:
:path: ".symlinks/plugins/local_auth/ios"
move_to_background:
:path: ".symlinks/plugins/move_to_background/ios"
open_filex:
:path: ".symlinks/plugins/open_filex/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/ios"
qr_code_scanner:
:path: ".symlinks/plugins/qr_code_scanner/ios"
sentry_flutter:
:path: ".symlinks/plugins/sentry_flutter/ios"
share_plus:
:path: ".symlinks/plugins/share_plus/ios"
shared_preferences_ios:
:path: ".symlinks/plugins/shared_preferences_ios/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher_ios:
@@ -183,37 +190,38 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: 817ab1d8cd2da9d2da412a417162deee3500fc95
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
fk_user_agent: 1f47ec39291e8372b1d692b50084b0d54103c545
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_email_sender: 02d7443217d8c41483223627972bfdc09f74276b
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
flutter_local_notifications: 0c0b1ae97e741e1521e4c1629a459d04b9aec743
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
flutter_secure_storage: 7953c38a04c3fdbb00571bcd87d8e3b5ceb9daec
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
flutter_sodium: c84426b4de738514b5b66cfdeb8a06634e72fe0b
fluttertoast: 74526702fea2c060ea55dde75895b7e1bde1c86b
fluttertoast: eb263d302cc92e04176c053d2385237e9f43fad0
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
in_app_purchase: 3e2155afa9d03d4fa32d9e62d567885080ce97d6
local_auth: 1740f55d7af0a2e2a8684ce225fe79d8931e808c
move_to_background: 39a5b79b26d577b0372cbe8a8c55e7aa9fcd3a2d
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
open_filex: 6e26e659846ec990262224a12ef1c528bb4edbe4
OrderedSet: aaeb196f7fef5a9edf55d89760da9176ad40b93c
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
SDWebImage: e5cc87bf736e60f49592f307bdf9e157189298a3
Sentry: 9be48e341494bc976c963b05aa4a8ca48308c684
sentry_flutter: 544e6376e35b00eef9f0864f8bb7f10a0e204993
SDWebImage: 9bec4c5cdd9579e1f57104735ee0c37df274d593
Sentry: 4c9babff9034785067c896fd580b1f7de44da020
sentry_flutter: b10ae7a5ddcbc7f04648eeb2672b5747230172f1
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad
shared_preferences_foundation: 297b3ebca31b34ec92be11acd7fb0ba932c822ca
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
url_launcher_ios: ae1517e5e344f5544fb090b079e11f399dfbe4d2
PODFILE CHECKSUM: b4e3a7eabb03395b66e81fc061789f61526ee6bb

View File

@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@@ -220,6 +220,7 @@
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
@@ -256,7 +257,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
buildActionMask = 12;
files = (
);
inputPaths = (
@@ -266,7 +267,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
};
/* End PBXShellScriptBuildPhase section */

View File

@@ -31,6 +31,8 @@
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>MinimumOSVersion</key>
<string>12.0</string>
<key>NSCameraUsageDescription</key>
@@ -60,5 +62,7 @@
<string>Please allow auth to lock itself with FaceID or TouchID</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Please allow auth to pick a file to import data from</string>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>

24
ios/ci_scripts/ci_post_clone.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
# by default, the execution directory of this script is the ci_scripts directory
# CI_WORKSPACE is the directory of your cloned repo
echo "🟩 Navigate from ($PWD) to ($CI_WORKSPACE)"
cd $CI_WORKSPACE
echo "🟩 Install Flutter"
time git clone https://github.com/flutter/flutter.git -b stable $HOME/flutter
export PATH="$PATH:$HOME/flutter/bin"
echo "🟩 Flutter Precache"
time flutter precache --ios
echo "🟩 Install Flutter Dependencies"
time flutter pub get
echo "🟩 Install CocoaPods via Homebrew"
time HOMEBREW_NO_AUTO_UPDATE=1 brew install cocoapods
echo "🟩 Install CocoaPods dependencies..."
time cd ios && pod install
exit 0

View File

@@ -1,2 +1,2 @@
// @dart=2.9
export "view/app.dart";

View File

@@ -1,4 +1,4 @@
// @dart=2.9
import 'dart:async';
import 'dart:io';
@@ -9,24 +9,37 @@ import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/events/signed_in_event.dart';
import 'package:ente_auth/events/signed_out_event.dart';
import "package:ente_auth/l10n/l10n.dart";
import 'package:ente_auth/locale.dart';
import "package:ente_auth/onboarding/view/onboarding_page.dart";
import 'package:ente_auth/services/update_service.dart';
import 'package:ente_auth/ui/home_page.dart';
import 'package:ente_auth/ui/settings/app_update_dialog.dart';
import 'package:flutter/foundation.dart';
import "package:flutter/material.dart";
import "package:flutter_localizations/flutter_localizations.dart";
import 'package:flutter_localizations/flutter_localizations.dart';
class App extends StatefulWidget {
const App({Key key});
final Locale locale;
const App({Key? key, this.locale = const Locale("en")}) : super(key: key);
static void setLocale(BuildContext context, Locale newLocale) {
_AppState state = context.findAncestorStateOfType<_AppState>()!;
state.setLocale(newLocale);
}
@override
State<App> createState() => _AppState();
}
class _AppState extends State<App> {
StreamSubscription<SignedOutEvent> _signedOutEvent;
StreamSubscription<SignedInEvent> _signedInEvent;
late StreamSubscription<SignedOutEvent> _signedOutEvent;
late StreamSubscription<SignedInEvent> _signedInEvent;
Locale? locale;
setLocale(Locale newLocale) {
setState(() {
locale = newLocale;
});
}
@override
void initState() {
@@ -40,6 +53,7 @@ class _AppState extends State<App> {
setState(() {});
}
});
locale = widget.locale;
UpdateService.instance.shouldUpdate().then((shouldUpdate) {
if (shouldUpdate) {
Future.delayed(Duration.zero, () {
@@ -78,7 +92,9 @@ class _AppState extends State<App> {
theme: lightTheme,
darkTheme: dartTheme,
debugShowCheckedModeBanner: false,
supportedLocales: AppLocalizations.supportedLocales,
locale: locale,
supportedLocales: appSupportedLocales,
localeListResolutionCallback: localResolutionCallBack,
localizationsDelegates: const [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
@@ -95,7 +111,9 @@ class _AppState extends State<App> {
theme: lightThemeData,
darkTheme: darkThemeData,
debugShowCheckedModeBanner: false,
supportedLocales: AppLocalizations.supportedLocales,
locale: locale,
supportedLocales: appSupportedLocales,
localeListResolutionCallback: localResolutionCallBack,
localizationsDelegates: const [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,

View File

@@ -7,7 +7,6 @@ import 'package:ente_auth/core/constants.dart';
import 'package:ente_auth/core/errors.dart';
import 'package:ente_auth/core/event_bus.dart';
// ignore: import_of_legacy_library_into_null_safe
import 'package:ente_auth/core/logging/super_logging.dart';
import 'package:ente_auth/events/signed_in_event.dart';
import 'package:ente_auth/events/signed_out_event.dart';
import 'package:ente_auth/models/key_attributes.dart';
@@ -20,7 +19,6 @@ import 'package:flutter_sodium/flutter_sodium.dart';
import 'package:logging/logging.dart';
import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:uuid/uuid.dart';
class Configuration {
Configuration._privateConstructor();
@@ -33,7 +31,6 @@ class Configuration {
static const emailKey = "email";
static const keyAttributesKey = "key_attributes";
static const keyKey = "key";
static const keyShouldHideFromRecents = "should_hide_from_recents";
static const keyShouldShowLockScreen = "should_show_lock_screen";
static const lastTempFolderClearTimeKey = "last_temp_folder_clear_time";
static const secretKeyKey = "secret_key";
@@ -41,9 +38,7 @@ class Configuration {
static const tokenKey = "token";
static const encryptedTokenKey = "encrypted_token";
static const userIDKey = "user_id";
static const hasMigratedSecureStorageToFirstUnlockKey =
"has_migrated_secure_storage_to_first_unlock";
static const anonymousUserIDKey = "anonymous_user_id";
static const hasMigratedSecureStorageKey = "has_migrated_secure_storage";
final kTempFolderDeletionTimeBuffer = const Duration(days: 1).inMicroseconds;
@@ -67,8 +62,9 @@ class Configuration {
late String _sharedDocumentsMediaDirectory;
String? _volatilePassword;
final _secureStorageOptionsIOS =
const IOSOptions(accessibility: KeychainAccessibility.first_unlock);
final _secureStorageOptionsIOS = const IOSOptions(
accessibility: KeychainAccessibility.first_unlock_this_device,
);
// const IOSOptions(accessibility: IOSAccessibility.first_unlock);
@@ -120,7 +116,6 @@ class Configuration {
}
await _migrateSecurityStorageToFirstUnlock();
}
SuperLogging.setUserID(await _getOrCreateAnonymousUserID());
}
Future<void> logout({bool autoLogout = false}) async {
@@ -130,6 +125,7 @@ class Configuration {
_key = null;
_cachedToken = null;
_secretKey = null;
_authSecretKey = null;
Bus.instance.fire(SignedOutEvent());
}
@@ -456,15 +452,7 @@ class Configuration {
return _preferences.setBool(keyShouldShowLockScreen, value);
}
bool shouldHideFromRecents() {
return _preferences.getBool(keyShouldHideFromRecents) ?? false;
}
Future<void> setShouldHideFromRecents(bool value) {
return _preferences.setBool(keyShouldHideFromRecents, value);
}
void setVolatilePassword(String volatilePassword) {
void setVolatilePassword(String? volatilePassword) {
_volatilePassword = volatilePassword;
}
@@ -474,7 +462,7 @@ class Configuration {
Future<void> _migrateSecurityStorageToFirstUnlock() async {
final hasMigratedSecureStorageToFirstUnlock =
_preferences.getBool(hasMigratedSecureStorageToFirstUnlockKey) ?? false;
_preferences.getBool(hasMigratedSecureStorageKey) ?? false;
if (!hasMigratedSecureStorageToFirstUnlock &&
_key != null &&
_secretKey != null) {
@@ -489,17 +477,9 @@ class Configuration {
iOptions: _secureStorageOptionsIOS,
);
await _preferences.setBool(
hasMigratedSecureStorageToFirstUnlockKey,
hasMigratedSecureStorageKey,
true,
);
}
}
Future<String> _getOrCreateAnonymousUserID() async {
if (!_preferences.containsKey(anonymousUserIDKey)) {
//ignore: prefer_const_constructors
await _preferences.setString(anonymousUserIDKey, Uuid().v4());
}
return _preferences.getString(anonymousUserIDKey)!;
}
}

View File

@@ -1,5 +1,3 @@
// @dart=2.9
library super_logging;
import 'dart:async';
@@ -8,6 +6,7 @@ import 'dart:core';
import 'dart:io';
import 'package:ente_auth/core/logging/tunneled_transport.dart';
import 'package:ente_auth/models/typedefs.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:http/http.dart' as http;
@@ -17,8 +16,8 @@ import 'package:package_info_plus/package_info_plus.dart';
import 'package:path/path.dart';
import 'package:path_provider/path_provider.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
typedef FutureOrVoidCallback = FutureOr<void> Function();
import 'package:shared_preferences/shared_preferences.dart';
import 'package:uuid/uuid.dart';
extension SuperString on String {
Iterable<String> chunked(int chunkSize) sync* {
@@ -38,7 +37,7 @@ extension SuperString on String {
}
extension SuperLogRecord on LogRecord {
String toPrettyString([String extraLines]) {
String toPrettyString([String? extraLines]) {
final header = "[$loggerName] [$level] [$time]";
var msg = "$header $message";
@@ -76,9 +75,9 @@ class LogConfig {
/// ```
///
/// If this is [null], Sentry logger is completely disabled (default).
String sentryDsn;
String? sentryDsn;
String tunnel;
String? tunnel;
/// A built-in retry mechanism for sending errors to sentry.
///
@@ -95,7 +94,7 @@ class LogConfig {
/// A non-empty string will be treated as an explicit path to a directory.
///
/// The chosen directory can be accessed using [SuperLogging.logFile.parent].
String logDirPath;
String? logDirPath;
/// The maximum number of log files inside [logDirPath].
///
@@ -113,12 +112,12 @@ class LogConfig {
/// any uncaught errors during its execution will be reported.
///
/// Works by using [FlutterError.onError] and [runZoned].
FutureOrVoidCallback body;
FutureOrVoidCallback? body;
/// The date format for storing log files.
///
/// `DateFormat('y-M-d')` by default.
DateFormat dateFmt;
DateFormat? dateFmt;
String prefix;
@@ -142,24 +141,27 @@ class SuperLogging {
static final $ = Logger('ente_logging');
/// The current super logging configuration
static LogConfig config;
static late LogConfig config;
static Future<void> main([LogConfig config]) async {
config ??= LogConfig();
SuperLogging.config = config;
static late SharedPreferences _preferences;
static const keyShouldReportErrors = "should_report_errors";
static const keyAnonymousUserID = "anonymous_user_id";
static Future<void> main([LogConfig? appConfig]) async {
appConfig ??= LogConfig();
SuperLogging.config = appConfig;
WidgetsFlutterBinding.ensureInitialized();
_preferences = await SharedPreferences.getInstance();
appVersion ??= await getAppVersion();
final isFDroidClient = await isFDroidBuild();
if (isFDroidClient) {
config.sentryDsn = null;
config.tunnel = null;
}
final enable = config.enableInDebugMode || kReleaseMode;
sentryIsEnabled = enable && config.sentryDsn != null && !isFDroidClient;
fileIsEnabled = enable && config.logDirPath != null;
final enable = appConfig.enableInDebugMode || kReleaseMode;
sentryIsEnabled =
enable && appConfig.sentryDsn != null && shouldReportErrors();
fileIsEnabled = enable && appConfig.logDirPath != null;
if (fileIsEnabled) {
await setupLogDir();
@@ -171,51 +173,46 @@ class SuperLogging {
Logger.root.level = Level.ALL;
Logger.root.onRecord.listen(onLogRecord);
if (isFDroidClient) {
assert(
sentryIsEnabled == false,
"sentry dsn should be disabled for "
"f-droid config ${config.sentryDsn} & ${config.tunnel}",
);
}
if (!enable) {
$.info("detected debug mode; sentry & file logging disabled.");
}
if (fileIsEnabled) {
$.info("log file for today: $logFile with prefix ${config.prefix}");
$.info("log file for today: $logFile with prefix ${appConfig.prefix}");
}
if (sentryIsEnabled) {
$.info("sentry uploader started");
}
if (config.body == null) return;
if (appConfig.body == null) return;
if (enable && sentryIsEnabled) {
await SentryFlutter.init(
(options) {
options.dsn = config.sentryDsn;
options.dsn = appConfig!.sentryDsn;
options.httpClient = http.Client();
if (config.tunnel != null) {
if (appConfig.tunnel != null) {
options.transport =
TunneledTransport(Uri.parse(config.tunnel), options);
TunneledTransport(Uri.parse(appConfig.tunnel!), options);
}
},
appRunner: () => config.body(),
appRunner: () => appConfig!.body!(),
);
} else {
await config.body();
await appConfig.body!();
}
}
static void setUserID(String userID) async {
if (config?.sentryDsn != null) {
if (config.sentryDsn != null) {
Sentry.configureScope((scope) => scope.user = SentryUser(id: userID));
$.info("setting sentry user ID to: $userID");
}
}
static Future<void> _sendErrorToSentry(Object error, StackTrace stack) async {
static Future<void> _sendErrorToSentry(
Object error,
StackTrace? stack,
) async {
try {
await Sentry.captureException(
error,
@@ -231,14 +228,14 @@ class SuperLogging {
static Future onLogRecord(LogRecord rec) async {
// log misc info if it changed
String extraLines = "app version: '$appVersion'\n";
String? extraLines = "app version: '$appVersion'\n";
if (extraLines != _lastExtraLines) {
_lastExtraLines = extraLines;
} else {
extraLines = null;
}
final str = config.prefix + " " + rec.toPrettyString(extraLines);
final str = (config.prefix) + " " + rec.toPrettyString(extraLines);
// write to stdout
printLog(str);
@@ -252,16 +249,8 @@ class SuperLogging {
}
// add error to sentry queue
if (sentryIsEnabled) {
if (rec.error != null) {
_sendErrorToSentry(rec.error, null);
} else if (rec.level == Level.SEVERE || rec.level == Level.SHOUT) {
if (rec.error != null) {
_sendErrorToSentry(rec.error, null);
} else {
_sendErrorToSentry(rec.message, null);
}
}
if (sentryIsEnabled && rec.error != null) {
_sendErrorToSentry(rec.error!, null);
}
}
@@ -269,12 +258,12 @@ class SuperLogging {
static bool isFlushing = false;
static void flushQueue() async {
if (isFlushing) {
if (isFlushing || logFile == null) {
return;
}
isFlushing = true;
final entry = fileQueueEntries.removeFirst();
await logFile.writeAsString(entry, mode: FileMode.append, flush: true);
await logFile!.writeAsString(entry, mode: FileMode.append, flush: true);
isFlushing = false;
if (fileQueueEntries.isNotEmpty) {
flushQueue();
@@ -293,9 +282,11 @@ class SuperLogging {
static final sentryQueueControl = StreamController<Error>();
/// Whether sentry logging is currently enabled or not.
static bool sentryIsEnabled;
static bool sentryIsEnabled = false;
static Future<void> setupSentry() async {
$.info("Setting up sentry");
SuperLogging.setUserID(await _getOrCreateAnonymousUserID());
await for (final error in sentryQueueControl.stream.asBroadcastStream()) {
try {
Sentry.captureException(
@@ -315,19 +306,39 @@ class SuperLogging {
sentryQueueControl.add(error);
}
static bool shouldReportErrors() {
if (_preferences.containsKey(keyShouldReportErrors)) {
return _preferences.getBool(keyShouldReportErrors)!;
} else {
return false;
}
}
static Future<void> setShouldReportErrors(bool value) {
return _preferences.setBool(keyShouldReportErrors, value);
}
static Future<String> _getOrCreateAnonymousUserID() async {
if (!_preferences.containsKey(keyAnonymousUserID)) {
//ignore: prefer_const_constructors
await _preferences.setString(keyAnonymousUserID, Uuid().v4());
}
return _preferences.getString(keyAnonymousUserID)!;
}
/// The log file currently in use.
static File logFile;
static File? logFile;
/// Whether file logging is currently enabled or not.
static bool fileIsEnabled;
static bool fileIsEnabled = false;
static Future<void> setupLogDir() async {
var dirPath = config.logDirPath;
// choose [logDir]
if (dirPath.isEmpty) {
if (dirPath == null || dirPath.isEmpty) {
final root = await getExternalStorageDirectory();
dirPath = '${root.path}/logs';
dirPath = '${root!.path}/logs';
}
// create [logDir]
@@ -340,16 +351,19 @@ class SuperLogging {
// collect all log files with valid names
await for (final file in dir.list()) {
try {
final date = config.dateFmt.parse(basename(file.path));
final date = config.dateFmt!.parse(basename(file.path));
dates[file as File] = date;
files.add(file);
} on FormatException {}
}
final nowTime = DateTime.now();
// delete old log files, if [maxLogFiles] is exceeded.
if (files.length > config.maxLogFiles) {
// sort files based on ascending order of date (older first)
files.sort((a, b) => dates[a].compareTo(dates[b]));
files.sort(
(a, b) => (dates[a] ?? nowTime).compareTo((dates[b] ?? nowTime)),
);
final extra = files.length - config.maxLogFiles;
final toDelete = files.sublist(0, extra);
@@ -364,13 +378,13 @@ class SuperLogging {
}
}
logFile = File("$dirPath/${config.dateFmt.format(DateTime.now())}.txt");
logFile = File("$dirPath/${config.dateFmt!.format(DateTime.now())}.txt");
}
/// Current app version, obtained from package_info plugin.
///
/// See: [getAppVersion]
static String appVersion;
static String? appVersion;
static Future<String> getAppVersion() async {
final pkgInfo = await PackageInfo.fromPlatform();

View File

@@ -1,5 +1,3 @@
// @dart=2.9
import 'dart:convert';
import 'package:http/http.dart';
@@ -10,9 +8,9 @@ class TunneledTransport implements Transport {
final Uri _tunnel;
final SentryOptions _options;
final Dsn _dsn;
final Dsn? _dsn;
_CredentialBuilder _credentialBuilder;
_CredentialBuilder? _credentialBuilder;
final Map<String, String> _headers;
@@ -21,7 +19,7 @@ class TunneledTransport implements Transport {
}
TunneledTransport._(this._tunnel, this._options)
: _dsn = Dsn.parse(_options.dsn),
: _dsn = _options.dsn != null ? Dsn.parse(_options.dsn!) : null,
_headers = _buildHeaders(
_options.platformChecker.isWeb,
_options.sdk.identifier,
@@ -34,7 +32,7 @@ class TunneledTransport implements Transport {
}
@override
Future<SentryId> send(SentryEnvelope envelope) async {
Future<SentryId?> send(SentryEnvelope envelope) async {
final streamedRequest = await _createStreamedRequest(envelope);
final response = await _options.httpClient
.send(streamedRequest)
@@ -47,7 +45,7 @@ class TunneledTransport implements Transport {
_options.logger(
SentryLevel.error,
'API returned an error, statusCode = ${response.statusCode}, '
'body = ${response.body}',
'body = ${response.body}',
);
}
return const SentryId.empty();
@@ -66,15 +64,15 @@ class TunneledTransport implements Transport {
}
Future<StreamedRequest> _createStreamedRequest(
SentryEnvelope envelope,
) async {
SentryEnvelope envelope,
) async {
final streamedRequest = StreamedRequest('POST', _tunnel);
envelope
.envelopeStream(_options)
.listen(streamedRequest.sink.add)
.onDone(streamedRequest.sink.close);
streamedRequest.headers.addAll(_credentialBuilder.configure(_headers));
streamedRequest.headers.addAll(_credentialBuilder!.configure(_headers));
return streamedRequest;
}
@@ -92,13 +90,13 @@ class _CredentialBuilder {
_clock = clock;
factory _CredentialBuilder(
Dsn dsn,
String sdkIdentifier,
ClockProvider clock,
) {
Dsn? dsn,
String sdkIdentifier,
ClockProvider clock,
) {
final authHeader = _buildAuthHeader(
publicKey: dsn.publicKey,
secretKey: dsn.secretKey,
publicKey: dsn?.publicKey,
secretKey: dsn?.secretKey,
sdkIdentifier: sdkIdentifier,
);
@@ -106,9 +104,9 @@ class _CredentialBuilder {
}
static String _buildAuthHeader({
String publicKey,
String secretKey,
String sdkIdentifier,
String? publicKey,
String? secretKey,
String? sdkIdentifier,
}) {
var header = 'Sentry sentry_version=7, sentry_client=$sdkIdentifier, '
'sentry_key=$publicKey';

View File

@@ -358,6 +358,9 @@ extension CustomColorScheme on ColorScheme {
EnteTheme get enteTheme =>
brightness == Brightness.light ? lightTheme : darkTheme;
EnteTheme get inverseEnteTheme =>
brightness == Brightness.light ? darkTheme : lightTheme;
}
OutlinedButtonThemeData buildOutlinedButtonThemeData({

View File

@@ -0,0 +1,3 @@
import 'package:ente_auth/events/event.dart';
class TriggerLogoutEvent extends Event {}

View File

@@ -103,24 +103,32 @@ class AuthenticatorGateway {
}
Future<List<AuthEntity>> getDiff(int sinceTime, {int limit = 500}) async {
final response = await _dio.get(
_basedEndpoint + "/entity/diff",
queryParameters: {
"sinceTime": sinceTime,
"limit": limit,
},
options: Options(
headers: {
"X-Auth-Token": _config.getToken(),
try {
final response = await _dio.get(
_basedEndpoint + "/entity/diff",
queryParameters: {
"sinceTime": sinceTime,
"limit": limit,
},
),
);
final List<AuthEntity> authEntities = <AuthEntity>[];
final diff = response.data["diff"] as List;
for (var entry in diff) {
final AuthEntity entity = AuthEntity.fromMap(entry);
authEntities.add(entity);
options: Options(
headers: {
"X-Auth-Token": _config.getToken(),
},
),
);
final List<AuthEntity> authEntities = <AuthEntity>[];
final diff = response.data["diff"] as List;
for (var entry in diff) {
final AuthEntity entity = AuthEntity.fromMap(entry);
authEntities.add(entity);
}
return authEntities;
} catch (e) {
if (e is DioError && e.response?.statusCode == 401) {
throw UnauthorizedError();
} else {
rethrow;
}
}
return authEntities;
}
}

123
lib/l10n/arb/app_de.arb Normal file
View File

@@ -0,0 +1,123 @@
{
"account": "Konto",
"counterAppBarTitle": "Zähler",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"onBoardingBody": "Sichern Sie Ihre 2FA-Codes",
"onBoardingGetStarted": "Los geht's",
"setupFirstAccount": "Ihr erstes Konto einrichten",
"importScanQrCode": "Scannen eines QR-Codes",
"importEnterSetupKey": "Einen Setup-Schlüssel eingeben",
"importAccountPageTitle": "Kontodaten eingeben",
"codeIssuerHint": "Aussteller",
"codeSecretKeyHint": "Geheimer Schlüssel",
"codeAccountHint": "Konto (you@domain.com)",
"accountKeyType": "Art des Schlüssels",
"loggingOut": "Wird abgemeldet...",
"timeBasedKeyType": "Zeitbasiert (TOTP)",
"counterBasedKeyType": "Zählerbasiert (HOTP)",
"saveAction": "Speichern",
"nextTotpTitle": "Weiter",
"deleteCodeTitle": "Code löschen?",
"deleteCodeMessage": "Sind Sie sicher, dass Sie diesen Code löschen wollen? Diese Aktion ist unumkehrbar.",
"viewLogsAction": "Protokolle anzeigen",
"sendLogsDescription": "Dadurch werden Protokolle übermittelt, die uns bei der Behebung Ihres Problems helfen. Obwohl wir Vorkehrungen treffen, um sicherzustellen, dass keine sensiblen Informationen protokolliert werden, empfehlen wir Ihnen, diese Protokolle anzusehen, bevor Sie sie weitergeben.",
"preparingLogsTitle": "Vorbereiten der Protokolle...",
"emailLogsTitle": "Protokolle versenden",
"emailLogsMessage": "Bitte senden Sie die Protokolle an {email}",
"@emailLogsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"copyEmailAction": "E-Mail kopieren",
"exportLogsAction": "Protokolle exportieren",
"reportABug": "Fehlermelden",
"crashAndErrorReporting": "Absturz- und Fehlerberichte",
"reportBug": "Fehlermelden",
"emailUsMessage": "Bitte senden Sie uns eine E-Mail an {email}",
"@emailUsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"contactSupport": "Support kontaktieren",
"verifyPassword": "Passwort überprüfen",
"pleaseWait": "Bitte warten...",
"generatingEncryptionKeysTitle": "Generierung von Verschlüsselungsschlüsseln...",
"recreatePassword": "Passwort wiederherstellen",
"recreatePasswordMessage": "Das aktuelle Gerät ist nicht leistungsfähig genug, um Ihr Passwort zu verifizieren, daher müssen wir es einmalig auf eine Weise neu generieren, die mit allen Geräten funktioniert. \n\nBitte melden Sie sich mit Ihrem Wiederherstellungsschlüssel an und generieren Sie Ihr Passwort neu (Sie können dasselbe erneut verwenden, wenn Sie möchten).",
"useRecoveryKey": "Wiederherstellungsschlüssel verwenden",
"incorrectPasswordTitle": "Falsches Passwort",
"welcomeBack": "Willkommen zurück!",
"madeWithLoveAtPrefix": "gemacht mit ❤️ bei ",
"changeEmail": "E-Mail ändern",
"changePassword": "Passwort ändern",
"data": "Datei",
"cancel": "Abbrechen",
"yes": "Ja",
"no": "Nein",
"email": "E-Mail",
"support": "Unterstützung",
"settings": "Einstellungen",
"copied": "Kopiert",
"pleaseTryAgain": "Bitte versuchen Sie es erneut",
"existingUser": "Bestehender Benutzer",
"newUser": "Neu bei ente",
"delete": "Löschen",
"enterYourPasswordHint": "Geben Sie Ihr Passwort ein",
"forgotPassword": "Passwort vergessen",
"somethingWentWrongMessage": "Ein Fehler ist aufgetreten, bitte versuchen Sie es erneut",
"leaveFamily": "Familie verlassen",
"leaveFamilyMessage": "Sind Sie sicher, dass Sie den Familien-Plan verlassen wollen?",
"inFamilyPlanMessage": "Sie haben einen Familien-Plan!",
"swipeHint": "Wischen Sie nach links, um Codes zu bearbeiten oder zu entfernen",
"scan": "Scannen",
"scanACode": "Scannen eines Codes",
"verify": "Überprüfen Sie",
"enterCodeHint": "Geben Sie den 6-stelligen Code \naus Ihrer Authentifikator-App ein.",
"lostDeviceTitle": "Gerät verloren?",
"twoFactorAuthTitle": "Zwei-Faktor-Authentifizierung",
"recoverAccount": "Konto wiederherstellen",
"enterRecoveryKeyHint": "Geben Sie Ihren Wiederherstellungsschlüssel ein",
"recover": "Wiederherstellen",
"contactSupportViaEmailMessage": "Bitte senden Sie eine E-Mail an {email} von Ihrer registrierten E-Mail-Adresse",
"@contactSupportViaEmailMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"noRecoveryKeyTitle": "Kein Wiederherstellungsschlüssel?",
"enterEmailHint": "Geben Sie Ihre E-Mail Adresse ein",
"invalidEmailTitle": "Ungültige E-Mail Adresse",
"invalidEmailMessage": "Bitte geben Sie eine gültige E-Mail Adresse ein.",
"deleteAccount": "Konto löschen",
"deleteAccountQuery": "Es wird uns leid tun, Sie gehen zu sehen. Haben Sie ein Problem?",
"yesSendFeedbackAction": "Ja, Feedback senden",
"noDeleteAccountAction": "Nein, Konto löschen",
"initiateAccountDeleteTitle": "Bitte authentifizieren Sie sich, um die Kontolöschung einzuleiten",
"confirmAccountDeleteTitle": "Sind Sie sicher, dass Sie Ihr ente Konto löschen wollen?",
"confirmAccountDeleteMessage": "Ihre hochgeladenen Daten werden in allen Anwendungen (sowohl Fotos als auch Authenticator) zur Löschung vorgesehen und Ihr Konto wird dauerhaft gelöscht.",
"sendEmail": "E-Mail senden",
"createNewAccount": "Neues Konto erstellen",
"weakStrength": "Schwach",
"strongStrength": "Stark",
"moderateStrength": "Mittel",
"confirmPassword": "Bestätigen Sie das Passwort",
"close": "Schließen",
"oopsSomethingWentWrong": "Ups, da ist etwas schief gelaufen.",
"selectLanguage": "Sprache auswählen",
"language": "Sprache",
"searchHint": "Suchen...",
"search": "Suchen",
"noResult": "Kein Ergebnis",
"scanAQrCode": "QR-Code scannen",
"saveKey": "Schlüssel speichern"
}

View File

@@ -1,23 +1,233 @@
{
"@@locale": "en",
"account": "Account",
"recoveryKey": "Recovery key",
"counterAppBarTitle": "Counter",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"onBoardingBody": "Secure your 2FA codes",
"onBoardingGetStarted": "Get Started",
"setupFirstAccount": "Setup your first account",
"importScanQrCode": "Scan a QR Code",
"importEnterSetupKey": "Enter a setup key",
"importAccountPageTitle": "Enter account details",
"accountNameHint": "Account name",
"accountKeyHint" : "Your key",
"codeIssuerHint": "Issuer",
"codeSecretKeyHint" : "Secret Key",
"codeAccountHint": "Account (you@domain.com)",
"accountKeyType": "Type of key",
"sessionExpired": "Session expired",
"@sessionExpired": {
"description": "Title of the dialog when the users current session is invalid/expired"
},
"pleaseLoginAgain": "Please login again",
"loggingOut" : "Logging out...",
"timeBasedKeyType": "Time based (TOTP)",
"counterBasedKeyType": "Counter based (HOTP)",
"importAddAction": "Add",
"saveAction": "Save",
"nextTotpTitle": "next",
"deleteCodeTitle": "Delete code?",
"deleteCodeMessage": "Are you sure you want to delete this code? This action is irreversible.",
"viewLogsAction": "View logs",
"sendLogsDescription": "This will send across logs to help us debug your issue. While we take precautions to ensure that sensitive information is not logged, we encourage you to view these logs before sharing them.",
"preparingLogsTitle": "Preparing logs...",
"emailLogsTitle": "Email logs",
"emailLogsMessage": "Please send the logs to {email}",
"@emailLogsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"copyEmailAction": "Copy email",
"exportLogsAction": "Export logs",
"reportABug": "Report a bug",
"crashAndErrorReporting": "Crash & error reporting",
"reportBug": "Report bug",
"emailUsMessage": "Please email us at {email}",
"@emailUsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"contactSupport": "Contact support",
"verifyPassword": "Verify password",
"pleaseWait": "Please wait...",
"generatingEncryptionKeysTitle": "Generating encryption keys...",
"recreatePassword": "Recreate password",
"recreatePasswordMessage": "The current device is not powerful enough to verify your password, so we need to regenerate it once in a way that works with all devices. \n\nPlease login using your recovery key and regenerate your password (you can use the same one again if you wish).",
"useRecoveryKey": "Use recovery key",
"incorrectPasswordTitle": "Incorrect password",
"welcomeBack": "Welcome back!",
"madeWithLoveAtPrefix": "made with ❤️ at ",
"supportDevs" : "Subscribe to <bold-green>ente</bold-green> to support this project.",
"supportDiscount" : "Use coupon code \"AUTH\" to get 10% off first year",
"changeEmail": "Change email",
"changePassword": "Change password",
"data" : "Data",
"importCodes": "Import codes",
"exportCodes": "Export codes",
"importInstruction": "Please select a file that contains a list of your codes in the following format",
"importCodeDelimiterInfo": "The codes can be separated by a comma or a new line",
"selectFile": "Select file",
"authToViewYourRecoveryKey": "Please authenticate to view your recovery key",
"authToChangeYourEmail": "Please authenticate to change your email",
"authToChangeYourPassword": "Please authenticate to change your password",
"ok": "Ok",
"cancel": "Cancel",
"yes": "Yes",
"no": "No",
"email": "Email",
"support": "Support",
"settings": "Settings",
"copied": "Copied",
"pleaseTryAgain": "Please try again",
"existingUser": "Existing User",
"newUser" : "New to ente"
}
"newUser" : "New to ente",
"delete": "Delete",
"enterYourPasswordHint": "Enter your password",
"forgotPassword": "Forgot password",
"oops": "Oops",
"somethingWentWrongMessage": "Something went wrong, please try again",
"leaveFamily": "Leave family",
"leaveFamilyMessage": "Are you sure that you want to leave the family plan?",
"inFamilyPlanMessage": "You are on a family plan!",
"swipeHint": "Swipe left to edit or remove codes",
"scan": "Scan",
"scanACode": "Scan a code",
"verify": "Verify",
"enterCodeHint": "Enter the 6-digit code from\nyour authenticator app",
"lostDeviceTitle": "Lost device?",
"twoFactorAuthTitle": "Two-factor authentication",
"recoverAccount": "Recover account",
"enterRecoveryKeyHint": "Enter your recovery key",
"recover": "Recover",
"contactSupportViaEmailMessage":"Please drop an email to {email} from your registered email address",
"@contactSupportViaEmailMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"noRecoveryKeyTitle": "No recovery key?",
"enterEmailHint": "Enter your email address",
"invalidEmailTitle": "Invalid email address",
"invalidEmailMessage": "Please enter a valid email address.",
"deleteAccount": "Delete account",
"deleteAccountQuery": "We'll be sorry to see you go. Are you facing some issue?",
"yesSendFeedbackAction": "Yes, send feedback",
"noDeleteAccountAction": "No, delete account",
"initiateAccountDeleteTitle": "Please authenticate to initiate account deletion",
"confirmAccountDeleteTitle": "Are you sure you want to delete your ente account?",
"confirmAccountDeleteMessage": "Your uploaded data, across all apps (Photos and Authenticator both), will be scheduled for deletion, and your account will be permanently deleted.",
"sendEmail": "Send email",
"createNewAccount": "Create new account",
"weakStrength": "Weak",
"strongStrength": "Strong",
"moderateStrength": "Moderate",
"confirmPassword": "Confirm password",
"close": "Close",
"oopsSomethingWentWrong": "Oops, Something went wrong.",
"selectLanguage": "Select language",
"language": "Language",
"social": "Social",
"security": "Security",
"lockscreen": "Lockscreen",
"authToChangeLockscreenSetting": "Please authenticate to change lockscreen setting",
"lockScreenEnablePreSteps": "To enable lockscreen, please setup device passcode or screen lock in your system settings.",
"viewActiveSessions": "View active sessions",
"authToViewYourActiveSessions": "Please authenticate to view your active sessions",
"searchHint": "Search...",
"search": "Search",
"sorryUnableToGenCode": "Sorry, unable to generate a code for {issuerName}",
"noResult": "No result",
"addCode": "Add code",
"scanAQrCode": "Scan a QR code",
"enterDetailsManually": "Enter details manually",
"edit": "Edit",
"copiedToClipboard": "Copied to clipboard",
"error": "Error",
"recoveryKeyCopiedToClipboard": "Recovery key copied to clipboard",
"recoveryKeyOnForgotPassword": "If you forget your password, the only way you can recover your data is with this key.",
"recoveryKeySaveDescription": "We don't store this key, please save this 24 word key in a safe place.",
"doThisLater": "Do this later",
"saveKey": "Save key",
"createAccount": "Create account",
"passwordStrength": "Password strength: {passwordStrengthValue}",
"@passwordStrength": {
"description": "Text to indicate the password strength",
"placeholders": {
"passwordStrengthValue": {
"description": "The strength of the password as a string",
"type": "String",
"example": "Weak or Moderate or Strong"
}
},
"message": "Password Strength: {passwordStrengthText}"
},
"password": "Password",
"signUpTerms" : "I agree to the <u-terms>terms of service</u-terms> and <u-policy>privacy policy</u-policy>",
"privacyPolicyTitle": "Privacy Policy",
"termsOfServicesTitle": "Terms",
"encryption": "Encryption",
"ackPasswordLostWarning": "I understand that if I lose my password, I may lose my data since my data is <underline>end-to-end encrypted</underline>.",
"loginTerms": "By clicking log in, I agree to the <u-terms>terms of service</u-terms> and <u-policy>privacy policy</u-policy>",
"logInLabel": "Log in",
"logout": "Logout",
"areYouSureYouWantToLogout": "Are you sure you want to logout?",
"yesLogout": "Yes, logout",
"exit": "Exit",
"verifyingRecoveryKey": "Verifying recovery key...",
"recoveryKeyVerified": "Recovery key verified",
"recoveryKeySuccessBody": "Great! Your recovery key is valid. Thank you for verifying.\n\nPlease remember to keep your recovery key safely backed up.",
"invalidRecoveryKey": "The recovery key you entered is not valid. Please make sure it contains 24 words, and check the spelling of each.\n\nIf you entered an older recovery code, make sure it is 64 characters long, and check each of them.",
"recreatePasswordTitle": "Recreate password",
"recreatePasswordBody": "The current device is not powerful enough to verify your password, but we can regenerate in a way that works with all devices.\n\nPlease login using your recovery key and regenerate your password (you can use the same one again if you wish).",
"invalidKey": "Invalid key",
"tryAgain": "Try again",
"viewRecoveryKey": "View recovery key",
"confirmRecoveryKey": "Confirm recovery key",
"recoveryKeyVerifyReason": "Your recovery key is the only way to recover your photos if you forget your password. You can find your recovery key in Settings > Account.\n\nPlease enter your recovery key here to verify that you have saved it correctly.",
"confirmYourRecoveryKey": "Confirm your recovery key",
"confirm": "Confirm",
"emailYourLogs": "Email your logs",
"pleaseSendTheLogsTo": "Please send the logs to \n{toEmail}",
"copyEmailAddress": "Copy email address",
"exportLogs": "Export logs",
"enterYourRecoveryKey": "Enter your recovery key",
"tempErrorContactSupportIfPersists": "It looks like something went wrong. Please retry after some time. If the error persists, please contact our support team.",
"itLooksLikeSomethingWentWrongPleaseRetryAfterSome": "It looks like something went wrong. Please retry after some time. If the error persists, please contact our support team.",
"about": "About",
"weAreOpenSource": "We are open source!",
"privacy": "Privacy",
"terms": "Terms",
"checkForUpdates": "Check for updates",
"checking": "Checking...",
"youAreOnTheLatestVersion": "You are on the latest version",
"warning": "Warning",
"exportWarningDesc": "The exported file contains sensitive information. Please store this safely.",
"iUnderStand" : "I understand",
"@iUnderStand": {
"description": "Text for the button to confirm the user understands the warning"
},
"authToExportCodes": "Please authenticate to export your codes",
"importSuccessTitle": "Yay!",
"importSuccessDesc": "You have imported {count} codes!",
"@importSuccessDes" : {
"placeholders": {
"count": {
"description": "The number of codes imported",
"type": "int",
"example": "1"
}
}
},
"sorry" : "Sorry",
"importFailureDesc": "Could not parse the selected file.\nPlease write to support@ente.io if you need help!",
"pendingSyncs" : "Warning",
"pendingSyncsWarningBody": "Some of your codes have not been backed up.\n\nPlease ensure that you have a backup for these codes before you logout."
}

View File

@@ -1,7 +1,198 @@
{
"@@locale": "es",
"counterAppBarTitle": "Contador",
"@counterAppBarTitle": {
"description": "Texto mostrado en la AppBar de la página del contador"
"account": "Cuenta",
"recoveryKey": "Clave de recuperación",
"counterAppBarTitle": "Contador",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"onBoardingBody": "Asegure sus códigos 2FA",
"onBoardingGetStarted": "Primeros pasos",
"setupFirstAccount": "Configura tu primera cuenta",
"importScanQrCode": "Escanear un código QR",
"importEnterSetupKey": "Ingrese una llave de configuración",
"importAccountPageTitle": "Ingrese los detalles de la cuenta",
"codeIssuerHint": "Emisor",
"codeSecretKeyHint": "Llave Secreta",
"codeAccountHint": "Cuenta (tu@dominio.com)",
"accountKeyType": "Tipo de llave",
"sessionExpired": "La sesión ha expirado",
"@sessionExpired": {
"description": "Title of the dialog when the users current session is invalid/expired"
},
"pleaseLoginAgain": "Por favor, vuelva a iniciar sesión",
"loggingOut": "Cerrando sesión...",
"timeBasedKeyType": "Basado en el tiempo (TOTP)",
"counterBasedKeyType": "Basado en Contador (HOTP)",
"saveAction": "Guardar",
"nextTotpTitle": "siguiente",
"deleteCodeTitle": "Eliminar código?",
"deleteCodeMessage": "¿Está seguro que desea eliminar este código? Esta acción es irreversible.",
"viewLogsAction": "Ver Registros",
"sendLogsDescription": "Esto enviará registros para ayudarnos a depurar su problema. Aunque tomamos precauciones para asegurarnos que no se registre información sensible, le recomendamos que consulte estos registros antes de compartirlos.",
"preparingLogsTitle": "Preparando registros...",
"emailLogsTitle": "Enviar registros por email",
"emailLogsMessage": "Por favor, envíe los registros a {email}",
"@emailLogsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"copyEmailAction": "Copiar correo electrónico",
"exportLogsAction": "Exportar registros",
"reportABug": "Reportar un error",
"crashAndErrorReporting": "Informes de errores y fallos",
"reportBug": "Reportar error",
"emailUsMessage": "Por favor, envíanos un correo electrónico a {email}",
"@emailUsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"contactSupport": "Ponerse en contacto con el equipo de soporte",
"verifyPassword": "Verificar contraseña",
"pleaseWait": "Por favor, espere...",
"generatingEncryptionKeysTitle": "Generando claves de encriptación...",
"recreatePassword": "Recrear contraseña",
"recreatePasswordMessage": "El dispositivo actual no es lo suficientemente potente para verificar su contraseña, así que necesitamos regenerarlo una vez de una manera que funcione con todos los dispositivos. \n\nPor favor Inicie sesión usando su clave de recuperación y regenere su contraseña (puede volver a utilizar la misma si lo desea).",
"useRecoveryKey": "Usar clave de recuperación",
"incorrectPasswordTitle": "Contraseña incorrecta",
"welcomeBack": "¡Te damos la bienvenida otra vez!",
"madeWithLoveAtPrefix": "hecho con ❤️ en ",
"supportDevs": "Suscríbase a <bold-green>ente</bold-green> para apoyar este proyecto.",
"supportDiscount": "Utiliza el cupón promocional \"AUTH\" para obtener un 10% de descuento en el primer año",
"changeEmail": "Cambiar correo electrónico",
"changePassword": "Cambiar contraseña",
"data": "Datos",
"importCodes": "Importar códigos",
"exportCodes": "Exportar códigos",
"importInstruction": "Por favor, seleccione un archivo que contenga una lista de sus códigos en el siguiente formato",
"importCodeDelimiterInfo": "Los códigos pueden separarse por una coma o una nueva línea",
"selectFile": "Seleccionar archivo",
"authToViewYourRecoveryKey": "Por favor, autentifíquese para ver su clave de recuperación",
"authToChangeYourEmail": "Por favor, autentifíquese para cambiar su correo electrónico",
"authToChangeYourPassword": "Por favor, autentifíquese para cambiar su contraseña",
"ok": "Ok",
"cancel": "Cancelar",
"yes": "Si",
"no": "No",
"email": "Correo electrónico",
"support": "Soporte",
"settings": "Configuración",
"copied": "Copiado",
"pleaseTryAgain": "Por favor, inténtalo nuevamente",
"existingUser": "Usuario existente",
"newUser": "Nuevo en ente",
"delete": "Borrar",
"enterYourPasswordHint": "Ingrese su contraseña",
"forgotPassword": "Olvidé mi contraseña",
"oops": "Ups",
"somethingWentWrongMessage": "Algo ha ido mal, por favor, prueba otra vez",
"leaveFamily": "Dejar plan familiar",
"leaveFamilyMessage": "¿Está seguro de que desea abandonar el plan familiar?",
"inFamilyPlanMessage": "¡Estás en un plan familiar!",
"swipeHint": "Deslice a la izquierda para editar o eliminar códigos",
"scan": "Escanear",
"scanACode": "Escanear un código",
"verify": "Verificar",
"enterCodeHint": "Ingrese el código de seis dígitos de su aplicación de autenticación",
"lostDeviceTitle": "¿Perdió su dispositivo?",
"twoFactorAuthTitle": "Autenticación de dos factores",
"recoverAccount": "Recuperar cuenta",
"enterRecoveryKeyHint": "Introduzca su clave de recuperación",
"recover": "Recuperar",
"contactSupportViaEmailMessage": "Por favor, envíe un email a {email} desde su dirección de correo electrónico registrada",
"@contactSupportViaEmailMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"noRecoveryKeyTitle": "¿Sin clave de recuperación?",
"enterEmailHint": "Introduce tu dirección de correo electrónico",
"invalidEmailTitle": "Dirección de correo electrónico no válida",
"invalidEmailMessage": "Por favor, introduzca una dirección de correo electrónico válida.",
"deleteAccount": "Eliminar cuenta",
"deleteAccountQuery": "Lamentaremos que te vayas. ¿Estás enfrentando algún inconveniente?",
"yesSendFeedbackAction": "Sí, enviar comentarios",
"noDeleteAccountAction": "No, eliminar cuenta",
"initiateAccountDeleteTitle": "Por favor, autentifíquese para iniciar la eliminación de la cuenta",
"confirmAccountDeleteTitle": "¿Estás seguro de que quieres eliminar tu cuenta de ente?",
"confirmAccountDeleteMessage": "Sus datos subidos a través de todas las aplicaciones (fotos y autenticador), se programarán para su eliminación y su cuenta se eliminará permanentemente.",
"sendEmail": "Enviar correo electrónico",
"createNewAccount": "Crear nueva cuenta",
"weakStrength": "Poco segura",
"strongStrength": "Fuerte",
"moderateStrength": "Moderado",
"confirmPassword": "Confirmar contraseña",
"close": "Cerrar",
"oopsSomethingWentWrong": "Vaya, algo salió mal.",
"selectLanguage": "Seleccionar idioma",
"language": "Idioma",
"social": "Social",
"security": "Seguridad",
"lockscreen": "Pantalla de bloqueo",
"searchHint": "Buscar...",
"search": "Buscar",
"sorryUnableToGenCode": "Lo sentimos, no se puede generar un código para {issuerName}",
"noResult": "Sin resultados",
"addCode": "Añadir código",
"scanAQrCode": "Escanear un código QR",
"enterDetailsManually": "Ingrese los detalles manualmente",
"edit": "Editar",
"copiedToClipboard": "Copiado al portapapeles",
"error": "Error",
"recoveryKeyCopiedToClipboard": "Llave de recuperación copiada al portapapeles",
"recoveryKeyOnForgotPassword": "Si olvida su contraseña, la única forma de recuperar sus datos es con esta clave.",
"recoveryKeySaveDescription": "Nosotros no almacenamos esta clave, por favor guarde dicha clave de 24 palabras en un lugar seguro.",
"doThisLater": "Hacer esto más tarde",
"saveKey": "Guardar Clave",
"createAccount": "Crear cuenta",
"passwordStrength": "Fortaleza de la contraseña: {passwordStrengthValue}",
"@passwordStrength": {
"description": "Text to indicate the password strength",
"placeholders": {
"passwordStrengthValue": {
"description": "The strength of the password as a string",
"type": "String",
"example": "Weak or Moderate or Strong"
}
},
"message": "Password Strength: {passwordStrengthText}"
},
"password": "Contraseña",
"signUpTerms": "Estoy de acuerdo con los <u-terms>términos del servicio</u-terms> y <u-policy> la política de privacidad</u-policy>",
"privacyPolicyTitle": "Política de Privacidad",
"termsOfServicesTitle": "Términos",
"encryption": "Cifrado",
"ackPasswordLostWarning": "Entiendo que si pierdo mi contraseña podría perder mis datos, ya que mis datos están <underline>cifrados de extremo a extremo</underline>.",
"loginTerms": "Al hacer clic en iniciar sesión, acepto los <u-terms>términos de servicio</u-terms> y <u-policy>la política de privacidad</u-policy>",
"logInLabel": "Iniciar sesión",
"logout": "Cerrar sesión",
"yesLogout": "Sí, cerrar sesión",
"exit": "Salir",
"verifyingRecoveryKey": "Verificando clave de recuperación...",
"recoveryKeyVerified": "Clave de recuperación verificada",
"recoveryKeySuccessBody": "¡Genial! Su clave de recuperación es válida. Gracias por verificar.\n\nPor favor, recuerde mantener su clave de recuperación segura.",
"invalidRecoveryKey": "La clave de recuperación introducida no es válida. Por favor, asegúrese de que contiene 24 palabras y compruebe la ortografía de cada una.\n\nSi ha introducido un código de recuperación antiguo, asegúrese de que tiene 64 caracteres de largo y compruebe cada uno de ellos.",
"recreatePasswordTitle": "Recrear contraseña",
"recreatePasswordBody": "El dispositivo actual no es lo suficientemente potente para verificar su contraseña, pero podemos regenerarla de una manera que funcione con todos los dispositivos.\n\nPor favor inicie sesión usando su clave de recuperación y regenere su contraseña (puede volver a utilizar la misma si lo desea).",
"invalidKey": "Clave inválida",
"tryAgain": "Inténtelo de nuevo",
"viewRecoveryKey": "Ver código de recuperación",
"confirmRecoveryKey": "Confirmar clave de recuperación",
"recoveryKeyVerifyReason": "Su clave de recuperación es la única forma de recuperar sus fotos si olvida su contraseña. Puede encontrar su clave de recuperación en Ajustes > Cuenta.\n\nPor favor, introduzca su clave de recuperación aquí para verificar que la ha guardado correctamente.",
"confirmYourRecoveryKey": "Confirmar su clave de recuperación",
"confirm": "Confirmar",
"emailYourLogs": "Envíe sus registros por correo electrónico",
"pleaseSendTheLogsTo": "Por favor, envíe los registros a {toEmail}",
"copyEmailAddress": "Copiar dirección de correo electrónico",
"exportLogs": "Exportar registros",
"enterYourRecoveryKey": "Introduzca su clave de recuperación",
"tempErrorContactSupportIfPersists": "Parece que algo salió mal. Por favor, vuelve a intentarlo después de algún tiempo. Si el error persiste, ponte en contacto con nuestro equipo de soporte.",
"itLooksLikeSomethingWentWrongPleaseRetryAfterSome": "Parece que algo salió mal. Por favor, vuelve a intentarlo después de algún tiempo. Si el error persiste, ponte en contacto con nuestro equipo de soporte."
}

122
lib/l10n/arb/app_fi.arb Normal file
View File

@@ -0,0 +1,122 @@
{
"counterAppBarTitle": "Laskuri",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"onBoardingBody": "Turvaa 2FA-koodisi",
"onBoardingGetStarted": "Aloitetaan",
"setupFirstAccount": "Määritä ensimmäinen tilisi",
"importScanQrCode": "Lue QR-koodi",
"importEnterSetupKey": "Syötä asetusavain",
"importAccountPageTitle": "Syötä tilin tiedot",
"codeIssuerHint": "Myöntäjä",
"codeSecretKeyHint": "Salainen avain",
"codeAccountHint": "Tili (sinun@jokinosoite.com)",
"accountKeyType": "Avaimen tyyppi",
"sessionExpired": "Istunto on vanheutunut",
"@sessionExpired": {
"description": "Title of the dialog when the users current session is invalid/expired"
},
"pleaseLoginAgain": "Sisäänkirjaudu uudestaan",
"loggingOut": "Kirjaudutaan ulos...",
"timeBasedKeyType": "Aikaperusteinen (TOTP)",
"counterBasedKeyType": "Laskuripohjainen (HOTP)",
"saveAction": "Tallenna",
"nextTotpTitle": "seuraava",
"deleteCodeTitle": "Poista koodi?",
"deleteCodeMessage": "Haluatko varmasti poistaa tämän koodin? Toimintoa ei voi peruuttaa.",
"viewLogsAction": "Näytä lokikirjaukset",
"sendLogsDescription": "Tämä toiminto lähettää lokin kirjaukset eteenpäin jotta saisimme apua ongelmasi ratkaisemiseen. Vaikkakin käytäntömme on olla kirjaamatta mitään arkaluontoista tietoa, suosittelemme että tarkistat nämä tiedot ennen niiden jakamista.",
"preparingLogsTitle": "Valmistellaan lokikirjaukset...",
"emailLogsTitle": "Toimita lokikirjaukset sähköpostilla",
"emailLogsMessage": "Lähetä lokikirjaukset osoitteeseen {email}",
"@emailLogsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"copyEmailAction": "Jäljennä sähköpostiosoite leikepöydälle",
"exportLogsAction": "Vie lokikirjaukset",
"reportABug": "Ilmoita virhetoiminnosta",
"crashAndErrorReporting": "Kaatumis- ja virheraportointi",
"reportBug": "Ilmoita virheestä",
"emailUsMessage": "Lähetä meille sähköpostia osoitteeseen {email}",
"@emailUsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"contactSupport": "Ota yhteyttä käyttötukeen",
"verifyPassword": "Vahvista salasana",
"pleaseWait": "Odota hetki...",
"generatingEncryptionKeysTitle": "Luodaan salausavaimia...",
"recreatePassword": "Luo salasana uudelleen",
"recreatePasswordMessage": "Nykyinen laite ei ole riittävän tehokas salasanasi varmistamiseen, joten se on uudistettava kerran sillä tavalla että se toimii sen jälkeen kaikkien laitteiden kanssa. \n\nOle hyvä ja kirjaudu sisään palautusavaimellasi ja luo salasanasi uudelleen (voit halutessasi käyttää aivan samaa salasanaa).",
"useRecoveryKey": "Käytä palautusavainta",
"incorrectPasswordTitle": "Salasana on väärin",
"welcomeBack": "Tervetuloa takaisin!",
"madeWithLoveAtPrefix": "tehty ❤️:lla täällä ",
"supportDevs": "Tilaa <bold-green>ente</bold-green> tukeaksesi tätä hanketta.",
"supportDiscount": "Käytä kuponkikoodia \"AUTH\" saadaksesi 10% alennuksen ensimmäisestä vuodesta",
"changeEmail": "vaihda sähköpostiosoitteesi",
"ok": "Selvä",
"cancel": "Keskeytä",
"yes": "Kyllä",
"no": "Ei",
"email": "Sähköposti",
"support": "Tuki",
"settings": "Asetukset",
"copied": "Jäljennetty",
"pleaseTryAgain": "Yritä uudestaan",
"existingUser": "Jo valmiiksi olemassaoleva käyttäjä",
"newUser": "Uusi Ente-käyttäjä",
"delete": "Poista",
"enterYourPasswordHint": "Syötä salasanasi",
"forgotPassword": "Olen unohtanut salasanani",
"oops": "Hupsista",
"somethingWentWrongMessage": "Jokin meni pieleen, yritä uudelleen",
"leaveFamily": "Poistu perheestä",
"leaveFamilyMessage": "Oletko varma että haluat jättää tämän perhemallin?",
"inFamilyPlanMessage": "Olet perhemallissa!",
"swipeHint": "Pyyhkäise vasemmalle muokataksesi tai poistaaksesi koodeja",
"scan": "Lue",
"scanACode": "Lue koodi",
"verify": "Vahvista",
"enterCodeHint": "Syötä 6-merkkinen koodi varmennussovelluksestasi",
"lostDeviceTitle": "Kadonnut laite?",
"twoFactorAuthTitle": "Kaksivaiheinen vahvistus",
"recoverAccount": "Palauta tilisi",
"enterRecoveryKeyHint": "Syötä palautusavaimesi",
"recover": "Palauta",
"contactSupportViaEmailMessage": "Ole hyvä ja lähetä sähköpostia osoitteeseen {email} omasta rekisteröidystä sähköpostiosoitteestasi",
"@contactSupportViaEmailMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"noRecoveryKeyTitle": "Ei palautusavainta?",
"enterEmailHint": "Syötä sähköpostiosoitteesi",
"invalidEmailTitle": "Epäkelpo sähköpostiosoite",
"invalidEmailMessage": "Syötä kelpoisa sähköpostiosoite.",
"deleteAccount": "Poista tili",
"deleteAccountQuery": "Olemme pahoillamme että lähdet keskuudestamme. Kohtasitko käytössä jonkin ongelman?",
"yesSendFeedbackAction": "Kyllä, lähetä palautetta",
"noDeleteAccountAction": "En, poista tili",
"initiateAccountDeleteTitle": "Ole hyvä ja tee todennus käynnistääksesi tilisi poistoprosessin",
"confirmAccountDeleteTitle": "Haluatko varmasti poistaa Ente-tilisi?",
"confirmAccountDeleteMessage": "Lataamasi tiedot kaikkien sovellusten kesken (molemmat, sekä kuvat ja todenteet) ajastetaan poistettavaksi ja tilisi poistetaan pysyvästi.",
"sendEmail": "Lähetä sähköpostia",
"createNewAccount": "Luo uusi tili",
"weakStrength": "Heikko salasana",
"strongStrength": "Vahva salasana",
"moderateStrength": "Kohtalainen salasana",
"confirmPassword": "Vahvista salasana",
"close": "Sulje",
"oopsSomethingWentWrong": "Hupsista! Jotakin meni nyt pieleen."
}

198
lib/l10n/arb/app_fr.arb Normal file
View File

@@ -0,0 +1,198 @@
{
"account": "Compte",
"recoveryKey": "Clé de récupération",
"counterAppBarTitle": "Compteur",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"onBoardingBody": "Sécurisez vos codes 2FA",
"onBoardingGetStarted": "Premiers Pas",
"setupFirstAccount": "Configurez votre premier compte",
"importScanQrCode": "Scannez un QR Code",
"importEnterSetupKey": "Saisir une clé de configuration",
"importAccountPageTitle": "Saisir les détails du compte",
"codeIssuerHint": "Émetteur",
"codeSecretKeyHint": "Clé secrète",
"codeAccountHint": "Compte (vous@domaine.fr)",
"accountKeyType": "Type de clé",
"sessionExpired": "Session expirée",
"@sessionExpired": {
"description": "Title of the dialog when the users current session is invalid/expired"
},
"pleaseLoginAgain": "Veuillez vous reconnecter",
"loggingOut": "Deconnexion...",
"timeBasedKeyType": "Basé sur l'heure (TOTP)",
"counterBasedKeyType": "Basé sur le compteur (HOTP)",
"saveAction": "Sauvegarder",
"nextTotpTitle": "suivant",
"deleteCodeTitle": "Supprimer le code ?",
"deleteCodeMessage": "Êtes-vous sûr de vouloir supprimer ce code ? Cette action est irréversible.",
"viewLogsAction": "Afficher les journaux",
"sendLogsDescription": "Cela enverra des logs pour nous aider à déboguer votre problème. Bien que nous prenions des précautions pour nous assurer que les informations sensibles ne sont pas enregistrées, nous vous encourageons à consulter ces journaux avant de les partager.",
"preparingLogsTitle": "Préparation des journaux...",
"emailLogsTitle": "Journaux d'email",
"emailLogsMessage": "Envoyez les logs à {email}",
"@emailLogsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"copyEmailAction": "Copier le-mail",
"exportLogsAction": "Exporter les journaux",
"reportABug": "Signaler un bug",
"crashAndErrorReporting": "Rapport de plantage et d'erreur",
"reportBug": "Signaler un bug",
"emailUsMessage": "Veuillez nous envoyer un e-mail à {email}",
"@emailUsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"contactSupport": "Contacter le support",
"verifyPassword": "Vérifier le mot de passe",
"pleaseWait": "Veuillez patienter...",
"generatingEncryptionKeysTitle": "Génération des clés de chiffrement...",
"recreatePassword": "Recréer le mot de passe",
"recreatePasswordMessage": "L'appareil actuel n'est pas assez puissant pour vérifier votre mot de passe, donc nous avons besoin de le régénérer une fois d'une manière qu'il fonctionne avec tous les périphériques.\n\nVeuillez vous connecter en utilisant votre clé de récupération et régénérer votre mot de passe (vous pouvez utiliser le même si vous le souhaitez).",
"useRecoveryKey": "Utiliser la clé de récupération",
"incorrectPasswordTitle": "Mot de passe incorrect",
"welcomeBack": "Bon retour parmi nous !",
"madeWithLoveAtPrefix": "fait avec ❤️ à ",
"supportDevs": "Abonnez-vous à <bold-green>ente</bold-green> pour soutenir ce projet.",
"supportDiscount": "Utilisez le code coupon \"AUTH\" pour obtenir 10% de réduction sur la première année",
"changeEmail": "Modifier l'e-mail",
"changePassword": "Modifier le mot de passe",
"data": "Données",
"importCodes": "Importer les codes",
"exportCodes": "Exporter les codes",
"importInstruction": "Veuillez sélectionner un fichier qui contient une liste de vos codes dans le format suivant",
"importCodeDelimiterInfo": "Les codes peuvent être séparés par une virgule ou un retour à la ligne",
"selectFile": "Sélectionner le fichier",
"authToViewYourRecoveryKey": "Veuillez vous authentifier pour afficher votre clé de récupération",
"authToChangeYourEmail": "Veuillez vous authentifier pour modifier votre adresse e-mail",
"authToChangeYourPassword": "Veuillez vous authentifier pour modifier votre mot de passe",
"ok": "Ok",
"cancel": "Annuler",
"yes": "Oui",
"no": "Non",
"email": "E-mail",
"support": "Support",
"settings": "Paramètres",
"copied": "Copié",
"pleaseTryAgain": "Veuillez réessayer",
"existingUser": "Utilisateur existant",
"newUser": "Nouveau sur ente",
"delete": "Supprimer",
"enterYourPasswordHint": "Saisir votre mot de passe",
"forgotPassword": "Mot de passe oublié",
"oops": "Oups",
"somethingWentWrongMessage": "Quelque chose s'est mal passé, veuillez recommencer",
"leaveFamily": "Quitter le plan familial",
"leaveFamilyMessage": "Êtes-vous certains de vouloir quitter le plan familial?",
"inFamilyPlanMessage": "Vous êtes sur un plan familial !",
"swipeHint": "Glisser vers la gauche pour modifier ou supprimer des codes",
"scan": "Analyser",
"scanACode": "Scanner un code",
"verify": "Vérifier",
"enterCodeHint": "Saisir le code à 6 caractères de votre appli d'authentification",
"lostDeviceTitle": "Appareil perdu ?",
"twoFactorAuthTitle": "Authentification à deux facteurs",
"recoverAccount": "Récupérer un compte",
"enterRecoveryKeyHint": "Saisissez votre clé de récupération",
"recover": "Restaurer",
"contactSupportViaEmailMessage": "Veuillez envoyer un e-mail à {email} depuis votre adresse enregistrée",
"@contactSupportViaEmailMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"noRecoveryKeyTitle": "Pas de clé de récupération ?",
"enterEmailHint": "Entrez votre adresse e-mail",
"invalidEmailTitle": "Adresse e-mail non valide",
"invalidEmailMessage": "Veuillez saisir une adresse e-mail valide.",
"deleteAccount": "Supprimer le compte",
"deleteAccountQuery": "Nous sommes désolés de vous voir partir. Êtes-vous confronté à un problème?",
"yesSendFeedbackAction": "Oui, envoyer un commentaire",
"noDeleteAccountAction": "Non, supprimer le compte",
"initiateAccountDeleteTitle": "Veuillez vous authentifier pour débuter la suppression du compte",
"confirmAccountDeleteTitle": "Êtes-vous sûr de vouloir supprimer votre compte ente ?",
"confirmAccountDeleteMessage": "Vos données téléchargées, à travers toutes les applications (Photos et Authenticator), seront planifiées pour la suppression, et votre compte sera définitivement supprimé.",
"sendEmail": "Envoyer un e-mail",
"createNewAccount": "Créer un nouveau compte",
"weakStrength": "Faible",
"strongStrength": "Fort",
"moderateStrength": "Modéré",
"confirmPassword": "Confirmer le mot de passe",
"close": "Fermer",
"oopsSomethingWentWrong": "Oops ! Une erreur s'est produite.",
"selectLanguage": "Sélectionnez la langue",
"language": "Langue",
"social": "Réseaux Sociaux",
"security": "Sécurité",
"lockscreen": "Ecran de vérouillage",
"searchHint": "Rechercher...",
"search": "Rechercher",
"sorryUnableToGenCode": "Désolé, impossible de générer un code pour {issuerName}",
"noResult": "Aucun résultat",
"addCode": "Ajouter un code",
"scanAQrCode": "Scanner un QR Code",
"enterDetailsManually": "Saisir les détails manuellement",
"edit": "Éditer",
"copiedToClipboard": "Copié dans le presse-papiers",
"error": "Erreur",
"recoveryKeyCopiedToClipboard": "Clé de récupération copiée dans le presse-papiers",
"recoveryKeyOnForgotPassword": "Si vous oubliez votre mot de passe, la seule façon de récupérer vos données sera grâce à cette clé.",
"recoveryKeySaveDescription": "Nous ne stockons pas cette clé, veuillez enregistrer cette clé de 24 mots dans un endroit sûr.",
"doThisLater": "Plus tard",
"saveKey": "Enregistrer la clé",
"createAccount": "Créer un compte",
"passwordStrength": "Force du mot de passe : {passwordStrengthValue}",
"@passwordStrength": {
"description": "Text to indicate the password strength",
"placeholders": {
"passwordStrengthValue": {
"description": "The strength of the password as a string",
"type": "String",
"example": "Weak or Moderate or Strong"
}
},
"message": "Password Strength: {passwordStrengthText}"
},
"password": "Mot de passe",
"signUpTerms": "J'accepte les <u-terms>conditions d'utilisation</u-terms> et la <u-policy>politique de confidentialité</u-policy>",
"privacyPolicyTitle": "Politique de confidentialité",
"termsOfServicesTitle": "Conditions",
"encryption": "Chiffrement",
"ackPasswordLostWarning": "Je comprends que si je perds mon mot de passe, je risque de perdre mes données puisque celles-ci sont <underline>chiffrées de bout en bout</underline>.",
"loginTerms": "En cliquant sur \"Connexion\", j'accepte les <u-terms>conditions d'utilisation</u-terms> et la <u-policy>politique de confidentialité</u-policy>",
"logInLabel": "Connexion",
"logout": "Déconnexion",
"yesLogout": "Oui, se déconnecter",
"exit": "Quitter",
"verifyingRecoveryKey": "Vérification de la clé de récupération...",
"recoveryKeyVerified": "Clé de récupération vérifiée",
"recoveryKeySuccessBody": "Parfait ! Votre clé de récupération est valide. Merci pour la vérification.\n\nN'oubliez pas de garder cette clé de récupération en lieu sûr.",
"invalidRecoveryKey": "La clé de récupération que vous avez saisie n'est pas valide. Assurez-vous qu'elle contient 24 mots et vérifiez l'orthographe de chacun.\n\nSi vous avez entré un ancien code de récupération, assurez-vous qu'il fait 64 caractères de long et vérifiez chacun d'entre eux.",
"recreatePasswordTitle": "Recréer le mot de passe",
"recreatePasswordBody": "L'appareil actuel n'est pas assez puissant pour vérifier votre mot de passe, donc nous avons besoin de le régénérer une fois d'une manière qu'il fonctionne avec tous les périphériques.\n\nVeuillez vous connecter en utilisant votre clé de récupération et régénérer votre mot de passe (vous pouvez utiliser le même si vous le souhaitez).",
"invalidKey": "Clé non valide",
"tryAgain": "Réessayer",
"viewRecoveryKey": "Voir la clé de récupération",
"confirmRecoveryKey": "Confirmer la clé de récupération",
"recoveryKeyVerifyReason": "Votre clé de récupération est la seule façon de récupérer vos photos si vous oubliez votre mot de passe. Vous pouvez trouver votre clé de récupération dans Paramètres > Compte.\n\nVeuillez entrer votre clé de récupération ici pour vous assurer que vous l'avez enregistrée correctement.",
"confirmYourRecoveryKey": "Confirmer la clé de récupération",
"confirm": "Confirmer",
"emailYourLogs": "Envoyez vos logs par e-mail",
"pleaseSendTheLogsTo": "Envoyez les logs à {toEmail}",
"copyEmailAddress": "Copier ladresse e-mail",
"exportLogs": "Exporter les journaux",
"enterYourRecoveryKey": "Entrez votre clé de récupération",
"tempErrorContactSupportIfPersists": "Il semble qu'une erreur s'est produite. Veuillez réessayer après un certain temps. Si l'erreur persiste, veuillez contacter notre équipe d'assistance.",
"itLooksLikeSomethingWentWrongPleaseRetryAfterSome": "Il semble qu'une erreur s'est produite. Veuillez réessayer après un certain temps. Si l'erreur persiste, veuillez contacter notre équipe d'assistance."
}

117
lib/l10n/arb/app_it.arb Normal file
View File

@@ -0,0 +1,117 @@
{
"counterAppBarTitle": "Contatore",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"onBoardingBody": "Proteggi i tuoi codici 2FA",
"onBoardingGetStarted": "Per iniziare",
"setupFirstAccount": "Configura il tuo primo account",
"importScanQrCode": "Scansiona un codice QR",
"importEnterSetupKey": "Inserisci il codice segreto",
"importAccountPageTitle": "Inserisci i dettagli del tuo account",
"codeIssuerHint": "Emittente",
"codeSecretKeyHint": "Codice segreto",
"codeAccountHint": "Account (username@dominio.it)",
"accountKeyType": "Tipo di chiave",
"timeBasedKeyType": "Basata sul tempo (TOTP)",
"counterBasedKeyType": "Basata su contatore (HOTP)",
"saveAction": "Salva",
"nextTotpTitle": "successivo",
"deleteCodeTitle": "Eliminare il codice?",
"deleteCodeMessage": "Sei sicuro di voler rimuovere questo codice? L'azione è irreversibile.",
"viewLogsAction": "Visualizza i log",
"sendLogsDescription": "Invierai i tuoi log per aiutarci a risolvere il tuo problema. Prendiamo precauzioni per garantire che le informazioni sensibili non siano registrate, tuttavia ti invitiamo a leggerli prima di condividerli con noi.",
"preparingLogsTitle": "Preparando i log...",
"emailLogsTitle": "Invia i log per email",
"emailLogsMessage": "Invia i log all'indirizzo {email}",
"@emailLogsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"copyEmailAction": "Copia email",
"exportLogsAction": "Esporta log",
"reportABug": "Segnala un problema",
"crashAndErrorReporting": "Segnalazione degli errori e dei crash",
"reportBug": "Segnala un bug",
"emailUsMessage": "Per favore inviaci un'email a {email}",
"@emailUsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"contactSupport": "Contatta il supporto",
"verifyPassword": "Verifica la password",
"pleaseWait": "Attendere prego...",
"generatingEncryptionKeysTitle": "Generazione delle chiavi di crittografia...",
"recreatePassword": "Crea una nuova password",
"recreatePasswordMessage": "Il tuo dispositivo non è abbastanza potente per verificare la tua password, quindi abbiamo bisogno di rigenerarla in un modo che funziona con tutti i dispositivi. \n\nEffettua il login utilizzando la tua chiave di recupero e rigenera la tua password (puoi utilizzare nuovamente la stessa se vuoi).",
"useRecoveryKey": "Utilizza un codice di recupero",
"incorrectPasswordTitle": "Password sbagliata",
"welcomeBack": "Bentornato!",
"madeWithLoveAtPrefix": "realizzato con ❤️ a ",
"supportDevs": "Iscriviti a <bold-green>ente</bold-green> per supportare questo progetto.",
"supportDiscount": "Utilizzare il codice coupon \"AUTH\" per ottenere il 10% di sconto al primo anno",
"changeEmail": "modifica email",
"ok": "OK",
"cancel": "Annulla",
"yes": "Si",
"no": "No",
"email": "Email",
"support": "Supporto",
"settings": "Impostazioni",
"copied": "Copiato",
"pleaseTryAgain": "Per favore riprova",
"existingUser": "Accedi",
"newUser": "Nuovo utente",
"delete": "Cancella",
"enterYourPasswordHint": "Inserisci la tua password",
"forgotPassword": "Password dimenticata",
"oops": "Oops",
"somethingWentWrongMessage": "Qualcosa è andato storto, per favore riprova",
"leaveFamily": "Abbandona il piano famiglia",
"leaveFamilyMessage": "Sei sicuro di voler uscire dal piano famiglia?",
"inFamilyPlanMessage": "Sei un utente con piano famiglia!",
"swipeHint": "Scorri a sinistra per modificare o rimuovere i codici",
"scan": "Scansiona",
"scanACode": "Scansiona un codice",
"verify": "Verifica",
"enterCodeHint": "Inserisci il codice di 6 cifre dalla tua app di autenticazione",
"lostDeviceTitle": "Dispositivo perso?",
"twoFactorAuthTitle": "Autenticazione a due fattori",
"recoverAccount": "Recupera account",
"enterRecoveryKeyHint": "Inserisci la tua chiave di recupero",
"recover": "Recupera",
"contactSupportViaEmailMessage": "Per favore invia un'email a {email} dal tuo indirizzo email registrato",
"@contactSupportViaEmailMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"noRecoveryKeyTitle": "Nessuna chiave di recupero?",
"enterEmailHint": "Inserisci il tuo indirizzo email",
"invalidEmailTitle": "Indirizzo email non valido",
"invalidEmailMessage": "Inserisci un indirizzo email valido.",
"deleteAccount": "Elimina account",
"deleteAccountQuery": "Ci dispiace vederti andare via. Stai avendo qualche problema?",
"yesSendFeedbackAction": "Sì, invia un feedback",
"noDeleteAccountAction": "No, elimina l'account",
"initiateAccountDeleteTitle": "Si prega di autenticarsi per avviare l'eliminazione dell'account",
"confirmAccountDeleteTitle": "Sei sicuro di voler eliminare il tuo account?",
"confirmAccountDeleteMessage": "I tuoi dati caricati, in tutte le app (sia foto che autenticatore), verranno pianificati per la cancellazione, e il tuo account sarà eliminato in modo permanente.",
"sendEmail": "Invia email",
"createNewAccount": "Crea un nuovo account",
"weakStrength": "Debole",
"strongStrength": "Forte",
"moderateStrength": "Mediocre",
"confirmPassword": "Conferma la password",
"close": "Chiudi",
"oopsSomethingWentWrong": "Oops, qualcosa è andato storto.",
"selectLanguage": "Seleziona lingua"
}

115
lib/l10n/arb/app_nl.arb Normal file
View File

@@ -0,0 +1,115 @@
{
"counterAppBarTitle": "Teller",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"onBoardingBody": "Beveilig je 2FA codes",
"onBoardingGetStarted": "Begin",
"setupFirstAccount": "Maak je account aan",
"importScanQrCode": "Scan een QR-code",
"importEnterSetupKey": "Voer een toegangssleutel in",
"importAccountPageTitle": "Accountgegevens invoeren",
"codeIssuerHint": "Uitgever",
"codeSecretKeyHint": "Geheime code",
"codeAccountHint": "Account (jij@domein.nl)",
"accountKeyType": "Type sleutel",
"timeBasedKeyType": "Tijd gebaseerd (TOTP)",
"counterBasedKeyType": "Teller gebaseerd (HOTP)",
"saveAction": "Opslaan",
"nextTotpTitle": "volgende",
"deleteCodeTitle": "Code verwijderen?",
"deleteCodeMessage": "Weet je zeker dat je deze code wilt verwijderen? Deze actie is onomkeerbaar.",
"viewLogsAction": "Bekijk logs",
"sendLogsDescription": "Dit zal logs verzenden om ons te helpen uw probleem op te lossen. Hoewel we voorzorgsmaatregelen nemen om ervoor te zorgen dat gevoelige informatie niet wordt gedeeld, raden we je aan deze logs te bekijken voordat je ze deelt.",
"preparingLogsTitle": "Klaarmaken...",
"emailLogsTitle": "E-mail logs",
"emailLogsMessage": "Verstuur de logs alsjeblieft naar {email}",
"@emailLogsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"copyEmailAction": "E-mail kopiëren",
"exportLogsAction": "Logs exporteren",
"reportABug": "Een fout melden",
"crashAndErrorReporting": "Crash- en foutrapportage",
"reportBug": "Een fout melden",
"emailUsMessage": "Stuur ons een e-mail op {email}",
"@emailUsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"contactSupport": "Klantenservice",
"verifyPassword": "Bevestig wachtwoord",
"pleaseWait": "Een ogenblik geduld...",
"generatingEncryptionKeysTitle": "Encryptiesleutels genereren...",
"recreatePassword": "Wachtwoord opnieuw instellen",
"recreatePasswordMessage": "Het huidige apparaat is niet krachtig genoeg om je wachtwoord te verifiëren, dus moeten we de code een keer opnieuw genereren op een manier die met alle apparaten werkt.\n\nLog in met behulp van uw herstelcode en genereer opnieuw uw wachtwoord (je kunt dezelfde indien gewenst opnieuw gebruiken).",
"useRecoveryKey": "Herstelcode gebruiken",
"incorrectPasswordTitle": "Onjuist wachtwoord",
"welcomeBack": "Welkom terug!",
"madeWithLoveAtPrefix": "gemaakt met ❤️ door ",
"supportDiscount": "Gebruik couponcode \"AUTH\" om 10% korting te krijgen op het eerste jaar",
"changeEmail": "e-mailadres wijzigen",
"ok": "Oké",
"cancel": "Annuleer",
"yes": "Ja",
"no": "Nee",
"email": "E-mail",
"support": "Ondersteuning",
"settings": "Instellingen",
"copied": "Gekopieerd",
"pleaseTryAgain": "Probeer het nog eens",
"existingUser": "Bestaande gebruiker",
"newUser": "Nieuw bij ente",
"delete": "Verwijderen",
"enterYourPasswordHint": "Voer je wachtwoord in",
"forgotPassword": "Wachtwoord vergeten",
"oops": "Oeps",
"somethingWentWrongMessage": "Er is iets fout gegaan, probeer het opnieuw",
"leaveFamily": "Familie verlaten",
"leaveFamilyMessage": "Weet je zeker dat je het familie-plan wil verlaten?",
"inFamilyPlanMessage": "Je hebt een familie-plan!",
"swipeHint": "Veeg naar links om codes te bewerken of te verwijderen",
"scan": "Scannen",
"scanACode": "Scan een code",
"verify": "Verifiëren",
"enterCodeHint": "Voer de 6-cijferige code van je verificatie-app in",
"lostDeviceTitle": "Apparaat verloren?",
"twoFactorAuthTitle": "Tweestapsverificatie",
"recoverAccount": "Account herstellen",
"enterRecoveryKeyHint": "Voer je herstelcode in",
"recover": "Herstellen",
"contactSupportViaEmailMessage": "Verstuur a.u.b. een e-mail naar {email} van uw geregistreerde e-mailadres",
"@contactSupportViaEmailMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"noRecoveryKeyTitle": "Geen herstelcode?",
"enterEmailHint": "Voer je e-mailadres in",
"invalidEmailTitle": "Ongeldig e-mailadres",
"invalidEmailMessage": "Voer een geldig e-mailadres in.",
"deleteAccount": "Account verwijderen",
"deleteAccountQuery": "We zullen het vervelend vinden om je te zien vertrekken. Zijn er problemen?",
"yesSendFeedbackAction": "Ja, geef feedback",
"noDeleteAccountAction": "Nee, verwijder account",
"initiateAccountDeleteTitle": "Gelieve te verifiëren om het account te verwijderen",
"confirmAccountDeleteTitle": "Weet je zeker dat je je ente account wil verwijderen?",
"confirmAccountDeleteMessage": "Uw geüploade gegevens, in alle apps (Photos en Authenticator), worden ingepland voor verwijdering en uw account zal permanent worden verwijderd.",
"sendEmail": "E-mail versturen",
"createNewAccount": "Nieuw account aanmaken",
"weakStrength": "Zwak",
"strongStrength": "Sterk",
"moderateStrength": "Matig",
"confirmPassword": "Wachtwoord bevestigen",
"close": "Sluiten",
"oopsSomethingWentWrong": "Oeps, er is iets fout gegaan."
}

1
lib/l10n/arb/app_pt.arb Normal file
View File

@@ -0,0 +1 @@
{}

115
lib/l10n/arb/app_ru.arb Normal file
View File

@@ -0,0 +1,115 @@
{
"counterAppBarTitle": "Счетчик",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"onBoardingBody": "Защитите ваши 2FA коды",
"onBoardingGetStarted": "Начать",
"setupFirstAccount": "Настройте свой первый аккаунт",
"importScanQrCode": "Сканировать QR-код",
"importEnterSetupKey": "Введите ключ установки",
"importAccountPageTitle": "Введите данные аккаунта",
"codeIssuerHint": "Эмитент",
"codeSecretKeyHint": "Секретный ключ",
"codeAccountHint": "Аккаунт (you@domain.com)",
"accountKeyType": "Тип ключа",
"timeBasedKeyType": "Основанный на времени (TOTP)",
"counterBasedKeyType": "На основе счётчиков (HOTP)",
"saveAction": "Сохранить",
"nextTotpTitle": "далее",
"deleteCodeTitle": "Удалить код?",
"deleteCodeMessage": "Вы уверены, что хотите удалить этот код? Это действие необратимо.",
"viewLogsAction": "Посмотреть журнал",
"sendLogsDescription": "Это отправит все журналы, чтобы помочь нам отладить вашу проблему. Хотя мы принимаем меры предосторожности, чтобы конфиденциальная информация не регистрировалась, мы рекомендуем вам просмотреть эти журналы, прежде чем делиться ими.",
"preparingLogsTitle": "Подготовка журналов...",
"emailLogsTitle": "Отправляйте журналы по электронной почте",
"emailLogsMessage": "Пожалуйста, отправьте журналы на {email}",
"@emailLogsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"copyEmailAction": "Скопировать адрес",
"exportLogsAction": "Экспорт журналов",
"reportABug": "Сообщить об ошибке",
"crashAndErrorReporting": "Отчёт об ошибках",
"reportBug": "Сообщить об ошибке",
"emailUsMessage": "Пожалуйста, напишите нам на {email}",
"@emailUsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"contactSupport": "Связаться с поддержкой",
"verifyPassword": "Подтверждение пароля",
"pleaseWait": "Пожалуйста, подождите...",
"generatingEncryptionKeysTitle": "Генерируем ключи шифрования...",
"recreatePassword": "Воссоздать пароль заново",
"recreatePasswordMessage": "Текущее устройство недостаточно мощное для проверки пароля, поэтому нам нужно регенерировать его один раз таким образом, чтобы работать со всеми устройствами. \n\nПожалуйста, войдите, используя ваш ключ восстановления и сгенерируйте ваш пароль (вы можете использовать тот же самый, если пожелаете).",
"useRecoveryKey": "Использовать ключ восстановления",
"incorrectPasswordTitle": "Неправильный пароль",
"welcomeBack": "С возвращением!",
"madeWithLoveAtPrefix": "сделана с ❤️ в ",
"supportDevs": "Подпишитесь на <bold-green>ente</bold-green> для поддержки этого проекта.",
"supportDiscount": "Используйте код скидки \"AUTH\", чтобы получить скидку 10% в первый год",
"changeEmail": "изменить почту",
"cancel": "Отменить",
"yes": "Да",
"no": "Нет",
"email": "Электронная почта",
"support": "Поддержка",
"settings": "Настройки",
"copied": "Скопировано",
"pleaseTryAgain": "Пожалуйста, попробуйте ещё раз",
"existingUser": "Существующий пользователь",
"newUser": "Новый аккаунт",
"delete": "Удалить",
"enterYourPasswordHint": "Введите пароль",
"forgotPassword": "Забыл пароль",
"oops": "Ой",
"somethingWentWrongMessage": "Что-то пошло не так. Попробуйте еще раз",
"leaveFamily": "Покинуть семью",
"leaveFamilyMessage": "Вы уверены, что хотите отказаться от семейного плана?",
"inFamilyPlanMessage": "Вы на семейном плане!",
"swipeHint": "Проведите пальцем влево, чтобы отредактировать или удалить коды",
"scan": "Сканировать",
"scanACode": "Сканировать QR-код",
"verify": "Подтвердить",
"enterCodeHint": "Введите 6-значный код из\nвашего приложения-аутентификатора",
"lostDeviceTitle": "Потеряно устройство?",
"twoFactorAuthTitle": "Двухфакторная аутентификация",
"recoverAccount": "Восстановить аккаунт",
"enterRecoveryKeyHint": "Введите свой ключ восстановления",
"recover": "Восстановить",
"contactSupportViaEmailMessage": "Пожалуйста, отправьте электронное письмо на адрес {email} с вашего зарегистрированного адреса электронной почты",
"@contactSupportViaEmailMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"noRecoveryKeyTitle": "Нет ключа восстановления?",
"enterEmailHint": "Введите свою почту",
"invalidEmailTitle": "Неверный адрес электронной почты",
"invalidEmailMessage": "Пожалуйста, введите действительный адрес электронной почты.",
"deleteAccount": "Удалить аккаунт",
"deleteAccountQuery": "Нам будет жаль, если вы уйдете. Вы столкнулись с какой-то проблемой?",
"yesSendFeedbackAction": "Да, отправить отзыв",
"noDeleteAccountAction": "Нет, удалить аккаунт",
"initiateAccountDeleteTitle": "Пожалуйста, авторизуйтесь, чтобы начать удаление аккаунта",
"confirmAccountDeleteTitle": "Вы уверены, что хотите удалить ваш аккаунт ente?",
"confirmAccountDeleteMessage": "Ваши загруженные данные во всех приложениях (как фотографии, так и средство аутентификации) будут запланированы к удалению, а ваш аккаунт будет удален безвозвратно.",
"sendEmail": "Отправить электронное письмо",
"createNewAccount": "Создать новый аккаунт",
"weakStrength": "Слабый",
"strongStrength": "Крепкий",
"moderateStrength": "Средний",
"confirmPassword": "Подтвердить пароль",
"close": "Закрыть",
"oopsSomethingWentWrong": "Ой, что-то пошло не так."
}

122
lib/l10n/arb/app_tr.arb Normal file
View File

@@ -0,0 +1,122 @@
{
"counterAppBarTitle": "Sayaç",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"onBoardingBody": "2 faktörlü kimlik doğrulama kodlarınızı koruyun",
"onBoardingGetStarted": "Başlayın",
"setupFirstAccount": "İlk hesabınızı ekleyin",
"importScanQrCode": "Karekodu tara",
"importEnterSetupKey": "Kurulum anahtarını giriniz",
"importAccountPageTitle": "Hesap bilgilerinizi girin",
"codeIssuerHint": "Yayınlayan",
"codeSecretKeyHint": "Gizli Anahtar",
"codeAccountHint": "Hesap (örnek@domain.com)",
"accountKeyType": "Anahtar türü",
"sessionExpired": "Oturum süresi doldu",
"@sessionExpired": {
"description": "Title of the dialog when the users current session is invalid/expired"
},
"pleaseLoginAgain": "Lütfen tekrar giriş yapın",
"loggingOut": "Çıkış yapılıyor...",
"timeBasedKeyType": "Zaman tabanlı (TOTP)",
"counterBasedKeyType": "Sayaç tabanlı (HOTP)",
"saveAction": "Kaydet",
"nextTotpTitle": "ileri",
"deleteCodeTitle": "Kodu silmek istiyor musunuz?",
"deleteCodeMessage": "Bu kodu silmek istediğinize emin misiniz? Bu geri alınamaz bir işlemdir.",
"viewLogsAction": "Günlüğü görüntüle",
"sendLogsDescription": "Günlüğünüz hatanızı çözmemize yardımcı olacaktır. Hassas bilginin kaydedilmediğine dikkat etsek de bu günlükleri paylaşmadan önce kontrol etmenizi isteriz.",
"preparingLogsTitle": "Günlük hazırlanıyor...",
"emailLogsTitle": "E-postaların Günlüğü",
"emailLogsMessage": "Lütfen günlüğünüzü {email} adresine gönderin",
"@emailLogsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"copyEmailAction": "E-postayı Kopyala",
"exportLogsAction": "Günlüğü dışa aktar",
"reportABug": "Bir hata bildir",
"crashAndErrorReporting": "Çökme ve hata bildirimi",
"reportBug": "Hata bildir",
"emailUsMessage": "Lütfen bize {email} adresinden ulaşın",
"@emailUsMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"contactSupport": "Destek ekibiyle iletişime geçin",
"verifyPassword": "Şifreyi doğrulayın",
"pleaseWait": "Lütfen bekleyin...",
"generatingEncryptionKeysTitle": "Şifreleme anahtarları üretiliyor...",
"recreatePassword": "Şifreyi yeniden oluştur",
"recreatePasswordMessage": "Bu cihaz, şifrenizi doğrulayabilecek kadar güçlü değil, bu sebeple şifreyi her cihazda çalışabilecek bir yolla oluşturmamız gerekiyor.\n\nLütfen kurtarma anahtarınızla giriş yapın ve şifrenizi tekrar oluşturun (dilerseniz aynı şifreyi kullanabilirsiniz).",
"useRecoveryKey": "Kurtarma anahtarını kullan",
"incorrectPasswordTitle": "Yanlış şifre",
"welcomeBack": "Tekrar hoş geldiniz!",
"madeWithLoveAtPrefix": "❤️ ile yapılmıştır ",
"supportDevs": "Bu projeyi desteklemek için <bold-green>ente</bold-green> kanalına abone olun.",
"supportDiscount": "İlk yılda %10 indirim için \"AUTH\" kupon kodunu kullanın",
"changeEmail": "E-postayı değiştir",
"ok": "Tamam",
"cancel": "İptal Et",
"yes": "Evet",
"no": "Hayır",
"email": "E-Posta",
"support": "Destek",
"settings": "Ayarlar",
"copied": "Kopyalandı",
"pleaseTryAgain": "Lütfen tekrar deneyin",
"existingUser": "Mevcut kullanıcı",
"newUser": "Yeni ente kullanıcısı",
"delete": "Sil",
"enterYourPasswordHint": "Parolanızı girin",
"forgotPassword": "Şifremi unuttum",
"oops": "Hay aksi",
"somethingWentWrongMessage": "Bir şeyler ters gitti, lütfen tekrar deneyin",
"leaveFamily": "Aile planından ayrıl",
"leaveFamilyMessage": "Aile planından ayrılmak istediğinize emin misiniz?",
"inFamilyPlanMessage": "Aile planı kullanıyorsunuz!",
"swipeHint": "Kodları düzenlemek ya da kaldırmak için sola kaydırın",
"scan": "Tara",
"scanACode": "Bir kodu tarayın",
"verify": "Doğrula",
"enterCodeHint": "Kimlik doğrulayıcı uygulamanızdaki 6 haneli doğrulama kodunu girin",
"lostDeviceTitle": "Cihazınızı mı kaybettiniz?",
"twoFactorAuthTitle": "İki faktörlü kimlik doğrulama",
"recoverAccount": "Hesap kurtarma",
"enterRecoveryKeyHint": "Kurtarma anahtarınızı girin",
"recover": "Kurtar",
"contactSupportViaEmailMessage": "Lütfen kayıtlı e-posta adresinizden {email} adresine e-posta gönderin",
"@contactSupportViaEmailMessage": {
"placeholders": {
"email": {
"type": "String"
}
}
},
"noRecoveryKeyTitle": "Kurtarma anahtarınız yok mu?",
"enterEmailHint": "E-posta adresinizi girin",
"invalidEmailTitle": "Geçersiz e-posta adresi",
"invalidEmailMessage": "Lütfen geçerli bir e-posta adresi girin.",
"deleteAccount": "Hesabı sil",
"deleteAccountQuery": "Sizin gitmenizi görmekten üzüleceğiz. Bazı problemlerle mi karşılaşıyorsunuz?",
"yesSendFeedbackAction": "Evet, geri bildirimi gönder",
"noDeleteAccountAction": "Hayır, hesabı sil",
"initiateAccountDeleteTitle": "Hesap silme işlemini yapabilmek için lütfen kimliğinizi doğrulayın",
"confirmAccountDeleteTitle": "ente hesabınızı silmek istediğinizden emin misiniz?",
"confirmAccountDeleteMessage": "Tüm uygulamalarda (Fotoğraflar ve Kimlik doğrulayıcı) kaydedilen verileriniz zamanlı silinmeye ayarlanacak ve hesabınız kalıcı olarak silinecektir.",
"sendEmail": "E-posta gönder",
"createNewAccount": "Yeni hesap oluşturun",
"weakStrength": "Zayıf",
"strongStrength": "Güçlü",
"moderateStrength": "Orta",
"confirmPassword": "Şifreyi onayla",
"close": "Kapat",
"oopsSomethingWentWrong": "Hay aksi, bir sorun oluştu."
}

1
lib/l10n/arb/app_zh.arb Normal file
View File

@@ -0,0 +1 @@
{}

40
lib/locale.dart Normal file
View File

@@ -0,0 +1,40 @@
import 'package:flutter/cupertino.dart';
import 'package:shared_preferences/shared_preferences.dart';
// list of locales which are enabled for auth app.
// Add more language to the list only when at least 90% of the strings are
// translated in the corresponding language.
const List<Locale> appSupportedLocales = <Locale>[
Locale('en'),
Locale('es'),
Locale('fr'),
];
Locale localResolutionCallBack(locales, supportedLocales) {
// print call stacktrace to identify caller
for (Locale locale in locales) {
if (appSupportedLocales.contains(locale)) {
return locale;
}
}
// if device language is not supported by the app, use en as default
return const Locale('en');
}
Future<Locale> getLocale() async {
final String? savedLocale =
(await SharedPreferences.getInstance()).getString('locale');
if (savedLocale != null &&
appSupportedLocales.contains(Locale(savedLocale))) {
return Locale(savedLocale);
}
return const Locale('en');
}
Future<void> setLocale(Locale locale) async {
if (!appSupportedLocales.contains(locale)) {
throw Exception('Locale $locale is not supported by the app');
}
await (await SharedPreferences.getInstance())
.setString('locale', locale.languageCode);
}

View File

@@ -1,13 +1,15 @@
// @dart=2.9
import 'package:adaptive_theme/adaptive_theme.dart';
import "package:ente_auth/app/view/app.dart";
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/core/constants.dart';
import 'package:ente_auth/core/logging/super_logging.dart';
import 'package:ente_auth/core/network.dart';
import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/locale.dart';
import 'package:ente_auth/services/authenticator_service.dart';
import 'package:ente_auth/services/billing_service.dart';
import 'package:ente_auth/services/notification_service.dart';
import 'package:ente_auth/services/preference_service.dart';
import 'package:ente_auth/services/update_service.dart';
import 'package:ente_auth/services/user_remote_flag_service.dart';
import 'package:ente_auth/services/user_service.dart';
@@ -16,7 +18,6 @@ import 'package:ente_auth/ui/tools/app_lock.dart';
import 'package:ente_auth/ui/tools/lock_screen.dart';
import 'package:ente_auth/utils/crypto_util.dart';
import "package:flutter/material.dart";
import 'package:in_app_purchase/in_app_purchase.dart';
import 'package:logging/logging.dart';
import 'package:path_provider/path_provider.dart';
@@ -24,26 +25,37 @@ final _logger = Logger("main");
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await _runInForeground();
final savedThemeMode = await AdaptiveTheme.getThemeMode();
await _runInForeground(savedThemeMode);
}
Future<void> _runInForeground() async {
Future<void> _runInForeground(AdaptiveThemeMode? savedThemeMode) async {
return await _runWithLogs(() async {
_logger.info("Starting app in foreground");
await _init(false, via: 'mainMethod');
final Locale locale = await getLocale();
UpdateService.instance.showUpdateNotification();
runApp(
AppLock(
builder: (args) => const App(),
builder: (args) => App(locale: locale),
lockScreen: const LockScreen(),
enabled: Configuration.instance.shouldShowLockScreen(),
locale: locale,
lightTheme: lightThemeData,
darkTheme: darkThemeData,
savedThemeMode: _themeMode(savedThemeMode),
),
);
});
}
ThemeMode _themeMode(AdaptiveThemeMode? savedThemeMode) {
if (savedThemeMode == null) return ThemeMode.system;
if (savedThemeMode.isLight) return ThemeMode.light;
if (savedThemeMode.isDark) return ThemeMode.dark;
return ThemeMode.system;
}
Future _runWithLogs(Function() function, {String prefix = ""}) async {
await SuperLogging.main(
LogConfig(
@@ -51,16 +63,15 @@ Future _runWithLogs(Function() function, {String prefix = ""}) async {
logDirPath: (await getApplicationSupportDirectory()).path + "/logs",
maxLogFiles: 5,
sentryDsn: sentryDSN,
tunnel: sentryTunnel,
enableInDebugMode: true,
prefix: prefix,
),
);
}
Future<void> _init(bool bool, {String via}) async {
InAppPurchaseConnection.enablePendingPurchases();
Future<void> _init(bool bool, {String? via}) async {
CryptoUtil.init();
await PreferenceService.instance.init();
await CodeStore.instance.init();
await Configuration.instance.init();
await Network.instance.init();

View File

@@ -0,0 +1,7 @@
class EntityResult {
final int generatedID;
final String rawData;
final bool hasSynced;
EntityResult(this.generatedID, this.rawData, this.hasSynced);
}

View File

@@ -5,15 +5,18 @@ import 'package:flutter/material.dart';
@immutable
class LocalAuthEntity {
final int generatedID;
// id can be null if a code has been scanned locally but it's yet to be
// synced with the remote server.
final String? id;
final String encryptedData;
final String header;
// createdAt and updateAt will be equal to local time of creation or updation
// till remote sync is completed.
final int createdAt;
final int updatedAt;
// shouldSync indicates that the entry was locally created or updated. The
// app should try to sync it to the server during next sync
final bool shouldSync;

View File

@@ -4,7 +4,7 @@ class Code {
static const defaultDigits = 6;
static const defaultPeriod = 30;
int? id;
int? generatedID;
final String account;
final String issuer;
final int digits;
@@ -13,6 +13,7 @@ class Code {
final Algorithm algorithm;
final Type type;
final String rawData;
bool? hasSynced;
Code(
this.account,
@@ -23,25 +24,29 @@ class Code {
this.algorithm,
this.type,
this.rawData, {
this.id,
this.generatedID,
});
static Code fromAccountAndSecret(String account, String secret) {
static Code fromAccountAndSecret(
String account,
String issuer,
String secret,
) {
return Code(
account,
"",
issuer,
defaultDigits,
defaultPeriod,
secret,
Algorithm.sha1,
Type.totp,
"otpauth://totp/" +
account +
issuer +
":" +
account +
"?algorithm=SHA1&digits=6&issuer=" +
account +
"period=30&secret=" +
issuer +
"&period=30&secret=" +
secret,
);
}
@@ -62,7 +67,16 @@ class Code {
static String _getAccount(Uri uri) {
try {
return uri.path.split(':')[1];
String path = Uri.decodeComponent(uri.path);
if (path.startsWith("/")) {
path = path.substring(1, path.length);
}
// Parse account name from documented auth URI
// otpauth://totp/ACCOUNT?secret=SUPERSECRET&issuer=SERVICE
if (uri.queryParameters.containsKey("issuer") && !path.contains(":")) {
return path;
}
return path.split(':')[1];
} catch (e) {
return "";
}
@@ -70,7 +84,17 @@ class Code {
static String _getIssuer(Uri uri) {
try {
return uri.path.split(':')[0].substring(1);
if (uri.queryParameters.containsKey("issuer")) {
String issuerName = uri.queryParameters['issuer']!;
// Handle issuer name with period
// See https://github.com/ente-io/auth/pull/77
if (issuerName.contains("period=")) {
return issuerName.substring(0, issuerName.indexOf("period="));
}
return issuerName;
}
final String path = Uri.decodeComponent(uri.path);
return path.split(':')[0].substring(1);
} catch (e) {
return "";
}
@@ -108,7 +132,12 @@ class Code {
}
static Type _getType(Uri uri) {
return uri.host == "totp" ? Type.totp : Type.hotp;
if (uri.host == "totp") {
return Type.totp;
} else if (uri.host == "hotp") {
return Type.hotp;
}
throw UnsupportedError("Unsupported format with host ${uri.host}");
}
@override

View File

@@ -0,0 +1,6 @@
enum ExecutionState {
idle,
inProgress,
error,
successful
}

7
lib/models/typedefs.dart Normal file
View File

@@ -0,0 +1,7 @@
import 'dart:async';
typedef FutureVoidCallback = Future<void> Function();
typedef BoolCallBack = bool Function();
typedef FutureVoidCallbackParamStr = Future<void> Function(String);
typedef VoidCallbackParamStr = void Function(String);
typedef FutureOrVoidCallback = FutureOr<void> Function();

View File

@@ -1,14 +1,24 @@
// ignore_for_file: import_of_legacy_library_into_null_safe
import 'dart:async';
import 'package:ente_auth/app/view/app.dart';
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/core/event_bus.dart';
import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/events/trigger_logout_event.dart';
import "package:ente_auth/l10n/l10n.dart";
import 'package:ente_auth/locale.dart';
import 'package:ente_auth/ui/account/email_entry_page.dart';
import 'package:ente_auth/ui/account/login_page.dart';
import 'package:ente_auth/ui/account/logout_dialog.dart';
import 'package:ente_auth/ui/account/password_entry_page.dart';
import 'package:ente_auth/ui/account/password_reentry_page.dart';
import 'package:ente_auth/ui/common/gradient_button.dart';
import 'package:ente_auth/ui/home_page.dart';
import 'package:ente_auth/ui/settings/language_picker.dart';
import 'package:ente_auth/utils/navigation_util.dart';
import 'package:flutter/foundation.dart';
import "package:flutter/material.dart";
class OnboardingPage extends StatefulWidget {
@@ -19,6 +29,23 @@ class OnboardingPage extends StatefulWidget {
}
class _OnboardingPageState extends State<OnboardingPage> {
late StreamSubscription<TriggerLogoutEvent> _triggerLogoutEvent;
@override
void initState() {
_triggerLogoutEvent =
Bus.instance.on<TriggerLogoutEvent>().listen((event) async {
await autoLogoutAlert(context);
});
super.initState();
}
@override
void dispose() {
_triggerLogoutEvent.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
debugPrint("Building OnboardingPage");
@@ -37,6 +64,30 @@ class _OnboardingPageState extends State<OnboardingPage> {
children: [
Column(
children: [
kDebugMode
? GestureDetector(
child: const Align(
alignment: Alignment.topRight,
child: Text("Lang"),
),
onTap: () async {
final locale = await getLocale();
routeToPage(
context,
LanguageSelectorPage(
appSupportedLocales,
(locale) async {
await setLocale(locale);
App.setLocale(context, locale);
},
locale,
),
).then((value) {
setState(() {});
});
},
)
: const SizedBox(),
Image.asset(
"assets/sheild-front-gradient.png",
width: 200,

View File

@@ -1,11 +1,14 @@
import "package:ente_auth/l10n/l10n.dart";
import 'package:ente_auth/models/code.dart';
// ignore: import_of_legacy_library_into_null_safe
import 'package:ente_auth/utils/dialog_util.dart';
import 'package:ente_auth/utils/totp_util.dart';
import "package:flutter/material.dart";
class SetupEnterSecretKeyPage extends StatefulWidget {
SetupEnterSecretKeyPage({Key? key}) : super(key: key);
final Code? code;
SetupEnterSecretKeyPage({this.code, Key? key}) : super(key: key);
@override
State<SetupEnterSecretKeyPage> createState() =>
@@ -13,8 +16,27 @@ class SetupEnterSecretKeyPage extends StatefulWidget {
}
class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
final _accountController = TextEditingController();
final _secretController = TextEditingController(text: "");
late TextEditingController _issuerController;
late TextEditingController _accountController;
late TextEditingController _secretController;
@override
void initState() {
_issuerController = TextEditingController(
text: widget.code != null
? Uri.decodeFull(widget.code!.issuer).trim()
: null,
);
_accountController = TextEditingController(
text: widget.code != null
? Uri.decodeFull(widget.code!.account).trim()
: null,
);
_secretController = TextEditingController(
text: widget.code != null ? widget.code!.secret : null,
);
super.initState();
}
@override
Widget build(BuildContext context) {
@@ -38,9 +60,9 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
return null;
},
decoration: InputDecoration(
hintText: l10n.accountNameHint,
hintText: l10n.codeIssuerHint,
),
controller: _accountController,
controller: _issuerController,
autofocus: true,
),
const SizedBox(
@@ -55,10 +77,26 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
return null;
},
decoration: InputDecoration(
hintText: l10n.accountKeyHint,
hintText: l10n.codeSecretKeyHint,
),
controller: _secretController,
),
const SizedBox(
height: 20,
),
TextFormField(
// The validator receives the text that the user has entered.
validator: (value) {
if (value == null || value.isEmpty) {
return "Please enter some text";
}
return null;
},
decoration: InputDecoration(
hintText: l10n.codeAccountHint,
),
controller: _accountController,
),
const SizedBox(
height: 40,
),
@@ -66,18 +104,29 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
width: 400,
child: OutlinedButton(
onPressed: () {
if (_accountController.text.trim().isEmpty ||
if ((_accountController.text.trim().isEmpty &&
_issuerController.text.trim().isEmpty) ||
_secretController.text.trim().isEmpty) {
_showIncorrectDetailsDialog(context);
String message;
if (_secretController.text.trim().isEmpty) {
message = "Secret can not be empty";
} else {
message = "Both account and issuer can not be empty";
}
_showIncorrectDetailsDialog(context, message: message);
return;
}
try {
final code = Code.fromAccountAndSecret(
_accountController.text.trim(),
_secretController.text.trim(),
_issuerController.text.trim(),
_secretController.text.trim().replaceAll(' ', ''),
);
// Verify the validity of the code
getTotp(code);
if (widget.code != null) {
code.generatedID = widget.code!.generatedID;
}
Navigator.of(context).pop(code);
} catch (e) {
_showIncorrectDetailsDialog(context);
@@ -88,7 +137,7 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
horizontal: 16.0,
vertical: 4,
),
child: Text(l10n.importAddAction),
child: Text(l10n.saveAction),
),
),
)
@@ -100,11 +149,14 @@ class _SetupEnterSecretKeyPageState extends State<SetupEnterSecretKeyPage> {
);
}
void _showIncorrectDetailsDialog(BuildContext context) {
void _showIncorrectDetailsDialog(
BuildContext context, {
String message = "Please verify the entered details",
}) {
showErrorDialog(
context,
"Incorrect details",
"Please verify the entered details",
message,
);
}
}

View File

@@ -8,9 +8,11 @@ import 'package:ente_auth/core/event_bus.dart';
import 'package:ente_auth/core/network.dart';
import 'package:ente_auth/events/codes_updated_event.dart';
import 'package:ente_auth/events/signed_in_event.dart';
import 'package:ente_auth/events/trigger_logout_event.dart';
import 'package:ente_auth/gateway/authenticator.dart';
import 'package:ente_auth/models/authenticator/auth_entity.dart';
import 'package:ente_auth/models/authenticator/auth_key.dart';
import 'package:ente_auth/models/authenticator/entity_result.dart';
import 'package:ente_auth/models/authenticator/local_auth_entity.dart';
import 'package:ente_auth/store/authenticator_db.dart';
import 'package:ente_auth/utils/crypto_util.dart';
@@ -44,22 +46,33 @@ class AuthenticatorService {
});
}
Future<Map<int, String>> getAllIDtoStringMap() async {
Future<List<EntityResult>> getEntities() async {
final List<LocalAuthEntity> result = await _db.getAll();
final Map<int, String> entries = <int, String>{};
final List<EntityResult> entities = [];
if (result.isEmpty) {
return entries;
return entities;
}
final key = await getOrCreateAuthDataKey();
for (LocalAuthEntity e in result) {
final decryptedValue = await CryptoUtil.decryptChaCha(
Sodium.base642bin(e.encryptedData),
key,
Sodium.base642bin(e.header),
);
entries[e.generatedID] = utf8.decode(decryptedValue);
try {
final decryptedValue = await CryptoUtil.decryptChaCha(
Sodium.base642bin(e.encryptedData),
key,
Sodium.base642bin(e.header),
);
final hasSynced = !(e.id == null || e.shouldSync);
entities.add(
EntityResult(
e.generatedID,
utf8.decode(decryptedValue),
hasSynced,
),
);
} catch (e, s) {
_logger.severe(e, s);
}
}
return entries;
return entities;
}
Future<int> addEntry(String plainText, bool shouldSync) async {
@@ -77,7 +90,11 @@ class AuthenticatorService {
return insertedID;
}
Future<void> updateEntry(int generatedID, String plainText) async {
Future<void> updateEntry(
int generatedID,
String plainText,
bool shouldSync,
) async {
var key = await getOrCreateAuthDataKey();
final encryptedKeyData = await CryptoUtil.encryptChaCha(
utf8.encode(plainText) as Uint8List,
@@ -91,7 +108,9 @@ class AuthenticatorService {
affectedRows == 1,
"updateEntry should have updated exactly one row",
);
unawaited(sync());
if (shouldSync) {
unawaited(sync());
}
}
Future<void> deleteEntry(int genID) async {
@@ -109,17 +128,18 @@ class AuthenticatorService {
Future<void> sync() async {
try {
_logger.info("Sync");
_logger.info("State of DB before sync");
await _printDBState();
await _remoteToLocalSync();
_logger.info("remote fetch completed");
_logger.info("State of DB after remoteToLocal sync");
await _printDBState();
await _localToRemoteSync();
_logger.info("State of DB after localToRemote sync");
await _printDBState();
_logger.info("local push completed");
Bus.instance.fire(CodesUpdatedEvent());
} on UnauthorizedError {
if ((await _db.removeSyncedData()) > 0) {
Bus.instance.fire(CodesUpdatedEvent());
}
debugPrint("Firing logout event");
Bus.instance.fire(TriggerLogoutEvent());
} catch (e) {
_logger.severe("Failed to sync with remote", e);
}
@@ -128,24 +148,27 @@ class AuthenticatorService {
Future<void> _remoteToLocalSync() async {
_logger.info('Initiating remote to local sync');
final int lastSyncTime = _prefs.getInt(_lastEntitySyncTime) ?? 0;
_logger.info("Current sync is " + lastSyncTime.toString());
const int fetchLimit = 500;
final List<AuthEntity> result =
await _gateway.getDiff(lastSyncTime, limit: fetchLimit);
_logger.info(result.length.toString() + " entries fetched from remote");
if (result.isEmpty) {
return;
} else {
_logger.info(result.length.toString() + " entries fetched from remote");
}
final maxSyncTime = result.map((e) => e.updatedAt).reduce(max);
List<String> deletedIDs =
result.where((element) => element.isDeleted).map((e) => e.id).toList();
_logger.info(deletedIDs.length.toString() + " entries deleted");
result.removeWhere((element) => element.isDeleted);
await _db.insertOrReplace(result);
if (deletedIDs.isNotEmpty) {
await _db.deleteByIDs(ids: deletedIDs);
}
_prefs.setInt(_lastEntitySyncTime, maxSyncTime);
_logger.info("Setting synctime to " + maxSyncTime.toString());
if (result.length == fetchLimit) {
_logger.info("Diff limit reached, pulling again");
await _remoteToLocalSync();
}
}
@@ -180,6 +203,10 @@ class AuthenticatorService {
await _db.updateLocalEntity(entity.copyWith(shouldSync: false));
}
}
if (pendingUpdate.isNotEmpty) {
_logger.info("Initiating remote sync since local entries were pushed");
await _remoteToLocalSync();
}
}
Future<Uint8List> getOrCreateAuthDataKey() async {
@@ -210,13 +237,4 @@ class AuthenticatorService {
rethrow;
}
}
Future<void> _printDBState() async {
_logger.info("_____");
final entities = await _db.getAll();
for (final entity in entities) {
_logger.info(entity.id);
}
_logger.info("_____");
}
}

View File

@@ -1,5 +1,3 @@
// @dart=2.9
import 'dart:io';
import 'package:dio/dio.dart';
@@ -8,7 +6,6 @@ import 'package:ente_auth/core/errors.dart';
import 'package:ente_auth/core/network.dart';
import 'package:ente_auth/models/billing_plan.dart';
import 'package:ente_auth/models/subscription.dart';
import 'package:in_app_purchase/in_app_purchase.dart';
import 'package:logging/logging.dart';
const kWebPaymentRedirectUrl = "https://payments.ente.io/frameRedirect";
@@ -33,37 +30,11 @@ class BillingService {
bool _isOnSubscriptionPage = false;
Future<BillingPlans> _future;
Subscription? _cachedSubscription;
Future<void> init() async {
if (Platform.isAndroid || Platform.isIOS) {
InAppPurchaseConnection.enablePendingPurchases();
// if (Platform.isIOS && kDebugMode) {
// await FlutterInappPurchase.instance.initConnection;
// FlutterInappPurchase.instance.clearTransactionIOS();
// }
InAppPurchaseConnection.instance.purchaseUpdatedStream
.listen((purchases) {
if (_isOnSubscriptionPage) {
return;
}
for (final purchase in purchases) {
if (purchase.status == PurchaseStatus.purchased) {
verifySubscription(
purchase.productID,
purchase.verificationData.serverVerificationData,
).then((response) {
if (response != null) {
InAppPurchaseConnection.instance.completePurchase(purchase);
}
});
} else if (Platform.isIOS && purchase.pendingCompletePurchase) {
InAppPurchaseConnection.instance.completePurchase(purchase);
}
}
});
}
}
Future<BillingPlans>? _future;
Future<void> init() async {}
void clearCache() {
_future = null;
@@ -76,7 +47,7 @@ class BillingService {
.then((response) {
return BillingPlans.fromMap(response.data);
});
return _future;
return _future!;
}
Future<Response<dynamic>> _fetchPrivateBillingPlans() {
@@ -116,7 +87,7 @@ class BillingService {
);
return Subscription.fromMap(response.data["subscription"]);
} on DioError catch (e) {
if (e.response != null && e.response.statusCode == 409) {
if (e.response != null && e.response!.statusCode == 409) {
throw SubscriptionAlreadyClaimedError();
} else {
rethrow;
@@ -127,22 +98,25 @@ class BillingService {
}
}
Future<Subscription> fetchSubscription() async {
try {
final response = await _dio.get(
_config.getHttpEndpoint() + "/billing/subscription",
options: Options(
headers: {
"X-Auth-Token": _config.getToken(),
},
),
);
final subscription = Subscription.fromMap(response.data["subscription"]);
return subscription;
} on DioError catch (e, s) {
_logger.severe(e, s);
rethrow;
Future<Subscription> getSubscription() async {
if (_cachedSubscription == null) {
try {
final response = await _dio.get(
_config.getHttpEndpoint() + "/billing/subscription",
options: Options(
headers: {
"X-Auth-Token": _config.getToken(),
},
),
);
_cachedSubscription =
Subscription.fromMap(response.data["subscription"]);
} on DioError catch (e, s) {
_logger.severe(e, s);
rethrow;
}
}
return _cachedSubscription!;
}
Future<Subscription> cancelStripeSubscription() async {

View File

@@ -1,4 +1,4 @@
// @dart=2.9
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/ui/tools/app_lock.dart';
@@ -18,9 +18,9 @@ class LocalAuthenticationService {
String infoMessage,
) async {
if (await _isLocalAuthSupportedOnDevice()) {
AppLock.of(context).setEnabled(false);
AppLock.of(context)!.setEnabled(false);
final result = await requestAuthentication(infoMessage);
AppLock.of(context).setEnabled(
AppLock.of(context)!.setEnabled(
Configuration.instance.shouldShowLockScreen(),
);
if (!result) {
@@ -41,17 +41,17 @@ class LocalAuthenticationService {
String errorDialogTitle = "",
]) async {
if (await LocalAuthentication().isDeviceSupported()) {
AppLock.of(context).disable();
AppLock.of(context)!.disable();
final result = await requestAuthentication(
infoMessage,
);
if (result) {
AppLock.of(context).setEnabled(shouldEnableLockScreen);
AppLock.of(context)!.setEnabled(shouldEnableLockScreen);
await Configuration.instance
.setShouldShowLockScreen(shouldEnableLockScreen);
return true;
} else {
AppLock.of(context)
AppLock.of(context)!
.setEnabled(Configuration.instance.shouldShowLockScreen());
}
} else {

View File

@@ -0,0 +1,27 @@
import 'package:shared_preferences/shared_preferences.dart';
class PreferenceService {
PreferenceService._privateConstructor();
static final PreferenceService instance =
PreferenceService._privateConstructor();
late final SharedPreferences _prefs;
static const kHasShownCoachMarkKey = "has_shown_coach_mark";
Future<void> init() async {
_prefs = await SharedPreferences.getInstance();
}
bool hasShownCoachMark() {
if (_prefs.containsKey(kHasShownCoachMarkKey)) {
return _prefs.getBool(kHasShownCoachMarkKey)!;
} else {
return false;
}
}
Future<void> setHasShownCoachMark(bool value) {
return _prefs.setBool(kHasShownCoachMarkKey, value);
}
}

View File

@@ -1,4 +1,4 @@
// @dart=2.9
import 'dart:io';
@@ -16,10 +16,10 @@ class UpdateService {
static final UpdateService instance = UpdateService._privateConstructor();
static const kUpdateAvailableShownTimeKey = "update_available_shown_time_key";
LatestVersionInfo _latestVersion;
LatestVersionInfo? _latestVersion;
final _logger = Logger("UpdateService");
PackageInfo _packageInfo;
SharedPreferences _prefs;
late PackageInfo _packageInfo;
late SharedPreferences _prefs;
Future<void> init() async {
_packageInfo = await PackageInfo.fromPlatform();
@@ -33,27 +33,27 @@ class UpdateService {
try {
_latestVersion = await _getLatestVersionInfo();
final currentVersionCode = int.parse(_packageInfo.buildNumber);
return currentVersionCode < _latestVersion.code;
return currentVersionCode < _latestVersion!.code!;
} catch (e) {
_logger.severe(e);
return false;
}
}
bool shouldForceUpdate(LatestVersionInfo info) {
bool shouldForceUpdate(LatestVersionInfo? info) {
if (!isIndependent()) {
return false;
}
try {
final currentVersionCode = int.parse(_packageInfo.buildNumber);
return currentVersionCode < info.lastSupportedVersionCode;
return currentVersionCode < info!.lastSupportedVersionCode;
} catch (e) {
_logger.severe(e);
return false;
}
}
LatestVersionInfo getLatestVersionInfo() {
LatestVersionInfo? getLatestVersionInfo() {
return _latestVersion;
}
@@ -69,7 +69,7 @@ class UpdateService {
(now - lastNotificationShownTime) > (3 * microSecondsInDay);
if (shouldUpdate &&
hasBeen3DaysSinceLastNotification &&
_latestVersion.shouldNotify) {
_latestVersion!.shouldNotify!) {
NotificationService.instance.showNotification(
"Update available",
"Click to install our best version yet",
@@ -96,14 +96,14 @@ class UpdateService {
}
class LatestVersionInfo {
final String name;
final int code;
final String? name;
final int? code;
final List<String> changelog;
final bool shouldForceUpdate;
final bool? shouldForceUpdate;
final int lastSupportedVersionCode;
final String url;
final int size;
final bool shouldNotify;
final String? url;
final int? size;
final bool? shouldNotify;
LatestVersionInfo(
this.name,

View File

@@ -1,5 +1,3 @@
// @dart=2.9
import 'package:bip39/bip39.dart' as bip39;
import 'package:dio/dio.dart';
import 'package:ente_auth/core/configuration.dart';
@@ -7,6 +5,7 @@ import 'package:ente_auth/core/constants.dart';
import 'package:ente_auth/core/event_bus.dart';
import 'package:ente_auth/core/network.dart';
import 'package:ente_auth/events/user_details_changed_event.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/models/delete_account.dart';
import 'package:ente_auth/models/key_attributes.dart';
import 'package:ente_auth/models/key_gen_result.dart';
@@ -31,14 +30,14 @@ class UserService {
final _dio = Network.instance.getDio();
final _logger = Logger("UserSerivce");
final _config = Configuration.instance;
ValueNotifier<String> emailValueNotifier;
late ValueNotifier<String?> emailValueNotifier;
UserService._privateConstructor();
static final UserService instance = UserService._privateConstructor();
Future<void> init() async {
emailValueNotifier =
ValueNotifier<String>(Configuration.instance.getEmail());
ValueNotifier<String?>(Configuration.instance.getEmail());
}
Future<void> sendOtt(
@@ -47,7 +46,8 @@ class UserService {
bool isChangeEmail = false,
bool isCreateAccountScreen = false,
}) async {
final dialog = createProgressDialog(context, "Please wait...");
final l10n = context.l10n;
final dialog = createProgressDialog(context, l10n.pleaseWait);
await dialog.show();
try {
final response = await _dio.post(
@@ -73,19 +73,19 @@ class UserService {
);
return;
}
showGenericErrorDialog(context);
showGenericErrorDialog(context: context);
} on DioError catch (e) {
await dialog.hide();
_logger.info(e);
if (e.response != null && e.response.statusCode == 403) {
if (e.response != null && e.response!.statusCode == 403) {
showErrorDialog(context, "Oops", "This email is already in use");
} else {
showGenericErrorDialog(context);
showGenericErrorDialog(context: context);
}
} catch (e) {
await dialog.hide();
_logger.severe(e);
showGenericErrorDialog(context);
showGenericErrorDialog(context: context);
}
}
@@ -184,14 +184,15 @@ class UserService {
} catch (e) {
_logger.severe(e);
await dialog.hide();
showGenericErrorDialog(context);
showGenericErrorDialog(context: context);
}
}
Future<DeleteChallengeResponse> getDeleteChallenge(
Future<DeleteChallengeResponse?> getDeleteChallenge(
BuildContext context,
) async {
final dialog = createProgressDialog(context, "Please wait...");
final l10n = context.l10n;
final dialog = createProgressDialog(context, l10n.pleaseWait);
await dialog.show();
try {
final response = await _dio.get(
@@ -215,7 +216,7 @@ class UserService {
} catch (e) {
_logger.severe(e);
await dialog.hide();
await showGenericErrorDialog(context);
await showGenericErrorDialog(context: context);
return null;
}
}
@@ -254,12 +255,13 @@ class UserService {
} catch (e) {
_logger.severe(e);
await dialog.hide();
showGenericErrorDialog(context);
showGenericErrorDialog(context: context);
}
}
Future<void> verifyEmail(BuildContext context, String ott) async {
final dialog = createProgressDialog(context, "Please wait...");
final l10n = context.l10n;
final dialog = createProgressDialog(context, l10n.pleaseWait);
await dialog.show();
try {
final response = await _dio.post(
@@ -298,7 +300,7 @@ class UserService {
} on DioError catch (e) {
_logger.info(e);
await dialog.hide();
if (e.response != null && e.response.statusCode == 410) {
if (e.response != null && e.response!.statusCode == 410) {
await showErrorDialog(
context,
"Oops",
@@ -329,7 +331,8 @@ class UserService {
String email,
String ott,
) async {
final dialog = createProgressDialog(context, "Please wait...");
final l10n = context.l10n;
final dialog = createProgressDialog(context, l10n.pleaseWait);
await dialog.show();
try {
final response = await _dio.post(
@@ -355,7 +358,7 @@ class UserService {
showErrorDialog(context, "Oops", "Verification failed, please try again");
} on DioError catch (e) {
await dialog.hide();
if (e.response != null && e.response.statusCode == 403) {
if (e.response != null && e.response!.statusCode == 403) {
showErrorDialog(context, "Oops", "This email is already in use");
} else {
showErrorDialog(
@@ -442,7 +445,7 @@ class UserService {
}
}
Future<String> getPaymentToken() async {
Future<String?> getPaymentToken() async {
try {
final response = await _dio.get(
"${_config.getHttpEndpoint()}/users/payment-token",
@@ -498,7 +501,8 @@ class UserService {
}
Future<void> recoverTwoFactor(BuildContext context, String sessionID) async {
final dialog = createProgressDialog(context, "Please wait...");
final l10n = context.l10n;
final dialog = createProgressDialog(context, l10n.pleaseWait);
await dialog.show();
try {
final response = await _dio.get(
@@ -523,7 +527,7 @@ class UserService {
}
} on DioError catch (e) {
_logger.severe(e);
if (e.response != null && e.response.statusCode == 404) {
if (e.response != null && e.response!.statusCode == 404) {
showToast(context, "Session expired");
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
@@ -583,7 +587,7 @@ class UserService {
} on DioError catch (e) {
await dialog.hide();
_logger.severe(e);
if (e.response != null && e.response.statusCode == 404) {
if (e.response != null && e.response!.statusCode == 404) {
showToast(context, "Session expired");
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
@@ -618,7 +622,8 @@ class UserService {
String encryptedSecret,
String secretDecryptionNonce,
) async {
final dialog = createProgressDialog(context, "Please wait...");
final l10n = context.l10n;
final dialog = createProgressDialog(context, l10n.pleaseWait);
await dialog.show();
String secret;
try {
@@ -668,7 +673,7 @@ class UserService {
}
} on DioError catch (e) {
_logger.severe(e);
if (e.response != null && e.response.statusCode == 404) {
if (e.response != null && e.response!.statusCode == 404) {
showToast(context, "Session expired");
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(

View File

@@ -135,6 +135,21 @@ class AuthenticatorDB {
return _convertRows(rows);
}
// removeSyncedData will remove all the data which is synced with the server
Future<int> removeSyncedData() async {
final db = await instance.database;
return await db
.delete(entityTable, where: 'shouldSync = ?', whereArgs: [0]);
}
// getCount of entries which are not synced with the server
Future<int> getNeedSyncCount() async {
final db = await instance.database;
final rows = await db
.rawQuery("SELECT COUNT(*) from $entityTable WHERE shouldSync = 1");
return Sqflite.firstIntValue(rows)!;
}
// deleteByID will prefer generated id if both ids are passed during deletion
Future<void> deleteByIDs({List<int>? generatedIDs, List<String>? ids}) async {
final db = await instance.database;

View File

@@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:ente_auth/core/event_bus.dart';
import 'package:ente_auth/events/codes_updated_event.dart';
import 'package:ente_auth/models/authenticator/entity_result.dart';
import 'package:ente_auth/models/code.dart';
import 'package:ente_auth/services/authenticator_service.dart';
import 'package:logging/logging.dart';
@@ -19,13 +20,14 @@ class CodeStore {
}
Future<List<Code>> getAllCodes() async {
final Map<int, String> rawCodesMap =
await _authenticatorService.getAllIDtoStringMap();
final List<EntityResult> entities =
await _authenticatorService.getEntities();
final List<Code> codes = [];
for (final entry in rawCodesMap.entries) {
final decodeJson = jsonDecode(entry.value);
for (final entity in entities) {
final decodeJson = jsonDecode(entity.rawData);
final code = Code.fromRawData(decodeJson);
code.id = entry.key;
code.generatedID = entity.generatedID;
code.hasSynced = entity.hasSynced;
codes.add(code);
}
codes.sort((c1, c2) {
@@ -39,21 +41,33 @@ class CodeStore {
bool shouldSync = true,
}) async {
final codes = await getAllCodes();
bool isExistingCode = false;
for (final existingCode in codes) {
if (existingCode == code) {
_logger.info("Found duplicate code, skipping add");
return;
} else if (existingCode.generatedID == code.generatedID) {
isExistingCode = true;
break;
}
}
code.id = await _authenticatorService.addEntry(
jsonEncode(code.rawData),
shouldSync,
);
if (isExistingCode) {
await _authenticatorService.updateEntry(
code.generatedID!,
jsonEncode(code.rawData),
shouldSync,
);
} else {
code.generatedID = await _authenticatorService.addEntry(
jsonEncode(code.rawData),
shouldSync,
);
}
Bus.instance.fire(CodesUpdatedEvent());
}
Future<void> removeCode(Code code) async {
await _authenticatorService.deleteEntry(code.id!);
await _authenticatorService.deleteEntry(code.generatedID!);
Bus.instance.fire(CodesUpdatedEvent());
}
}

View File

@@ -11,6 +11,7 @@ class EnteColorScheme {
// Backdrop Colors
final Color backdropBase;
final Color backdropBaseMute;
final Color backdropFaint;
// Text Colors
final Color textBase;
@@ -19,15 +20,22 @@ class EnteColorScheme {
// Fill Colors
final Color fillBase;
final Color fillBasePressed;
final Color fillMuted;
final Color fillFaint;
final Color fillFaintPressed;
// Stroke Colors
final Color strokeBase;
final Color strokeMuted;
final Color strokeFaint;
final Color strokeFainter;
final Color blurStrokeBase;
final Color blurStrokeFaint;
final Color blurStrokePressed;
// Fixed Colors
final Color primaryGreen;
final Color primary700;
final Color primary500;
final Color primary400;
@@ -36,6 +44,8 @@ class EnteColorScheme {
final Color warning700;
final Color warning500;
final Color warning400;
final Color warning800;
final Color caution500;
const EnteColorScheme(
@@ -44,20 +54,29 @@ class EnteColorScheme {
this.backgroundElevated2,
this.backdropBase,
this.backdropBaseMute,
this.backdropFaint,
this.textBase,
this.textMuted,
this.textFaint,
this.fillBase,
this.fillBasePressed,
this.fillMuted,
this.fillFaint,
this.fillFaintPressed,
this.strokeBase,
this.strokeMuted,
this.strokeFaint, {
this.strokeFaint,
this.strokeFainter,
this.blurStrokeBase,
this.blurStrokeFaint,
this.blurStrokePressed, {
this.primaryGreen = _primaryGreen,
this.primary700 = _primary700,
this.primary500 = _primary500,
this.primary400 = _primary400,
this.primary300 = _primary300,
this.warning700 = _warning700,
this.warning800 = _warning800,
this.warning500 = _warning500,
this.warning400 = _warning700,
this.caution500 = _caution500,
@@ -69,16 +88,23 @@ const EnteColorScheme lightScheme = EnteColorScheme(
backgroundElevatedLight,
backgroundElevated2Light,
backdropBaseLight,
backdropBaseMuteLight,
backdropMutedLight,
backdropFaintLight,
textBaseLight,
textMutedLight,
textFaintLight,
fillBaseLight,
fillBasePressedLight,
fillMutedLight,
fillFaintLight,
fillFaintPressedLight,
strokeBaseLight,
strokeMutedLight,
strokeFaintLight,
strokeFainterLight,
blurStrokeBaseLight,
blurStrokeFaintLight,
blurStrokePressedLight,
);
const EnteColorScheme darkScheme = EnteColorScheme(
@@ -86,16 +112,23 @@ const EnteColorScheme darkScheme = EnteColorScheme(
backgroundElevatedDark,
backgroundElevated2Dark,
backdropBaseDark,
backdropBaseMuteDark,
backdropMutedDark,
backdropFaintDark,
textBaseDark,
textMutedDark,
textFaintDark,
fillBaseDark,
fillBasePressedDark,
fillMutedDark,
fillFaintDark,
fillFaintPressedDark,
strokeBaseDark,
strokeMutedDark,
strokeFaintDark,
strokeFainterDark,
blurStrokeBaseDark,
blurStrokeFaintDark,
blurStrokePressedDark,
);
// Background Colors
@@ -108,11 +141,13 @@ const Color backgroundElevatedDark = Color.fromRGBO(27, 27, 27, 1);
const Color backgroundElevated2Dark = Color.fromRGBO(37, 37, 37, 1);
// Backdrop Colors
const Color backdropBaseLight = Color.fromRGBO(255, 255, 255, 0.75);
const Color backdropBaseMuteLight = Color.fromRGBO(255, 255, 255, 0.30);
const Color backdropBaseLight = Color.fromRGBO(255, 255, 255, 0.92);
const Color backdropMutedLight = Color.fromRGBO(255, 255, 255, 0.75);
const Color backdropFaintLight = Color.fromRGBO(255, 255, 255, 0.30);
const Color backdropBaseDark = Color.fromRGBO(0, 0, 0, 0.65);
const Color backdropBaseMuteDark = Color.fromRGBO(0, 0, 0, 0.20);
const Color backdropBaseDark = Color.fromRGBO(0, 0, 0, 0.90);
const Color backdropMutedDark = Color.fromRGBO(0, 0, 0, 0.65);
const Color backdropFaintDark = Color.fromRGBO(0, 0, 0, 0.20);
// Text Colors
const Color textBaseLight = Color.fromRGBO(0, 0, 0, 1);
@@ -125,24 +160,38 @@ const Color textFaintDark = Color.fromRGBO(255, 255, 255, 0.5);
// Fill Colors
const Color fillBaseLight = Color.fromRGBO(0, 0, 0, 1);
const Color fillBasePressedLight = Color.fromRGBO(0, 0, 0, 0.87);
const Color fillMutedLight = Color.fromRGBO(0, 0, 0, 0.12);
const Color fillFaintLight = Color.fromRGBO(0, 0, 0, 0.04);
const Color fillFaintPressedLight = Color.fromRGBO(0, 0, 0, 0.08);
const Color fillBaseDark = Color.fromRGBO(255, 255, 255, 1);
const Color fillBasePressedDark = Color.fromRGBO(255, 255, 255, 0.9);
const Color fillMutedDark = Color.fromRGBO(255, 255, 255, 0.16);
const Color fillFaintDark = Color.fromRGBO(255, 255, 255, 0.12);
const Color fillFaintPressedDark = Color.fromRGBO(255, 255, 255, 0.06);
// Stroke Colors
const Color strokeBaseLight = Color.fromRGBO(0, 0, 0, 1);
const Color strokeMutedLight = Color.fromRGBO(0, 0, 0, 0.24);
const Color strokeFaintLight = Color.fromRGBO(0, 0, 0, 0.04);
const Color strokeFainterLight = Color.fromRGBO(0, 0, 0, 0.06);
const Color blurStrokeBaseLight = Color.fromRGBO(0, 0, 0, 0.65);
const Color blurStrokeFaintLight = Color.fromRGBO(0, 0, 0, 0.08);
const Color blurStrokePressedLight = Color.fromRGBO(0, 0, 0, 0.50);
const Color strokeBaseDark = Color.fromRGBO(255, 255, 255, 1);
const Color strokeMutedDark = Color.fromRGBO(255, 255, 255, 0.24);
const Color strokeFaintDark = Color.fromRGBO(255, 255, 255, 0.16);
const Color strokeFainterDark = Color.fromRGBO(255, 255, 255, 0.08);
const Color blurStrokeBaseDark = Color.fromRGBO(255, 255, 255, 0.90);
const Color blurStrokeFaintDark = Color.fromRGBO(255, 255, 255, 0.06);
const Color blurStrokePressedDark = Color.fromRGBO(255, 255, 255, 0.50);
// Fixed Colors
const Color _primaryGreen = Color.fromRGBO(29, 185, 84, 1);
const Color _primary700 = Color.fromARGB(255, 164, 0, 182);
const Color _primary500 = Color.fromARGB(255, 204, 10, 101);
const Color _primary400 = Color.fromARGB(255, 122, 41, 193);
@@ -150,6 +199,7 @@ const Color _primary300 = Color.fromARGB(255, 152, 77, 244);
const Color _warning700 = Color.fromRGBO(234, 63, 63, 1);
const Color _warning500 = Color.fromRGBO(255, 101, 101, 1);
const Color _warning800 = Color(0xFFF53434);
const Color warning500 = Color.fromRGBO(255, 101, 101, 1);
const Color _warning400 = Color.fromRGBO(255, 111, 111, 1);

View File

@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
const blurBase = 96;
const blurMuted = 48;
const blurFaint = 24;
const blurBase = 96.0;
const blurMuted = 48.0;
const blurFaint = 24.0;
List<BoxShadow> shadowFloatLight = const [
BoxShadow(blurRadius: 10, color: Color.fromRGBO(0, 0, 0, 0.25)),

View File

@@ -36,10 +36,20 @@ EnteTheme darkTheme = EnteTheme(
shadowButton: shadowButtonDark,
);
EnteColorScheme getEnteColorScheme(BuildContext context) {
return Theme.of(context).colorScheme.enteTheme.colorScheme;
EnteColorScheme getEnteColorScheme(
BuildContext context, {
bool inverse = false,
}) {
return inverse
? Theme.of(context).colorScheme.inverseEnteTheme.colorScheme
: Theme.of(context).colorScheme.enteTheme.colorScheme;
}
EnteTextTheme getEnteTextTheme(BuildContext context) {
return Theme.of(context).colorScheme.enteTheme.textTheme;
EnteTextTheme getEnteTextTheme(
BuildContext context, {
bool inverse = false,
}) {
return inverse
? Theme.of(context).colorScheme.inverseEnteTheme.textTheme
: Theme.of(context).colorScheme.enteTheme.textTheme;
}

View File

@@ -1,36 +1,36 @@
// @dart=2.9
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/services/user_service.dart';
import 'package:ente_auth/utils/dialog_util.dart';
import 'package:ente_auth/utils/email_util.dart';
import 'package:flutter/material.dart';
class ChangeEmailDialog extends StatefulWidget {
const ChangeEmailDialog({Key key}) : super(key: key);
const ChangeEmailDialog({Key? key}) : super(key: key);
@override
State<ChangeEmailDialog> createState() => _ChangeEmailDialogState();
}
class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
String _email;
String _email = "";
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
return AlertDialog(
title: const Text("Enter your email address"),
title: Text(l10n.enterEmailHint),
content: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextFormField(
decoration: const InputDecoration(
hintText: 'Email',
hintStyle: TextStyle(
decoration: InputDecoration(
hintText: l10n.email,
hintStyle: const TextStyle(
color: Colors.white30,
),
contentPadding: EdgeInsets.all(12),
contentPadding: const EdgeInsets.all(12),
),
onChanged: (value) {
setState(() {
@@ -47,9 +47,9 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
),
actions: [
TextButton(
child: const Text(
"Cancel",
style: TextStyle(
child: Text(
l10n.cancel,
style: const TextStyle(
color: Colors.redAccent,
),
),
@@ -58,9 +58,9 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
},
),
TextButton(
child: const Text(
"Verify",
style: TextStyle(
child: Text(
l10n.verify,
style: const TextStyle(
color: Colors.purple,
),
),
@@ -68,8 +68,8 @@ class _ChangeEmailDialogState extends State<ChangeEmailDialog> {
if (!isValidEmail(_email)) {
showErrorDialog(
context,
"Invalid email address",
"Please enter a valid email address.",
l10n.invalidEmailTitle,
l10n.invalidEmailMessage,
);
return;
}

View File

@@ -1,8 +1,7 @@
// @dart=2.9
import 'dart:convert';
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/models/delete_account.dart';
import 'package:ente_auth/services/local_authentication_service.dart';
import 'package:ente_auth/services/user_service.dart';
@@ -15,15 +14,16 @@ import 'package:flutter_sodium/flutter_sodium.dart';
class DeleteAccountPage extends StatelessWidget {
const DeleteAccountPage({
Key key,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
return Scaffold(
appBar: AppBar(
elevation: 0,
title: const Text("Delete account"),
title: Text(l10n.deleteAccount),
leading: IconButton(
icon: const Icon(Icons.arrow_back),
color: Theme.of(context).iconTheme.color,
@@ -47,7 +47,7 @@ class DeleteAccountPage extends StatelessWidget {
),
Center(
child: Text(
"We'll be sorry to see you go. Are you facing some issue?",
l10n.deleteAccountQuery,
style: Theme.of(context).textTheme.subtitle1,
),
),
@@ -74,7 +74,7 @@ class DeleteAccountPage extends StatelessWidget {
height: 24,
),
GradientButton(
text: "Yes, send feedback",
text: l10n.yesSendFeedbackAction,
iconData: Icons.check,
onTap: () async {
await sendEmail(
@@ -104,9 +104,9 @@ class DeleteAccountPage extends StatelessWidget {
),
backgroundColor: Colors.white,
),
label: const Text(
"No, delete account",
style: TextStyle(
label: Text(
l10n.noDeleteAccountAction,
style: const TextStyle(
color: Colors.redAccent, // same for both themes
),
textAlign: TextAlign.center,
@@ -143,21 +143,20 @@ class DeleteAccountPage extends StatelessWidget {
BuildContext context,
DeleteChallengeResponse response,
) async {
final l10n = context.l10n;
final hasAuthenticated =
await LocalAuthenticationService.instance.requestLocalAuthentication(
context,
"Please authenticate to initiate account deletion",
l10n.initiateAccountDeleteTitle,
);
if (hasAuthenticated) {
final choice = await showChoiceDialog(
final choice = await showChoiceDialogOld(
context,
'Are you sure you want to delete your ente account?',
'Your uploaded data, across all apps '
'(Photos and Authenticator both), will be scheduled for deletion,'
'and your account will be permanently deleted.',
firstAction: 'Cancel',
secondAction: 'Delete',
l10n.confirmAccountDeleteTitle,
l10n.confirmAccountDeleteMessage,
firstAction: l10n.cancel,
secondAction: l10n.delete,
firstActionColor: Theme.of(context).colorScheme.onSurface,
secondActionColor: Colors.red,
);
@@ -166,8 +165,8 @@ class DeleteAccountPage extends StatelessWidget {
}
final decryptChallenge = CryptoUtil.openSealSync(
Sodium.base642bin(response.encryptedChallenge),
Sodium.base642bin(Configuration.instance.getKeyAttributes().publicKey),
Configuration.instance.getSecretKey(),
Sodium.base642bin(Configuration.instance.getKeyAttributes()!.publicKey),
Configuration.instance.getSecretKey()!,
);
final challengeResponseStr = utf8.decode(decryptChallenge);
await UserService.instance.deleteAccount(context, challengeResponseStr);
@@ -175,10 +174,11 @@ class DeleteAccountPage extends StatelessWidget {
}
Future<void> _requestEmailForDeletion(BuildContext context) async {
final l10n = context.l10n;
final AlertDialog alert = AlertDialog(
title: const Text(
"Delete account",
style: TextStyle(
title: Text(
l10n.deleteAccount,
style: const TextStyle(
color: Colors.red,
),
),
@@ -208,9 +208,9 @@ class DeleteAccountPage extends StatelessWidget {
),
actions: [
TextButton(
child: const Text(
"Send email",
style: TextStyle(
child: Text(
l10n.sendEmail,
style: const TextStyle(
color: Colors.red,
),
),
@@ -225,7 +225,7 @@ class DeleteAccountPage extends StatelessWidget {
),
TextButton(
child: Text(
"Ok",
l10n.ok,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
),

View File

@@ -1,25 +1,18 @@
// @dart=2.9
import 'dart:io';
import 'package:email_validator/email_validator.dart';
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/models/billing_plan.dart';
import 'package:ente_auth/services/billing_service.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/services/user_service.dart';
import 'package:ente_auth/ui/common/dynamic_fab.dart';
import 'package:ente_auth/ui/common/loading_widget.dart';
import 'package:ente_auth/ui/common/web_page.dart';
import 'package:ente_auth/utils/data_util.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:password_strength/password_strength.dart';
import 'package:step_progress_indicator/step_progress_indicator.dart';
import "package:styled_text/styled_text.dart";
class EmailEntryPage extends StatefulWidget {
const EmailEntryPage({Key key}) : super(key: key);
const EmailEntryPage({Key? key}) : super(key: key);
@override
State<EmailEntryPage> createState() => _EmailEntryPageState();
@@ -34,8 +27,8 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
final _passwordController2 = TextEditingController();
final Color _validFieldValueColor = const Color.fromARGB(51, 157, 45, 194);
String _email;
String _password;
String? _email;
String? _password;
String _cnfPassword = '';
double _passwordStrength = 0.0;
bool _emailIsValid = false;
@@ -71,7 +64,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
Widget build(BuildContext context) {
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
FloatingActionButtonLocation fabLocation() {
FloatingActionButtonLocation? fabLocation() {
if (isKeypadOpen) {
return null;
} else {
@@ -107,12 +100,12 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
floatingActionButton: DynamicFAB(
isKeypadOpen: isKeypadOpen,
isFormValid: _isFormValid(),
buttonText: 'Create account',
buttonText: context.l10n.createAccount,
onPressedFunction: () {
_config.setVolatilePassword(_passwordController1.text);
UserService.instance.setEmail(_email);
UserService.instance.setEmail(_email!);
UserService.instance
.sendOtt(context, _email, isCreateAccountScreen: true);
.sendOtt(context, _email!, isCreateAccountScreen: true);
FocusScope.of(context).unfocus();
},
),
@@ -122,13 +115,13 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
}
Widget _getBody() {
var passwordStrengthText = 'Weak';
var passwordStrengthText = context.l10n.weakStrength;
var passwordStrengthColor = Colors.redAccent;
if (_passwordStrength > kStrongPasswordStrengthThreshold) {
passwordStrengthText = 'Strong';
passwordStrengthText = context.l10n.strongStrength;
passwordStrengthColor = Colors.greenAccent;
} else if (_passwordStrength > kMildPasswordStrengthThreshold) {
passwordStrengthText = 'Moderate';
passwordStrengthText = context.l10n.moderateStrength;
passwordStrengthColor = Colors.orangeAccent;
}
return Column(
@@ -141,7 +134,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
padding:
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
child: Text(
'Create new account',
context.l10n.createNewAccount,
style: Theme.of(context).textTheme.headline4,
),
),
@@ -153,7 +146,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
decoration: InputDecoration(
fillColor: _emailIsValid ? _validFieldValueColor : null,
filled: true,
hintText: 'Email',
hintText: context.l10n.email,
contentPadding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 14,
@@ -168,7 +161,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
size: 20,
color: Theme.of(context)
.inputDecorationTheme
.focusedBorder
.focusedBorder!
.borderSide
.color,
)
@@ -176,9 +169,9 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
),
onChanged: (value) {
_email = value.trim();
if (_emailIsValid != EmailValidator.validate(_email)) {
if (_emailIsValid != EmailValidator.validate(_email!)) {
setState(() {
_emailIsValid = EmailValidator.validate(_email);
_emailIsValid = EmailValidator.validate(_email!);
});
}
},
@@ -201,7 +194,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
fillColor:
_passwordIsValid ? _validFieldValueColor : null,
filled: true,
hintText: "Password",
hintText: context.l10n.password,
contentPadding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 14,
@@ -226,7 +219,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
Icons.check,
color: Theme.of(context)
.inputDecorationTheme
.focusedBorder
.focusedBorder!
.borderSide
.color,
)
@@ -266,9 +259,11 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
autofillHints: const [AutofillHints.newPassword],
onEditingComplete: () => TextInput.finishAutofillContext(),
decoration: InputDecoration(
fillColor: _passwordsMatch ? _validFieldValueColor : null,
fillColor: _passwordsMatch && _passwordIsValid
? _validFieldValueColor
: null,
filled: true,
hintText: "Confirm password",
hintText: context.l10n.confirmPassword,
contentPadding: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 14,
@@ -293,7 +288,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
Icons.check,
color: Theme.of(context)
.inputDecorationTheme
.focusedBorder
.focusedBorder!
.borderSide
.color,
)
@@ -320,7 +315,7 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
padding:
const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
child: Text(
'Password strength: $passwordStrengthText',
context.l10n.passwordStrength(passwordStrengthText),
style: TextStyle(
color: passwordStrengthColor,
fontWeight: FontWeight.w500,
@@ -369,63 +364,51 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
side: CheckboxTheme.of(context).side,
onChanged: (value) {
setState(() {
_hasAgreedToTOS = value;
_hasAgreedToTOS = value!;
});
},
),
Expanded(
child: RichText(
text: TextSpan(
children: [
const TextSpan(
text: "I agree to the ",
child: StyledText(
text: context.l10n.signUpTerms,
style:
Theme.of(context).textTheme.subtitle1!.copyWith(fontSize: 12),
tags: {
'u-terms': StyledTextActionTag(
(String? text, Map<String?, String?> attrs) => {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return WebPage(
context.l10n.termsOfServicesTitle,
"https://ente.io/terms",
);
},
),
)
},
style: const TextStyle(
decoration: TextDecoration.underline,
),
TextSpan(
text: "terms of service",
style: const TextStyle(
decoration: TextDecoration.underline,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return const WebPage(
"Terms",
"https://ente.io/terms",
);
},
),
);
},
),
'u-policy': StyledTextActionTag(
(String? text, Map<String?, String?> attrs) => {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return WebPage(
context.l10n.privacyPolicyTitle,
"https://ente.io/privacy",
);
},
),
)
},
style: const TextStyle(
decoration: TextDecoration.underline,
),
const TextSpan(text: " and "),
TextSpan(
text: "privacy policy",
style: const TextStyle(
decoration: TextDecoration.underline,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return const WebPage(
"Privacy",
"https://ente.io/privacy",
);
},
),
);
},
),
],
style: Theme.of(context)
.textTheme
.subtitle1
.copyWith(fontSize: 12),
),
textAlign: TextAlign.left,
)
},
),
),
],
@@ -448,45 +431,34 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
side: CheckboxTheme.of(context).side,
onChanged: (value) {
setState(() {
_hasAgreedToE2E = value;
_hasAgreedToE2E = value!;
});
},
),
Expanded(
child: RichText(
text: TextSpan(
children: [
const TextSpan(
text:
"I understand that if I lose my password, I may lose my data since my data is ",
child: StyledText(
text: context.l10n.ackPasswordLostWarning,
style:
Theme.of(context).textTheme.subtitle1!.copyWith(fontSize: 12),
tags: {
'underline': StyledTextActionTag(
(String? text, Map<String?, String?> attrs) => {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return WebPage(
context.l10n.encryption,
"https://ente.io/architecture",
);
},
),
)
},
style: const TextStyle(
decoration: TextDecoration.underline,
),
TextSpan(
text: "end-to-end encrypted",
style: const TextStyle(
decoration: TextDecoration.underline,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return const WebPage(
"Encryption",
"https://ente.io/architecture",
);
},
),
);
},
),
const TextSpan(text: " with ente"),
],
style: Theme.of(context)
.textTheme
.subtitle1
.copyWith(fontSize: 12),
),
textAlign: TextAlign.left,
),
},
),
),
],
@@ -502,134 +474,3 @@ class _EmailEntryPageState extends State<EmailEntryPage> {
_passwordIsValid;
}
}
class PricingWidget extends StatelessWidget {
const PricingWidget({
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return FutureBuilder<BillingPlans>(
future: BillingService.instance.getBillingPlans(),
builder: (BuildContext context, AsyncSnapshot snapshot) {
if (snapshot.hasData) {
return _buildPlans(context, snapshot.data);
} else if (snapshot.hasError) {
return const Text("Oops, Something went wrong.");
}
return const EnteLoadingWidget();
},
);
}
Container _buildPlans(BuildContext context, BillingPlans plans) {
final planWidgets = <BillingPlanWidget>[];
for (final plan in plans.plans) {
final productID = Platform.isAndroid ? plan.androidID : plan.iosID;
if (productID != null && productID.isNotEmpty) {
planWidgets.add(BillingPlanWidget(plan));
}
}
final freePlan = plans.freePlan;
return Container(
height: 280,
color: Theme.of(context).cardColor,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
const Text(
"Pricing",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: planWidgets,
),
),
Text(
"We offer a free trial of " +
convertBytesToReadableFormat(freePlan.storage) +
" for " +
freePlan.duration.toString() +
" " +
freePlan.period,
),
GestureDetector(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: const [
Icon(
Icons.close,
size: 12,
color: Colors.white38,
),
Padding(padding: EdgeInsets.all(1)),
Text(
"Close",
style: TextStyle(
color: Colors.white38,
),
),
],
),
onTap: () => Navigator.pop(context),
)
],
),
);
}
}
class BillingPlanWidget extends StatelessWidget {
final BillingPlan plan;
const BillingPlanWidget(
this.plan, {
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(2.0),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12.0),
),
color: Colors.black.withOpacity(0.2),
child: Container(
padding: const EdgeInsets.fromLTRB(12, 20, 12, 20),
child: Column(
children: [
Text(
convertBytesToGBs(plan.storage, precision: 0).toString() +
" GB",
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
const Padding(
padding: EdgeInsets.all(4),
),
Text(
plan.price + " / " + plan.period,
style: const TextStyle(
fontSize: 12,
color: Colors.white70,
),
),
],
),
),
),
);
}
}

View File

@@ -1,15 +1,14 @@
// @dart=2.9
import 'package:email_validator/email_validator.dart';
import 'package:ente_auth/core/configuration.dart';
import "package:ente_auth/l10n/l10n.dart";
import 'package:ente_auth/services/user_service.dart';
import 'package:ente_auth/ui/common/dynamic_fab.dart';
import 'package:ente_auth/ui/common/web_page.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import "package:styled_text/styled_text.dart";
class LoginPage extends StatefulWidget {
const LoginPage({Key key}) : super(key: key);
const LoginPage({Key? key}) : super(key: key);
@override
State<LoginPage> createState() => _LoginPageState();
@@ -18,8 +17,8 @@ class LoginPage extends StatefulWidget {
class _LoginPageState extends State<LoginPage> {
final _config = Configuration.instance;
bool _emailIsValid = false;
String _email;
Color _emailInputFieldColor;
String? _email;
Color? _emailInputFieldColor;
@override
void initState() {
@@ -31,7 +30,7 @@ class _LoginPageState extends State<LoginPage> {
Widget build(BuildContext context) {
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
FloatingActionButtonLocation fabLocation() {
FloatingActionButtonLocation? fabLocation() {
if (isKeypadOpen) {
return null;
} else {
@@ -55,11 +54,11 @@ class _LoginPageState extends State<LoginPage> {
floatingActionButton: DynamicFAB(
isKeypadOpen: isKeypadOpen,
isFormValid: _emailIsValid,
buttonText: 'Log in',
buttonText: context.l10n.logInLabel,
onPressedFunction: () {
UserService.instance.setEmail(_email);
UserService.instance.setEmail(_email!);
UserService.instance
.sendOtt(context, _email, isCreateAccountScreen: false);
.sendOtt(context, _email!, isCreateAccountScreen: false);
FocusScope.of(context).unfocus();
},
),
@@ -69,6 +68,7 @@ class _LoginPageState extends State<LoginPage> {
}
Widget _getBody() {
final l10n = context.l10n;
return Column(
children: [
Expanded(
@@ -79,7 +79,7 @@ class _LoginPageState extends State<LoginPage> {
padding:
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
child: Text(
'Welcome back!',
l10n.welcomeBack,
style: Theme.of(context).textTheme.headline4,
),
),
@@ -90,7 +90,7 @@ class _LoginPageState extends State<LoginPage> {
decoration: InputDecoration(
fillColor: _emailInputFieldColor,
filled: true,
hintText: 'Email',
hintText: l10n.email,
contentPadding: const EdgeInsets.symmetric(
horizontal: 15,
vertical: 15,
@@ -105,7 +105,7 @@ class _LoginPageState extends State<LoginPage> {
size: 20,
color: Theme.of(context)
.inputDecorationTheme
.focusedBorder
.focusedBorder!
.borderSide
.color,
)
@@ -114,7 +114,7 @@ class _LoginPageState extends State<LoginPage> {
onChanged: (value) {
setState(() {
_email = value.trim();
_emailIsValid = EmailValidator.validate(_email);
_emailIsValid = EmailValidator.validate(_email!);
if (_emailIsValid) {
_emailInputFieldColor =
const Color.fromARGB(51, 157, 45, 194);
@@ -141,58 +141,48 @@ class _LoginPageState extends State<LoginPage> {
children: [
Expanded(
flex: 5,
child: RichText(
text: TextSpan(
style: Theme.of(context)
.textTheme
.subtitle1
.copyWith(fontSize: 12),
children: [
const TextSpan(
text: "By clicking log in, I agree to the ",
child: StyledText(
text: context.l10n.loginTerms,
style: Theme.of(context)
.textTheme
.subtitle1!
.copyWith(fontSize: 12),
tags: {
'u-terms': StyledTextActionTag(
(String? text, Map<String?, String?> attrs) => {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return WebPage(
context.l10n.termsOfServicesTitle,
"https://ente.io/terms",
);
},
),
)
},
style: const TextStyle(
decoration: TextDecoration.underline,
),
TextSpan(
text: "terms of service",
style: const TextStyle(
decoration: TextDecoration.underline,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return const WebPage(
"terms",
"https://ente.io/terms",
);
},
),
);
},
),
'u-policy': StyledTextActionTag(
(String? text, Map<String?, String?> attrs) => {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return WebPage(
context.l10n.privacyPolicyTitle,
"https://ente.io/privacy",
);
},
),
)
},
style: const TextStyle(
decoration: TextDecoration.underline,
),
const TextSpan(text: " and "),
TextSpan(
text: "privacy policy",
style: const TextStyle(
decoration: TextDecoration.underline,
),
recognizer: TapGestureRecognizer()
..onTap = () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return const WebPage(
"privacy",
"https://ente.io/privacy",
);
},
),
);
},
),
],
),
textAlign: TextAlign.left,
)
},
),
),
Expanded(

View File

@@ -0,0 +1,56 @@
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/store/authenticator_db.dart';
import 'package:ente_auth/utils/dialog_util.dart';
import 'package:flutter/material.dart';
Future<void> autoLogoutAlert(BuildContext context) async {
final l10n = context.l10n;
final AlertDialog alert = AlertDialog(
title: Text(l10n.sessionExpired),
content: Text(l10n.pleaseLoginAgain),
actions: [
TextButton(
child: Text(
l10n.ok,
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
),
),
onPressed: () async {
Navigator.of(context, rootNavigator: true).pop('dialog');
Navigator.of(context).popUntil((route) => route.isFirst);
int pendingSyncCount =
await AuthenticatorDB.instance.getNeedSyncCount();
if (pendingSyncCount > 0) {
showChoiceActionSheet(
context,
title: l10n.pendingSyncs,
body: l10n.pendingSyncsWarningBody,
firstButtonLabel: context.l10n.yesLogout,
isCritical: true,
firstButtonOnTap: () async {
await _logout(context, l10n);
},
);
} else {
await _logout(context, l10n);
}
},
),
],
);
await showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}
Future<void> _logout(BuildContext context, AppLocalizations l10n) async {
final dialog = createProgressDialog(context, l10n.loggingOut);
await dialog.show();
await Configuration.instance.logout();
await dialog.hide();
}

View File

@@ -1,4 +1,4 @@
// @dart=2.9
import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/services/user_service.dart';
@@ -15,7 +15,7 @@ class OTTVerificationPage extends StatefulWidget {
this.email, {
this.isChangeEmail = false,
this.isCreateAccountScreen = false,
Key key,
Key? key,
}) : super(key: key);
@override
@@ -29,7 +29,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
Widget build(BuildContext context) {
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
FloatingActionButtonLocation fabLocation() {
FloatingActionButtonLocation? fabLocation() {
if (isKeypadOpen) {
return null;
} else {
@@ -114,7 +114,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
text: TextSpan(
style: Theme.of(context)
.textTheme
.subtitle1
.subtitle1!
.copyWith(fontSize: 14),
children: [
const TextSpan(text: "We've sent a mail to "),
@@ -134,7 +134,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
'Please check your inbox (and spam) to complete verification',
style: Theme.of(context)
.textTheme
.subtitle1
.subtitle1!
.copyWith(fontSize: 14),
),
],
@@ -187,7 +187,7 @@ class _OTTVerificationPageState extends State<OTTVerificationPage> {
},
child: Text(
"Resend email",
style: Theme.of(context).textTheme.subtitle1.copyWith(
style: Theme.of(context).textTheme.subtitle1!.copyWith(
fontSize: 14,
decoration: TextDecoration.underline,
),

View File

@@ -1,6 +1,7 @@
// @dart=2.9
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/services/user_service.dart';
import 'package:ente_auth/ui/account/recovery_key_page.dart';
import 'package:ente_auth/ui/common/dynamic_fab.dart';
@@ -23,7 +24,7 @@ enum PasswordEntryMode {
class PasswordEntryPage extends StatefulWidget {
final PasswordEntryMode mode;
const PasswordEntryPage({this.mode = PasswordEntryMode.set, Key key})
const PasswordEntryPage({this.mode = PasswordEntryMode.set, Key? key})
: super(key: key);
@override
@@ -38,7 +39,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
final _passwordController1 = TextEditingController(),
_passwordController2 = TextEditingController();
final Color _validFieldValueColor = const Color.fromRGBO(45, 194, 98, 0.2);
String _volatilePassword;
String? _volatilePassword;
String _passwordInInputBox = '';
String _passwordInInputConfirmationBox = '';
double _passwordStrength = 0.0;
@@ -59,7 +60,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
if (_volatilePassword != null) {
Future.delayed(
Duration.zero,
() => _showRecoveryCodeDialog(_volatilePassword),
() => _showRecoveryCodeDialog(_volatilePassword!),
);
}
_password1FocusNode.addListener(() {
@@ -78,7 +79,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
Widget build(BuildContext context) {
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
FloatingActionButtonLocation fabLocation() {
FloatingActionButtonLocation? fabLocation() {
if (isKeypadOpen) {
return null;
} else {
@@ -164,7 +165,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
textAlign: TextAlign.start,
style: Theme.of(context)
.textTheme
.subtitle1
.subtitle1!
.copyWith(fontSize: 14),
),
),
@@ -175,7 +176,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
text: TextSpan(
style: Theme.of(context)
.textTheme
.subtitle1
.subtitle1!
.copyWith(fontSize: 14),
children: [
const TextSpan(
@@ -184,7 +185,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
),
TextSpan(
text: "we cannot decrypt your data",
style: Theme.of(context).textTheme.subtitle1.copyWith(
style: Theme.of(context).textTheme.subtitle1!.copyWith(
fontSize: 14,
decoration: TextDecoration.underline,
),
@@ -242,7 +243,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
Icons.check,
color: Theme.of(context)
.inputDecorationTheme
.focusedBorder
.focusedBorder!
.borderSide
.color,
)
@@ -304,7 +305,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
Icons.check,
color: Theme.of(context)
.inputDecorationTheme
.focusedBorder
.focusedBorder!
.borderSide
.color,
)
@@ -361,7 +362,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
child: RichText(
text: TextSpan(
text: "How it works",
style: Theme.of(context).textTheme.subtitle1.copyWith(
style: Theme.of(context).textTheme.subtitle1!.copyWith(
fontSize: 14,
decoration: TextDecoration.underline,
),
@@ -395,20 +396,21 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
} catch (e, s) {
_logger.severe(e, s);
await dialog.hide();
showGenericErrorDialog(context);
showGenericErrorDialog(context: context);
}
}
Future<void> _showRecoveryCodeDialog(String password) async {
final l10n = context.l10n;
final dialog =
createProgressDialog(context, "Generating encryption keys...");
createProgressDialog(context, l10n.generatingEncryptionKeysTitle);
await dialog.show();
try {
final result = await Configuration.instance.generateKey(password);
Configuration.instance.setVolatilePassword(null);
await dialog.hide();
onDone() async {
final dialog = createProgressDialog(context, "Please wait...");
final dialog = createProgressDialog(context, l10n.pleaseWait);
await dialog.show();
try {
await UserService.instance.setAttributes(result);
@@ -424,7 +426,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
} catch (e, s) {
_logger.severe(e, s);
await dialog.hide();
showGenericErrorDialog(context);
showGenericErrorDialog(context: context);
}
}
@@ -449,7 +451,7 @@ class _PasswordEntryPageState extends State<PasswordEntryPage> {
"Sorry, we could not generate secure keys on this device.\n\nplease sign up from a different device.",
);
} else {
showGenericErrorDialog(context);
showGenericErrorDialog(context: context);
}
}
}

View File

@@ -1,11 +1,11 @@
// @dart=2.9
import 'dart:async';
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/core/errors.dart';
import 'package:ente_auth/models/key_attributes.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/ui/account/recovery_page.dart';
import 'package:ente_auth/ui/common/dialogs.dart';
import 'package:ente_auth/ui/common/dynamic_fab.dart';
import 'package:ente_auth/ui/components/buttons/button_widget.dart';
import 'package:ente_auth/ui/home_page.dart';
import 'package:ente_auth/utils/dialog_util.dart';
import 'package:ente_auth/utils/email_util.dart';
@@ -13,7 +13,7 @@ import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
class PasswordReentryPage extends StatefulWidget {
const PasswordReentryPage({Key key}) : super(key: key);
const PasswordReentryPage({Key? key}) : super(key: key);
@override
State<PasswordReentryPage> createState() => _PasswordReentryPageState();
@@ -23,7 +23,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
final _logger = Logger((_PasswordReentryPageState).toString());
final _passwordController = TextEditingController();
final FocusNode _passwordFocusNode = FocusNode();
String email;
String? email;
bool _passwordInFocus = false;
bool _passwordVisible = false;
@@ -42,7 +42,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
Widget build(BuildContext context) {
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
FloatingActionButtonLocation fabLocation() {
FloatingActionButtonLocation? fabLocation() {
if (isKeypadOpen) {
return null;
} else {
@@ -66,32 +66,26 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
floatingActionButton: DynamicFAB(
isKeypadOpen: isKeypadOpen,
isFormValid: _passwordController.text.isNotEmpty,
buttonText: 'Verify password',
buttonText: context.l10n.verifyPassword,
onPressedFunction: () async {
FocusScope.of(context).unfocus();
final dialog = createProgressDialog(context, "Please wait...");
final dialog = createProgressDialog(context, context.l10n.pleaseWait);
await dialog.show();
try {
await Configuration.instance.decryptAndSaveSecrets(
_passwordController.text,
Configuration.instance.getKeyAttributes(),
Configuration.instance.getKeyAttributes()!,
);
} on KeyDerivationError catch (e, s) {
_logger.severe("Password verification failed", e, s);
await dialog.hide();
final dialogUserChoice = await showChoiceDialog(
final dialogChoice = await showChoiceDialog(
context,
"Recreate password",
"The current device is not powerful enough to verify your "
"password, so we need to regenerate it once in a way that "
"works with all devices. \n\nPlease login using your "
"recovery key and regenerate your password (you can use the same one again if you wish).",
firstAction: "Cancel",
firstActionColor: Theme.of(context).colorScheme.primary,
secondAction: "Use recovery key",
secondActionColor: Theme.of(context).colorScheme.primary,
title: context.l10n.recreatePasswordTitle,
body: context.l10n.recreatePasswordBody,
firstButtonLabel: context.l10n.useRecoveryKey,
);
if (dialogUserChoice == DialogUserChoice.secondChoice) {
if (dialogChoice!.action == ButtonAction.first) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
@@ -104,20 +98,17 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
} catch (e, s) {
_logger.severe("Password verification failed", e, s);
await dialog.hide();
final dialogUserChoice = await showChoiceDialog(
final dialogChoice = await showChoiceDialog(
context,
"Incorrect password",
"Please try again",
firstAction: "Contact Support",
firstActionColor: Theme.of(context).colorScheme.primary,
secondAction: "Ok",
secondActionColor: Theme.of(context).colorScheme.primary,
title: context.l10n.incorrectPasswordTitle,
body: context.l10n.pleaseTryAgain,
firstButtonLabel: context.l10n.contactSupport,
secondButtonLabel: context.l10n.ok,
);
if (dialogUserChoice == DialogUserChoice.firstChoice) {
if (dialogChoice!.action == ButtonAction.first) {
await sendLogs(
context,
"Contact support",
context.l10n.contactSupport,
"support@ente.io",
postShare: () {},
);
@@ -125,13 +116,15 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
return;
}
await dialog.hide();
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (BuildContext context) {
return const HomePage();
},
unawaited(
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (BuildContext context) {
return const HomePage();
},
),
(route) => false,
),
(route) => false,
);
},
),
@@ -151,7 +144,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
padding:
const EdgeInsets.symmetric(vertical: 30, horizontal: 20),
child: Text(
'Welcome back!',
context.l10n.welcomeBack,
style: Theme.of(context).textTheme.headline4,
),
),
@@ -174,7 +167,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
child: TextFormField(
autofillHints: const [AutofillHints.password],
decoration: InputDecoration(
hintText: "Enter your password",
hintText: context.l10n.enterYourPasswordHint,
filled: true,
contentPadding: const EdgeInsets.all(20),
border: UnderlineInputBorder(
@@ -236,9 +229,9 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
},
child: Center(
child: Text(
"Forgot password",
context.l10n.forgotPassword,
style:
Theme.of(context).textTheme.subtitle1.copyWith(
Theme.of(context).textTheme.subtitle1!.copyWith(
fontSize: 14,
decoration: TextDecoration.underline,
),
@@ -248,8 +241,10 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
final dialog =
createProgressDialog(context, "Please wait...");
final dialog = createProgressDialog(
context,
context.l10n.pleaseWait,
);
await dialog.show();
await Configuration.instance.logout();
await dialog.hide();
@@ -258,9 +253,9 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
},
child: Center(
child: Text(
"Change email",
context.l10n.changeEmail,
style:
Theme.of(context).textTheme.subtitle1.copyWith(
Theme.of(context).textTheme.subtitle1!.copyWith(
fontSize: 14,
decoration: TextDecoration.underline,
),
@@ -277,10 +272,4 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
],
);
}
void validatePreVerificationState(KeyAttributes keyAttributes) {
if (keyAttributes == null) {
throw Exception("Key Attributes can not be null");
}
}
}

View File

@@ -1,5 +1,3 @@
// @dart=2.9
import 'dart:io' as io;
import 'package:bip39/bip39.dart' as bip39;
@@ -7,6 +5,7 @@ import 'package:dotted_border/dotted_border.dart';
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/core/constants.dart';
import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/ui/common/gradient_button.dart';
import 'package:ente_auth/utils/toast_util.dart';
import 'package:flutter/material.dart';
@@ -15,20 +14,20 @@ import 'package:share_plus/share_plus.dart';
import 'package:step_progress_indicator/step_progress_indicator.dart';
class RecoveryKeyPage extends StatefulWidget {
final bool showAppBar;
final bool? showAppBar;
final String recoveryKey;
final String doneText;
final Function() onDone;
final bool isDismissible;
final String title;
final String text;
final String subText;
final Function()? onDone;
final bool? isDismissible;
final String? title;
final String? text;
final String? subText;
final bool showProgressBar;
const RecoveryKeyPage(
this.recoveryKey,
this.doneText, {
Key key,
Key? key,
this.showAppBar,
this.onDone,
this.isDismissible,
@@ -56,7 +55,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
'recovery code should have $mnemonicKeyWordCount words',
);
}
final double topPadding = widget.showAppBar
final double topPadding = widget.showAppBar!
? 40
: widget.showProgressBar
? 32
@@ -65,6 +64,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
return Scaffold(
appBar: widget.showProgressBar
? AppBar(
automaticallyImplyLeading: false,
elevation: 0,
title: Hero(
tag: "recovery_key",
@@ -78,10 +78,10 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
),
),
)
: widget.showAppBar
: widget.showAppBar!
? AppBar(
elevation: 0,
title: Text(widget.title ?? "Recovery key"),
title: Text(widget.title ?? context.l10n.recoveryKey),
)
: null,
body: Padding(
@@ -97,19 +97,19 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
child: IntrinsicHeight(
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.showAppBar
widget.showAppBar!
? const SizedBox.shrink()
: Text(
widget.title ?? "Recovery key",
widget.title ?? context.l10n.recoveryKey,
style: Theme.of(context).textTheme.headline4,
),
Padding(
padding: EdgeInsets.all(widget.showAppBar ? 0 : 12),
padding: EdgeInsets.all(widget.showAppBar! ? 0 : 12),
),
Text(
widget.text ??
"If you forget your password, the only way you can recover your data is with this key.",
widget.text ?? context.l10n.recoveryKeyOnForgotPassword,
style: Theme.of(context).textTheme.subtitle1,
),
const Padding(padding: EdgeInsets.only(top: 24)),
@@ -134,9 +134,9 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
await Clipboard.setData(
ClipboardData(text: recoveryKey),
);
showToast(
showShortToast(
context,
"Recovery key copied to clipboard",
context.l10n.recoveryKeyCopiedToClipboard,
);
setState(() {
_hasTriedToSave = true;
@@ -145,11 +145,11 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: const Color.fromARGB(
51,
147,
43,
200,
color: const Color.fromRGBO(
49,
155,
86,
.2,
),
),
borderRadius: const BorderRadius.all(
@@ -172,16 +172,12 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
),
),
),
SizedBox(
height: 80,
width: double.infinity,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: Text(
widget.subText ??
"We dont store this key, please save this in a safe place.",
style: Theme.of(context).textTheme.bodyText1,
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: Text(
widget.subText ??
context.l10n.recoveryKeySaveDescription,
style: Theme.of(context).textTheme.bodyText1,
),
),
Expanded(
@@ -216,7 +212,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
onPressed: () async {
await _saveKeys();
},
child: const Text('Do this later'),
child: Text(context.l10n.doThisLater),
),
);
childrens.add(const SizedBox(height: 10));
@@ -227,7 +223,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
onTap: () async {
await _shareRecoveryKey(recoveryKey);
},
text: 'Save key',
text: context.l10n.saveKey,
),
);
if (_hasTriedToSave) {
@@ -265,6 +261,6 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
if (_recoveryKeyFile.existsSync()) {
await _recoveryKeyFile.delete();
}
widget.onDone();
widget.onDone!();
}
}

View File

@@ -1,4 +1,4 @@
// @dart=2.9
import 'dart:ui';
@@ -10,7 +10,7 @@ import 'package:ente_auth/utils/toast_util.dart';
import 'package:flutter/material.dart';
class RecoveryPage extends StatefulWidget {
const RecoveryPage({Key key}) : super(key: key);
const RecoveryPage({Key? key}) : super(key: key);
@override
State<RecoveryPage> createState() => _RecoveryPageState();
@@ -22,7 +22,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
@override
Widget build(BuildContext context) {
final isKeypadOpen = MediaQuery.of(context).viewInsets.bottom > 100;
FloatingActionButtonLocation fabLocation() {
FloatingActionButtonLocation? fabLocation() {
if (isKeypadOpen) {
return null;
} else {
@@ -140,7 +140,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
child: Text(
"No recovery key?",
style:
Theme.of(context).textTheme.subtitle1.copyWith(
Theme.of(context).textTheme.subtitle1!.copyWith(
fontSize: 14,
decoration: TextDecoration.underline,
),

View File

@@ -1,7 +1,8 @@
// @dart=2.9
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/models/sessions.dart';
import 'package:ente_auth/services/user_service.dart';
import 'package:ente_auth/ui/common/loading_widget.dart';
@@ -12,14 +13,14 @@ import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
class SessionsPage extends StatefulWidget {
const SessionsPage({Key key}) : super(key: key);
const SessionsPage({Key? key}) : super(key: key);
@override
State<SessionsPage> createState() => _SessionsPageState();
}
class _SessionsPageState extends State<SessionsPage> {
Sessions _sessions;
Sessions? _sessions;
final Logger _logger = Logger("SessionsPageState");
@override
@@ -45,7 +46,7 @@ class _SessionsPageState extends State<SessionsPage> {
}
final List<Widget> rows = [];
rows.add(const Padding(padding: EdgeInsets.all(4)));
for (final session in _sessions.sessions) {
for (final session in _sessions!.sessions) {
rows.add(_getSessionWidget(session));
}
return SingleChildScrollView(
@@ -111,7 +112,8 @@ class _SessionsPageState extends State<SessionsPage> {
}
Future<void> _terminateSession(Session session) async {
final dialog = createProgressDialog(context, "Please wait...");
final l10n = context.l10n;
final dialog = createProgressDialog(context, l10n.pleaseWait);
await dialog.show();
try {
await UserService.instance.terminateSession(session.token);
@@ -122,8 +124,8 @@ class _SessionsPageState extends State<SessionsPage> {
_logger.severe('failed to terminate', e, s);
showErrorDialog(
context,
'Oops',
"Something went wrong, please try again",
l10n.oops,
l10n.somethingWentWrongMessage,
);
}
}
@@ -131,11 +133,11 @@ class _SessionsPageState extends State<SessionsPage> {
Future<void> _fetchActiveSessions() async {
_sessions = await UserService.instance
.getActiveSessions()
.onError((error, stackTrace) {
.onError((dynamic error, stackTrace) {
showToast(context, "Failed to fetch active sessions");
throw error;
});
_sessions.sessions.sort((first, second) {
_sessions!.sessions.sort((first, second) {
return second.lastUsedTime.compareTo(first.lastUsedTime);
});
setState(() {});

View File

@@ -1,18 +1,15 @@
// ignore_for_file: import_of_legacy_library_into_null_safe
import 'dart:ui';
import 'package:bip39/bip39.dart' as bip39;
import 'package:dio/dio.dart';
import 'package:ente_auth/core/configuration.dart';
import 'package:ente_auth/core/event_bus.dart';
import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/events/notification_event.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/services/local_authentication_service.dart';
import 'package:ente_auth/services/user_remote_flag_service.dart';
import 'package:ente_auth/ui/account/recovery_key_page.dart';
import 'package:ente_auth/ui/common/dialogs.dart';
import 'package:ente_auth/ui/common/gradient_button.dart';
import 'package:ente_auth/ui/components/buttons/button_widget.dart';
import 'package:ente_auth/utils/dialog_util.dart';
import 'package:ente_auth/utils/navigation_util.dart';
import 'package:flutter/material.dart';
@@ -31,7 +28,8 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
final Logger _logger = Logger((_VerifyRecoveryPageState).toString());
void _verifyRecoveryKey() async {
final dialog = createProgressDialog(context, "Verifying recovery key...");
final dialog =
createProgressDialog(context, context.l10n.verifyingRecoveryKey);
await dialog.show();
try {
final String inputKey = _recoveryKey.text.trim();
@@ -50,19 +48,17 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
"Please check your internet connection and try again.",
);
} else {
await showGenericErrorDialog(context);
await showGenericErrorDialog(context: context);
}
return;
}
Bus.instance.fire(NotificationEvent());
await dialog.hide();
// todo: change this as per figma once the component is ready
await showErrorDialog(
context,
"Recovery key verified",
"Great! Your recovery key is valid. Thank you for verifying.\n"
"\nPlease"
" remember to keep your recovery key safely backed up.",
context.l10n.recoveryKeyVerified,
context.l10n.recoveryKeySuccessBody,
);
Navigator.of(context).pop();
} else {
@@ -71,18 +67,16 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
} catch (e, s) {
_logger.severe("failed to verify recovery key", e, s);
await dialog.hide();
const String errMessage =
"The recovery key you entered is not valid. Please make sure it "
"contains 24 words, and check the spelling of each.\n\nIf you "
"entered an older recovery code, make sure it is 64 characters long, and check each of them.";
final String errMessage = context.l10n.invalidRecoveryKey;
final result = await showChoiceDialog(
context,
"Invalid key",
errMessage,
firstAction: "Try again",
secondAction: "View recovery key",
title: context.l10n.invalidKey,
body: errMessage,
firstButtonLabel: context.l10n.tryAgain,
secondButtonLabel: context.l10n.viewRecoveryKey,
secondButtonAction: ButtonAction.second,
);
if (result == DialogUserChoice.secondChoice) {
if (result!.action == ButtonAction.second) {
await _onViewRecoveryKeyClick();
}
}
@@ -102,7 +96,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
context,
RecoveryKeyPage(
recoveryKey,
"OK",
context.l10n.ok,
showAppBar: true,
onDone: () {
Navigator.of(context).pop();
@@ -110,7 +104,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
),
);
} catch (e) {
showGenericErrorDialog(context);
showGenericErrorDialog(context: context);
return;
}
}
@@ -147,16 +141,14 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
SizedBox(
width: double.infinity,
child: Text(
'Verify recovery key',
context.l10n.confirmRecoveryKey,
style: enteTheme.textTheme.h3Bold,
textAlign: TextAlign.left,
),
),
const SizedBox(height: 18),
Text(
"If you forget your password, your recovery key is the "
"only way to recover your photos.\n\nPlease verify that "
"you have safely backed up your 24 word recovery key by re-entering it.",
context.l10n.recoveryKeyVerifyReason,
style: enteTheme.textTheme.small
.copyWith(color: enteTheme.colorScheme.textMuted),
),
@@ -164,7 +156,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
TextFormField(
decoration: InputDecoration(
filled: true,
hintText: "Enter your recovery key",
hintText: context.l10n.enterYourRecoveryKey,
contentPadding: const EdgeInsets.all(20),
border: UnderlineInputBorder(
borderSide: BorderSide.none,
@@ -186,12 +178,6 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
},
),
const SizedBox(height: 12),
Text(
"If you saved the recovery key from older app versions, you might have a 64 character recovery code instead of 24 words. You can enter that too.",
style: enteTheme.textTheme.mini
.copyWith(color: enteTheme.colorScheme.textMuted),
),
const SizedBox(height: 8),
Expanded(
child: Container(
alignment: Alignment.bottomCenter,
@@ -203,8 +189,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
children: [
GradientButton(
onTap: _verifyRecoveryKey,
text: "Verify",
iconData: Icons.shield_outlined,
text: context.l10n.confirm,
),
const SizedBox(height: 8),
],

View File

@@ -0,0 +1,55 @@
import 'package:ente_auth/ui/linear_progress_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
class CodeTimerProgress extends StatefulWidget {
final int period;
CodeTimerProgress({
Key? key,
required this.period,
}) : super(key: key);
@override
_CodeTimerProgressState createState() => _CodeTimerProgressState();
}
class _CodeTimerProgressState extends State<CodeTimerProgress>
with SingleTickerProviderStateMixin {
late final Ticker _ticker;
double _progress = 0.0;
late final int _microSecondsInPeriod;
@override
void initState() {
super.initState();
_microSecondsInPeriod = widget.period * 1000000;
_ticker = createTicker((elapsed) {
_updateTimeRemaining();
});
_ticker.start();
_updateTimeRemaining();
}
void _updateTimeRemaining() {
int timeRemaining = (_microSecondsInPeriod) -
(DateTime.now().microsecondsSinceEpoch % _microSecondsInPeriod);
setState(() {
_progress = (timeRemaining / _microSecondsInPeriod);
});
}
@override
void dispose() {
_ticker.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return LinearProgressWidget(
color: _progress > 0.4 ? Colors.green : Colors.orange,
fractionOfStorage: _progress,
);
}
}

View File

@@ -2,13 +2,16 @@ import 'dart:async';
import 'package:clipboard/clipboard.dart';
import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/models/code.dart';
import 'package:ente_auth/onboarding/view/setup_enter_secret_key_page.dart';
import 'package:ente_auth/store/code_store.dart';
import 'package:ente_auth/ui/code_timer_progress.dart';
import 'package:ente_auth/utils/toast_util.dart';
import 'package:ente_auth/utils/totp_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter_animation_progress_bar/flutter_animation_progress_bar.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:logging/logging.dart';
class CodeWidget extends StatefulWidget {
final Code code;
@@ -21,33 +24,36 @@ class CodeWidget extends StatefulWidget {
class _CodeWidgetState extends State<CodeWidget> {
Timer? _everySecondTimer;
int _timeRemaining = 30;
final ValueNotifier<String> _currentCode = ValueNotifier<String>("");
final ValueNotifier<String> _nextCode = ValueNotifier<String>("");
final Logger logger = Logger("_CodeWidgetState");
@override
void initState() {
super.initState();
_updateTimeRemaining();
_currentCode.value = _getTotp();
_nextCode.value = _getNextTotp();
_everySecondTimer =
Timer.periodic(const Duration(milliseconds: 200), (Timer t) {
setState(() {
_updateTimeRemaining();
});
Timer.periodic(const Duration(milliseconds: 500), (Timer t) {
String newCode = _getTotp();
if (newCode != _currentCode.value) {
_currentCode.value = newCode;
_nextCode.value = _getNextTotp();
}
});
}
void _updateTimeRemaining() {
_timeRemaining =
widget.code.period - (DateTime.now().second % widget.code.period);
}
@override
void dispose() {
_everySecondTimer?.cancel();
_currentCode.dispose();
_nextCode.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
return Container(
margin: const EdgeInsets.only(left: 16, right: 16, bottom: 8, top: 8),
child: Slidable(
@@ -55,14 +61,29 @@ class _CodeWidgetState extends State<CodeWidget> {
endActionPane: ActionPane(
motion: const ScrollMotion(),
children: [
SlidableAction(
onPressed: _onEditPressed,
backgroundColor: Colors.grey.withOpacity(0.1),
borderRadius: const BorderRadius.all(Radius.circular(12.0)),
foregroundColor:
Theme.of(context).colorScheme.inverseBackgroundColor,
icon: Icons.edit_outlined,
label: l10n.edit,
padding: const EdgeInsets.only(left: 4, right: 0),
spacing: 8,
),
const SizedBox(
width: 4,
),
SlidableAction(
onPressed: _onDeletePressed,
backgroundColor: Colors.grey.withOpacity(0.1),
borderRadius: const BorderRadius.all(Radius.circular(12.0)),
foregroundColor: const Color(0xFFFE4A49),
icon: Icons.delete,
label: 'Delete',
label: l10n.delete,
padding: const EdgeInsets.only(left: 0, right: 0),
spacing: 8,
),
],
),
@@ -89,40 +110,47 @@ class _CodeWidgetState extends State<CodeWidget> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
FAProgressBar(
currentValue:
_timeRemaining / widget.code.period * 100,
size: 4,
animatedDuration: const Duration(milliseconds: 200),
progressColor: Colors.orange,
changeColorValue: 40,
changeProgressColor: Colors.green,
CodeTimerProgress(
period: widget.code.period,
),
const SizedBox(
height: 16,
),
Padding(
padding: const EdgeInsets.only(left: 16, right: 16),
child: Column(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
Uri.decodeFull(widget.code.issuer).trim(),
style: Theme.of(context).textTheme.headline6,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
safeDecode(widget.code.issuer).trim(),
style:
Theme.of(context).textTheme.headline6,
),
const SizedBox(height: 2),
Text(
safeDecode(widget.code.account).trim(),
style: Theme.of(context)
.textTheme
.caption
?.copyWith(
fontSize: 12,
color: Colors.grey,
),
),
],
),
const SizedBox(height: 2),
Text(
Uri.decodeFull(
widget.code.account,
).trim(),
style: Theme.of(context)
.textTheme
.caption
?.copyWith(
fontSize: 12,
color: Colors.grey,
widget.code.hasSynced != null &&
widget.code.hasSynced!
? Container()
: const Icon(
Icons.sync_disabled,
size: 20,
color: Colors.amber,
),
),
],
),
),
@@ -134,24 +162,34 @@ class _CodeWidgetState extends State<CodeWidget> {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: Text(
_getTotp(),
style: const TextStyle(fontSize: 24),
child: ValueListenableBuilder<String>(
valueListenable: _currentCode,
builder: (context, value, child) {
return Text(
value,
style: const TextStyle(fontSize: 24),
);
},
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"next",
l10n.nextTotpTitle,
style: Theme.of(context).textTheme.caption,
),
Text(
_getNextTotp(),
style: const TextStyle(
fontSize: 18,
color: Colors.grey,
),
ValueListenableBuilder<String>(
valueListenable: _nextCode,
builder: (context, value, child) {
return Text(
value,
style: const TextStyle(
fontSize: 18,
color: Colors.grey,
),
);
},
),
],
),
@@ -174,26 +212,39 @@ class _CodeWidgetState extends State<CodeWidget> {
}
void _copyToClipboard() {
FlutterClipboard.copy(_getTotp()).then(
(value) => showToast(context, "Copied to clipboard"),
FlutterClipboard.copy(_getTotp())
.then((value) => showToast(context, context.l10n.copiedToClipboard));
}
Future<void> _onEditPressed(_) async {
final Code? code = await Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return SetupEnterSecretKeyPage(code: widget.code);
},
),
);
if (code != null) {
CodeStore.instance.addCode(code);
}
}
void _onDeletePressed(_) {
final l10n = context.l10n;
final AlertDialog alert = AlertDialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
title: Text(
"Delete code?",
l10n.deleteCodeTitle,
style: Theme.of(context).textTheme.headline6,
),
content: const Text(
"Are you sure you want to delete this code? This action is irreversible.",
content: Text(
l10n.deleteCodeMessage,
),
actions: [
TextButton(
child: const Text(
"Delete",
style: TextStyle(
child: Text(
l10n.delete,
style: const TextStyle(
color: Colors.red,
),
),
@@ -204,7 +255,7 @@ class _CodeWidgetState extends State<CodeWidget> {
),
TextButton(
child: Text(
"Cancel",
l10n.cancel,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
),
@@ -225,11 +276,21 @@ class _CodeWidgetState extends State<CodeWidget> {
);
}
String safeDecode(String value) {
try {
return Uri.decodeComponent(value);
} catch (e) {
// note: don't log the value, it might contain sensitive information
logger.severe("Failed to decode", e);
return value;
}
}
String _getTotp() {
try {
return getTotp(widget.code);
} catch (e) {
return "Error";
return context.l10n.error;
}
}
@@ -237,7 +298,7 @@ class _CodeWidgetState extends State<CodeWidget> {
try {
return getNextTotp(widget.code);
} catch (e) {
return "Error";
return context.l10n.error;
}
}
}

View File

@@ -1,11 +1,11 @@
// @dart=2.9
import 'package:flutter/material.dart';
class DividerWithPadding extends StatelessWidget {
final double left, top, right, bottom, thinckness;
const DividerWithPadding({
Key key,
Key? key,
this.left = 0,
this.top = 0,
this.right = 0,

View File

@@ -1,11 +1,11 @@
// @dart=2.9
import 'package:flutter/material.dart';
class BottomShadowWidget extends StatelessWidget {
final double offsetDy;
final Color shadowColor;
const BottomShadowWidget({this.offsetDy = 28, this.shadowColor, Key key})
final Color? shadowColor;
const BottomShadowWidget({this.offsetDy = 28, this.shadowColor, Key? key})
: super(key: key);
@override

View File

@@ -1,8 +1,10 @@
// @dart=2.9
import 'package:ente_auth/ente_theme_data.dart';
import 'package:ente_auth/models/typedefs.dart';
import 'package:ente_auth/ui/components/buttons/button_widget.dart';
import 'package:ente_auth/ui/components/dialog_widget.dart';
import 'package:ente_auth/ui/components/models/button_result.dart';
import 'package:ente_auth/ui/components/models/button_type.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
enum DialogUserChoice { firstChoice, secondChoice }
@@ -12,14 +14,14 @@ enum ActionType {
}
// if dialog is dismissed by tapping outside, this will return null
Future<DialogUserChoice> showChoiceDialog<T>(
Future<DialogUserChoice?> showChoiceDialogOld<T>(
BuildContext context,
String title,
String content, {
String firstAction = 'Ok',
Color firstActionColor,
Color? firstActionColor,
String secondAction = 'Cancel',
Color secondActionColor,
Color? secondActionColor,
ActionType actionType = ActionType.confirm,
}) {
final AlertDialog alert = AlertDialog(
@@ -69,7 +71,7 @@ Future<DialogUserChoice> showChoiceDialog<T>(
],
);
return showDialog(
return showDialog<DialogUserChoice>(
context: context,
builder: (BuildContext context) {
return alert;
@@ -77,3 +79,46 @@ Future<DialogUserChoice> showChoiceDialog<T>(
barrierColor: Colors.black87,
);
}
///Will return null if dismissed by tapping outside
Future<ButtonResult?> showChoiceDialog(
BuildContext context, {
required String title,
String? body,
required String firstButtonLabel,
String secondButtonLabel = "Cancel",
ButtonType firstButtonType = ButtonType.neutral,
ButtonType secondButtonType = ButtonType.secondary,
ButtonAction firstButtonAction = ButtonAction.first,
ButtonAction secondButtonAction = ButtonAction.cancel,
FutureVoidCallback? firstButtonOnTap,
FutureVoidCallback? secondButtonOnTap,
bool isCritical = false,
IconData? icon,
bool isDismissible = true,
}) async {
final buttons = [
ButtonWidget(
buttonType: isCritical ? ButtonType.critical : firstButtonType,
labelText: firstButtonLabel,
isInAlert: true,
onTap: firstButtonOnTap,
buttonAction: firstButtonAction,
),
ButtonWidget(
buttonType: secondButtonType,
labelText: secondButtonLabel,
isInAlert: true,
onTap: secondButtonOnTap,
buttonAction: secondButtonAction,
),
];
return showDialogWidget(
context: context,
title: title,
body: body,
buttons: buttons,
icon: icon,
isDismissible: isDismissible,
);
}

View File

@@ -1,4 +1,4 @@
// @dart=2.9
import 'dart:math' as math;
@@ -6,13 +6,13 @@ import 'package:ente_auth/ente_theme_data.dart';
import 'package:flutter/material.dart';
class DynamicFAB extends StatelessWidget {
final bool isKeypadOpen;
final bool isFormValid;
final String buttonText;
final Function onPressedFunction;
final bool? isKeypadOpen;
final bool? isFormValid;
final String? buttonText;
final Function? onPressedFunction;
const DynamicFAB({
Key key,
Key? key,
this.isKeypadOpen,
this.buttonText,
this.isFormValid,
@@ -21,7 +21,7 @@ class DynamicFAB extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (isKeypadOpen) {
if (isKeypadOpen!) {
return Container(
decoration: BoxDecoration(
boxShadow: [
@@ -43,13 +43,13 @@ class DynamicFAB extends StatelessWidget {
Theme.of(context).colorScheme.dynamicFABBackgroundColor,
foregroundColor:
Theme.of(context).colorScheme.dynamicFABTextColor,
onPressed: isFormValid
? onPressedFunction
onPressed: isFormValid!
? onPressedFunction as void Function()?
: () {
FocusScope.of(context).unfocus();
},
child: Transform.rotate(
angle: isFormValid ? 0 : math.pi / 2,
angle: isFormValid! ? 0 : math.pi / 2,
child: const Icon(
Icons.chevron_right,
size: 36,
@@ -65,8 +65,8 @@ class DynamicFAB extends StatelessWidget {
height: 56,
padding: const EdgeInsets.symmetric(horizontal: 20),
child: OutlinedButton(
onPressed: isFormValid ? onPressedFunction : null,
child: Text(buttonText),
onPressed: isFormValid! ? onPressedFunction as void Function()? : null,
child: Text(buttonText!),
),
);
}
@@ -75,17 +75,17 @@ class DynamicFAB extends StatelessWidget {
class NoScalingAnimation extends FloatingActionButtonAnimator {
@override
Offset getOffset({Offset begin, Offset end, double progress}) {
Offset getOffset({Offset? begin, required Offset end, double? progress}) {
return end;
}
@override
Animation<double> getRotationAnimation({Animation<double> parent}) {
Animation<double> getRotationAnimation({required Animation<double> parent}) {
return Tween<double>(begin: 1.0, end: 1.0).animate(parent);
}
@override
Animation<double> getScaleAnimation({Animation<double> parent}) {
Animation<double> getScaleAnimation({required Animation<double> parent}) {
return Tween<double>(begin: 1.0, end: 1.0).animate(parent);
}
}

View File

@@ -1,22 +1,22 @@
// @dart=2.9
import 'package:flutter/material.dart';
class GradientButton extends StatelessWidget {
final List<Color> linearGradientColors;
final Function onTap;
final Function? onTap;
// text is ignored if child is specified
final String text;
// nullable
final IconData iconData;
final IconData? iconData;
// padding between the text and icon
final double paddingValue;
const GradientButton({
Key key,
Key? key,
this.linearGradientColors = const [
Color.fromARGB(255, 133, 44, 210),
Color.fromARGB(255, 187, 26, 93),
@@ -64,7 +64,7 @@ class GradientButton extends StatelessWidget {
);
}
return InkWell(
onTap: onTap,
onTap: onTap as void Function()?,
child: Container(
height: 56,
decoration: BoxDecoration(

View File

@@ -1,4 +1,4 @@
// @dart=2.9
import 'package:ente_auth/ente_theme_data.dart';
import 'package:flutter/material.dart';
@@ -6,14 +6,14 @@ import 'package:flutter/material.dart';
class LinearProgressDialog extends StatefulWidget {
final String message;
const LinearProgressDialog(this.message, {Key key}) : super(key: key);
const LinearProgressDialog(this.message, {Key? key}) : super(key: key);
@override
LinearProgressDialogState createState() => LinearProgressDialogState();
}
class LinearProgressDialogState extends State<LinearProgressDialog> {
double _progress;
double? _progress;
@override
void initState() {

View File

@@ -1,14 +1,32 @@
import 'package:flutter/cupertino.dart';
import 'package:ente_auth/theme/ente_theme.dart';
import 'package:flutter/material.dart';
class EnteLoadingWidget extends StatelessWidget {
const EnteLoadingWidget({Key? key}) : super(key: key);
final Color? color;
final double size;
final double padding;
final Alignment alignment;
const EnteLoadingWidget({
this.color,
this.size = 14,
this.padding = 5,
this.alignment = Alignment.center,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: const Size.square(30),
child: const CupertinoActivityIndicator(),
return Align(
alignment: alignment,
child: Padding(
padding: EdgeInsets.all(padding),
child: SizedBox.fromSize(
size: Size.square(size),
child: CircularProgressIndicator(
strokeWidth: 2,
color: color ?? getEnteColorScheme(context).strokeBase,
),
),
),
);
}

View File

@@ -1,5 +1,3 @@
// @dart=2.9
import 'package:flutter/material.dart';
enum ProgressDialogType { normal, download }
@@ -7,7 +5,7 @@ enum ProgressDialogType { normal, download }
String _dialogMessage = "Loading...";
double _progress = 0.0, _maxProgress = 100.0;
Widget _customBody;
Widget? _customBody;
TextAlign _textAlign = TextAlign.left;
Alignment _progressWidgetAlignment = Alignment.centerLeft;
@@ -15,10 +13,10 @@ Alignment _progressWidgetAlignment = Alignment.centerLeft;
TextDirection _direction = TextDirection.ltr;
bool _isShowing = false;
BuildContext _context, _dismissingContext;
ProgressDialogType _progressDialogType;
BuildContext? _context, _dismissingContext;
ProgressDialogType? _progressDialogType;
bool _barrierDismissible = true, _showLogs = false;
Color _barrierColor;
Color? _barrierColor;
TextStyle _progressTextStyle = const TextStyle(
color: Colors.black,
@@ -42,16 +40,16 @@ Widget _progressWidget = Image.asset(
);
class ProgressDialog {
_Body _dialog;
_Body? _dialog;
ProgressDialog(
BuildContext context, {
ProgressDialogType type,
bool isDismissible,
bool showLogs,
TextDirection textDirection,
Widget customBody,
Color barrierColor,
ProgressDialogType? type,
bool? isDismissible,
bool? showLogs,
TextDirection? textDirection,
Widget? customBody,
Color? barrierColor,
}) {
_context = context;
_progressDialogType = type ?? ProgressDialogType.normal;
@@ -63,20 +61,20 @@ class ProgressDialog {
}
void style({
Widget child,
double progress,
double maxProgress,
String message,
Widget progressWidget,
Color backgroundColor,
TextStyle progressTextStyle,
TextStyle messageTextStyle,
double elevation,
TextAlign textAlign,
double borderRadius,
Curve insetAnimCurve,
EdgeInsets padding,
Alignment progressWidgetAlignment,
Widget? child,
double? progress,
double? maxProgress,
String? message,
Widget? progressWidget,
Color? backgroundColor,
TextStyle? progressTextStyle,
TextStyle? messageTextStyle,
double? elevation,
TextAlign? textAlign,
double? borderRadius,
Curve? insetAnimCurve,
EdgeInsets? padding,
Alignment? progressWidgetAlignment,
}) {
if (_isShowing) return;
if (_progressDialogType == ProgressDialogType.download) {
@@ -100,12 +98,12 @@ class ProgressDialog {
}
void update({
double progress,
double maxProgress,
String message,
Widget progressWidget,
TextStyle progressTextStyle,
TextStyle messageTextStyle,
double? progress,
double? maxProgress,
String? message,
Widget? progressWidget,
TextStyle? progressTextStyle,
TextStyle? messageTextStyle,
}) {
if (_progressDialogType == ProgressDialogType.download) {
_progress = progress ?? _progress;
@@ -117,7 +115,7 @@ class ProgressDialog {
_messageStyle = messageTextStyle ?? _messageStyle;
_progressTextStyle = progressTextStyle ?? _progressTextStyle;
if (_isShowing) _dialog.update();
if (_isShowing) _dialog!.update();
}
bool isShowing() {
@@ -128,7 +126,9 @@ class ProgressDialog {
try {
if (_isShowing) {
_isShowing = false;
Navigator.of(_dismissingContext).pop();
if (_dismissingContext != null) {
Navigator.of(_dismissingContext!).pop();
}
if (_showLogs) debugPrint('ProgressDialog dismissed');
return Future.value(true);
} else {
@@ -147,7 +147,7 @@ class ProgressDialog {
if (!_isShowing) {
_dialog = _Body();
showDialog<dynamic>(
context: _context,
context: _context!,
barrierDismissible: _barrierDismissible,
barrierColor: _barrierColor,
builder: (BuildContext context) {

View File

@@ -1,4 +1,4 @@
// @dart=2.9
import 'package:ente_auth/utils/dialog_util.dart';
import 'package:flutter/material.dart';
@@ -8,7 +8,7 @@ class RenameDialog extends StatefulWidget {
final String type;
final int maxLength;
const RenameDialog(this.name, this.type, {Key key, this.maxLength = 100})
const RenameDialog(this.name, this.type, {Key? key, this.maxLength = 100})
: super(key: key);
@override
@@ -16,7 +16,7 @@ class RenameDialog extends StatefulWidget {
}
class _RenameDialogState extends State<RenameDialog> {
String _newName;
String? _newName;
@override
void initState() {
@@ -74,7 +74,7 @@ class _RenameDialogState extends State<RenameDialog> {
),
),
onPressed: () {
if (_newName.trim().isEmpty) {
if (_newName!.trim().isEmpty) {
showErrorDialog(
context,
"Empty name",
@@ -82,7 +82,7 @@ class _RenameDialogState extends State<RenameDialog> {
);
return;
}
if (_newName.trim().length > widget.maxLength) {
if (_newName!.trim().length > widget.maxLength) {
showErrorDialog(
context,
"Name too large",
@@ -90,7 +90,7 @@ class _RenameDialogState extends State<RenameDialog> {
);
return;
}
Navigator.of(context).pop(_newName.trim());
Navigator.of(context).pop(_newName!.trim());
},
),
],

View File

@@ -1,5 +1,3 @@
// @dart=2.9
import 'package:ente_auth/ui/common/loading_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
@@ -8,7 +6,7 @@ class WebPage extends StatefulWidget {
final String title;
final String url;
const WebPage(this.title, this.url, {Key key}) : super(key: key);
const WebPage(this.title, this.url, {Key? key}) : super(key: key);
@override
State<WebPage> createState() => _WebPageState();

View File

@@ -0,0 +1,221 @@
import 'dart:ui';
import 'package:ente_auth/theme/colors.dart';
import 'package:ente_auth/theme/effects.dart';
import 'package:ente_auth/theme/ente_theme.dart';
import 'package:ente_auth/ui/components/buttons/button_widget.dart';
import 'package:ente_auth/ui/components/components_constants.dart';
import 'package:ente_auth/ui/components/models/button_result.dart';
import 'package:ente_auth/ui/components/separators.dart';
import 'package:flutter/material.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
enum ActionSheetType {
defaultActionSheet,
iconOnly,
}
///Returns null if dismissed
Future<ButtonResult?> showActionSheet({
required BuildContext context,
required List<ButtonWidget> buttons,
ActionSheetType actionSheetType = ActionSheetType.defaultActionSheet,
bool enableDrag = true,
bool isDismissible = true,
bool isCheckIconGreen = false,
String? title,
Widget? bodyWidget,
String? body,
String? bodyHighlight,
}) {
return showMaterialModalBottomSheet(
backgroundColor: Colors.transparent,
barrierColor: backdropFaintDark,
useRootNavigator: true,
context: context,
isDismissible: isDismissible,
enableDrag: enableDrag,
builder: (_) {
return ActionSheetWidget(
title: title,
bodyWidget: bodyWidget,
body: body,
bodyHighlight: bodyHighlight,
actionButtons: buttons,
actionSheetType: actionSheetType,
isCheckIconGreen: isCheckIconGreen,
);
},
);
}
class ActionSheetWidget extends StatelessWidget {
final String? title;
final Widget? bodyWidget;
final String? body;
final String? bodyHighlight;
final List<ButtonWidget> actionButtons;
final ActionSheetType actionSheetType;
final bool isCheckIconGreen;
const ActionSheetWidget({
required this.actionButtons,
required this.actionSheetType,
required this.isCheckIconGreen,
this.title,
this.bodyWidget,
this.body,
this.bodyHighlight,
super.key,
});
@override
Widget build(BuildContext context) {
final isTitleAndBodyNull =
title == null && bodyWidget == null && body == null;
final blur = MediaQuery.of(context).platformBrightness == Brightness.light
? blurMuted
: blurBase;
final extraWidth = MediaQuery.of(context).size.width - restrictedMaxWidth;
final double? horizontalPadding = extraWidth > 0 ? extraWidth / 2 : null;
return Padding(
padding: EdgeInsets.fromLTRB(
horizontalPadding ?? 12,
12,
horizontalPadding ?? 12,
32,
),
child: Container(
decoration: BoxDecoration(boxShadow: shadowMenuLight),
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: blur, sigmaY: blur),
child: Container(
color: backdropMutedDark,
child: Padding(
padding: EdgeInsets.fromLTRB(
24,
24,
24,
isTitleAndBodyNull ? 24 : 28,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
isTitleAndBodyNull
? const SizedBox.shrink()
: Padding(
padding: const EdgeInsets.only(bottom: 36),
child: ContentContainerWidget(
title: title,
bodyWidget: bodyWidget,
body: body,
bodyHighlight: bodyHighlight,
actionSheetType: actionSheetType,
isCheckIconGreen: isCheckIconGreen,
),
),
ActionButtons(
actionButtons,
),
],
),
),
),
),
),
),
);
}
}
class ContentContainerWidget extends StatelessWidget {
final String? title;
final Widget? bodyWidget;
final String? body;
final String? bodyHighlight;
final ActionSheetType actionSheetType;
final bool isCheckIconGreen;
const ContentContainerWidget({
required this.actionSheetType,
required this.isCheckIconGreen,
this.title,
this.bodyWidget,
this.body,
this.bodyHighlight,
super.key,
});
@override
Widget build(BuildContext context) {
final textTheme = getEnteTextTheme(context);
final bool bodyMissing = body == null && bodyWidget == null;
debugPrint("body missing $bodyMissing");
return Column(
mainAxisSize: MainAxisSize.min,
//todo: set cross axis to center when icon should be shown in place of body
crossAxisAlignment: actionSheetType == ActionSheetType.defaultActionSheet
? CrossAxisAlignment.stretch
: CrossAxisAlignment.center,
children: [
title == null
? const SizedBox.shrink()
: Text(
title!,
style: textTheme.largeBold
.copyWith(color: textBaseDark), //constant color
),
title == null || bodyMissing
? const SizedBox.shrink()
: const SizedBox(height: 19),
actionSheetType == ActionSheetType.defaultActionSheet
? bodyMissing
? const SizedBox.shrink()
: (bodyWidget != null
? bodyWidget!
: Text(
body!,
style: textTheme.body
.copyWith(color: textMutedDark), //constant color
))
: Icon(
Icons.check_outlined,
size: 48,
color: isCheckIconGreen
? getEnteColorScheme(context).primary700
: strokeBaseDark,
),
actionSheetType == ActionSheetType.defaultActionSheet &&
bodyHighlight != null
? Padding(
padding: const EdgeInsets.only(top: 19.0),
child: Text(
bodyHighlight!,
style: textTheme.body
.copyWith(color: textBaseDark), //constant color
),
)
: const SizedBox.shrink(),
],
);
}
}
class ActionButtons extends StatelessWidget {
final List<Widget> actionButtons;
const ActionButtons(this.actionButtons, {super.key});
@override
Widget build(BuildContext context) {
final actionButtonsWithSeparators = actionButtons;
return Column(
children:
//Separator height is 8pts in figma. -2pts here as the action
//buttons are 2pts extra in height in code compared to figma because
//of the border(1pt top + 1pt bottom) of action buttons.
addSeparators(actionButtonsWithSeparators, const SizedBox(height: 6)),
);
}
}

Some files were not shown because too many files have changed in this diff Show More