Willy-JL / F95Checker

GNU General Public License v3.0
101 stars 16 forks source link

Extension installation will always fail for Chromium because of "CRX_REQUIRED_PROOF_MISSING." #125

Closed nazdridoy closed 5 months ago

nazdridoy commented 5 months ago

Since F95Checker tries to install extensions via RPC, it attempts to load http://127.0.0.1:57095/assets/chrome.crx in the browser and expects to auto-install the extension. This method would be very convenient than installing an unpacked extension. but You cannot distribute an extension witch isn't in the Chrome Extension Store. According to the official chrome docs, every extension distributed either from the chrome extension store or outside of it must be uploaded to the chrome extension store. Or you have to modify your local Policies to allow installs from a custom URL.

Besides, most, if not all, modern browsers would warn users about its "potentially harmful nature", which could probably spook some people. Some browsers might outright delete this file. (vivaldi)

2024-02-06_03-04

Chromium won't let you install CRX without the "Chrome Web Store's publisher key hash." 2024-02-06_03-05

https://github.com/chromium/chromium/blob/main/components/crx_file/crx_verifier.cc#L97-L270

chromium/components/crx_file /crx_verifier.cc ```c++ VerifierResult VerifyCrx3( base::File* file, crypto::SecureHash* hash, const std::vector>& required_key_hashes, std::string* public_key, std::string* crx_id, std::vector* compressed_verified_contents, bool require_publisher_key, bool accept_publisher_test_key) { // ... if (public_key_bytes.empty() || !required_key_set.empty()) return VerifierResult::ERROR_REQUIRED_PROOF_MISSING; if (require_publisher_key && !found_publisher_key) return VerifierResult::ERROR_REQUIRED_PROOF_MISSING; // ... VerifierResult Verify( const base::FilePath& crx_path, const VerifierFormat& format, const std::vector>& required_key_hashes, const std::vector& required_file_hash, std::string* public_key, std::string* crx_id, std::vector* compressed_verified_contents) { std::string public_key_local; std::string crx_id_local; base::File file(crx_path, base::File::FLAG_OPEN | base::File::FLAG_READ); // ... // Version number. const uint32_t version = ReadAndHashLittleEndianUInt32(&file, file_hash.get()); VerifierResult result; if (version == 3) { bool require_publisher_key = format == VerifierFormat::CRX3_WITH_PUBLISHER_PROOF || format == VerifierFormat::CRX3_WITH_TEST_PUBLISHER_PROOF; result = VerifyCrx3( &file, file_hash.get(), required_key_hashes, &public_key_local, &crx_id_local, compressed_verified_contents, require_publisher_key, format == VerifierFormat::CRX3_WITH_TEST_PUBLISHER_PROOF); ```
Willy-JL commented 5 months ago

always google ruining shit.

was working great, but im on ungoogled chromium. im more surprised that the other browsers have this bullshit too tbh. if brave has it too thats very disappointing.

Willy-JL commented 5 months ago

even this research looks pretty grim on the matter https://blog.janestreet.com/chrome-extensions-finding-the-missing-proof/

nazdridoy commented 5 months ago

if brave has it too

it does... 😐️

nazdridoy commented 5 months ago

I'd suggest you not package these extensions with the program; it's kind of a bad practice. Instead, you can build these extensions separately and update them when needed. Create a GitHub page to serve extension archives (redirect from the GUI) and provide proper documentation. You have built a very useful tool, but it is in extreme need of proper documentation describing all its features and FAQs

Willy-JL commented 5 months ago

cant even make chrome open chrome://extensions, neither via cli, nor via default open, nor via redirect. this is great.

Willy-JL commented 5 months ago

I'd suggest you not package these extensions with the program; it's kind of a bad practice. Instead, you can build these extensions separately and update them when needed. Create a GitHub page to serve extension archives (redirect from the GUI) and provide proper documentation. You have built a very useful tool, but it is in extreme need of proper documentation describing all its features and FAQs

sounds like effort

Willy-JL commented 5 months ago

i made it pop up an explanation for chrome, when accepted it shows an explorer window where chrome.zip can be found. should atleast be easier than before, although still not as i wouldve liked it by installing via local webserver. this is good enough, i will not lose more time on google's tyranny.

see 3152bccf085b767bc82489b8c6811f94f581a297...8462fecfc62c86ba1eaa7ed413bc6e66b39a1b24

