Compare commits

...

221 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
vishnukvmd
86be8482b7 Merge branch 'main' into independent 2022-11-28 13:07:08 +05:30
vishnukvmd
3e49cfbe5f Merge branch 'main' into independent 2022-11-28 13:06:41 +05:30
vishnukvmd
02ffe72cca Revert "Disable OpenFile to please PlayStore overlords"
This reverts commit a5cac1579b.
2022-11-24 16:15:24 +05:30
154 changed files with 6867 additions and 2743 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

View File

@@ -3,6 +3,8 @@
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
@@ -33,7 +35,7 @@ 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.
@@ -45,23 +47,38 @@ file, that adheres to the above format.
### Android
This repository's [GitHub releases](https://github.com/ente-io/auth/releases/latest/download/ente-auth.apks) contains APKs, built straight from source. These builds keep themselves updated, without relying on third party stores.
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.
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 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>
### iOS
<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 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, Mac and Windows) is a [work in progress](https://github.com/ente-io/auth/tree/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.
@@ -69,7 +86,7 @@ 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/index.md).
tokens has been documented [here](architecture/README.md).
## 🧑‍💻 Building from source
@@ -80,16 +97,26 @@ tokens has been documented [here](architecture/index.md).
4. For Android, run `flutter build apk --release --flavor independent`
5. For iOS, run `flutter build ios`
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.
On the other hand, if you wish to support us, please
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

@@ -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
@@ -54,7 +54,7 @@ PODS:
- 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
@@ -69,38 +69,42 @@ PODS:
- 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`)
@@ -113,12 +117,13 @@ DEPENDENCIES:
- fluttertoast (from `.symlinks/plugins/fluttertoast/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:
@@ -164,18 +169,20 @@ EXTERNAL SOURCES:
: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
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

