Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portability on Windows #591

Merged
merged 2 commits into from
Nov 19, 2018
Merged

Portability on Windows #591

merged 2 commits into from
Nov 19, 2018

Conversation

crazy-max
Copy link
Contributor

@crazy-max crazy-max commented Nov 18, 2018

Closes #444

About

The purpose of this PR is to allow the portability of Chromium on Windows with the addition of two new switches :

  • disable-machine-id : Allows disabling the machine ID generation on Windows.
  • disable-encryption : Allows disabling encryption of cookies, passwords, settings. Should be ONLY used if your hard drive is encrypted or if you know what you are doing 🙃

This allows the portability of everything, except certificates.

Related threads :

Test

disable-machine-id

  • Launch chormium with switch --disable-machine-id
  • Install an extension
  • Close chormium and copy data to a second computer
  • Launch chormium on the second computer
  • The extension must be ok

disable-encryption

  • Launch chormium with switch --disable-encryption
  • Login to a known website with credentials and save them (will add unencrypted cookies and passwords to database)
  • Close chormium and copy data to a second computer
  • Launch chormium on the second computer
  • You must be still logged in on the website and credentials must be kept intact in the database

use both switches

  • Previous and following settings must be ok too :
    • Default search engine
    • Homepage
    • Startup pages
    • Pinned tabs

@Eloston
Copy link
Member

Eloston commented Nov 19, 2018

Looking good, but a couple questions:

  1. Why is this marked as a WIP? What else needs to be done?
  2. What happens if you disable machine ID but leave encryption enabled? Is encryption still tied to the current machine? Are the machine ID and encryption mechanisms independent of each other?

@Eloston Eloston added this to the 70.x.x.x milestone Nov 19, 2018
@crazy-max
Copy link
Contributor Author

@Eloston

  1. WIP to handle certificates but I think we cannot do something about it so feel free to remove the WIP :)
  2. For me encryption is not tied to machine-id. Machine ID seems to be linked to extensions and only used on Windows.

@crazy-max crazy-max changed the title [WIP] Portability on Windows Portability on Windows Nov 19, 2018
@Eloston
Copy link
Member

Eloston commented Nov 19, 2018

BTW on Windows, does Chromium store credentials internally in the user data directory by default? Or is there a credential storage mechanism that Chromium uses? I'm trying to understand why passwords are included in the encryption.

@crazy-max
Copy link
Contributor Author

@Eloston Passwords are stored in the user data directory in a sqlite database called Login Data with the following schema :

BEGIN TRANSACTION;
CREATE TABLE stats (origin_domain VARCHAR NOT NULL, username_value VARCHAR, dismissal_count INTEGER, update_time INTEGER NOT NULL, UNIQUE(origin_domain, username_value));
CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR);
CREATE TABLE logins (origin_url VARCHAR NOT NULL, action_url VARCHAR, username_element VARCHAR, username_value VARCHAR, password_element VARCHAR, password_value BLOB, submit_element VARCHAR, signon_realm VARCHAR NOT NULL, preferred INTEGER NOT NULL, date_created INTEGER NOT NULL, blacklisted_by_user INTEGER NOT NULL, scheme INTEGER NOT NULL, password_type INTEGER, times_used INTEGER, form_data BLOB, date_synced INTEGER, display_name VARCHAR, icon_url VARCHAR, federation_url VARCHAR, skip_zero_click INTEGER, generation_upload_status INTEGER, possible_username_pairs BLOB, UNIQUE (origin_url, username_element, username_value, password_element, signon_realm));
CREATE INDEX stats_origin ON stats(origin_domain);
CREATE INDEX logins_signon ON logins (signon_realm);
COMMIT;

@crazy-max
Copy link
Contributor Author

And Chromium uses CryptProtectData to encrypt passwords in the password_value BLOB.

@Eloston
Copy link
Member

Eloston commented Nov 19, 2018

I see, it kinda sucks that the Windows version doesn't use a credentials storage. Thanks for the info.

Copy link
Member

@Eloston Eloston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@Eloston Eloston merged commit 3c204f2 into ungoogled-software:master Nov 19, 2018
@caspertone2003
Copy link

@crazy-max
@Eloston
Thanks!
Good job, much desired behaviour.

@xixiranran
Copy link

请问这两个参数现在还支持最新的chrome吗?

@GeographicCone
Copy link

Thank you for this patch. Works great with 76.0.3809.100.

