From 911425451dcb7cf5da282a93fd28618e266155a3 Mon Sep 17 00:00:00 2001 From: akliuxingyuan Date: Fri, 9 Aug 2024 19:23:02 +0800 Subject: [PATCH 1/2] fix #787 --- app/src/main/AndroidManifest.xml | 5 ++-- .../addons/AddonInstallIntentProcessor.kt | 27 ++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 0d62adad8dae..634ef7d86bc0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -236,9 +236,10 @@ - - + + + diff --git a/app/src/main/java/org/mozilla/fenix/addons/AddonInstallIntentProcessor.kt b/app/src/main/java/org/mozilla/fenix/addons/AddonInstallIntentProcessor.kt index 2f3d78669980..7744f9e0e209 100644 --- a/app/src/main/java/org/mozilla/fenix/addons/AddonInstallIntentProcessor.kt +++ b/app/src/main/java/org/mozilla/fenix/addons/AddonInstallIntentProcessor.kt @@ -6,23 +6,30 @@ import mozilla.components.concept.engine.webextension.WebExtension import mozilla.components.concept.engine.webextension.WebExtensionRuntime import mozilla.components.feature.intent.processing.IntentProcessor import mozilla.components.support.ktx.android.net.getFileName +import mozilla.components.support.utils.toSafeIntent import java.io.File import java.io.FileOutputStream class AddonInstallIntentProcessor(private val context: Context, private val runtime: WebExtensionRuntime) : IntentProcessor { + private fun matches(intent: Intent) = + intent.data != null + && intent.scheme.equals("content") + && intent.type in arrayOf("application/x-xpinstall", "application/zip") + override fun process(intent: Intent): Boolean { - if(intent.data == null) { - return false - } - val iuri = intent.data as Uri - if(!iuri.scheme.equals("content")) { - return false + val safeIntent = intent.toSafeIntent() + val url = safeIntent.dataString + + return if (!url.isNullOrEmpty() && matches(intent)) { + val uriData = intent.data as Uri + val file = fromUri(uriData) + val extURI = parseExtension(file) + installExtension(extURI) {} + true + } else { + false } - val file = fromUri(iuri) - val extURI = parseExtension(file) - installExtension(extURI) {} - return true } fun installExtension(b64: String, onSuccess: ((WebExtension) -> Unit)) { From 507acf8a542fa574eb07e3005553324cba620561 Mon Sep 17 00:00:00 2001 From: akliuxingyuan Date: Fri, 9 Aug 2024 19:23:17 +0800 Subject: [PATCH 2/2] add issue template --- .github/ISSUE_TEMPLATE/bug_report.yml | 78 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 40 +++++++++++ README.md | 77 --------------------- 3 files changed, 118 insertions(+), 77 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000000..bd96536f644f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,78 @@ +name: "🐞 Bug report" +description: Create a report to help us improve. +title: "[Bug]: " +labels: ["🐞 bug", "needs:triage"] +body: + - type: markdown + attributes: + value: | + - Please do your best to search for duplicate issues before filing a new issue so we can keep our issue board clean. + - Have a look at ["I want to file an issue!"][info] for more information. + + [info]: https://github.com/fork-maintainers/iceraven-browser#i-want-to-file-an-issue + - type: textarea + attributes: + label: Steps to reproduce + description: Steps to reproduce the behaviour. + placeholder: | + 1. Have a tab open.. + 2. Go to.. + 3. Click on.. + 4. Observe.. + validations: + required: true + - type: textarea + attributes: + label: Expected behaviour + placeholder: A menu should open.. + validations: + required: true + - type: textarea + attributes: + label: Actual behaviour + placeholder: The app closes unexpectedly.. + validations: + required: true + - type: markdown + attributes: + value: | + # Device information + - type: input + attributes: + label: Device name + description: The name of the device model and manufacturer. + placeholder: Google Pixel 2 + validations: + required: false + - type: input + attributes: + label: Android version + description: You can find the Android version information in the About section of your device's system settings. + placeholder: Android 10 + validations: + required: true + - type: input + attributes: + label: Iceraven version + description: You can find this information in Settings -> About Iceraven. + placeholder: 2.22.0 + validations: + required: true + - type: textarea + attributes: + label: Device logs + description: | + Device logs or crash information can greatly aid in debugging. You can find some details here on how to [retrieve device logs or crash IDs][log]. + + [log]: https://github.com/fork-maintainers/iceraven-browser/blob/iceraven/docs/Logging-Crash-Information.md + validations: + required: false + - type: textarea + attributes: + label: Additional information + description: | + If you have any additional information for us, use the field below. + Please note, you can attach screenshots or screen recordings here, by + dragging and dropping files in the field below. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000000..eeea5ed96526 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,40 @@ +name: "⭐️ Feature request" +description: Suggest an idea for this project +title: "[Feature Request]: " +labels: ["🌟 feature request"] +body: + - type: markdown + attributes: + value: | + - Please do your best to search for duplicate issues before filing a new issue so we can keep our issue board clean + - Every issue should have exactly one feature request described in it. Please do not file feedback list tickets as it is difficult to parse them and address their individual points + - Feature Requests are better when they’re open-ended instead of demanding a specific solution e.g: “I want an easier way to do X” instead of “add Y” + - Read https://github.com/fork-maintainers/iceraven-browser#i-want-to-file-an-issue for more information + + - type: textarea + attributes: + label: Feature Summary + description: What is the user problem or growth opportunity you want to see solved? + validations: + required: true + + - type: textarea + attributes: + label: Feature Research + description: How do you know that this problem exists today? Why is this important? + validations: + required: true + + - type: textarea + attributes: + label: Alternative Solution + description: Other possible solutions, if any. + validations: + required: false + + - type: textarea + attributes: + label: Target beneficiaries + description: Who will benefit from it? + validations: + required: true diff --git a/README.md b/README.md index ec366c772c3b..6bd8e62f4a2f 100644 --- a/README.md +++ b/README.md @@ -131,83 +131,6 @@ To make it easier to triage, we have these issue requirements: Please keep in mind that even though a feature you have in mind may seem like a small ask, as a small team, we have to prioritize our planned work and every new feature adds complexity and maintenance and may take up design, research, product, and engineering time. We appreciate everyone’s passion but we will not be able to incorporate every feature request or even fix every bug. That being said, just because we haven't replied, doesn't mean we don't care about the issue, please be patient with our response times as we're very busy. -Note: If while pushing you encounter this error "Could not initialize class org.codehaus.groovy.runtime.InvokerHelper" and are currently on Java14 then downgrading your Java version to Java13 or lower can resolve the issue - -Steps to downgrade Java Version on Mac with Brew: -1. Install Homebrew (https://brew.sh/) -2. run ```brew update``` -3. To uninstall your current java version, run ```sudo rm -fr /Library/Java/JavaVirtualMachines/``` -4. run ```brew tap homebrew/cask-versions``` -5. run ```brew search java``` -6. If you see java11, then run ```brew install java11``` -7. Verify java-version by running ```java -version``` - -## local.properties helpers -You can speed up local development by setting a few helper flags available in `local.properties`. Some flags will make it easy to -work across multiple layers of the dependency stack - specifically, with android-components, geckoview or application-services. - -### Automatically sign release builds -To sign your release builds with your debug key automatically, add the following to `/local.properties`: - -```sh -autosignReleaseWithDebugKey -``` - -With this line, release build variants will automatically be signed with your debug key (like debug builds), allowing them to be built and installed directly through Android Studio or the command line. - -This is helpful when you're building release variants frequently, for example to test feature flags and or do performance analyses. - -### Building debuggable release variants - -Nightly, Beta and Release variants are getting published to Google Play and therefore are not debuggable. To locally create debuggable builds of those variants, add the following to `/local.properties`: - -```sh -debuggable -``` - -### Setting raptor manifest flag - -To set the raptor manifest flag in Nightly, Beta and Release variants, add the following to `/local.properties`: - -```sh -raptorEnabled -``` - -### Auto-publication workflow for application-services and glean -If you're making changes to these projects and want to test them in Fenix, auto-publication workflow is the fastest, most reliable -way to do that. - -In `local.properties`, specify a relative path to your local `glean` and/or `application-services` projects. E.g.: -- `autoPublish.glean.dir=../glean` -- `autoPublish.application-services.dir=../application-services` - -Once these flags are set, your Fenix builds will include any local modifications present in these projects. - -See a [demo of auto-publication workflow in action](https://www.youtube.com/watch?v=qZKlBzVvQGc). - -In order to build successfully, you need to check out a commit in the dependency repository that has no breaking changes. The two best ways to do this are: -- Run the `/tools/list_compatible_dependency_versions.py` script to output a compatible commit -- Check out the latest commit from main in this repository and the dependency repository. However, this may fail if there were breaking changes added recently to the dependency. - -If you're trying to build fenix with a local ac AND a local GV, you'll have to use another method: see [this doc](https://github.com/mozilla-mobile/fenix/blob/main/docs/substituting-local-ac-and-gv.md). - -### Using Nimbus servers during local development -If you're working with the Nimbus experiments platform, by default for local development Fenix configures Nimbus to not use a server. - -If you wish to use a Nimbus server during local development, you can add a `https://` or `file://` endpoint to the `local.properties` file. - -- `nimbus.remote-settings.url` - -Testing experimental branches should be possible without a server. - -### Using custom Glean servers during local development -If you wish to use a custom Glean server during local development, you can add a `https://` endpoint to the `local.properties` file. - -- `glean.custom.server.url` - -### GeckoView -For building with a local checkout of `mozilla-central` see [Substituting Local GeckoView](https://github.com/mozilla-mobile/firefox-android/blob/main/fenix/docs/substituting-local-gv.md) - ## License