@@ -31,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";
@@ -39,8 +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 hasMigratedSecureStorageKey = "has_migrated_secure_storage";
final kTempFolderDeletionTimeBuffer = const Duration(days: 1).inMicroseconds;
@@ -64,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);
@@ -453,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;
}
@@ -471,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) {
@@ -486,7 +477,7 @@ class Configuration {
iOptions: _secureStorageOptionsIOS,
);
await _preferences.setBool(
hasMigratedSecureStorageToFirstUnlockKey,
hasMigratedSecureStorageKey,
true,
);
}

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;
@@ -20,8 +19,6 @@ import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:uuid/uuid.dart';
typedef FutureOrVoidCallback = FutureOr<void> Function();
extension SuperString on String {
Iterable<String> chunked(int chunkSize) sync* {
var start = 0;
@@ -40,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";
@@ -78,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.
///
@@ -97,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].
///
@@ -115,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;
@@ -144,77 +141,78 @@ class SuperLogging {
static final $ = Logger('ente_logging');
/// The current super logging configuration
static LogConfig config;
static late LogConfig config;
static SharedPreferences _preferences;
static late SharedPreferences _preferences;
static const keyShouldReportErrors = "should_report_errors";
static const keyAnonymousUserID = "anonymous_user_id";
static Future<void> main([LogConfig config]) async {
config ??= LogConfig();
SuperLogging.config = config;
static Future<void> main([LogConfig? appConfig]) async {
appConfig ??= LogConfig();
SuperLogging.config = appConfig;
WidgetsFlutterBinding.ensureInitialized();
_preferences = await SharedPreferences.getInstance();
appVersion ??= await getAppVersion();
final loggingEnabled = config.enableInDebugMode || kReleaseMode;
final enable = appConfig.enableInDebugMode || kReleaseMode;
sentryIsEnabled =
loggingEnabled && config.sentryDsn != null && shouldReportErrors();
fileIsEnabled = loggingEnabled && config.logDirPath != null;
enable && appConfig.sentryDsn != null && shouldReportErrors();
fileIsEnabled = enable && appConfig.logDirPath != null;
if (fileIsEnabled) {
await setupLogDir();
}
if (sentryIsEnabled) {
setupSentry();
}
Logger.root.level = Level.ALL;
Logger.root.onRecord.listen(onLogRecord);
if (sentryIsEnabled) {
setupSentry();
} else {
$.info("Sentry is disabled");
}
if (!loggingEnabled) {
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 (loggingEnabled && sentryIsEnabled) {
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,
@@ -230,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);
@@ -251,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);
}
}
@@ -268,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();
@@ -292,7 +282,7 @@ 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");
@@ -318,7 +308,7 @@ class SuperLogging {
static bool shouldReportErrors() {
if (_preferences.containsKey(keyShouldReportErrors)) {
return _preferences.getBool(keyShouldReportErrors);
return _preferences.getBool(keyShouldReportErrors)!;
} else {
return false;
}
@@ -333,22 +323,22 @@ class SuperLogging {
//ignore: prefer_const_constructors
await _preferences.setString(keyAnonymousUserID, Uuid().v4());
}
return _preferences.getString(keyAnonymousUserID);
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]
@@ -361,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);
@@ -385,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,12 +1,13 @@
{
"@@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",
@@ -15,10 +16,218 @@
"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)",
"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,10 +1,11 @@
// @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';
@@ -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(
@@ -57,7 +69,7 @@ Future _runWithLogs(Function() function, {String prefix = ""}) async {
);
}
Future<void> _init(bool bool, {String via}) async {
Future<void> _init(bool bool, {String? via}) async {
CryptoUtil.init();
await PreferenceService.instance.init();
await CodeStore.instance.init();

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

@@ -46,7 +46,7 @@ class Code {
account +
"?algorithm=SHA1&digits=6&issuer=" +
issuer +
"period=30&secret=" +
"&period=30&secret=" +
secret,
);
}
@@ -67,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 "";
}
@@ -75,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 "";
}
@@ -113,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

@@ -104,16 +104,23 @@ 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(),
_issuerController.text.trim(),
_secretController.text.trim(),
_secretController.text.trim().replaceAll(' ', ''),
);
// Verify the validity of the code
getTotp(code);
@@ -142,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,6 +8,7 @@ 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';
@@ -132,6 +133,13 @@ class AuthenticatorService {
await _localToRemoteSync();
_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);
}
@@ -140,7 +148,7 @@ class AuthenticatorService {
Future<void> _remoteToLocalSync() async {
_logger.info('Initiating remote to local sync');
final int lastSyncTime = _prefs.getInt(_lastEntitySyncTime) ?? 0;
_logger.info("Current synctime is " + lastSyncTime.toString());
_logger.info("Current sync is " + lastSyncTime.toString());
const int fetchLimit = 500;
final List<AuthEntity> result =
await _gateway.getDiff(lastSyncTime, limit: fetchLimit);

View File

@@ -1,5 +1,3 @@
// @dart=2.9
import 'dart:io';
import 'package:dio/dio.dart';
@@ -32,10 +30,11 @@ class BillingService {
bool _isOnSubscriptionPage = false;
Future<BillingPlans> _future;
Subscription? _cachedSubscription;
Future<void> init() async {
}
Future<BillingPlans>? _future;
Future<void> init() async {}
void clearCache() {
_future = null;
@@ -48,7 +47,7 @@ class BillingService {
.then((response) {
return BillingPlans.fromMap(response.data);
});
return _future;
return _future!;
}
Future<Response<dynamic>> _fetchPrivateBillingPlans() {
@@ -88,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;
@@ -99,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

@@ -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

@@ -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,14 +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;
@@ -22,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(
@@ -63,7 +68,7 @@ class _CodeWidgetState extends State<CodeWidget> {
foregroundColor:
Theme.of(context).colorScheme.inverseBackgroundColor,
icon: Icons.edit_outlined,
label: 'Edit',
label: l10n.edit,
padding: const EdgeInsets.only(left: 4, right: 0),
spacing: 8,
),
@@ -76,7 +81,7 @@ class _CodeWidgetState extends State<CodeWidget> {
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,
),
@@ -105,14 +110,8 @@ 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,
@@ -127,15 +126,13 @@ class _CodeWidgetState extends State<CodeWidget> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
Uri.decodeFull(widget.code.issuer).trim(),
safeDecode(widget.code.issuer).trim(),
style:
Theme.of(context).textTheme.headline6,
),
const SizedBox(height: 2),
Text(
Uri.decodeFull(
widget.code.account,
).trim(),
safeDecode(widget.code.account).trim(),
style: Theme.of(context)
.textTheme
.caption
@@ -165,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,
),
);
},
),
],
),
@@ -205,9 +212,8 @@ 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 {
@@ -224,20 +230,21 @@ class _CodeWidgetState extends State<CodeWidget> {
}
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,
),
),
@@ -248,7 +255,7 @@ class _CodeWidgetState extends State<CodeWidget> {
),
TextButton(
child: Text(
"Cancel",
l10n.cancel,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
),
@@ -269,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;
}
}
@@ -281,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)),
);
}
}

