ungoogled-software / ungoogled-chromium-android

Android build for ungoogled-chromium
GNU General Public License v3.0
495 stars 42 forks source link

Native crash in extension install #20

Closed androidacy-user closed 4 years ago

androidacy-user commented 4 years ago

Please at least answer all questions marked with * below. Issues without answering these questions will be closed.

*Device info (please complete the following information):

*Is the bug related to extensions? Yes

*If not related to extensions, can the bug be reproduced with corresponding Chromium version? No

*Describe the bug A clear and concise description of what the bug is.

Native crash on installing chromium-web-store extension: https://del.dog/uzovukirut

Weirdly nothing in logcat besides activity manager killing the process

*To Reproduce Steps to reproduce the behavior:

  1. Go to install the extension via chrome://extensions
  2. See error

*Expected behavior A clear and concise description of what you expected to happen. Extension loads as expected

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

wchen342 commented 4 years ago

I need the Java backtrace. It should be above the tomestone you posted.

androidacy-user commented 4 years ago

Nope, bliss offered to grab the trace automatically on crash, nothing in logcat. I'll even send it

wchen342 commented 4 years ago

That doesn't sound right. Can you post the whole log somewhere? Or what is the extension id you are installing? Maybe I can reproduce it.

androidacy-user commented 4 years ago

Here you go, maybe I just overlooked it

https://transfer.sh/45zrX/logcat_06-23-2020_22-41-23.txt

androidacy-user commented 4 years ago

That doesn't sound right. Can you post the whole log somewhere? Or what is the extension id you are installing? Maybe I can reproduce it.

It's the chromium-web-store extension linked in the faq

wchen342 commented 4 years ago

Oh that one. I was trying to integrate it somehow in the extension-supoort version so ppl can install from WebStore directly. Installation of that extension doesn't seem to work now, which I assume is because it lacks metadata like extension id/hash/etc. because it is not an official extension.

androidacy-user commented 4 years ago

Also reproducible with ublock origin

wchen342 commented 4 years ago

That seems to be a different problem since ublock origin installs fine here and by others. Which method are you using to install the extension (developer mode/url download)?

androidacy-user commented 4 years ago

Developer mode, crx download says can't open file, even with the chrome://flags/#extension-mime-request-handling on (set to always prompt to install)

wchen342 commented 4 years ago

Do you have a screenshot of 'can't open file'? Do you have anything blocking storage access?

androidacy-user commented 4 years ago

Testing on a clean profile FYI, wiped app data just to be sure

androidacy-user commented 4 years ago

Do you have a screenshot of 'can't open file'? Do you have anything blocking storage access?

Storage access was actually the first thing I thought of, since it didn't request it but no didn't help

androidacy-user commented 4 years ago

Screen record of issue

https://transfer.sh/AFuEj/ScreenRecord-20200623-230322.mp4

androidacy-user commented 4 years ago

https://transfer.sh/KsI5O/Screenshot_20200623-230516_Permission_controller.png

wchen342 commented 4 years ago

I think I found the error: Caused by: java.lang.IllegalArgumentException: Invalid URI: content://com.android.externalstorage.documents/document/primary%3AChromium.Web.Store%2Fmanifest.json

It is probably ROM specific cause I cannot see what is wrong with the URI. Usually it is tree/primary though, but I suppose that is not the cause.

androidacy-user commented 4 years ago

Have you checked on Android 10? Afaik storage access got a lot stricter and was changed around

wchen342 commented 4 years ago

So the 'can't open file' is for chromium-webstore, it is normal because of the reason I mentioned above. I thought it is also true for uBlock Origin.

One purpose of the url-download method is to get around the Android 10 access problem. See the discussion in https://github.com/wchen342/ungoogled-chromium-android/issues/27

androidacy-user commented 4 years ago

So the 'can't open file' is for chromium-webstore, it is normal because of the reason I mentioned above. I thought it is also true for uBLock Origin.

One purpose of the url-download method is to get around the Android 10 access problem. See the discussion in https://github.com/wchen342/ungoogled-chromium-android/issues/27

If only it didn't tell me it can't open the file xD

wchen342 commented 4 years ago

Well the screen you posted is actually the native download manager which is outside chromium so I have no control, and the normal way it works is when the download finishes chromium will unpack the extension by itself and prompt for installation immediately.

androidacy-user commented 4 years ago

Ok, the chrome webstore direct link works for ublock origin, I get the prompt to install

However obviously that's not an option for chromium-web-store

androidacy-user commented 4 years ago

Well the screen you posted is actually the native download manager which is outside chromium so I have no control, and the normal way it works is when the download finishes crhomium will unpack the extension by itself and prompt for installation immediately.

There's no reason non default behavior should be exhibited; this is a default browser profile and I've seen a ROM break many things, documentprovider isn't one of them

wchen342 commented 4 years ago

However obviously that's not an option for chromium-web-store

Yes, and I tried on desktop chromium and that doesn't work too, so it is more like a problem of the crx file. The author has been contacted.

There's no reason non default behavior should be exhibited; this is a default browser profile and I've seen a ROM break many things z documentprovider isn't one of them

The crx file is not meant to be opened like a normal file directly on Android, because chromium is not configure as an application to open crx file extension. The way extension-mime-request-handling actually works is chromium download the crx to a temp dir and verify-unpack-install it immediately after the downloading completed and (1) if there was no error the temp file will be remove and the extension got installed, or (2) if there was an error the installation will be cancelled and the temp file got renamed to it's original filename and moved to the destination folder, as a normal downloading. That is why you ended up seeing the crx file in download manager, which will only happen when the installation was not successful.

androidacy-user commented 4 years ago

However obviously that's not an option for chromium-web-store

Yes, and I tried on desktop chromium and that doesn't work too, so it is more like a problem of the crx file. The author has been contacted.

There's no reason non default behavior should be exhibited; this is a default browser profile and I've seen a ROM break many things z documentprovider isn't one of them

The crx file is not meant to be opened like a normal file directly on Android, because chromium is not configure as an application to open crx file extension. The way extension-mime-request-handling actually works is chromium download the crx to a temp dir and verify-unpack-install it immediately after the downloading completed and (1) if there was no error the temp file will be remove and the extension got installed, or (2) if there was an error the installation will be cancelled and the temp file got renamed to it's original filename and moved to the destination folder, as a normal downloading. That is why you ended up seeing the crx file in download manager, which will only happen when the installation was not successful.

Okay, got it

So now we wait on the chromium-web-store developer

wchen342 commented 4 years ago

So now we wait on the chromium-web-store developer

Right. I am also trying to bundle it with the extension support version but haven't figured out how.

wchen342 commented 4 years ago

chromium-webstore is bundled with the extension-support version since 468442f.