Matthew Finkel pushed to branch tor-browser-84.0.0b2-10.5-1 at The Tor Project / Applications / fenix
Commits:
-
5ad0f655
by Matthew Finkel at 2020-12-01T21:49:39+00:00
-
6c98973b
by Matthew Finkel at 2020-12-01T21:52:52+00:00
22 changed files:
- LICENSE
- app/src/main/java/org/mozilla/fenix/components/Core.kt
- app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
- app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SessionControlController.kt
- app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/onboarding/TorOnboardingSecurityLevelViewHolder.kt
- app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
- + app/src/main/java/org/mozilla/fenix/settings/TorSecurityLevelFragment.kt
- app/src/main/java/org/mozilla/fenix/theme/ThemeManager.kt
- + app/src/main/java/org/mozilla/fenix/tor/SecurityLevel.kt
- app/src/main/java/org/mozilla/fenix/utils/Settings.kt
- + app/src/main/res/drawable/ic_illo.png
- + app/src/main/res/drawable/ic_tape.png
- + app/src/main/res/font/cousine.ttf
- + app/src/main/res/font/terminal_grotesque.otf
- + app/src/main/res/font/white_on_black.ttf
- app/src/main/res/layout/fragment_home.xml
- app/src/main/res/layout/tor_onboarding_security_level.xml
- app/src/main/res/navigation/nav_graph.xml
- app/src/main/res/values/styles.xml
- app/src/main/res/values/torbrowser_strings.xml
- app/src/main/res/xml/preferences.xml
- + app/src/main/res/xml/tor_security_level_preferences.xml
Changes:
... | ... | @@ -371,3 +371,328 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice |
371 | 371 |
|
372 | 372 |
This Source Code Form is "Incompatible With Secondary Licenses", as
|
373 | 373 |
defined by the Mozilla Public License, v. 2.0.
|
374 |
+ |
|
375 |
+===============================================================================
|
|
376 |
+ |
|
377 |
+"White On Black" font embedded in chrome/skin/aboutTorFonts.css is licensed under:
|
|
378 |
+ |
|
379 |
+Non Exclusive License Agreement
|
|
380 |
+ |
|
381 |
+Object: Imagex font called « White on Black »
|
|
382 |
+Owner: Daniel Hochard
|
|
383 |
+ |
|
384 |
+1. Allowed uses
|
|
385 |
+The user may use this font on any surface such as logo, paper, web sites,
|
|
386 |
+textile, Online medias, except TV, cinéma and advertising campaign.
|
|
387 |
+2. Number of users : 5
|
|
388 |
+All users must belong to the same company or household purchasing the font.
|
|
389 |
+3. Modifications
|
|
390 |
+The user can modify this font itself without written consent of the owner.
|
|
391 |
+4. This font belongs to Daniel Hochard. The user may not sell it as a font (in a
|
|
392 |
+font bank or a commercial fonts web site, for example).
|
|
393 |
+The fee for this font was paid on paypal the 29 september 2020
|
|
394 |
+ |
|
395 |
+===============================================================================
|
|
396 |
+ |
|
397 |
+"Terminal Grotesque Open" font embedded in chrome/skin/aboutTorFonts.css is licensed
|
|
398 |
+under the SIL Open Font License, Version 1.1.
|
|
399 |
+This license is copied below, and is also available with a FAQ at:
|
|
400 |
+http://scripts.sil.org/OFL
|
|
401 |
+ |
|
402 |
+===============================================================================
|
|
403 |
+ |
|
404 |
+SIL OPEN FONT LICENSE
|
|
405 |
+ |
|
406 |
+Version 1.1 - 26 February 2007
|
|
407 |
+ |
|
408 |
+PREAMBLE
|
|
409 |
+ |
|
410 |
+The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
411 |
+development of collaborative font projects, to support the font creation
|
|
412 |
+efforts of academic and linguistic communities, and to provide a free and
|
|
413 |
+open framework in which fonts may be shared and improved in partnership
|
|
414 |
+with others.
|
|
415 |
+ |
|
416 |
+The OFL allows the licensed fonts to be used, studied, modified and
|
|
417 |
+redistributed freely as long as they are not sold by themselves. The
|
|
418 |
+fonts, including any derivative works, can be bundled, embedded,
|
|
419 |
+redistributed and/or sold with any software provided that any reserved
|
|
420 |
+names are not used by derivative works. The fonts and derivatives,
|
|
421 |
+however, cannot be released under any other type of license. The
|
|
422 |
+requirement for fonts to remain under this license does not apply
|
|
423 |
+to any document created using the fonts or their derivatives.
|
|
424 |
+DEFINITIONS
|
|
425 |
+ |
|
426 |
+"Font Software" refers to the set of files released by the Copyright
|
|
427 |
+Holder(s) under this license and clearly marked as such. This may
|
|
428 |
+include source files, build scripts and documentation.
|
|
429 |
+ |
|
430 |
+"Reserved Font Name" refers to any names specified as such after the
|
|
431 |
+copyright statement(s).
|
|
432 |
+ |
|
433 |
+"Original Version" refers to the collection of Font Software components as
|
|
434 |
+distributed by the Copyright Holder(s).
|
|
435 |
+ |
|
436 |
+"Modified Version" refers to any derivative made by adding to, deleting,
|
|
437 |
+or substituting — in part or in whole — any of the components of the
|
|
438 |
+Original Version, by changing formats or by porting the Font Software to a
|
|
439 |
+new environment.
|
|
440 |
+ |
|
441 |
+"Author" refers to any designer, engineer, programmer, technical
|
|
442 |
+writer or other person who contributed to the Font Software.
|
|
443 |
+PERMISSION & CONDITIONS
|
|
444 |
+ |
|
445 |
+Permission is hereby granted, free of charge, to any person obtaining
|
|
446 |
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
447 |
+redistribute, and sell modified and unmodified copies of the Font
|
|
448 |
+Software, subject to the following conditions:
|
|
449 |
+ |
|
450 |
+1) Neither the Font Software nor any of its individual components,
|
|
451 |
+in Original or Modified Versions, may be sold by itself.
|
|
452 |
+ |
|
453 |
+2) Original or Modified Versions of the Font Software may be bundled,
|
|
454 |
+redistributed and/or sold with any software, provided that each copy
|
|
455 |
+contains the above copyright notice and this license. These can be
|
|
456 |
+included either as stand-alone text files, human-readable headers or
|
|
457 |
+in the appropriate machine-readable metadata fields within text or
|
|
458 |
+binary files as long as those fields can be easily viewed by the user.
|
|
459 |
+ |
|
460 |
+3) No Modified Version of the Font Software may use the Reserved Font
|
|
461 |
+Name(s) unless explicit written permission is granted by the corresponding
|
|
462 |
+Copyright Holder. This restriction only applies to the primary font name as
|
|
463 |
+presented to the users.
|
|
464 |
+ |
|
465 |
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
466 |
+Software shall not be used to promote, endorse or advertise any
|
|
467 |
+Modified Version, except to acknowledge the contribution(s) of the
|
|
468 |
+Copyright Holder(s) and the Author(s) or with their explicit written
|
|
469 |
+permission.
|
|
470 |
+ |
|
471 |
+5) The Font Software, modified or unmodified, in part or in whole,
|
|
472 |
+must be distributed entirely under this license, and must not be
|
|
473 |
+distributed under any other license. The requirement for fonts to
|
|
474 |
+remain under this license does not apply to any document created
|
|
475 |
+using the Font Software.
|
|
476 |
+TERMINATION
|
|
477 |
+ |
|
478 |
+This license becomes null and void if any of the above conditions are
|
|
479 |
+not met.
|
|
480 |
+DISCLAIMER
|
|
481 |
+ |
|
482 |
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
483 |
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
484 |
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
485 |
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
486 |
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
487 |
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
488 |
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
489 |
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
490 |
+OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
491 |
+ |
|
492 |
+===============================================================================
|
|
493 |
+ |
|
494 |
+The Cousine font is licensed under the Apache License, Version 2.0.
|
|
495 |
+https://fonts.google.com/specimen/Cousine
|
|
496 |
+ |
|
497 |
+ |
|
498 |
+ Apache License
|
|
499 |
+ Version 2.0, January 2004
|
|
500 |
+ http://www.apache.org/licenses/
|
|
501 |
+ |
|
502 |
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
503 |
+ |
|
504 |
+ 1. Definitions.
|
|
505 |
+ |
|
506 |
+ "License" shall mean the terms and conditions for use, reproduction,
|
|
507 |
+ and distribution as defined by Sections 1 through 9 of this document.
|
|
508 |
+ |
|
509 |
+ "Licensor" shall mean the copyright owner or entity authorized by
|
|
510 |
+ the copyright owner that is granting the License.
|
|
511 |
+ |
|
512 |
+ "Legal Entity" shall mean the union of the acting entity and all
|
|
513 |
+ other entities that control, are controlled by, or are under common
|
|
514 |
+ control with that entity. For the purposes of this definition,
|
|
515 |
+ "control" means (i) the power, direct or indirect, to cause the
|
|
516 |
+ direction or management of such entity, whether by contract or
|
|
517 |
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
518 |
+ outstanding shares, or (iii) beneficial ownership of such entity.
|
|
519 |
+ |
|
520 |
+ "You" (or "Your") shall mean an individual or Legal Entity
|
|
521 |
+ exercising permissions granted by this License.
|
|
522 |
+ |
|
523 |
+ "Source" form shall mean the preferred form for making modifications,
|
|
524 |
+ including but not limited to software source code, documentation
|
|
525 |
+ source, and configuration files.
|
|
526 |
+ |
|
527 |
+ "Object" form shall mean any form resulting from mechanical
|
|
528 |
+ transformation or translation of a Source form, including but
|
|
529 |
+ not limited to compiled object code, generated documentation,
|
|
530 |
+ and conversions to other media types.
|
|
531 |
+ |
|
532 |
+ "Work" shall mean the work of authorship, whether in Source or
|
|
533 |
+ Object form, made available under the License, as indicated by a
|
|
534 |
+ copyright notice that is included in or attached to the work
|
|
535 |
+ (an example is provided in the Appendix below).
|
|
536 |
+ |
|
537 |
+ "Derivative Works" shall mean any work, whether in Source or Object
|
|
538 |
+ form, that is based on (or derived from) the Work and for which the
|
|
539 |
+ editorial revisions, annotations, elaborations, or other modifications
|
|
540 |
+ represent, as a whole, an original work of authorship. For the purposes
|
|
541 |
+ of this License, Derivative Works shall not include works that remain
|
|
542 |
+ separable from, or merely link (or bind by name) to the interfaces of,
|
|
543 |
+ the Work and Derivative Works thereof.
|
|
544 |
+ |
|
545 |
+ "Contribution" shall mean any work of authorship, including
|
|
546 |
+ the original version of the Work and any modifications or additions
|
|
547 |
+ to that Work or Derivative Works thereof, that is intentionally
|
|
548 |
+ submitted to Licensor for inclusion in the Work by the copyright owner
|
|
549 |
+ or by an individual or Legal Entity authorized to submit on behalf of
|
|
550 |
+ the copyright owner. For the purposes of this definition, "submitted"
|
|
551 |
+ means any form of electronic, verbal, or written communication sent
|
|
552 |
+ to the Licensor or its representatives, including but not limited to
|
|
553 |
+ communication on electronic mailing lists, source code control systems,
|
|
554 |
+ and issue tracking systems that are managed by, or on behalf of, the
|
|
555 |
+ Licensor for the purpose of discussing and improving the Work, but
|
|
556 |
+ excluding communication that is conspicuously marked or otherwise
|
|
557 |
+ designated in writing by the copyright owner as "Not a Contribution."
|
|
558 |
+ |
|
559 |
+ "Contributor" shall mean Licensor and any individual or Legal Entity
|
|
560 |
+ on behalf of whom a Contribution has been received by Licensor and
|
|
561 |
+ subsequently incorporated within the Work.
|
|
562 |
+ |
|
563 |
+ 2. Grant of Copyright License. Subject to the terms and conditions of
|
|
564 |
+ this License, each Contributor hereby grants to You a perpetual,
|
|
565 |
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
566 |
+ copyright license to reproduce, prepare Derivative Works of,
|
|
567 |
+ publicly display, publicly perform, sublicense, and distribute the
|
|
568 |
+ Work and such Derivative Works in Source or Object form.
|
|
569 |
+ |
|
570 |
+ 3. Grant of Patent License. Subject to the terms and conditions of
|
|
571 |
+ this License, each Contributor hereby grants to You a perpetual,
|
|
572 |
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
573 |
+ (except as stated in this section) patent license to make, have made,
|
|
574 |
+ use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
575 |
+ where such license applies only to those patent claims licensable
|
|
576 |
+ by such Contributor that are necessarily infringed by their
|
|
577 |
+ Contribution(s) alone or by combination of their Contribution(s)
|
|
578 |
+ with the Work to which such Contribution(s) was submitted. If You
|
|
579 |
+ institute patent litigation against any entity (including a
|
|
580 |
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
581 |
+ or a Contribution incorporated within the Work constitutes direct
|
|
582 |
+ or contributory patent infringement, then any patent licenses
|
|
583 |
+ granted to You under this License for that Work shall terminate
|
|
584 |
+ as of the date such litigation is filed.
|
|
585 |
+ |
|
586 |
+ 4. Redistribution. You may reproduce and distribute copies of the
|
|
587 |
+ Work or Derivative Works thereof in any medium, with or without
|
|
588 |
+ modifications, and in Source or Object form, provided that You
|
|
589 |
+ meet the following conditions:
|
|
590 |
+ |
|
591 |
+ (a) You must give any other recipients of the Work or
|
|
592 |
+ Derivative Works a copy of this License; and
|
|
593 |
+ |
|
594 |
+ (b) You must cause any modified files to carry prominent notices
|
|
595 |
+ stating that You changed the files; and
|
|
596 |
+ |
|
597 |
+ (c) You must retain, in the Source form of any Derivative Works
|
|
598 |
+ that You distribute, all copyright, patent, trademark, and
|
|
599 |
+ attribution notices from the Source form of the Work,
|
|
600 |
+ excluding those notices that do not pertain to any part of
|
|
601 |
+ the Derivative Works; and
|
|
602 |
+ |
|
603 |
+ (d) If the Work includes a "NOTICE" text file as part of its
|
|
604 |
+ distribution, then any Derivative Works that You distribute must
|
|
605 |
+ include a readable copy of the attribution notices contained
|
|
606 |
+ within such NOTICE file, excluding those notices that do not
|
|
607 |
+ pertain to any part of the Derivative Works, in at least one
|
|
608 |
+ of the following places: within a NOTICE text file distributed
|
|
609 |
+ as part of the Derivative Works; within the Source form or
|
|
610 |
+ documentation, if provided along with the Derivative Works; or,
|
|
611 |
+ within a display generated by the Derivative Works, if and
|
|
612 |
+ wherever such third-party notices normally appear. The contents
|
|
613 |
+ of the NOTICE file are for informational purposes only and
|
|
614 |
+ do not modify the License. You may add Your own attribution
|
|
615 |
+ notices within Derivative Works that You distribute, alongside
|
|
616 |
+ or as an addendum to the NOTICE text from the Work, provided
|
|
617 |
+ that such additional attribution notices cannot be construed
|
|
618 |
+ as modifying the License.
|
|
619 |
+ |
|
620 |
+ You may add Your own copyright statement to Your modifications and
|
|
621 |
+ may provide additional or different license terms and conditions
|
|
622 |
+ for use, reproduction, or distribution of Your modifications, or
|
|
623 |
+ for any such Derivative Works as a whole, provided Your use,
|
|
624 |
+ reproduction, and distribution of the Work otherwise complies with
|
|
625 |
+ the conditions stated in this License.
|
|
626 |
+ |
|
627 |
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
628 |
+ any Contribution intentionally submitted for inclusion in the Work
|
|
629 |
+ by You to the Licensor shall be under the terms and conditions of
|
|
630 |
+ this License, without any additional terms or conditions.
|
|
631 |
+ Notwithstanding the above, nothing herein shall supersede or modify
|
|
632 |
+ the terms of any separate license agreement you may have executed
|
|
633 |
+ with Licensor regarding such Contributions.
|
|
634 |
+ |
|
635 |
+ 6. Trademarks. This License does not grant permission to use the trade
|
|
636 |
+ names, trademarks, service marks, or product names of the Licensor,
|
|
637 |
+ except as required for reasonable and customary use in describing the
|
|
638 |
+ origin of the Work and reproducing the content of the NOTICE file.
|
|
639 |
+ |
|
640 |
+ 7. Disclaimer of Warranty. Unless required by applicable law or
|
|
641 |
+ agreed to in writing, Licensor provides the Work (and each
|
|
642 |
+ Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
643 |
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
644 |
+ implied, including, without limitation, any warranties or conditions
|
|
645 |
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
646 |
+ PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
647 |
+ appropriateness of using or redistributing the Work and assume any
|
|
648 |
+ risks associated with Your exercise of permissions under this License.
|
|
649 |
+ |
|
650 |
+ 8. Limitation of Liability. In no event and under no legal theory,
|
|
651 |
+ whether in tort (including negligence), contract, or otherwise,
|
|
652 |
+ unless required by applicable law (such as deliberate and grossly
|
|
653 |
+ negligent acts) or agreed to in writing, shall any Contributor be
|
|
654 |
+ liable to You for damages, including any direct, indirect, special,
|
|
655 |
+ incidental, or consequential damages of any character arising as a
|
|
656 |
+ result of this License or out of the use or inability to use the
|
|
657 |
+ Work (including but not limited to damages for loss of goodwill,
|
|
658 |
+ work stoppage, computer failure or malfunction, or any and all
|
|
659 |
+ other commercial damages or losses), even if such Contributor
|
|
660 |
+ has been advised of the possibility of such damages.
|
|
661 |
+ |
|
662 |
+ 9. Accepting Warranty or Additional Liability. While redistributing
|
|
663 |
+ the Work or Derivative Works thereof, You may choose to offer,
|
|
664 |
+ and charge a fee for, acceptance of support, warranty, indemnity,
|
|
665 |
+ or other liability obligations and/or rights consistent with this
|
|
666 |
+ License. However, in accepting such obligations, You may act only
|
|
667 |
+ on Your own behalf and on Your sole responsibility, not on behalf
|
|
668 |
+ of any other Contributor, and only if You agree to indemnify,
|
|
669 |
+ defend, and hold each Contributor harmless for any liability
|
|
670 |
+ incurred by, or claims asserted against, such Contributor by reason
|
|
671 |
+ of your accepting any such warranty or additional liability.
|
|
672 |
+ |
|
673 |
+ END OF TERMS AND CONDITIONS
|
|
674 |
+ |
|
675 |
+ APPENDIX: How to apply the Apache License to your work.
|
|
676 |
+ |
|
677 |
+ To apply the Apache License to your work, attach the following
|
|
678 |
+ boilerplate notice, with the fields enclosed by brackets "[]"
|
|
679 |
+ replaced with your own identifying information. (Don't include
|
|
680 |
+ the brackets!) The text should be enclosed in the appropriate
|
|
681 |
+ comment syntax for the file format. We also recommend that a
|
|
682 |
+ file or class name and description of purpose be included on the
|
|
683 |
+ same "printed page" as the copyright notice for easier
|
|
684 |
+ identification within third-party archives.
|
|
685 |
+ |
|
686 |
+ Copyright [yyyy] [name of copyright owner]
|
|
687 |
+ |
|
688 |
+ Licensed under the Apache License, Version 2.0 (the "License");
|
|
689 |
+ you may not use this file except in compliance with the License.
|
|
690 |
+ You may obtain a copy of the License at
|
|
691 |
+ |
|
692 |
+ http://www.apache.org/licenses/LICENSE-2.0
|
|
693 |
+ |
|
694 |
+ Unless required by applicable law or agreed to in writing, software
|
|
695 |
+ distributed under the License is distributed on an "AS IS" BASIS,
|
|
696 |
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
697 |
+ See the License for the specific language governing permissions and
|
|
698 |
+ limitations under the License.
|
... | ... | @@ -110,6 +110,7 @@ class Core( |
110 | 110 |
context,
|
111 | 111 |
R.color.foundation_normal_theme
|
112 | 112 |
),
|
113 |
+ torSecurityLevel = context.settings().torSecurityLevel().intRepresentation,
|
|
113 | 114 |
spoofEnglish = context.settings().spoofEnglish
|
114 | 115 |
)
|
115 | 116 |
|
... | ... | @@ -72,6 +72,7 @@ import mozilla.components.feature.top.sites.TopSitesFeature |
72 | 72 |
import mozilla.components.lib.state.ext.consumeFrom
|
73 | 73 |
import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
|
74 | 74 |
import mozilla.components.support.ktx.android.content.res.resolveAttribute
|
75 |
+import mozilla.components.support.locale.LocaleManager
|
|
75 | 76 |
import org.mozilla.fenix.BrowserDirection
|
76 | 77 |
import org.mozilla.fenix.BuildConfig
|
77 | 78 |
import org.mozilla.fenix.HomeActivity
|
... | ... | @@ -99,6 +100,7 @@ import org.mozilla.fenix.home.sessioncontrol.viewholders.CollectionViewHolder |
99 | 100 |
import org.mozilla.fenix.home.sessioncontrol.viewholders.topsites.DefaultTopSitesView
|
100 | 101 |
import org.mozilla.fenix.onboarding.FenixOnboarding
|
101 | 102 |
import org.mozilla.fenix.settings.SupportUtils
|
103 |
+import org.mozilla.fenix.settings.advanced.getSelectedLocale
|
|
102 | 104 |
import org.mozilla.fenix.settings.deletebrowsingdata.deleteAndQuit
|
103 | 105 |
import org.mozilla.fenix.tor.bootstrap.TorQuickStart
|
104 | 106 |
import org.mozilla.fenix.theme.ThemeManager
|
... | ... | @@ -265,6 +267,28 @@ class HomeFragment : Fragment() { |
265 | 267 |
adjustHomeFragmentView(currentMode.getCurrentMode(), view)
|
266 | 268 |
showSessionControlView(view)
|
267 | 269 |
|
270 |
+ view.donationmatch.setOnClickListener {
|
|
271 |
+ activity.openToBrowserAndLoad(
|
|
272 |
+ searchTermOrURL = "https://blog.torproject.org/friends-of-tor-match-2020",
|
|
273 |
+ newTab = true,
|
|
274 |
+ from = BrowserDirection.FromHome
|
|
275 |
+ )
|
|
276 |
+ }
|
|
277 |
+ |
|
278 |
+ view.donate_now_button.setOnClickListener {
|
|
279 |
+ val country = LocaleManager.getSelectedLocale(requireContext()).country
|
|
280 |
+ var locale = LocaleManager.getSelectedLocale(requireContext()).language
|
|
281 |
+ if (country != "") {
|
|
282 |
+ locale = "$locale-$country"
|
|
283 |
+ }
|
|
284 |
+ val localeUrl = "https://www.torproject.org/donate/donate-usetor-mobile-$locale"
|
|
285 |
+ activity.openToBrowserAndLoad(
|
|
286 |
+ searchTermOrURL = localeUrl,
|
|
287 |
+ newTab = true,
|
|
288 |
+ from = BrowserDirection.FromHome
|
|
289 |
+ )
|
|
290 |
+ }
|
|
291 |
+ |
|
268 | 292 |
return view
|
269 | 293 |
}
|
270 | 294 |
|
... | ... | @@ -396,6 +420,14 @@ class HomeFragment : Fragment() { |
396 | 420 |
toolbarLayoutHeight - SESSION_CONTROL_VIEW_PADDING
|
397 | 421 |
)
|
398 | 422 |
}
|
423 |
+ view.donate_now_button?.apply {
|
|
424 |
+ (layoutParams as ViewGroup.MarginLayoutParams).setMargins(
|
|
425 |
+ 0,
|
|
426 |
+ 0,
|
|
427 |
+ 0,
|
|
428 |
+ toolbarLayoutHeight - SESSION_CONTROL_VIEW_PADDING
|
|
429 |
+ )
|
|
430 |
+ }
|
|
399 | 431 |
}
|
400 | 432 |
} else {
|
401 | 433 |
view.sessionControlRecyclerView?.apply {
|
... | ... | @@ -406,6 +438,38 @@ class HomeFragment : Fragment() { |
406 | 438 |
height - SESSION_CONTROL_VIEW_PADDING
|
407 | 439 |
)
|
408 | 440 |
}
|
441 |
+ view.donate_now_button?.apply {
|
|
442 |
+ (layoutParams as ViewGroup.MarginLayoutParams).setMargins(
|
|
443 |
+ 0,
|
|
444 |
+ 0,
|
|
445 |
+ 0,
|
|
446 |
+ height - SESSION_CONTROL_VIEW_PADDING
|
|
447 |
+ )
|
|
448 |
+ }
|
|
449 |
+ }
|
|
450 |
+ }
|
|
451 |
+ |
|
452 |
+ // Hide the EOY image during Onboarding, too.
|
|
453 |
+ view?.illo_image?.apply {
|
|
454 |
+ visibility = if (onboarding.userHasBeenOnboarded()) {
|
|
455 |
+ View.VISIBLE
|
|
456 |
+ } else {
|
|
457 |
+ View.GONE
|
|
458 |
+ }
|
|
459 |
+ }
|
|
460 |
+ // Hide the EOY donate button during Onboarding, too.
|
|
461 |
+ view?.donate_now_button?.apply {
|
|
462 |
+ visibility = if (onboarding.userHasBeenOnboarded()) {
|
|
463 |
+ View.VISIBLE
|
|
464 |
+ } else {
|
|
465 |
+ View.GONE
|
|
466 |
+ }
|
|
467 |
+ }
|
|
468 |
+ view?.resistsurveillance?.apply {
|
|
469 |
+ visibility = if (onboarding.userHasBeenOnboarded()) {
|
|
470 |
+ View.VISIBLE
|
|
471 |
+ } else {
|
|
472 |
+ View.GONE
|
|
409 | 473 |
}
|
410 | 474 |
}
|
411 | 475 |
// Hide the onion pattern during Onboarding, too.
|
... | ... | @@ -411,6 +411,8 @@ class DefaultSessionControlController( |
411 | 411 |
}
|
412 | 412 |
|
413 | 413 |
override fun handleOpenSecurityLevelSettingsClicked() {
|
414 |
+ val directions = HomeFragmentDirections.actionGlobalTorSecurityLevelFragment()
|
|
415 |
+ navController.nav(R.id.homeFragment, directions)
|
|
414 | 416 |
}
|
415 | 417 |
|
416 | 418 |
override fun handleWhatsNewGetAnswersClicked() {
|
... | ... | @@ -8,8 +8,11 @@ import android.view.View |
8 | 8 |
import androidx.recyclerview.widget.RecyclerView
|
9 | 9 |
import kotlinx.android.synthetic.main.tor_onboarding_security_level.view.*
|
10 | 10 |
import org.mozilla.fenix.R
|
11 |
+import org.mozilla.fenix.ext.components
|
|
11 | 12 |
import org.mozilla.fenix.home.sessioncontrol.OnboardingInteractor
|
12 | 13 |
import org.mozilla.fenix.onboarding.OnboardingRadioButton
|
14 |
+import org.mozilla.fenix.tor.SecurityLevel
|
|
15 |
+import org.mozilla.fenix.tor.SecurityLevelUtil
|
|
13 | 16 |
import org.mozilla.fenix.utils.view.addToRadioGroup
|
14 | 17 |
|
15 | 18 |
class TorOnboardingSecurityLevelViewHolder(
|
... | ... | @@ -33,34 +36,56 @@ class TorOnboardingSecurityLevelViewHolder( |
33 | 36 |
)
|
34 | 37 |
|
35 | 38 |
view.open_settings_button.setOnClickListener {
|
36 |
- interactor.onOpenSettingsClicked()
|
|
39 |
+ interactor.onOpenSecurityLevelSettingsClicked()
|
|
37 | 40 |
}
|
38 | 41 |
|
39 |
- setupRadioGroup()
|
|
42 |
+ setupRadioGroup(view)
|
|
40 | 43 |
}
|
41 | 44 |
|
42 |
- private fun setupRadioGroup() {
|
|
45 |
+ private fun setupRadioGroup(view: View) {
|
|
43 | 46 |
|
44 | 47 |
addToRadioGroup(standardSecurityLevel, saferSecurityLevel, safestSecurityLevel)
|
45 | 48 |
|
46 |
- standardSecurityLevel.isChecked = true
|
|
47 |
- safestSecurityLevel.isChecked = false
|
|
48 |
- saferSecurityLevel.isChecked = false
|
|
49 |
+ val securityLevel = try {
|
|
50 |
+ SecurityLevelUtil.getSecurityLevelFromInt(
|
|
51 |
+ view.context.components.core.engine.settings.torSecurityLevel
|
|
52 |
+ )
|
|
53 |
+ } catch (e: IllegalStateException) {
|
|
54 |
+ SecurityLevel.STANDARD
|
|
55 |
+ }
|
|
56 |
+ |
|
57 |
+ standardSecurityLevel.isChecked = securityLevel == SecurityLevel.STANDARD
|
|
58 |
+ safestSecurityLevel.isChecked = securityLevel == SecurityLevel.SAFEST
|
|
59 |
+ saferSecurityLevel.isChecked = securityLevel == SecurityLevel.SAFER
|
|
49 | 60 |
|
50 | 61 |
standardSecurityLevel.onClickListener {
|
51 |
- updateSecurityLevel()
|
|
62 |
+ updateSecurityLevel(SecurityLevel.STANDARD)
|
|
52 | 63 |
}
|
53 | 64 |
|
54 | 65 |
saferSecurityLevel.onClickListener {
|
55 |
- updateSecurityLevel()
|
|
66 |
+ updateSecurityLevel(SecurityLevel.SAFER)
|
|
56 | 67 |
}
|
57 | 68 |
|
58 | 69 |
safestSecurityLevel.onClickListener {
|
59 |
- updateSecurityLevel()
|
|
70 |
+ updateSecurityLevel(SecurityLevel.SAFEST)
|
|
60 | 71 |
}
|
72 |
+ |
|
73 |
+ updateSecurityLevel(securityLevel)
|
|
61 | 74 |
}
|
62 | 75 |
|
63 |
- private fun updateSecurityLevel() {
|
|
76 |
+ private fun updateSecurityLevel(newLevel: SecurityLevel) {
|
|
77 |
+ val resources = itemView.context.resources
|
|
78 |
+ val securityLevel = when (newLevel) {
|
|
79 |
+ SecurityLevel.STANDARD -> resources.getString(R.string.tor_security_level_standard_option)
|
|
80 |
+ SecurityLevel.SAFER -> resources.getString(R.string.tor_security_level_safer_option)
|
|
81 |
+ SecurityLevel.SAFEST -> resources.getString(R.string.tor_security_level_safest_option)
|
|
82 |
+ }
|
|
83 |
+ itemView.current_level.text = resources.getString(
|
|
84 |
+ R.string.tor_onboarding_chosen_security_level_label, securityLevel
|
|
85 |
+ )
|
|
86 |
+ itemView.context.components.let {
|
|
87 |
+ it.core.engine.settings.torSecurityLevel = newLevel.intRepresentation
|
|
88 |
+ }
|
|
64 | 89 |
}
|
65 | 90 |
|
66 | 91 |
companion object {
|
... | ... | @@ -224,6 +224,9 @@ class SettingsFragment : PreferenceFragmentCompat() { |
224 | 224 |
resources.getString(R.string.pref_key_tor_network_settings) -> {
|
225 | 225 |
SettingsFragmentDirections.actionSettingsFragmentToTorNetworkSettingsFragment()
|
226 | 226 |
}
|
227 |
+ resources.getString(R.string.pref_key_tor_security_level_settings) -> {
|
|
228 |
+ SettingsFragmentDirections.actionSettingsFragmentToTorSecurityLevelFragment()
|
|
229 |
+ }
|
|
227 | 230 |
resources.getString(R.string.pref_key_tracking_protection_settings) -> {
|
228 | 231 |
requireContext().metrics.track(Event.TrackingProtectionSettings)
|
229 | 232 |
SettingsFragmentDirections.actionSettingsFragmentToTrackingProtectionFragment()
|
1 |
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
4 |
+ |
|
5 |
+package org.mozilla.fenix.settings
|
|
6 |
+ |
|
7 |
+import android.os.Bundle
|
|
8 |
+import androidx.preference.PreferenceFragmentCompat
|
|
9 |
+import org.mozilla.fenix.R
|
|
10 |
+import org.mozilla.fenix.ext.components
|
|
11 |
+import org.mozilla.fenix.ext.settings
|
|
12 |
+import org.mozilla.fenix.ext.showToolbar
|
|
13 |
+import org.mozilla.fenix.tor.SecurityLevel
|
|
14 |
+import org.mozilla.fenix.tor.SecurityLevelUtil
|
|
15 |
+import org.mozilla.fenix.utils.view.GroupableRadioButton
|
|
16 |
+import org.mozilla.fenix.utils.view.addToRadioGroup
|
|
17 |
+import org.mozilla.fenix.utils.view.uncheckAll
|
|
18 |
+ |
|
19 |
+/**
|
|
20 |
+ * Lets the user choose their security level
|
|
21 |
+ */
|
|
22 |
+@Suppress("SpreadOperator")
|
|
23 |
+class TorSecurityLevelFragment : PreferenceFragmentCompat() {
|
|
24 |
+ private val securityLevelRadioGroups = mutableListOf<GroupableRadioButton>()
|
|
25 |
+ private var previousSecurityLevel: SecurityLevel? = null
|
|
26 |
+ |
|
27 |
+ override fun onResume() {
|
|
28 |
+ super.onResume()
|
|
29 |
+ showToolbar(getString(R.string.preferences_tor_security_level_options))
|
|
30 |
+ }
|
|
31 |
+ |
|
32 |
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
|
33 |
+ setPreferencesFromResource(R.xml.tor_security_level_preferences, rootKey)
|
|
34 |
+ |
|
35 |
+ val currentLevel: SecurityLevel? = context?.components?.let {
|
|
36 |
+ try {
|
|
37 |
+ SecurityLevelUtil.getSecurityLevelFromInt(
|
|
38 |
+ it.core.engine.settings.torSecurityLevel
|
|
39 |
+ )
|
|
40 |
+ } catch (e: IllegalStateException) {
|
|
41 |
+ // The default state is 0. If we get an invalid state then
|
|
42 |
+ // default to Standard (4).
|
|
43 |
+ SecurityLevel.STANDARD
|
|
44 |
+ }
|
|
45 |
+ }
|
|
46 |
+ |
|
47 |
+ if (currentLevel == null) {
|
|
48 |
+ throw IllegalStateException("context or Components is null.")
|
|
49 |
+ }
|
|
50 |
+ |
|
51 |
+ val radioSafer = bindSecurityLevelRadio(SecurityLevel.SAFER)
|
|
52 |
+ val radioSafest = bindSecurityLevelRadio(SecurityLevel.SAFEST)
|
|
53 |
+ val radioStandard = bindSecurityLevelRadio(SecurityLevel.STANDARD)
|
|
54 |
+ |
|
55 |
+ securityLevelRadioGroups.addAll(mutableListOf(radioSafer, radioSafest, radioStandard))
|
|
56 |
+ // `*` is Kotlin's "spread" operator, for expanding an Array as a vararg.
|
|
57 |
+ addToRadioGroup(*securityLevelRadioGroups.toTypedArray())
|
|
58 |
+ |
|
59 |
+ securityLevelRadioGroups.uncheckAll()
|
|
60 |
+ val securityLevelRadioButton = requirePreference<RadioButtonPreference>(currentLevel.preferenceKey)
|
|
61 |
+ // Cache this for later comparison in the OnPreferenceChangeListener
|
|
62 |
+ previousSecurityLevel = currentLevel
|
|
63 |
+ securityLevelRadioButton.setCheckedWithoutClickListener(true)
|
|
64 |
+ }
|
|
65 |
+ |
|
66 |
+ private fun bindSecurityLevelRadio(
|
|
67 |
+ level: SecurityLevel
|
|
68 |
+ ): RadioButtonPreference {
|
|
69 |
+ val radio = requirePreference<RadioButtonPreference>(level.preferenceKey)
|
|
70 |
+ |
|
71 |
+ radio.summary = getString(level.contentDescriptionRes)
|
|
72 |
+ |
|
73 |
+ radio.apply {
|
|
74 |
+ setOnPreferenceChangeListener<Boolean> { preference, isChecked ->
|
|
75 |
+ if (isChecked && (previousSecurityLevel!! != level)) {
|
|
76 |
+ preference.context.components.core.engine.settings.torSecurityLevel =
|
|
77 |
+ level.intRepresentation
|
|
78 |
+ previousSecurityLevel = level
|
|
79 |
+ }
|
|
80 |
+ true
|
|
81 |
+ }
|
|
82 |
+ }
|
|
83 |
+ |
|
84 |
+ return radio
|
|
85 |
+ }
|
|
86 |
+}
|
... | ... | @@ -32,7 +32,7 @@ abstract class ThemeManager { |
32 | 32 |
@get:StyleRes
|
33 | 33 |
val currentThemeResource get() = when (currentTheme) {
|
34 | 34 |
BrowsingMode.Normal -> R.style.NormalTheme
|
35 |
- BrowsingMode.Private -> R.style.PrivateTheme
|
|
35 |
+ BrowsingMode.Private -> R.style.PrivateEOYTheme
|
|
36 | 36 |
}
|
37 | 37 |
|
38 | 38 |
/**
|
1 |
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2 |
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3 |
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
4 |
+ |
|
5 |
+package org.mozilla.fenix.tor
|
|
6 |
+ |
|
7 |
+import android.os.Parcelable
|
|
8 |
+import androidx.annotation.StringRes
|
|
9 |
+import kotlinx.android.parcel.Parcelize
|
|
10 |
+import org.mozilla.fenix.R
|
|
11 |
+ |
|
12 |
+@Parcelize
|
|
13 |
+enum class SecurityLevel(
|
|
14 |
+ @StringRes val preferenceKey: Int,
|
|
15 |
+ @StringRes val contentDescriptionRes: Int,
|
|
16 |
+ val intRepresentation: Int
|
|
17 |
+) : Parcelable {
|
|
18 |
+ |
|
19 |
+ STANDARD(
|
|
20 |
+ preferenceKey = R.string.pref_key_tor_security_level_standard_option,
|
|
21 |
+ contentDescriptionRes = R.string.tor_security_level_standard_description,
|
|
22 |
+ intRepresentation = SecurityLevel.SECURITY_LEVEL_STANDARD
|
|
23 |
+ ),
|
|
24 |
+ SAFER(
|
|
25 |
+ preferenceKey = R.string.pref_key_tor_security_level_safer_option,
|
|
26 |
+ contentDescriptionRes = R.string.tor_security_level_safer_description,
|
|
27 |
+ intRepresentation = SecurityLevel.SECURITY_LEVEL_SAFER
|
|
28 |
+ ),
|
|
29 |
+ SAFEST(
|
|
30 |
+ preferenceKey = R.string.pref_key_tor_security_level_safest_option,
|
|
31 |
+ contentDescriptionRes = R.string.tor_security_level_safest_description,
|
|
32 |
+ intRepresentation = SecurityLevel.SECURITY_LEVEL_SAFEST
|
|
33 |
+ );
|
|
34 |
+ |
|
35 |
+ companion object {
|
|
36 |
+ const val SECURITY_LEVEL_STANDARD = 4
|
|
37 |
+ const val SECURITY_LEVEL_SAFER = 2
|
|
38 |
+ const val SECURITY_LEVEL_SAFEST = 1
|
|
39 |
+ }
|
|
40 |
+}
|
|
41 |
+ |
|
42 |
+object SecurityLevelUtil {
|
|
43 |
+ fun getSecurityLevelFromInt(level: Int): SecurityLevel {
|
|
44 |
+ return when (level) {
|
|
45 |
+ SecurityLevel.SECURITY_LEVEL_STANDARD -> SecurityLevel.STANDARD
|
|
46 |
+ SecurityLevel.SECURITY_LEVEL_SAFER -> SecurityLevel.SAFER
|
|
47 |
+ SecurityLevel.SECURITY_LEVEL_SAFEST -> SecurityLevel.SAFEST
|
|
48 |
+ else -> throw IllegalStateException("Security Level $level is not valid")
|
|
49 |
+ }
|
|
50 |
+ }
|
|
51 |
+}
|
... | ... | @@ -40,6 +40,7 @@ import org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataOnQuitTyp |
40 | 40 |
import org.mozilla.fenix.settings.logins.SavedLoginsSortingStrategyMenu
|
41 | 41 |
import org.mozilla.fenix.settings.logins.SortingStrategy
|
42 | 42 |
import org.mozilla.fenix.settings.registerOnSharedPreferenceChangeListener
|
43 |
+import org.mozilla.fenix.tor.SecurityLevel
|
|
43 | 44 |
import java.security.InvalidParameterException
|
44 | 45 |
|
45 | 46 |
private const val AUTOPLAY_USER_SETTING = "AUTOPLAY_USER_SETTING"
|
... | ... | @@ -174,6 +175,33 @@ class Settings(private val appContext: Context) : PreferencesHolder { |
174 | 175 |
false
|
175 | 176 |
)
|
176 | 177 |
|
178 |
+ var standardSecurityLevel by booleanPreference(
|
|
179 |
+ appContext.getPreferenceKey(SecurityLevel.STANDARD.preferenceKey),
|
|
180 |
+ default = true
|
|
181 |
+ )
|
|
182 |
+ |
|
183 |
+ var saferSecurityLevel by booleanPreference(
|
|
184 |
+ appContext.getPreferenceKey(SecurityLevel.SAFER.preferenceKey),
|
|
185 |
+ default = false
|
|
186 |
+ )
|
|
187 |
+ |
|
188 |
+ var safestSecurityLevel by booleanPreference(
|
|
189 |
+ appContext.getPreferenceKey(SecurityLevel.SAFEST.preferenceKey),
|
|
190 |
+ default = false
|
|
191 |
+ )
|
|
192 |
+ |
|
193 |
+ // torSecurityLevel is defined as the first |true| preference,
|
|
194 |
+ // beginning at the safest level.
|
|
195 |
+ // If multiple preferences are true, then that is a bug and the
|
|
196 |
+ // highest |true| security level is chosen.
|
|
197 |
+ // Standard is the default level.
|
|
198 |
+ fun torSecurityLevel(): SecurityLevel = when {
|
|
199 |
+ safestSecurityLevel -> SecurityLevel.SAFEST
|
|
200 |
+ saferSecurityLevel -> SecurityLevel.SAFER
|
|
201 |
+ standardSecurityLevel -> SecurityLevel.STANDARD
|
|
202 |
+ else -> SecurityLevel.STANDARD
|
|
203 |
+ }
|
|
204 |
+ |
|
177 | 205 |
var spoofEnglish by booleanPreference(
|
178 | 206 |
appContext.getPreferenceKey(R.string.pref_key_spoof_english),
|
179 | 207 |
default = false
|
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
... | ... | @@ -53,6 +53,7 @@ |
53 | 53 |
android:clickable="false"
|
54 | 54 |
android:contentDescription="@string/app_name"
|
55 | 55 |
android:focusable="false"
|
56 |
+ android:visibility="gone"
|
|
56 | 57 |
android:importantForAccessibility="no"
|
57 | 58 |
app:srcCompat="@mipmap/ic_launcher"
|
58 | 59 |
app:layout_collapseMode="parallax"
|
... | ... | @@ -69,6 +70,7 @@ |
69 | 70 |
android:height="60dp"
|
70 | 71 |
android:clickable="false"
|
71 | 72 |
android:focusable="false"
|
73 |
+ android:visibility="gone"
|
|
72 | 74 |
android:importantForAccessibility="no"
|
73 | 75 |
android:lines="2"
|
74 | 76 |
android:text="@string/app_name"
|
... | ... | @@ -83,19 +85,99 @@ |
83 | 85 |
android:id="@+id/exploreprivately"
|
84 | 86 |
android:layout_width="wrap_content"
|
85 | 87 |
android:layout_height="wrap_content"
|
86 |
- android:layout_gravity="center|center_vertical"
|
|
87 |
- android:gravity="center_horizontal"
|
|
88 |
+ android:layout_gravity="center_vertical"
|
|
89 |
+ android:layout_marginStart="30dp"
|
|
90 |
+ android:layout_marginEnd="30dp"
|
|
88 | 91 |
android:clickable="false"
|
89 | 92 |
android:ellipsize="end"
|
90 | 93 |
android:focusable="false"
|
91 | 94 |
android:importantForAccessibility="no"
|
92 |
- android:text="@string/tor_explore_privately"
|
|
93 |
- android:fontFamily="Roboto-Medium"
|
|
94 |
- android:textColor="#DEFFFFFF"
|
|
95 |
+ android:text="@string/tor_useamask_usetor"
|
|
96 |
+ android:fontFamily="@font/white_on_black"
|
|
97 |
+ android:textColor="#FFFFFFFF"
|
|
95 | 98 |
android:textSize="40sp"
|
99 |
+ android:paddingTop="20dp"
|
|
96 | 100 |
android:lineSpacingMultiplier="1.1"
|
97 | 101 |
app:layout_scrollFlags="scroll" />
|
98 | 102 |
|
103 |
+ <LinearLayout
|
|
104 |
+ android:layout_width="match_parent"
|
|
105 |
+ android:layout_height="wrap_content">
|
|
106 |
+ |
|
107 |
+ <LinearLayout
|
|
108 |
+ android:layout_width="match_parent"
|
|
109 |
+ android:layout_height="wrap_content"
|
|
110 |
+ android:layout_weight="1"
|
|
111 |
+ android:orientation="vertical">
|
|
112 |
+ |
|
113 |
+ <TextView
|
|
114 |
+ android:id="@+id/resistsurveillance"
|
|
115 |
+ android:layout_width="wrap_content"
|
|
116 |
+ android:layout_height="wrap_content"
|
|
117 |
+ android:layout_marginStart="40dp"
|
|
118 |
+ android:layout_gravity="center_vertical"
|
|
119 |
+ android:clickable="false"
|
|
120 |
+ android:focusable="false"
|
|
121 |
+ android:gravity="start"
|
|
122 |
+ android:fontFamily="@font/terminal_grotesque"
|
|
123 |
+ android:importantForAccessibility="no"
|
|
124 |
+ android:lineSpacingMultiplier="1.1"
|
|
125 |
+ android:text="@string/tor_resistsurveillance"
|
|
126 |
+ android:textColor="#FFFFFFFF"
|
|
127 |
+ android:textSize="27sp"
|
|
128 |
+ android:visibility="visible"
|
|
129 |
+ app:layout_scrollFlags="scroll" />
|
|
130 |
+ |
|
131 |
+ <TextView
|
|
132 |
+ android:id="@+id/donationmatch"
|
|
133 |
+ android:layout_width="wrap_content"
|
|
134 |
+ android:layout_height="wrap_content"
|
|
135 |
+ android:layout_marginStart="40dp"
|
|
136 |
+ android:layout_gravity="center_vertical"
|
|
137 |
+ android:paddingTop="20dp"
|
|
138 |
+ android:paddingBottom="20dp"
|
|
139 |
+ android:clickable="false"
|
|
140 |
+ android:focusable="false"
|
|
141 |
+ android:gravity="start"
|
|
142 |
+ android:fontFamily="@font/cousine"
|
|
143 |
+ android:importantForAccessibility="no"
|
|
144 |
+ android:lineSpacingMultiplier="1.1"
|
|
145 |
+ android:text="@string/tor_donationmatch"
|
|
146 |
+ android:textColor="#9D4AE8"
|
|
147 |
+ android:textSize="14sp"
|
|
148 |
+ android:visibility="visible"
|
|
149 |
+ app:layout_scrollFlags="scroll" />
|
|
150 |
+ |
|
151 |
+ <Button
|
|
152 |
+ android:id="@+id/donate_now_button"
|
|
153 |
+ android:layout_width="wrap_content"
|
|
154 |
+ android:layout_height="wrap_content"
|
|
155 |
+ android:layout_marginStart="30dp"
|
|
156 |
+ android:background="">"@drawable/ic_tape"
|
|
157 |
+ android:gravity="center|start"
|
|
158 |
+ android:fontFamily="@font/terminal_grotesque"
|
|
159 |
+ android:paddingStart="15dp"
|
|
160 |
+ android:paddingEnd="20dp"
|
|
161 |
+ android:text="@string/tor_onboarding_donate_button"
|
|
162 |
+ android:textColor="#FF000000"
|
|
163 |
+ android:textSize="25sp"
|
|
164 |
+ android:textAllCaps="false"
|
|
165 |
+ android:textStyle="bold"
|
|
166 |
+ android:visibility="visible"
|
|
167 |
+ tools:ignore="ButtonStyleXmlDetector" />
|
|
168 |
+ </LinearLayout>
|
|
169 |
+ |
|
170 |
+ <ImageView
|
|
171 |
+ android:id="@+id/illo_image"
|
|
172 |
+ android:layout_width="match_parent"
|
|
173 |
+ android:layout_height="wrap_content"
|
|
174 |
+ android:layout_weight="1"
|
|
175 |
+ app:srcCompat="@drawable/ic_illo"
|
|
176 |
+ tools:ignore="ContentDescription"
|
|
177 |
+ app:layout_scrollFlags="scroll" />
|
|
178 |
+ |
|
179 |
+ </LinearLayout>
|
|
180 |
+ |
|
99 | 181 |
</com.google.android.material.appbar.AppBarLayout>
|
100 | 182 |
|
101 | 183 |
<androidx.recyclerview.widget.RecyclerView
|
... | ... | @@ -32,9 +32,18 @@ |
32 | 32 |
android:textAppearance="@style/Body14TextStyle"
|
33 | 33 |
app:layout_constraintEnd_toEndOf="parent"
|
34 | 34 |
app:layout_constraintStart_toStartOf="parent"
|
35 |
- app:layout_constraintTop_toBottomOf="@id/header_text"
|
|
35 |
+ app:layout_constraintTop_toBottomOf="@id/current_level"
|
|
36 | 36 |
tools:text="@string/tor_onboarding_security_level_description" />
|
37 | 37 |
|
38 |
+ <TextView
|
|
39 |
+ android:id="@+id/current_level"
|
|
40 |
+ android:layout_width="match_parent"
|
|
41 |
+ android:layout_height="wrap_content"
|
|
42 |
+ android:layout_marginTop="12dp"
|
|
43 |
+ app:layout_constraintEnd_toEndOf="parent"
|
|
44 |
+ app:layout_constraintStart_toStartOf="parent"
|
|
45 |
+ app:layout_constraintTop_toBottomOf="@id/header_text"
|
|
46 |
+ tools:text="@string/tor_onboarding_chosen_security_level_label" />
|
|
38 | 47 |
|
39 | 48 |
<org.mozilla.fenix.onboarding.OnboardingRadioButton
|
40 | 49 |
android:id="@+id/security_level_standard_option"
|
... | ... | @@ -58,6 +58,9 @@ |
58 | 58 |
<action
|
59 | 59 |
android:id="@+id/action_global_syncedTabsFragment"
|
60 | 60 |
app:destination="@id/syncedTabsFragment" />
|
61 |
+ <action
|
|
62 |
+ android:id="@+id/action_global_torSecurityLevelFragment"
|
|
63 |
+ app:destination="@id/torSecurityLevelFragment" />
|
|
61 | 64 |
<action
|
62 | 65 |
android:id="@+id/action_global_privateBrowsingFragment"
|
63 | 66 |
app:destination="@id/privateBrowsingFragment" />
|
... | ... | @@ -473,6 +476,13 @@ |
473 | 476 |
app:exitAnim="@anim/slide_out_left"
|
474 | 477 |
app:popEnterAnim="@anim/slide_in_left"
|
475 | 478 |
app:popExitAnim="@anim/slide_out_right" />
|
479 |
+ <action
|
|
480 |
+ android:id="@+id/action_settingsFragment_to_torSecurityLevelFragment"
|
|
481 |
+ app:destination="@id/torSecurityLevelFragment"
|
|
482 |
+ app:enterAnim="@anim/slide_in_right"
|
|
483 |
+ app:exitAnim="@anim/slide_out_left"
|
|
484 |
+ app:popEnterAnim="@anim/slide_in_left"
|
|
485 |
+ app:popExitAnim="@anim/slide_out_right" />
|
|
476 | 486 |
<action
|
477 | 487 |
android:id="@+id/action_settingsFragment_to_privateBrowsingFragment"
|
478 | 488 |
app:destination="@id/privateBrowsingFragment"
|
... | ... | @@ -632,6 +642,10 @@ |
632 | 642 |
android:id="@+id/customizationFragment"
|
633 | 643 |
android:name="org.mozilla.fenix.settings.CustomizationFragment"
|
634 | 644 |
android:label="@string/preferences_customize" />
|
645 |
+ <fragment
|
|
646 |
+ android:id="@+id/torSecurityLevelFragment"
|
|
647 |
+ android:name="org.mozilla.fenix.settings.TorSecurityLevelFragment"
|
|
648 |
+ android:label="@string/preferences_tor_security_level_settings" />
|
|
635 | 649 |
<fragment
|
636 | 650 |
android:id="@+id/privateBrowsingFragment"
|
637 | 651 |
android:name="org.mozilla.fenix.settings.PrivateBrowsingFragment"
|
... | ... | @@ -269,6 +269,10 @@ |
269 | 269 |
|
270 | 270 |
<style name="PrivateTheme" parent="PrivateThemeBase" />
|
271 | 271 |
|
272 |
+ <style name="PrivateEOYTheme" parent="PrivateThemeBase" >
|
|
273 |
+ <item name="homeBackground">@android:color/black</item>
|
|
274 |
+ </style>
|
|
275 |
+ |
|
272 | 276 |
<!-- Fade animation for theme switching -->
|
273 | 277 |
<style name="WindowAnimationTransition">
|
274 | 278 |
<item name="android:windowEnterAnimation">@anim/fade_in</item>
|
... | ... | @@ -23,6 +23,7 @@ |
23 | 23 |
|
24 | 24 |
<string name="tor_onboarding_security_level">Set your Security Level</string>
|
25 | 25 |
<string name="tor_onboarding_security_level_description">Disable certain web features that can be used to attack you, and harm your security, anonymity, and privacy.</string>
|
26 |
+ <string name="tor_onboarding_chosen_security_level_label">Current Security Level: %s</string>
|
|
26 | 27 |
<string name="tor_onboarding_security_settings_button">Open Security Settings</string>
|
27 | 28 |
<string name="tor_onboarding_donate_header">Donate and keep Tor safe</string>
|
28 | 29 |
<string name="tor_onboarding_donate_description">Tor is free to use because of donations from people like you.</string>
|
... | ... | @@ -57,6 +58,10 @@ |
57 | 58 |
<string name="preferences_tor_network_settings_restarting">Restarting</string>
|
58 | 59 |
<string name="preferences_tor_network_settings_bridges_enabled">Bridges are enabled: %s</string>
|
59 | 60 |
|
61 |
+ <!-- Preference title for security level settings -->
|
|
62 |
+ <string name="preferences_tor_security_level_settings">Security Settings</string>
|
|
63 |
+ <string name="preferences_tor_security_level_options">Security Level</string>
|
|
64 |
+ |
|
60 | 65 |
<!-- Description of security levels -->
|
61 | 66 |
<string name="tor_security_level_standard_option">Standard</string>
|
62 | 67 |
<string name="tor_security_level_standard_description">All Tor Browser and website features are enabled.</string>
|
... | ... | @@ -67,4 +72,8 @@ |
67 | 72 |
|
68 | 73 |
<!-- Spoof locale to English -->
|
69 | 74 |
<string name="tor_spoof_english">Request English versions of web pages for enhanced privacy</string>
|
75 |
+ |
|
76 |
+ <string name="tor_useamask_usetor">Use a mask, use Tor.</string>
|
|
77 |
+ <string name="tor_resistsurveillance">Resist the surveillance pandemic.</string>
|
|
78 |
+ <string name="tor_donationmatch">Your donation will be matched by Friends of Tor.</string>
|
|
70 | 79 |
</resources>
|
... | ... | @@ -89,6 +89,11 @@ |
89 | 89 |
app:iconSpaceReserved="false"
|
90 | 90 |
android:layout="@layout/preference_cat_style">
|
91 | 91 |
|
92 |
+ <androidx.preference.Preference
|
|
93 |
+ android:icon="@drawable/ic_tracking_protection_enabled"
|
|
94 |
+ android:key="@string/pref_key_tor_security_level_settings"
|
|
95 |
+ android:title="@string/preferences_tor_security_level_settings"/>
|
|
96 |
+ |
|
92 | 97 |
<androidx.preference.Preference
|
93 | 98 |
android:icon="@drawable/ic_private_browsing"
|
94 | 99 |
android:key="@string/pref_key_private_browsing"
|
1 |
+<?xml version="1.0" encoding="utf-8"?><!-- This Source Code Form is subject to the terms of the Mozilla Public
|
|
2 |
+ - License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3 |
+ - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
|
4 |
+<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
|
5 |
+ xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
6 |
+ <org.mozilla.fenix.settings.RadioButtonPreference
|
|
7 |
+ android:defaultValue="true"
|
|
8 |
+ android:key="@string/pref_key_tor_security_level_standard_option"
|
|
9 |
+ android:summary="@string/tor_security_level_standard_description"
|
|
10 |
+ android:title="@string/tor_security_level_standard_option" />
|
|
11 |
+ <org.mozilla.fenix.settings.RadioButtonPreference
|
|
12 |
+ android:defaultValue="false"
|
|
13 |
+ android:key="@string/pref_key_tor_security_level_safer_option"
|
|
14 |
+ android:summary="@string/tor_security_level_safer_description"
|
|
15 |
+ android:title="@string/tor_security_level_safer_option" />
|
|
16 |
+ <org.mozilla.fenix.settings.RadioButtonPreference
|
|
17 |
+ android:defaultValue="false"
|
|
18 |
+ android:key="@string/pref_key_tor_security_level_safest_option"
|
|
19 |
+ android:summary="@string/tor_security_level_safest_description"
|
|
20 |
+ android:title="@string/tor_security_level_safest_option" />
|
|
21 |
+</androidx.preference.PreferenceScreen>
|