View File

@@ -0,0 +1,526 @@
import 'package:ente_auth/models/execution_states.dart';
import 'package:ente_auth/models/typedefs.dart';
import 'package:ente_auth/theme/colors.dart';
import 'package:ente_auth/theme/ente_theme.dart';
import 'package:ente_auth/theme/text_style.dart';
import 'package:ente_auth/ui/common/loading_widget.dart';
import 'package:ente_auth/ui/components/models/button_result.dart';
import 'package:ente_auth/ui/components/models/button_type.dart';
import 'package:ente_auth/ui/components/models/custom_button_style.dart';
import 'package:ente_auth/utils/debouncer.dart';
import "package:ente_auth/utils/dialog_util.dart";
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
enum ButtonSize { small, large }
enum ButtonAction { first, second, third, fourth, cancel, error }
class ButtonWidget extends StatelessWidget {
final IconData? icon;
final String? labelText;
final ButtonType buttonType;
final FutureVoidCallback? onTap;
final bool isDisabled;
final ButtonSize buttonSize;
///Setting this flag to true will show a success confirmation as a 'check'
///icon once the onTap(). This is expected to be used only if time taken to
///execute onTap() takes less than debouce time.
final bool shouldShowSuccessConfirmation;
///Setting this flag to false will restrict the loading and success states of
///the button from surfacing on the UI. The ExecutionState of the button will
///change irrespective of the value of this flag. Only that it won't be
///surfaced on the UI
final bool shouldSurfaceExecutionStates;
/// iconColor should only be specified when we do not want to honor the default
/// iconColor based on buttonType. Most of the items, default iconColor is what
/// we need unless we want to pop out the icon in a non-primary button type
final Color? iconColor;
///Button action will only work if isInAlert is true
final ButtonAction? buttonAction;
///setting this flag to true will make the button appear like how it would
///on dark theme irrespective of the app's theme.
final bool shouldStickToDarkTheme;
///isInAlert is to dismiss the alert if the action on the button is completed.
///This should be set to true if the alert which uses this button needs to
///return the Button's action.
final bool isInAlert;
/// progressStatus can be used to display information about the action
/// progress when ExecutionState is in Progress.
final ValueNotifier<String>? progressStatus;
const ButtonWidget({
Key? key,
required this.buttonType,
this.buttonSize = ButtonSize.large,
this.icon,
this.labelText,
this.onTap,
this.shouldStickToDarkTheme = false,
this.isDisabled = false,
this.buttonAction,
this.isInAlert = false,
this.iconColor,
this.shouldSurfaceExecutionStates = true,
this.progressStatus,
this.shouldShowSuccessConfirmation = false,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final colorScheme =
shouldStickToDarkTheme ? darkScheme : getEnteColorScheme(context);
final inverseColorScheme = shouldStickToDarkTheme
? lightScheme
: getEnteColorScheme(context, inverse: true);
final textTheme =
shouldStickToDarkTheme ? darkTextTheme : getEnteTextTheme(context);
final inverseTextTheme = shouldStickToDarkTheme
? lightTextTheme
: getEnteTextTheme(context, inverse: true);
final buttonStyle = CustomButtonStyle(
//Dummy default values since we need to keep these properties non-nullable
defaultButtonColor: Colors.transparent,
defaultBorderColor: Colors.transparent,
defaultIconColor: Colors.transparent,
defaultLabelStyle: textTheme.body,
);
buttonStyle.defaultButtonColor = buttonType.defaultButtonColor(colorScheme);
buttonStyle.pressedButtonColor = buttonType.pressedButtonColor(colorScheme);
buttonStyle.disabledButtonColor =
buttonType.disabledButtonColor(colorScheme, buttonSize);
buttonStyle.defaultBorderColor =
buttonType.defaultBorderColor(colorScheme, buttonSize);
buttonStyle.pressedBorderColor = buttonType.pressedBorderColor(
colorScheme: colorScheme,
buttonSize: buttonSize,
);
buttonStyle.disabledBorderColor =
buttonType.disabledBorderColor(colorScheme, buttonSize);
buttonStyle.defaultIconColor = iconColor ??
buttonType.defaultIconColor(
colorScheme: colorScheme,
inverseColorScheme: inverseColorScheme,
);
buttonStyle.pressedIconColor =
buttonType.pressedIconColor(colorScheme, buttonSize);
buttonStyle.disabledIconColor =
buttonType.disabledIconColor(colorScheme, buttonSize);
buttonStyle.defaultLabelStyle = buttonType.defaultLabelStyle(
textTheme: textTheme,
inverseTextTheme: inverseTextTheme,
);
buttonStyle.pressedLabelStyle =
buttonType.pressedLabelStyle(textTheme, colorScheme, buttonSize);
buttonStyle.disabledLabelStyle =
buttonType.disabledLabelStyle(textTheme, colorScheme);
buttonStyle.checkIconColor = buttonType.checkIconColor(colorScheme);
return ButtonChildWidget(
buttonStyle: buttonStyle,
buttonType: buttonType,
isDisabled: isDisabled,
buttonSize: buttonSize,
isInAlert: isInAlert,
onTap: onTap,
labelText: labelText,
icon: icon,
buttonAction: buttonAction,
shouldSurfaceExecutionStates: shouldSurfaceExecutionStates,
progressStatus: progressStatus,
shouldShowSuccessConfirmation: shouldShowSuccessConfirmation,
);
}
}
class ButtonChildWidget extends StatefulWidget {
final CustomButtonStyle buttonStyle;
final FutureVoidCallback? onTap;
final ButtonType buttonType;
final String? labelText;
final IconData? icon;
final bool isDisabled;
final ButtonSize buttonSize;
final ButtonAction? buttonAction;
final bool isInAlert;
final bool shouldSurfaceExecutionStates;
final ValueNotifier<String>? progressStatus;
final bool shouldShowSuccessConfirmation;
const ButtonChildWidget({
Key? key,
required this.buttonStyle,
required this.buttonType,
required this.isDisabled,
required this.buttonSize,
required this.isInAlert,
required this.shouldSurfaceExecutionStates,
required this.shouldShowSuccessConfirmation,
this.progressStatus,
this.onTap,
this.labelText,
this.icon,
this.buttonAction,
}) : super(key: key);
@override
State<ButtonChildWidget> createState() => _ButtonChildWidgetState();
}
class _ButtonChildWidgetState extends State<ButtonChildWidget> {
late Color buttonColor;
late Color borderColor;
late Color iconColor;
late TextStyle labelStyle;
late Color checkIconColor;
late Color loadingIconColor;
ValueNotifier<String>? progressStatus;
///This is used to store the width of the button in idle state (small button)
///to be used as width for the button when the loading/succes states comes.
double? widthOfButton;
final _debouncer = Debouncer(const Duration(milliseconds: 300));
ExecutionState executionState = ExecutionState.idle;
Exception? _exception;
@override
void initState() {
_setButtonTheme();
super.initState();
}
@override
void didUpdateWidget(covariant ButtonChildWidget oldWidget) {
_setButtonTheme();
super.didUpdateWidget(oldWidget);
}
@override
Widget build(BuildContext context) {
if (executionState == ExecutionState.successful) {
Future.delayed(Duration(seconds: widget.isInAlert ? 1 : 2), () {
setState(() {
executionState = ExecutionState.idle;
});
});
}
return GestureDetector(
onTap: _shouldRegisterGestures ? _onTap : null,
onTapDown: _shouldRegisterGestures ? _onTapDown : null,
onTapUp: _shouldRegisterGestures ? _onTapUp : null,
onTapCancel: _shouldRegisterGestures ? _onTapCancel : null,
child: Container(
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(4)),
border: widget.buttonType == ButtonType.tertiaryCritical
? Border.all(color: borderColor)
: null,
),
child: AnimatedContainer(
duration: const Duration(milliseconds: 16),
width: widget.buttonSize == ButtonSize.large ? double.infinity : null,
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(4)),
color: buttonColor,
),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 14, horizontal: 16),
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 175),
switchInCurve: Curves.easeInOutExpo,
switchOutCurve: Curves.easeInOutExpo,
child: executionState == ExecutionState.idle ||
!widget.shouldSurfaceExecutionStates
? widget.buttonType.hasTrailingIcon
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
widget.labelText == null
? const SizedBox.shrink()
: Flexible(
child: Padding(
padding: widget.icon == null
? const EdgeInsets.symmetric(
horizontal: 8,
)
: const EdgeInsets.only(right: 16),
child: Text(
widget.labelText!,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: labelStyle,
),
),
),
widget.icon == null
? const SizedBox.shrink()
: Icon(
widget.icon,
size: 20,
color: iconColor,
),
],
)
: Builder(
builder: (context) {
SchedulerBinding.instance.addPostFrameCallback(
(timeStamp) {
final box =
context.findRenderObject() as RenderBox;
widthOfButton = box.size.width;
},
);
return Row(
mainAxisSize:
widget.buttonSize == ButtonSize.large
? MainAxisSize.max
: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
widget.icon == null
? const SizedBox.shrink()
: Icon(
widget.icon,
size: 20,
color: iconColor,
),
widget.icon == null || widget.labelText == null
? const SizedBox.shrink()
: const SizedBox(width: 8),
widget.labelText == null
? const SizedBox.shrink()
: Flexible(
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8,
),
child: Text(
widget.labelText!,
style: labelStyle,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
)
],
);
},
)
: executionState == ExecutionState.inProgress
? SizedBox(
width: widthOfButton,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
progressStatus == null
? const SizedBox.shrink()
: ValueListenableBuilder<String>(
valueListenable: progressStatus!,
builder: (
BuildContext context,
String value,
Widget? child,
) {
return Padding(
padding:
const EdgeInsets.only(right: 8.0),
child: Text(
value,
style: lightTextTheme.smallBold,
),
);
},
),
EnteLoadingWidget(
padding: 3,
color: loadingIconColor,
),
],
),
)
: executionState == ExecutionState.successful
? SizedBox(
width: widthOfButton,
child: Icon(
Icons.check_outlined,
size: 20,
color: checkIconColor,
),
)
: const SizedBox.shrink(), //fallback
),
),
),
),
);
}
void _setButtonTheme() {
progressStatus = widget.progressStatus;
checkIconColor = widget.buttonStyle.checkIconColor ??
widget.buttonStyle.defaultIconColor;
loadingIconColor = widget.buttonStyle.defaultIconColor;
if (widget.isDisabled) {
buttonColor = widget.buttonStyle.disabledButtonColor ??
widget.buttonStyle.defaultButtonColor;
borderColor = widget.buttonStyle.disabledBorderColor ??
widget.buttonStyle.defaultBorderColor;
iconColor = widget.buttonStyle.disabledIconColor ??
widget.buttonStyle.defaultIconColor;
labelStyle = widget.buttonStyle.disabledLabelStyle ??
widget.buttonStyle.defaultLabelStyle;
} else {
buttonColor = widget.buttonStyle.defaultButtonColor;
borderColor = widget.buttonStyle.defaultBorderColor;
iconColor = widget.buttonStyle.defaultIconColor;
labelStyle = widget.buttonStyle.defaultLabelStyle;
}
}
bool get _shouldRegisterGestures =>
!widget.isDisabled && executionState == ExecutionState.idle;
void _onTap() async {
if (widget.onTap != null) {
_debouncer.run(
() => Future(() {
setState(() {
executionState = ExecutionState.inProgress;
});
}),
);
await widget.onTap!.call().then(
(value) {
_exception = null;
},
onError: (error, stackTrace) {
executionState = ExecutionState.error;
_exception = error as Exception;
_debouncer.cancelDebounce();
},
);
widget.shouldShowSuccessConfirmation && _debouncer.isActive()
? executionState = ExecutionState.successful
: null;
_debouncer.cancelDebounce();
if (executionState == ExecutionState.successful) {
setState(() {});
}
// when the time taken by widget.onTap is approximately equal to the debounce
// time, the callback is getting executed when/after the if condition
// below is executing/executed which results in execution state stuck at
// idle state. This Future is for delaying the execution of the if
// condition so that the calback in the debouncer finishes execution before.
await Future.delayed(const Duration(milliseconds: 5));
}
if (executionState == ExecutionState.inProgress ||
executionState == ExecutionState.error) {
if (executionState == ExecutionState.inProgress) {
if (mounted) {
setState(() {
executionState = ExecutionState.successful;
Future.delayed(
Duration(
seconds: widget.shouldSurfaceExecutionStates
? (widget.isInAlert ? 1 : 2)
: 0,
), () {
widget.isInAlert
? _popWithButtonAction(
context,
buttonAction: widget.buttonAction,
)
: null;
if (mounted) {
setState(() {
executionState = ExecutionState.idle;
});
}
});
});
}
}
if (executionState == ExecutionState.error) {
setState(() {
executionState = ExecutionState.idle;
widget.isInAlert
? Future.delayed(
const Duration(seconds: 0),
() => _popWithButtonAction(
context,
buttonAction: ButtonAction.error,
exception: _exception,
),
)
: null;
});
}
} else {
if (widget.isInAlert) {
Future.delayed(
Duration(seconds: widget.shouldShowSuccessConfirmation ? 1 : 0),
() =>
_popWithButtonAction(context, buttonAction: widget.buttonAction),
);
}
}
}
void _popWithButtonAction(
BuildContext context, {
required ButtonAction? buttonAction,
Exception? exception,
}) {
if (Navigator.of(context).canPop()) {
Navigator.of(context).pop(ButtonResult(widget.buttonAction, exception));
} else if (exception != null) {
//This is to show the execution was unsuccessful if the dialog is manually
//closed before the execution completes.
showGenericErrorDialog(context: context);
}
}
void _onTapDown(details) {
setState(() {
buttonColor = widget.buttonStyle.pressedButtonColor ??
widget.buttonStyle.defaultButtonColor;
borderColor = widget.buttonStyle.pressedBorderColor ??
widget.buttonStyle.defaultBorderColor;
iconColor = widget.buttonStyle.pressedIconColor ??
widget.buttonStyle.defaultIconColor;
labelStyle = widget.buttonStyle.pressedLabelStyle ??
widget.buttonStyle.defaultLabelStyle;
});
}
void _onTapUp(details) {
Future.delayed(
const Duration(milliseconds: 84),
() => setState(() {
setAllStylesToDefault();
}),
);
}
void _onTapCancel() {
setState(() {
setAllStylesToDefault();
});
}
void setAllStylesToDefault() {
buttonColor = widget.buttonStyle.defaultButtonColor;
borderColor = widget.buttonStyle.defaultBorderColor;
iconColor = widget.buttonStyle.defaultIconColor;
labelStyle = widget.buttonStyle.defaultLabelStyle;
}
}

