Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • sysrqb/fenix
  • acat/fenix
  • gk/fenix
  • ahf/fenix
  • gaba/fenix
  • torrrrrrrrrrrrrrrr/fenix
  • boklm/fenix
  • aguestuser/fenix
  • ma1/fenix
  • morgan/fenix
  • dan/fenix
  • t-m-w/fenix
  • cypherpunks1/fenix
13 results
Show changes
Commits on Source (9)
  • Matthew Finkel's avatar
    Bug 40002: Add GitLab CI · b1e2bf83
    Matthew Finkel authored
    Pin CI builds to runners with 32GB of RAM to avoid OOM conditions.
    b1e2bf83
  • Matthew Finkel's avatar
    Rename as Tor Browser · 6f10e521
    Matthew Finkel authored
    Bug 40020: Change applicationId
    
    Bug 40020: Change app name
    
    Bug 40020: Change deeplink scheme
    
    Bug 40020: Change App icons
    
    Bug 40073: Use correct branding on About page
    
    Bug 40088: Use Tor Browser logo in migration screen
    6f10e521
  • Matthew Finkel's avatar
    Disable features and functionality · 7d26c2d6
    Matthew Finkel authored
    Bug 33594: Disable data collection by default (Glean)
    
    Bug 40019: Adjust is disabled on Release when data collection is disabled
    
    Bug 34338: Disable the crash reporter
    
    Bug 40014: Neuter Google Advertising ID
    
    Bug 40018: Disable Push service
    
    Bug 40034: Disable PWA onboading
    
    Bug 40072: Disable Tracking Protection
    
    Bug 40061: Do not show "Send to device" in sharing menu
    7d26c2d6
  • Georg Koppen's avatar
    Modify build system · bb632be6
    Georg Koppen authored and Matthew Finkel's avatar Matthew Finkel committed
    Bug 40083: Make locale ordering in BuildConfig deterministic
    
    Bug 40042: Add option do overwrite timestamp in extension version
    
    Bug 40059: Use MOZ_BUILD_DATE for versionCode
    
    At the same time we adapt MOZ_BUILD_DATE to our needs where it is
    actually used and not in tor-browser-build. This gives us more
    flexibility. See: tor-browser-build#40084.
    
    Bug 40067: Fix reproducibility issue in classes2.dex
    
    We make sure our MOZ_BUILD_DATE gets used as a source for showing date
    related information on the Fenix about page.
    
    Bug 40071: Show only supported locales
    
    Bug 40064: Use Gecko Beta for Nightly and Debug variants
    bb632be6
  • Matthew Finkel's avatar
    Add Tor integration and UI · ee4629a0
    Matthew Finkel authored
    Bug 40001: Start Tor as part of the Fenix initialization
    
    Bug 40028: Implement Tor Service controller
    
    Bug 40028: Integrate Tor Controller into HomeFragment
    
    Bug 40028: Implement Tor connect and logger screens
    
    Bug 40028: Implement Tor Onboarding
    
    Bug 40028: Implement new home screen
    
    Bug 40028: Define bootstrapping events and Quick Start
    
    Bug 40041: Implement Tor Network Settings
    
    Bug 40041: Integrate Tor Network Settings
    ee4629a0
  • Alex Catarineu's avatar
    Modify UI/UX · 8a485790
    Alex Catarineu authored and Matthew Finkel's avatar Matthew Finkel committed
    Bug 40015: Modify Home menu
    
    Bug 40016: Hide unwanted Settings
    
    Bug 40016: Modify Default toolbar menu
    
    Bug 40016: Add Donate settings button
    
    Bug 40016: Move Allow Screenshots under Advanced
    
    Bug 40016: Don't install WebCompat webext
    
    Bug 40016: Don't onboard Search Suggestions
    
    Bug 40094: Do not use MasterPasswordTipProvider in HomeFragment
    
    Bug 40095: Hide "Sign in to sync" in bookmarks
    
    Bug 40031: Hide Mozilla-specific items on About page
    
    Bug 40032: Set usesCleartextTraffic as false
    
    Bug 40063: Do not sort search engines alphabetically
    
    Bug 34378: Port external helper app prompting
    
    With the corresponding android-components patch, this allows all `startActivity`
    that may open external apps to be replaced by `TorUtils.startActivityPrompt`.
    
    Bug 34403: Disable Normal mode by default
    
    Bug 40087: Implement a switch for english locale spoofing
    8a485790
  • Alex Catarineu's avatar
    Modify Add-on support · 59d6c47b
    Alex Catarineu authored and Matthew Finkel's avatar Matthew Finkel committed
    Bug 40030: Install HTTPS Everywhere and NoScript addons on startup
    
    HTTPS Everywhere is installed as a builtin extension and NoScript as
    a regular AMO addon. To avoid unnecessary I/O we only install NoScript
    the first time, and rely on the browser addon updating mechanism for
    keeping up with new versions. This is the same behaviour that was
    implemented in the Fennec-based Tor Browser, where it was installed
    as a "distribution addon", which also only occurred once.
    
    Bug 40062: HTTPS Everywhere is not shown as installed
    
    Also 40070: Consider storing the list of recommended addons
    
    This implements our own AddonsProvider, which loads the list of
    available addons from assets instead of fetching it from an
    endpoint. In this list, we replace https-everywhere by
    our https-everywhere-eff, so that the EFF one is shown as installed
    in the addons list and the AMO one is not displayed.
    
    Also, we hide the uninstall button for builtin addons.
    
    Bug 40058: Hide option for disallowing addon in private mode
    59d6c47b
  • Matthew Finkel's avatar
    Add Security Level UI · bab13d40
    Matthew Finkel authored
    Bug 40026: Implement Security Level settings
    
    Bug 40026: Integrate Security Level settings
    bab13d40
  • Matthew Finkel's avatar
    Bug 40098: Add EOY home screen · e70be826
    Matthew Finkel authored
    Unverified
    e70be826
