diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..231d32a --- /dev/null +++ b/Android.mk @@ -0,0 +1,47 @@ +# +# Copyright (C) 2014 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Install the prebuilt webview apk. + +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := webview +LOCAL_MODULE_CLASS := APPS +LOCAL_PRODUCT_MODULE := true +LOCAL_MULTILIB := both +LOCAL_REQUIRED_MODULES := \ + libwebviewchromium_loader \ + libwebviewchromium_plat_support + +LOCAL_MODULE_TARGET_ARCH := arm arm64 x86 x86_64 +my_src_arch := $(call get-prebuilt-src-arch,$(LOCAL_MODULE_TARGET_ARCH)) +LOCAL_SRC_FILES := prebuilt/$(my_src_arch)/webview.apk + +# Don't sign our arm* builds for out-of-band distribution +ifneq ( ,$(filter $(my_src_arch), arm arm64)) +LOCAL_CERTIFICATE := PRESIGNED +else +LOCAL_CERTIFICATE := $(DEFAULT_SYSTEM_DEV_CERTIFICATE) +endif + +LOCAL_PREBUILT_JNI_LIBS_arm := @lib/armeabi-v7a/libwebviewchromium.so +LOCAL_PREBUILT_JNI_LIBS_arm64 := @lib/arm64-v8a/libwebviewchromium.so +LOCAL_PREBUILT_JNI_LIBS_x86 := @lib/x86/libwebviewchromium.so +LOCAL_PREBUILT_JNI_LIBS_x86_64 := @lib/x86_64/libwebviewchromium.so + +include $(BUILD_PREBUILT) diff --git a/CleanSpec.mk b/CleanSpec.mk new file mode 100644 index 0000000..9c16618 --- /dev/null +++ b/CleanSpec.mk @@ -0,0 +1,52 @@ +# Copyright (C) 2014 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# If you don't need to do a full clean build but would like to touch +# a file or delete some intermediate files, add a clean step to the end +# of the list. These steps will only be run once, if they haven't been +# run before. +# +# E.g.: +# $(call add-clean-step, touch -c external/sqlite/sqlite3.h) +# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) +# +# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with +# files that are missing or have been moved. +# +# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. +# Use $(OUT_DIR) to refer to the "out" directory. +# +# If you need to re-do something that's already mentioned, just copy +# the command and add it to the bottom of the list. E.g., if a change +# that you made last week required touching a file and a change you +# made today requires touching the same file, just copy the old +# touch step and add it to the end of the list. +# +# ***************************************************************** +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST ABOVE THE BANNER +# ***************************************************************** + +# For example: +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) +#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) +#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) +#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib/libwebviewchromium.so) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/lib64/libwebviewchromium.so) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/webview) + +# ****************************************************************** +# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST ABOVE THIS BANNER +# ****************************************************************** diff --git a/LICENSE b/LICENSE index 9843c20..8064d9d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,232 +1,12 @@ -GNU GENERAL PUBLIC LICENSE -Version 3, 29 June 2007 - -Copyright © 2007 Free Software Foundation, Inc. - -Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - -Preamble - -The GNU General Public License is a free, copyleft license for software and other kinds of works. - -The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - -To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. - -For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. - -Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. - -For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. - -Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. - -Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. - -The precise terms and conditions for copying, distribution and modification follow. - -TERMS AND CONDITIONS - -0. Definitions. - -“This License” refers to version 3 of the GNU General Public License. - -“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. - -“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations. - -To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work. - -A “covered work” means either the unmodified Program or a work based on the Program. - -To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. - -To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - -An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. - -1. Source Code. -The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work. - -A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. - -The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. - -The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. - -The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. - -The Corresponding Source for a work in source code form is that same work. - -2. Basic Permissions. -All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - -3. Protecting Users' Legal Rights From Anti-Circumvention Law. -No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. - -When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. - -4. Conveying Verbatim Copies. -You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. - -5. Conveying Modified Source Versions. -You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”. - - c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. - -A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. - -6. Conveying Non-Source Forms. -You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: - - a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. - - d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - -A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - -“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. - -If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). - -The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. - -Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. - -7. Additional Terms. -“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or authors of the material; or - - e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. - -All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. - -If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. - -8. Termination. -You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). - -However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. - -Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. - -Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. - -9. Acceptance Not Required for Having Copies. -You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. - -10. Automatic Licensing of Downstream Recipients. -Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. - -An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. - -11. Patents. -A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”. - -A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. - -In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. - -If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. - -A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. - -12. No Surrender of Others' Freedom. -If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - -13. Use with the GNU Affero General Public License. -Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. - -14. Revised Versions of this License. -The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. - -If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. - -Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. - -15. Disclaimer of Warranty. -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. Limitation of Liability. -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -17. Interpretation of Sections 15 and 16. -If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. - -END OF TERMS AND CONDITIONS - -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. - - LeOSium - Copyright (C) 2023 JoJo - - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - -If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - - LeOSium Copyright (C) 2023 JoJo - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”. - -You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . - -The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . +Below are the license mappings for all of the files found in this repository. +All attempts have been made to ensure accuracy of the corresponding license files. +If you've found an issue please file an issue or pull request. + +Android.mk - Apache-2.0 - https://github.com/LineageOS/android_external_chromium-webview +CleanSpec.mk - Apache-2.0 - https://github.com/LineageOS/android_external_chromium-webview +patches/ + 0001-Vanadium - GPL-2.0-only with exceptions - https://github.com/GrapheneOS/Vanadium + 0002-LineageOS - Apache-2.0 - https://github.com/LineageOS/android_external_chromium-webview +build-webview.sh - Apache-2.0 - https://github.com/LineageOS/scripts/tree/master/build-webview + +Please see the included LICENSE.* files for the corresponding full license texts. diff --git a/README.md b/README.md index 877158b..a254f78 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,30 @@ # LeOSium +Web Browser based on Chromium with a set of patches from Bromite / Calyx / LeOS + +![ic_launcher](https://user-images.githubusercontent.com/2726574/236664554-45e53ecb-d60b-46b6-958d-aea660ecccbc.png) + +# Credits + +* [Chromium project](https://www.chromium.org/Home) and developers +* [Iridium project](https://github.com/iridium-browser) for some patches +* [ungoogled-chromium](https://github.com/Eloston/ungoogled-chromium) for some patches +* [ungoogled-chromium-android](https://github.com/ungoogled-software/ungoogled-chromium-android) for some patches +* [GrapheneOS](https://github.com/GrapheneOS) for some security patches +* [Inox patchset](https://github.com/gcarq/inox-patchset) for some patches (via ungoogled-chromium) +* [Brave Browser](https://github.com/brave/brave-core) for some patches +* [Calyx Browser](https://github.com/CalyxOS/platform_external_calyx_chromium/tree/android13/build/patches) for some patches + +# Filters credits +* [EasyList](https://easylist.to/#easylist) +* [EasyPrivacy](https://easylist.to/#easyprivacy) +* [uBlock Origin](https://github.com/uBlockOrigin) +* [Peter Lowe's Ad and tracking server list](https://pgl.yoyo.org/adservers/) + +The URLs of the lists used are available at: https://github.com/bromite/filters/blob/master/lists.txt + +# License + +* The GrapheneOS patches are released under [GNU GPL v2](https://github.com/GrapheneOS/Vanadium/blob/main/LICENSE). +* The Bromite / Calyxc / LeOS patches are released under [GNU GPL v3](https://github.com/CalyxOS/platform_external_calyx_chromium/blob/android13/LICENSE). +* The Brave patches are released [Mozilla Public License](https://github.com/brave/brave-core/blob/master/LICENSE.html). diff --git a/build-webview.sh b/build-webview.sh new file mode 100644 index 0000000..2851281 --- /dev/null +++ b/build-webview.sh @@ -0,0 +1,233 @@ +#!/bin/bash + +set -e + +chromium_version="114.0.5735.117" +chromium_code="5735117" +chromium_rebrand_name="LeOSium" +chromium_rebrand_color="#7B3F00" +chromium_packageid_webview="com.leos.ium_wv" +chromium_packageid_standalone="com.leos.ium" +chromium_packageid_libtrichrome="com.leos.ium_tcl" +clean=0 +gsync=0 +supported_archs=(arm arm64 x86 x64) + +usage() { + echo "Usage:" + echo " build_webview [ options ]" + echo + echo " Options:" + echo " -a Build specified arch" + echo " -c Clean" + echo " -h Show this message" + echo " -r Specify chromium release" + echo " -s Sync" + echo + echo " Example:" + echo " build_webview -c -s -r $chromium_version:$chromium_code" + echo + exit 1 +} + +build() { + build_args=$args' target_cpu="'$1'"' + + code=$chromium_code + if [ $1 '==' "arm" ]; then + code+=00 + elif [ $1 '==' "arm64" ]; then + code+=50 + #build_args+=' arm_control_flow_integrity="standard"' + elif [ $1 '==' "x86" ]; then + code+=10 + elif [ $1 '==' "x64" ]; then + code+=60 + fi + build_args+=' android_default_version_code="'$code'"' + + gn gen "out/$1" --args="$build_args" + ninja -C out/$1 system_webview_apk chrome_public_apk + if [ "$?" -eq 0 ]; then + [ "$1" '==' "x64" ] && android_arch="x86_64" || android_arch=$1 + cp out/$1/apks/SystemWebView.apk ../prebuilt/$android_arch/webview.apk + fi +} + +while getopts ":a:chr:s" opt; do + case $opt in + a) for arch in ${supported_archs[@]}; do + [ "$OPTARG" '==' "$arch" ] && build_arch="$OPTARG" + done + if [ -z "$build_arch" ]; then + echo "Unsupported ARCH: $OPTARG" + echo "Supported ARCHs: ${supported_archs[@]}" + exit 1 + fi + ;; + c) clean=1 ;; + h) usage ;; + r) version=(${OPTARG//:/ }) + chromium_version=${version[0]} + chromium_code=${version[1]} + ;; + s) gsync=1 ;; + :) + echo "Option -$OPTARG requires an argument" + echo + usage + ;; + \?) + echo "Invalid option:-$OPTARG" + echo + usage + ;; + esac +done +shift $((OPTIND-1)) + +# Add depot_tools to PATH +if [ ! -d depot_tools ]; then + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git +fi +export PATH="$(pwd -P)/depot_tools:$PATH" + +if [ ! -d src ]; then + echo "Initial source download" + fetch android + yes | gclient sync -D -R -r $chromium_version +fi + +if [ $gsync -eq 1 ]; then + echo "Syncing" + find src -name index.lock -delete + yes | gclient sync -D -R -f -r $chromium_version +fi +cd src + +applyPatchReal() { + currentWorkingPatch=$1; + firstLine=$(head -n1 "$currentWorkingPatch"); + if [[ "$firstLine" = *"Mon Sep 17 00:00:00 2001"* ]] || [[ "$firstLine" = *"Thu Jan 1 00:00:00 1970"* ]]; then + if git am "$@"; then + git format-patch -1 HEAD --zero-commit --no-signature --output="$currentWorkingPatch"; + fi; + else + git apply "$@"; + echo "Applying (as diff): $currentWorkingPatch"; + fi; +} +export -f applyPatchReal; + +applyPatch() { + currentWorkingPatch=$1; + if [ -f "$currentWorkingPatch" ]; then + if git apply --check "$@" &> /dev/null; then + applyPatchReal "$@"; + else + if git apply --reverse --check "$@" &> /dev/null; then + echo "Already applied: $currentWorkingPatch"; + else + if git apply --check "$@" --3way &> /dev/null; then + applyPatchReal "$@" --3way; + echo "Applied (as 3way): $currentWorkingPatch"; + else + echo -e "\e[0;31mERROR: Cannot apply: $currentWorkingPatch\e[0m"; + fi; + fi; + fi; + else + echo -e "\e[0;31mERROR: Patch doesn't exist: $currentWorkingPatch\e[0m"; + fi; +} +export -f applyPatch; + +# Apply our changes +if [ $gsync -eq 1 ]; then + #Apply all available patches safely + echo "Applying patches" + find ../patches/0001-Vanadium/ -name "*.patch" -exec bash -c 'applyPatch "$0"' {} \;; + find ../patches/0002-LineageOS/ -name "*.patch" -exec bash -c 'applyPatch "$0"' {} \;; + + #String rebranding, credit Vanadium + echo "String rebranding" + sed -ri 's/(Google )?Chrom(e|ium)/'$chromium_rebrand_name'/g' chrome/browser/touch_to_fill/android/internal/java/strings/android_touch_to_fill_strings.grd chrome/browser/ui/android/strings/android_chrome_strings.grd components/components_chromium_strings.grd components/new_or_sad_tab_strings.grdp components/security_interstitials_strings.grdp chrome/android/java/res_chromium_base/values/channel_constants.xml components/page_info_strings.grdp; + find components/strings/ -name '*.xtb' -exec sed -ri 's/(Google )?Chrom(e|ium)/'$chromium_rebrand_name'/g' {} +; + find chrome/browser/ui/android/strings/translations -name '*.xtb' -exec sed -ri 's/(Google )?Chrom(e|ium)/'$chromium_rebrand_name'/g' {} +; + sed -i 's/Android System WebView/'$chromium_rebrand_name' System WebView/' android_webview/nonembedded/java/AndroidManifest.xml; +fi + +# Build args +args='target_os="android"' +args+=' android_channel="stable"' #Release build +args+=' android_default_version_name="'$chromium_version'"' +args+=' disable_fieldtrial_testing_config=true' +args+=' is_chrome_branded=false' +args+=' is_component_build=false' +args+=' is_official_build=true' +args+=' use_official_google_api_keys=false' +args+=' webview_devui_show_icon=false' +args+=' blink_symbol_level=0' #Release optimizations +args+=' is_debug=false' +args+=' symbol_level=0' +args+=' dfmify_dev_ui=false' #Don't build as module +#args+=' disable_tab_ui_dfm=true' +args+=' ffmpeg_branding="Chrome"' #Codec support +args+=' proprietary_codecs=true' +args+=' enable_resource_allowlist_generation=false' +args+=' enable_gvr_services=false' #Unncessary +args+=' enable_nacl=false' +args+=' enable_remoting=false' +args+=' enable_vr=false' +args+=' use_official_google_api_keys=false' +args+=' system_webview_package_name="'$chromium_packageid_webview'"' #Package IDs +args+=' chrome_public_manifest_package="'$chromium_packageid_standalone'"' +args+=' trichrome_library_package="'$chromium_packageid_libtrichrome'"' +args+=' is_cfi=true' #Security +args+=' use_cfi_cast=true' +args+=' use_relative_vtables_abi=false' +args+=' enable_reporting=false' #Privacy +# from Bromite +args+=' build_contextual_search=false' +#args+=' build_with_tflite_lib=false' +args+=' chrome_pgo_phase=0' +args+=' dcheck_always_on=false' +args+=' debuggable_apks=false' +#args+=' disable_autofill_assistant_dfm=true' +args+=' enable_av1_decoder=true' +args+=' enable_dav1d_decoder=true' +args+=' enable_hangout_services_extension=false' +args+=' enable_iterator_debugging=false' +args+=' enable_mdns=false' +args+=' enable_mse_mpeg2ts_stream_parser=true' +args+=' enable_platform_dolby_vision=true' +args+=' enable_platform_hevc=true' +args+=' exclude_unwind_tables=false' +args+=' icu_use_data_file=true' +args+=' rtc_build_examples=false' +args+=' safe_browsing_mode=2' +args+=' treat_warnings_as_errors=true' +args+=' use_debug_fission=false' +args+=' is_clang=true' +args+=' use_errorprone_java_compiler=false' +args+=' use_gnome_keyring=false' +args+=' use_rtti=false' +args+=' use_stable_package_name_for_trichrome=false' + +cd .. +bash icons.sh +cd src +# Setup environment +[ $clean -eq 1 ] && rm -rf out && echo "Cleaned out" +. build/android/envsetup.sh + +# Check target and build +if [ -n "$build_arch" ]; then + build $build_arch +else + echo "Building all" + build arm64 + build arm + #build x86 + #build x64 +fi diff --git a/icons.sh b/icons.sh new file mode 100644 index 0000000..9302748 --- /dev/null +++ b/icons.sh @@ -0,0 +1,16 @@ +cp -R icons/res_icon/ src/android_webview/nonembedded/java/ + +cp -R icons/res_chromium_base/ src/chrome/android/java/ + +cp -R icons/res/ src/chrome/android/webapk/shell_apk/res/ + +cp -R icons/images/ src/docs/ + +cp -R icons/res1/mipmap-hdpi src/tools/android/kerberos/SpnegoAuthenticator/res/ +cp -R icons/res1/mipmap-mdpi src/tools/android/kerberos/SpnegoAuthenticator/res/ +cp -R icons/res1/mipmap-xhdpi src/tools/android/kerberos/SpnegoAuthenticator/res/ +cp -R icons/res1/mipmap-xxhdpi src/tools/android/kerberos/SpnegoAuthenticator/res/ + + + + diff --git a/icons/images/chromium_logo.png b/icons/images/chromium_logo.png new file mode 100644 index 0000000..b154239 Binary files /dev/null and b/icons/images/chromium_logo.png differ diff --git a/icons/res/mipmap-mdpi/ic_launcher_foreground.png b/icons/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..c543e7b Binary files /dev/null and b/icons/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/icons/res1/mipmap-hdpi/ic_launcher.png b/icons/res1/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..d8fa36f Binary files /dev/null and b/icons/res1/mipmap-hdpi/ic_launcher.png differ diff --git a/icons/res1/mipmap-mdpi/ic_launcher.png b/icons/res1/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..8426df2 Binary files /dev/null and b/icons/res1/mipmap-mdpi/ic_launcher.png differ diff --git a/icons/res1/mipmap-xhdpi/ic_launcher.png b/icons/res1/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..e887310 Binary files /dev/null and b/icons/res1/mipmap-xhdpi/ic_launcher.png differ diff --git a/icons/res1/mipmap-xxhdpi/ic_launcher.png b/icons/res1/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..f50acb4 Binary files /dev/null and b/icons/res1/mipmap-xxhdpi/ic_launcher.png differ diff --git a/icons/res_chromium_base/OWNERS b/icons/res_chromium_base/OWNERS new file mode 100644 index 0000000..8708130 --- /dev/null +++ b/icons/res_chromium_base/OWNERS @@ -0,0 +1,6 @@ +# This restriction is in place to avoid accidential addition to our top level +# layout files, such as add duplicated assets, or introducing new colors when +# we don't want them. +set noparent + +file://ui/android/java/res/LAYOUT_OWNERS diff --git a/icons/res_chromium_base/mipmap-hdpi/app_icon.png b/icons/res_chromium_base/mipmap-hdpi/app_icon.png new file mode 100644 index 0000000..3c833b4 Binary files /dev/null and b/icons/res_chromium_base/mipmap-hdpi/app_icon.png differ diff --git a/icons/res_chromium_base/mipmap-hdpi/layered_app_icon.png b/icons/res_chromium_base/mipmap-hdpi/layered_app_icon.png new file mode 100644 index 0000000..3384795 Binary files /dev/null and b/icons/res_chromium_base/mipmap-hdpi/layered_app_icon.png differ diff --git a/icons/res_chromium_base/mipmap-hdpi/layered_app_icon_background.png b/icons/res_chromium_base/mipmap-hdpi/layered_app_icon_background.png new file mode 100644 index 0000000..3ed5ab6 Binary files /dev/null and b/icons/res_chromium_base/mipmap-hdpi/layered_app_icon_background.png differ diff --git a/icons/res_chromium_base/mipmap-mdpi/app_icon.png b/icons/res_chromium_base/mipmap-mdpi/app_icon.png new file mode 100644 index 0000000..86ca238 Binary files /dev/null and b/icons/res_chromium_base/mipmap-mdpi/app_icon.png differ diff --git a/icons/res_chromium_base/mipmap-mdpi/layered_app_icon.png b/icons/res_chromium_base/mipmap-mdpi/layered_app_icon.png new file mode 100644 index 0000000..21d3814 Binary files /dev/null and b/icons/res_chromium_base/mipmap-mdpi/layered_app_icon.png differ diff --git a/icons/res_chromium_base/mipmap-mdpi/layered_app_icon_background.png b/icons/res_chromium_base/mipmap-mdpi/layered_app_icon_background.png new file mode 100644 index 0000000..4f37a59 Binary files /dev/null and b/icons/res_chromium_base/mipmap-mdpi/layered_app_icon_background.png differ diff --git a/icons/res_chromium_base/mipmap-xhdpi/app_icon.png b/icons/res_chromium_base/mipmap-xhdpi/app_icon.png new file mode 100644 index 0000000..9a20f15 Binary files /dev/null and b/icons/res_chromium_base/mipmap-xhdpi/app_icon.png differ diff --git a/icons/res_chromium_base/mipmap-xhdpi/layered_app_icon.png b/icons/res_chromium_base/mipmap-xhdpi/layered_app_icon.png new file mode 100644 index 0000000..de67dd4 Binary files /dev/null and b/icons/res_chromium_base/mipmap-xhdpi/layered_app_icon.png differ diff --git a/icons/res_chromium_base/mipmap-xhdpi/layered_app_icon_background.png b/icons/res_chromium_base/mipmap-xhdpi/layered_app_icon_background.png new file mode 100644 index 0000000..1fe1d40 Binary files /dev/null and b/icons/res_chromium_base/mipmap-xhdpi/layered_app_icon_background.png differ diff --git a/icons/res_chromium_base/mipmap-xxhdpi/app_icon.png b/icons/res_chromium_base/mipmap-xxhdpi/app_icon.png new file mode 100644 index 0000000..d7f1f33 Binary files /dev/null and b/icons/res_chromium_base/mipmap-xxhdpi/app_icon.png differ diff --git a/icons/res_chromium_base/mipmap-xxhdpi/layered_app_icon.png b/icons/res_chromium_base/mipmap-xxhdpi/layered_app_icon.png new file mode 100644 index 0000000..0176275 Binary files /dev/null and b/icons/res_chromium_base/mipmap-xxhdpi/layered_app_icon.png differ diff --git a/icons/res_chromium_base/mipmap-xxhdpi/layered_app_icon_background.png b/icons/res_chromium_base/mipmap-xxhdpi/layered_app_icon_background.png new file mode 100644 index 0000000..479300e Binary files /dev/null and b/icons/res_chromium_base/mipmap-xxhdpi/layered_app_icon_background.png differ diff --git a/icons/res_chromium_base/mipmap-xxxhdpi/app_icon.png b/icons/res_chromium_base/mipmap-xxxhdpi/app_icon.png new file mode 100644 index 0000000..4378563 Binary files /dev/null and b/icons/res_chromium_base/mipmap-xxxhdpi/app_icon.png differ diff --git a/icons/res_chromium_base/mipmap-xxxhdpi/layered_app_icon.png b/icons/res_chromium_base/mipmap-xxxhdpi/layered_app_icon.png new file mode 100644 index 0000000..a461d2c Binary files /dev/null and b/icons/res_chromium_base/mipmap-xxxhdpi/layered_app_icon.png differ diff --git a/icons/res_chromium_base/mipmap-xxxhdpi/layered_app_icon_background.png b/icons/res_chromium_base/mipmap-xxxhdpi/layered_app_icon_background.png new file mode 100644 index 0000000..43b0e98 Binary files /dev/null and b/icons/res_chromium_base/mipmap-xxxhdpi/layered_app_icon_background.png differ diff --git a/icons/res_icon/drawable-hdpi/icon_webview.png b/icons/res_icon/drawable-hdpi/icon_webview.png new file mode 100644 index 0000000..3c833b4 Binary files /dev/null and b/icons/res_icon/drawable-hdpi/icon_webview.png differ diff --git a/icons/res_icon/drawable-mdpi/icon_webview.png b/icons/res_icon/drawable-mdpi/icon_webview.png new file mode 100644 index 0000000..86ca238 Binary files /dev/null and b/icons/res_icon/drawable-mdpi/icon_webview.png differ diff --git a/icons/res_icon/drawable-xhdpi/icon_webview.png b/icons/res_icon/drawable-xhdpi/icon_webview.png new file mode 100644 index 0000000..9a20f15 Binary files /dev/null and b/icons/res_icon/drawable-xhdpi/icon_webview.png differ diff --git a/icons/res_icon/drawable-xxhdpi/icon_webview.png b/icons/res_icon/drawable-xxhdpi/icon_webview.png new file mode 100644 index 0000000..d7f1f33 Binary files /dev/null and b/icons/res_icon/drawable-xxhdpi/icon_webview.png differ diff --git a/icons/res_icon/drawable-xxxhdpi/icon_webview.png b/icons/res_icon/drawable-xxxhdpi/icon_webview.png new file mode 100644 index 0000000..4378563 Binary files /dev/null and b/icons/res_icon/drawable-xxxhdpi/icon_webview.png differ diff --git a/patches/0001-Vanadium/0001-disable-checkout_nacl.patch b/patches/0001-Vanadium/0001-disable-checkout_nacl.patch new file mode 100644 index 0000000..99e1ddb --- /dev/null +++ b/patches/0001-Vanadium/0001-disable-checkout_nacl.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Sat, 21 Nov 2020 01:30:06 -0500 +Subject: [PATCH] disable checkout_nacl + +--- + DEPS | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/DEPS b/DEPS +index 058ab4e2e99f6..3d1b87682d225 100644 +--- a/DEPS ++++ b/DEPS +@@ -107,7 +107,7 @@ vars = { + + # Check out and download nacl by default, unless on an arm mac. + # This can be disabled e.g. with custom_vars. +- 'checkout_nacl': 'not (host_os == "mac" and host_cpu == "arm64")', ++ 'checkout_nacl': False, + + # By default, do not check out src-internal. This can be overridden e.g. with + # custom_vars. diff --git a/patches/0001-Vanadium/0002-use-64-bit-WebView-processes.patch b/patches/0001-Vanadium/0002-use-64-bit-WebView-processes.patch new file mode 100644 index 0000000..716a27a --- /dev/null +++ b/patches/0001-Vanadium/0002-use-64-bit-WebView-processes.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 26 Jan 2017 01:30:12 -0500 +Subject: [PATCH] use 64-bit WebView processes + +--- + android_webview/nonembedded/java/AndroidManifest.xml | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/android_webview/nonembedded/java/AndroidManifest.xml b/android_webview/nonembedded/java/AndroidManifest.xml +index 6f4d2015c8685..2640f3f722a96 100644 +--- a/android_webview/nonembedded/java/AndroidManifest.xml ++++ b/android_webview/nonembedded/java/AndroidManifest.xml +@@ -40,9 +40,6 @@ by a child template that "extends" this file. + android:icon="@{{manifest_package|default('com.android.webview')}}:drawable/icon_webview" + android:name="{{ application_name|default('org.chromium.android_webview.nonembedded.WebViewApkApplication') }}" + android:multiArch="true" +- {% if force_32_bit is defined and force_32_bit == 'true' %} +- android:use32bitAbi="true" +- {% endif %} + android:extractNativeLibs="false"> + {# This part is shared between stand-alone WebView and Monochrome #} + {% macro common(manifest_package, webview_lib) %} diff --git a/patches/0001-Vanadium/0003-switch-to-fstack-protector-strong.patch b/patches/0001-Vanadium/0003-switch-to-fstack-protector-strong.patch new file mode 100644 index 0000000..a9d66e0 --- /dev/null +++ b/patches/0001-Vanadium/0003-switch-to-fstack-protector-strong.patch @@ -0,0 +1,33 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Wed, 26 Dec 2018 10:20:24 -0500 +Subject: [PATCH] switch to -fstack-protector-strong + +--- + build/config/compiler/BUILD.gn | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index 28c2255ba8090..04a4efb658b28 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -332,18 +332,12 @@ config("compiler") { + cflags += [ "-fstack-protector" ] + } + } else if ((is_posix && !is_chromeos && !is_nacl) || is_fuchsia) { +- # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc supports it. +- # See also https://crbug.com/533294 +- if (current_os != "zos") { +- cflags += [ "--param=ssp-buffer-size=4" ] +- } +- + # The x86 toolchain currently has problems with stack-protector. + if (is_android && current_cpu == "x86") { + cflags += [ "-fno-stack-protector" ] + } else if (current_os != "aix") { + # Not available on aix. +- cflags += [ "-fstack-protector" ] ++ cflags += [ "-fstack-protector-strong" ] + } + } + diff --git a/patches/0001-Vanadium/0004-enable-fwrapv-in-Clang-for-non-UBSan-builds.patch b/patches/0001-Vanadium/0004-enable-fwrapv-in-Clang-for-non-UBSan-builds.patch new file mode 100644 index 0000000..eedfa60 --- /dev/null +++ b/patches/0001-Vanadium/0004-enable-fwrapv-in-Clang-for-non-UBSan-builds.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 22 Dec 2016 07:15:34 -0500 +Subject: [PATCH] enable -fwrapv in Clang for non-UBSan builds + +--- + build/config/compiler/BUILD.gn | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index 04a4efb658b28..e91ed9c20f8f1 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -348,6 +348,10 @@ config("compiler") { + } + } + ++ if (is_clang && !is_ubsan && !is_ubsan_security) { ++ cflags += [ "-fwrapv" ] ++ } ++ + # Linker warnings. + if (fatal_linker_warnings && !is_apple && current_os != "aix" && + current_os != "zos") { diff --git a/patches/0001-Vanadium/0005-enable-ftrivial-auto-var-init-zero.patch b/patches/0001-Vanadium/0005-enable-ftrivial-auto-var-init-zero.patch new file mode 100644 index 0000000..4fcadb7 --- /dev/null +++ b/patches/0001-Vanadium/0005-enable-ftrivial-auto-var-init-zero.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Wed, 8 Apr 2020 20:48:17 -0400 +Subject: [PATCH] enable -ftrivial-auto-var-init=zero + +--- + build/config/compiler/BUILD.gn | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index e91ed9c20f8f1..55ea7a01701ad 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -352,6 +352,10 @@ config("compiler") { + cflags += [ "-fwrapv" ] + } + ++ if (is_clang) { ++ cflags += [ "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang" ] ++ } ++ + # Linker warnings. + if (fatal_linker_warnings && !is_apple && current_os != "aix" && + current_os != "zos") { diff --git a/patches/0001-Vanadium/0006-disable-broken-warning-for-auto-var-init.patch b/patches/0001-Vanadium/0006-disable-broken-warning-for-auto-var-init.patch new file mode 100644 index 0000000..0221f72 --- /dev/null +++ b/patches/0001-Vanadium/0006-disable-broken-warning-for-auto-var-init.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 21 May 2020 14:07:54 -0400 +Subject: [PATCH] disable broken warning for auto var init + +--- + build/config/compiler/BUILD.gn | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn +index 55ea7a01701ad..8d4daeea6874f 100644 +--- a/build/config/compiler/BUILD.gn ++++ b/build/config/compiler/BUILD.gn +@@ -353,7 +353,7 @@ config("compiler") { + } + + if (is_clang) { +- cflags += [ "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang" ] ++ cflags += [ "-ftrivial-auto-var-init=zero", "-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang", "-Wno-unused-command-line-argument" ] + } + + # Linker warnings. diff --git a/patches/0001-Vanadium/0010-Remove-logo-from-chrome-version.patch b/patches/0001-Vanadium/0010-Remove-logo-from-chrome-version.patch new file mode 100644 index 0000000..df1c3a9 --- /dev/null +++ b/patches/0001-Vanadium/0010-Remove-logo-from-chrome-version.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: A Mak +Date: Sat, 25 Jul 2020 17:56:47 -0700 +Subject: [PATCH] Remove logo from chrome://version + +--- + components/version_ui/resources/about_version.html | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/components/version_ui/resources/about_version.html b/components/version_ui/resources/about_version.html +index d00bc990102ae..19f51bfb26ac5 100644 +--- a/components/version_ui/resources/about_version.html ++++ b/components/version_ui/resources/about_version.html +@@ -55,13 +55,6 @@ about:version template page + media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"> + $i18n{logo_alt_text} + +- +- +- +- +- +- $i18n{logo_alt_text} +- + +
$i18n{company}
+ diff --git a/patches/0001-Vanadium/0013-remove-Help-feedback-menu-entry.patch b/patches/0001-Vanadium/0013-remove-Help-feedback-menu-entry.patch new file mode 100644 index 0000000..f506ae0 --- /dev/null +++ b/patches/0001-Vanadium/0013-remove-Help-feedback-menu-entry.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 15 Apr 2021 02:14:37 -0400 +Subject: [PATCH] remove Help & feedback menu entry + +--- + .../browser/app/appmenu/AppMenuPropertiesDelegateImpl.java | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java +index 60b0dc69ce868..950c70bd9d161 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java +@@ -546,6 +546,8 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate + menu.findItem(R.id.reader_mode_prefs_id) + .setVisible(isCurrentTabNotNull && shouldShowReaderModePrefs(currentTab)); + ++ menu.findItem(R.id.help_id).setVisible(false); ++ + updateManagedByMenuItem(menu, currentTab); + } + diff --git a/patches/0001-Vanadium/0014-hide-passwords.google.com-link-when-not-supported.patch b/patches/0001-Vanadium/0014-hide-passwords.google.com-link-when-not-supported.patch new file mode 100644 index 0000000..f57c299 --- /dev/null +++ b/patches/0001-Vanadium/0014-hide-passwords.google.com-link-when-not-supported.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Sun, 13 Aug 2017 19:33:04 -0400 +Subject: [PATCH] hide passwords.google.com link when not supported + +--- + .../browser/password_manager/settings/PasswordSettings.java | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java +index 59418af6c90f6..a95af908191e4 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettings.java +@@ -40,6 +40,7 @@ import org.chromium.chrome.browser.password_manager.PasswordManagerHelper; + import org.chromium.chrome.browser.preferences.Pref; + import org.chromium.chrome.browser.profiles.Profile; + import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate; ++import org.chromium.chrome.browser.signin.services.IdentityServicesProvider; + import org.chromium.chrome.browser.settings.SettingsLauncherImpl; + import org.chromium.chrome.browser.sync.SyncService; + import org.chromium.chrome.browser.sync.settings.SyncSettingsUtils; +@@ -597,6 +598,9 @@ public class PasswordSettings extends PreferenceFragmentCompat + if (mSearchQuery != null && !mNoPasswords) { + return; // Don't add the Manage Account link if there is a search going on. + } ++ if (!IdentityServicesProvider.get().getSigninManager(Profile.getLastUsedRegularProfile()).isSigninSupported(false)) { ++ return; ++ } + if (getPreferenceScreen().findPreference(PREF_KEY_MANAGE_ACCOUNT_LINK) != null) { + return; // Don't add the Manage Account link if it's present. + } diff --git a/patches/0001-Vanadium/0015-disable-first-run-welcome-page.patch b/patches/0001-Vanadium/0015-disable-first-run-welcome-page.patch new file mode 100644 index 0000000..2e23abf --- /dev/null +++ b/patches/0001-Vanadium/0015-disable-first-run-welcome-page.patch @@ -0,0 +1,48 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: csagan5 <32685696+csagan5@users.noreply.github.com> +Date: Sun, 26 Nov 2017 22:51:43 +0100 +Subject: [PATCH] disable first run welcome page + +--- + .../org/chromium/chrome/browser/firstrun/FirstRunUtils.java | 3 --- + .../chromium/chrome/browser/firstrun/FirstRunStatus.java | 6 +++++- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java +index 1ed0ad476b512..fb390474ccaf0 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunUtils.java +@@ -44,15 +44,12 @@ public class FirstRunUtils { + boolean javaPrefValue = + javaPrefs.readBoolean(ChromePreferenceKeys.FIRST_RUN_CACHED_TOS_ACCEPTED, false); + boolean nativePrefValue = isFirstRunEulaAccepted(); +- boolean isFirstRunComplete = FirstRunStatus.getFirstRunFlowComplete(); +- if (javaPrefValue || nativePrefValue || isFirstRunComplete) { + if (!javaPrefValue) { + javaPrefs.writeBoolean(ChromePreferenceKeys.FIRST_RUN_CACHED_TOS_ACCEPTED, true); + } + if (!nativePrefValue) { + setEulaAccepted(); + } +- } + } + + /** +diff --git a/chrome/browser/first_run/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java b/chrome/browser/first_run/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java +index 46536c7cdd988..59d5c8d322e1f 100644 +--- a/chrome/browser/first_run/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java ++++ b/chrome/browser/first_run/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunStatus.java +@@ -43,8 +43,12 @@ public class FirstRunStatus { + * includes ToS and Sign In pages if necessary. + */ + public static boolean getFirstRunFlowComplete() { +- return SharedPreferencesManager.getInstance().readBoolean( ++ boolean complete = SharedPreferencesManager.getInstance().readBoolean( + ChromePreferenceKeys.FIRST_RUN_FLOW_COMPLETE, false); ++ if (!complete) { ++ setFirstRunFlowComplete(true); ++ } ++ return true; + } + + /** diff --git a/patches/0001-Vanadium/0016-disable-seed-based-field-trials.patch b/patches/0001-Vanadium/0016-disable-seed-based-field-trials.patch new file mode 100644 index 0000000..a384fa5 --- /dev/null +++ b/patches/0001-Vanadium/0016-disable-seed-based-field-trials.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Tue, 25 Dec 2018 16:19:51 -0500 +Subject: [PATCH] disable seed-based field trials + +--- + .../variations/service/variations_field_trial_creator.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc +index ac34e1377e10b..5979b8864278d 100644 +--- a/components/variations/service/variations_field_trial_creator.cc ++++ b/components/variations/service/variations_field_trial_creator.cc +@@ -311,12 +311,16 @@ bool VariationsFieldTrialCreator::SetUpFieldTrials( + + bool used_seed = false; + if (!used_testing_config) { ++#if defined(FIELDTRIAL_SEED_ENABLED) + used_seed = CreateTrialsFromSeed(*entropy_providers, feature_list.get(), + safe_seed_manager); ++#endif // BUILDFLAG(FIELDTRIAL_SEED_ENABLED) + } + ++#if defined(FIELDTRIAL_SEED_ENABLED) + platform_field_trials->SetUpClientSideFieldTrials( + used_seed, *entropy_providers, feature_list.get()); ++#endif // BUILDFLAG(FIELDTRIAL_SEED_ENABLED) + + base::FeatureList::SetInstance(std::move(feature_list)); + diff --git a/patches/0001-Vanadium/0017-disable-fetching-variations.patch b/patches/0001-Vanadium/0017-disable-fetching-variations.patch new file mode 100644 index 0000000..495a545 --- /dev/null +++ b/patches/0001-Vanadium/0017-disable-fetching-variations.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Wed, 18 Nov 2020 19:08:58 -0500 +Subject: [PATCH] disable fetching variations + +--- + .../org/chromium/chrome/browser/init/AsyncInitTaskRunner.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java +index 28675ebecf26b..577ab8e775467 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitTaskRunner.java +@@ -39,7 +39,7 @@ public abstract class AsyncInitTaskRunner { + + @VisibleForTesting + boolean shouldFetchVariationsSeedDuringFirstRun() { +- return VersionInfo.isOfficialBuild(); ++ return false; + } + + @VisibleForTesting diff --git a/patches/0001-Vanadium/0018-disable-WebView-variations-support.patch b/patches/0001-Vanadium/0018-disable-WebView-variations-support.patch new file mode 100644 index 0000000..77d6bb3 --- /dev/null +++ b/patches/0001-Vanadium/0018-disable-WebView-variations-support.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 10 Dec 2020 10:09:18 -0500 +Subject: [PATCH] disable WebView variations support + +--- + .../com/android/webview/chromium/WebViewChromiumAwInit.java | 6 ------ + .../webview/chromium/WebViewChromiumFactoryProvider.java | 4 ---- + 2 files changed, 10 deletions(-) + +diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumAwInit.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumAwInit.java +index d165d41f8b9e8..154be209c83fd 100644 +--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumAwInit.java ++++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumAwInit.java +@@ -202,12 +202,6 @@ public class WebViewChromiumAwInit { + + AwBrowserProcess.configureChildProcessLauncher(); + +- // finishVariationsInitLocked() must precede native initialization so the seed is +- // available when AwFeatureListCreator::SetUpFieldTrials() runs. +- if (!FastVariationsSeedSafeModeAction.hasRun()) { +- finishVariationsInitLocked(); +- } +- + AwBrowserProcess.start(); + AwBrowserProcess.handleMinidumpsAndSetMetricsConsent(true /* updateMetricsConsent */); + +diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java +index c1c83348cc734..eea695706f323 100644 +--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java ++++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java +@@ -478,10 +478,6 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider { + } + } + +- if (!FastVariationsSeedSafeModeAction.hasRun()) { +- mAwInit.startVariationsInit(); +- } +- + mShouldDisableThreadChecking = shouldDisableThreadChecking(ctx); + + setSingleton(this); diff --git a/patches/0001-Vanadium/0019-disable-navigation-error-correction-by-default.patch b/patches/0001-Vanadium/0019-disable-navigation-error-correction-by-default.patch new file mode 100644 index 0000000..44847f1 --- /dev/null +++ b/patches/0001-Vanadium/0019-disable-navigation-error-correction-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Wed, 23 Nov 2016 08:29:58 -0500 +Subject: [PATCH] disable navigation error correction by default + +--- + chrome/browser/net/profile_network_context_service.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/net/profile_network_context_service.cc b/chrome/browser/net/profile_network_context_service.cc +index 81851bafbadd5..3511c7f9095e7 100644 +--- a/chrome/browser/net/profile_network_context_service.cc ++++ b/chrome/browser/net/profile_network_context_service.cc +@@ -389,7 +389,7 @@ void ProfileNetworkContextService::UpdateAdditionalCertificates() { + void ProfileNetworkContextService::RegisterProfilePrefs( + user_prefs::PrefRegistrySyncable* registry) { + registry->RegisterBooleanPref( +- embedder_support::kAlternateErrorPagesEnabled, true, ++ embedder_support::kAlternateErrorPagesEnabled, false, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kQuicAllowed, true); + registry->RegisterBooleanPref(prefs::kGloballyScopeHTTPAuthCacheEnabled, diff --git a/patches/0001-Vanadium/0020-disable-contextual-search-by-default.patch b/patches/0001-Vanadium/0020-disable-contextual-search-by-default.patch new file mode 100644 index 0000000..5cee271 --- /dev/null +++ b/patches/0001-Vanadium/0020-disable-contextual-search-by-default.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Wed, 23 Nov 2016 09:26:51 -0500 +Subject: [PATCH] disable contextual search by default + +--- + .../browser/contextualsearch/ContextualSearchFieldTrial.java | 2 +- + chrome/browser/profiles/profile.cc | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java +index 2dc13948b232d..2eff86dcc43f2 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFieldTrial.java +@@ -114,7 +114,7 @@ public class ContextualSearchFieldTrial { + // Allow disabling the feature remotely. + if (getBooleanParam(DISABLED_PARAM)) return false; + +- return true; ++ return false; + } + + /** +diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc +index 6cffe941b26f9..8cb7e0e113203 100644 +--- a/chrome/browser/profiles/profile.cc ++++ b/chrome/browser/profiles/profile.cc +@@ -315,7 +315,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { + #if BUILDFLAG(IS_ANDROID) + registry->RegisterStringPref( + prefs::kContextualSearchEnabled, +- std::string(), ++ "false", + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref( + prefs::kContextualSearchWasFullyPrivacyEnabled, false, diff --git a/patches/0001-Vanadium/0021-disable-network-prediction-by-default.patch b/patches/0001-Vanadium/0021-disable-network-prediction-by-default.patch new file mode 100644 index 0000000..c5deb41 --- /dev/null +++ b/patches/0001-Vanadium/0021-disable-network-prediction-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Wed, 23 Nov 2016 08:31:44 -0500 +Subject: [PATCH] disable network prediction by default + +--- + chrome/browser/prefetch/prefetch_prefs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/prefetch/prefetch_prefs.h b/chrome/browser/prefetch/prefetch_prefs.h +index 02f682dc1eba1..2f36fa7fd1c08 100644 +--- a/chrome/browser/prefetch/prefetch_prefs.h ++++ b/chrome/browser/prefetch/prefetch_prefs.h +@@ -28,7 +28,7 @@ enum class NetworkPredictionOptions { + kWifiOnlyDeprecated = 1, + kDisabled = 2, + kExtended = 3, +- kDefault = kWifiOnlyDeprecated, ++ kDefault = kDisabled, + }; + + // Enum representing possible values of the Preload Pages opt-in state. These diff --git a/patches/0001-Vanadium/0022-disable-metrics-by-default.patch b/patches/0001-Vanadium/0022-disable-metrics-by-default.patch new file mode 100644 index 0000000..de1ade0 --- /dev/null +++ b/patches/0001-Vanadium/0022-disable-metrics-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 24 Nov 2016 11:41:00 -0500 +Subject: [PATCH] disable metrics by default + +--- + .../chromium/chrome/browser/firstrun/FirstRunActivityBase.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java +index db91b908462b1..8d8c8302a58d8 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java +@@ -55,7 +55,7 @@ public abstract class FirstRunActivityBase + static final String SHOW_SEARCH_ENGINE_PAGE = "ShowSearchEnginePage"; + static final String SHOW_SYNC_CONSENT_PAGE = "ShowSyncConsent"; + +- public static final boolean DEFAULT_METRICS_AND_CRASH_REPORTING = true; ++ public static final boolean DEFAULT_METRICS_AND_CRASH_REPORTING = false; + + private static PolicyLoadListenerFactory sPolicyLoadListenerFactory; + diff --git a/patches/0001-Vanadium/0023-disable-hyperlink-auditing-by-default.patch b/patches/0001-Vanadium/0023-disable-hyperlink-auditing-by-default.patch new file mode 100644 index 0000000..548de0f --- /dev/null +++ b/patches/0001-Vanadium/0023-disable-hyperlink-auditing-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Sat, 26 Nov 2016 14:57:22 -0500 +Subject: [PATCH] disable hyperlink auditing by default + +--- + chrome/browser/chrome_content_browser_client.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc +index bb3d32d4f4909..70a74f4178233 100644 +--- a/chrome/browser/chrome_content_browser_client.cc ++++ b/chrome/browser/chrome_content_browser_client.cc +@@ -1619,7 +1619,7 @@ void ChromeContentBrowserClient::RegisterLocalStatePrefs( + void ChromeContentBrowserClient::RegisterProfilePrefs( + user_prefs::PrefRegistrySyncable* registry) { + registry->RegisterBooleanPref(prefs::kDisable3DAPIs, false); +- registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, true); ++ registry->RegisterBooleanPref(prefs::kEnableHyperlinkAuditing, false); + // Register user prefs for mapping SitePerProcess and IsolateOrigins in + // user policy in addition to the same named ones in Local State (which are + // used for mapping the command-line flags). diff --git a/patches/0001-Vanadium/0024-disable-showing-popular-sites-by-default.patch b/patches/0001-Vanadium/0024-disable-showing-popular-sites-by-default.patch new file mode 100644 index 0000000..9dea892 --- /dev/null +++ b/patches/0001-Vanadium/0024-disable-showing-popular-sites-by-default.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Tue, 6 Mar 2018 00:27:41 -0500 +Subject: [PATCH] disable showing popular sites by default + +--- + components/ntp_tiles/features.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/components/ntp_tiles/features.cc b/components/ntp_tiles/features.cc +index 26049117ac858..87bc57efba5a9 100644 +--- a/components/ntp_tiles/features.cc ++++ b/components/ntp_tiles/features.cc +@@ -15,7 +15,7 @@ const char kPopularSitesFieldTrialName[] = "NTPPopularSites"; + + BASE_FEATURE(kPopularSitesBakedInContentFeature, + "NTPPopularSitesBakedInContent", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + + BASE_FEATURE(kNtpMostLikelyFaviconsFromServerFeature, + "NTPMostLikelyFaviconsFromServer", +@@ -23,7 +23,7 @@ BASE_FEATURE(kNtpMostLikelyFaviconsFromServerFeature, + + BASE_FEATURE(kUsePopularSitesSuggestions, + "UsePopularSitesSuggestions", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + + BASE_FEATURE(kNewTabPageRetention, + "IOSNewTabPageRetention", diff --git a/patches/0001-Vanadium/0025-disable-article-suggestions-feature-by-default.patch b/patches/0001-Vanadium/0025-disable-article-suggestions-feature-by-default.patch new file mode 100644 index 0000000..1e1ee71 --- /dev/null +++ b/patches/0001-Vanadium/0025-disable-article-suggestions-feature-by-default.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 8 Mar 2018 22:43:12 -0500 +Subject: [PATCH] disable article suggestions feature by default + +--- + components/feed/core/shared_prefs/pref_names.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/components/feed/core/shared_prefs/pref_names.cc b/components/feed/core/shared_prefs/pref_names.cc +index e239b42b31ef3..5a5e881272c22 100644 +--- a/components/feed/core/shared_prefs/pref_names.cc ++++ b/components/feed/core/shared_prefs/pref_names.cc +@@ -20,8 +20,8 @@ const char kArticlesListVisible[] = "ntp_snippets.list_visible"; + const char kVideoPreviewsType[] = "ntp_snippets.video_previews_type"; + + void RegisterFeedSharedProfilePrefs(PrefRegistrySimple* registry) { +- registry->RegisterBooleanPref(kEnableSnippets, true); +- registry->RegisterBooleanPref(kArticlesListVisible, true); ++ registry->RegisterBooleanPref(kEnableSnippets, false); ++ registry->RegisterBooleanPref(kArticlesListVisible, false); + registry->RegisterIntegerPref(kVideoPreviewsType, 1); + } + diff --git a/patches/0001-Vanadium/0026-disable-content-feed-suggestions-by-default.patch b/patches/0001-Vanadium/0026-disable-content-feed-suggestions-by-default.patch new file mode 100644 index 0000000..5070e69 --- /dev/null +++ b/patches/0001-Vanadium/0026-disable-content-feed-suggestions-by-default.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Sun, 22 Mar 2020 01:23:48 -0400 +Subject: [PATCH] disable content feed suggestions by default + +--- + .../org/chromium/chrome/browser/flags/ChromeFeatureList.java | 2 +- + components/feed/feed_feature_list.cc | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java +index 957ccbd940466..73954ddc3e289 100644 +--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java ++++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java +@@ -623,7 +623,7 @@ public abstract class ChromeFeatureList { + new CachedFlag(INCOGNITO_REAUTHENTICATION_FOR_ANDROID, false); + public static final CachedFlag sInstanceSwitcher = new CachedFlag(INSTANCE_SWITCHER, true); + public static final CachedFlag sInstantStart = new CachedFlag(INSTANT_START, false); +- public static final CachedFlag sInterestFeedV2 = new CachedFlag(INTEREST_FEED_V2, true); ++ public static final CachedFlag sInterestFeedV2 = new CachedFlag(INTEREST_FEED_V2, false); + public static final CachedFlag sLensCameraAssistedSearch = + new CachedFlag(LENS_CAMERA_ASSISTED_SEARCH, true); + public static final CachedFlag sOmahaMinSdkVersionAndroid = +diff --git a/components/feed/feed_feature_list.cc b/components/feed/feed_feature_list.cc +index a8b36a9ace946..93f8bc7a9af6e 100644 +--- a/components/feed/feed_feature_list.cc ++++ b/components/feed/feed_feature_list.cc +@@ -24,7 +24,7 @@ BASE_FEATURE(kInterestFeedContentSuggestions, + // changed, please update the cached one's default value in CachedFeatureFlags. + BASE_FEATURE(kInterestFeedV2, + "InterestFeedV2", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + + BASE_FEATURE(kInterestFeedV2Autoplay, + "InterestFeedV2Autoplay", diff --git a/patches/0001-Vanadium/0027-disable-sensors-access-by-default.patch b/patches/0001-Vanadium/0027-disable-sensors-access-by-default.patch new file mode 100644 index 0000000..ae2e04d --- /dev/null +++ b/patches/0001-Vanadium/0027-disable-sensors-access-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Sun, 16 Jun 2019 15:57:29 -0400 +Subject: [PATCH] disable sensors access by default + +--- + .../content_settings/core/browser/content_settings_registry.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc +index 07258df900b71..c7a23d2e5ff72 100644 +--- a/components/content_settings/core/browser/content_settings_registry.cc ++++ b/components/content_settings/core/browser/content_settings_registry.cc +@@ -318,7 +318,7 @@ void ContentSettingsRegistry::Init() { + // TODO(crbug.com/904439): Update this to "SECURE_ONLY" once + // DeviceOrientationEvents and DeviceMotionEvents are only fired in secure + // contexts. +- Register(ContentSettingsType::SENSORS, "sensors", CONTENT_SETTING_ALLOW, ++ Register(ContentSettingsType::SENSORS, "sensors", CONTENT_SETTING_BLOCK, + WebsiteSettingsInfo::UNSYNCABLE, /*allowlisted_schemes=*/{}, + /*valid_settings=*/{CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK}, + WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, diff --git a/patches/0001-Vanadium/0028-block-playing-protected-media-by-default.patch b/patches/0001-Vanadium/0028-block-playing-protected-media-by-default.patch new file mode 100644 index 0000000..6006c8a --- /dev/null +++ b/patches/0001-Vanadium/0028-block-playing-protected-media-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Tue, 1 Dec 2020 00:29:28 -0500 +Subject: [PATCH] block playing protected media by default + +--- + .../content_settings/core/browser/content_settings_registry.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc +index c7a23d2e5ff72..7a2c634ebb4a3 100644 +--- a/components/content_settings/core/browser/content_settings_registry.cc ++++ b/components/content_settings/core/browser/content_settings_registry.cc +@@ -200,7 +200,7 @@ void ContentSettingsRegistry::Init() { + ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); + + Register(ContentSettingsType::PROTECTED_MEDIA_IDENTIFIER, +- "protected-media-identifier", CONTENT_SETTING_ALLOW, ++ "protected-media-identifier", CONTENT_SETTING_BLOCK, + WebsiteSettingsInfo::UNSYNCABLE, /*allowlisted_schemes=*/{}, + #if BUILDFLAG(IS_ANDROID) + /*valid_settings=*/ diff --git a/patches/0001-Vanadium/0029-disable-third-party-cookies-by-default.patch b/patches/0001-Vanadium/0029-disable-third-party-cookies-by-default.patch new file mode 100644 index 0000000..c36f83c --- /dev/null +++ b/patches/0001-Vanadium/0029-disable-third-party-cookies-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Sun, 16 Jun 2019 16:01:31 -0400 +Subject: [PATCH] disable third party cookies by default + +--- + components/content_settings/core/browser/cookie_settings.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/content_settings/core/browser/cookie_settings.cc b/components/content_settings/core/browser/cookie_settings.cc +index 7ce34161ef3cb..42eeb19304efe 100644 +--- a/components/content_settings/core/browser/cookie_settings.cc ++++ b/components/content_settings/core/browser/cookie_settings.cc +@@ -69,7 +69,7 @@ void CookieSettings::RegisterProfilePrefs( + user_prefs::PrefRegistrySyncable* registry) { + registry->RegisterIntegerPref( + prefs::kCookieControlsMode, +- static_cast(CookieControlsMode::kIncognitoOnly), ++ static_cast(CookieControlsMode::kBlockThirdParty), + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + } + diff --git a/patches/0001-Vanadium/0030-disable-background-sync-by-default.patch b/patches/0001-Vanadium/0030-disable-background-sync-by-default.patch new file mode 100644 index 0000000..0ae2153 --- /dev/null +++ b/patches/0001-Vanadium/0030-disable-background-sync-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Sun, 16 Jun 2019 21:57:26 -0400 +Subject: [PATCH] disable background sync by default + +--- + .../content_settings/core/browser/content_settings_registry.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc +index f37611519b351..52284e2e3858a 100644 +--- a/components/content_settings/core/browser/content_settings_registry.cc ++++ b/components/content_settings/core/browser/content_settings_registry.cc +@@ -227,7 +227,7 @@ void ContentSettingsRegistry::Init() { + ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); + + Register(ContentSettingsType::BACKGROUND_SYNC, "background-sync", +- CONTENT_SETTING_ALLOW, WebsiteSettingsInfo::UNSYNCABLE, ++ CONTENT_SETTING_BLOCK, WebsiteSettingsInfo::UNSYNCABLE, + /*allowlisted_schemes=*/{}, + /*valid_settings=*/{CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK}, + WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, diff --git a/patches/0001-Vanadium/0031-disable-payment-support-by-default.patch b/patches/0001-Vanadium/0031-disable-payment-support-by-default.patch new file mode 100644 index 0000000..d379f50 --- /dev/null +++ b/patches/0001-Vanadium/0031-disable-payment-support-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Tue, 18 Jun 2019 22:28:53 -0400 +Subject: [PATCH] disable payment support by default + +--- + components/payments/core/payment_prefs.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/payments/core/payment_prefs.cc b/components/payments/core/payment_prefs.cc +index 3196befc8c400..2caca44e2d4e7 100644 +--- a/components/payments/core/payment_prefs.cc ++++ b/components/payments/core/payment_prefs.cc +@@ -16,7 +16,7 @@ const char kCanMakePaymentEnabled[] = "payments.can_make_payment_enabled"; + void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { + registry->RegisterBooleanPref(kPaymentsFirstTransactionCompleted, false); + registry->RegisterBooleanPref( +- kCanMakePaymentEnabled, true, ++ kCanMakePaymentEnabled, false, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + } + diff --git a/patches/0001-Vanadium/0032-disable-media-router-media-remoting-by-default.patch b/patches/0001-Vanadium/0032-disable-media-router-media-remoting-by-default.patch new file mode 100644 index 0000000..17405fe --- /dev/null +++ b/patches/0001-Vanadium/0032-disable-media-router-media-remoting-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 4 Jul 2019 18:11:27 -0400 +Subject: [PATCH] disable media router media remoting by default + +--- + chrome/browser/media/router/media_router_feature.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc +index b451850d327d2..bdb5b72179a79 100644 +--- a/chrome/browser/media/router/media_router_feature.cc ++++ b/chrome/browser/media/router/media_router_feature.cc +@@ -147,7 +147,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { + registry->RegisterStringPref(prefs::kMediaRouterReceiverIdHashToken, "", + PrefRegistry::PUBLIC); + registry->RegisterBooleanPref( +- media_router::prefs::kMediaRouterMediaRemotingEnabled, true); ++ media_router::prefs::kMediaRouterMediaRemotingEnabled, false); + registry->RegisterBooleanPref( + media_router::prefs::kMediaRouterShowCastSessionsStartedByOtherDevices, + true); diff --git a/patches/0001-Vanadium/0033-disable-media-router-by-default.patch b/patches/0001-Vanadium/0033-disable-media-router-by-default.patch new file mode 100644 index 0000000..3e0740e --- /dev/null +++ b/patches/0001-Vanadium/0033-disable-media-router-by-default.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 4 Jul 2019 19:08:52 -0400 +Subject: [PATCH] disable media router by default + +--- + chrome/browser/media/router/media_router_feature.cc | 2 +- + chrome/browser/profiles/profile_impl.cc | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc +index 559346224f01f..b451850d327d2 100644 +--- a/chrome/browser/media/router/media_router_feature.cc ++++ b/chrome/browser/media/router/media_router_feature.cc +@@ -134,7 +134,7 @@ bool MediaRouterEnabled(content::BrowserContext* context) { + pref_values.insert(std::make_pair(context, allowed)); + return allowed; + } +- return true; ++ return false; + } + + #if !BUILDFLAG(IS_ANDROID) +diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc +index 57d728da590da..82000864b70f8 100644 +--- a/chrome/browser/profiles/profile_impl.cc ++++ b/chrome/browser/profiles/profile_impl.cc +@@ -419,7 +419,7 @@ void ProfileImpl::RegisterProfilePrefs( + #endif + + registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false); +- registry->RegisterBooleanPref(prefs::kEnableMediaRouter, true); ++ registry->RegisterBooleanPref(prefs::kEnableMediaRouter, false); + #if !BUILDFLAG(IS_ANDROID) + registry->RegisterBooleanPref(prefs::kShowCastIconInToolbar, false); + #endif // !BUILDFLAG(IS_ANDROID) diff --git a/patches/0001-Vanadium/0034-disable-offering-translations-by-default.patch b/patches/0001-Vanadium/0034-disable-offering-translations-by-default.patch new file mode 100644 index 0000000..b9e5751 --- /dev/null +++ b/patches/0001-Vanadium/0034-disable-offering-translations-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Fri, 12 Jul 2019 03:58:01 -0400 +Subject: [PATCH] disable offering translations by default + +--- + chrome/browser/ui/browser_ui_prefs.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc +index 16ab8096b4048..05e24c9c3fc21 100644 +--- a/chrome/browser/ui/browser_ui_prefs.cc ++++ b/chrome/browser/ui/browser_ui_prefs.cc +@@ -75,7 +75,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { + registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true); + registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true); + registry->RegisterBooleanPref( +- translate::prefs::kOfferTranslateEnabled, true, ++ translate::prefs::kOfferTranslateEnabled, false, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterStringPref(prefs::kCloudPrintEmail, std::string()); + registry->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, true); diff --git a/patches/0001-Vanadium/0035-disable-browser-sign-in-feature-by-default.patch b/patches/0001-Vanadium/0035-disable-browser-sign-in-feature-by-default.patch new file mode 100644 index 0000000..acd1a91 --- /dev/null +++ b/patches/0001-Vanadium/0035-disable-browser-sign-in-feature-by-default.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Fri, 12 Jul 2019 04:23:18 -0400 +Subject: [PATCH] disable browser sign in feature by default + +--- + chrome/browser/signin/account_consistency_mode_manager.cc | 2 +- + .../signin/internal/identity_manager/primary_account_manager.cc | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/chrome/browser/signin/account_consistency_mode_manager.cc b/chrome/browser/signin/account_consistency_mode_manager.cc +index a7853cc014069..67acb94246580 100644 +--- a/chrome/browser/signin/account_consistency_mode_manager.cc ++++ b/chrome/browser/signin/account_consistency_mode_manager.cc +@@ -119,7 +119,7 @@ AccountConsistencyModeManager::~AccountConsistencyModeManager() {} + // static + void AccountConsistencyModeManager::RegisterProfilePrefs( + user_prefs::PrefRegistrySyncable* registry) { +- registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, true); ++ registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, false); + } + + // static +diff --git a/components/signin/internal/identity_manager/primary_account_manager.cc b/components/signin/internal/identity_manager/primary_account_manager.cc +index f5a43ce0aa03c..8c687d3133f1f 100644 +--- a/components/signin/internal/identity_manager/primary_account_manager.cc ++++ b/components/signin/internal/identity_manager/primary_account_manager.cc +@@ -148,7 +148,7 @@ void PrimaryAccountManager::RegisterProfilePrefs(PrefRegistrySimple* registry) { + registry->RegisterBooleanPref(prefs::kGoogleServicesConsentedToSync, false); + registry->RegisterBooleanPref(prefs::kAutologinEnabled, false); + registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList); +- registry->RegisterBooleanPref(prefs::kSigninAllowed, true); ++ registry->RegisterBooleanPref(prefs::kSigninAllowed, false); + registry->RegisterBooleanPref(prefs::kSignedInWithCredentialProvider, false); + } + diff --git a/patches/0001-Vanadium/0036-disable-browser-autologin-by-default.patch b/patches/0001-Vanadium/0036-disable-browser-autologin-by-default.patch new file mode 100644 index 0000000..f68f396 --- /dev/null +++ b/patches/0001-Vanadium/0036-disable-browser-autologin-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Sun, 22 Mar 2020 03:07:08 -0400 +Subject: [PATCH] disable browser autologin by default + +--- + .../signin/internal/identity_manager/primary_account_manager.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/signin/internal/identity_manager/primary_account_manager.cc b/components/signin/internal/identity_manager/primary_account_manager.cc +index 1558c2342710e..f5a43ce0aa03c 100644 +--- a/components/signin/internal/identity_manager/primary_account_manager.cc ++++ b/components/signin/internal/identity_manager/primary_account_manager.cc +@@ -146,7 +146,7 @@ void PrimaryAccountManager::RegisterProfilePrefs(PrefRegistrySimple* registry) { + std::string()); + registry->RegisterStringPref(prefs::kGoogleServicesAccountId, std::string()); + registry->RegisterBooleanPref(prefs::kGoogleServicesConsentedToSync, false); +- registry->RegisterBooleanPref(prefs::kAutologinEnabled, true); ++ registry->RegisterBooleanPref(prefs::kAutologinEnabled, false); + registry->RegisterListPref(prefs::kReverseAutologinRejectedEmailList); + registry->RegisterBooleanPref(prefs::kSigninAllowed, true); + registry->RegisterBooleanPref(prefs::kSignedInWithCredentialProvider, false); diff --git a/patches/0001-Vanadium/0037-disable-safe-browsing-reporting-opt-in-by-default.patch b/patches/0001-Vanadium/0037-disable-safe-browsing-reporting-opt-in-by-default.patch new file mode 100644 index 0000000..94db128 --- /dev/null +++ b/patches/0001-Vanadium/0037-disable-safe-browsing-reporting-opt-in-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Fri, 12 Jul 2019 05:22:11 -0400 +Subject: [PATCH] disable safe browsing reporting opt-in by default + +--- + components/safe_browsing/core/common/safe_browsing_prefs.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/safe_browsing/core/common/safe_browsing_prefs.cc b/components/safe_browsing/core/common/safe_browsing_prefs.cc +index f0eb6d10da26a..baac2e7a44fc2 100644 +--- a/components/safe_browsing/core/common/safe_browsing_prefs.cc ++++ b/components/safe_browsing/core/common/safe_browsing_prefs.cc +@@ -229,7 +229,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { + registry->RegisterBooleanPref( + prefs::kSafeBrowsingSawInterstitialScoutReporting, false); + registry->RegisterBooleanPref( +- prefs::kSafeBrowsingExtendedReportingOptInAllowed, true); ++ prefs::kSafeBrowsingExtendedReportingOptInAllowed, false); + registry->RegisterBooleanPref( + prefs::kSafeBrowsingEnabled, true, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); diff --git a/patches/0001-Vanadium/0038-disable-unused-safe-browsing-option-by-default.patch b/patches/0001-Vanadium/0038-disable-unused-safe-browsing-option-by-default.patch new file mode 100644 index 0000000..9ec18a7 --- /dev/null +++ b/patches/0001-Vanadium/0038-disable-unused-safe-browsing-option-by-default.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 12 Mar 2020 13:01:02 -0400 +Subject: [PATCH] disable unused safe browsing option by default + +Safe Browsing is currently a no-op due to the lack of Play Services, and +support for using the local database backend hasn't been implemented. +Various changes would be needed to make it available and to make sure +that privacy is preserved. +--- + components/safe_browsing/core/common/safe_browsing_prefs.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/safe_browsing/core/common/safe_browsing_prefs.cc b/components/safe_browsing/core/common/safe_browsing_prefs.cc +index baac2e7a44fc2..7dc0df8c69812 100644 +--- a/components/safe_browsing/core/common/safe_browsing_prefs.cc ++++ b/components/safe_browsing/core/common/safe_browsing_prefs.cc +@@ -231,7 +231,7 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) { + registry->RegisterBooleanPref( + prefs::kSafeBrowsingExtendedReportingOptInAllowed, false); + registry->RegisterBooleanPref( +- prefs::kSafeBrowsingEnabled, true, ++ prefs::kSafeBrowsingEnabled, false, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kSafeBrowsingEnhanced, false); + registry->RegisterBooleanPref(prefs::kSafeBrowsingProceedAnywayDisabled, diff --git a/patches/0001-Vanadium/0039-disable-media-DRM-preprovisioning-by-default.patch b/patches/0001-Vanadium/0039-disable-media-DRM-preprovisioning-by-default.patch new file mode 100644 index 0000000..c1cc2a5 --- /dev/null +++ b/patches/0001-Vanadium/0039-disable-media-DRM-preprovisioning-by-default.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 21 May 2020 12:27:29 -0400 +Subject: [PATCH] disable media DRM preprovisioning by default + +This switches to fetching on-demand, which can only happen if DRM media +support is enabled. +--- + media/base/media_switches.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc +index b8f748b183652..b6bf9d2583e28 100644 +--- a/media/base/media_switches.cc ++++ b/media/base/media_switches.cc +@@ -1002,7 +1002,7 @@ BASE_FEATURE(kMediaDrmPersistentLicense, + // which will trigger provisioning process after MediaDrmBridge is created. + BASE_FEATURE(kMediaDrmPreprovisioning, + "MediaDrmPreprovisioning", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + + // Determines if MediaDrmOriginIdManager should attempt to pre-provision origin + // IDs at startup (whenever a profile is loaded). Also used by tests that diff --git a/patches/0001-Vanadium/0040-enable-prefetch-privacy-changes-by-default.patch b/patches/0001-Vanadium/0040-enable-prefetch-privacy-changes-by-default.patch new file mode 100644 index 0000000..78d41e1 --- /dev/null +++ b/patches/0001-Vanadium/0040-enable-prefetch-privacy-changes-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Fri, 23 Oct 2020 23:59:13 -0400 +Subject: [PATCH] enable prefetch privacy changes by default + +--- + third_party/blink/common/features.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc +index 953924fa504a6..fd487ea4505f0 100644 +--- a/third_party/blink/common/features.cc ++++ b/third_party/blink/common/features.cc +@@ -528,7 +528,7 @@ BASE_FEATURE(kAllowSyncXHRInPageDismissal, + // crbug.com/988956. + BASE_FEATURE(kPrefetchPrivacyChanges, + "PrefetchPrivacyChanges", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + // Decodes jpeg 4:2:0 formatted images to YUV instead of RGBX and stores in this + // format in the image decode cache. See crbug.com/919627 for details on the diff --git a/patches/0001-Vanadium/0041-enable-user-agent-freeze-by-default.patch b/patches/0001-Vanadium/0041-enable-user-agent-freeze-by-default.patch new file mode 100644 index 0000000..096b86e --- /dev/null +++ b/patches/0001-Vanadium/0041-enable-user-agent-freeze-by-default.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Wed, 3 Mar 2021 13:42:41 -0500 +Subject: [PATCH] enable user agent freeze by default + +--- + .../blink/renderer/platform/runtime_enabled_features.json5 | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 +index 34e188f2254d5..74e01f5fb013d 100644 +--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 ++++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5 +@@ -3511,6 +3511,7 @@ + // iOS not included as it should not send a reduced User-Agent string. + origin_trial_os: ["android", "chromeos", "fuchsia", "linux", "mac", "win"], + base_feature: "ReduceUserAgent", ++ base_feature_status: "enabled", + }, + { + name: "V8IdleTasks", diff --git a/patches/0001-Vanadium/0042-enable-split-cache-by-default.patch b/patches/0001-Vanadium/0042-enable-split-cache-by-default.patch new file mode 100644 index 0000000..5a6ae62 --- /dev/null +++ b/patches/0001-Vanadium/0042-enable-split-cache-by-default.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Wed, 23 Dec 2020 06:00:50 -0500 +Subject: [PATCH] enable split cache by default + +--- + net/base/features.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/net/base/features.cc b/net/base/features.cc +index 2b7c931a18ed4..8519289f77c5d 100644 +--- a/net/base/features.cc ++++ b/net/base/features.cc +@@ -92,11 +92,11 @@ BASE_FEATURE(kSplitCacheByIncludeCredentials, + + BASE_FEATURE(kSplitCacheByNetworkIsolationKey, + "SplitCacheByNetworkIsolationKey", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + BASE_FEATURE(kSplitCodeCacheByNetworkIsolationKey, + "SplitCodeCacheByNetworkIsolationKey", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + BASE_FEATURE(kSplitHostCacheByNetworkIsolationKey, + "SplitHostCacheByNetworkIsolationKey", diff --git a/patches/0001-Vanadium/0043-enable-partitioning-connections-by-default.patch b/patches/0001-Vanadium/0043-enable-partitioning-connections-by-default.patch new file mode 100644 index 0000000..a36029e --- /dev/null +++ b/patches/0001-Vanadium/0043-enable-partitioning-connections-by-default.patch @@ -0,0 +1,47 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Mon, 8 Mar 2021 16:53:47 -0500 +Subject: [PATCH] enable partitioning connections by default + +--- + net/base/features.cc | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/net/base/features.cc b/net/base/features.cc +index f554886495bec..dda468bd46050 100644 +--- a/net/base/features.cc ++++ b/net/base/features.cc +@@ -100,27 +100,27 @@ BASE_FEATURE(kSplitCodeCacheByNetworkIsolationKey, + + BASE_FEATURE(kSplitHostCacheByNetworkIsolationKey, + "SplitHostCacheByNetworkIsolationKey", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + BASE_FEATURE(kPartitionConnectionsByNetworkIsolationKey, + "PartitionConnectionsByNetworkIsolationKey", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + BASE_FEATURE(kPartitionHttpServerPropertiesByNetworkIsolationKey, + "PartitionHttpServerPropertiesByNetworkIsolationKey", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + BASE_FEATURE(kPartitionSSLSessionsByNetworkIsolationKey, + "PartitionSSLSessionsByNetworkIsolationKey", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + BASE_FEATURE(kPartitionNelAndReportingByNetworkIsolationKey, + "PartitionNelAndReportingByNetworkIsolationKey", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + BASE_FEATURE(kEnableCrossSiteFlagNetworkIsolationKey, + "EnableCrossSiteFlagNetworkIsolationKey", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + BASE_FEATURE(kTLS13KeyUpdate, + "TLS13KeyUpdate", diff --git a/patches/0001-Vanadium/0044-enable-new-third-party-storage-partitioning.patch b/patches/0001-Vanadium/0044-enable-new-third-party-storage-partitioning.patch new file mode 100644 index 0000000..80d2767 --- /dev/null +++ b/patches/0001-Vanadium/0044-enable-new-third-party-storage-partitioning.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Mon, 2 Jan 2023 12:14:24 -0500 +Subject: [PATCH] enable new third party storage partitioning + +--- + net/base/features.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/base/features.cc b/net/base/features.cc +index dda468bd46050..2b7c931a18ed4 100644 +--- a/net/base/features.cc ++++ b/net/base/features.cc +@@ -254,7 +254,7 @@ BASE_FEATURE(kBlockSetCookieHeader, + // by the top level site to reduce fingerprinting. + BASE_FEATURE(kThirdPartyStoragePartitioning, + "ThirdPartyStoragePartitioning", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + // Whether to use the new code paths needed to support partitioning Blob URLs. + // This exists as a kill-switch in case an issue is identified with the Blob + // URL implementation that causes breakage. diff --git a/patches/0001-Vanadium/0045-enable-dubious-Do-Not-Track-feature-by-default.patch b/patches/0001-Vanadium/0045-enable-dubious-Do-Not-Track-feature-by-default.patch new file mode 100644 index 0000000..38e9065 --- /dev/null +++ b/patches/0001-Vanadium/0045-enable-dubious-Do-Not-Track-feature-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Tue, 1 Aug 2017 11:16:11 -0400 +Subject: [PATCH] enable dubious Do Not Track feature by default + +--- + chrome/browser/ui/browser_ui_prefs.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc +index 05e24c9c3fc21..6ff2102a201ba 100644 +--- a/chrome/browser/ui/browser_ui_prefs.cc ++++ b/chrome/browser/ui/browser_ui_prefs.cc +@@ -84,7 +84,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { + registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacementPopup); + registry->RegisterDictionaryPref(prefs::kAppWindowPlacement); + registry->RegisterBooleanPref( +- prefs::kEnableDoNotTrack, false, ++ prefs::kEnableDoNotTrack, true, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + #if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID) + registry->RegisterBooleanPref(prefs::kPrintPreviewUseSystemDefaultPrinter, diff --git a/patches/0001-Vanadium/0046-disable-autofill-server-communication-by-default.patch b/patches/0001-Vanadium/0046-disable-autofill-server-communication-by-default.patch new file mode 100644 index 0000000..6794d01 --- /dev/null +++ b/patches/0001-Vanadium/0046-disable-autofill-server-communication-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Tue, 1 Dec 2020 00:56:57 -0500 +Subject: [PATCH] disable autofill server communication by default + +--- + components/autofill/core/common/autofill_features.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/autofill/core/common/autofill_features.cc b/components/autofill/core/common/autofill_features.cc +index 2eebd38e9f948..2246179592da9 100644 +--- a/components/autofill/core/common/autofill_features.cc ++++ b/components/autofill/core/common/autofill_features.cc +@@ -710,7 +710,7 @@ BASE_FEATURE(kAutofillLogToTerminal, + // i.e., https://other.autofill.server:port/tbproxy/af/ + BASE_FEATURE(kAutofillServerCommunication, + "AutofillServerCommunication", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + + // Controls attaching the autofill type predictions to their respective + // element in the DOM. diff --git a/patches/0001-Vanadium/0047-disable-component-updater-pings-by-default.patch b/patches/0001-Vanadium/0047-disable-component-updater-pings-by-default.patch new file mode 100644 index 0000000..597092e --- /dev/null +++ b/patches/0001-Vanadium/0047-disable-component-updater-pings-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Fri, 27 Nov 2020 03:56:29 -0500 +Subject: [PATCH] disable component updater pings by default + +--- + .../component_updater_command_line_config_policy.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/component_updater/component_updater_command_line_config_policy.h b/components/component_updater/component_updater_command_line_config_policy.h +index 6c16b4e37a753..a627cb7ffd59c 100644 +--- a/components/component_updater/component_updater_command_line_config_policy.h ++++ b/components/component_updater/component_updater_command_line_config_policy.h +@@ -42,7 +42,7 @@ class ComponentUpdaterCommandLineConfigPolicy final + bool background_downloads_enabled_ = false; + bool deltas_enabled_ = true; + bool fast_update_ = false; +- bool pings_enabled_ = true; ++ bool pings_enabled_ = false; + bool test_request_ = false; + + // If non-zero, time interval until the first component update check. diff --git a/patches/0001-Vanadium/0048-mark-non-secure-origins-as-dangerous.patch b/patches/0001-Vanadium/0048-mark-non-secure-origins-as-dangerous.patch new file mode 100644 index 0000000..d4fc475 --- /dev/null +++ b/patches/0001-Vanadium/0048-mark-non-secure-origins-as-dangerous.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Fri, 20 Oct 2017 21:20:50 -0400 +Subject: [PATCH] mark non-secure origins as dangerous + +--- + components/security_state/core/security_state.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/security_state/core/security_state.cc b/components/security_state/core/security_state.cc +index eb8f4e76b421d..6158bbe82a988 100644 +--- a/components/security_state/core/security_state.cc ++++ b/components/security_state/core/security_state.cc +@@ -137,7 +137,7 @@ SecurityLevel GetSecurityLevel( + return NONE; + } + #endif // !BUILDFLAG(IS_ANDROID) +- return WARNING; ++ return DANGEROUS; + } + return NONE; + } diff --git a/patches/0001-Vanadium/0049-enable-strict-site-isolation-by-default-on-Android.patch b/patches/0001-Vanadium/0049-enable-strict-site-isolation-by-default-on-Android.patch new file mode 100644 index 0000000..c5c76c8 --- /dev/null +++ b/patches/0001-Vanadium/0049-enable-strict-site-isolation-by-default-on-Android.patch @@ -0,0 +1,47 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 2 May 2019 07:15:32 -0400 +Subject: [PATCH] enable strict site isolation by default on Android + +--- + chrome/browser/about_flags.cc | 10 ---------- + chrome/common/chrome_features.cc | 4 ---- + 2 files changed, 14 deletions(-) + +diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc +index e2d74e803159c..23e19d205b9b9 100644 +--- a/chrome/browser/about_flags.cc ++++ b/chrome/browser/about_flags.cc +@@ -4522,16 +4522,6 @@ const FeatureEntry kFeatureEntries[] = { + flag_descriptions::kMojoLinuxChannelSharedMemDescription, + kOsCrOS | kOsLinux | kOsLacros | kOsAndroid, + FEATURE_VALUE_TYPE(mojo::core::kMojoLinuxChannelSharedMem)}, +-#endif +-#if BUILDFLAG(IS_ANDROID) +- {"enable-site-isolation-for-password-sites", +- flag_descriptions::kSiteIsolationForPasswordSitesName, +- flag_descriptions::kSiteIsolationForPasswordSitesDescription, kOsAndroid, +- FEATURE_VALUE_TYPE( +- site_isolation::features::kSiteIsolationForPasswordSites)}, +- {"enable-site-per-process", flag_descriptions::kStrictSiteIsolationName, +- flag_descriptions::kStrictSiteIsolationDescription, kOsAndroid, +- SINGLE_VALUE_TYPE(switches::kSitePerProcess)}, + #endif + {"enable-isolated-web-apps", flag_descriptions::kEnableIsolatedWebAppsName, + flag_descriptions::kEnableIsolatedWebAppsDescription, kOsAll, +diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc +index a0fab5169196e..385555fa4f9b2 100644 +--- a/chrome/common/chrome_features.cc ++++ b/chrome/common/chrome_features.cc +@@ -1049,11 +1049,7 @@ BASE_FEATURE(kSecurityKeyAttestationPrompt, + // browser_features, as they are only used on the browser side. + BASE_FEATURE(kSitePerProcess, + "SitePerProcess", +-#if BUILDFLAG(IS_ANDROID) +- base::FEATURE_DISABLED_BY_DEFAULT +-#else + base::FEATURE_ENABLED_BY_DEFAULT +-#endif + ); + + #if BUILDFLAG(IS_CHROMEOS_ASH) diff --git a/patches/0001-Vanadium/0050-most-private-WebRTC-IP-handling-policy-by-default.patch b/patches/0001-Vanadium/0050-most-private-WebRTC-IP-handling-policy-by-default.patch new file mode 100644 index 0000000..746de6b --- /dev/null +++ b/patches/0001-Vanadium/0050-most-private-WebRTC-IP-handling-policy-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 21 May 2020 12:58:04 -0400 +Subject: [PATCH] most private WebRTC IP handling policy by default + +--- + chrome/browser/ui/browser_ui_prefs.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc +index 67055ab9f0e56..2033481910aad 100644 +--- a/chrome/browser/ui/browser_ui_prefs.cc ++++ b/chrome/browser/ui/browser_ui_prefs.cc +@@ -91,7 +91,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { + false); + #endif + registry->RegisterStringPref(prefs::kWebRTCIPHandlingPolicy, +- blink::kWebRTCIPHandlingDefault); ++ blink::kWebRTCIPHandlingDisableNonProxiedUdp); + registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string()); + registry->RegisterBooleanPref(prefs::kWebRtcEventLogCollectionAllowed, false); + registry->RegisterListPref(prefs::kWebRtcLocalIpsAllowedUrls); diff --git a/patches/0001-Vanadium/0051-stub-out-the-battery-status-API.patch b/patches/0001-Vanadium/0051-stub-out-the-battery-status-API.patch new file mode 100644 index 0000000..3573859 --- /dev/null +++ b/patches/0001-Vanadium/0051-stub-out-the-battery-status-API.patch @@ -0,0 +1,65 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Mon, 17 Jun 2019 11:29:21 -0400 +Subject: [PATCH] stub out the battery status API + +Pretend that the device is always plugged in and fully charged. +--- + .../modules/battery/battery_manager.cc | 26 +++---------------- + 1 file changed, 4 insertions(+), 22 deletions(-) + +diff --git a/third_party/blink/renderer/modules/battery/battery_manager.cc b/third_party/blink/renderer/modules/battery/battery_manager.cc +index e8512cf82bf59..e1aa5153dceb3 100644 +--- a/third_party/blink/renderer/modules/battery/battery_manager.cc ++++ b/third_party/blink/renderer/modules/battery/battery_manager.cc +@@ -78,46 +78,28 @@ ScriptPromise BatteryManager::StartRequest(ScriptState* script_state) { + } + + bool BatteryManager::charging() { +- return battery_status_.Charging(); ++ return true; + } + + double BatteryManager::chargingTime() { +- return battery_status_.charging_time().InSecondsF(); ++ return 0.0; + } + + double BatteryManager::dischargingTime() { +- return battery_status_.discharging_time().InSecondsF(); ++ return std::numeric_limits::infinity(); + } + + double BatteryManager::level() { +- return battery_status_.Level(); ++ return 1.0; + } + + void BatteryManager::DidUpdateData() { + DCHECK(battery_property_); + +- BatteryStatus old_status = battery_status_; +- battery_status_ = *battery_dispatcher_->LatestData(); +- + if (battery_property_->GetState() == BatteryProperty::kPending) { + battery_property_->Resolve(this); + return; + } +- +- DCHECK(GetExecutionContext()); +- if (GetExecutionContext()->IsContextPaused() || +- GetExecutionContext()->IsContextDestroyed()) { +- return; +- } +- +- if (battery_status_.Charging() != old_status.Charging()) +- DispatchEvent(*Event::Create(event_type_names::kChargingchange)); +- if (battery_status_.charging_time() != old_status.charging_time()) +- DispatchEvent(*Event::Create(event_type_names::kChargingtimechange)); +- if (battery_status_.discharging_time() != old_status.discharging_time()) +- DispatchEvent(*Event::Create(event_type_names::kDischargingtimechange)); +- if (battery_status_.Level() != old_status.Level()) +- DispatchEvent(*Event::Create(event_type_names::kLevelchange)); + } + + void BatteryManager::RegisterWithDispatcher() { diff --git a/patches/0001-Vanadium/0052-always-use-local-new-tab-page.patch b/patches/0001-Vanadium/0052-always-use-local-new-tab-page.patch new file mode 100644 index 0000000..77185ee --- /dev/null +++ b/patches/0001-Vanadium/0052-always-use-local-new-tab-page.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Mon, 17 Jun 2019 13:14:22 -0400 +Subject: [PATCH] always use local new tab page + +--- + chrome/browser/search/search.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc +index d367a6dee4e18..6d8049076890d 100644 +--- a/chrome/browser/search/search.cc ++++ b/chrome/browser/search/search.cc +@@ -161,7 +161,7 @@ bool ShouldShowLocalNewTab(Profile* profile) { + #if !BUILDFLAG(IS_ANDROID) + return DefaultSearchProviderIsGoogle(profile); + #else +- return false; ++ return true; + #endif + } + diff --git a/patches/0001-Vanadium/0053-disable-search-provider-logo.patch b/patches/0001-Vanadium/0053-disable-search-provider-logo.patch new file mode 100644 index 0000000..f1f42b1 --- /dev/null +++ b/patches/0001-Vanadium/0053-disable-search-provider-logo.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Mon, 17 Jun 2019 12:03:52 -0400 +Subject: [PATCH] disable search provider logo + +--- + .../android/template_url_service_android.cc | 23 +------------------ + 1 file changed, 1 insertion(+), 22 deletions(-) + +diff --git a/components/search_engines/android/template_url_service_android.cc b/components/search_engines/android/template_url_service_android.cc +index 1cc492a695a59..75b1780f86f46 100644 +--- a/components/search_engines/android/template_url_service_android.cc ++++ b/components/search_engines/android/template_url_service_android.cc +@@ -103,28 +103,7 @@ jboolean TemplateUrlServiceAndroid::IsSearchByImageAvailable( + jboolean TemplateUrlServiceAndroid::DoesDefaultSearchEngineHaveLogo( + JNIEnv* env, + const JavaParamRef& obj) { +- // |kSearchProviderLogoURL| applies to all search engines (Google or +- // third-party). +- if (base::CommandLine::ForCurrentProcess()->HasSwitch( +- search_provider_logos::switches::kSearchProviderLogoURL)) { +- return true; +- } +- +- // Google always has a logo. +- if (IsDefaultSearchEngineGoogle(env, obj)) +- return true; +- +- // Third-party search engines can have a doodle specified via the command +- // line, or a static logo or doodle from the TemplateURLService. +- if (base::CommandLine::ForCurrentProcess()->HasSwitch( +- search_provider_logos::switches::kThirdPartyDoodleURL)) { +- return true; +- } +- const TemplateURL* default_search_provider = +- template_url_service_->GetDefaultSearchProvider(); +- return default_search_provider && +- (default_search_provider->doodle_url().is_valid() || +- default_search_provider->logo_url().is_valid()); ++ return false; + } + + jboolean TemplateUrlServiceAndroid::IsDefaultSearchEngineGoogle( diff --git a/patches/0001-Vanadium/0054-stop-ignoring-download-location-prompt-setting.patch b/patches/0001-Vanadium/0054-stop-ignoring-download-location-prompt-setting.patch new file mode 100644 index 0000000..4a6ce96 --- /dev/null +++ b/patches/0001-Vanadium/0054-stop-ignoring-download-location-prompt-setting.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Fri, 28 Jun 2019 16:56:37 -0400 +Subject: [PATCH] stop ignoring download location prompt setting + +--- + .../DownloadLocationDialogCoordinator.java | 15 --------------- + 1 file changed, 15 deletions(-) + +diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java +index f5aeac768a2f1..9cb877cd18d92 100644 +--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java ++++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java +@@ -131,21 +131,6 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties. + * @param dirs An list of available download directories. + */ + private void onDirectoryOptionsRetrieved(ArrayList dirs) { +- // If there is only one directory available, don't show the default dialog, and set the +- // download directory to default. Dialog will still show for other types of dialogs, like +- // name conflict or disk error or if Incognito download warning is needed. +- if (dirs.size() == 1 && !mLocationDialogManaged +- && mDialogType == DownloadLocationDialogType.DEFAULT +- && !shouldShowIncognitoWarning()) { +- final DirectoryOption dir = dirs.get(0); +- if (dir.type == DirectoryOption.DownloadLocationDirectoryType.DEFAULT) { +- assert (!TextUtils.isEmpty(dir.location)); +- DownloadDialogBridge.setDownloadAndSaveFileDefaultDirectory(dir.location); +- mController.onDownloadLocationDialogComplete(mSuggestedPath); +- } +- return; +- } +- + // Already showing the dialog. + if (mDialogModel != null) return; + diff --git a/patches/0001-Vanadium/0055-show-download-prompt-again-by-default.patch b/patches/0001-Vanadium/0055-show-download-prompt-again-by-default.patch new file mode 100644 index 0000000..c7e1500 --- /dev/null +++ b/patches/0001-Vanadium/0055-show-download-prompt-again-by-default.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Fri, 28 Jun 2019 17:48:49 -0400 +Subject: [PATCH] show download prompt again by default + +--- + .../download/dialogs/DownloadLocationDialogCoordinator.java | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java +index 33bf3003820f6..f5aeac768a2f1 100644 +--- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java ++++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java +@@ -177,12 +177,9 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties. + } + + private PropertyModel getLocationDialogModel() { +- boolean isInitial = DownloadDialogBridge.getPromptForDownloadAndroid() +- == DownloadPromptStatus.SHOW_INITIAL; +- + PropertyModel.Builder builder = + new PropertyModel.Builder(DownloadLocationDialogProperties.ALL_KEYS); +- builder.with(DownloadLocationDialogProperties.DONT_SHOW_AGAIN_CHECKBOX_CHECKED, isInitial); ++ builder.with(DownloadLocationDialogProperties.DONT_SHOW_AGAIN_CHECKBOX_CHECKED, false); + builder.with( + DownloadLocationDialogProperties.FILE_NAME, new File(mSuggestedPath).getName()); + builder.with(DownloadLocationDialogProperties.SHOW_SUBTITLE, true); diff --git a/patches/0001-Vanadium/0056-Consolidate-java-sources-added-at-android-specific-c.patch b/patches/0001-Vanadium/0056-Consolidate-java-sources-added-at-android-specific-c.patch new file mode 100644 index 0000000..9d7f184 --- /dev/null +++ b/patches/0001-Vanadium/0056-Consolidate-java-sources-added-at-android-specific-c.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Mon, 13 Mar 2023 08:41:43 +0000 +Subject: [PATCH] Consolidate java sources added at android-specific chrome + layer + +--- + chrome/android/chrome_ext_java_sources.gni | 6 ++++++ + chrome/android/java_sources.gni | 2 ++ + 2 files changed, 8 insertions(+) + create mode 100644 chrome/android/chrome_ext_java_sources.gni + +diff --git a/chrome/android/chrome_ext_java_sources.gni b/chrome/android/chrome_ext_java_sources.gni +new file mode 100644 +index 0000000000000..fe72e9b1d3abb +--- /dev/null ++++ b/chrome/android/chrome_ext_java_sources.gni +@@ -0,0 +1,6 @@ ++# Copyright 2023 GrapheneOS ++# Use of this source code is governed by a GPLv2 only-style license that can be ++# found in the LICENSE file. ++ ++chrome_ext_java_sources = [ ++] +diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni +index a5f30237c3bfa..727142fc4e8f5 100644 +--- a/chrome/android/java_sources.gni ++++ b/chrome/android/java_sources.gni +@@ -3,6 +3,7 @@ + # found in the LICENSE file. + + import("//build/config/android/config.gni") ++import("//chrome/android/chrome_ext_java_sources.gni") + import("//chrome/android/chrome_java_sources.gni") + import("//chrome/android/chrome_junit_test_java_sources.gni") + import("//chrome/android/chrome_test_java_sources.gni") +@@ -24,6 +25,7 @@ import("//components/feed/features.gni") + import("//components/offline_pages/buildflags/features.gni") + import("//device/vr/buildflags/buildflags.gni") + ++chrome_java_sources += chrome_ext_java_sources + # Only used for testing, should not be shipped to end users. + if (enable_offline_pages_harness) { + chrome_java_sources += [ "java/src/org/chromium/chrome/browser/offlinepages/evaluation/OfflinePageEvaluationBridge.java" ] diff --git a/patches/0001-Vanadium/0057-Consolidate-resources-added-at-android-specific-chro.patch b/patches/0001-Vanadium/0057-Consolidate-resources-added-at-android-specific-chro.patch new file mode 100644 index 0000000..b38dbe7 --- /dev/null +++ b/patches/0001-Vanadium/0057-Consolidate-resources-added-at-android-specific-chro.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Mon, 13 Mar 2023 08:46:00 +0000 +Subject: [PATCH] Consolidate resources added at android-specific chrome layer + +--- + chrome/android/chrome_ext_java_resources.gni | 6 ++++++ + chrome/android/chrome_java_resources.gni | 5 ++++- + 2 files changed, 10 insertions(+), 1 deletion(-) + create mode 100644 chrome/android/chrome_ext_java_resources.gni + +diff --git a/chrome/android/chrome_ext_java_resources.gni b/chrome/android/chrome_ext_java_resources.gni +new file mode 100644 +index 0000000000000..9980a7c5f6d84 +--- /dev/null ++++ b/chrome/android/chrome_ext_java_resources.gni +@@ -0,0 +1,6 @@ ++# Copyright 2023 GrapheneOS ++# Use of this source code is governed by a GPLv2 only-style license that can be ++# found in the LICENSE file. ++ ++chrome_ext_java_resources = [ ++] +diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni +index f245de7d3a597..c2ce0b39d17f2 100644 +--- a/chrome/android/chrome_java_resources.gni ++++ b/chrome/android/chrome_java_resources.gni +@@ -7,7 +7,10 @@ + # (for f in $(find java/res/*/ -type f); do echo ' "'$f'",'; done; echo ']') >> chrome_java_resources.gni + # git cl format + +-chrome_java_resources = [ ++import ("//chrome/android/chrome_ext_java_resources.gni") ++ ++chrome_java_resources = chrome_ext_java_resources ++chrome_java_resources += [ + "java/res/anim/accelerate_quart.xml", + "java/res/anim/activity_close_exit.xml", + "java/res/anim/activity_open_enter.xml", diff --git a/patches/0001-Vanadium/0058-Consolidate-downstream-strings-in-a-separate-file-fo.patch b/patches/0001-Vanadium/0058-Consolidate-downstream-strings-in-a-separate-file-fo.patch new file mode 100644 index 0000000..8b1e042 --- /dev/null +++ b/patches/0001-Vanadium/0058-Consolidate-downstream-strings-in-a-separate-file-fo.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Mon, 13 Mar 2023 08:58:10 +0000 +Subject: [PATCH] Consolidate downstream strings in a separate file for chrome + layer + +--- + .../ui/android/strings/android_chrome_ext_strings.grdp | 6 ++++++ + .../browser/ui/android/strings/android_chrome_strings.grd | 1 + + 2 files changed, 7 insertions(+) + create mode 100644 chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp + +diff --git a/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp b/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp +new file mode 100644 +index 0000000000000..ba31bf0fad150 +--- /dev/null ++++ b/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp +@@ -0,0 +1,6 @@ ++ ++ ++ ++ +diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd +index ac9d4fcc188be..1a006b670345d 100644 +--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd ++++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd +@@ -202,6 +202,7 @@ CHAR_LIMIT guidelines: + + + ++ + + + diff --git a/patches/0001-Vanadium/0059-Utility-class-for-adding-shared-preference-keys.patch b/patches/0001-Vanadium/0059-Utility-class-for-adding-shared-preference-keys.patch new file mode 100644 index 0000000..8673da5 --- /dev/null +++ b/patches/0001-Vanadium/0059-Utility-class-for-adding-shared-preference-keys.patch @@ -0,0 +1,199 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Mon, 13 Mar 2023 10:29:53 +0000 +Subject: [PATCH] Utility class for adding shared preference keys + +--- + chrome/browser/preferences/BUILD.gn | 3 + + .../ChromePreferenceKeyChecker.java | 4 + + .../browser/preferences/SharedPrefsUtils.java | 152 ++++++++++++++++++ + 3 files changed, 159 insertions(+) + create mode 100644 chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java + +diff --git a/chrome/browser/preferences/BUILD.gn b/chrome/browser/preferences/BUILD.gn +index c3038943a893b..e2a45f2c23b95 100644 +--- a/chrome/browser/preferences/BUILD.gn ++++ b/chrome/browser/preferences/BUILD.gn +@@ -15,6 +15,9 @@ android_library("java") { + "android/java/src/org/chromium/chrome/browser/preferences/PrefChangeRegistrar.java", + "android/java/src/org/chromium/chrome/browser/preferences/SharedPreferencesManager.java", + ] ++ sources += [ ++ "android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java", ++ ] + deps = [ + "//base:base_java", + "//base:jni_java", +diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeyChecker.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeyChecker.java +index 21e3be5ba9f77..915ee8be3def7 100644 +--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeyChecker.java ++++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeyChecker.java +@@ -75,6 +75,10 @@ class ChromePreferenceKeyChecker extends BaseChromePreferenceKeyChecker { + * @return Whether |key| is in use. + */ + private boolean isKeyInUse(String key) { ++ if (SharedPrefsUtils.isKeyInUse(key)) { ++ return true; ++ } ++ + // For non-dynamic legacy keys, a simple map check is enough. + if (mLegacyFormatKeys.contains(key)) { + return true; +diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java +new file mode 100644 +index 0000000000000..ceec302c0a9d6 +--- /dev/null ++++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java +@@ -0,0 +1,152 @@ ++package org.chromium.chrome.browser.preferences; ++ ++import org.chromium.build.annotations.CheckDiscard; ++ ++import java.util.Arrays; ++ ++/** ++ * Wrapper utility class for both (Base)ChromePreferenceKeys and SharedPreferencesManager, ++ * which also serves as storage of added PreferenceKeys. ++ */ ++public final class SharedPrefsUtils { ++ ++ public static class BoolSharedPref { ++ private final String key; ++ private boolean defValue; ++ ++ BoolSharedPref(String key, boolean defValue) { ++ this.key = key; ++ this.defValue = defValue; ++ } ++ ++ public String getKey() { return key; } ++ ++ public boolean get() { ++ return getSharedPrefManager().readBoolean(key, defValue); ++ } ++ ++ public void put(boolean newValue) { ++ getSharedPrefManager().writeBoolean(key, newValue); ++ } ++ ++ public boolean putSync(boolean newValue) { ++ return getSharedPrefManager().writeBooleanSync(key, newValue); ++ } ++ } ++ ++ public static class IntSharedPref { ++ private final String key; ++ private int defValue; ++ private int[] validValues; ++ ++ IntSharedPref(String key, int defValue) { ++ this.key = key; ++ this.defValue = defValue; ++ } ++ ++ IntSharedPref(String key, int defValue, int[] validValues) { ++ this.key = key; ++ this.defValue = defValue; ++ this.validValues = validValues; ++ } ++ ++ public String getKey() { return key; } ++ ++ public int get() { ++ return getSharedPrefManager().readInt(key, defValue); ++ } ++ ++ public boolean validateValue(int val) { ++ if (validValues == null) { ++ return true; ++ } ++ // don't do sort() + bsearch() of validValues array, it's expected to have a small number of entries ++ for (int validValue : validValues) { ++ if (val == validValue) { ++ return true; ++ } ++ } ++ return false; ++ } ++ ++ public void put(int newValue) { ++ if (!validateValue(newValue)) { ++ return; ++ } ++ getSharedPrefManager().writeInt(key, newValue); ++ } ++ ++ public boolean putSync(int newValue) { ++ if (!validateValue(newValue)) { ++ return false; ++ } ++ return getSharedPrefManager().writeIntSync(key, newValue); ++ } ++ } ++ ++ public static class StringSharedPref { ++ private final String key; ++ private String defValue; ++ private String[] validValues; ++ ++ StringSharedPref(String key, String defValue) { ++ this.key = key; ++ this.defValue = defValue; ++ } ++ ++ StringSharedPref(String key, String defValue, String[] validValues) { ++ this.key = key; ++ this.defValue = defValue; ++ this.validValues = validValues; ++ } ++ ++ public String getKey() { return key; } ++ ++ public String get() { ++ return getSharedPrefManager().readString(key, defValue); ++ } ++ ++ public boolean validateValue(String val) { ++ if (validValues == null) { ++ return true; ++ } ++ // don't do sort() + bsearch() of validValues array, it's expected to have a small number of entries ++ for (String validValue : validValues) { ++ if (val == validValue) { ++ return true; ++ } ++ } ++ return false; ++ } ++ ++ public void put(String newValue) { ++ if (!validateValue(newValue)) { ++ return; ++ } ++ getSharedPrefManager().writeString(key, newValue); ++ } ++ ++ public boolean putSync(String newValue) { ++ if (!validateValue(newValue)) { ++ return false; ++ } ++ return getSharedPrefManager().writeStringSync(key, newValue); ++ } ++ } ++ ++ // Stores SharedPreferences keys and its default value ++ public static class SharedPrefsExt { ++ } ++ ++ static SharedPreferencesManager getSharedPrefManager() { ++ return SharedPreferencesManager.getInstance(); ++ } ++ ++ @CheckDiscard("Validation is performed in tests and in debug builds.") ++ static boolean isKeyInUse(String key) { ++ // clang-format off ++ return Arrays.asList( ++ ).contains(key); ++ // clang-format on ++ } ++} diff --git a/patches/0001-Vanadium/0060-Helper-class-for-modifying-preferences-at-chrome-lay.patch b/patches/0001-Vanadium/0060-Helper-class-for-modifying-preferences-at-chrome-lay.patch new file mode 100644 index 0000000..327f847 --- /dev/null +++ b/patches/0001-Vanadium/0060-Helper-class-for-modifying-preferences-at-chrome-lay.patch @@ -0,0 +1,98 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Tue, 11 Apr 2023 07:14:45 +0000 +Subject: [PATCH] Helper class for modifying preferences at chrome layer + +--- + chrome/android/chrome_ext_java_sources.gni | 1 + + .../browser/settings/SettingsExtUtils.java | 71 +++++++++++++++++++ + 2 files changed, 72 insertions(+) + create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsExtUtils.java + +diff --git a/chrome/android/chrome_ext_java_sources.gni b/chrome/android/chrome_ext_java_sources.gni +index fe72e9b1d3abb..b3a489f124aa8 100644 +--- a/chrome/android/chrome_ext_java_sources.gni ++++ b/chrome/android/chrome_ext_java_sources.gni +@@ -3,4 +3,5 @@ + # found in the LICENSE file. + + chrome_ext_java_sources = [ ++ "java/src/org/chromium/chrome/browser/settings/SettingsExtUtils.java", + ] +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsExtUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsExtUtils.java +new file mode 100644 +index 0000000000000..c9907624c4fc1 +--- /dev/null ++++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsExtUtils.java +@@ -0,0 +1,71 @@ ++// Copyright 2023 GrapheneOS ++// Use of this source code is governed by a GPLv2-style license that can be ++// found in the LICENSE file. ++ ++package org.chromium.chrome.browser.settings; ++ ++import androidx.annotation.NonNull; ++import androidx.annotation.Nullable; ++import androidx.preference.Preference; ++import androidx.preference.PreferenceFragmentCompat; ++import androidx.preference.SwitchPreferenceCompat; ++ ++import org.chromium.base.ThreadUtils; ++ ++public class SettingsExtUtils { ++ ++ public static void safelyUpdatePreference( ++ @Nullable Preference preference, ++ @Nullable String newSummary ++ ) { ++ if (preference == null) return; ++ safelyUpdatePreferenceCommon(preference, newSummary); ++ } ++ ++ ++ public static void safelyUpdateSwitchPreference( ++ @Nullable SwitchPreferenceCompat switchPref, ++ @Nullable String newSummary, ++ boolean newValue ++ ) { ++ if (switchPref == null) return; ++ safelyUpdatePreferenceCommon(switchPref, newSummary); ++ safelyUpdatePreferenceChecked(switchPref, newSummary, newValue); ++ } ++ ++ private static void safelyUpdatePreferenceCommon( ++ @NonNull Preference preference, ++ @Nullable String newSummary ++ ) { ++ ThreadUtils.checkUiThread(); ++ if (newSummary != null) { ++ preference.setSummary(newSummary); ++ } ++ } ++ ++ private static void safelyUpdatePreferenceChecked( ++ @NonNull SwitchPreferenceCompat switchPref, ++ @Nullable String nativeKey, ++ boolean checked ++ ) { ++ switchPref.setChecked(checked); ++ } ++ ++ public static void safelyRemovePreference( ++ @NonNull PreferenceFragmentCompat prefFragment, ++ @NonNull String key ++ ) { ++ Preference preference = prefFragment.findPreference(key); ++ safelyRemovePreference(prefFragment, preference); ++ } ++ ++ public static void safelyRemovePreference( ++ @NonNull PreferenceFragmentCompat prefFragment, ++ @Nullable Preference preference ++ ) { ++ ThreadUtils.checkUiThread(); ++ if (preference != null) { ++ prefFragment.getPreferenceScreen().removePreference(preference); ++ } ++ } ++} diff --git a/patches/0001-Vanadium/0061-Utility-class-for-modifying-preferences-at-Privacy-s.patch b/patches/0001-Vanadium/0061-Utility-class-for-modifying-preferences-at-Privacy-s.patch new file mode 100644 index 0000000..56400ea --- /dev/null +++ b/patches/0001-Vanadium/0061-Utility-class-for-modifying-preferences-at-Privacy-s.patch @@ -0,0 +1,154 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Tue, 11 Apr 2023 07:55:52 +0000 +Subject: [PATCH] Utility class for modifying preferences at Privacy section + +--- + chrome/android/chrome_ext_java_resources.gni | 1 + + chrome/android/chrome_ext_java_sources.gni | 1 + + .../java/res/xml/privacy_preferences_ext.xml | 9 +++ + .../privacy/settings/PrivacySettings.java | 6 ++ + .../privacy/settings/PrivacySettingsExt.java | 67 +++++++++++++++++++ + 5 files changed, 84 insertions(+) + create mode 100644 chrome/android/java/res/xml/privacy_preferences_ext.xml + create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java + +diff --git a/chrome/android/chrome_ext_java_resources.gni b/chrome/android/chrome_ext_java_resources.gni +index 9980a7c5f6d84..164ef483d5a44 100644 +--- a/chrome/android/chrome_ext_java_resources.gni ++++ b/chrome/android/chrome_ext_java_resources.gni +@@ -3,4 +3,5 @@ + # found in the LICENSE file. + + chrome_ext_java_resources = [ ++ "java/res/xml/privacy_preferences_ext.xml", + ] +diff --git a/chrome/android/chrome_ext_java_sources.gni b/chrome/android/chrome_ext_java_sources.gni +index b3a489f124aa8..d580fb6e83875 100644 +--- a/chrome/android/chrome_ext_java_sources.gni ++++ b/chrome/android/chrome_ext_java_sources.gni +@@ -4,4 +4,5 @@ + + chrome_ext_java_sources = [ + "java/src/org/chromium/chrome/browser/settings/SettingsExtUtils.java", ++ "java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java", + ] +diff --git a/chrome/android/java/res/xml/privacy_preferences_ext.xml b/chrome/android/java/res/xml/privacy_preferences_ext.xml +new file mode 100644 +index 0000000000000..a352cd657b1b9 +--- /dev/null ++++ b/chrome/android/java/res/xml/privacy_preferences_ext.xml +@@ -0,0 +1,9 @@ ++ ++ ++ ++ +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +index f97d64c38274d..3e137357b40c6 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +@@ -93,6 +93,8 @@ public class PrivacySettings extends PreferenceFragmentCompat + SettingsUtils.addPreferencesFromResource(this, R.xml.privacy_preferences); + } + ++ PrivacySettingsExt.initializePreferences(this); ++ + Preference sandboxPreference = findPreference(PREF_PRIVACY_SANDBOX); + if (PrivacySandboxBridge.isPrivacySandboxRestricted() + && !PrivacySandboxBridge.isRestrictedNoticeEnabled()) { +@@ -191,6 +193,8 @@ public class PrivacySettings extends PreferenceFragmentCompat + SingleCategorySettings.EXTRA_TITLE, thirdPartyCookies.getTitle().toString()); + } + ++ PrivacySettingsExt.removeUnwantedPreferences(this); ++ + updatePreferences(); + } + +@@ -305,6 +309,8 @@ public class PrivacySettings extends PreferenceFragmentCompat + UserPrefs.get(mProfile).getInteger(COOKIE_CONTROLS_MODE))); + } + ++ PrivacySettingsExt.updatePreferences(this); ++ + updatePrivacyGuidePreferenceTitle(); + } + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java +new file mode 100644 +index 0000000000000..00a65cf922353 +--- /dev/null ++++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java +@@ -0,0 +1,67 @@ ++// Copyright 2023 GrapheneOS ++// Use of this source code is governed by a GPLv2-style license that can be ++// found in the LICENSE file. ++ ++package org.chromium.chrome.browser.privacy.settings; ++ ++import androidx.annotation.NonNull; ++import androidx.preference.Preference; ++import androidx.preference.PreferenceFragmentCompat; ++import androidx.preference.SwitchPreferenceCompat; ++ ++import org.chromium.base.ThreadUtils; ++import org.chromium.chrome.R; ++import org.chromium.chrome.browser.flags.ChromeFeatureList; ++import org.chromium.chrome.browser.preferences.Pref; ++import org.chromium.chrome.browser.preferences.SharedPrefsUtils.SharedPrefsExt; ++import org.chromium.chrome.browser.profiles.Profile; ++import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate; ++import org.chromium.chrome.browser.settings.SettingsExtUtils; ++import org.chromium.components.browser_ui.settings.ChromeBasePreference; ++import org.chromium.components.browser_ui.settings.ChromeSwitchPreference; ++import org.chromium.components.browser_ui.settings.SettingsUtils; ++import org.chromium.components.prefs.PrefService; ++import org.chromium.components.user_prefs.UserPrefs; ++ ++final class PrivacySettingsExt { ++ ++ private static final Preference.OnPreferenceChangeListener LISTENER = ++ (pref, val) -> { ++ PrefService prefService = UserPrefs.get(Profile.getLastUsedRegularProfile()); ++ if (pref == null) { ++ return false; ++ } ++ String key = pref.getKey(); ++ return true; ++ }; ++ ++ private static final ChromeManagedPreferenceDelegate DELEGATE = ++ pref -> { ++ PrefService prefService = UserPrefs.get(Profile.getLastUsedRegularProfile()); ++ if (pref == null) { ++ return false; ++ } ++ String key = pref.getKey(); ++ return false; ++ }; ++ ++ static void removeUnwantedPreferences(@NonNull PreferenceFragmentCompat prefFragment) { ++ ThreadUtils.checkUiThread(); ++ } ++ ++ static void initializePreferences(@NonNull PreferenceFragmentCompat prefFragment) { ++ ThreadUtils.checkUiThread(); ++ // This is such that privacy preferences are added at Privacy Section in newer UI, ++ // and mostly kept on previous order at older UI. ++ int PRIVACY_PREFERENCES_ORDER = ++ ChromeFeatureList.isEnabled(ChromeFeatureList.PRIVACY_SANDBOX_SETTINGS_4) ? 2 : 6; ++ int SECURITY_PREFERENCES_ORDER = ++ ChromeFeatureList.isEnabled(ChromeFeatureList.PRIVACY_SANDBOX_SETTINGS_4) ? 2 : 9999; ++ SettingsUtils.addPreferencesFromResource(prefFragment, R.xml.privacy_preferences_ext); ++ } ++ ++ static void updatePreferences(@NonNull PreferenceFragmentCompat prefFragment) { ++ ThreadUtils.checkUiThread(); ++ PrefService prefService = UserPrefs.get(Profile.getLastUsedRegularProfile()); ++ } ++} diff --git a/patches/0001-Vanadium/0062-remove-translate-offer-preference.patch b/patches/0001-Vanadium/0062-remove-translate-offer-preference.patch new file mode 100644 index 0000000..7392be5 --- /dev/null +++ b/patches/0001-Vanadium/0062-remove-translate-offer-preference.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Fri, 2 Aug 2019 21:11:17 -0400 +Subject: [PATCH] remove translate offer preference + +--- + .../language/settings/LanguageSettings.java | 21 +------------------ + 1 file changed, 1 insertion(+), 20 deletions(-) + +diff --git a/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java b/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java +index 3d35cb516928f..4689ed7213cd7 100644 +--- a/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java ++++ b/chrome/browser/language/android/java/src/org/chromium/chrome/browser/language/settings/LanguageSettings.java +@@ -109,26 +109,7 @@ public class LanguageSettings extends PreferenceFragmentCompat + (ContentLanguagesPreference) findPreference(PREFERRED_LANGUAGES_KEY); + mLanguageListPref.registerActivityLauncher(this); + +- ChromeSwitchPreference translateSwitch = +- (ChromeSwitchPreference) findPreference(TRANSLATE_SWITCH_KEY); +- boolean isTranslateEnabled = getPrefService().getBoolean(Pref.OFFER_TRANSLATE_ENABLED); +- translateSwitch.setChecked(isTranslateEnabled); +- +- translateSwitch.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { +- @Override +- public boolean onPreferenceChange(Preference preference, Object newValue) { +- boolean enabled = (boolean) newValue; +- getPrefService().setBoolean(Pref.OFFER_TRANSLATE_ENABLED, enabled); +- mLanguageListPref.notifyPrefChanged(); +- LanguagesManager.recordAction(enabled ? LanguagesManager.LanguageSettingsActionType +- .ENABLE_TRANSLATE_GLOBALLY +- : LanguagesManager.LanguageSettingsActionType +- .DISABLE_TRANSLATE_GLOBALLY); +- return true; +- } +- }); +- translateSwitch.setManagedPreferenceDelegate((ChromeManagedPreferenceDelegate) preference +- -> getPrefService().isManagedPreference(Pref.OFFER_TRANSLATE_ENABLED)); ++ getPreferenceScreen().removePreference(findPreference(TRANSLATE_SWITCH_KEY)); + } + + /** diff --git a/patches/0001-Vanadium/0063-set-default-search-engine-to-DuckDuckGo.patch b/patches/0001-Vanadium/0063-set-default-search-engine-to-DuckDuckGo.patch new file mode 100644 index 0000000..152619e --- /dev/null +++ b/patches/0001-Vanadium/0063-set-default-search-engine-to-DuckDuckGo.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zoraver Kang +Date: Sat, 17 Aug 2019 15:53:50 -0400 +Subject: [PATCH] set default search engine to DuckDuckGo + +--- + components/search_engines/template_url_prepopulate_data.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc +index fb459bc4dfedb..691c22fe6d866 100644 +--- a/components/search_engines/template_url_prepopulate_data.cc ++++ b/components/search_engines/template_url_prepopulate_data.cc +@@ -1384,7 +1384,7 @@ std::vector> GetPrepopulatedEngines( + } + if (default_search_provider_index) { + const auto itr = +- base::ranges::find(t_urls, google.id, &TemplateURLData::prepopulate_id); ++ base::ranges::find(t_urls, duckduckgo.id, &TemplateURLData::prepopulate_id); + *default_search_provider_index = + itr == t_urls.end() ? 0 : std::distance(t_urls.begin(), itr); + } diff --git a/patches/0001-Vanadium/0064-disable-trivial-subdomain-hiding.patch b/patches/0001-Vanadium/0064-disable-trivial-subdomain-hiding.patch new file mode 100644 index 0000000..77861bf --- /dev/null +++ b/patches/0001-Vanadium/0064-disable-trivial-subdomain-hiding.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: JTL +Date: Sat, 21 Dec 2019 04:04:24 +0000 +Subject: [PATCH] disable trivial subdomain hiding + +--- + components/url_formatter/url_formatter.cc | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatter/url_formatter.cc +index 5c7783a11f3f4..6d9eaff152084 100644 +--- a/components/url_formatter/url_formatter.cc ++++ b/components/url_formatter/url_formatter.cc +@@ -658,8 +658,7 @@ std::u16string FormatUrlWithAdjustments( + *prefix_end = static_cast(url_string.length()); + + // Host. +- bool trim_trivial_subdomains = +- (format_types & kFormatUrlOmitTrivialSubdomains) != 0; ++ bool trim_trivial_subdomains = false; + bool trim_mobile_prefix = (format_types & kFormatUrlOmitMobilePrefix) != 0; + AppendFormattedComponent( + spec, parsed.host, diff --git a/patches/0001-Vanadium/0065-disable-learn-more-link-in-incognito-new-tab.patch b/patches/0001-Vanadium/0065-disable-learn-more-link-in-incognito-new-tab.patch new file mode 100644 index 0000000..d685835 --- /dev/null +++ b/patches/0001-Vanadium/0065-disable-learn-more-link-in-incognito-new-tab.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: A Mak +Date: Sat, 8 Aug 2020 11:17:59 -0700 +Subject: [PATCH] disable learn more link in incognito new tab + +--- + .../chrome/browser/ntp/LegacyIncognitoDescriptionView.java | 4 ++-- + .../chrome/browser/ntp/RevampedIncognitoDescriptionView.java | 1 + + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/LegacyIncognitoDescriptionView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/LegacyIncognitoDescriptionView.java +index 517d82077141b..a26dc3e57a04e 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/LegacyIncognitoDescriptionView.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/LegacyIncognitoDescriptionView.java +@@ -286,9 +286,9 @@ public class LegacyIncognitoDescriptionView + private void adjustLearnMore() { + final String subtitleText = getContext().getResources().getString( + R.string.new_tab_otr_subtitle_with_reading_list); +- boolean learnMoreInSubtitle = mWidthDp > WIDE_LAYOUT_THRESHOLD_DP; ++ boolean learnMoreInSubtitle = false; + +- mLearnMore.setVisibility(learnMoreInSubtitle ? View.GONE : View.VISIBLE); ++ mLearnMore.setVisibility(View.GONE); + + if (!learnMoreInSubtitle) { + // Revert to the original text. +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RevampedIncognitoDescriptionView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RevampedIncognitoDescriptionView.java +index 4213e30ca7f72..3610c592e49fb 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RevampedIncognitoDescriptionView.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RevampedIncognitoDescriptionView.java +@@ -264,6 +264,7 @@ public class RevampedIncognitoDescriptionView + + mLearnMore.setText(formattedText); + mLearnMore.setMovementMethod(LinkMovementMethod.getInstance()); ++ mLearnMore.setVisibility(View.GONE); + } + + private boolean isNarrowScreen() { diff --git a/patches/0001-Vanadium/0066-disable-Omaha-update-check-support.patch b/patches/0001-Vanadium/0066-disable-Omaha-update-check-support.patch new file mode 100644 index 0000000..8f017c3 --- /dev/null +++ b/patches/0001-Vanadium/0066-disable-Omaha-update-check-support.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Wed, 18 Nov 2020 19:13:27 -0500 +Subject: [PATCH] disable Omaha update check support + +--- + .../java/src/org/chromium/chrome/browser/omaha/OmahaBase.java | 2 +- + .../org/chromium/chrome/browser/omaha/VersionNumberGetter.java | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java +index 81108fdc4f5e9..9e57118fbf0f9 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase.java +@@ -157,7 +157,7 @@ public class OmahaBase { + + /** See {@link #sIsDisabled}. */ + static boolean isDisabled() { +- return sIsDisabled; ++ return true; + } + + /** +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java +index bf9c4eef05cf0..2e2129cd3383b 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java +@@ -51,7 +51,7 @@ public class VersionNumberGetter { + private static VersionNumberGetter sInstanceForTests; + + /** If false, OmahaClient will never report that a newer version is available. */ +- private static boolean sEnableUpdateDetection = true; ++ private static boolean sEnableUpdateDetection = false; + + protected VersionNumberGetter() { } + diff --git a/patches/0001-Vanadium/0067-disable-GaiaAuthFetcher-code-due-to-upstream-bug.patch b/patches/0001-Vanadium/0067-disable-GaiaAuthFetcher-code-due-to-upstream-bug.patch new file mode 100644 index 0000000..3babc88 --- /dev/null +++ b/patches/0001-Vanadium/0067-disable-GaiaAuthFetcher-code-due-to-upstream-bug.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 19 Nov 2020 07:59:29 -0500 +Subject: [PATCH] disable GaiaAuthFetcher code due to upstream bug + +https://bugs.chromium.org/p/chromium/issues/detail?id=1150817 +--- + google_apis/gaia/gaia_auth_fetcher.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc +index 7d789c40d3847..aeff2607a3990 100644 +--- a/google_apis/gaia/gaia_auth_fetcher.cc ++++ b/google_apis/gaia/gaia_auth_fetcher.cc +@@ -41,7 +41,9 @@ + + namespace { + ++#if 0 + const size_t kMaxMessageSize = 1024 * 1024; // 1MB ++#endif + + constexpr char kBadAuthenticationError[] = "BadAuthentication"; + constexpr char kBadAuthenticationShortError[] = "badauth"; +@@ -272,6 +274,7 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher( + const net::NetworkTrafficAnnotationTag& traffic_annotation) { + DCHECK(!fetch_pending_) << "Tried to fetch two things at once!"; + ++#if 0 + auto resource_request = std::make_unique(); + resource_request->url = gaia_gurl; + original_url_ = gaia_gurl; +@@ -326,6 +329,7 @@ void GaiaAuthFetcher::CreateAndStartGaiaFetcher( + base::BindOnce(&GaiaAuthFetcher::OnURLLoadComplete, + base::Unretained(this)), + kMaxMessageSize); ++#endif + } + + // static diff --git a/patches/0001-Vanadium/0068-remove-safety-check-menu.patch b/patches/0001-Vanadium/0068-remove-safety-check-menu.patch new file mode 100644 index 0000000..fb73cc3 --- /dev/null +++ b/patches/0001-Vanadium/0068-remove-safety-check-menu.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Tue, 25 May 2021 16:43:39 -0400 +Subject: [PATCH] remove safety check menu + +--- + .../src/org/chromium/chrome/browser/settings/MainSettings.java | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java +index 16879dbc752cc..0f8e31e160cbb 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java +@@ -209,6 +209,8 @@ public class MainSettings extends PreferenceFragmentCompat + templateUrlService.load(); + } + ++ getPreferenceScreen().removePreference(findPreference(PREF_SAFETY_CHECK)); ++ + new AdaptiveToolbarStatePredictor(null).recomputeUiState(uiState -> { + // We don't show the toolbar shortcut settings page if disabled from finch. + if (uiState.canShowUi) return; diff --git a/patches/0001-Vanadium/0069-disable-unused-password-check-feature.patch b/patches/0001-Vanadium/0069-disable-unused-password-check-feature.patch new file mode 100644 index 0000000..7342907 --- /dev/null +++ b/patches/0001-Vanadium/0069-disable-unused-password-check-feature.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Thu, 15 Apr 2021 11:33:17 -0400 +Subject: [PATCH] disable unused password check feature + +--- + .../chrome/browser/password_check/PasswordCheckFactory.java | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/chrome/browser/password_check/android/internal/java/src/org/chromium/chrome/browser/password_check/PasswordCheckFactory.java b/chrome/browser/password_check/android/internal/java/src/org/chromium/chrome/browser/password_check/PasswordCheckFactory.java +index ca83d3a1d2223..aca3e146f0b51 100644 +--- a/chrome/browser/password_check/android/internal/java/src/org/chromium/chrome/browser/password_check/PasswordCheckFactory.java ++++ b/chrome/browser/password_check/android/internal/java/src/org/chromium/chrome/browser/password_check/PasswordCheckFactory.java +@@ -24,10 +24,7 @@ public class PasswordCheckFactory { + * @return A {@link PasswordCheckImpl} or null if the feature is disabled. + */ + public static @Nullable PasswordCheck getOrCreate(SettingsLauncher settingsLauncher) { +- if (sPasswordCheck == null) { +- sPasswordCheck = new PasswordCheckImpl(settingsLauncher); +- } +- return sPasswordCheck; ++ return null; + } + + /** diff --git a/patches/0001-Vanadium/0071-Move-search-suggestions-back-to-privacy-section.patch b/patches/0001-Vanadium/0071-Move-search-suggestions-back-to-privacy-section.patch new file mode 100644 index 0000000..96dbbd1 --- /dev/null +++ b/patches/0001-Vanadium/0071-Move-search-suggestions-back-to-privacy-section.patch @@ -0,0 +1,81 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Fri, 20 Aug 2021 16:13:42 +0000 +Subject: [PATCH] Move search suggestions back to privacy section. + +--- + .../java/res/xml/privacy_preferences_ext.xml | 5 +++++ + .../privacy/settings/PrivacySettingsExt.java | 20 +++++++++++++++++++ + 2 files changed, 25 insertions(+) + +diff --git a/chrome/android/java/res/xml/privacy_preferences_ext.xml b/chrome/android/java/res/xml/privacy_preferences_ext.xml +index a352cd657b1b9..01e8c8217afed 100644 +--- a/chrome/android/java/res/xml/privacy_preferences_ext.xml ++++ b/chrome/android/java/res/xml/privacy_preferences_ext.xml +@@ -5,5 +5,10 @@ that can be found in the LICENSE file. + --> + ++ + + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java +index 00a65cf922353..d627ead5ee9d0 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java +@@ -25,6 +25,8 @@ import org.chromium.components.user_prefs.UserPrefs; + + final class PrivacySettingsExt { + ++ private static final String PREF_SEARCH_SUGGESTIONS = "search_suggestions"; ++ + private static final Preference.OnPreferenceChangeListener LISTENER = + (pref, val) -> { + PrefService prefService = UserPrefs.get(Profile.getLastUsedRegularProfile()); +@@ -32,6 +34,9 @@ final class PrivacySettingsExt { + return false; + } + String key = pref.getKey(); ++ if (PREF_SEARCH_SUGGESTIONS.equals(key)) { ++ prefService.setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) val); ++ } + return true; + }; + +@@ -42,6 +47,9 @@ final class PrivacySettingsExt { + return false; + } + String key = pref.getKey(); ++ if (PREF_SEARCH_SUGGESTIONS.equals(key)) { ++ return prefService.isManagedPreference(Pref.SEARCH_SUGGEST_ENABLED); ++ } + return false; + }; + +@@ -58,10 +66,22 @@ final class PrivacySettingsExt { + int SECURITY_PREFERENCES_ORDER = + ChromeFeatureList.isEnabled(ChromeFeatureList.PRIVACY_SANDBOX_SETTINGS_4) ? 2 : 9999; + SettingsUtils.addPreferencesFromResource(prefFragment, R.xml.privacy_preferences_ext); ++ ChromeSwitchPreference searchSuggestionsPref = ++ (ChromeSwitchPreference) prefFragment.findPreference(PREF_SEARCH_SUGGESTIONS); ++ if (searchSuggestionsPref != null) { ++ searchSuggestionsPref.setOrder(PRIVACY_PREFERENCES_ORDER); ++ searchSuggestionsPref.setOnPreferenceChangeListener(LISTENER); ++ searchSuggestionsPref.setManagedPreferenceDelegate(DELEGATE); ++ } + } + + static void updatePreferences(@NonNull PreferenceFragmentCompat prefFragment) { + ThreadUtils.checkUiThread(); + PrefService prefService = UserPrefs.get(Profile.getLastUsedRegularProfile()); ++ ChromeSwitchPreference searchSuggestionsPref = ++ (ChromeSwitchPreference) prefFragment.findPreference(PREF_SEARCH_SUGGESTIONS); ++ SettingsExtUtils.safelyUpdateSwitchPreference(/* switchPref */ searchSuggestionsPref, ++ /* newSummary*/ null, ++ /* newCheckedValue*/ prefService.getBoolean(Pref.SEARCH_SUGGEST_ENABLED)); + } + } diff --git a/patches/0001-Vanadium/0073-disable-trials-of-privacy-aware-analytics-advertisin.patch b/patches/0001-Vanadium/0073-disable-trials-of-privacy-aware-analytics-advertisin.patch new file mode 100644 index 0000000..85f284c --- /dev/null +++ b/patches/0001-Vanadium/0073-disable-trials-of-privacy-aware-analytics-advertisin.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Wed, 4 Aug 2021 03:29:04 -0400 +Subject: [PATCH] disable trials of privacy-aware analytics/advertising APIs + +--- + components/privacy_sandbox/privacy_sandbox_prefs.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/privacy_sandbox/privacy_sandbox_prefs.cc b/components/privacy_sandbox/privacy_sandbox_prefs.cc +index b97d1209550f4..9d486bbe3f4f6 100644 +--- a/components/privacy_sandbox/privacy_sandbox_prefs.cc ++++ b/components/privacy_sandbox/privacy_sandbox_prefs.cc +@@ -103,7 +103,7 @@ namespace privacy_sandbox { + + void RegisterProfilePrefs(PrefRegistrySimple* registry) { + registry->RegisterBooleanPref( +- prefs::kPrivacySandboxApisEnabled, true, ++ prefs::kPrivacySandboxApisEnabled, false, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kPrivacySandboxApisEnabledV2, false); + registry->RegisterBooleanPref(prefs::kPrivacySandboxM1ConsentDecisionMade, diff --git a/patches/0001-Vanadium/0074-remove-unwanted-sync-and-services-link.patch b/patches/0001-Vanadium/0074-remove-unwanted-sync-and-services-link.patch new file mode 100644 index 0000000..8f87d92 --- /dev/null +++ b/patches/0001-Vanadium/0074-remove-unwanted-sync-and-services-link.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Sat, 7 Aug 2021 15:01:54 -0400 +Subject: [PATCH] remove unwanted sync and services link + +--- + .../chrome/browser/privacy/settings/PrivacySettings.java | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +index 6af2642df1e0f..67c390408cd69 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +@@ -176,8 +176,7 @@ public class PrivacySettings extends PreferenceFragmentCompat + Preference secureDnsPref = findPreference(PREF_SECURE_DNS); + secureDnsPref.setVisible(SecureDnsSettings.isUiEnabled()); + +- Preference syncAndServicesLink = findPreference(PREF_SYNC_AND_SERVICES_LINK); +- syncAndServicesLink.setSummary(buildSyncAndServicesLink()); ++ getPreferenceScreen().removePreference(findPreference(PREF_SYNC_AND_SERVICES_LINK)); + + Preference thirdPartyCookies = findPreference(PREF_THIRD_PARTY_COOKIES); + if (thirdPartyCookies != null) { diff --git a/patches/0001-Vanadium/0075-remove-unwanted-account-and-services-section.patch b/patches/0001-Vanadium/0075-remove-unwanted-account-and-services-section.patch new file mode 100644 index 0000000..1f07739 --- /dev/null +++ b/patches/0001-Vanadium/0075-remove-unwanted-account-and-services-section.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Fri, 20 Aug 2021 16:13:42 +0000 +Subject: [PATCH] remove unwanted account and services section + +--- + .../src/org/chromium/chrome/browser/settings/MainSettings.java | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java +index 0f8e31e160cbb..17088c8d6c9df 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java +@@ -210,6 +210,8 @@ public class MainSettings extends PreferenceFragmentCompat + } + + getPreferenceScreen().removePreference(findPreference(PREF_SAFETY_CHECK)); ++ getPreferenceScreen().removePreference(findPreference(PREF_ACCOUNT_AND_GOOGLE_SERVICES_SECTION)); ++ getPreferenceScreen().removePreference(findPreference(PREF_GOOGLE_SERVICES)); + + new AdaptiveToolbarStatePredictor(null).recomputeUiState(uiState -> { + // We don't show the toolbar shortcut settings page if disabled from finch. diff --git a/patches/0001-Vanadium/0076-Hide-Sign-In-preference-when-disallowed.patch b/patches/0001-Vanadium/0076-Hide-Sign-In-preference-when-disallowed.patch new file mode 100644 index 0000000..f1fc87b --- /dev/null +++ b/patches/0001-Vanadium/0076-Hide-Sign-In-preference-when-disallowed.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Sun, 29 Aug 2021 19:31:00 +0000 +Subject: [PATCH] Hide Sign In preference when disallowed + +--- + .../chromium/chrome/browser/sync/settings/SignInPreference.java | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SignInPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SignInPreference.java +index 2e52171a9acd9..66bed04ba16c3 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SignInPreference.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SignInPreference.java +@@ -151,6 +151,7 @@ public class SignInPreference + } + + private void setupSigninDisallowed() { ++ setViewEnabled(false); + mWasGenericSigninPromoDisplayed = false; + } + diff --git a/patches/0001-Vanadium/0077-disable-using-Play-services-fonts.patch b/patches/0001-Vanadium/0077-disable-using-Play-services-fonts.patch new file mode 100644 index 0000000..011049e --- /dev/null +++ b/patches/0001-Vanadium/0077-disable-using-Play-services-fonts.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Wed, 1 Sep 2021 02:09:14 -0400 +Subject: [PATCH] disable using Play services fonts + +--- + .../chromium/content/browser/font/AndroidFontLookupImpl.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/content/public/android/java/src/org/chromium/content/browser/font/AndroidFontLookupImpl.java b/content/public/android/java/src/org/chromium/content/browser/font/AndroidFontLookupImpl.java +index faeb88e2de254..9da1f71b033f4 100644 +--- a/content/public/android/java/src/org/chromium/content/browser/font/AndroidFontLookupImpl.java ++++ b/content/public/android/java/src/org/chromium/content/browser/font/AndroidFontLookupImpl.java +@@ -177,7 +177,7 @@ public class AndroidFontLookupImpl implements AndroidFontLookup { + * @param fontUniqueName The ICU case folded unique full font name to fetch. + */ + private ReadOnlyFile fetchFontInBackground(String fontUniqueName, Core core) { +- ParcelFileDescriptor fileDescriptor = tryFetchFont(fontUniqueName); ++ ParcelFileDescriptor fileDescriptor = null; + if (fileDescriptor == null) { + // Avoid re-requesting this font in future. + mExpectedFonts.remove(fontUniqueName); diff --git a/patches/0001-Vanadium/0078-Remove-privacy-trials-preference-UI.patch b/patches/0001-Vanadium/0078-Remove-privacy-trials-preference-UI.patch new file mode 100644 index 0000000..0c13937 --- /dev/null +++ b/patches/0001-Vanadium/0078-Remove-privacy-trials-preference-UI.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Fri, 15 Oct 2021 13:49:33 +0000 +Subject: [PATCH] Remove privacy trials preference UI + +--- + .../chrome/browser/privacy/settings/PrivacySettings.java | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +index a9da397ba2eaf..6af2642df1e0f 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +@@ -128,6 +128,8 @@ public class PrivacySettings extends PreferenceFragmentCompat + mIncognitoLockSettings = new IncognitoLockSettings(incognitoReauthPreference); + mIncognitoLockSettings.setUpIncognitoReauthPreference(getActivity()); + ++ getPreferenceScreen().removePreference(findPreference(PREF_PRIVACY_SANDBOX)); ++ + Preference safeBrowsingPreference = findPreference(PREF_SAFE_BROWSING); + safeBrowsingPreference.setSummary( + SafeBrowsingSettingsFragment.getSafeBrowsingSummaryString(getContext())); diff --git a/patches/0001-Vanadium/0079-use-Google-Chrome-branding-for-client-hints.patch b/patches/0001-Vanadium/0079-use-Google-Chrome-branding-for-client-hints.patch new file mode 100644 index 0000000..8252687 --- /dev/null +++ b/patches/0001-Vanadium/0079-use-Google-Chrome-branding-for-client-hints.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zoraver Kang +Date: Sun, 10 Oct 2021 21:59:16 -0400 +Subject: [PATCH] use Google Chrome branding for client hints + +--- + components/embedder_support/user_agent_utils.cc | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/components/embedder_support/user_agent_utils.cc b/components/embedder_support/user_agent_utils.cc +index 86e97af7108a5..bbc583aba184b 100644 +--- a/components/embedder_support/user_agent_utils.cc ++++ b/components/embedder_support/user_agent_utils.cc +@@ -246,6 +246,7 @@ const blink::UserAgentBrandList GetUserAgentBrandList( + bool parse_result = base::StringToInt(major_version, &major_version_number); + DCHECK(parse_result); + absl::optional brand; ++ brand = "Google Chrome"; + #if !BUILDFLAG(CHROMIUM_BRANDING) + brand = version_info::GetProductName(); + #endif diff --git a/patches/0001-Vanadium/0080-Make-HTTPS-only-mode-the-default.patch b/patches/0001-Vanadium/0080-Make-HTTPS-only-mode-the-default.patch new file mode 100644 index 0000000..a8aa0f3 --- /dev/null +++ b/patches/0001-Vanadium/0080-Make-HTTPS-only-mode-the-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: qua3k +Date: Mon, 18 Oct 2021 17:18:52 -0400 +Subject: [PATCH] Make HTTPS-only mode the default + +--- + chrome/browser/ui/browser_ui_prefs.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc +index 6ff2102a201ba..67055ab9f0e56 100644 +--- a/chrome/browser/ui/browser_ui_prefs.cc ++++ b/chrome/browser/ui/browser_ui_prefs.cc +@@ -161,7 +161,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { + #endif + + registry->RegisterBooleanPref( +- prefs::kHttpsOnlyModeEnabled, false, ++ prefs::kHttpsOnlyModeEnabled, true, + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterListPref(prefs::kHttpAllowlist); + registry->RegisterBooleanPref(prefs::kHttpsUpgradesEnabled, true); diff --git a/patches/0001-Vanadium/0081-Enable-strict-origin-isolation-by-default.patch b/patches/0001-Vanadium/0081-Enable-strict-origin-isolation-by-default.patch new file mode 100644 index 0000000..76fbd89 --- /dev/null +++ b/patches/0001-Vanadium/0081-Enable-strict-origin-isolation-by-default.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: qua3k +Date: Thu, 21 Oct 2021 00:00:00 +0000 +Subject: [PATCH] Enable strict origin isolation by default + +Upstream is in the process of enabling origin isolation by default +in the process of deprecating `document.domain`. An insignificant +number of Chrome page loads use `document.domain`. + +See https://crbug.com/1259920 and +https://chromestatus.com/metrics/feature/timeline/popularity/2544 +for more detail. +--- + content/public/common/content_features.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc +index 2dd328bff1f9c..76a15e470a170 100644 +--- a/content/public/common/content_features.cc ++++ b/content/public/common/content_features.cc +@@ -1264,7 +1264,7 @@ BASE_FEATURE(kStopVideoCaptureOnScreenLock, + // eTLD+1. + BASE_FEATURE(kStrictOriginIsolation, + "StrictOriginIsolation", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + // Disallows window.{alert, prompt, confirm} if triggered inside a subframe that + // is not same origin with the main frame. diff --git a/patches/0001-Vanadium/0082-disable-appending-variations-header.patch b/patches/0001-Vanadium/0082-disable-appending-variations-header.patch new file mode 100644 index 0000000..f23c095 --- /dev/null +++ b/patches/0001-Vanadium/0082-disable-appending-variations-header.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zoraver Kang +Date: Sat, 15 Jan 2022 13:34:33 -0500 +Subject: [PATCH] disable appending variations header + +--- + components/variations/net/variations_http_headers.cc | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/components/variations/net/variations_http_headers.cc b/components/variations/net/variations_http_headers.cc +index 2818ede04d78a..d1512714b0ab9 100644 +--- a/components/variations/net/variations_http_headers.cc ++++ b/components/variations/net/variations_http_headers.cc +@@ -118,10 +118,7 @@ URLValidationResult GetUrlValidationResult(const GURL& url) { + // Also, logs the result of validating |url| in histograms, one of which ends in + // |suffix|. + bool ShouldAppendVariationsHeader(const GURL& url, const std::string& suffix) { +- URLValidationResult result = GetUrlValidationResult(url); +- base::UmaHistogramEnumeration( +- "Variations.Headers.URLValidationResult." + suffix, result); +- return result == URLValidationResult::kShouldAppend; ++ return false; + } + + // Returns true if the request is sent from a Google web property, i.e. from a diff --git a/patches/0001-Vanadium/0083-Hide-currently-no-op-preload-settings.patch b/patches/0001-Vanadium/0083-Hide-currently-no-op-preload-settings.patch new file mode 100644 index 0000000..95e0b52 --- /dev/null +++ b/patches/0001-Vanadium/0083-Hide-currently-no-op-preload-settings.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Mon, 24 Jan 2022 19:22:26 +0000 +Subject: [PATCH] Hide currently no-op preload settings + +--- + .../chrome/browser/privacy/settings/PrivacySettings.java | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +index 67c390408cd69..f97d64c38274d 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java +@@ -145,6 +145,11 @@ public class PrivacySettings extends PreferenceFragmentCompat + (ChromeSwitchPreference) findPreference(PREF_CAN_MAKE_PAYMENT); + canMakePaymentPref.setOnPreferenceChangeListener(this); + ++ Preference preloadPagesPreference = findPreference(PREF_PRELOAD_PAGES); ++ preloadPagesPreference.setSummary( ++ PreloadPagesSettingsFragment.getPreloadPagesSummaryString(getContext())); ++ getPreferenceScreen().removePreference(preloadPagesPreference); ++ + ChromeSwitchPreference httpsFirstModePref = + (ChromeSwitchPreference) findPreference(PREF_HTTPS_FIRST_MODE); + httpsFirstModePref.setVisible( diff --git a/patches/0001-Vanadium/0084-Disable-detailed-language-settings-by-default.patch b/patches/0001-Vanadium/0084-Disable-detailed-language-settings-by-default.patch new file mode 100644 index 0000000..fc1ccfb --- /dev/null +++ b/patches/0001-Vanadium/0084-Disable-detailed-language-settings-by-default.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Tue, 8 Feb 2022 03:04:20 +0000 +Subject: [PATCH] Disable detailed language settings by default + +--- + components/language/core/common/language_experiments.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/components/language/core/common/language_experiments.cc b/components/language/core/common/language_experiments.cc +index eddc4487ff15f..93e8f1e9d4e5e 100644 +--- a/components/language/core/common/language_experiments.cc ++++ b/components/language/core/common/language_experiments.cc +@@ -16,7 +16,7 @@ BASE_FEATURE(kExplicitLanguageAsk, + base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kAppLanguagePrompt, + "AppLanguagePrompt", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kAppLanguagePromptULP, + "AppLanguagePromptULP", + base::FEATURE_ENABLED_BY_DEFAULT); +@@ -25,7 +25,7 @@ BASE_FEATURE(kForceAppLanguagePrompt, + base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kDetailedLanguageSettings, + "DetailedLanguageSettings", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + BASE_FEATURE(kDesktopDetailedLanguageSettings, + "DesktopDetailedLanguageSettings", + base::FEATURE_ENABLED_BY_DEFAULT); diff --git a/patches/0001-Vanadium/0085-disable-fetching-optimization-guides-by-default.patch b/patches/0001-Vanadium/0085-disable-fetching-optimization-guides-by-default.patch new file mode 100644 index 0000000..a5f0807 --- /dev/null +++ b/patches/0001-Vanadium/0085-disable-fetching-optimization-guides-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Micay +Date: Mon, 25 Apr 2022 06:19:32 -0400 +Subject: [PATCH] disable fetching optimization guides by default + +--- + .../optimization_guide/core/optimization_guide_features.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/optimization_guide/core/optimization_guide_features.cc b/components/optimization_guide/core/optimization_guide_features.cc +index 031965e0d936f..1356ab5c15a04 100644 +--- a/components/optimization_guide/core/optimization_guide_features.cc ++++ b/components/optimization_guide/core/optimization_guide_features.cc +@@ -86,7 +86,7 @@ BASE_FEATURE(kOptimizationHints, + // Enables fetching from a remote Optimization Guide Service. + BASE_FEATURE(kRemoteOptimizationGuideFetching, + "OptimizationHintsFetching", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + + BASE_FEATURE(kRemoteOptimizationGuideFetchingAnonymousDataConsent, + "OptimizationHintsFetchingAnonymousDataConsent", diff --git a/patches/0001-Vanadium/0086-Implement-UI-for-JIT-site-settings.patch b/patches/0001-Vanadium/0086-Implement-UI-for-JIT-site-settings.patch new file mode 100644 index 0000000..ce748b3 --- /dev/null +++ b/patches/0001-Vanadium/0086-Implement-UI-for-JIT-site-settings.patch @@ -0,0 +1,488 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Fri, 28 Jan 2022 20:52:56 +0000 +Subject: [PATCH] Implement UI for JIT site settings + +--- + .../browser_ui/site_settings/android/BUILD.gn | 5 +++++ + .../permission_javascript_jit.png | Bin 0 -> 433 bytes + .../permission_javascript_jit.png | Bin 0 -> 377 bytes + .../permission_javascript_jit.png | Bin 0 -> 518 bytes + .../permission_javascript_jit.png | Bin 0 -> 629 bytes + .../permission_javascript_jit.png | Bin 0 -> 797 bytes + .../res/xml/site_settings_preferences.xml | 4 ++++ + .../ContentSettingsResources.java | 7 ++++++ + .../site_settings/SingleCategorySettings.java | 7 ++++++ + .../site_settings/SingleWebsiteSettings.java | 21 ++++++++++++++++++ + .../site_settings/SiteSettingsCategory.java | 9 ++++++-- + .../site_settings/SiteSettingsUtil.java | 1 + + .../browser_ui/site_settings/Website.java | 6 +++++ + .../android/website_preference_bridge.cc | 1 + + .../strings/android/site_settings.grdp | 18 +++++++++++++++ + .../core/browser/content_settings_registry.cc | 2 +- + .../android/page_info_controller_android.cc | 3 +++ + components/page_info/page_info.cc | 6 +++++ + components/page_info/page_info_ui.cc | 2 ++ + components/site_settings_strings.grdp | 6 +++++ + 20 files changed, 95 insertions(+), 3 deletions(-) + create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-hdpi/permission_javascript_jit.png + create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-mdpi/permission_javascript_jit.png + create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xhdpi/permission_javascript_jit.png + create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/permission_javascript_jit.png + create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xxxhdpi/permission_javascript_jit.png + +diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn +index 1809637c1ecd3..e1c42d5a3955b 100644 +--- a/components/browser_ui/site_settings/android/BUILD.gn ++++ b/components/browser_ui/site_settings/android/BUILD.gn +@@ -186,6 +186,7 @@ android_resources("java_resources") { + "java/res/drawable-hdpi/ic_volume_up_grey600_24dp.png", + "java/res/drawable-hdpi/permission_background_sync.png", + "java/res/drawable-hdpi/permission_javascript.png", ++ "java/res/drawable-hdpi/permission_javascript_jit.png", + "java/res/drawable-hdpi/permission_popups.png", + "java/res/drawable-hdpi/permission_protected_media.png", + "java/res/drawable-hdpi/settings_sensors.png", +@@ -193,6 +194,7 @@ android_resources("java_resources") { + "java/res/drawable-mdpi/ic_volume_up_grey600_24dp.png", + "java/res/drawable-mdpi/permission_background_sync.png", + "java/res/drawable-mdpi/permission_javascript.png", ++ "java/res/drawable-mdpi/permission_javascript_jit.png", + "java/res/drawable-mdpi/permission_popups.png", + "java/res/drawable-mdpi/permission_protected_media.png", + "java/res/drawable-mdpi/settings_sensors.png", +@@ -200,6 +202,7 @@ android_resources("java_resources") { + "java/res/drawable-xhdpi/ic_volume_up_grey600_24dp.png", + "java/res/drawable-xhdpi/permission_background_sync.png", + "java/res/drawable-xhdpi/permission_javascript.png", ++ "java/res/drawable-xhdpi/permission_javascript_jit.png", + "java/res/drawable-xhdpi/permission_popups.png", + "java/res/drawable-xhdpi/permission_protected_media.png", + "java/res/drawable-xhdpi/settings_sensors.png", +@@ -207,6 +210,7 @@ android_resources("java_resources") { + "java/res/drawable-xxhdpi/ic_volume_up_grey600_24dp.png", + "java/res/drawable-xxhdpi/permission_background_sync.png", + "java/res/drawable-xxhdpi/permission_javascript.png", ++ "java/res/drawable-xxhdpi/permission_javascript_jit.png", + "java/res/drawable-xxhdpi/permission_popups.png", + "java/res/drawable-xxhdpi/permission_protected_media.png", + "java/res/drawable-xxhdpi/settings_sensors.png", +@@ -214,6 +218,7 @@ android_resources("java_resources") { + "java/res/drawable-xxxhdpi/ic_volume_up_grey600_24dp.png", + "java/res/drawable-xxxhdpi/permission_background_sync.png", + "java/res/drawable-xxxhdpi/permission_javascript.png", ++ "java/res/drawable-xxxhdpi/permission_javascript_jit.png", + "java/res/drawable-xxxhdpi/permission_popups.png", + "java/res/drawable-xxxhdpi/permission_protected_media.png", + "java/res/drawable-xxxhdpi/settings_sensors.png", +diff --git a/components/browser_ui/site_settings/android/java/res/drawable-hdpi/permission_javascript_jit.png b/components/browser_ui/site_settings/android/java/res/drawable-hdpi/permission_javascript_jit.png +new file mode 100644 +index 0000000000000000000000000000000000000000..88f0ec11d6b186923ace473eb426f80341adc5f1 +GIT binary patch +literal 433 +zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8JTOS+@4BLl<6e(pbstUx|flDE4H +z!~gdFGy8!&_7YEDSN5meq5{TNTew%=2MRs)ba4#vIR193A=e=T3AgxL3xfGC+&p@g +zxq@%H!}^D6y&U%raBHM||I>M|)jh@5n_;>qt-4aO=Jn{SdpL;NdW$kh#Vwulipg-_&G}z8XMSF)ko-7% +z3rFxL#;bCHS58EnVqE2EI5A82*pCZV%bVPaq%Za?;S4FhcERGPe87bhk=K|*Cof)P +zJZTY&`R&NhA8)^oa_Rejc2&J;W}U>6#x9$0I?f-rAIrEOoW?)l(3d%VGfMurhSh~n +zzkWP``Iq|?^{v|tcEx$Uv<7-uwZt`|BqgyV)hf9t6-Y4{85kMr8XD>v8HN~GS{a&H +r8JTDs7+4t?X#IcZhN2-iKP5A*61RrvMPa{y8W=oX{an^LB{Ts5WVxh$ + +literal 0 +HcmV?d00001 + +diff --git a/components/browser_ui/site_settings/android/java/res/drawable-mdpi/permission_javascript_jit.png b/components/browser_ui/site_settings/android/java/res/drawable-mdpi/permission_javascript_jit.png +new file mode 100644 +index 0000000000000000000000000000000000000000..97b96dba01ebcae8a232a63f08bdf42ce997dc30 +GIT binary patch +literal 377 +zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1mUKs7M+SzC{oH>NS%G|}ByV>Y +zhX3vTXZ8bm>?NMQuIx{_MFotlws5b!4-{JK>Eak-ar*3}jl72p1YGCKrguwpW=1ep +zHhAz%6ft0N{iUJ3p?|rt!k>f!rSnaUse1uys-bF975M8jK$ +zp)d16ffF8Fr<(4~epuY_I&9C*DW^Y6O7W&8{tlIJ7if%p=Tv7F#w3uvcalHD +zvVT4ArrmS9WAybSo6Ewd7v4v2%1Kl_+;bvt-+xn{2bp&^d%SgY&iHtR^{w;n>*xJn +zvCg?`T*7?o3?tCtswJ)wB`Jv|saDBFsX&Us$iT=@*U(Vc$S}mf(#p`p%E(09z`)AD +jKgTe~DWM4fOh$>o + +literal 0 +HcmV?d00001 + +diff --git a/components/browser_ui/site_settings/android/java/res/drawable-xhdpi/permission_javascript_jit.png b/components/browser_ui/site_settings/android/java/res/drawable-xhdpi/permission_javascript_jit.png +new file mode 100644 +index 0000000000000000000000000000000000000000..8f85eb32c30cc965440d44c2eee784c23ea1f2fc +GIT binary patch +literal 518 +zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}a}tmUKs7M+SzC{oH>NS%G|}ByV>Y +zhX3vTXZ8bm>?NMQuIx{_MFotlws5b!&%nTF<>}%W5^?zLG(#_DN0GMu+da9sr#7?- +zZrSpU<(Yuej_L`yvbUee2`erYH!$C@IlN~omnKVOflk>?m8Li6p6F`4yU(L@`2XJT +z`)4LD3|;N3`m?A|Ls`-&ps2RYczT@uw1&@%@5$Cay>x%mgW8+uN56|v7Qd1%;d +z&~kl(v%tLki@$X0g8s~0Kly}ofP$8acDup@xroP`f0xH>5xcPB)BO88Wf+dUpLH!S +zj%kJ<^NDF{4tb|L?1H|pns?TF8dC|wJMrV&j3?M`+j?l?>^C{Tmc*5;u3x2JujJ$Y +z%7~#G7_h1(t`Q|Ei6yC4$wjF^iowXh$WYhNP}j&X#K6+Z(8S8fMBBi?%D_PD|2sDn +d4Y~O#nQ4`{HAF88`vug%;OXk;vd$@?2>=L-$>9J1 + +literal 0 +HcmV?d00001 + +diff --git a/components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/permission_javascript_jit.png b/components/browser_ui/site_settings/android/java/res/drawable-xxhdpi/permission_javascript_jit.png +new file mode 100644 +index 0000000000000000000000000000000000000000..54d86e9b38553720c860b0e0e5d7196fb0dc0dc6 +GIT binary patch +literal 629 +zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXhawSkfJR9T^xl_H+M9WCik>lDyqr +z82-2SpV<%Ov6p!Iy0Smz78NkI+QPl^J_7^eN>3NZkc@k8XYTepY#`EBzy0O{WgVS0 +ztYydeJoYdOnKE^DOZ*aQx$dAFJ-N|cgXheerTGV#q*D_#W+;}vn!-1sSjfF#AK$h~ +zuby0f@2$fsz~U%iq_O?J-EmH{D@B$4=J^s2t@btjRNJy$>`Ulrf30VAMFpRye8~zD^{uHVD%iSxJA&IC +zJHp#_j;wVSd30TI?Iu^NbDSTpyKpI}gt%C-EL>Fb@7!rquEI#og^#9itk&T&eU=`y +z!CURQzsgWDz2%HY?(*$YmZvUO`pkMcVdgw> +z&i3UO_QmvAUQh^kMk%5t+uA!l>kzt5|rIn$Hm63_I +nfq|8Qf!6lDyqr +z82-2SpV<%Ov6p!Iy0Smz78NkI+QPl^K2Sc;)5S5Q;?~>Q`@NMNMULN}!P5O%A!_yB +zE`|2eS;7bH4=6=P9*MGe6Z@a#;^VF*_bQ(7Tb$@@-K*3gsJnRW9mgD%b;%2NPd=+} +zX7zq=Y|VTV&nu~)6^pw90gb$1zOH`zq+?!-wf@8UGqYP?_6B;g8gdC; +zhAs)YHv5;GCH7dq5tvu{^Z&K^$M-R1Kb~BwQJ~&)@Z|o`#TN>R +z@h+a5^?`RueLkB|>tf}r2Dy{o|J*3RnCH?UE%?BVWrrYRUI&Ye`BkPqZfi}k13mXG +z=lWIDyxq)k!}|ACM$f?A0(s9J#TRt+Yd8qY`!;CVO=5_x5n(*_gM(?y$F=>;&5z61 +zzOIpYpR0H!i#uR`?P(^NkGfnRj!b8lYJPqwZx!nfku_zCe5|J*H$1nx@IUF>gt`Np +z>I8$gGaZWU2xEL|=C!iHgztjp0^XDmt`23xUZz(eO-_uJu^AtB7-$_`o?#oI?lk|* +z%`DcbopnubSvCjW>1)|%_G{IH1+ueWR30b})@x|zC{Sj))4^b_bfA}`AX%+g_s6ZD +zt{>-F-wKG@%e39#{?7JUkIq@}+~x6lw*PYJyMVzr`I;RW_w~PXgy=sM +zFW<0Z#r*y2t5_Ir*?%!C-(vA%|MlC;rWqb>voD`9vnkc%L$|=KaCUR)<++=es^=6k +zdS#hbu1|FIHV@q!yV7(=Ge?sG5UI3_o4szn*>QjOAz*q_Epd$~Nl7e8wMs5Z1yT$~ +z21bUuhK9OEh9L%)R)!{4Mkd+@237_JTL0gPsvQH#H}HEQP?k_1_n=8KbLh* +G2~7a)DNWn} + +literal 0 +HcmV?d00001 + +diff --git a/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml b/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml +index b261f5c1b2e9a..848ae8441df01 100644 +--- a/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml ++++ b/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml +@@ -47,6 +47,10 @@ Also add new settings to site_settings_preferences_with_categories.xml! + ++ ++ + + + JavaScript + ++ ++ JavaScript JIT ++ + + Location + +@@ -646,6 +649,21 @@ + Block JavaScript for a specific site. + + ++ ++ ++ ++ Allow sites to use just-in-time compilation; improve performance at expense of security by compiling JavaScript to native code. ++ ++ ++ Block sites to use just-in-time compilation; improve security at expense of performance by not compiling JavaScript to native code, and using only interpreted code. ++ ++ ++ Allow JIT for a specific site. ++ ++ ++ Block JIT for a specific site. ++ ++ + + + +diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc +index 7a2c634ebb4a3..f37611519b351 100644 +--- a/components/content_settings/core/browser/content_settings_registry.cc ++++ b/components/content_settings/core/browser/content_settings_registry.cc +@@ -508,7 +508,7 @@ void ContentSettingsRegistry::Init() { + ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); + + Register(ContentSettingsType::JAVASCRIPT_JIT, "javascript-jit", +- CONTENT_SETTING_ALLOW, WebsiteSettingsInfo::UNSYNCABLE, ++ CONTENT_SETTING_BLOCK, WebsiteSettingsInfo::UNSYNCABLE, + /*allowlisted_schemes=*/{}, + /*valid_settings=*/{CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK}, + WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE, +diff --git a/components/page_info/android/page_info_controller_android.cc b/components/page_info/android/page_info_controller_android.cc +index 126d202ff7355..51fd74ac38735 100644 +--- a/components/page_info/android/page_info_controller_android.cc ++++ b/components/page_info/android/page_info_controller_android.cc +@@ -134,6 +134,7 @@ void PageInfoControllerAndroid::SetPermissionInfo( + permissions_to_display.push_back(ContentSettingsType::IDLE_DETECTION); + permissions_to_display.push_back(ContentSettingsType::IMAGES); + permissions_to_display.push_back(ContentSettingsType::JAVASCRIPT); ++ permissions_to_display.push_back(ContentSettingsType::JAVASCRIPT_JIT); + permissions_to_display.push_back(ContentSettingsType::POPUPS); + permissions_to_display.push_back(ContentSettingsType::ADS); + permissions_to_display.push_back( +@@ -216,6 +217,8 @@ absl::optional PageInfoControllerAndroid::GetSettingToDisplay( + // The javascript content setting should show up if it is blocked globally + // to give users an easy way to create exceptions. + return permission.default_setting; ++ } else if (permission.type == ContentSettingsType::JAVASCRIPT_JIT) { ++ return permission.default_setting; + } else if (permission.type == ContentSettingsType::SOUND) { + // The sound content setting should always show up when the tab has played + // audio since last navigation. +diff --git a/components/page_info/page_info.cc b/components/page_info/page_info.cc +index 57ec08b826a66..20170f569c7fa 100644 +--- a/components/page_info/page_info.cc ++++ b/components/page_info/page_info.cc +@@ -99,6 +99,7 @@ ContentSettingsType kPermissionType[] = { + ContentSettingsType::SENSORS, + ContentSettingsType::NOTIFICATIONS, + ContentSettingsType::JAVASCRIPT, ++ ContentSettingsType::JAVASCRIPT_JIT, + #if !BUILDFLAG(IS_ANDROID) + ContentSettingsType::IMAGES, + #endif +@@ -157,6 +158,11 @@ bool ShouldShowPermission(const PageInfo::PermissionInfo& info, + return true; + } + ++ // Always show JIT settings UI when when it has a site-specific override. ++ if (info.type == ContentSettingsType::JAVASCRIPT_JIT) { ++ return true; ++ } ++ + const bool is_incognito = web_contents->GetBrowserContext()->IsOffTheRecord(); + #if BUILDFLAG(IS_ANDROID) + // Special geolocation DSE settings apply only on Android, so make sure it +diff --git a/components/page_info/page_info_ui.cc b/components/page_info/page_info_ui.cc +index 22aab629c43e5..efcccf42de6ac 100644 +--- a/components/page_info/page_info_ui.cc ++++ b/components/page_info/page_info_ui.cc +@@ -137,6 +137,8 @@ base::span GetContentSettingsUIInfo() { + IDS_SITE_SETTINGS_TYPE_COOKIES_MID_SENTENCE}, + {ContentSettingsType::JAVASCRIPT, IDS_SITE_SETTINGS_TYPE_JAVASCRIPT, + IDS_SITE_SETTINGS_TYPE_JAVASCRIPT_MID_SENTENCE}, ++ {ContentSettingsType::JAVASCRIPT_JIT, IDS_SITE_SETTINGS_TYPE_JAVASCRIPT_JIT, ++ IDS_SITE_SETTINGS_TYPE_JAVASCRIPT_JIT_MID_SENTENCE}, + {ContentSettingsType::POPUPS, IDS_SITE_SETTINGS_TYPE_POPUPS_REDIRECTS, + IDS_SITE_SETTINGS_TYPE_POPUPS_REDIRECTS_MID_SENTENCE}, + {ContentSettingsType::GEOLOCATION, IDS_SITE_SETTINGS_TYPE_LOCATION, +diff --git a/components/site_settings_strings.grdp b/components/site_settings_strings.grdp +index d2b25c8483de5..3e27850ff9645 100644 +--- a/components/site_settings_strings.grdp ++++ b/components/site_settings_strings.grdp +@@ -82,6 +82,12 @@ + + javascript + ++ ++ JavaScript JIT ++ ++ ++ javascript JIT ++ + + Location + diff --git a/patches/0001-Vanadium/0087-enable-process-isolated-sandboxed-iframes-by-default.patch b/patches/0001-Vanadium/0087-enable-process-isolated-sandboxed-iframes-by-default.patch new file mode 100644 index 0000000..5cbee54 --- /dev/null +++ b/patches/0001-Vanadium/0087-enable-process-isolated-sandboxed-iframes-by-default.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: June +Date: Sun, 8 May 2022 01:34:58 +0000 +Subject: [PATCH] enable process isolated sandboxed iframes by default + +Signed-off-by: June +--- + third_party/blink/common/features.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc +index a69da8c71d979..953924fa504a6 100644 +--- a/third_party/blink/common/features.cc ++++ b/third_party/blink/common/features.cc +@@ -1642,7 +1642,7 @@ BASE_FEATURE(kWebRtcCombinedNetworkAndWorkerThread, + // sandboxes are isolated. + BASE_FEATURE(kIsolateSandboxedIframes, + "IsolateSandboxedIframes", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + const base::FeatureParam::Option + isolated_sandboxed_iframes_grouping_types[] = { + {IsolateSandboxedIframesGrouping::kPerSite, "per-site"}, diff --git a/patches/0001-Vanadium/0088-Toggle-for-closing-tabs-on-exit.patch b/patches/0001-Vanadium/0088-Toggle-for-closing-tabs-on-exit.patch new file mode 100644 index 0000000..88d7037 --- /dev/null +++ b/patches/0001-Vanadium/0088-Toggle-for-closing-tabs-on-exit.patch @@ -0,0 +1,166 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Fri, 17 Jun 2022 10:15:43 +0000 +Subject: [PATCH] Toggle for closing tabs on exit + +--- + chrome/android/chrome_ext_java_sources.gni | 1 + + .../java/res/xml/privacy_preferences_ext.xml | 5 ++++ + .../chrome/browser/ChromeTabbedActivity.java | 1 + + .../chrome/browser/TabPreferencesUtils.java | 24 +++++++++++++++++++ + .../privacy/settings/PrivacySettingsExt.java | 16 +++++++++++++ + .../browser/preferences/SharedPrefsUtils.java | 3 +++ + .../strings/android_chrome_ext_strings.grdp | 6 +++++ + 7 files changed, 56 insertions(+) + create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/TabPreferencesUtils.java + +diff --git a/chrome/android/chrome_ext_java_sources.gni b/chrome/android/chrome_ext_java_sources.gni +index d580fb6e83875..b4e048ed73ef3 100644 +--- a/chrome/android/chrome_ext_java_sources.gni ++++ b/chrome/android/chrome_ext_java_sources.gni +@@ -5,4 +5,5 @@ + chrome_ext_java_sources = [ + "java/src/org/chromium/chrome/browser/settings/SettingsExtUtils.java", + "java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java", ++ "java/src/org/chromium/chrome/browser/TabPreferencesUtils.java", + ] +diff --git a/chrome/android/java/res/xml/privacy_preferences_ext.xml b/chrome/android/java/res/xml/privacy_preferences_ext.xml +index 01e8c8217afed..ea1dd6c3f529c 100644 +--- a/chrome/android/java/res/xml/privacy_preferences_ext.xml ++++ b/chrome/android/java/res/xml/privacy_preferences_ext.xml +@@ -10,5 +10,10 @@ that can be found in the LICENSE file. + android:title="@string/improve_search_suggestions_title" + android:summary="@string/improve_search_suggestions_summary" + android:persistent="false"/> ++ + + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +index eb8d976faa065..f595aa4e1b231 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +@@ -1285,6 +1285,7 @@ public class ChromeTabbedActivity extends ChromeActivity { +@@ -36,6 +37,8 @@ final class PrivacySettingsExt { + String key = pref.getKey(); + if (PREF_SEARCH_SUGGESTIONS.equals(key)) { + prefService.setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) val); ++ } else if (PREF_CLOSE_TABS_ON_EXIT.equals(key)) { ++ SharedPrefsExt.CLOSE_TABS_ON_EXIT.put((boolean) val); + } + return true; + }; +@@ -73,6 +76,13 @@ final class PrivacySettingsExt { + searchSuggestionsPref.setOnPreferenceChangeListener(LISTENER); + searchSuggestionsPref.setManagedPreferenceDelegate(DELEGATE); + } ++ ++ ChromeSwitchPreference closeTabsOnExitPref = ++ (ChromeSwitchPreference) prefFragment.findPreference(PREF_CLOSE_TABS_ON_EXIT); ++ if (closeTabsOnExitPref != null) { ++ closeTabsOnExitPref.setOrder(PRIVACY_PREFERENCES_ORDER); ++ closeTabsOnExitPref.setOnPreferenceChangeListener(LISTENER); ++ } + } + + static void updatePreferences(@NonNull PreferenceFragmentCompat prefFragment) { +@@ -83,5 +93,11 @@ final class PrivacySettingsExt { + SettingsExtUtils.safelyUpdateSwitchPreference(/* switchPref */ searchSuggestionsPref, + /* newSummary*/ null, + /* newCheckedValue*/ prefService.getBoolean(Pref.SEARCH_SUGGEST_ENABLED)); ++ ++ ChromeSwitchPreference closeTabsOnExitPref = ++ (ChromeSwitchPreference) prefFragment.findPreference(PREF_CLOSE_TABS_ON_EXIT); ++ SettingsExtUtils.safelyUpdateSwitchPreference(/* switchPref */ closeTabsOnExitPref, ++ /* newSummary*/ null, ++ /* newCheckedValue*/ SharedPrefsExt.CLOSE_TABS_ON_EXIT.get()); + } + } +diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java +index ceec302c0a9d6..8fc7dde1db697 100644 +--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java ++++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java +@@ -136,6 +136,8 @@ public final class SharedPrefsUtils { + + // Stores SharedPreferences keys and its default value + public static class SharedPrefsExt { ++ public static final BoolSharedPref CLOSE_TABS_ON_EXIT = ++ new BoolSharedPref("close_tabs_on_exit", false); + } + + static SharedPreferencesManager getSharedPrefManager() { +@@ -146,6 +148,7 @@ public final class SharedPrefsUtils { + static boolean isKeyInUse(String key) { + // clang-format off + return Arrays.asList( ++ SharedPrefsExt.CLOSE_TABS_ON_EXIT.getKey() + ).contains(key); + // clang-format on + } +diff --git a/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp b/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp +index ba31bf0fad150..a1018b43620cd 100644 +--- a/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp ++++ b/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp +@@ -3,4 +3,10 @@ + Use of this source code is governed by a GPLv2 only-style license that can be + found in the LICENSE file. --> + ++ ++ Close tabs on exit ++ ++ ++ Don't persist tabs between browsing sessions ++ + diff --git a/patches/0001-Vanadium/0089-Toggle-for-navigating-external-URL-in-incognito.patch b/patches/0001-Vanadium/0089-Toggle-for-navigating-external-URL-in-incognito.patch new file mode 100644 index 0000000..6dba2c0 --- /dev/null +++ b/patches/0001-Vanadium/0089-Toggle-for-navigating-external-URL-in-incognito.patch @@ -0,0 +1,195 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Sun, 19 Jun 2022 06:39:48 +0000 +Subject: [PATCH] Toggle for navigating external URL in incognito + +--- + .../java/res/xml/privacy_preferences_ext.xml | 5 +++ + .../chrome/browser/ChromeTabbedActivity.java | 2 ++ + .../browser/LaunchIntentDispatcher.java | 3 ++ + .../chrome/browser/TabPreferencesUtils.java | 32 +++++++++++++++++++ + .../privacy/settings/PrivacySettingsExt.java | 17 ++++++++++ + .../browser/preferences/SharedPrefsUtils.java | 5 ++- + .../strings/android_chrome_ext_strings.grdp | 6 ++++ + 7 files changed, 69 insertions(+), 1 deletion(-) + +diff --git a/chrome/android/java/res/xml/privacy_preferences_ext.xml b/chrome/android/java/res/xml/privacy_preferences_ext.xml +index ea1dd6c3f529c..4f6b5a3ae75a5 100644 +--- a/chrome/android/java/res/xml/privacy_preferences_ext.xml ++++ b/chrome/android/java/res/xml/privacy_preferences_ext.xml +@@ -15,5 +15,10 @@ that can be found in the LICENSE file. + android:title="@string/close_tabs_on_exit_title" + android:summary="@string/close_tabs_on_exit_summary" + android:persistent="false"/> ++ + + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +index f595aa4e1b231..2950cc2c8b81b 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +@@ -2373,6 +2373,8 @@ public class ChromeTabbedActivity extends ChromeActivity { +@@ -39,6 +41,8 @@ final class PrivacySettingsExt { + prefService.setBoolean(Pref.SEARCH_SUGGEST_ENABLED, (boolean) val); + } else if (PREF_CLOSE_TABS_ON_EXIT.equals(key)) { + SharedPrefsExt.CLOSE_TABS_ON_EXIT.put((boolean) val); ++ } else if (PREF_OPEN_LINKS_IN_INCOGNITO.equals(key)) { ++ SharedPrefsExt.OPEN_LINKS_IN_INCOGNITO.put((boolean) val); + } + return true; + }; +@@ -83,6 +87,13 @@ final class PrivacySettingsExt { + closeTabsOnExitPref.setOrder(PRIVACY_PREFERENCES_ORDER); + closeTabsOnExitPref.setOnPreferenceChangeListener(LISTENER); + } ++ ++ ChromeSwitchPreference openLinksInIncognitoPref = ++ (ChromeSwitchPreference) prefFragment.findPreference(PREF_OPEN_LINKS_IN_INCOGNITO); ++ if (openLinksInIncognitoPref != null) { ++ openLinksInIncognitoPref.setOrder(PRIVACY_PREFERENCES_ORDER); ++ openLinksInIncognitoPref.setOnPreferenceChangeListener(LISTENER); ++ } + } + + static void updatePreferences(@NonNull PreferenceFragmentCompat prefFragment) { +@@ -99,5 +110,11 @@ final class PrivacySettingsExt { + SettingsExtUtils.safelyUpdateSwitchPreference(/* switchPref */ closeTabsOnExitPref, + /* newSummary*/ null, + /* newCheckedValue*/ SharedPrefsExt.CLOSE_TABS_ON_EXIT.get()); ++ ++ ChromeSwitchPreference openLinksInIncognitoPref = ++ (ChromeSwitchPreference) prefFragment.findPreference(PREF_OPEN_LINKS_IN_INCOGNITO); ++ SettingsExtUtils.safelyUpdateSwitchPreference(/* switchPref */ openLinksInIncognitoPref, ++ /* newSummary*/ null, ++ /* newCheckedValue*/ SharedPrefsExt.OPEN_LINKS_IN_INCOGNITO.get()); + } + } +diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java +index 8fc7dde1db697..c2ab10e14c29a 100644 +--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java ++++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/SharedPrefsUtils.java +@@ -138,6 +138,8 @@ public final class SharedPrefsUtils { + public static class SharedPrefsExt { + public static final BoolSharedPref CLOSE_TABS_ON_EXIT = + new BoolSharedPref("close_tabs_on_exit", false); ++ public static final BoolSharedPref OPEN_LINKS_IN_INCOGNITO = ++ new BoolSharedPref("open_links_in_incognito", false); + } + + static SharedPreferencesManager getSharedPrefManager() { +@@ -148,7 +150,8 @@ public final class SharedPrefsUtils { + static boolean isKeyInUse(String key) { + // clang-format off + return Arrays.asList( +- SharedPrefsExt.CLOSE_TABS_ON_EXIT.getKey() ++ SharedPrefsExt.CLOSE_TABS_ON_EXIT.getKey(), ++ SharedPrefsExt.OPEN_LINKS_IN_INCOGNITO.getKey() + ).contains(key); + // clang-format on + } +diff --git a/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp b/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp +index a1018b43620cd..52b9ca2042bee 100644 +--- a/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp ++++ b/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp +@@ -9,4 +9,10 @@ + + Don't persist tabs between browsing sessions + ++ ++ Open external links in incognito ++ ++ ++ Open links navigated by external apps in incognito tabs ++ + diff --git a/patches/0001-Vanadium/0090-Implement-UI-for-WebRTC-toggle.patch b/patches/0001-Vanadium/0090-Implement-UI-for-WebRTC-toggle.patch new file mode 100644 index 0000000..18ffa67 --- /dev/null +++ b/patches/0001-Vanadium/0090-Implement-UI-for-WebRTC-toggle.patch @@ -0,0 +1,470 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Thu, 23 Jun 2022 16:38:51 +0000 +Subject: [PATCH] Implement UI for WebRTC toggle + +This is based on Brave's implementation for webRTC policy toggle, but reuses +PrivacySettings logic on saving, loading preference values from +PrefService for the said policy. +--- + chrome/android/chrome_ext_java_resources.gni | 2 + + chrome/android/chrome_ext_java_sources.gni | 3 + + .../res/layout/webrtc_policy_preference.xml | 54 +++++++++++ + .../java/res/xml/privacy_preferences_ext.xml | 4 + + .../res/xml/webrtc_policy_preferences.xml | 9 ++ + .../privacy/settings/PrivacySettingsExt.java | 11 +++ + .../settings/WebRtcPolicyPreference.java | 97 +++++++++++++++++++ + .../webrtc/settings/WebRtcPolicySettings.java | 58 +++++++++++ + .../webrtc/settings/WebRtcPolicyUtils.java | 92 ++++++++++++++++++ + .../strings/android_chrome_ext_strings.grdp | 16 +++ + 10 files changed, 346 insertions(+) + create mode 100644 chrome/android/java/res/layout/webrtc_policy_preference.xml + create mode 100644 chrome/android/java/res/xml/webrtc_policy_preferences.xml + create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicyPreference.java + create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicySettings.java + create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicyUtils.java + +diff --git a/chrome/android/chrome_ext_java_resources.gni b/chrome/android/chrome_ext_java_resources.gni +index 164ef483d5a44..4b55afd038612 100644 +--- a/chrome/android/chrome_ext_java_resources.gni ++++ b/chrome/android/chrome_ext_java_resources.gni +@@ -4,4 +4,6 @@ + + chrome_ext_java_resources = [ + "java/res/xml/privacy_preferences_ext.xml", ++ "java/res/layout/webrtc_policy_preference.xml", ++ "java/res/xml/webrtc_policy_preferences.xml", + ] +diff --git a/chrome/android/chrome_ext_java_sources.gni b/chrome/android/chrome_ext_java_sources.gni +index b4e048ed73ef3..77963fdccafca 100644 +--- a/chrome/android/chrome_ext_java_sources.gni ++++ b/chrome/android/chrome_ext_java_sources.gni +@@ -6,4 +6,7 @@ chrome_ext_java_sources = [ + "java/src/org/chromium/chrome/browser/settings/SettingsExtUtils.java", + "java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java", + "java/src/org/chromium/chrome/browser/TabPreferencesUtils.java", ++ "java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicyPreference.java", ++ "java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicySettings.java", ++ "java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicyUtils.java", + ] +diff --git a/chrome/android/java/res/layout/webrtc_policy_preference.xml b/chrome/android/java/res/layout/webrtc_policy_preference.xml +new file mode 100644 +index 0000000000000..8addab2ecf1e1 +--- /dev/null ++++ b/chrome/android/java/res/layout/webrtc_policy_preference.xml +@@ -0,0 +1,54 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/chrome/android/java/res/xml/privacy_preferences_ext.xml b/chrome/android/java/res/xml/privacy_preferences_ext.xml +index 4f6b5a3ae75a5..6e955e33c0109 100644 +--- a/chrome/android/java/res/xml/privacy_preferences_ext.xml ++++ b/chrome/android/java/res/xml/privacy_preferences_ext.xml +@@ -20,5 +20,9 @@ that can be found in the LICENSE file. + android:title="@string/open_links_in_incognito_title" + android:summary="@string/open_links_in_incognito_summary" + android:persistent="false"/> ++ + + +diff --git a/chrome/android/java/res/xml/webrtc_policy_preferences.xml b/chrome/android/java/res/xml/webrtc_policy_preferences.xml +new file mode 100644 +index 0000000000000..f90f9d7231ff9 +--- /dev/null ++++ b/chrome/android/java/res/xml/webrtc_policy_preferences.xml +@@ -0,0 +1,9 @@ ++ ++ ++ ++ ++ ++ +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java +index e75b5cd5a534a..fdd7daddf6dca 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettingsExt.java +@@ -17,6 +17,7 @@ import org.chromium.chrome.browser.preferences.SharedPrefsUtils.SharedPrefsExt; + import org.chromium.chrome.browser.profiles.Profile; + import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate; + import org.chromium.chrome.browser.settings.SettingsExtUtils; ++import org.chromium.chrome.browser.webrtc.settings.WebRtcPolicySettings; + import org.chromium.components.browser_ui.settings.ChromeBasePreference; + import org.chromium.components.browser_ui.settings.ChromeSwitchPreference; + import org.chromium.components.browser_ui.settings.SettingsUtils; +@@ -29,6 +30,7 @@ final class PrivacySettingsExt { + private static final String PREF_CLOSE_TABS_ON_EXIT = SharedPrefsExt.CLOSE_TABS_ON_EXIT.getKey(); + private static final String PREF_OPEN_LINKS_IN_INCOGNITO = + SharedPrefsExt.OPEN_LINKS_IN_INCOGNITO.getKey(); ++ private static final String PREF_WEBRTC_POLICY = "webrtc_policy"; + + private static final Preference.OnPreferenceChangeListener LISTENER = + (pref, val) -> { +@@ -94,6 +96,11 @@ final class PrivacySettingsExt { + openLinksInIncognitoPref.setOrder(PRIVACY_PREFERENCES_ORDER); + openLinksInIncognitoPref.setOnPreferenceChangeListener(LISTENER); + } ++ ++ Preference webRtcPolicyPref = prefFragment.findPreference(PREF_WEBRTC_POLICY); ++ if (webRtcPolicyPref != null) { ++ webRtcPolicyPref.setOrder(PRIVACY_PREFERENCES_ORDER); ++ } + } + + static void updatePreferences(@NonNull PreferenceFragmentCompat prefFragment) { +@@ -116,5 +123,9 @@ final class PrivacySettingsExt { + SettingsExtUtils.safelyUpdateSwitchPreference(/* switchPref */ openLinksInIncognitoPref, + /* newSummary*/ null, + /* newCheckedValue*/ SharedPrefsExt.OPEN_LINKS_IN_INCOGNITO.get()); ++ ++ Preference webRtcPolicyPref = prefFragment.findPreference(PREF_WEBRTC_POLICY); ++ SettingsExtUtils.safelyUpdatePreference(/* preference */ webRtcPolicyPref, ++ /* newSummary */ WebRtcPolicySettings.getWebRtcPolicySummaryString(prefFragment.getContext())); + } + } +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicyPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicyPreference.java +new file mode 100644 +index 0000000000000..2026f9461b632 +--- /dev/null ++++ b/chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicyPreference.java +@@ -0,0 +1,97 @@ ++/* Copyright (c) 2021 The Brave Authors. All rights reserved. ++ * This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this file, ++ * You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++package org.chromium.chrome.browser.webrtc.settings; ++ ++import android.annotation.SuppressLint; ++import android.content.Context; ++import android.content.Intent; ++import android.net.Uri; ++import android.provider.Browser; ++import android.util.AttributeSet; ++import android.view.View; ++import android.widget.RadioGroup; ++import android.widget.TextView; ++ ++import androidx.annotation.IntDef; ++import androidx.preference.Preference; ++import androidx.preference.PreferenceViewHolder; ++ ++import org.chromium.chrome.R; ++import org.chromium.components.browser_ui.widget.RadioButtonWithDescription; ++import org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionLayout; ++ ++import java.util.ArrayList; ++import java.util.Collections; ++ ++public class WebRtcPolicyPreference ++ extends Preference implements RadioGroup.OnCheckedChangeListener { ++ @IntDef({WebRtcPolicy.DEFAULT, WebRtcPolicy.DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES, ++ WebRtcPolicy.DEFAULT_PUBLIC_INTERFACE_ONLY, WebRtcPolicy.DISABLE_NON_PROXIED_UDP}) ++ public @interface WebRtcPolicy { ++ int DEFAULT = 0; ++ int DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES = 1; ++ int DEFAULT_PUBLIC_INTERFACE_ONLY = 2; ++ int DISABLE_NON_PROXIED_UDP = 3; ++ ++ int NUM_ENTRIES = 4; ++ } ++ ++ private @WebRtcPolicy int mSetting; ++ private RadioButtonWithDescription mSettingRadioButton; ++ private RadioButtonWithDescriptionLayout mGroup; ++ private ArrayList mButtons; ++ ++ @SuppressLint("WrongConstant") ++ public WebRtcPolicyPreference(Context context, AttributeSet attrs) { ++ super(context, attrs); ++ ++ setLayoutResource(R.layout.webrtc_policy_preference); ++ ++ mButtons = new ArrayList<>(Collections.nCopies(WebRtcPolicy.NUM_ENTRIES, null)); ++ } ++ ++ public void initialize(@WebRtcPolicy int policy) { ++ mSetting = policy; ++ } ++ ++ @Override ++ public void onBindViewHolder(PreferenceViewHolder holder) { ++ super.onBindViewHolder(holder); ++ ++ mGroup = (RadioButtonWithDescriptionLayout) holder.findViewById(R.id.radio_button_layout); ++ mGroup.setOnCheckedChangeListener(this); ++ ++ mButtons.set(WebRtcPolicy.DEFAULT, ++ (RadioButtonWithDescription) holder.findViewById(R.id.webrtc_policy_default)); ++ mButtons.set(WebRtcPolicy.DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES, ++ (RadioButtonWithDescription) holder.findViewById( ++ R.id.webrtc_policy_default_public_and_private_interfaces)); ++ mButtons.set(WebRtcPolicy.DEFAULT_PUBLIC_INTERFACE_ONLY, ++ (RadioButtonWithDescription) holder.findViewById( ++ R.id.webrtc_policy_default_public_interface_only)); ++ mButtons.set(WebRtcPolicy.DISABLE_NON_PROXIED_UDP, ++ (RadioButtonWithDescription) holder.findViewById( ++ R.id.webrtc_policy_disable_non_proxied_udp)); ++ ++ mSettingRadioButton = mButtons.get(mSetting); ++ mSettingRadioButton.setChecked(true); ++ } ++ ++ @Override ++ @SuppressLint("WrongConstant") ++ public void onCheckedChanged(RadioGroup group, int checkedId) { ++ for (int i = 0; i < WebRtcPolicy.NUM_ENTRIES; i++) { ++ if (mButtons.get(i).isChecked()) { ++ mSetting = i; ++ mSettingRadioButton = mButtons.get(i); ++ break; ++ } ++ } ++ assert mSetting >= 0 && mSetting < WebRtcPolicy.NUM_ENTRIES : "No matching setting found."; ++ ++ callChangeListener(mSetting); ++ } ++} +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicySettings.java +new file mode 100644 +index 0000000000000..5ee1893382254 +--- /dev/null ++++ b/chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicySettings.java +@@ -0,0 +1,58 @@ ++/* Copyright (c) 2021 The Brave Authors. All rights reserved. ++ * This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this file, ++ * You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++package org.chromium.chrome.browser.webrtc.settings; ++ ++import android.content.Context; ++import android.content.Intent; ++import android.net.Uri; ++import android.os.Build; ++import android.os.Bundle; ++import android.provider.Browser; ++import android.view.Menu; ++import android.view.MenuInflater; ++import android.view.MenuItem; ++ ++import androidx.annotation.Nullable; ++import androidx.preference.PreferenceFragmentCompat; ++ ++import org.chromium.chrome.R; ++import org.chromium.components.browser_ui.settings.SettingsUtils; ++import org.chromium.ui.UiUtils; ++ ++public class WebRtcPolicySettings extends PreferenceFragmentCompat { ++ static final String PREF_WEBRTC_POLICY = "webrtc_policy"; ++ ++ @Override ++ public void onCreatePreferences(@Nullable Bundle savedInstanceState, String rootKey) { ++ SettingsUtils.addPreferencesFromResource(this, R.xml.webrtc_policy_preferences); ++ getActivity().setTitle(R.string.webrtc_policy_title); ++ ++ WebRtcPolicyPreference webRtcPolicyPreference = ++ (WebRtcPolicyPreference) findPreference(PREF_WEBRTC_POLICY); ++ webRtcPolicyPreference.initialize(WebRtcPolicyUtils.getPolicy()); ++ ++ webRtcPolicyPreference.setOnPreferenceChangeListener((preference, newValue) -> { ++ WebRtcPolicyUtils.setPolicy((int) newValue); ++ return true; ++ }); ++ } ++ ++ public static String getWebRtcPolicySummaryString(Context context) { ++ return WebRtcPolicyUtils.getSummary(context); ++ } ++ ++ @Override ++ public void onActivityCreated(Bundle savedInstanceState) { ++ super.onActivityCreated(savedInstanceState); ++ ++ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.O_MR1) { ++ UiUtils.setNavigationBarIconColor(getActivity().getWindow().getDecorView(), ++ getResources().getBoolean(R.bool.window_light_navigation_bar)); ++ } ++ ++ setDivider(null); ++ } ++} +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicyUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicyUtils.java +new file mode 100644 +index 0000000000000..296e59fc57167 +--- /dev/null ++++ b/chrome/android/java/src/org/chromium/chrome/browser/webrtc/settings/WebRtcPolicyUtils.java +@@ -0,0 +1,92 @@ ++// Copyright 2023 GrapheneOS ++// Use of this source code is governed by a GPLv2 only-style license that can be ++// found in the LICENSE file. ++ ++package org.chromium.chrome.browser.webrtc.settings; ++ ++import android.content.Context; ++ ++import org.chromium.chrome.R; ++import org.chromium.chrome.browser.preferences.Pref; ++import org.chromium.chrome.browser.profiles.Profile; ++import org.chromium.chrome.browser.webrtc.settings.WebRtcPolicyPreference.WebRtcPolicy; ++import org.chromium.components.user_prefs.UserPrefs; ++ ++/** ++ * Utility class for fetching and converting native pref value for WebRTC ++ * policy to Java int equivalent and its corresponding description. ++ */ ++class WebRtcPolicyUtils { ++ // Pref values mirrored in Java, copied from ++ // third_party/blink/common/peerconnection/webrtc_ip_handling_policy.cc ++ private static final String WEBRTC_DEFAULT = "default"; ++ private static final String WEBRTC_DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES = ++ "default_public_and_private_interfaces"; ++ private static final String WEBRTC_DEFAULT_PUBLIC_INTERFACE_ONLY = ++ "default_public_interface_only"; ++ private static final String WEBRTC_DISABLE_NON_PROXIED_UDP = ++ "disable_non_proxied_udp"; ++ ++ static String getSummary(Context context) { ++ switch (convertToWebRtcPolicyInt(getPolicyFromNative())) { ++ case WebRtcPolicy.DEFAULT: ++ return context.getString(R.string.webrtc_policy_default); ++ case WebRtcPolicy.DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES: ++ return context.getString( ++ R.string.webrtc_policy_default_public_and_private_interfaces); ++ case WebRtcPolicy.DEFAULT_PUBLIC_INTERFACE_ONLY: ++ return context.getString(R.string.webrtc_policy_default_public_interface_only); ++ case WebRtcPolicy.DISABLE_NON_PROXIED_UDP: ++ return context.getString(R.string.webrtc_policy_disable_non_proxied_udp); ++ default: ++ assert false; ++ return ""; ++ } ++ } ++ ++ static String convertToWebRtcPolicyString(@WebRtcPolicy int policy) { ++ switch (policy) { ++ case WebRtcPolicy.DEFAULT: ++ return WEBRTC_DEFAULT; ++ case WebRtcPolicy.DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES: ++ return WEBRTC_DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES; ++ case WebRtcPolicy.DEFAULT_PUBLIC_INTERFACE_ONLY: ++ return WEBRTC_DEFAULT_PUBLIC_INTERFACE_ONLY; ++ case WebRtcPolicy.DISABLE_NON_PROXIED_UDP: ++ return WEBRTC_DISABLE_NON_PROXIED_UDP; ++ default: ++ return WEBRTC_DISABLE_NON_PROXIED_UDP; ++ } ++ } ++ ++ static @WebRtcPolicy int convertToWebRtcPolicyInt(String value) { ++ switch (value) { ++ case WEBRTC_DEFAULT: ++ return WebRtcPolicy.DEFAULT; ++ case WEBRTC_DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES: ++ return WebRtcPolicy.DEFAULT_PUBLIC_AND_PRIVATE_INTERFACES; ++ case WEBRTC_DEFAULT_PUBLIC_INTERFACE_ONLY: ++ return WebRtcPolicy.DEFAULT_PUBLIC_INTERFACE_ONLY; ++ case WEBRTC_DISABLE_NON_PROXIED_UDP: ++ return WebRtcPolicy.DISABLE_NON_PROXIED_UDP; ++ default: ++ return WebRtcPolicy.DISABLE_NON_PROXIED_UDP; ++ } ++ } ++ ++ private static String getPolicyFromNative() { ++ return UserPrefs.get(Profile.getLastUsedRegularProfile()) ++ .getString(Pref.WEB_RTCIP_HANDLING_POLICY); ++ } ++ ++ static @WebRtcPolicy int getPolicy() { ++ return convertToWebRtcPolicyInt(getPolicyFromNative()); ++ } ++ ++ static void setPolicy(@WebRtcPolicy int policy) { ++ UserPrefs.get(Profile.getLastUsedRegularProfile()) ++ .setString(Pref.WEB_RTCIP_HANDLING_POLICY, convertToWebRtcPolicyString(policy)); ++ } ++ ++ private WebRtcPolicyUtils() {} ++} +diff --git a/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp b/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp +index 52b9ca2042bee..11457f2fbc577 100644 +--- a/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp ++++ b/chrome/browser/ui/android/strings/android_chrome_ext_strings.grdp +@@ -15,4 +15,20 @@ + + Open links navigated by external apps in incognito tabs + ++ ++ ++ WebRTC IP handling policy ++ ++ ++ Default ++ ++ ++ Default public and private interfaces ++ ++ ++ Default public interface only ++ ++ ++ Disable non-proxied UDP ++ + diff --git a/patches/0001-Vanadium/0091-Handle-web-search-action-in-browser.patch b/patches/0001-Vanadium/0091-Handle-web-search-action-in-browser.patch new file mode 100644 index 0000000..d084bf8 --- /dev/null +++ b/patches/0001-Vanadium/0091-Handle-web-search-action-in-browser.patch @@ -0,0 +1,73 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Wed, 28 Sep 2022 05:37:00 +0200 +Subject: [PATCH] Handle web search action in browser + +--- + .../src/org/chromium/base/PackageManagerUtils.java | 10 ++++++++++ + chrome/android/java/AndroidManifest.xml | 4 ++++ + .../src/org/chromium/chrome/browser/IntentHandler.java | 1 + + .../chrome/browser/LaunchIntentDispatcher.java | 2 +- + 4 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/base/android/java/src/org/chromium/base/PackageManagerUtils.java b/base/android/java/src/org/chromium/base/PackageManagerUtils.java +index 2d1661ee534f6..2c983646ab42b 100644 +--- a/base/android/java/src/org/chromium/base/PackageManagerUtils.java ++++ b/base/android/java/src/org/chromium/base/PackageManagerUtils.java +@@ -85,6 +85,16 @@ public class PackageManagerUtils { + return canResolveActivity(intent, 0); + } + ++ public static boolean canOnlyOthersResolveActivity(Intent intent, int flags) { ++ for (ResolveInfo ri: queryIntentActivities(intent, flags)) { ++ if (ContextUtils.getApplicationContext() ++ .getPackageName().equals(ri.activityInfo.packageName)) { ++ return false; ++ } ++ } ++ return true; ++ } ++ + /** + * @return Intent to query a list of installed home launchers. + */ +diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml +index db72fb7356e29..575050c5c0d06 100644 +--- a/chrome/android/java/AndroidManifest.xml ++++ b/chrome/android/java/AndroidManifest.xml +@@ -345,6 +345,10 @@ by a child template that "extends" this file. + + + ++ # DOWNSTREAM ++ ++ ++ # DOWNSTREAM + + + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java +index 3647020cb02d8..da7ad2c4a09ac 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/IntentHandler.java +@@ -768,6 +768,7 @@ public class IntentHandler { + String query = null; + final String action = intent.getAction(); + if (Intent.ACTION_SEARCH.equals(action) ++ || Intent.ACTION_WEB_SEARCH.equals(action) + || MediaStore.INTENT_ACTION_MEDIA_SEARCH.equals(action)) { + query = IntentUtils.safeGetStringExtra(intent, SearchManager.QUERY); + } +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java +index aa44a679bee3c..e75c14b279c33 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java +@@ -211,7 +211,7 @@ public class LaunchIntentDispatcher implements IntentHandler.IntentHandlerDelega + searchIntent.putExtra(SearchManager.QUERY, query); + + try (StrictModeContext ignored = StrictModeContext.allowDiskReads()) { +- if (PackageManagerUtils.canResolveActivity( ++ if (PackageManagerUtils.canOnlyOthersResolveActivity( + searchIntent, PackageManager.GET_RESOLVED_FILTER)) { + mActivity.startActivity(searchIntent); + } else { diff --git a/patches/0001-Vanadium/0092-Support-opening-external-web-search-in-incognito.patch b/patches/0001-Vanadium/0092-Support-opening-external-web-search-in-incognito.patch new file mode 100644 index 0000000..1ce6fa7 --- /dev/null +++ b/patches/0001-Vanadium/0092-Support-opening-external-web-search-in-incognito.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Sat, 3 Sep 2022 08:15:59 +0200 +Subject: [PATCH] Support opening external web search in incognito + +--- + .../chromium/chrome/browser/searchwidget/SearchActivity.java | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java +index 9a426bfdd7843..9a0615f63674e 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java +@@ -32,6 +32,7 @@ import org.chromium.base.supplier.UnownedUserDataSupplier; + import org.chromium.blink.mojom.DisplayMode; + import org.chromium.chrome.R; + import org.chromium.chrome.browser.IntentHandler; ++import org.chromium.chrome.browser.TabPreferencesUtils; + import org.chromium.chrome.browser.WebContentsFactory; + import org.chromium.chrome.browser.app.omnibox.ActionChipsDelegateImpl; + import org.chromium.chrome.browser.app.tabmodel.TabWindowManagerSingleton; +@@ -532,6 +533,8 @@ public class SearchActivity extends AsyncInitializationActivity + } + if (isFromSearchWidget()) { + intent.putExtra(SearchWidgetProvider.EXTRA_FROM_SEARCH_WIDGET, true); ++ } else if (TabPreferencesUtils.shouldOpenLinksInIncognito()) { ++ intent = TabPreferencesUtils.appendNeededIncognitoExtras(this, intent); + } + intent.putExtra(EXTRA_FROM_SEARCH_ACTIVITY, true); + IntentUtils.addTrustedIntentExtras(intent); diff --git a/patches/0001-Vanadium/0094-Enable-reduce-accept-language-header-by-default.patch b/patches/0001-Vanadium/0094-Enable-reduce-accept-language-header-by-default.patch new file mode 100644 index 0000000..193e35a --- /dev/null +++ b/patches/0001-Vanadium/0094-Enable-reduce-accept-language-header-by-default.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Tue, 14 Feb 2023 21:35:28 +0000 +Subject: [PATCH] Enable reduce accept language header by default + +--- + services/network/public/cpp/features.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc +index 61deb8a280354..8e7774854f015 100644 +--- a/services/network/public/cpp/features.cc ++++ b/services/network/public/cpp/features.cc +@@ -301,7 +301,7 @@ constexpr base::FeatureParam kCacheTransparencyPervasivePayloads{ + // accept-language. https://github.com/Tanych/accept-language + BASE_FEATURE(kReduceAcceptLanguage, + "ReduceAcceptLanguage", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + const base::FeatureParam kReduceAcceptLanguageCacheDuration{ + &kReduceAcceptLanguage, "reduce-accept-language-cache-duration", diff --git a/patches/0001-Vanadium/0095-Add-missing-null-check-for-password-manager-autofill.patch b/patches/0001-Vanadium/0095-Add-missing-null-check-for-password-manager-autofill.patch new file mode 100644 index 0000000..ecdb1a5 --- /dev/null +++ b/patches/0001-Vanadium/0095-Add-missing-null-check-for-password-manager-autofill.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Mon, 20 Feb 2023 07:06:53 +0000 +Subject: [PATCH] Add missing null check for password manager autofill + +--- + .../autofill/content/renderer/password_autofill_agent.cc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc +index 82d26af673fa8..f1877135d198a 100644 +--- a/components/autofill/content/renderer/password_autofill_agent.cc ++++ b/components/autofill/content/renderer/password_autofill_agent.cc +@@ -778,7 +778,10 @@ void PasswordAutofillAgent::UpdateStateForTextChange( + + void PasswordAutofillAgent::TrackAutofilledElement( + const blink::WebFormControlElement& element) { +- autofill_agent_->TrackAutofilledElement(element); ++ AutofillAgent* agent = autofill_agent_.get(); ++ if (agent) { ++ agent->TrackAutofilledElement(element); ++ } + } + + bool PasswordAutofillAgent::FillSuggestion( diff --git a/patches/0001-Vanadium/0096-Drop-workaround-with-android-autofill-in-compatibili.patch b/patches/0001-Vanadium/0096-Drop-workaround-with-android-autofill-in-compatibili.patch new file mode 100644 index 0000000..890f333 --- /dev/null +++ b/patches/0001-Vanadium/0096-Drop-workaround-with-android-autofill-in-compatibili.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Fri, 24 Feb 2023 10:20:37 +0100 +Subject: [PATCH] Drop workaround with android autofill in compatibility mode + +This causes the autofill popup to show when url is tapped. Drop in favor +of native android autofill support compatibility with other autofill +implementations. +--- + .../java/src/org/chromium/chrome/browser/omnibox/UrlBar.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java +index c03bff1721bf9..a6ac07dc01f67 100644 +--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java ++++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java +@@ -408,7 +408,7 @@ public abstract class UrlBar extends AutocompleteEditText { + // the domain changes. We restore this behavior by mimicking the relevant part of + // TextView.notifyListeningManagersAfterTextChanged(). + // https://cs.android.com/android/platform/superproject/+/5d123b67756dffcfdebdb936ab2de2b29c799321:frameworks/base/core/java/android/widget/TextView.java;l=10618;drc=master;bpv=0 +- ApiHelperForO.notifyValueChangedForAutofill(this); ++ //ApiHelperForO.notifyValueChangedForAutofill(this); + } + } + diff --git a/patches/0001-Vanadium/0097-Enable-android-autofill-on-http-authentication-dialo.patch b/patches/0001-Vanadium/0097-Enable-android-autofill-on-http-authentication-dialo.patch new file mode 100644 index 0000000..10c543c --- /dev/null +++ b/patches/0001-Vanadium/0097-Enable-android-autofill-on-http-authentication-dialo.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Mon, 20 Feb 2023 07:10:30 +0000 +Subject: [PATCH] Enable android autofill on http authentication dialog + +--- + .../chromium/chrome/browser/login/ChromeHttpAuthHandler.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/login/ChromeHttpAuthHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/login/ChromeHttpAuthHandler.java +index 3b87576c9ed6b..a97f7cff21c49 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/login/ChromeHttpAuthHandler.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/login/ChromeHttpAuthHandler.java +@@ -102,7 +102,7 @@ public class ChromeHttpAuthHandler extends EmptyTabObserver implements LoginProm + mTab.addObserver(this); + String messageBody = ChromeHttpAuthHandlerJni.get().getMessageBody( + mNativeChromeHttpAuthHandler, ChromeHttpAuthHandler.this); +- mLoginPrompt = new LoginPrompt(activity, messageBody, null, this); ++ mLoginPrompt = new LoginPrompt(activity, messageBody, tab.getOriginalUrl(), this); + // In case the autofill data arrives before the prompt is created. + if (mAutofillUsername != null && mAutofillPassword != null) { + mLoginPrompt.onAutofillDataAvailable(mAutofillUsername, mAutofillPassword); diff --git a/patches/0001-Vanadium/0098-Enable-new-password-manager-autofill-UI-by-default.patch b/patches/0001-Vanadium/0098-Enable-new-password-manager-autofill-UI-by-default.patch new file mode 100644 index 0000000..f1a4e6d --- /dev/null +++ b/patches/0001-Vanadium/0098-Enable-new-password-manager-autofill-UI-by-default.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Mon, 20 Feb 2023 07:07:52 +0000 +Subject: [PATCH] Enable new password manager autofill UI by default + +This instead uses a keyboard accessory on top of virutal keyboard to +avoid UX issues of drop-down suggestions obscuring other dialogs, such +as switching keyboard +--- + components/autofill/core/common/autofill_features.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/autofill/core/common/autofill_features.cc b/components/autofill/core/common/autofill_features.cc +index 2246179592da9..db8549d0ea31a 100644 +--- a/components/autofill/core/common/autofill_features.cc ++++ b/components/autofill/core/common/autofill_features.cc +@@ -611,7 +611,7 @@ BASE_FEATURE(kAutofillVirtualCardsOnTouchToFillAndroid, + // instead of the regular popup. + BASE_FEATURE(kAutofillKeyboardAccessory, + "AutofillKeyboardAccessory", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ base::FEATURE_ENABLED_BY_DEFAULT); + + // Controls whether the Autofill manual fallback for Addresses and Payments is + // present on Android. diff --git a/patches/0001-Vanadium/0099-Support-both-password-manager-and-android-autofill-f.patch b/patches/0001-Vanadium/0099-Support-both-password-manager-and-android-autofill-f.patch new file mode 100644 index 0000000..f8d56e5 --- /dev/null +++ b/patches/0001-Vanadium/0099-Support-both-password-manager-and-android-autofill-f.patch @@ -0,0 +1,76 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Mon, 20 Feb 2023 07:06:53 +0000 +Subject: [PATCH] Support both password manager and android autofill + functionality + +--- + .../autofill/content/renderer/autofill_agent.cc | 2 -- + .../content/renderer/password_autofill_agent.cc | 9 --------- + .../core/browser/browser_autofill_manager.cc | 13 +++++++++++++ + 3 files changed, 13 insertions(+), 11 deletions(-) + +diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc +index a663c48414a08..dc752712b1cb5 100644 +--- a/components/autofill/content/renderer/autofill_agent.cc ++++ b/components/autofill/content/renderer/autofill_agent.cc +@@ -509,7 +509,6 @@ void AutofillAgent::OnTextFieldDidChange(const WebInputElement& element) { + if (password_autofill_agent_->TextDidChangeInTextField(element)) { + is_popup_possibly_visible_ = true; + element_ = element; +- return; + } + + ShowSuggestions(element, {.requires_caret_at_end = true}); +@@ -878,7 +877,6 @@ void AutofillAgent::ShowSuggestions(const WebFormControlElement& element, + input_element, ShowAll(options.show_full_suggestion_list), + GenerationShowing(is_generation_popup_possibly_visible_))) { + is_popup_possibly_visible_ = true; +- return; + } + + if (is_generation_popup_possibly_visible_) +diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc +index f1877135d198a..f0e623b9cf9d2 100644 +--- a/components/autofill/content/renderer/password_autofill_agent.cc ++++ b/components/autofill/content/renderer/password_autofill_agent.cc +@@ -1102,15 +1102,6 @@ bool PasswordAutofillAgent::ShowSuggestions( + if (generation_popup_showing) + return false; + +-#if BUILDFLAG(IS_ANDROID) +- // Don't call ShowSuggestionPopup if Touch To Fill is currently showing. Since +- // Touch To Fill in spirit is very similar to a suggestion pop-up, return true +- // so that the AutofillAgent does not try to show other autofill suggestions +- // instead. +- if (touch_to_fill_state_ == TouchToFillState::kIsShowing) +- return true; +-#endif +- + if (!HasDocumentWithValidFrame(element)) + return false; + +diff --git a/components/autofill/core/browser/browser_autofill_manager.cc b/components/autofill/core/browser/browser_autofill_manager.cc +index b89394fa35f3d..73776acad6ae0 100644 +--- a/components/autofill/core/browser/browser_autofill_manager.cc ++++ b/components/autofill/core/browser/browser_autofill_manager.cc +@@ -1107,6 +1107,19 @@ void BrowserAutofillManager::OnAskForValuesToFillImpl( + return; + } + ++ if (AutofillField* _autofill_field = GetAutofillField(form, field)) { ++ switch (_autofill_field->Type().group()) { ++ // Do not override password manager prompt on these fields ++ case FieldTypeGroup::kNoGroup: ++ case FieldTypeGroup::kPasswordField: ++ case FieldTypeGroup::kUsernameField: ++ case FieldTypeGroup::kEmail: ++ return; ++ default: ++ break; ++ } ++ } ++ + SetDataList(field.datalist_values, field.datalist_labels); + external_delegate_->OnQuery(form, field, transformed_box); + diff --git a/patches/0001-Vanadium/0100-Support-for-both-browser-and-android-autofill-functi.patch b/patches/0001-Vanadium/0100-Support-for-both-browser-and-android-autofill-functi.patch new file mode 100644 index 0000000..9d6baf9 --- /dev/null +++ b/patches/0001-Vanadium/0100-Support-for-both-browser-and-android-autofill-functi.patch @@ -0,0 +1,230 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Tue, 21 Feb 2023 01:48:15 +0000 +Subject: [PATCH] Support for both browser and android autofill functionality + +--- + .../browser/android_autofill_manager.cc | 15 +++++++ + .../browser/android_autofill_manager.h | 15 +++++++ + .../browser/content_autofill_driver.cc | 42 +++++++++++++++++++ + .../content/browser/content_autofill_driver.h | 12 ++++++ + 4 files changed, 84 insertions(+) + +diff --git a/components/android_autofill/browser/android_autofill_manager.cc b/components/android_autofill/browser/android_autofill_manager.cc +index 60b056e7e22d9..4101639a5649e 100644 +--- a/components/android_autofill/browser/android_autofill_manager.cc ++++ b/components/android_autofill/browser/android_autofill_manager.cc +@@ -9,6 +9,7 @@ + #include "components/android_autofill/browser/autofill_provider.h" + #include "components/autofill/content/browser/content_autofill_driver.h" + #include "components/autofill/core/browser/metrics/form_events/form_event_logger_weblayer_android.h" ++#include "components/autofill/core/browser/browser_autofill_manager.h" + #include "content/public/browser/render_frame_host.h" + #include "content/public/browser/web_contents.h" + +@@ -26,6 +27,20 @@ void AndroidDriverInitHook(AutofillClient* client, + driver->GetAutofillAgent()->SetQueryPasswordSuggestion(true); + } + ++void AndroidAndBrowserDriverInitHook( ++ AutofillClient* client, ++ const std::string& app_locale, ++ ContentAutofillDriver* driver) { ++ driver->set_autofill_manager(std::make_unique( ++ driver, client, app_locale)); ++ driver->set_secondary_autofill_manager(base::WrapUnique( ++ new AndroidAutofillManager(driver, client))); ++ driver->GetAutofillAgent()->SetUserGestureRequired(false); ++ driver->GetAutofillAgent()->SetSecureContextRequired(true); ++ driver->GetAutofillAgent()->SetFocusRequiresScroll(false); ++ driver->GetAutofillAgent()->SetQueryPasswordSuggestion(true); ++} ++ + AndroidAutofillManager::AndroidAutofillManager(AutofillDriver* driver, + AutofillClient* client) + : AutofillManager(driver, client) { +diff --git a/components/android_autofill/browser/android_autofill_manager.h b/components/android_autofill/browser/android_autofill_manager.h +index 179b2b47464e0..dd8af3166841a 100644 +--- a/components/android_autofill/browser/android_autofill_manager.h ++++ b/components/android_autofill/browser/android_autofill_manager.h +@@ -16,6 +16,16 @@ class AutofillProvider; + class ContentAutofillDriver; + class FormEventLoggerWeblayerAndroid; + ++// Creates an AndroidAutofillManager and attaches it to the `driver`. ++// ++// This hook is to be passed to CreateForWebContentsAndDelegate(). ++// It is the glue between ContentAutofillDriver[Factory] and ++// AndroidAutofillManager, BrowserAutofillManager. ++void AndroidAndBrowserDriverInitHook( ++ AutofillClient* client, ++ const std::string& app_locale, ++ ContentAutofillDriver* driver); ++ + // Creates an AndroidAutofillManager and attaches it to the `driver`. + // + // This hook is to be passed to CreateForWebContentsAndDelegate(). +@@ -86,6 +96,11 @@ class AndroidAutofillManager : public AutofillManager { + const url::Origin& triggered_origin); + + protected: ++ friend void AndroidAndBrowserDriverInitHook( ++ AutofillClient* client, ++ const std::string& app_locale, ++ ContentAutofillDriver* driver); ++ + friend void AndroidDriverInitHook(AutofillClient* client, + ContentAutofillDriver* driver); + +diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc +index 00b0f300a0748..0f9287246a098 100644 +--- a/components/autofill/content/browser/content_autofill_driver.cc ++++ b/components/autofill/content/browser/content_autofill_driver.cc +@@ -336,6 +336,10 @@ void ContentAutofillDriver::FormsSeen( + const std::vector& removed_forms) { + target->autofill_manager_->OnFormsSeen(WithNewVersion(updated_forms), + removed_forms); ++ if (target->secondary_autofill_manager_) { ++ target->secondary_autofill_manager_->OnFormsSeen(WithNewVersion(updated_forms), ++ removed_forms); ++ } + }); + } + +@@ -362,6 +366,10 @@ void ContentAutofillDriver::FormSubmitted( + } + target->autofill_manager_->OnFormSubmitted( + WithNewVersion(form), known_success, submission_source); ++ if (target->secondary_autofill_manager_) { ++ target->secondary_autofill_manager_->OnFormSubmitted( ++ WithNewVersion(form), known_success, submission_source); ++ } + }); + } + +@@ -382,6 +390,10 @@ void ContentAutofillDriver::TextFieldDidChange(const FormData& raw_form, + base::TimeTicks timestamp) { + target->autofill_manager_->OnTextFieldDidChange( + WithNewVersion(form), field, bounding_box, timestamp); ++ if (target->secondary_autofill_manager_) { ++ target->secondary_autofill_manager_->OnTextFieldDidChange( ++ WithNewVersion(form), field, bounding_box, timestamp); ++ } + }); + } + +@@ -400,6 +412,10 @@ void ContentAutofillDriver::TextFieldDidScroll(const FormData& raw_form, + const FormFieldData& field, const gfx::RectF& bounding_box) { + target->autofill_manager_->OnTextFieldDidScroll(WithNewVersion(form), + field, bounding_box); ++ if (target->secondary_autofill_manager_) { ++ target->secondary_autofill_manager_->OnTextFieldDidScroll(WithNewVersion(form), ++ field, bounding_box); ++ } + }); + } + +@@ -419,6 +435,10 @@ void ContentAutofillDriver::SelectControlDidChange( + const FormFieldData& field, const gfx::RectF& bounding_box) { + target->autofill_manager_->OnSelectControlDidChange( + WithNewVersion(form), field, bounding_box); ++ if (target->secondary_autofill_manager_) { ++ target->autofill_manager_->OnSelectControlDidChange( ++ WithNewVersion(form), field, bounding_box); ++ } + }); + } + +@@ -444,6 +464,11 @@ void ContentAutofillDriver::AskForValuesToFill( + target->autofill_manager_->OnAskForValuesToFill( + WithNewVersion(form), field, bounding_box, + autoselect_first_suggestion, form_element_was_clicked); ++ if (target->secondary_autofill_manager_) { ++ target->secondary_autofill_manager_->OnAskForValuesToFill( ++ WithNewVersion(form), field, bounding_box, ++ autoselect_first_suggestion, form_element_was_clicked); ++ } + }); + } + +@@ -454,12 +479,18 @@ void ContentAutofillDriver::HidePopup() { + DCHECK(!target->IsPrerendering()) + << "We should never affect UI while prerendering"; + target->autofill_manager_->OnHidePopup(); ++ if (target->secondary_autofill_manager_) { ++ target->secondary_autofill_manager_->OnHidePopup(); ++ } + }); + } + + void ContentAutofillDriver::FocusNoLongerOnFormCallback( + bool had_interacted_form) { + autofill_manager_->OnFocusNoLongerOnForm(had_interacted_form); ++ if (secondary_autofill_manager_) { ++ secondary_autofill_manager_->OnFocusNoLongerOnForm(had_interacted_form); ++ } + } + + void ContentAutofillDriver::FocusNoLongerOnForm(bool had_interacted_form) { +@@ -487,6 +518,10 @@ void ContentAutofillDriver::FocusOnFormField(const FormData& raw_form, + const FormFieldData& field, const gfx::RectF& bounding_box) { + target->autofill_manager_->OnFocusOnFormField(WithNewVersion(form), + field, bounding_box); ++ if (target->secondary_autofill_manager_) { ++ target->secondary_autofill_manager_->OnFocusOnFormField(WithNewVersion(form), ++ field, bounding_box); ++ } + }); + } + +@@ -500,6 +535,10 @@ void ContentAutofillDriver::DidFillAutofillFormData(const FormData& raw_form, + base::TimeTicks timestamp) { + target->autofill_manager_->OnDidFillAutofillFormData( + WithNewVersion(form), timestamp); ++ if (target->secondary_autofill_manager_) { ++ target->secondary_autofill_manager_->OnDidFillAutofillFormData( ++ WithNewVersion(form), timestamp); ++ } + }); + } + +@@ -575,6 +614,9 @@ void ContentAutofillDriver::Reset() { + submitted_forms_.clear(); + autofill_router_->UnregisterDriver(this); + autofill_manager_->Reset(); ++ if (secondary_autofill_manager_) { ++ secondary_autofill_manager_->Reset(); ++ } + } + + const mojo::AssociatedRemote& +diff --git a/components/autofill/content/browser/content_autofill_driver.h b/components/autofill/content/browser/content_autofill_driver.h +index 65d6e43b5e017..bfae54ada1006 100644 +--- a/components/autofill/content/browser/content_autofill_driver.h ++++ b/components/autofill/content/browser/content_autofill_driver.h +@@ -130,6 +130,14 @@ class ContentAutofillDriver : public AutofillDriver, + } + AutofillManager* autofill_manager() { return autofill_manager_.get(); } + ++ void set_secondary_autofill_manager( ++ std::unique_ptr secondary_autofill_manager) { ++ secondary_autofill_manager_ = std::move(secondary_autofill_manager); ++ } ++ AutofillManager* secondary_autofill_manager() { ++ return secondary_autofill_manager_.get(); ++ } ++ + content::RenderFrameHost* render_frame_host() { return render_frame_host_; } + + // Expose the events that originate from the browser and renderer processes, +@@ -343,6 +351,10 @@ class ContentAutofillDriver : public AutofillDriver, + // code. + std::unique_ptr autofill_manager_ = nullptr; + ++ // adds a reference for AndroidAutofillManager, since native autofill works in ++ // conjunction with browser autofill ++ std::unique_ptr secondary_autofill_manager_ = nullptr; ++ + content::RenderWidgetHost::KeyPressEventCallback key_press_handler_; + + mojo::AssociatedReceiver receiver_{this}; diff --git a/patches/0001-Vanadium/0101-Support-native-Android-autofill-at-browser.patch b/patches/0001-Vanadium/0101-Support-native-Android-autofill-at-browser.patch new file mode 100644 index 0000000..bdde4ff --- /dev/null +++ b/patches/0001-Vanadium/0101-Support-native-Android-autofill-at-browser.patch @@ -0,0 +1,379 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Mon, 20 Feb 2023 07:10:55 +0000 +Subject: [PATCH] Support native Android autofill at browser + +This enables support for Android Autofil on tabs showing fillable +entries, reusing the codebase used for webview's android autofill +support. +--- + android_webview/browser/aw_autofill_client.cc | 4 ++ + chrome/android/BUILD.gn | 1 + + .../chromium/chrome/browser/tab/TabImpl.java | 45 +++++++++++++++++ + .../browser/tab/TabViewAndroidDelegate.java | 13 +++++ + chrome/browser/BUILD.gn | 7 +++ + .../ui/autofill/chrome_autofill_client.cc | 14 +++++- + .../embedder_support/view/ContentView.java | 48 +++++++++++++++++++ + .../chromium/ui/base/ViewAndroidDelegate.java | 8 ++++ + 8 files changed, 139 insertions(+), 1 deletion(-) + +diff --git a/android_webview/browser/aw_autofill_client.cc b/android_webview/browser/aw_autofill_client.cc +index 7dd21f8202f9f..889bf90b7821e 100644 +--- a/android_webview/browser/aw_autofill_client.cc ++++ b/android_webview/browser/aw_autofill_client.cc +@@ -83,6 +83,7 @@ AwAutofillClient::GetURLLoaderFactory() { + } + + autofill::AutofillDownloadManager* AwAutofillClient::GetDownloadManager() { ++#if defined(USE_BROWSER_AUTOFILL_ONLY) + if (autofill::AutofillProvider::is_download_manager_disabled_for_testing()) { + return nullptr; + } +@@ -92,6 +93,9 @@ autofill::AutofillDownloadManager* AwAutofillClient::GetDownloadManager() { + this, GetChannel(), GetLogManager()); + } + return download_manager_.get(); ++#else ++ return nullptr; ++#endif // defined(USE_BROWSER_AUTOFILL_ONLY) + } + + autofill::PersonalDataManager* AwAutofillClient::GetPersonalDataManager() { +diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn +index 4a4695c3d0119..47956c1f09e07 100644 +--- a/chrome/android/BUILD.gn ++++ b/chrome/android/BUILD.gn +@@ -351,6 +351,7 @@ if (current_toolchain == default_toolchain) { + "//chrome/browser/webapps/android:java", + "//chrome/browser/webauthn/android:java", + "//chrome/browser/xsurface:java", ++ "//components/android_autofill/browser:java", + "//components/autofill/android:autofill_java", + "//components/autofill/android:prefeditor_autofill_java", + "//components/background_task_scheduler:background_task_scheduler_java", +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java +index 84dee29291b42..baf0859ca7cf2 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabImpl.java +@@ -10,10 +10,14 @@ import android.annotation.SuppressLint; + import android.app.Activity; + import android.content.Context; + import android.graphics.Rect; ++import android.os.Build; + import android.text.TextUtils; ++import android.util.SparseArray; + import android.view.View; + import android.view.View.OnAttachStateChangeListener; ++import android.view.ViewStructure; + import android.view.accessibility.AccessibilityEvent; ++import android.view.autofill.AutofillValue; + + import androidx.annotation.Nullable; + import androidx.annotation.VisibleForTesting; +@@ -54,6 +58,8 @@ import org.chromium.chrome.browser.tab.state.CriticalPersistedTabData; + import org.chromium.chrome.browser.tab.state.SerializedCriticalPersistedTabData; + import org.chromium.chrome.browser.ui.native_page.FrozenNativePage; + import org.chromium.chrome.browser.ui.native_page.NativePage; ++import org.chromium.components.autofill.AutofillActionModeCallback; ++import org.chromium.components.autofill.AutofillProvider; + import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; + import org.chromium.components.embedder_support.util.UrlConstants; + import org.chromium.components.embedder_support.view.ContentView; +@@ -66,9 +72,11 @@ import org.chromium.components.version_info.VersionInfo; + import org.chromium.content_public.browser.ChildProcessImportance; + import org.chromium.content_public.browser.ContentFeatureList; + import org.chromium.content_public.browser.LoadUrlParams; ++import org.chromium.content_public.browser.SelectionPopupController; + import org.chromium.content_public.browser.WebContents; + import org.chromium.content_public.browser.WebContentsAccessibility; + import org.chromium.content_public.browser.navigation_controller.UserAgentOverrideOption; ++import org.chromium.ui.base.EventOffsetHandler; + import org.chromium.ui.base.PageTransition; + import org.chromium.ui.base.ViewAndroidDelegate; + import org.chromium.ui.base.WindowAndroid; +@@ -212,6 +220,7 @@ public class TabImpl implements Tab { + private int mThemeColor; + private boolean mUsedCriticalPersistedTabData; + private boolean mIsWebContentObscured; ++ AutofillProvider mAutofillProvider; + + /** + * Creates an instance of a {@link TabImpl}. +@@ -255,12 +264,18 @@ public class TabImpl implements Tab { + public void onViewAttachedToWindow(View view) { + mIsViewAttachedToWindow = true; + updateInteractableState(); ++ if (mAutofillProvider != null) { ++ mAutofillProvider.onContainerViewChanged(mContentView); ++ } + } + + @Override + public void onViewDetachedFromWindow(View view) { + mIsViewAttachedToWindow = false; + updateInteractableState(); ++ if (mAutofillProvider != null) { ++ mAutofillProvider.onContainerViewChanged(mContentView); ++ } + } + }; + mTabViewManager = new TabViewManagerImpl(this); +@@ -796,6 +811,11 @@ public class TabImpl implements Tab { + for (TabObserver observer : mObservers) observer.onDestroyed(this); + mObservers.clear(); + ++ if (mAutofillProvider != null) { ++ mAutofillProvider.destroy(); ++ mAutofillProvider = null; ++ } ++ + mUserDataHost.destroy(); + mTabViewManager.destroy(); + hideNativePage(false, null); +@@ -1393,6 +1413,18 @@ public class TabImpl implements Tab { + return tabsPtrArray; + } + ++ public void onProvideAutofillVirtualStructure(ViewStructure structure, int flags) { ++ if (mAutofillProvider != null) { ++ mAutofillProvider.onProvideAutoFillVirtualStructure(structure, flags); ++ } ++ } ++ ++ public void autofill(final SparseArray values) { ++ if (mAutofillProvider != null) { ++ mAutofillProvider.autofill(values); ++ } ++ } ++ + /** + * Initializes the {@link WebContents}. Completes the browser content components initialization + * around a native WebContents pointer. +@@ -1436,10 +1468,23 @@ public class TabImpl implements Tab { + mWebContentsDelegate = createWebContentsDelegate(); + + assert mNativeTabAndroid != 0; ++ SelectionPopupController selectionController = null; ++ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { ++ selectionController = SelectionPopupController.fromWebContents(mWebContents); ++ mAutofillProvider = new AutofillProvider( ++ getContext(), cv, webContents, "NativeAutofillRenderer"); ++ } + TabImplJni.get().initWebContents(mNativeTabAndroid, mIncognito, isDetached(this), + webContents, mWebContentsDelegate, + new TabContextMenuPopulatorFactory( + mDelegateFactory.createContextMenuPopulatorFactory(this), this)); ++ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && selectionController != null) { ++ mAutofillProvider.setWebContents(webContents); ++ cv.setWebContents(webContents); ++ selectionController.setNonSelectionActionModeCallback( ++ new AutofillActionModeCallback( ++ mThemedApplicationContext, mAutofillProvider)); ++ } + + mWebContents.notifyRendererPreferenceUpdate(); + TabHelpers.initWebContentsHelpers(this); +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabViewAndroidDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabViewAndroidDelegate.java +index aeb890d6fd459..df95505407cda 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabViewAndroidDelegate.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabViewAndroidDelegate.java +@@ -4,7 +4,10 @@ + + package org.chromium.chrome.browser.tab; + ++import android.util.SparseArray; + import android.view.ViewGroup; ++import android.view.ViewStructure; ++import android.view.autofill.AutofillValue; + + import androidx.annotation.Nullable; + import androidx.annotation.VisibleForTesting; +@@ -87,6 +90,16 @@ public class TabViewAndroidDelegate extends ViewAndroidDelegate { + mTab.onBackgroundColorChanged(color); + } + ++ @Override ++ public void onProvideAutofillVirtualStructure(ViewStructure structure, int flags) { ++ mTab.onProvideAutofillVirtualStructure(structure, flags); ++ } ++ ++ @Override ++ public void autofill(final SparseArray values) { ++ mTab.autofill(values); ++ } ++ + @Override + public void onTopControlsChanged( + int topControlsOffsetY, int contentOffsetY, int topControlsMinHeightOffsetY) { +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +index acf48b7ffd061..ef9200037fe05 100644 +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -2484,6 +2484,13 @@ static_library("browser") { + deps += [ "//chrome/browser/error_reporting" ] + } + ++ if (is_android) { ++ deps += [ ++ "//components/android_autofill/browser", ++ "//components/android_autofill/browser:android" ++ ] ++ } ++ + if (use_ozone) { + deps += [ + "//ui/events/ozone", +diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc +index 07663b4b2e793..dccf3ac3163dc 100644 +--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc ++++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc +@@ -53,6 +53,9 @@ + #include "chrome/browser/web_data_service_factory.h" + #include "chrome/common/channel_info.h" + #include "chrome/common/url_constants.h" ++#if BUILDFLAG(IS_ANDROID) ++#include "components/android_autofill/browser/android_autofill_manager.h" ++#endif // BUILDFLAG(IS_ANDROID) + #include "components/autofill/content/browser/autofill_log_router_factory.h" + #include "components/autofill/content/browser/content_autofill_driver.h" + #include "components/autofill/content/browser/content_autofill_driver_factory.h" +@@ -180,12 +183,16 @@ ChromeAutofillClient::GetURLLoaderFactory() { + } + + AutofillDownloadManager* ChromeAutofillClient::GetDownloadManager() { ++#if defined(USE_BROWSER_AUTOFILL_ONLY) + if (!download_manager_) { + // Lazy initialization to avoid virtual function calls in the constructor. + download_manager_ = std::make_unique( + this, GetChannel(), GetLogManager()); + } + return download_manager_.get(); ++#else ++ return nullptr; ++#endif // defined(USE_BROWSER_AUTOFILL_ONLY) + } + + AutofillOptimizationGuide* ChromeAutofillClient::GetAutofillOptimizationGuide() +@@ -1162,7 +1169,12 @@ void ChromeAutofillClient::OnZoomChanged( + ChromeAutofillClient::ChromeAutofillClient(content::WebContents* web_contents) + : ContentAutofillClient( + web_contents, +- base::BindRepeating(&BrowserDriverInitHook, ++ base::BindRepeating( ++#if BUILDFLAG(IS_ANDROID) ++ &AndroidAndBrowserDriverInitHook, ++#else ++ &BrowserDriverInitHook, ++#endif // BUILDFLAG(IS_ANDROID) + this, + g_browser_process->GetApplicationLocale())), + content::WebContentsObserver(web_contents), +diff --git a/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java b/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java +index 0e909aab3760a..58de87e58e3f1 100644 +--- a/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java ++++ b/components/embedder_support/android/java/src/org/chromium/components/embedder_support/view/ContentView.java +@@ -9,6 +9,7 @@ import android.content.res.Configuration; + import android.graphics.Rect; + import android.os.Build; + import android.os.Handler; ++import android.util.SparseArray; + import android.view.DragEvent; + import android.view.KeyEvent; + import android.view.MotionEvent; +@@ -18,6 +19,7 @@ import android.view.View.OnSystemUiVisibilityChangeListener; + import android.view.ViewGroup.OnHierarchyChangeListener; + import android.view.ViewStructure; + import android.view.accessibility.AccessibilityNodeProvider; ++import android.view.autofill.AutofillValue; + import android.view.inputmethod.EditorInfo; + import android.view.inputmethod.InputConnection; + import android.widget.FrameLayout; +@@ -37,6 +39,7 @@ import org.chromium.ui.accessibility.AccessibilityState; + import org.chromium.ui.base.EventForwarder; + import org.chromium.ui.base.EventOffsetHandler; + import org.chromium.ui.dragdrop.DragEventDispatchHelper.DragEventDispatchDestination; ++import org.chromium.ui.base.ViewAndroidDelegate; + + /** + * The containing view for {@link WebContents} that exists in the Android UI hierarchy and exposes +@@ -89,6 +92,9 @@ public class ContentView extends FrameLayout + */ + public static ContentView createContentView(Context context, + @Nullable EventOffsetHandler eventOffsetHandler, @Nullable WebContents webContents) { ++ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { ++ return new ContentViewWithAutofill(context, eventOffsetHandler, webContents); ++ } + return new ContentView(context, eventOffsetHandler, webContents); + } + +@@ -619,4 +625,46 @@ public class ContentView extends FrameLayout + mDragDropEventOffsetHandler.onPostDispatchDragEvent(event.getAction()); + return ret; + } ++ ++ /** ++ * API level 26 implementation that includes autofill. ++ */ ++ private static class ContentViewWithAutofill extends ContentView { ++ private ViewAndroidDelegate viewAndroidDelegate; ++ ++ private ContentViewWithAutofill( ++ Context context, EventOffsetHandler eventOffsetHandler, WebContents webContents) { ++ super(context, eventOffsetHandler, webContents); ++ ++ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { ++ // The Autofill system-level infrastructure has heuristics for which Views it ++ // considers important for autofill; only these Views will be queried for their ++ // autofill structure on notifications that a new (virtual) View was entered. By ++ // default, FrameLayout is not considered important for autofill. Thus, for ++ // ContentView to be queried for its autofill structure, we must explicitly inform ++ // the autofill system that this View is important for autofill. ++ setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_YES); ++ } ++ } ++ ++ @Override ++ public void setWebContents(WebContents webContents) { ++ viewAndroidDelegate = webContents.getViewAndroidDelegate(); ++ super.setWebContents(webContents); ++ } ++ ++ @Override ++ public void onProvideAutofillVirtualStructure(ViewStructure structure, int flags) { ++ if (viewAndroidDelegate != null) { ++ viewAndroidDelegate.onProvideAutofillVirtualStructure(structure, flags); ++ } ++ } ++ ++ @Override ++ public void autofill(final SparseArray values) { ++ if (viewAndroidDelegate != null) { ++ viewAndroidDelegate.autofill(values); ++ } ++ } ++ } + } +diff --git a/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java b/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java +index 454eb50e76104..849fdd41bca62 100644 +--- a/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java ++++ b/ui/android/java/src/org/chromium/ui/base/ViewAndroidDelegate.java +@@ -29,6 +29,10 @@ import org.chromium.ui.dragdrop.DragStateTracker; + import org.chromium.ui.dragdrop.DropDataAndroid; + import org.chromium.ui.mojom.CursorType; + ++import android.util.SparseArray; ++import android.view.autofill.AutofillValue; ++import android.view.ViewStructure; ++ + /** + * Class to acquire, position, and remove anchor views from the implementing View. + */ +@@ -620,4 +624,8 @@ public class ViewAndroidDelegate { + public static void setDragAndDropDelegateForTest(DragAndDropDelegate testDelegate) { + sDragAndDropTestDelegate = testDelegate; + } ++ ++ public void onProvideAutofillVirtualStructure(ViewStructure structure, int flags) {} ++ ++ public void autofill(final SparseArray values) {} + } diff --git a/patches/0001-Vanadium/0102-Disable-Play-services-dependent-password-manager-fea.patch b/patches/0001-Vanadium/0102-Disable-Play-services-dependent-password-manager-fea.patch new file mode 100644 index 0000000..88f1f92 --- /dev/null +++ b/patches/0001-Vanadium/0102-Disable-Play-services-dependent-password-manager-fea.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Tue, 21 Feb 2023 02:02:40 +0000 +Subject: [PATCH] Disable Play services dependent password manager feature by + default + +--- + .../password_manager/core/common/password_manager_features.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/password_manager/core/common/password_manager_features.cc b/components/password_manager/core/common/password_manager_features.cc +index dd18e63ae5fb0..77bcd13048d5d 100644 +--- a/components/password_manager/core/common/password_manager_features.cc ++++ b/components/password_manager/core/common/password_manager_features.cc +@@ -255,7 +255,7 @@ BASE_FEATURE(kUnifiedCredentialManagerDryRun, + // database will be unused but kept in sync for local passwords. + BASE_FEATURE(kUnifiedPasswordManagerAndroid, + "UnifiedPasswordManagerAndroid", +- base::FEATURE_ENABLED_BY_DEFAULT); ++ base::FEATURE_DISABLED_BY_DEFAULT); + + // Enables showing contextual error messages when UPM encounters an auth error. + BASE_FEATURE(kUnifiedPasswordManagerErrorMessages, diff --git a/patches/0001-Vanadium/0103-Disable-Play-services-dependent-password-manager-pre.patch b/patches/0001-Vanadium/0103-Disable-Play-services-dependent-password-manager-pre.patch new file mode 100644 index 0000000..5904d2a --- /dev/null +++ b/patches/0001-Vanadium/0103-Disable-Play-services-dependent-password-manager-pre.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Tue, 21 Feb 2023 02:06:16 +0000 +Subject: [PATCH] Disable Play services dependent password manager prefs by + default + +--- + components/password_manager/core/browser/password_manager.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc +index b926aa122adf2..abae7863e1aea 100644 +--- a/components/password_manager/core/browser/password_manager.cc ++++ b/components/password_manager/core/browser/password_manager.cc +@@ -307,9 +307,9 @@ void PasswordManager::RegisterProfilePrefs( + user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kPasswordsPrefWithNewLabelUsed, false); + #if BUILDFLAG(IS_ANDROID) +- registry->RegisterBooleanPref(prefs::kOfferToSavePasswordsEnabledGMS, true); ++ registry->RegisterBooleanPref(prefs::kOfferToSavePasswordsEnabledGMS, false); + registry->RegisterBooleanPref(prefs::kSavePasswordsSuspendedByError, false); +- registry->RegisterBooleanPref(prefs::kAutoSignInEnabledGMS, true); ++ registry->RegisterBooleanPref(prefs::kAutoSignInEnabledGMS, false); + registry->RegisterBooleanPref(prefs::kSettingsMigratedToUPM, false); + registry->RegisterIntegerPref( + prefs::kCurrentMigrationVersionToGoogleMobileServices, 0); diff --git a/patches/0001-Vanadium/0104-Use-local-list-of-supported-languages-for-Language-s.patch b/patches/0001-Vanadium/0104-Use-local-list-of-supported-languages-for-Language-s.patch new file mode 100644 index 0000000..2de6c3d --- /dev/null +++ b/patches/0001-Vanadium/0104-Use-local-list-of-supported-languages-for-Language-s.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Sat, 25 Feb 2023 05:11:12 +0100 +Subject: [PATCH] Use local list of supported languages for Language settings + +Disable requests or connections to fetch language list from server +--- + .../translate/core/browser/translate_language_list.cc | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/components/translate/core/browser/translate_language_list.cc b/components/translate/core/browser/translate_language_list.cc +index 577f2c9f4de00..e49dc937e60eb 100644 +--- a/components/translate/core/browser/translate_language_list.cc ++++ b/components/translate/core/browser/translate_language_list.cc +@@ -163,7 +163,7 @@ const char* const kDefaultSupportedLanguages[] = { + const char kLanguageListFetchPath[] = "translate_a/l?client=chrome"; + + // Represent if the language list updater is disabled. +-bool update_is_disabled = false; ++bool update_is_disabled = true; + + // Retry parameter for fetching. + const int kMaxRetryOn5xx = 5; +@@ -229,6 +229,10 @@ GURL TranslateLanguageList::TranslateLanguageUrl() { + } + + void TranslateLanguageList::RequestLanguageList() { ++ if (update_is_disabled) { ++ return; ++ } ++ + // If resource requests are not allowed, we'll get a callback when they are. + if (!resource_requests_allowed_) { + request_pending_ = true; diff --git a/patches/0001-Vanadium/0106-Remove-not-applicable-additional-terms-of-services.patch b/patches/0001-Vanadium/0106-Remove-not-applicable-additional-terms-of-services.patch new file mode 100644 index 0000000..77b8694 --- /dev/null +++ b/patches/0001-Vanadium/0106-Remove-not-applicable-additional-terms-of-services.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Wed, 19 Apr 2023 13:16:49 +0000 +Subject: [PATCH] Remove not applicable additional terms of services + +--- + chrome/android/java/res/xml/legal_information_preferences.xml | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/chrome/android/java/res/xml/legal_information_preferences.xml b/chrome/android/java/res/xml/legal_information_preferences.xml +index 32067c19d4f7a..e386dc0765491 100644 +--- a/chrome/android/java/res/xml/legal_information_preferences.xml ++++ b/chrome/android/java/res/xml/legal_information_preferences.xml +@@ -16,10 +16,6 @@ found in the LICENSE file. + android:key="google_terms_of_service" + android:title="@string/google_terms_of_service_title" + app:url="@string/google_terms_of_service_url" /> +- + +Date: Tue, 25 Apr 2023 04:53:22 -0400 +Subject: [PATCH] require HTTPS for component updates + +--- + .../component_updater/aw_component_updater_configurator.cc | 2 +- + .../component_updater/chrome_component_updater_configurator.cc | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/android_webview/nonembedded/component_updater/aw_component_updater_configurator.cc b/android_webview/nonembedded/component_updater/aw_component_updater_configurator.cc +index f0a64d0cdb6ef..66d2a98f0fddf 100644 +--- a/android_webview/nonembedded/component_updater/aw_component_updater_configurator.cc ++++ b/android_webview/nonembedded/component_updater/aw_component_updater_configurator.cc +@@ -36,7 +36,7 @@ AwComponentUpdaterConfigurator::AwComponentUpdaterConfigurator( + PrefService* pref_service) + : configurator_impl_( + component_updater::ComponentUpdaterCommandLineConfigPolicy(cmdline), +- false), ++ true), + pref_service_(pref_service) {} + + AwComponentUpdaterConfigurator::~AwComponentUpdaterConfigurator() = default; +diff --git a/chrome/browser/component_updater/chrome_component_updater_configurator.cc b/chrome/browser/component_updater/chrome_component_updater_configurator.cc +index c89a2d5c693dd..298e91d90bdb3 100644 +--- a/chrome/browser/component_updater/chrome_component_updater_configurator.cc ++++ b/chrome/browser/component_updater/chrome_component_updater_configurator.cc +@@ -111,7 +111,7 @@ class ChromeConfigurator : public update_client::Configurator { + ChromeConfigurator::ChromeConfigurator(const base::CommandLine* cmdline, + PrefService* pref_service) + : configurator_impl_(ComponentUpdaterCommandLineConfigPolicy(cmdline), +- false), ++ true), + pref_service_(pref_service) { + DCHECK(pref_service_); + } diff --git a/patches/0001-Vanadium/0110-Block-partitioned-third-party-cookies-as-well-when-b.patch b/patches/0001-Vanadium/0110-Block-partitioned-third-party-cookies-as-well-when-b.patch new file mode 100644 index 0000000..050fbc7 --- /dev/null +++ b/patches/0001-Vanadium/0110-Block-partitioned-third-party-cookies-as-well-when-b.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: fgei +Date: Sat, 15 Apr 2023 04:04:47 +0000 +Subject: [PATCH] Block partitioned third party cookies as well when blocking + third party cookies + +--- + services/network/cookie_settings.cc | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/services/network/cookie_settings.cc b/services/network/cookie_settings.cc +index d5299ee0a680d..3145460067cf1 100644 +--- a/services/network/cookie_settings.cc ++++ b/services/network/cookie_settings.cc +@@ -35,6 +35,11 @@ bool IsExplicitSetting(const ContentSettingPatternSource& setting) { + !setting.secondary_pattern.MatchesAllHosts(); + } + ++bool IsThirdPartyAllowed(const ContentSettingPatternSource& setting) { ++ return setting.primary_pattern.MatchesAllHosts() && ++ !setting.secondary_pattern.MatchesAllHosts(); ++} ++ + const ContentSettingPatternSource* FindMatchingSetting( + const GURL& primary_url, + const GURL& secondary_url, +@@ -197,7 +202,8 @@ CookieSettings::GetThirdPartyBlockingScope(const GURL& first_party_url) const { + // partitioned cross-site cookies. + if (const ContentSettingPatternSource* match = FindMatchingSetting( + first_party_url, first_party_url, content_settings_); +- !match || match->GetContentSetting() == CONTENT_SETTING_ALLOW) { ++ match && IsThirdPartyAllowed(*match) && ++ match->GetContentSetting() == CONTENT_SETTING_ALLOW) { + return ThirdPartyBlockingScope::kUnpartitionedOnly; + } + return ThirdPartyBlockingScope::kUnpartitionedAndPartitioned; diff --git a/patches/0001-Vanadium/0111-Use-StorageKey-for-NetworkIsolationKey-in-ServiceWor.patch b/patches/0001-Vanadium/0111-Use-StorageKey-for-NetworkIsolationKey-in-ServiceWor.patch new file mode 100644 index 0000000..d957506 --- /dev/null +++ b/patches/0001-Vanadium/0111-Use-StorageKey-for-NetworkIsolationKey-in-ServiceWor.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dylan Cutler +Date: Tue, 2 May 2023 13:12:27 -0400 +Subject: [PATCH] Use StorageKey for NetworkIsolationKey in ServiceWorkerHost + +Bug:1147281 +Change-Id: I1a47f2ca4927bfd39bc8d0c159c6b5b0a6114d3b +--- + content/browser/service_worker/service_worker_host.cc | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/content/browser/service_worker/service_worker_host.cc b/content/browser/service_worker/service_worker_host.cc +index f1192469d5305..5b368d0d99499 100644 +--- a/content/browser/service_worker/service_worker_host.cc ++++ b/content/browser/service_worker/service_worker_host.cc +@@ -145,11 +145,7 @@ void ServiceWorkerHost::BindUsbService( + } + + net::NetworkIsolationKey ServiceWorkerHost::GetNetworkIsolationKey() const { +- // TODO(https://crbug.com/1147281): This is the NetworkIsolationKey of a +- // top-level browsing context, which shouldn't be use for ServiceWorkers used +- // in iframes. +- return net::NetworkIsolationKey::ToDoUseTopFrameOriginAsWell( +- version_->key().origin()); ++ return version_->key().ToPartialNetIsolationInfo().network_isolation_key(); + } + + net::NetworkAnonymizationKey ServiceWorkerHost::GetNetworkAnonymizationKey() diff --git a/patches/0001-Vanadium/0112-Add-method-to-convert-StorageKey-to-net-IsolationInf.patch b/patches/0001-Vanadium/0112-Add-method-to-convert-StorageKey-to-net-IsolationInf.patch new file mode 100644 index 0000000..3f78182 --- /dev/null +++ b/patches/0001-Vanadium/0112-Add-method-to-convert-StorageKey-to-net-IsolationInf.patch @@ -0,0 +1,120 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dylan Cutler +Date: Tue, 2 May 2023 20:31:30 +0000 +Subject: [PATCH] Add method to convert StorageKey to net::IsolationInfo + +This is useful for computing IsolationInfo, NetworkIsolationKey, etc. +in partitioned storage which have network access (e.g. service workers). We want to switch to deriving these using the contexts' StorageKey so that they only have access to network state in their partition. + +Bug: 1147281 +Change-Id: I22ae2cd861ce156b2897cbf0fec713933957a421 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4496124 +Commit-Queue: Dylan Cutler +Reviewed-by: Steven Bingler +Cr-Commit-Position: refs/heads/main@{#1138611} +--- + .../blink/common/storage_key/storage_key.cc | 10 +++++ + .../storage_key/storage_key_unittest.cc | 40 +++++++++++++++++++ + .../public/common/storage_key/storage_key.h | 17 ++++++++ + 3 files changed, 67 insertions(+) + +diff --git a/third_party/blink/common/storage_key/storage_key.cc b/third_party/blink/common/storage_key/storage_key.cc +index da0925aa2414d..512880ba4afd1 100644 +--- a/third_party/blink/common/storage_key/storage_key.cc ++++ b/third_party/blink/common/storage_key/storage_key.cc +@@ -779,6 +779,16 @@ const net::SiteForCookies StorageKey::ToNetSiteForCookies() const { + return net::SiteForCookies(top_level_site_); + } + ++const net::IsolationInfo StorageKey::ToPartialNetIsolationInfo() const { ++ url::Origin top_frame_origin = ++ IsFirstPartyContext() ? origin_ ++ : url::Origin::Create(top_level_site_.GetURL()); ++ return net::IsolationInfo::Create(net::IsolationInfo::RequestType::kOther, ++ top_frame_origin, origin_, ++ ToNetSiteForCookies(), ++ /*party_context=*/absl::nullopt, nonce_); ++} ++ + // static + bool StorageKey::ShouldSkipKeyDueToPartitioning( + const std::string& reg_key_string) { +diff --git a/third_party/blink/common/storage_key/storage_key_unittest.cc b/third_party/blink/common/storage_key/storage_key_unittest.cc +index 4066bf8c62691..3d0ecf69fde44 100644 +--- a/third_party/blink/common/storage_key/storage_key_unittest.cc ++++ b/third_party/blink/common/storage_key/storage_key_unittest.cc +@@ -944,6 +944,46 @@ TEST_F(StorageKeyTest, ToNetSiteForCookies) { + } + } + ++TEST_F(StorageKeyTest, ToPartialNetIsolationInfo) { ++ const auto kOrigin = url::Origin::Create(GURL("https://subdomain.foo.com")); ++ const auto kOtherOrigin = ++ url::Origin::Create(GURL("https://subdomain.bar.com")); ++ const auto nonce = base::UnguessableToken::Create(); ++ ++ { // Same-site storage key ++ const auto storage_key = ++ StorageKey::Create(kOrigin, net::SchemefulSite(kOrigin), ++ mojom::AncestorChainBit::kSameSite); ++ ++ storage_key.ToPartialNetIsolationInfo().IsEqualForTesting( ++ net::IsolationInfo::Create(net::IsolationInfo::RequestType::kOther, ++ kOrigin, kOrigin, ++ net::SiteForCookies::FromOrigin(kOrigin))); ++ } ++ ++ { // Cross-site storage key ++ const auto storage_key = ++ StorageKey::Create(kOrigin, net::SchemefulSite(kOtherOrigin), ++ mojom::AncestorChainBit::kCrossSite); ++ ++ storage_key.ToPartialNetIsolationInfo().IsEqualForTesting( ++ net::IsolationInfo::Create( ++ net::IsolationInfo::RequestType::kOther, ++ net::SchemefulSite(kOrigin).GetInternalOriginForTesting(), ++ kOtherOrigin, net::SiteForCookies())); ++ } ++ ++ { // Nonced key ++ const auto storage_key = StorageKey::CreateWithNonce(kOrigin, nonce); ++ ++ storage_key.ToPartialNetIsolationInfo().IsEqualForTesting( ++ net::IsolationInfo::Create( ++ net::IsolationInfo::RequestType::kOther, ++ net::SchemefulSite(kOrigin).GetInternalOriginForTesting(), kOrigin, ++ net::SiteForCookies(), absl::nullopt, nonce)); ++ } ++} ++ + TEST_F(StorageKeyTest, CopyWithForceEnabledThirdPartyStoragePartitioning) { + const url::Origin kOrigin = url::Origin::Create(GURL("https://foo.com")); + const url::Origin kOtherOrigin = url::Origin::Create(GURL("https://bar.com")); +diff --git a/third_party/blink/public/common/storage_key/storage_key.h b/third_party/blink/public/common/storage_key/storage_key.h +index 7c452e6563660..7993f652d7542 100644 +--- a/third_party/blink/public/common/storage_key/storage_key.h ++++ b/third_party/blink/public/common/storage_key/storage_key.h +@@ -239,6 +239,23 @@ class BLINK_COMMON_EXPORT StorageKey { + // info.) + const net::SiteForCookies ToNetSiteForCookies() const; + ++ // Return an instance of net::IsolationInfo. This is used for forms of storage ++ // like workers which have network access to ensure they only have access to ++ // network state in their partition. ++ // ++ // The IsolationInfo that this creates will not be exactly the same as the ++ // IsolationInfo of the context that created the worker. This is because ++ // StorageKey only stores the top-frame *site* whereas IsolationInfo normally ++ // uses top-frame *origin*. So we may lose the subdomain of the original ++ // context. Although this is imperfect, it is better than using first-party ++ // IsolationInfo for partitioned workers. ++ // ++ // For first-party contexts, the storage origin is used for the top-frame ++ // origin in the resulting IsolationInfo. This matches legacy behavior before ++ // storage partitioning, where the storage origin is always used as the ++ // top-frame origin. ++ const net::IsolationInfo ToPartialNetIsolationInfo() const; ++ + // Returns true if the registration key string is partitioned by top-level + // site but storage partitioning is currently disabled, otherwise returns + // false. Also returns false if the key string contains a serialized nonce. diff --git a/patches/0001-Vanadium/0113-Use-StorageKey-method-to-convert-to-IsolationInfo-in.patch b/patches/0001-Vanadium/0113-Use-StorageKey-method-to-convert-to-IsolationInfo-in.patch new file mode 100644 index 0000000..1be7e33 --- /dev/null +++ b/patches/0001-Vanadium/0113-Use-StorageKey-method-to-convert-to-IsolationInfo-in.patch @@ -0,0 +1,46 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dylan Cutler +Date: Fri, 5 May 2023 16:53:42 +0000 +Subject: [PATCH] Use StorageKey method to convert to IsolationInfo in + background fetch + +Now that this method was merged in https://crrev.com/c/4496124, I am cleaning up places where we derive IsolationInfo from a StorageKey so that we can have only one implementation of the casting logic. + +The logic used in StorageKey::ToPartialNetIsolationInfo is almost identical to the logic here. The only difference is in first-party contexts, it uses the full storage origin for the top-frame origin, instead of making an origin from the top-frame site. + +Bug: None +Change-Id: Ia0c2d1b8e776be5b918af54770dcc9a9450ed66c +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4500186 +Commit-Queue: Dylan Cutler +Reviewed-by: Peter Beverloo +Cr-Commit-Position: refs/heads/main@{#1140174} +--- + .../background_fetch_service_impl.cc | 15 +++++---------- + 1 file changed, 5 insertions(+), 10 deletions(-) + +diff --git a/content/browser/background_fetch/background_fetch_service_impl.cc b/content/browser/background_fetch/background_fetch_service_impl.cc +index d3b8c441ed525..34efc195dc75c 100644 +--- a/content/browser/background_fetch/background_fetch_service_impl.cc ++++ b/content/browser/background_fetch/background_fetch_service_impl.cc +@@ -67,16 +67,11 @@ void BackgroundFetchServiceImpl::CreateForWorker( + return; + } + +- mojo::MakeSelfOwnedReceiver( +- std::make_unique( +- std::move(context), info.storage_key, +- net::IsolationInfo::Create( +- net::IsolationInfo::RequestType::kOther, +- url::Origin::Create(info.storage_key.top_level_site().GetURL()), +- info.storage_key.origin(), info.storage_key.ToNetSiteForCookies(), +- /*party_context=*/absl::nullopt, info.storage_key.nonce()), +- render_process_host, /*rfh=*/nullptr), +- std::move(receiver)); ++ mojo::MakeSelfOwnedReceiver(std::make_unique( ++ std::move(context), info.storage_key, ++ info.storage_key.ToPartialNetIsolationInfo(), ++ render_process_host, /*rfh=*/nullptr), ++ std::move(receiver)); + } + + // static diff --git a/patches/0001-Vanadium/LICENSE b/patches/0001-Vanadium/LICENSE new file mode 100644 index 0000000..ef9a0e8 --- /dev/null +++ b/patches/0001-Vanadium/LICENSE @@ -0,0 +1,12 @@ +Copyright © 2016-2023 GrapheneOS + +Vanadium patches are available under the terms of the GNU General Public +License version 2 only, according with LICENSE.GPL-2.0. Also see +LICENSE.WebView-note and LICENSE.Apache-2.0-note for exceptions from the GPLv2 +terms. + +In order for us to continue to contribute upstream, contributors to Vanadium +give permission to the GrapheneOS project to submit their changes to the +Chromium project or a future replacement for the base Vanadium code based on +it under the preferred choice of licensing for that project. Only the code +accepted by them will be available under their choice of license. diff --git a/patches/0001-Vanadium/LICENSE.Apache-2.0-note b/patches/0001-Vanadium/LICENSE.Apache-2.0-note new file mode 100644 index 0000000..84c8fed --- /dev/null +++ b/patches/0001-Vanadium/LICENSE.Apache-2.0-note @@ -0,0 +1,4 @@ +The Vanadium code may be used as part of a work containing code licensed as +Apache 2. An exception is made for the specific patent clause of the Apache 2 +license. This exception does not permit using our code in a project containing +GPLv3 code which has additional restrictions. diff --git a/patches/0001-Vanadium/LICENSE.GPL-2.0 b/patches/0001-Vanadium/LICENSE.GPL-2.0 new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/patches/0001-Vanadium/LICENSE.GPL-2.0 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/patches/0001-Vanadium/LICENSE.WebView-note b/patches/0001-Vanadium/LICENSE.WebView-note new file mode 100644 index 0000000..a791cf3 --- /dev/null +++ b/patches/0001-Vanadium/LICENSE.WebView-note @@ -0,0 +1,3 @@ +Applications using Vanadium through the WebView library including our changes +and extensions to the API are not considered derivative works of Vanadium for +the terms of the GPL-2.0 license. diff --git a/patches/0002-LineageOS/0001-Add-support-for-getting-updates-for-theme-color-chan.patch b/patches/0002-LineageOS/0001-Add-support-for-getting-updates-for-theme-color-chan.patch new file mode 100644 index 0000000..e22bf61 --- /dev/null +++ b/patches/0002-LineageOS/0001-Add-support-for-getting-updates-for-theme-color-chan.patch @@ -0,0 +1,210 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Danny Baumann +Date: Thu, 18 May 2017 11:04:40 +0200 +Subject: [PATCH] Add support for getting updates for theme color changes. + +--- + .../webview/chromium/WebViewChromium.java | 9 +++++ + .../WebViewContentsClientAdapter.java | 34 +++++++++++++++++++ + .../android_webview/AwContentsClient.java | 2 ++ + .../AwContentsClientCallbackHelper.java | 11 ++++++ + .../AwWebContentsObserver.java | 15 ++++++++ + .../test/NullContentsClient.java | 4 +++ + 6 files changed, 75 insertions(+) + +diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java +index 38b5fff802e1e..148f632261f48 100644 +--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java ++++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java +@@ -10,6 +10,7 @@ import android.content.Intent; + import android.content.res.Configuration; + import android.graphics.Bitmap; + import android.graphics.Canvas; ++import android.graphics.Color; + import android.graphics.Paint; + import android.graphics.Picture; + import android.graphics.Rect; +@@ -75,6 +76,7 @@ import org.chromium.components.embedder_support.application.ClassLoaderContextWr + import org.chromium.content_public.browser.MessagePayload; + import org.chromium.content_public.browser.NavigationHistory; + import org.chromium.content_public.browser.SmartClipProvider; ++import org.chromium.content_public.browser.WebContents; + import org.chromium.url.GURL; + + import java.io.BufferedWriter; +@@ -1371,6 +1373,13 @@ class WebViewChromium implements WebViewProvider, WebViewProvider.ScrollDelegate + return mAwContents.getMostRecentProgress(); + } + ++ public int getThemeColor() { ++ WebContents webContents = mAwContents != null ? mAwContents.getWebContents() : null; ++ if (webContents == null) return Color.TRANSPARENT; ++ // No checkThread() because the value is cached java side (workaround for b/10533304). ++ return webContents.getThemeColor(); ++ } ++ + @Override + public int getContentHeight() { + recordWebViewApiCall(ApiCall.GET_CONTENT_HEIGHT); +diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java +index d1c3f5606ef80..9c8d2c1d7db76 100644 +--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java ++++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java +@@ -57,6 +57,8 @@ import org.chromium.base.task.TaskTraits; + import org.chromium.components.embedder_support.util.WebResourceResponseInfo; + + import java.lang.ref.WeakReference; ++import java.lang.reflect.InvocationTargetException; ++import java.lang.reflect.Method; + import java.security.Principal; + import java.security.PrivateKey; + import java.security.cert.X509Certificate; +@@ -99,6 +101,9 @@ class WebViewContentsClientAdapter extends SharedWebViewContentsClientAdapter { + private WeakHashMap> + mOngoingPermissionRequests; + ++ private static Method sWebChromeClientThemeColorMethod; ++ private static boolean sWebChromeClientThemeColorMethodInitialized; ++ + /** + * Adapter constructor. + * +@@ -110,6 +115,17 @@ class WebViewContentsClientAdapter extends SharedWebViewContentsClientAdapter { + super(webView, webViewDelegate, context); + try (ScopedSysTraceEvent event = + ScopedSysTraceEvent.scoped("WebViewContentsClientAdapter.constructor")) { ++ ++ if (!sWebChromeClientThemeColorMethodInitialized) { ++ try { ++ sWebChromeClientThemeColorMethod = WebChromeClient.class.getMethod( ++ "onThemeColorChanged", WebView.class, Integer.TYPE); ++ } catch (Exception e) { ++ // ignored ++ } ++ sWebChromeClientThemeColorMethodInitialized = true; ++ } ++ + // See //android_webview/docs/how-does-on-create-window-work.md for more details. + mUiThreadHandler = new Handler() { + @Override +@@ -1037,6 +1053,24 @@ class WebViewContentsClientAdapter extends SharedWebViewContentsClientAdapter { + } + } + ++ /** ++ * @see AwContentsClient#onThemeColorChanged(int) ++ */ ++ @Override ++ public void onThemeColorChanged(int color) { ++ try { ++ TraceEvent.begin("WebViewContentsClientAdapter.onThemeColorChanged"); ++ if (mWebChromeClient != null && sWebChromeClientThemeColorMethod != null) { ++ if (TRACE) Log.d(TAG, "onThemeColorChanged=" + color); ++ sWebChromeClientThemeColorMethod.invoke(mWebChromeClient, mWebView, color); ++ } ++ } catch (IllegalAccessException | InvocationTargetException e) { ++ // ignored ++ } finally { ++ TraceEvent.end("WebViewContentsClientAdapter.onThemeColorChanged"); ++ } ++ } ++ + private static class AwHttpAuthHandlerAdapter extends android.webkit.HttpAuthHandler { + private AwHttpAuthHandler mAwHandler; + +diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java +index b842bcc9b3f84..cab7751b7cdf1 100644 +--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java ++++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java +@@ -170,6 +170,8 @@ public abstract class AwContentsClient { + + public abstract void onProgressChanged(int progress); + ++ public abstract void onThemeColorChanged(int color); ++ + public abstract WebResourceResponseInfo shouldInterceptRequest(AwWebResourceRequest request); + + public abstract boolean shouldOverrideKeyEvent(KeyEvent event); +diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java +index 29ad12ad713be..6370748819511 100644 +--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java ++++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClientCallbackHelper.java +@@ -134,6 +134,9 @@ public class AwContentsClientCallbackHelper { + private static final int MSG_ON_FORM_RESUBMISSION = 14; + private static final int MSG_ON_SAFE_BROWSING_HIT = 15; + ++ // Custom ++ private static final int MSG_ON_THEME_COLOR_CHANGED = 99; ++ + // Minimum period allowed between consecutive onNewPicture calls, to rate-limit the callbacks. + private static final long ON_NEW_PICTURE_MIN_PERIOD_MILLIS = 500; + // Timestamp of the most recent onNewPicture callback. +@@ -229,6 +232,10 @@ public class AwContentsClientCallbackHelper { + mContentsClient.onProgressChanged(msg.arg1); + break; + } ++ case MSG_ON_THEME_COLOR_CHANGED: { ++ mContentsClient.onThemeColorChanged(msg.arg1); ++ break; ++ } + case MSG_SYNTHESIZE_PAGE_LOADING: { + final String url = (String) msg.obj; + mContentsClient.onPageStarted(url); +@@ -341,6 +348,10 @@ public class AwContentsClientCallbackHelper { + mHandler.sendMessage(mHandler.obtainMessage(MSG_SYNTHESIZE_PAGE_LOADING, url)); + } + ++ public void postOnThemeColorChanged(int color) { ++ mHandler.sendMessage(mHandler.obtainMessage(MSG_ON_THEME_COLOR_CHANGED, color, 0)); ++ } ++ + public void postDoUpdateVisitedHistory(String url, boolean isReload) { + DoUpdateVisitedHistoryInfo info = new DoUpdateVisitedHistoryInfo(url, isReload); + mHandler.sendMessage(mHandler.obtainMessage(MSG_DO_UPDATE_VISITED_HISTORY, info)); +diff --git a/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java b/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java +index 6b6b16075b8b2..2e814fa3fa0df 100644 +--- a/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java ++++ b/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java +@@ -164,12 +164,27 @@ public class AwWebContentsObserver extends WebContentsObserver { + }); + } + ++ if (client != null) { ++ AwContents awContents = mAwContents.get(); ++ WebContents contents = awContents != null ? awContents.getWebContents() : null; ++ if (contents != null) { ++ client.getCallbackHelper().postOnThemeColorChanged(contents.getThemeColor()); ++ } ++ } ++ + if (client != null && navigation.isPrimaryMainFrameFragmentNavigation()) { + // Note fragment navigations do not have a matching onPageStarted. + client.getCallbackHelper().postOnPageFinished(url); + } + } + ++ public void didChangeThemeColor(int color) { ++ AwContentsClient client = mAwContentsClient.get(); ++ if (client != null) { ++ client.getCallbackHelper().postOnThemeColorChanged(color); ++ } ++ } ++ + public boolean didEverCommitNavigation() { + return mCommittedNavigation; + } +diff --git a/android_webview/test/shell/src/org/chromium/android_webview/test/NullContentsClient.java b/android_webview/test/shell/src/org/chromium/android_webview/test/NullContentsClient.java +index 198ae543a6a66..5465d1438a4e4 100644 +--- a/android_webview/test/shell/src/org/chromium/android_webview/test/NullContentsClient.java ++++ b/android_webview/test/shell/src/org/chromium/android_webview/test/NullContentsClient.java +@@ -72,6 +72,10 @@ public class NullContentsClient extends AwContentsClient { + public void onProgressChanged(int progress) { + } + ++ @Override ++ public void onThemeColorChanged(int color) { ++ } ++ + @Override + public WebResourceResponseInfo shouldInterceptRequest( + AwContentsClient.AwWebResourceRequest request) { diff --git a/patches/0002-LineageOS/0002-Add-xxxhdpi-icon_webview.png-to-BUILD.gn.patch b/patches/0002-LineageOS/0002-Add-xxxhdpi-icon_webview.png-to-BUILD.gn.patch new file mode 100644 index 0000000..b6b0a88 --- /dev/null +++ b/patches/0002-LineageOS/0002-Add-xxxhdpi-icon_webview.png-to-BUILD.gn.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Kevin F. Haggerty" +Date: Tue, 19 May 2020 17:21:42 -0600 +Subject: [PATCH] Add xxxhdpi icon_webview.png to BUILD.gn + +--- + android_webview/nonembedded/BUILD.gn | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/android_webview/nonembedded/BUILD.gn b/android_webview/nonembedded/BUILD.gn +index 06c44fd47ba33..626e7a3fdce67 100644 +--- a/android_webview/nonembedded/BUILD.gn ++++ b/android_webview/nonembedded/BUILD.gn +@@ -203,6 +203,7 @@ android_resources("icon_resources") { + "java/res_icon/drawable-mdpi/icon_webview.png", + "java/res_icon/drawable-xhdpi/icon_webview.png", + "java/res_icon/drawable-xxhdpi/icon_webview.png", ++ "java/res_icon/drawable-xxxhdpi/icon_webview.png", + ] + } + diff --git a/patches/0002-LineageOS/0003-webview-Hard-no-to-persistent-histograms.patch b/patches/0002-LineageOS/0003-webview-Hard-no-to-persistent-histograms.patch new file mode 100644 index 0000000..7f368ba --- /dev/null +++ b/patches/0002-LineageOS/0003-webview-Hard-no-to-persistent-histograms.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Kevin F. Haggerty" +Date: Sun, 27 Dec 2020 09:42:54 -0700 +Subject: [PATCH] webview: Hard no to persistent histograms + +* It's probably some kind of bug somewhere that these are never + deleted, but they don't really add value to us in the first + place. +* Stop eating 4MB every single time any app that uses webview + ever opens. +* These were guarded by a feature check before + https://chromium.googlesource.com/chromium/src/+/b86102f2a243 +--- + android_webview/browser/aw_field_trials.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/android_webview/browser/aw_field_trials.cc b/android_webview/browser/aw_field_trials.cc +index f6f167cb88916..3252a46a6f1b1 100644 +--- a/android_webview/browser/aw_field_trials.cc ++++ b/android_webview/browser/aw_field_trials.cc +@@ -11,6 +11,7 @@ + #include "components/metrics/persistent_histograms.h" + + void AwFieldTrials::OnVariationsSetupComplete() { ++#if 0 + // Persistent histograms must be enabled ASAP, but depends on Features. + base::FilePath metrics_dir; + if (base::PathService::Get(base::DIR_ANDROID_APP_DATA, &metrics_dir)) { +@@ -18,4 +19,5 @@ void AwFieldTrials::OnVariationsSetupComplete() { + } else { + NOTREACHED(); + } ++#endif + } diff --git a/patches/0002-LineageOS/0005-webview-Disable-autofill-metadata-uploads-by-default.patch b/patches/0002-LineageOS/0005-webview-Disable-autofill-metadata-uploads-by-default.patch new file mode 100644 index 0000000..0c01b6d --- /dev/null +++ b/patches/0002-LineageOS/0005-webview-Disable-autofill-metadata-uploads-by-default.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Kevin F. Haggerty" +Date: Tue, 28 Sep 2021 08:43:01 -0600 +Subject: [PATCH] webview: Disable autofill metadata uploads by default + +* [haggertk - 2021-11-16] - Update per d85f6c03db147 + (Reland "[Autofill] Inline kAutofillMetadataUploads") +--- + components/autofill/core/browser/randomized_encoder.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/components/autofill/core/browser/randomized_encoder.cc b/components/autofill/core/browser/randomized_encoder.cc +index 376849e083fa8..0d3bc03b66b6e 100644 +--- a/components/autofill/core/browser/randomized_encoder.cc ++++ b/components/autofill/core/browser/randomized_encoder.cc +@@ -187,7 +187,7 @@ const char RandomizedEncoder::kUrlKeyedAnonymizedDataCollectionEnabled[] = + std::unique_ptr RandomizedEncoder::Create( + PrefService* pref_service) { + // Early abort if metadata uploads are not enabled. +- if (!pref_service) { ++ if (!pref_service || (true)) { + return nullptr; + } + diff --git a/patches/0003-LeOS/1-19/000-Bromite-subresource-adblocker.patch b/patches/0003-LeOS/1-19/000-Bromite-subresource-adblocker.patch new file mode 100644 index 0000000..4aa87b6 --- /dev/null +++ b/patches/0003-LeOS/1-19/000-Bromite-subresource-adblocker.patch @@ -0,0 +1,1878 @@ +From: csagan5 <32685696+csagan5@users.noreply.github.com> +Date: Sat, 14 Sep 2019 10:20:08 +0200 +Subject: Bromite subresource adblocker + +Add option to configure the ad blocker filters URL +Disable look-alike, metrics, ablation and navigation throttles +Do not use experiments to enable/disable presets +Always enable ad filtering +Download filters by checking Last-Modified header first +Fix RestoreForeignSessionTab by recreating the tab (issue #681) +Enable AutomaticLazyFrameLoadingToAds and AutomaticLazyFrameLoadingToEmbeds features + +License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html +Change-Id: I09c0504269c659e0f125dfa982148b705cd6528b +--- + chrome/android/BUILD.gn | 1 + + chrome/android/chrome_java_resources.gni | 2 + + chrome/android/chrome_java_sources.gni | 2 + + .../java/res/layout/adblock_editor.xml | 67 +++++ + chrome/android/java/res/values/styles.xml | 18 ++ + chrome/android/java/res/values/values.xml | 2 + + .../java/res/xml/adblock_preferences.xml | 25 ++ + .../android/java/res/xml/main_preferences.xml | 5 + + .../browser/settings/AdBlockEditor.java | 91 ++++++ + .../browser/settings/AdBlockPreferences.java | 61 ++++ + .../chrome/browser/tabmodel/TabModelImpl.java | 2 +- + chrome/app/generated_resources.grd | 10 + + chrome/browser/after_startup_task_utils.cc | 4 + + chrome/browser/browser_process.h | 6 + + chrome/browser/browser_process_impl.cc | 20 ++ + chrome/browser/browser_process_impl.h | 2 + + chrome/browser/chrome_browser_main.cc | 3 + + .../flags/android/cached_feature_flags.cc | 11 + + .../browser/flags/CachedFeatureFlags.java | 10 + + .../net/system_network_context_manager.cc | 4 + + .../sessions/session_restore_android.cc | 4 +- + .../strings/android_chrome_strings.grd | 14 + + chrome/common/pref_names.cc | 3 + + chrome/common/pref_names.h | 1 + + .../strings/android/site_settings.grdp | 4 +- + components/component_updater/BUILD.gn | 7 + + .../adblock_updater_service.cc | 268 ++++++++++++++++++ + .../adblock_updater_service.h | 98 +++++++ + .../download_filters_task.cc | 222 +++++++++++++++ + .../component_updater/download_filters_task.h | 129 +++++++++ + ...ent_subresource_filter_throttle_manager.cc | 11 + + .../content/browser/ruleset_service.cc | 33 ++- + .../content/browser/ruleset_service.h | 7 +- + .../content/browser/ruleset_version.h | 4 + + .../browser/verified_ruleset_dealer.cc | 4 + + .../browser/subresource_filter_features.cc | 116 +------- + .../core/common/indexed_ruleset.cc | 5 +- + .../navigation_throttle_runner.cc | 5 - + third_party/blink/common/features.cc | 12 +- + 39 files changed, 1158 insertions(+), 135 deletions(-) + create mode 100644 chrome/android/java/res/layout/adblock_editor.xml + create mode 100644 chrome/android/java/res/xml/adblock_preferences.xml + create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockEditor.java + create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockPreferences.java + create mode 100644 components/component_updater/adblock_updater_service.cc + create mode 100644 components/component_updater/adblock_updater_service.h + create mode 100644 components/component_updater/download_filters_task.cc + create mode 100644 components/component_updater/download_filters_task.h + +diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn +--- a/chrome/android/BUILD.gn ++++ b/chrome/android/BUILD.gn +@@ -253,6 +253,7 @@ if (current_toolchain == default_toolchain) { + "//chrome/android/modules/image_editor/provider:java", + "//chrome/android/modules/stack_unwinder/provider:java", + "//chrome/android/webapk/libs/client:client_java", ++ "//chrome/browser/endpoint_fetcher:java", + "//chrome/android/webapk/libs/common:common_java", + "//chrome/android/webapk/libs/common:splash_java", + "//chrome/android/webapk/libs/runtime_library:webapk_service_aidl_java", +diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni +--- a/chrome/android/chrome_java_sources.gni ++++ b/chrome/android/chrome_java_sources.gni +@@ -941,6 +941,8 @@ chrome_java_sources = [ + "java/src/org/chromium/chrome/browser/permissions/PermissionSettingsBridge.java", + "java/src/org/chromium/chrome/browser/permissions/PermissionUpdateRequester.java", + "java/src/org/chromium/chrome/browser/photo_picker/DecoderServiceImpl.java", ++ "java/src/org/chromium/chrome/browser/settings/AdBlockEditor.java", ++ "java/src/org/chromium/chrome/browser/settings/AdBlockPreferences.java", + "java/src/org/chromium/chrome/browser/policy/PolicyAuditor.java", + "java/src/org/chromium/chrome/browser/policy/PolicyAuditorBridge.java", + "java/src/org/chromium/chrome/browser/prerender/ChromePrerenderServiceImpl.java", +diff --git a/chrome/android/java/res/layout/adblock_editor.xml b/chrome/android/java/res/layout/adblock_editor.xml +new file mode 100644 +index 0000000000000000000000000000000000000000..aced0dbca5a2be7e2dc03207a757a6c0c1e654e1 +--- /dev/null ++++ b/chrome/android/java/res/layout/adblock_editor.xml +@@ -0,0 +1,67 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/chrome/android/java/res/values/styles.xml b/chrome/android/java/res/values/styles.xml +--- a/chrome/android/java/res/values/styles.xml ++++ b/chrome/android/java/res/values/styles.xml +@@ -224,6 +224,24 @@ found in the LICENSE file. + + + ++ ++ ++ ++ + +