diff --git a/scripts/langindex.json b/scripts/langindex.json index eafbc0172..0a6ce80f0 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -1475,6 +1475,7 @@ "core.cannotconnect": "local_moodlemobileapp", "core.cannotdownloadfiles": "local_moodlemobileapp", "core.cannotinstallapk": "local_moodlemobileapp", + "core.cannotinstallapkinfo": "local_moodlemobileapp", "core.cannotlogoutpageblocks": "local_moodlemobileapp", "core.cannotopeninapp": "local_moodlemobileapp", "core.cannotopeninappdownload": "local_moodlemobileapp", diff --git a/src/core/lang.json b/src/core/lang.json index 48821d5b4..4f0734c0b 100644 --- a/src/core/lang.json +++ b/src/core/lang.json @@ -16,7 +16,8 @@ "cancel": "Cancel", "cannotconnect": "Can't connect to site", "cannotdownloadfiles": "Your school or learning provider has disabled downloading files.", - "cannotinstallapk": "For security reasons, you can't install unknown apps on your device from this app. Please open the file using a browser.", + "cannotinstallapk": "Can't install .apk files", + "cannotinstallapkinfo": "For security reasons, you can't install unknown apps on your device from this app. If you still want to proceed with the installation, you need to open it in a browser.", "cannotlogoutpageblocks": "Please save or discard your changes before continuing.", "cannotopeninapp": "This file may not work as expected on this device. Would you like to open it anyway?", "cannotopeninappdownload": "This file may not work as expected on this device. Would you like to download it anyway?", diff --git a/src/core/services/utils/utils.ts b/src/core/services/utils/utils.ts index c241d3c2b..b312ce0ad 100644 --- a/src/core/services/utils/utils.ts +++ b/src/core/services/utils/utils.ts @@ -999,13 +999,19 @@ export class CoreUtilsProvider { // @todo MOBILE-4167: Handle urls with expired tokens. throw new CoreErrorWithOptions( + Translate.instant('core.cannotinstallapkinfo'), Translate.instant('core.cannotinstallapk'), - undefined, url - ? [{ - text: Translate.instant('core.openinbrowser'), - handler: () => this.openInBrowser(url), - }] + ? [ + { + text: Translate.instant('core.openinbrowser'), + handler: () => this.openInBrowser(url), + }, + { + text: Translate.instant('core.cancel'), + role: 'cancel', + }, + ] : undefined, ); }