Showing
with 3901 additions and 342 deletions
variables:
DEBIAN_FRONTEND: noninteractive
ANDROID_CLI_TOOLS: "6609375"
ANDROID_CLI_TOOLS_DIGEST: "89f308315e041c93a37a79e0627c47f21d5c5edbe5e80ea8dc0aac8a649e0e92"
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.3"
MAVEN_REPOSITORIES: "${CI_PROJECT_DIR}/gradle_storage"
GRADLE_MAVEN_REPOSITORIES: "file://${MAVEN_REPOSITORIES}"
default:
# See https://about.gitlab.com/blog/2018/10/24/setting-up-gitlab-ci-for-android-projects/
# https://github.com/docker-library/openjdk/blob/master/8/jdk/buster/Dockerfile
image: openjdk:8-jdk
tags:
- 32GB
before_script:
- set -e
# Prepare our Debian environment.
- apt-get update -qq
- apt-get upgrade -qy
# Install needed packages from Debian.
- apt-get install -qy --fix-missing wget tar unzip lib32stdc++6 lib32z1 bzip2
#- ./taskcluster/scripts/toolchain/android-gradle-dependencies.sh
# Install the Android SDK Tools.
- wget --quiet --output-document=android-cli-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_CLI_TOOLS}_latest.zip
- echo "${ANDROID_CLI_TOOLS_DIGEST} android-cli-tools.zip" | sha256sum -c
- unzip -qd cmdline-tools android-cli-tools.zip
- echo y | cmdline-tools/tools/bin/sdkmanager --install "platforms;android-${ANDROID_COMPILE_SDK}" > /dev/null
- echo y | cmdline-tools/tools/bin/sdkmanager --install "platform-tools" > /dev/null
- echo y | cmdline-tools/tools/bin/sdkmanager --install "build-tools;${ANDROID_BUILD_TOOLS}" > /dev/null
# Install the Android NDK.
- echo y | cmdline-tools/tools/bin/sdkmanager ndk-bundle > /dev/null
# Accept all the licenses.
- set +o pipefail
- yes | cmdline-tools/tools/bin/sdkmanager --licenses > /dev/null
- set -o pipefail
# Create local.properties file.
- echo "sdk.dir=$PWD" > local.properties
# Fetch tor library build dependencies
- wget --quiet https://people.torproject.org/~sysrqb/mirrors/tor-onion-proxy-library/0.0.3/android-release.aar
- wget --quiet https://people.torproject.org/~sysrqb/mirrors/tor-onion-proxy-library/0.0.3/universal-0.0.3.jar
- wget --quiet https://people.torproject.org/~sysrqb/mirrors/tor-android-service/1.0/jsocksAndroid-release.aar
- wget --quiet https://people.torproject.org/~sysrqb/mirrors/tor-android-service/1.0/service-release.aar
- wget --quiet https://people.torproject.org/~sysrqb/mirrors/tor/0.4.4.4-rc/tor_x86.tar.gz
- wget --quiet https://people.torproject.org/~sysrqb/mirrors/tor/0.4.4.4-rc/tor_x86_64.tar.gz
- wget --quiet https://people.torproject.org/~sysrqb/mirrors/tor/0.4.4.4-rc/tor_armv7.tar.gz
- wget --quiet https://people.torproject.org/~sysrqb/mirrors/tor/0.4.4.4-rc/tor_aarch64.tar.gz
- echo "4e2bd087df6128a31c598d297367c106762f539c25d71cc343aae25386e4bee9 android-release.aar" | sha256sum -c
- echo "0082d1d035a0808d03d7e1009398ed2c3e3ea4c51811198f6ff83ccda456036f universal-0.0.3.jar" | sha256sum -c
- echo "3dca44a48fdbd3f6c44f7ea335ae85fe542676d8e48c6438f84a2c852daf4f54 jsocksAndroid-release.aar" | sha256sum -c
- echo "d38967569af56d809f09f08b888962971149411832c3bc2b7b0b64a43ceb0dcd service-release.aar" | sha256sum -c
- echo "0faa344f658d2e38c7cc881f51c1d8658aac56801f7def1b75be72a8d3f90c54 tor_x86.tar.gz" | sha256sum -c
- echo "acf1d403ca12e3302d1150d2b5fba6585aa83d46db16f15ad33fae39645c5b5d tor_x86_64.tar.gz" | sha256sum -c
- echo "132cb40bbc15bd8f72abd15324705ab720f8b316a2fca84baaeb5db37f602c32 tor_armv7.tar.gz" | sha256sum -c
- echo "6c453c5f7566c87d422ef60750cba794d9616e9197114be5dc1194f75b55b04e tor_aarch64.tar.gz" | sha256sum -c
- mv android-release.aar universal-0.0.3.jar jsocksAndroid-release.aar service-release.aar app/
- tar -C app/src/main -xf tor_x86.tar.gz
- tar -C app/src/main -xf tor_x86_64.tar.gz
- tar -C app/src/main -xf tor_armv7.tar.gz
- tar -C app/src/main -xf tor_aarch64.tar.gz
- rm tor_x86.tar.gz tor_x86_64.tar.gz tor_armv7.tar.gz tor_aarch64.tar.gz
stages:
- build
- buildFenixProduction
- buildFennecBeta
- buildFennecProduction
- test
buildDebug:
stage: build
script:
- ./gradlew -PdisableTor=true clean app:assembleDebug --stacktrace
# Disable for now.
#artifacts:
# paths:
# - app/build/outputs/apk/geckoBeta/debug/*.apk
# expire_in: 1 day
testLight:
stage: test
script:
# from config/pre-push-recommended.sh
# `tee` into a log file because resulting output is larger than 4 MB
# (4 MB is max log size)
- ./gradlew -PdisableTor=true ktlint detekt assembleDebug assembleDebugAndroidTest testDebug | tee testLight_gradle.log
artifacts:
paths:
- testLight_gradle.log
expire_in: 1 day
when: always
#### Scheduled Jobs (build* stages run serially) ###
buildFenixProduction:
stage: buildFenixProduction
only:
- schedules
script:
- ./gradlew -PdisableTor=true clean app:assembleNightly --stacktrace
buildFennecBeta:
stage: buildFennecBeta
only:
- schedules
script:
- ./gradlew -PdisableTor=true clean app:assembleBeta --stacktrace
buildFennecProduction:
stage: buildFennecProduction
only:
- schedules
script:
- ./gradlew -PdisableTor=true clean app:assembleRelease --stacktrace
testAll:
stage: test
only:
- schedules
script:
- ./gradlew -PdisableTor=true clean test
......@@ -371,3 +371,328 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
===============================================================================
"White On Black" font embedded in chrome/skin/aboutTorFonts.css is licensed under:
Non Exclusive License Agreement
Object: Imagex font called « White on Black »
Owner: Daniel Hochard
1. Allowed uses
The user may use this font on any surface such as logo, paper, web sites,
textile, Online medias, except TV, cinéma and advertising campaign.
2. Number of users : 5
All users must belong to the same company or household purchasing the font.
3. Modifications
The user can modify this font itself without written consent of the owner.
4. This font belongs to Daniel Hochard. The user may not sell it as a font (in a
font bank or a commercial fonts web site, for example).
The fee for this font was paid on paypal the 29 september 2020
===============================================================================
"Terminal Grotesque Open" font embedded in chrome/skin/aboutTorFonts.css is licensed
under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
===============================================================================
SIL OPEN FONT LICENSE
Version 1.1 - 26 February 2007
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting — in part or in whole — any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
===============================================================================
The Cousine font is licensed under the Apache License, Version 2.0.
https://fonts.google.com/specimen/Cousine
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
......@@ -20,7 +20,7 @@ import static org.gradle.api.tasks.testing.TestResult.ResultType
android {
compileSdkVersion Config.compileSdkVersion
defaultConfig {
applicationId "org.mozilla"
applicationId "org.torproject"
minSdkVersion Config.minSdkVersion
targetSdkVersion Config.targetSdkVersion
versionCode 1
......@@ -31,7 +31,7 @@ android {
resValue "bool", "IS_DEBUG", "false"
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "false"
buildConfigField "String", "AMO_COLLECTION", "\"7dfae8669acc4312a65e8ba5553036\""
def deepLinkSchemeValue = "fenix-dev"
def deepLinkSchemeValue = "torbrowser-dev"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
"deepLinkScheme": deepLinkSchemeValue
......@@ -43,6 +43,8 @@ android {
} else {
buildConfigField "boolean", "MOZILLA_ONLINE", "false"
}
buildConfigField "boolean", "DATA_COLLECTION_DISABLED", "true"
}
def releaseTemplate = {
......@@ -64,21 +66,21 @@ android {
debug {
shrinkResources false
minifyEnabled false
applicationIdSuffix ".fenix.debug"
applicationIdSuffix ".torbrowser_debug"
resValue "bool", "IS_DEBUG", "true"
pseudoLocalesEnabled true
}
nightly releaseTemplate >> {
applicationIdSuffix ".fenix"
applicationIdSuffix ".torbrowser_nightly"
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
def deepLinkSchemeValue = "fenix-nightly"
def deepLinkSchemeValue = "torbrowser-nightly"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = ["deepLinkScheme": deepLinkSchemeValue]
}
beta releaseTemplate >> {
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
applicationIdSuffix ".firefox_beta"
def deepLinkSchemeValue = "fenix-beta"
applicationIdSuffix ".torbrowser_alpha"
def deepLinkSchemeValue = "torbrowser-alpha"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
// This release type is meant to replace Firefox (Beta channel) and therefore needs to inherit
......@@ -88,14 +90,14 @@ android {
// fatal consequences. For example see:
// - https://issuetracker.google.com/issues/36924841
// - https://issuetracker.google.com/issues/36905922
"sharedUserId": "org.mozilla.firefox.sharedID",
"sharedUserId": "org.torproject.torbrowser_alpha.sharedID",
"deepLinkScheme": deepLinkSchemeValue
]
}
release releaseTemplate >> {
buildConfigField "boolean", "USE_RELEASE_VERSIONING", "true"
applicationIdSuffix ".firefox"
def deepLinkSchemeValue = "fenix"
applicationIdSuffix ".torbrowser"
def deepLinkSchemeValue = "torbrowser"
buildConfigField "String", "DEEP_LINK_SCHEME", "\"$deepLinkSchemeValue\""
manifestPlaceholders = [
// This release type is meant to replace Firefox (Release channel) and therefore needs to inherit
......@@ -105,7 +107,7 @@ android {
// fatal consequences. For example see:
// - https://issuetracker.google.com/issues/36924841
// - https://issuetracker.google.com/issues/36905922
"sharedUserId": "org.mozilla.firefox.sharedID",
"sharedUserId": "org.torproject.torbrowser.sharedID",
"deepLinkScheme": deepLinkSchemeValue
]
}
......@@ -210,15 +212,25 @@ android.applicationVariants.all { variant ->
// -------------------------------------------------------------------------------------------------
def isDebug = variant.buildType.resValues['IS_DEBUG']?.value ?: false
def isDataCollectionDisabled = variant.buildType.buildConfigFields['DATA_COLLECTION_DISABLED']?.value ?: true
def isDebugOrDCD = isDebug || isDataCollectionDisabled
def useReleaseVersioning = variant.buildType.buildConfigFields['USE_RELEASE_VERSIONING']?.value ?: false
def versionName = Config.releaseVersionName(project)
def disableTor = false
if (project.hasProperty("disableTor")) {
disableTor = project.getProperty("disableTor")
}
println("----------------------------------------------")
println("Variant name: " + variant.name)
println("Application ID: " + [variant.mergedFlavor.applicationId, variant.buildType.applicationIdSuffix].findAll().join())
println("Build type: " + variant.buildType.name)
println("Flavor: " + variant.flavorName)
println("Telemetry enabled: " + !isDebug)
println("Telemetry enabled: " + !isDebugOrDCD)
println("Tor is disabled: " + disableTor)
buildConfigField "boolean", "DISABLE_TOR", "$disableTor"
if (useReleaseVersioning) {
// The Google Play Store does not allow multiple APKs for the same app that all have the
......@@ -243,7 +255,7 @@ android.applicationVariants.all { variant ->
// -------------------------------------------------------------------------------------------------
buildConfigField 'String', 'SENTRY_TOKEN', 'null'
if (!isDebug) {
if (!isDebugOrDCD) {
buildConfigField 'boolean', 'CRASH_REPORTING', 'true'
// Reading sentry token from local file (if it exists). In a release task on taskcluster it will be available.
try {
......@@ -254,7 +266,7 @@ android.applicationVariants.all { variant ->
buildConfigField 'boolean', 'CRASH_REPORTING', 'false'
}
if (!isDebug) {
if (!isDebugOrDCD) {
buildConfigField 'boolean', 'TELEMETRY', 'true'
} else {
buildConfigField 'boolean', 'TELEMETRY', 'false'
......@@ -275,7 +287,7 @@ android.applicationVariants.all { variant ->
print("Adjust token: ")
if (!isDebug) {
if (!isDebugOrDCD) {
try {
def token = new File("${rootDir}/.adjust_token").text.trim()
buildConfigField 'String', 'ADJUST_TOKEN', '"' + token + '"'
......@@ -358,9 +370,9 @@ dependencies {
jnaForTest Deps.jna
testImplementation files(configurations.jnaForTest.copyRecursive().files)
debugImplementation Deps.mozilla_browser_engine_gecko_nightly
debugImplementation Deps.mozilla_browser_engine_gecko_beta
nightlyImplementation Deps.mozilla_browser_engine_gecko_nightly
nightlyImplementation Deps.mozilla_browser_engine_gecko_beta
betaImplementation Deps.mozilla_browser_engine_gecko_beta
releaseImplementation Deps.mozilla_browser_engine_gecko_release
......@@ -480,8 +492,6 @@ dependencies {
implementation Deps.adjust
implementation Deps.installreferrer // Required by Adjust
implementation Deps.google_ads_id // Required for the Google Advertising ID
implementation Deps.google_play_store // Required for in-app reviews
androidTestImplementation Deps.uiautomator
......@@ -533,6 +543,18 @@ dependencies {
testImplementation "org.mozilla.telemetry:glean-forUnitTests:${project.ext.glean_version}"
lintChecks project(":mozilla-lint-rules")
// Tor Android Services Dependencies
implementation 'net.freehaven.tor.control:jtorctl:0.2'
implementation 'org.slf4j:slf4j-api:1.7.25'
implementation 'org.slf4j:slf4j-android:1.7.25'
// Tor Android Services.
implementation files('service-release.aar')
// Tor Onion Proxy Library.
implementation files('universal-0.0.3.jar')
implementation files('android-release.aar')
}
if (project.hasProperty("coverage")) {
......@@ -605,16 +627,22 @@ task buildTranslationArray {
// This isn't running as a task, instead the array is build when the gradle file is parsed.
// https://github.com/mozilla-mobile/fenix/issues/14175
def foundLocales = new StringBuilder()
def languageCodes = []
foundLocales.append("new String[]{")
fileTree("src/main/res").visit { FileVisitDetails details ->
if(details.file.path.endsWith("${File.separator}strings.xml")){
if(details.file.path.endsWith("${File.separator}torbrowser_strings.xml")){
def languageCode = details.file.parent.tokenize(File.separator).last().replaceAll('values-','').replaceAll('-r','-')
languageCode = (languageCode == "values") ? "en-US" : languageCode
foundLocales.append("\"").append(languageCode).append("\"").append(",")
languageCodes.add(languageCode)
}
}
// The order of files in a `FileTree` is not stable, even on a single
// computer. Thus we need to sort the `languageCode`s. See: fenix#40083.
languageCodes.sort()
languageCodes.each {
foundLocales.append("\"").append(it).append("\"").append(",")
}
foundLocales.append("}")
def foundLocalesString = foundLocales.toString().replaceAll(',}','}')
android.defaultConfig.buildConfigField "String[]", "SUPPORTED_LOCALE_ARRAY", foundLocalesString
......@@ -697,7 +725,13 @@ ext.updateExtensionVersion = { task, extDir ->
rename { 'manifest.json' }
into extDir
def values = ['version': AndroidComponents.VERSION + "." + new Date().format('MMddHHmmss')]
def systemEnvBuildDate = System.getenv('MOZ_BUILD_DATE')
// MOZ_BUILD_DATE is in the yyyyMMddHHmmss format. Thus, we only use a
// substring of it if it is available.
def values = ['version': AndroidComponents.VERSION + "." +
(systemEnvBuildDate != null ?
systemEnvBuildDate.substring(4) :
new Date().format('MMddHHmmss'))]
inputs.properties(values)
expand(values)
}
......
......@@ -107,8 +107,8 @@ private fun assertVersionNumber() {
}
private fun assertProductCompany() {
onView(withId(R.id.about_content))
.check(matches(withText(containsString("Firefox Preview is produced by Mozilla."))))
onView(withId(R.id.tor_about_content))
.check(matches(withText(containsString("Firefox Preview is produced by the Tor Project."))))
}
private fun assertCurrentTimestamp() {
......
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:pathData="M75.22,60.55H51.81a1.25,1.25 0,0 0,-1.25 1.25v3.75a10,10 0,0 0,10 10h13A7.49,7.49 0,0 0,81 68v-3.23c0,-1.88 -1.87,-4.22 -5.78,-4.22z"
android:fillColor="#008787"/>
<path
android:pathData="M75.22,60.55H51.81a1.25,1.25 0,0 0,-1.25 1.25v3.75a10,10 0,0 0,10 10h13A7.49,7.49 0,0 0,81 68v-3.23c0,-1.88 -1.87,-4.22 -5.78,-4.22z"
android:strokeAlpha="0.9"
android:fillAlpha="0.9">
<aapt:attr name="android:fillColor">
<gradient
android:startY="75.100006"
android:startX="74.920456"
android:endY="72.55"
android:endX="65.785286"
android:type="linear">
<item android:offset="0" android:color="#7F054096"/>
<item android:offset="0.7" android:color="#07542BC8"/>
<item android:offset="0.85" android:color="#00592ACB"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M78.13,44.28c-1.13,-2.72 -3.43,-5.66 -5.23,-6.59a26.79,26.79 0,0 1,2.64 7.91c-3,-7.34 -7.94,-10.3 -12,-16.74 -0.2,-0.33 -0.41,-0.65 -0.61,-1a5.94,5.94 0,0 1,-0.29 -0.54,4.92 4.92,0 0,1 -0.39,-1 0.07,0.07 0,0 0,-0.05 -0.07h-0.07a19,19 0,0 0,-9 14.46A12.92,12.92 0,0 0,46 43.49a10.031,10.031 0,0 0,-0.68 -0.51,12 12,0 0,1 -0.07,-6.36A19.21,19.21 0,0 0,39 41.46c-1,-1.31 -1,-5.62 -0.9,-6.52a4.39,4.39 0,0 0,-0.87 0.46,19.37 19.37,0 0,0 -2.54,2.18 22.23,22.23 0,0 0,-2.43 2.92,21.88 21.88,0 0,0 -3.5,7.88v0.18a39.159,39.159 0,0 0,-0.26 1.62,0.13 0.13,0 0,1 0,0.06 26.47,26.47 0,0 0,-0.5 3.59L28,54a26,26 0,0 0,51.7 4.41l0.12,-1a26.9,26.9 0,0 0,-1.69 -13.13zM48.13,64.66l0.36,0.18zM54.13,48.96zM75.6,45.65z">
<aapt:attr name="android:fillColor">
<gradient
android:startY="34.731655"
android:startX="73.6671"
android:endY="77.194664"
android:endX="32.80596"
android:type="linear">
<item android:offset="0.05" android:color="#FFFFF44F"/>
<item android:offset="0.37" android:color="#FFFF980E"/>
<item android:offset="0.53" android:color="#FFFF3647"/>
<item android:offset="0.7" android:color="#FFE31587"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M78.13,44.28c-1.13,-2.72 -3.43,-5.66 -5.23,-6.59a26.79,26.79 0,0 1,2.64 7.91,23.55 23.55,0 0,1 -0.81,17.57c-3,6.4 -10.21,13 -21.51,12.65 -12.22,-0.35 -23,-9.41 -25,-21.29a11.22,11.22 0,0 1,0.18 -4.34,19.61 19.61,0 0,0 -0.4,3.64V54a26,26 0,0 0,51.7 4.41l0.12,-1a26.9,26.9 0,0 0,-1.69 -13.13z">
<aapt:attr name="android:fillColor">
<gradient
android:gradientRadius="53.746716"
android:centerX="68.339355"
android:centerY="37.69"
android:type="radial">
<item android:offset="0.13" android:color="#FFFFBD4F"/>
<item android:offset="0.28" android:color="#FFFF980E"/>
<item android:offset="0.47" android:color="#FFFF3750"/>
<item android:offset="0.78" android:color="#FFEB0878"/>
<item android:offset="0.86" android:color="#FFE50080"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M78.13,44.28c-1.13,-2.72 -3.43,-5.66 -5.23,-6.59a26.79,26.79 0,0 1,2.64 7.91,23.55 23.55,0 0,1 -0.81,17.57c-3,6.4 -10.21,13 -21.51,12.65 -12.22,-0.35 -23,-9.41 -25,-21.29a11.22,11.22 0,0 1,0.18 -4.34,19.61 19.61,0 0,0 -0.4,3.64V54a26,26 0,0 0,51.7 4.41l0.12,-1a26.9,26.9 0,0 0,-1.69 -13.13z">
<aapt:attr name="android:fillColor">
<gradient
android:gradientRadius="55.09038"
android:centerX="48.56332"
android:centerY="55.002163"
android:type="radial">
<item android:offset="0.3" android:color="#FF960E18"/>
<item android:offset="0.35" android:color="#BCB11927"/>
<item android:offset="0.43" android:color="#56DB293D"/>
<item android:offset="0.5" android:color="#16F5334B"/>
<item android:offset="0.53" android:color="#00FF3750"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M65.47,47.34l0.17,0.12a14.35,14.35 0,0 0,-2.42 -3.15c-8.09,-8.09 -2.12,-17.55 -1.12,-18a19,19 0,0 0,-9 14.46h0.92a13.13,13.13 0,0 1,11.45 6.57z">
<aapt:attr name="android:fillColor">
<gradient
android:gradientRadius="29.610003"
android:centerX="59.1192"
android:centerY="23.771997"
android:type="radial">
<item android:offset="0.13" android:color="#FFFFF44F"/>
<item android:offset="0.53" android:color="#FFFF980E"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M54.08,49c0,0.65 -2.33,2.88 -3.13,2.88 -7.4,0 -8.6,4.48 -8.6,4.48a11,11 0,0 0,6.13 8.52l0.44,0.21a12.13,12.13 0,0 0,0.76 0.31,11.91 11.91,0 0,0 3.39,0.66c13,0.61 15.49,-15.52 6.13,-20.2a9,9 0,0 1,6.27 1.52,13.13 13.13,0 0,0 -11.4,-6.66h-0.92A12.92,12.92 0,0 0,46 43.49c0.39,0.34 0.84,0.78 1.79,1.71 1.75,1.8 6.28,3.55 6.29,3.8z">
<aapt:attr name="android:fillColor">
<gradient
android:gradientRadius="26.21"
android:centerX="48.315395"
android:centerY="69.29355"
android:type="radial">
<item android:offset="0.35" android:color="#FF3A8EE6"/>
<item android:offset="0.67" android:color="#FF9059FF"/>
<item android:offset="1" android:color="#FFC139E6"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M54.08,49c0,0.65 -2.33,2.88 -3.13,2.88 -7.4,0 -8.6,4.48 -8.6,4.48a11,11 0,0 0,6.13 8.52l0.44,0.21a12.13,12.13 0,0 0,0.76 0.31,11.91 11.91,0 0,0 3.39,0.66c13,0.61 15.49,-15.52 6.13,-20.2a9,9 0,0 1,6.27 1.52,13.13 13.13,0 0,0 -11.4,-6.66h-0.92A12.92,12.92 0,0 0,46 43.49c0.39,0.34 0.84,0.78 1.79,1.71 1.75,1.8 6.28,3.55 6.29,3.8z">
<aapt:attr name="android:fillColor">
<gradient
android:gradientRadius="13.917509"
android:centerX="50.381275"
android:centerY="49.283504"
android:type="radial">
<item android:offset="0.21" android:color="#009059FF"/>
<item android:offset="0.97" android:color="#996E008B"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M44.77,42.62l0.54,0.36a12,12 0,0 1,-0.07 -6.36A19.21,19.21 0,0 0,39 41.46c0.1,0 3.87,-0.07 5.77,1.16z">
<aapt:attr name="android:fillColor">
<gradient
android:gradientRadius="18.444002"
android:centerX="52.251003"
android:centerY="30.259998"
android:type="radial">
<item android:offset="0.1" android:color="#FFFFE226"/>
<item android:offset="0.79" android:color="#FFFF7139"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M28.24,54.58c2,11.88 12.77,20.94 25,21.29 11.3,0.32 18.52,-6.25 21.51,-12.65a23.55,23.55 0,0 0,0.81 -17.57c0.92,6 -2.15,11.87 -6.94,15.82 -9.34,7.61 -18.28,4.59 -20.09,3.35l-0.38,-0.19c-5.45,-2.6 -7.7,-7.56 -7.22,-11.82A6.67,6.67 0,0 1,34.74 49a9.8,9.8 0,0 1,9.57 -0.38A13,13 0,0 0,54.08 49c0,-0.21 -4.54,-2 -6.3,-3.76 -1,-0.93 -1.4,-1.37 -1.79,-1.71a10.031,10.031 0,0 0,-0.68 -0.51l-0.54,-0.36c-1.9,-1.23 -5.67,-1.16 -5.8,-1.16 -1,-1.31 -1,-5.62 -0.9,-6.52a4.39,4.39 0,0 0,-0.87 0.46,19.37 19.37,0 0,0 -2.54,2.18 22.23,22.23 0,0 0,-2.43 2.92,21.88 21.88,0 0,0 -3.5,7.88c-0.02,0.02 -0.95,4.07 -0.49,6.16z">
<aapt:attr name="android:fillColor">
<gradient
android:gradientRadius="89.619446"
android:centerX="69.60241"
android:centerY="18.083904"
android:type="radial">
<item android:offset="0.11" android:color="#FFFFF44F"/>
<item android:offset="0.46" android:color="#FFFF980E"/>
<item android:offset="0.72" android:color="#FFFF3647"/>
<item android:offset="0.9" android:color="#FFE31587"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M63.22,44.31a14.35,14.35 0,0 1,2.42 3.15l0.39,0.32c5.9,5.44 2.81,13.13 2.58,13.68 4.79,-4 7.86,-9.79 6.94,-15.82 -3,-7.34 -7.94,-10.3 -12,-16.74 -0.2,-0.33 -0.41,-0.65 -0.61,-1a5.94,5.94 0,0 1,-0.29 -0.54,4.92 4.92,0 0,1 -0.39,-1 0.07,0.07 0,0 0,-0.05 -0.07H62.1c-1,0.47 -6.97,9.93 1.12,18.02z">
<aapt:attr name="android:fillColor">
<gradient
android:gradientRadius="95.36754"
android:centerX="-6.76699"
android:centerY="37.10374"
android:type="radial">
<item android:offset="0" android:color="#FFFFF44F"/>
<item android:offset="0.3" android:color="#FFFF980E"/>
<item android:offset="0.57" android:color="#FFFF3647"/>
<item android:offset="0.74" android:color="#FFE31587"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M66,47.78l-0.39,-0.32 -0.17,-0.12a9,9 0,0 0,-6.27 -1.52c9.36,4.68 6.85,20.81 -6.13,20.2a11.91,11.91 0,0 1,-3.39 -0.66,12.13 12.13,0 0,1 -0.76,-0.31l-0.44,-0.21c1.81,1.24 10.75,4.26 20.09,-3.35 0.3,-0.58 3.39,-8.27 -2.54,-13.71z">
<aapt:attr name="android:fillColor">
<gradient
android:gradientRadius="56.180176"
android:centerX="52.887726"
android:centerY="35.519154"
android:type="radial">
<item android:offset="0.14" android:color="#FFFFF44F"/>
<item android:offset="0.48" android:color="#FFFF980E"/>
<item android:offset="0.66" android:color="#FFFF3647"/>
<item android:offset="0.9" android:color="#FFE31587"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M42.35,56.32s1.2,-4.48 8.6,-4.48c0.8,0 3.09,-2.23 3.13,-2.88a13,13 0,0 1,-9.77 -0.38,9.8 9.8,0 0,0 -9.57,0.38 6.67,6.67 0,0 0,6.16 3.88c-0.48,4.26 1.77,9.22 7.22,11.82l0.36,0.18a11,11 0,0 1,-6.13 -8.52z">
<aapt:attr name="android:fillColor">
<gradient
android:gradientRadius="60.55354"
android:centerX="65.548615"
android:centerY="39.680077"
android:type="radial">
<item android:offset="0.09" android:color="#FFFFF44F"/>
<item android:offset="0.63" android:color="#FFFF980E"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M78.13,44.28c-1.13,-2.72 -3.43,-5.66 -5.23,-6.59a26.79,26.79 0,0 1,2.64 7.91c-3,-7.34 -7.94,-10.3 -12,-16.74 -0.2,-0.33 -0.41,-0.65 -0.61,-1a5.94,5.94 0,0 1,-0.29 -0.54,4.92 4.92,0 0,1 -0.39,-1 0.07,0.07 0,0 0,-0.05 -0.07h-0.07a19,19 0,0 0,-9 14.46h0.92a13.13,13.13 0,0 1,11.4 6.66,9 9,0 0,0 -6.27,-1.52c9.36,4.68 6.85,20.81 -6.13,20.2a11.91,11.91 0,0 1,-3.39 -0.66,12.13 12.13,0 0,1 -0.76,-0.31l-0.44,-0.21 -0.38,-0.19 0.36,0.18a11,11 0,0 1,-6.13 -8.52s1.2,-4.48 8.6,-4.48c0.8,0 3.09,-2.23 3.13,-2.88 0,-0.21 -4.54,-2 -6.3,-3.76 -1,-0.93 -1.4,-1.37 -1.79,-1.71A10.031,10.031 0,0 0,45.27 43a12,12 0,0 1,-0.07 -6.36,19.21 19.21,0 0,0 -6.2,4.82c-1,-1.31 -1,-5.62 -0.9,-6.52a4.39,4.39 0,0 0,-0.87 0.46,19.37 19.37,0 0,0 -2.54,2.18 22.23,22.23 0,0 0,-2.43 2.92,21.88 21.88,0 0,0 -3.5,7.88v0.18a39.815,39.815 0,0 0,-0.3 1.64A31.77,31.77 0,0 0,28 53.83L28,54a26,26 0,0 0,51.7 4.41l0.12,-1a26.9,26.9 0,0 0,-1.69 -13.13zM75.54,45.62z">
<aapt:attr name="android:fillColor">
<gradient
android:startY="33.91085"
android:startX="69.86179"
android:endY="72.21511"
android:endX="37.319843"
android:type="linear">
<item android:offset="0.17" android:color="#CCFFF44F"/>
<item android:offset="0.6" android:color="#00FFF44F"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M79.75,66H58.23A9.23,9.23 0,0 0,49 75.24v4.51A1.25,1.25 0,0 0,50.25 81h21.52A9.23,9.23 0,0 0,81 71.77v-7A1.24,1.24 0,0 1,79.75 66z">
<aapt:attr name="android:fillColor">
<gradient
android:startY="67.2045"
android:startX="52.19842"
android:endY="79.377"
android:endX="82.60009"
android:type="linear">
<item android:offset="0.001" android:color="#FF54FFBD"/>
<item android:offset="1" android:color="#FF00DDFF"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M54.26,70.33h2.65c1.43,0 2.23,0.64 2.23,1.79a1.42,1.42 0,0 1,-0.74 1.3,1.47 1.47,0 0,1 0.83,1.42c0,1.27 -0.87,1.9 -2.3,1.9h-2.67zM55.48,71.42v1.49L57,72.91c0.66,0 0.94,-0.33 0.94,-0.77s-0.31,-0.72 -1,-0.72zM55.48,74.02v1.6L57,75.62c0.68,0 1,-0.3 1,-0.8s-0.3,-0.8 -1.08,-0.8zM60.42,70.33h4.31v1.16h-3.07v1.45h3.07v1.16h-3.07v1.46h3.07v1.18h-4.31zM67.58,71.47L65.8,71.47v-1.14h4.77v1.14L68.8,71.47v5.27h-1.22zM72.67,70.33h1.22l2.43,6.41L75,76.74l-0.42,-1.17h-2.64l-0.42,1.17h-1.28zM72.35,74.45h1.86l-0.93,-2.55z"
android:fillColor="#20123a"/>
</vector>
app/src/beta/res/mipmap-hdpi/ic_launcher.png

3.9 KiB | W: 0px | H: 0px

app/src/beta/res/mipmap-hdpi/ic_launcher.png

5.87 KiB | W: 0px | H: 0px

app/src/beta/res/mipmap-hdpi/ic_launcher.png
app/src/beta/res/mipmap-hdpi/ic_launcher.png
app/src/beta/res/mipmap-hdpi/ic_launcher.png
app/src/beta/res/mipmap-hdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
app/src/beta/res/mipmap-mdpi/ic_launcher.png

2.09 KiB | W: 0px | H: 0px

app/src/beta/res/mipmap-mdpi/ic_launcher.png

5.87 KiB | W: 0px | H: 0px

app/src/beta/res/mipmap-mdpi/ic_launcher.png
app/src/beta/res/mipmap-mdpi/ic_launcher.png
app/src/beta/res/mipmap-mdpi/ic_launcher.png
app/src/beta/res/mipmap-mdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
app/src/beta/res/mipmap-xhdpi/ic_launcher.png

4.94 KiB | W: 0px | H: 0px

app/src/beta/res/mipmap-xhdpi/ic_launcher.png

8.57 KiB | W: 0px | H: 0px

app/src/beta/res/mipmap-xhdpi/ic_launcher.png
app/src/beta/res/mipmap-xhdpi/ic_launcher.png
app/src/beta/res/mipmap-xhdpi/ic_launcher.png
app/src/beta/res/mipmap-xhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
app/src/beta/res/mipmap-xxhdpi/ic_launcher.png

8.21 KiB | W: 0px | H: 0px

app/src/beta/res/mipmap-xxhdpi/ic_launcher.png

15.8 KiB | W: 0px | H: 0px

app/src/beta/res/mipmap-xxhdpi/ic_launcher.png
app/src/beta/res/mipmap-xxhdpi/ic_launcher.png
app/src/beta/res/mipmap-xxhdpi/ic_launcher.png
app/src/beta/res/mipmap-xxhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
app/src/beta/res/mipmap-xxxhdpi/ic_launcher.png

12.6 KiB | W: 0px | H: 0px

app/src/beta/res/mipmap-xxxhdpi/ic_launcher.png

24.1 KiB | W: 0px | H: 0px

app/src/beta/res/mipmap-xxxhdpi/ic_launcher.png
app/src/beta/res/mipmap-xxxhdpi/ic_launcher.png
app/src/beta/res/mipmap-xxxhdpi/ic_launcher.png
app/src/beta/res/mipmap-xxxhdpi/ic_launcher.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -4,5 +4,5 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<!-- Name of the application -->
<string name="app_name" translatable="false">Firefox Beta</string>
<string name="app_name" translatable="false">Tor Browser Alpha</string>
</resources>
......@@ -11,7 +11,7 @@
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_tab_2">
<intent
android:action="org.mozilla.fenix.OPEN_TAB"
android:targetPackage="org.mozilla.firefox_beta"
android:targetPackage="org.torproject.torbrowser_alpha"
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
</shortcut>
<shortcut
......@@ -22,7 +22,7 @@
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_private_tab_2">
<intent
android:action="org.mozilla.fenix.OPEN_PRIVATE_TAB"
android:targetPackage="org.mozilla.firefox_beta"
android:targetPackage="org.torproject.torbrowser_alpha"
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
</shortcut>
</shortcuts>
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="208"
android:viewportHeight="208">
<path android:pathData="M163.2,113.7c6.4,-1.2 3.9,-14.4 6.6,-5.2"
android:strokeWidth="1.1"
android:fillColor="#000"
android:strokeColor="#000"/>
<path android:pathData="M171.8,59c2.1,-5.6 5.7,-6.7 8.6,-8.3 -4.7,7.3 -1.4,10.2 -2.5,13 -2.3,5.5 -7.9,0 -6,-4.8z"
android:strokeWidth="1.1"
android:fillColor="#fe9d2a"
android:strokeColor="#000"/>
<path android:pathData="M44.3,75.2c1.8,-4.2 4.8,-5 7.3,-6.1 -4,5.4 -1.2,7.6 -2.2,9.7 -1.9,4.1 -6.6,0 -5,-3.6zM27.3,51.9c4,5.4 3,9.6 4,11.7 1.8,4.1 5.9,0.5 4.3,-3.1a19,19 0,0 0,-8.4 -8.6z"
android:strokeWidth="1.1"
android:fillColor="#f3611e"
android:strokeColor="#000"/>
<path android:pathData="M89.3,91.9l2.8,12.1L23,104l2.5,-19.7a50.9,50.9 0,0 1,18.3 -19c-6.4,7.6 -5.7,21.1 8.6,24.8 9.2,2.4 28.6,-9.8 36.8,1.8zM120.7,92.6c21.9,-9.5 26.4,-1.8 34.8,-4 17.2,-5.3 15.7,-13.6 9.7,-23.4A51,51 0,0 1,183.5 84l2.5,20h-66.6l1.3,-11.4zM89.3,91.9zM159.5,78c0.3,3 5.5,3.2 6.4,0 -0.3,-7 -5.5,-9.2 -10.7,-10.8 2.8,3.6 4.3,5.3 4.3,10.8zM34.1,64.4c-1.8,-4.1 -6.6,-5.2 -9.1,-6.3 4,5.4 3,7.8 4,9.9 1.8,4.1 6.6,0 5,-3.6z"
android:strokeWidth="1.1"
android:fillColor="#f00027"
android:strokeColor="#000"/>
<path android:pathData="M87.3,92.8c-24.6,-8.2 -41,7 -45.9,6.5 -19,-2.3 -19,-16.2 -13.8,-28.6 -4.3,6.5 -9.6,7 -12.3,22.7 -2.3,-2.3 -4.8,-3 -5.8,-11.6 -5.4,16.9 -2,20.8 0.5,26.2 -2.6,-1.6 -5,-3.5 -7.2,-5.5 0.7,7.9 3.5,11.6 5.8,16.3l-5.8,-3.5c9.5,25.9 23.3,35.6 39.6,36.1 16,-1.5 24.2,-4 33.7,-6.3l11.2,-52.3zM123.3,94.8c4,-2.3 10.3,-3.1 15.4,-3 8.7,-0.5 25.2,7.9 29,7.9 9.3,0.1 21.1,-9.6 14,-28.3 4.9,6.5 9.9,10.8 12,22 3.5,-2 4.6,-6.3 6,-10.4 4,9.1 3,17.4 -0.2,25.3 2,-1.1 4,-2.4 6.6,-5.6 0.3,7 -3.6,11 -6,16l5,-2.6c-6,17.8 -15.6,32.7 -36.1,35.6 -13,-2.9 -25.4,-6.9 -41,-6.4l-9.2,-24.4s6.1,-28.4 4.6,-26.1"
android:strokeWidth="1.1"
android:fillColor="#cc002b"
android:strokeColor="#000"/>
<path android:pathData="M163,113.5c2.8,-0.6 4.8,-3.2 5.9,-8.7l1,3.6"
android:strokeWidth="1.1"
android:fillColor="#0000"
android:strokeColor="#000"
android:strokeLineCap="square"/>
<path android:pathData="M177,110a19,19 0,0 0,5.4 -6.8l1,7M154,129.3c5.6,0.8 6.9,-2.7 9.4,-5l-0.5,3.7"
android:strokeLineJoin="bevel"
android:strokeWidth="1.1"
android:fillColor="#0000"
android:strokeColor="#000"/>
<path android:pathData="M44,112.7c-2.7,-0.6 -4.7,-3.2 -5.9,-8.7l-1,3.6"
android:strokeWidth="1.1"
android:fillColor="#0000"
android:strokeColor="#000"
android:strokeLineCap="square"/>
<path android:pathData="M30.1,109.2a19,19 0,0 1,-5.4 -6.8l-1,7M53,128.4c-5.5,0.7 -6.8,-2.7 -9.3,-5l0.5,3.7"
android:strokeLineJoin="bevel"
android:strokeWidth="1.1"
android:fillColor="#0000"
android:strokeColor="#000"/>
<path android:pathData="M24.3 105c0.3 7 1.1 13.8 6.2 18.6a24 24 0 0 1-6.8-2.7c2.2 4.4 4.5 8.8 9 12l-4.7-0.3c2.5 4.5 6.3 8.1 10 11.8-8.3-3.7-17.7-5.7-20.6-18.9 2.3 2.2 3 1.6 4.1 1.9-4-4-5.3-9.3-7-13.8 2 2 4.3 3.5 6.8 4.4-6-6.2-4.5-14.3-4.2-22.2 1.8 3.8 3.9 7.3 7.2 9.2zm10.2 18c3 1.6 4.2 4.3 9.7 4 1 5.4 5 8.4 9.4 11.4-6.1 0.7-14.1-0.1-19-15.4zm5.8-0.8C30.3 119 29 109.4 31 98.9c2 6.6 3.9 7.2 6 8.2-0.7 6-0.5 12 3.3 15z"
android:strokeWidth="1.1"
android:fillColor="#f00027"
android:strokeColor="#000"/>
<path android:pathData="M182.8 105.8c3.3-1.9 5.3-5.4 7.2-9.1 0.3 7.8 1.8 16-4.2 22.1a17 17 0 0 0 6.7-4.3c-1.6 4.4-2.8 9.6-6.9 13.7 1.2-0.3 1.8 0.3 4.2-1.9-3 13.2-12.4 15.3-20.7 19 3.7-3.8 7.5-7.4 10-12-1.8 0.3-3.4 0.4-4.7 0.4 4.5-3.2 6.8-7.6 9-12a24 24 0 0 1-6.8 2.7c5-4.8 6-11.6 6.2-18.6zm-20 22c5.6 0.3 6.8-2.4 9.8-4-5 15.3-13 16-19.1 15.4 4.3-3 8.4-6 9.4-11.3zm4-3.1c10-3.2 11.3-12.8 9.3-23.3-2 6.6-3.9 7.2-6 8.2 0.7 6 0.5 12-3.3 15z"
android:strokeWidth="1.1"
android:fillColor="#f00027"
android:strokeColor="#000"/>
<path android:pathData="M146.8,95.8c0,-3.6 -2.8,-6.5 -6.4,-6.5a6.5,6.5 0,0 0,-6.4 6.5v26.7c0,3.5 3,6.4 6.4,6.4 3.5,0 6.4,-3 6.4,-6.4L146.8,95.7zM72,95.8c0,-3.6 -2.8,-6.5 -6.4,-6.5a6.5,6.5 0,0 0,-6.4 6.5v26.7c0,3.5 3,6.4 6.4,6.4 3.5,0 6.4,-3 6.5,-6.4L72.1,95.7zM117,65.2l4.6,-8.2s0.4,-0.7 -0.4,-1.2c-0.7,-0.4 -1.2,0.4 -1.2,0.4l-4.6,8.2a30.4,30.4 0,0 0,-24.7 0L86,56.2s-0.5,-0.8 -1.2,-0.4c-0.8,0.4 -0.4,1.3 -0.4,1.3l4.5,8.1a26,26 0,0 0,-14.6 23h57.2a26,26 0,0 0,-14.5 -23zM74.4,90.5v41.4a7,7 0,0 0,7 6.9h4.5v14.1c0,3.6 3,6.4 6.4,6.4 3.6,0 6.4,-2.8 6.5,-6.4v-14.1h8.5v14.1c0,3.6 3,6.4 6.4,6.4 3.5,0 6.4,-2.8 6.4,-6.4v-14.1h4.6a7,7 0,0 0,7 -6.9L131.7,90.4L74.3,90.4z"
android:fillColor="#79c257"/>
<path android:pathData="M94.6,88.6c4.5,5 11.5,3.3 17.2,3 -6,-1 -12.6,-2.5 -17,-8.6"
android:strokeWidth="1"
android:fillColor="#f8db00"
android:strokeColor="#000"/>
<path android:pathData="M106.5,90.2c4,-2.8 8.9,-2.5 13.3,-1.4 -2.3,-1.8 -1.5,-3.4 -14.6,-2.6a17,17 0,0 1,-9.4 -2.4c1.8,3.2 6.1,6 10.7,6.4z"
android:strokeWidth="1"
android:fillColor="#d36224"
android:strokeColor="#000"/>
<path android:pathData="M122.2,91c2,-4 -5,-9.6 -6.8,-9.6 -5,-0.5 -14.7,-0.3 -14.4,-3 -3,-0.4 -5,1 -5.8,4 2.7,2.2 5.7,3.7 9.3,3.8 12.3,-0.9 14,0.8 15,2.6l2.7,2.2z"
android:strokeLineJoin="bevel"
android:strokeWidth="1"
android:fillColor="#ecd404"
android:strokeColor="#000"/>
<path android:pathData="M89.7,77.2L84,79.5l1,-2.3L89,74l0.8,1v2.2zM114.8,76.7l-5.7,1.9 1.2,-2.2 4,-3 0.7,1 -0.2,2.3z"
android:strokeWidth="1"
android:fillColor="#680000"
android:strokeColor="#000"/>
<path android:pathData="M84.3,78.6c1.8,-4.7 3.7,-6.3 7.3,-5.1 0.6,0.3 1.3,0.3 1.5,2.2 -0.1,1.4 -0.8,2 -2,2 -2.3,0 -2,-1.5 -2,-3 -2.4,0 -4.8,8.6 -7,3h0.7c0,1.1 1.3,1.4 1.5,0.9zM109.3,77.7c2.2,-4.5 4.2,-6 7.7,-4.6 0.6,0.4 1.3,0.4 1.3,2.4 -0.2,1.3 -0.9,1.9 -2,1.8 -2.3,0 -2,-1.7 -1.8,-3.2 -2.5,-0.1 -5.5,8.3 -7.2,2.6h0.6c0,1.1 1.2,1.5 1.4,1z"
android:strokeWidth="1"
android:fillColor="#000"
android:strokeColor="#000"/>
<path android:pathData="M92.3,75.7c0,0.6 -0.4,1 -1,1a1,1 0,0 1,-1 -1c0,-0.5 0.5,-1 1,-1 0.6,0 1,0.5 1,1zM117.6,75.4c0,0.6 -0.5,1 -1,1a1,1 0,0 1,-1 -1.1c0,-0.5 0.5,-1 1,-1a1,1 0,0 1,1 1.1z"
android:fillColor="#fff"/>
</vector>
......@@ -12,7 +12,7 @@
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_tab_2">
<intent
android:action="org.mozilla.fenix.OPEN_TAB"
android:targetPackage="org.mozilla.fenix.debug"
android:targetPackage="org.torproject.torbrowser_debug"
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
</shortcut>
<shortcut
......@@ -23,7 +23,7 @@
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_private_tab_2">
<intent
android:action="org.mozilla.fenix.OPEN_PRIVATE_TAB"
android:targetPackage="org.mozilla.fenix.debug"
android:targetPackage="org.torproject.torbrowser_debug"
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
</shortcut>
</shortcuts>
\ No newline at end of file
......@@ -24,10 +24,10 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/NormalTheme"
android:usesCleartextTraffic="true"
android:usesCleartextTraffic="false"
tools:ignore="UnusedAttribute">
<!--
......@@ -258,6 +258,7 @@
<service
android:name=".push.FirebasePushService"
android:enabled="false"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
......@@ -278,6 +279,13 @@
android:name="androidx.work.impl.WorkManagerInitializer"
android:authorities="${applicationId}.workmanager-init"
tools:node="remove" />
<!-- Define Orbotservice's TorService -->
<service
android:name="org.torproject.android.service.TorService"
android:enabled="true"
android:exported="false"
android:stopWithTask="true">
</service>
</application>
</manifest>
This diff is collapsed.
......@@ -19,12 +19,12 @@ object FeatureFlags {
*
* Tracking issue: https://github.com/mozilla-mobile/fenix/issues/13892
*/
val syncedTabsInTabsTray = Config.channel.isNightlyOrDebug
const val syncedTabsInTabsTray = false
/**
* Enables downloads with external download managers.
*/
const val externalDownloadManager = true
const val externalDownloadManager = false
/**
* Enables swipe to delete in bookmarks
......
......@@ -49,6 +49,7 @@ import org.mozilla.fenix.push.WebPushEngineIntegration
import org.mozilla.fenix.session.PerformanceActivityLifecycleCallbacks
import org.mozilla.fenix.session.VisibilityLifecycleCallback
import org.mozilla.fenix.utils.BrowsersCache
import org.torproject.android.service.util.Prefs
/**
*The main application class for Fenix. Records data to measure initialization performance.
......@@ -62,6 +63,8 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
private val logger = Logger("FenixApplication")
var terminating = false
open val components by lazy { Components(this) }
var visibilityLifecycleCallback: VisibilityLifecycleCallback? = null
......@@ -91,6 +94,21 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
setupInMainProcessOnly()
}
fun isTerminating() = terminating
fun terminate() {
onTerminate()
System.exit(0)
}
override fun onTerminate() {
terminating = true
super.onTerminate()
components.torController.stop()
components.torController.stopTor()
}
protected open fun initializeGlean() {
val telemetryEnabled = settings().isTelemetryEnabled
......@@ -139,6 +157,11 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
if (!megazordSetup.isCompleted) {
runBlockingIncrement { megazordSetup.await() }
}
GlobalScope.launch(Dispatchers.IO) {
// Give TAS the base Context
Prefs.setContext(applicationContext)
}
}
setupLeakCanary()
......@@ -157,6 +180,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
initVisualCompletenessQueueAndQueueTasks()
components.appStartupTelemetry.onFenixApplicationOnCreate()
components.torController.start()
}
private fun restoreDownloads() {
......
......@@ -4,6 +4,7 @@
package org.mozilla.fenix
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.content.res.Configuration
......@@ -43,6 +44,8 @@ import mozilla.components.browser.state.state.SessionState
import mozilla.components.browser.state.state.WebExtensionState
import mozilla.components.concept.engine.EngineSession
import mozilla.components.concept.engine.EngineView
import mozilla.components.feature.app.links.RedirectDialogFragment
import mozilla.components.feature.app.links.SimpleRedirectDialogFragment
import mozilla.components.feature.contextmenu.DefaultSelectionActionDelegate
import mozilla.components.feature.privatemode.notification.PrivateNotificationFeature
import mozilla.components.feature.search.BrowserStoreSearchAdapter
......@@ -56,6 +59,7 @@ import mozilla.components.support.ktx.kotlin.isUrl
import mozilla.components.support.ktx.kotlin.toNormalizedUrl
import mozilla.components.support.locale.LocaleAwareAppCompatActivity
import mozilla.components.support.utils.SafeIntent
import mozilla.components.support.utils.TorUtils
import mozilla.components.support.utils.toSafeIntent
import mozilla.components.support.webextensions.WebExtensionPopupFeature
import org.mozilla.fenix.GleanMetrics.Metrics
......@@ -129,6 +133,8 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
private var isToolbarInflated = false
private var isBeingRecreated = false
private val webExtensionPopupFeature by lazy {
WebExtensionPopupFeature(components.core.store, ::openPopup)
}
......@@ -152,8 +158,11 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
private lateinit var navigationToolbar: Toolbar
private var dialog: RedirectDialogFragment? = null
final override fun onCreate(savedInstanceState: Bundle?) {
components.strictMode.attachListenerToDisablePenaltyDeath(supportFragmentManager)
// There is disk read violations on some devices such as samsung and pixel for android 9/10
components.strictMode.resetAfter(StrictMode.allowThreadDiskReads()) {
super.onCreate(savedInstanceState)
......@@ -369,6 +378,14 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
)
privateNotificationObserver?.stop()
if (!isBeingRecreated && !(application as FenixApplication).isTerminating()) {
// We assume the Activity is being destroyed because the user
// swiped away the app on the Recent screen. When this happens,
// we assume the user expects the entire Application is destroyed
// and not only the top Activity/Task. Therefore we kill the
// underlying Application, as well.
(application as FenixApplication).terminate()
}
}
override fun onConfigurationChanged(newConfig: Configuration) {
......@@ -388,9 +405,31 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
message = "recreate()"
)
isBeingRecreated = true
super.recreate()
}
// Copied from mozac AppLinksFeature.kt
internal fun getOrCreateDialog(): RedirectDialogFragment {
val existingDialog = dialog
if (existingDialog != null) {
return existingDialog
}
SimpleRedirectDialogFragment.newInstance().also {
dialog = it
return it
}
}
private fun isAlreadyADialogCreated(): Boolean {
return findPreviousDialogFragment() != null
}
private fun findPreviousDialogFragment(): RedirectDialogFragment? {
return supportFragmentManager.findFragmentByTag(RedirectDialogFragment.FRAGMENT_TAG) as? RedirectDialogFragment
}
/**
* Handles intents received when the activity is open.
*/
......@@ -402,6 +441,26 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
}
open fun handleNewIntent(intent: Intent) {
val startIntent = intent.getParcelableExtra<PendingIntent>(TorUtils.TORBROWSER_START_ACTIVITY_PROMPT)
if (startIntent != null) {
if (startIntent.creatorPackage == applicationContext.packageName) {
val dialog = getOrCreateDialog()
dialog.onConfirmRedirect = {
@Suppress("EmptyCatchBlock")
try {
startIntent.send()
} catch (error: PendingIntent.CanceledException) {
}
}
dialog.onCancelRedirect = {}
if (!isAlreadyADialogCreated()) {
dialog.showNow(supportFragmentManager, RedirectDialogFragment.FRAGMENT_TAG)
}
}
return
}
// Diagnostic breadcrumb for "Display already aquired" crash:
// https://github.com/mozilla-mobile/android-components/issues/7960
breadcrumb(
......@@ -582,11 +641,17 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
internal fun getModeFromIntentOrLastKnown(intent: Intent?): BrowsingMode {
intent?.toSafeIntent()?.let {
if (it.hasExtra(PRIVATE_BROWSING_MODE)) {
val startPrivateMode = it.getBooleanExtra(PRIVATE_BROWSING_MODE, false)
val startPrivateMode = settings().shouldDisableNormalMode ||
it.getBooleanExtra(PRIVATE_BROWSING_MODE, settings().openLinksInAPrivateTab)
return BrowsingMode.fromBoolean(isPrivate = startPrivateMode)
}
}
return settings().lastKnownMode
return when {
settings().shouldDisableNormalMode -> BrowsingMode.Private
settings().openLinksInAPrivateTab -> BrowsingMode.Private
else -> settings().lastKnownMode
}
}
/**
......
......@@ -21,6 +21,7 @@ import kotlinx.coroutines.launch
import mozilla.components.feature.addons.Addon
import mozilla.components.feature.addons.AddonManagerException
import mozilla.components.feature.addons.ui.translateName
import mozilla.components.support.webextensions.WebExtensionSupport.installedExtensions
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.components
......@@ -112,7 +113,7 @@ class InstalledAddonDetailsFragment : Fragment() {
runIfFragmentIsAttached {
this.addon = it
switch.isClickable = true
privateBrowsingSwitch.isVisible = it.isEnabled()
privateBrowsingSwitch.isVisible = false
privateBrowsingSwitch.isChecked = it.isAllowedInPrivateBrowsing()
switch.setText(R.string.mozac_feature_addons_enabled)
view.settings.isVisible = shouldSettingsBeVisible()
......@@ -238,7 +239,7 @@ class InstalledAddonDetailsFragment : Fragment() {
private fun bindAllowInPrivateBrowsingSwitch(view: View) {
val switch = view.allow_in_private_browsing_switch
switch.isChecked = addon.isAllowedInPrivateBrowsing()
switch.isVisible = addon.isEnabled()
switch.isVisible = false
switch.setOnCheckedChangeListener { v, isChecked ->
val addonManager = v.context.components.addonManager
switch.isClickable = false
......@@ -264,6 +265,8 @@ class InstalledAddonDetailsFragment : Fragment() {
}
}
private fun bindRemoveButton(view: View) {
val isBuiltin = installedExtensions[addon.id]?.isBuiltIn() ?: false
view.remove_add_on.isVisible = !isBuiltin
view.remove_add_on.setOnClickListener {
setAllInteractiveViewsClickable(view, false)
requireContext().components.addonManager.uninstallAddon(
......