Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/iceraven' into iceraven
Browse files Browse the repository at this point in the history
  • Loading branch information
akliuxingyuan committed Aug 20, 2024
2 parents 75c6bff + 507acf8 commit b12e07a
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 89 deletions.
78 changes: 78 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -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
77 changes: 0 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<jdk-version>```
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 `<proj-root>/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 `<proj-root>/local.properties`:

```sh
debuggable
```

### Setting raptor manifest flag

To set the raptor manifest flag in Nightly, Beta and Release variants, add the following to `<proj-root>/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 `<android-components>/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


Expand Down
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@
<data android:scheme="file" />
<data android:scheme="content"/>
<data android:host="*" />
<data android:pathPattern=".*\\.xpi"/>
<data android:pathPattern=".*\\.zip"/>
<data android:pathSuffix=".xpi"/>
<data android:pathSuffix=".zip"/>
<data android:mimeType="application/x-xpinstall"/>
<data android:mimeType="application/zip"/>
</intent-filter>

<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit b12e07a

Please sign in to comment.