Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
For #12289 Add lib-auth for authentication using biometrics or PIN.
Browse files Browse the repository at this point in the history
  • Loading branch information
iorgamgabriel committed Jun 9, 2022
2 parents 40d95a2 + 5e39eba commit 4feb1cf
Show file tree
Hide file tree
Showing 28 changed files with 303 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ componentsGroupId: "org.mozilla.components"
# Synchronized build configuration for all modules
compileSdkVersion: 31
minSdkVersion: 21
targetSdkVersion: 30
targetSdkVersion: 31
1 change: 1 addition & 0 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ tasks:
MOBILE_HEAD_TAG: '${head_tag}'
MOBILE_PIP_REQUIREMENTS: taskcluster/requirements.txt
MOBILE_REPOSITORY_TYPE: git
MOZ_AUTOMATION: "1"
REPOSITORIES: {$json: {mobile: "android-components"}}
ANDROID_SDK_ROOT: /builds/worker/android-sdk
- $if: 'tasks_for in ["github-pull-request"]'
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// If you ever need to force a toolchain rebuild (taskcluster) then edit the following comment.
// FORCE REBUILD 2022-01-13
// FORCE REBUILD 2022-06-02

// Synchronized version numbers for dependencies used by (some) modules
object Versions {
Expand Down Expand Up @@ -53,8 +53,8 @@ object Versions {
const val core = "1.3.2"
const val fragment = "1.3.4"
const val recyclerview = "1.2.0"
const val test = "1.3.0"
const val test_ext = "1.1.2"
const val test = "1.4.0"
const val test_ext = "1.1.3"
const val espresso = "3.3.0"
const val room = "2.4.2"
const val paging = "2.1.2"
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Gecko.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object Gecko {
/**
* GeckoView Version.
*/
const val version = "103.0.20220605065813"
const val version = "103.0.20220607093440"

/**
* GeckoView channel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<!-- The description for a suggestion that represents an opened tab.
Used to distinguish between History search suggestions from your
browsing history and your open tabs -->
<string name="switch_to_tab_description">Alternar para a aba</string>
<string name="switch_to_tab_description">Mudar para a aba</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- Text for context menu item to open the image in a new tab. -->
<string name="mozac_feature_contextmenu_open_image_in_new_tab">Abrir imagen en una pestaña nueva</string>
<!-- Text for context menu item to save / download the link. -->
<string name="mozac_feature_contextmenu_download_link">Enlace de descarga</string>
<string name="mozac_feature_contextmenu_download_link">Descargar enlace</string>
<!-- Text for context menu item to share the link with an other app. -->
<string name="mozac_feature_contextmenu_share_link">Compartir enlace</string>
<!-- Text for context menu item to share the image with an other app. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<!-- Text for confirmation "snackbar" shown after copying a link or image URL to the clipboard. -->
<string name="mozac_feature_contextmenu_snackbar_link_copied">Link copiado para área de transferência</string>
<!-- Action shown in a "snacbkar" after opening a new/private tab. Clicking this action will switch to the newly opened tab. -->
<string name="mozac_feature_contextmenu_snackbar_action_switch">Alternar</string>
<string name="mozac_feature_contextmenu_snackbar_action_switch">Mostrar</string>
<!-- Text for context menu item to open the link in an external app. -->
<string name="mozac_feature_contextmenu_open_link_in_external_app">Abrir link em app externo</string>
<!-- Text for context menu item to share the email with another app. -->
Expand Down
10 changes: 10 additions & 0 deletions components/feature/prompts/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,14 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Opdater kortets udløbsdato?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Kortnummeret vil blive krypteret. Sikkerhedskoden vil ikke blive gemt.</string>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Vælg adresser</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Udvid foreslåede adresser</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Sammenfold foreslåede adresser</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Håndter adresser</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,8 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Ενημέρωση ημερομηνίας λήξης κάρτας;</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Ο αριθμός της κάρτας θα κρυπτογραφηθεί. Ο κωδικός ασφαλείας δεν θα αποθηκευτεί.</string>
</resources>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Επιλογή διευθύνσεων</string>
</resources>
10 changes: 10 additions & 0 deletions components/feature/prompts/src/main/res/values-et/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,14 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Kas uuendada kaardi aegumiskuupäeva?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Kaardi number krüptitakse. Turvakoodi ei salvestata.</string>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Vali aadressid</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Laienda soovitatud aadressid</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Ahenda soovitatud aadressid</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Halda aadresse</string>
</resources>
10 changes: 10 additions & 0 deletions components/feature/prompts/src/main/res/values-eu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,14 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Eguneratu txartelaren iraungitze-data?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Txartel-zenbakia zifratu egingo da. Segurtasun-kodea ez da gordeko.</string>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Hautatu helbideak</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Zabaldu iradokitako helbideak</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Tolestu iradokitako helbideak</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Kudeatu helbideak</string>
</resources>
3 changes: 3 additions & 0 deletions components/feature/prompts/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,7 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Mettre à jour la date d’expiration de la carte ?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Le numéro de carte sera chiffré. Le code de sécurité ne sera pas enregistré.</string>

<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Gérer les adresses</string>
</resources>
10 changes: 10 additions & 0 deletions components/feature/prompts/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,14 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Frissíti a kártya lejárati dátumát?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">A kártyaszám titkosítva lesz. A biztonsági kód nem kerül mentésre.</string>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Címek kiválasztása</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Javasolt címek kibontása</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Javasolt címek összecsukása</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Címek kezelése</string>
</resources>
10 changes: 10 additions & 0 deletions components/feature/prompts/src/main/res/values-is/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,14 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Uppfæra gildistíma korts?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Kortanúmer verður dulritað. Öryggiskóði verður ekki vistaður.</string>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Velja póstföng</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Fletta út tillögum að póstföngum</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Fella saman tillögur að póstföngum</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Sýsla með póstföng</string>
</resources>
10 changes: 10 additions & 0 deletions components/feature/prompts/src/main/res/values-kk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,14 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Картаның жарамдылық мерзімін жаңарту керек пе?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Карта нөмірі шифрленеді. Қауіпсіздік коды сақталмайды.</string>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Адрестерді таңдау</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Ұсынылған адрестерді жазық қылу</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Ұсынылған адрестерді бүктеу</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Адрестерді басқару</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,10 @@
<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Selecionar endereços</string>
</resources>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Expandir endereços sugeridos</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Colapsar endereços sugeridas</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Gerir endereços</string>
</resources>
10 changes: 10 additions & 0 deletions components/feature/prompts/src/main/res/values-sv-rSE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,14 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Uppdatera kortets utgångsdatum?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Kortnummer kommer att krypteras. Säkerhetskoden kommer inte att sparas.</string>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Välj adresser</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Expandera föreslagna adresser</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Komprimera föreslagna adresser</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Hantera adresser</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@
<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">选择地址</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">展开建议的地址</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">折叠建议的地址</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">管理地址</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ class BiometricPromptFeature(
internal inner class PromptCallback : BiometricPrompt.AuthenticationCallback() {
override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
logger.error("onAuthenticationError: errorMessage $errString errorCode=$errorCode")
authenticationCallbacks.onAuthError.invoke(errString.toString())
authenticationCallbacks.onAuthError(errString.toString())
}

override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
logger.debug("onAuthenticationSucceeded")
authenticationCallbacks.onAuthSuccess.invoke()
authenticationCallbacks.onAuthSuccess()
}

override fun onAuthenticationFailed() {
logger.error("onAuthenticationFailed")
authenticationCallbacks.onAuthFailure.invoke()
authenticationCallbacks.onAuthFailure()
}
}
}
35 changes: 33 additions & 2 deletions taskcluster/ac_taskgraph/target_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,42 @@
# 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/.

from taskgraph.target_tasks import _target_task, filter_for_tasks_for
import os
from redo import retry

from taskgraph.target_tasks import _target_task
from taskgraph.util.taskcluster import find_task_id


def index_exists(index_path, reason=""):
print(f"Looking for existing index {index_path} {reason}...")
try:
task_id = find_task_id(index_path)
print(f"Index {index_path} exists: taskId {task_id}")
return True
except KeyError:
print(f"Index {index_path} doesn't exist.")
return False


@_target_task("nightly")
def target_tasks_nightly(full_task_graph, parameters, graph_config):
def filter(task, parameters):
return task.attributes.get("build-type", "") == "nightly"

index_path = (
f"{graph_config['trust-domain']}.v2.{parameters['project']}.branch."
f"{parameters['head_ref']}.revision.{parameters['head_rev']}.taskgraph.decision-nightly"
)
if os.environ.get("MOZ_AUTOMATION") and retry(
index_exists,
args=(index_path,),
kwargs={
"reason": "to avoid triggering multiple nightlies off the same revision",
},
):
return []

return [l for l, t in full_task_graph.tasks.items() if filter(t, parameters)]


Expand All @@ -19,7 +47,10 @@ def filter(task, parameters):
# Mark-as-shipped is always red on github-release and it confuses people.
# This task cannot be green if we kick off a release through github-releases, so
# let's exlude that task there.
if task.kind == "mark-as-shipped" and parameters["tasks_for"] == "github-release":
if (
task.kind == "mark-as-shipped"
and parameters["tasks_for"] == "github-release"
):
return False

return task.attributes.get("build-type", "") == "release"
Expand Down
1 change: 1 addition & 0 deletions taskcluster/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# https://taskcluster-taskgraph.readthedocs.io/en/latest/howto/bootstrap-taskgraph.html

mozilla-version
redo
taskcluster-taskgraph
24 changes: 24 additions & 0 deletions taskcluster/test/params/fork-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
base_repository: https://github.com/JohanLorenzo/android-components
base_rev: 77293b6bb9624749aa421e627f812613aa982557
build_date: 1570437923
do_not_optimize: []
existing_tasks: {}
filters:
- target_tasks_method
head_ref: refs/heads/some-branch
head_repository: https://github.com/JohanLorenzo/android-components
head_rev: f8c343141bab0467aa8faf41d515b2c9d3273c2e
head_tag: ''
level: '1'
moz_build_date: '20191007084523'
optimize_target_tasks: true
owner: [email protected]
project: android-components
pull_request_number: null
pushdate: 0
pushlog_id: '0'
repository_type: git
target_tasks_method: default
tasks_for: github-push
version: '90.0.0'
next_version: '90.0.1'
24 changes: 24 additions & 0 deletions taskcluster/test/params/fork-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
base_repository: https://github.com/JohanLorenzo/android-components
base_rev: UNDEFINED
build_date: 1569932069
do_not_optimize: []
existing_tasks: {}
filters:
- target_tasks_method
head_ref: master
head_repository: https://github.com/JohanLorenzo/android-components
head_rev: 5ce0cc79c8cb2d6479d8b297d6e09238ec730fbf
head_tag: v15.0.0
level: '1'
moz_build_date: '20191001121429'
optimize_target_tasks: true
owner: [email protected]
project: android-components
pull_request_number: null
pushdate: 0
pushlog_id: '0'
repository_type: git
target_tasks_method: release
tasks_for: github-release
version: '90.0.0'
next_version: '90.0.1'
24 changes: 24 additions & 0 deletions taskcluster/test/params/main-repo-cron-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
base_repository: https://github.com/mozilla-mobile/android-components
base_rev: UNDEFINED
build_date: 1570280464
do_not_optimize: []
existing_tasks: {}
filters:
- target_tasks_method
head_ref: master
head_repository: https://github.com/mozilla-mobile/android-components
head_rev: 79636afc6ae17f83f634e8a890ba73097954dd0e
head_tag: ''
level: '3'
moz_build_date: '20191005130104'
optimize_target_tasks: true
owner: [email protected]
project: android-components
pull_request_number: null
pushdate: 0
pushlog_id: '0'
repository_type: git
target_tasks_method: nightly
tasks_for: cron
version: '90.0.0'
next_version: '90.0.1'
Loading

0 comments on commit 4feb1cf

Please sign in to comment.