View File

@@ -0,0 +1,109 @@
import 'package:ente_auth/theme/colors.dart';
import 'package:ente_auth/theme/ente_theme.dart';
import 'package:flutter/material.dart';
enum IconButtonType {
primary,
secondary,
rounded,
}
class IconButtonWidget extends StatefulWidget {
final IconButtonType iconButtonType;
final IconData icon;
final bool disableGestureDetector;
final VoidCallback? onTap;
final Color? defaultColor;
final Color? pressedColor;
final Color? iconColor;
const IconButtonWidget({
Key? key,
required this.icon,
required this.iconButtonType,
this.disableGestureDetector = false,
this.onTap,
this.defaultColor,
this.pressedColor,
this.iconColor,
}) : super(key: key);
@override
State<IconButtonWidget> createState() => _IconButtonWidgetState();
}
class _IconButtonWidgetState extends State<IconButtonWidget> {
Color? iconStateColor;
@override
void didChangeDependencies() {
setState(() {
iconStateColor = null;
});
super.didChangeDependencies();
}
@override
Widget build(BuildContext context) {
final bool hasPressedState = widget.onTap != null;
final colorTheme = getEnteColorScheme(context);
iconStateColor ??
(iconStateColor = widget.defaultColor ??
(widget.iconButtonType == IconButtonType.rounded
? colorTheme.fillFaint
: null));
return widget.disableGestureDetector
? _iconButton(colorTheme)
: GestureDetector(
onTapDown: hasPressedState ? _onTapDown : null,
onTapUp: hasPressedState ? _onTapUp : null,
onTapCancel: hasPressedState ? _onTapCancel : null,
onTap: widget.onTap,
child: _iconButton(colorTheme),
);
}
Widget _iconButton(EnteColorScheme colorTheme) {
return Padding(
padding: const EdgeInsets.all(4.0),
child: AnimatedContainer(
duration: const Duration(milliseconds: 20),
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: iconStateColor,
),
child: Icon(
widget.icon,
color: widget.iconColor ??
(widget.iconButtonType == IconButtonType.secondary
? colorTheme.strokeMuted
: colorTheme.strokeBase),
size: 24,
),
),
);
}
_onTapDown(details) {
final colorTheme = getEnteColorScheme(context);
setState(() {
iconStateColor = widget.pressedColor ??
(widget.iconButtonType == IconButtonType.rounded
? colorTheme.fillMuted
: colorTheme.fillFaint);
});
}
_onTapUp(details) {
Future.delayed(const Duration(milliseconds: 100), () {
setState(() {
iconStateColor = null;
});
});
}
_onTapCancel() {
setState(() {
iconStateColor = null;
});
}
}