@crazy-max
Copy link
Contributor Author

Hi @Eloston,

Looks like the patches for portability on Windows have been removed?

@Eloston
Copy link
Member

Eloston commented Mar 23, 2020

@crazy-max This was merged before the fragmentation refactor (i.e. before platform repos were created). They now live in here: https://github.com/ungoogled-software/ungoogled-chromium-windows/tree/master/patches/ungoogled-chromium/windows

@crazy-max
Copy link
Contributor Author

@Eloston Perfect thanks

@gilluc
Copy link

gilluc commented Oct 30, 2020

Why appdata/local/chromium is not stored just beside chromium.exe to be really portable??
This could make it possible for me to use ungoogled chromium on my two pcs from my Nextcloud drive...
I would have the same extensions and bookmarks.

@mikhoul
Copy link

mikhoul commented Oct 6, 2021

@Eloston @crazy-max I have a question I want to transfer my "user data" profile (from my Windows desktop) to my Windows laptop without having to reinstall all my extensions and configure their settings.

There is also unpacked customized extensions in dev mode that I want to transfer too (they are inside a specific sub-folder inside the "user data" folder. Of course I want to keep all the custom settings and flags related to the browser.

My question is: **How I can transfer all my extensions (packed/unpacked with their settings) + the browser/flags settings with the disable-machine-id/disable-encryption switch ??? 🤔

I'm not sure of the right procedure since my extensions were installed without the "disable-machine-id" switch

Regards :octocat:

@iGom
Copy link

iGom commented Jul 5, 2022

Do we also lose history, settings, extensions and bookmarks even when we update/upgrade ungoogled-chromium on the same machine on Windows??? Because that's what happened to me right now.

@MarvinFS
Copy link

MarvinFS commented Mar 6, 2024

I have been using command line switches disable-machine-id and disable-encryption for ages now, all was good, but I noticed on the main project website these 2 parameters are now crossed out, but I can't find any details what happened. Also with the latest build I noticed all my cookies doesn't survive browsers restart and I'm forced to login to absolutely all sites from scratch each time, which is a huge issue for me. I initially thought that is related to 3PCD, but doesn't seems like, as I manually marked all my required websites as allowed for 3rd party cookies still if I restart the browser I'm forced to login again everywhere absolutely. I was never the case and something changed only in the latest build 122.xxx, but I'm unable to find what it was exactly. Any suggestions are appreciated; possible to DM if needed.
image

@mavorse
Copy link

mavorse commented Apr 10, 2024

Do these switches still work with the current version of Chromium? I tried using them on Vivaldi, and they didn't seem to function.

@ltguillaume
Copy link

@mavorse Apparently it's --disable-encryption-win now, see macchrome/winchrome#135

@tomasz1986
Copy link

tomasz1986 commented Apr 11, 2024

@mavorse Apparently it's --disable-encryption-win now, see macchrome/winchrome#135

According to https://github.com/ungoogled-software/ungoogled-chromium-windows/blob/master/patches/ungoogled-chromium/windows/windows-disable-encryption.patch, the switch should still be just --disable-encryption. Please keep in mind that the binaries from https://github.com/macchrome/winchrome are not official and may have additional modifications in comparison to the official Windows binaries distributed by https://github.com/ungoogled-software.

@ltguillaume
Copy link

This isn't a change by macchrome, I know that for sure (see the issue I linked). That being said, I myself didn't have any success using --disable-encryption-win, but some others reported they did.

@Nifury
Copy link
Member

Nifury commented Apr 11, 2024

Well, passing --disable-encryption-win to chromium is the same as passing nothing. It's just an invalid argument.
disable-encryption-win doesn't even exist in either UG or winchrome.
image

@ltguillaume
Copy link

Ha! I knew it! Thanks for checking this and sorry for paying forward false information. I'll report back to those who think it worked.

@ltguillaume
Copy link

I just saw this patch related to the issue: Alex313031/thorium@1ac0e00

@AJolly
Copy link

AJolly commented May 10, 2024

Fyi if you reaaally want its possible to export dpapi keys and also resign chrome/chromiums securepreferences.

@AJolly
Copy link

AJolly commented Jul 20, 2024

Also the issue with the current patches is if you ever accidentally run the exe without having those cli flags set, it'll wipe out the existing settings. ie #668

@PF4Public
Copy link
Contributor

@AJolly Please file proper issues into Windows repository if you think those issues are a significant ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Portability under Windows OS