Install unsigned XPI on Firefox for Android version 42 or later

I am trying to bring back an old project, an extension for Firefox for Android, I was developing. I have 2 phones, a personal one and one of my work. I have an old version of Firefox (40). It works exactly the same as before. But in the updated version of my work phone (Firefox 46) I can not install .xpi. I always see the “Blocked Add-ons” pop-up with the text “Firefox prevented the installation of the add-in on your device”:

[ OD5c6.png one

I have a preference xpinstall.signatures.required = false . But it does not seem to work. I also have Android Debug enabled. I'm doing it:

 #4 - This will copy the XPI to the phone SD card. adb push $OUTPUT_DIR/$APP_NAME.xpi /sdcard/$APP_NAME.xpi; #5 - This will start the Firefox App with the XPI to install adb shell am start -a android.intent.action.VIEW -c android.intent.category.DEFAULT -d file:///mnt/sdcard/$APP_NAME.xpi -n $ANDROID_APP_ID/.App; 

In the old version of Firefox, this works; in the new one, no. The reason is as follows:

Our first goal is to make adding signatures a little easier for Developers. This API allows you to load XPI and return a signed add-on if it passes all validation checks.

and

Firefox 48: (Popped from Firefox 46). The release and beta of Firefox for desktop does not allow the use of unsigned extensions installed, without overriding. Firefox for Android will add signing and retain the preference - which will be removed in a future release - to allow the user to disable forced signing.

But I need to be able to program without checking: I have to sign the extension very hard every time I make a small change (even to verify that something works).

I already tried to install the night version, because it is intended for developers. I changed xpinstall.signatures.required to false . But behavior is the same message.

So how should we evolve in this way? This is so impractical!

+7
android firefox firefox-addon firefox-addon-sdk
source share
1 answer

I tested this with Walkthrough from MDN. I ran Firefox 48.0, releasing a version. This answer assumes xpinstall.signatures.required set to false in about:config .

The add-in is not installed if you go directly to file:/// URL:
It seems that Firefox has disabled the installation of unsigned extensions by directly clicking on the file:/// link (I have not tested signed extensions yet). Thus, using the adb shell am start -a android.intent.action.VIEW method adb shell am start -a android.intent.action.VIEW using the intent to force Firefox to go to the file:///mnt/sdcard/extentionFile.xpi will only result in a "Blocked Add-on" dialog, without the possibility allow, from which you included a screenshot in your question. This dialog is the same if you manually enter the URL.

You can install the add-in without signing:

You can download the unsigned extension by going to Firefox to the directory containing the .xpi file (for example, file: /// mnt / sdcard / ), then click / tap on the file.

Thus, for adb you will need to open the directory, and not try to open Firefox directly. The adb command you want to use depending on your question will be:

 adb shell am start -a android.intent.action.VIEW -c android.intent.category.DEFAULT -d file:///mnt/sdcard/ -n $ANDROID_APP_ID/.App; 

On your phone you will need to select the file $APP_NAME.xpi . You will be presented with one or more screens through which you can click to install the add-on.

These are the screens that I shot during testing. To have an empty directory, I used /mnt/sdcard/testing/ instead of /mnt/sdcard/ .

Firstly, I used adb to navigate to the directory in Firefox (this is for convenience, you can access it through the phone’s user interface) using the command:

 adb" shell am start -a android.intent.action.VIEW -c android.intent.category.DEFAULT -d file:///mnt/sdcard/testing/ -n org.mozilla.firefox/.App 

This causes Firefox to open the directory ( file:///mnt/sdcard/testing/ ):
1Si0K.png

Press / select the .xpi file. In this case, it is view-source.xpi.

The Blocked Add-on dialog box appears. This dialog box will have the “Allow” installation option. You can skip this dialog by setting xpinstall.whitelist.required to false in about:config . But this still will not allow you to install by directly navigating the file using the intent or entering it into the Firefox user interface]:
3NgLo.png

Then a dialog box will appear asking if you want to install an unverified add-on:
UUnuj.png

After that, the installation is performed:
URSOb.png

+4
source share

All Articles