View File

@@ -0,0 +1,4 @@
const double mobileSmallThreshold = 336;
//Screen width of iPhone 14 pro max in points is taken as maximum
const double restrictedMaxWidth = 430;

View File

@@ -0,0 +1,286 @@
import 'dart:math';
import 'package:ente_auth/l10n/l10n.dart';
import 'package:ente_auth/models/typedefs.dart';
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/models/button_type.dart';
import 'package:ente_auth/ui/components/separators.dart';
import 'package:ente_auth/ui/components/text_input_widget.dart';
import 'package:flutter/material.dart';
///Will return null if dismissed by tapping outside
Future<ButtonResult?> showDialogWidget({
required BuildContext context,
required String title,
String? body,
required List<ButtonWidget> buttons,
IconData? icon,
bool isDismissible = true,
}) {
return showDialog(
barrierDismissible: isDismissible,
barrierColor: backdropFaintDark,
context: context,
builder: (context) {
final widthOfScreen = MediaQuery.of(context).size.width;
final isMobileSmall = widthOfScreen <= mobileSmallThreshold;
return Padding(
padding: EdgeInsets.symmetric(horizontal: isMobileSmall ? 8 : 0),
child: Dialog(
insetPadding: EdgeInsets.zero,
child: DialogWidget(
title: title,
body: body,
buttons: buttons,
icon: icon,
),
),
);
},
);
}
class DialogWidget extends StatelessWidget {
final String title;
final String? body;
final List<ButtonWidget> buttons;
final IconData? icon;
const DialogWidget({
required this.title,
this.body,
required this.buttons,
this.icon,
super.key,
});
@override
Widget build(BuildContext context) {
final widthOfScreen = MediaQuery.of(context).size.width;
final isMobileSmall = widthOfScreen <= mobileSmallThreshold;
final colorScheme = getEnteColorScheme(context);
return Container(
width: min(widthOfScreen, 320),
padding: isMobileSmall
? const EdgeInsets.all(0)
: const EdgeInsets.fromLTRB(6, 8, 6, 6),
decoration: BoxDecoration(
color: colorScheme.backgroundElevated,
boxShadow: shadowFloatLight,
borderRadius: const BorderRadius.all(Radius.circular(8)),
),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ContentContainer(
title: title,
body: body,
icon: icon,
),
const SizedBox(height: 36),
Actions(buttons),
],
),
),
);
}
}
class ContentContainer extends StatelessWidget {
final String title;
final String? body;
final IconData? icon;
const ContentContainer({
required this.title,
this.body,
this.icon,
super.key,
});
@override
Widget build(BuildContext context) {
final textTheme = getEnteTextTheme(context);
final colorScheme = getEnteColorScheme(context);
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
icon == null
? const SizedBox.shrink()
: Row(
children: [
Icon(
icon,
size: 32,
),
],
),
icon == null ? const SizedBox.shrink() : const SizedBox(height: 19),
Text(title, style: textTheme.largeBold),
body != null ? const SizedBox(height: 19) : const SizedBox.shrink(),
body != null
? Text(
body!,
style: textTheme.body.copyWith(color: colorScheme.textMuted),
)
: const SizedBox.shrink(),
],
);
}
}
class Actions extends StatelessWidget {
final List<ButtonWidget> buttons;
const Actions(this.buttons, {super.key});
@override
Widget build(BuildContext context) {
return Column(
children: addSeparators(
buttons,
const SizedBox(
// In figma this white space is of height 8pts. But the Button
// component has 1pts of invisible border by default in code. So two
// 1pts borders will visually make the whitespace 8pts.
// Height of button component in figma = 48, in code = 50 (2pts for
// top + bottom border)
height: 6,
),
),
);
}
}
class TextInputDialog extends StatefulWidget {
final String title;
final String? body;
final String submitButtonLabel;
final IconData? icon;
final String? label;
final String? message;
final FutureVoidCallbackParamStr onSubmit;
final String? hintText;
final IconData? prefixIcon;
final String? initialValue;
final Alignment? alignMessage;
final int? maxLength;
final bool showOnlyLoadingState;
final TextCapitalization? textCapitalization;
final bool alwaysShowSuccessState;
final bool isPasswordInput;
const TextInputDialog({
required this.title,
this.body,
required this.submitButtonLabel,
required this.onSubmit,
this.icon,
this.label,
this.message,
this.hintText,
this.prefixIcon,
this.initialValue,
this.alignMessage,
this.maxLength,
this.textCapitalization,
this.showOnlyLoadingState = false,
this.alwaysShowSuccessState = false,
this.isPasswordInput = false,
super.key,
});
@override
State<TextInputDialog> createState() => _TextInputDialogState();
}
class _TextInputDialogState extends State<TextInputDialog> {
//the value of this ValueNotifier has no significance
final _submitNotifier = ValueNotifier(false);
@override
void dispose() {
_submitNotifier.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final widthOfScreen = MediaQuery.of(context).size.width;
final isMobileSmall = widthOfScreen <= mobileSmallThreshold;
final colorScheme = getEnteColorScheme(context);
return Container(
width: min(widthOfScreen, 320),
padding: isMobileSmall
? const EdgeInsets.all(0)
: const EdgeInsets.fromLTRB(6, 8, 6, 6),
decoration: BoxDecoration(
color: colorScheme.backgroundElevated,
boxShadow: shadowFloatLight,
borderRadius: const BorderRadius.all(Radius.circular(8)),
),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ContentContainer(
title: widget.title,
body: widget.body,
icon: widget.icon,
),
Padding(
padding: const EdgeInsets.only(top: 19),
child: TextInputWidget(
label: widget.label,
message: widget.message,
hintText: widget.hintText,
prefixIcon: widget.prefixIcon,
initialValue: widget.initialValue,
alignMessage: widget.alignMessage,
autoFocus: true,
maxLength: widget.maxLength,
submitNotifier: _submitNotifier,
onSubmit: widget.onSubmit,
popNavAfterSubmission: true,
showOnlyLoadingState: widget.showOnlyLoadingState,
textCapitalization: widget.textCapitalization,
alwaysShowSuccessState: widget.alwaysShowSuccessState,
isPasswordInput: widget.isPasswordInput,
),
),
const SizedBox(height: 36),
Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: ButtonWidget(
buttonType: ButtonType.secondary,
buttonSize: ButtonSize.small,
labelText: context.l10n.cancel,
isInAlert: true,
),
),
const SizedBox(width: 8),
Expanded(
child: ButtonWidget(
buttonSize: ButtonSize.small,
buttonType: ButtonType.neutral,
labelText: widget.submitButtonLabel,
onTap: () async {
_submitNotifier.value = !_submitNotifier.value;
},
),
),
],
)
],
),
),
);
}
}