Willy-JL commented 5 months ago

I'd suggest you not package these extensions with the program; it's kind of a bad practice. Instead, you can build these extensions separately and update them when needed. Create a GitHub page to serve extension archives (redirect from the GUI) and provide proper documentation. You have built a very useful tool, but it is in extreme need of proper documentation describing all its features and FAQs

seriously however, if i need to tell people they need to download another separate file along with doing the long roundabout way of installing it, then thats even worse than having it included. i will not do that. the extension will be included. the firefox one we can argue about, but the chrome one will ship with it. we can agree on the documentation side, but i dont really care too much tbh

Willy-JL commented 5 months ago

i made it pop up an explanation for chrome, when accepted it shows an explorer window where chrome.zip can be found. should atleast be easier than before, although still not as i wouldve liked it by installing via local webserver. this is good enough, i will not lose more time on google's tyranny.

see 3152bcc...8462fec

also, this approach solves the dilemma over the proposed appimage distribution. this way, the user doesnt need to go digging for the file to drag and drop, it is shown to them directly.

nazdridoy commented 5 months ago

see 3152bcc...8462fec

If you insist on shipping extension archives, this seems like the best approach so far.

nazdridoy commented 5 months ago

i made it pop up an explanation for chrome, when accepted it shows an explorer window where chrome.zip can be found. should atleast be easier than before, although still not as i wouldve liked it by installing via local webserver. this is good enough, i will not lose more time on google's tyranny. see 3152bcc...8462fec

also, this approach solves the dilemma over the proposed appimage distribution. this way, the user doesnt need to go digging for the file to drag and drop, it is shown to them directly.

i agree. as appimage mounts its AppDir with random characters added to the end of its path. opening file explorer at self_path would be the best option.

nazdridoy commented 5 months ago

and please, try to think of a way to make it a bit more verbose, at least when someone runs it from the CLI. My personal build (with some minor tweaks ) crashed with a 'segmentation fault (core dumped),' and the debug executable didn't provide any information either. While it's nice when programs run without spitting out 30 lines of log messages, bot when someone actively chooses to run it through the terminal and gets no information (absolutely nothing) while trying to debug, it's frustrating. Please give some thought to debugging and troubleshooting.

Willy-JL commented 5 months ago

i agree. as appimages mounts its AppDir with random characters added to the end of its path. opening file explorer at self_path would the best option.

yep. i wouldve wanted it to be step by step, like click ok to open the extensions page, then you click next to show the chrome.zip file, but chrome said no and you cant open chrome:// urls from cli

Willy-JL commented 5 months ago

and please, try to think of a way to make it a bit more verbose, at least when someone runs it from the CLI. My personal build (with some minor tweaks ) crashed with a 'segmentation fault (core dumped),' and the debug executable didn't provide any information either. While it's nice when programs run without spitting out 30 lines of log messages, bot when someone actively chooses to run it through the terminal and gets no information (absolutely nothing) while trying to debug, it's frustrating. Please give some thought to debugging and troubleshooting.

ill try to. but if its a segmentation fault, it is very likely something is wrong with either the browser, or how it is compiled, or with your python install

nazdridoy commented 5 months ago

i agree. as appimages mounts its AppDir with random characters added to the end of its path. opening file explorer at self_path would the best option.

yep. i wouldve wanted it to be step by step, like click ok to open the extensions page, then you click next to show the chrome.zip file, but chrome said no and you cant open chrome:// urls from cli

google-chrome --new-window chrome://desired-url works

Willy-JL commented 5 months ago

google-chrome --new-window chrome://desired-url works

maybe for you, but not for me. and not for most of the web from what ive seen, im not the only one this doesnt work for.

Willy-JL commented 5 months ago

https://superuser.com/questions/1783506/how-to-open-chrome-pages-from-linux-terminal

nazdridoy commented 5 months ago

google-chrome --new-window chrome://desired-url works

maybe for you, but not for me. and not for most of the web from what ive seen, im not the only one this doesnt work for.

vivaldi --new-window chrome://settings works brave --new-window chrome://settings doesn't work.

seems like every browsers trys to handle this differently.

nazdridoy commented 5 months ago

https://superuser.com/questions/1783506/how-to-open-chrome-pages-from-linux-terminal

how about you just open a simple extentionInstallation.gif showing the steps in the browsers?

Willy-JL commented 5 months ago

that could work yeah, but i think step by step is fine for now