View File

@@ -0,0 +1,69 @@
import 'package:ente_auth/theme/ente_theme.dart';
import 'package:flutter/material.dart';
enum DividerType {
solid,
menu,
menuNoIcon,
bottomBar,
}
class DividerWidget extends StatelessWidget {
final DividerType dividerType;
final Color bgColor;
final bool divColorHasBlur;
final EdgeInsets? padding;
const DividerWidget({
Key? key,
required this.dividerType,
this.bgColor = Colors.transparent,
this.divColorHasBlur = true,
this.padding,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final dividerColor = divColorHasBlur
? getEnteColorScheme(context).blurStrokeFaint
: getEnteColorScheme(context).strokeFaint;
if (dividerType == DividerType.solid) {
return Container(
color: getEnteColorScheme(context).strokeFaint,
width: double.infinity,
height: 1,
);
}
if (dividerType == DividerType.bottomBar) {
return Container(
color: dividerColor,
width: double.infinity,
height: 1,
);
}
return Container(
color: bgColor,
padding: padding ?? EdgeInsets.zero,
child: Row(
children: [
SizedBox(
width: dividerType == DividerType.menu
? 48
: dividerType == DividerType.menuNoIcon
? 16
: 0,
height: 1,
),
Expanded(
child: Container(
color: dividerColor,
height: 1,
width: double.infinity,
),
),
],
),
);
}
}

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