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

Build a Cromite SystemWebView #159

Open
4 tasks done
TadaCZE opened this issue Aug 4, 2023 · 91 comments
Open
4 tasks done

Build a Cromite SystemWebView #159

TadaCZE opened this issue Aug 4, 2023 · 91 comments
Labels
need triage I will look into it, I promise! task These are things I tell myself I should do user report is a user report

Comments

@TadaCZE
Copy link

TadaCZE commented Aug 4, 2023

Preliminary checklist

  • I have read the README
  • I have read the FAQs.
  • I have searched existing issues for my feature request. This is a new issue (NOT a duplicate) and is not related to another issue.
  • This is a feature request for the Cromite browser; not the website nor F-Droid nor anything else.

Is your feature request related to privacy?

Yes

Is there a patch available for this feature somewhere?

Code for this is likely already present in the codebase.

Describe the solution you would like

As Bromite, which this project is a continuation of, provided a privacy-preserving systemwebview, it should likely be possible for a Cromite one to exist. I believe that if the codebase hasn't strayed from Bromite too much, the action will be somewhat easy.

As I have used the Bromite SystemWebView for a long time, it would be sad to have to stop using it.

Describe alternatives you have considered

You could alternatively delete all the text referencing the Bromite WebView from the project so there would be no confusion and possibly provide a link to a project with an up-to-date one.

@LeOS-GSI

This comment was marked as off-topic.

@Jojoxzx
Copy link

Jojoxzx commented Aug 8, 2023

Making a webview is indeed a very good idea, and it would be very nice if it could be used without overlay like bromite or mulch

@LeOS-GSI
Copy link

LeOS-GSI commented Aug 8, 2023

bromite or mulch webview needing also a change of config_webview_packages.xml. It's for all custom webview the same.

First is always integration in a custom rom or GSI. the name (and key) of the custom webview must be added in config_webview_packages.xml. OK, you can put that xml in an overlay, like LOS is doing. But I'm not sure, that it will work it you will but the overlay in a finished build.

attached the xml for my webview (you must rename it from txt to xml)

config_webview_packages.txt

@Universalizer
Copy link

For Rooted Android OR Non-Rooted ?

@LeOS-GSI
Copy link

LeOS-GSI commented Aug 8, 2023

For Rooted Android OR Non-Rooted ?

If you want push an overlay and webview.apk to your device, you will need root and system RW

@Jojoxzx

This comment was marked as off-topic.

@LeOS-GSI
Copy link

LeOS-GSI commented Aug 8, 2023

OK, that are old files and I don't know what they have done. If you will use this way you should better contact the developer of theses hacked apk's.
I'm not a friend of these kind of hacks and I think you won't find any webview developer who will build such a apk.

@LeOS-GSI

This comment was marked as off-topic.

@Jojoxzx

This comment was marked as off-topic.

@LeOS-GSI

This comment was marked as off-topic.

@Jojoxzx
Copy link

Jojoxzx commented Aug 9, 2023

Are you sure he has not added some bad code like keylogger in the apk

You overestimate the openness of the source code, because there are a lot of people, not programmers, who can't read code, and even if you are a programmer, how many programmers do you think read other people's code, well, you can make an application and I'm sure that at least 60% of people who download something either don't know or don't even want to.

To answer your question - no, I'm not sure, but at least on webview 113 I could remove the permission for an application to access the Internet, since 114 version there are problems with this. And to add to my answer, I'm not sure about any opensource and I don't think anyone should believe in it.

In our world at least 2 things are overrated: opensouce and democracy. ©Me

@Universalizer
Copy link

#99

For current time, (temporary) Chrome Custom Tabs may be solution.

@uazo
Copy link
Owner

uazo commented Aug 9, 2023

Build a Cromite SystemWebView

I repeat, no intention to compile the webview, at least until I understand its usefulness.

You overestimate the openness of the source code, because there are a lot of people, not programmers, who can't read code, and even if you are a programmer, how many programmers do you think read other people's code

think of it the other way around, it only takes 1 programmer capable of reading code to find a keylogger in an opensource project

@uazo uazo closed this as completed Aug 9, 2023
@LeOS-GSI
Copy link

LeOS-GSI commented Aug 9, 2023

it only takes 1 programmer capable of reading code to find a keylogger in an opensource project

agree to 100%. But the problem is, that these cracked webview apks are not FOSS anymore.

@Universalizer
Copy link

it only takes 1 programmer capable of reading code to find a keylogger in an opensource project

agree to 100%. But the problem is, that these cracked webview apks are not FOSS anymore.

By license ?
OR
Something else.

@Jojoxzx
Copy link

Jojoxzx commented Aug 10, 2023

at least until I understand its usefulness.

  1. update by
  2. from alternatives only mulch (f-droid says "upstreamnonfree") or chromium without additional patches
  3. not everyone uses chromite browser
  4. a lot of people have been using bromite webview and want to continue, that's why they are asking for chromite webview.

it only takes 1 programmer capable of reading code to find a keylogger in an opensource project

I don't know much about your opensourse, so I'll ask the question "What will this programmer do if he sees such a keylogger or something else?". Can he file a request to shut down the project? And if he can, as I say, there are a lot of people who don't understand all this, the project can be closed, and the application is already installed and a person just thinks that updates are not released, but the application is beautiful, it works - so I'll use it, it's a two-way street, as far as I'm concerned, just like if you download an application from the playmarket and believe the programmer or the Google protection itself. I've pissed off all my friends that there are better alternatives, which are without trackers and without all the tinsel, even the programmer among them is 1 and all of them did not care whether they are watched or not, not a reason to judge them all, but the trend is clearly there.

@LeOS-GSI
Copy link

FOSS= Free Open Source Software. The sources must be available for everyone and much more. Read wiki about GPL.
The sources for the hacked apks are NOT available. So it's not FOSS anymore !!!!!!

to 4. --> People which are using Mulch or Bromite webview are using it, because it is default in their custom ROM/GSI or installing it with an MagisK module. All other ways a breaking the rules and as I have written before: Noone knows what is all hacked in the apk, because the sources of this new created apk are not available anymore.

@LeOS-GSI
Copy link

it only takes 1 programmer capable of reading code to find a keylogger in an opensource project

agree to 100%. But the problem is, that these cracked webview apks are not FOSS anymore.

By license ? OR Something else.

my lst words to this tasks: If Uazo will build a cromite webview, it won't work til it will be hacked. Because ALL standard webview builds (like my LeOSium webview) need to be included in the build.

@uazo
Copy link
Owner

uazo commented Aug 22, 2023

this is an interesting use.

Export android_webview as java library
https://groups.google.com/a/chromium.org/g/chromium-dev/c/QOqR1yKXpMM

I'm using a WebView for my app, but I don't want to depend on the Android
system WebView. Instead, I want to build it myself and include it in my
app. Thanks

If they explain how to do it, we can talk about it again.

EDIT: message deleted

@erredi
Copy link

erredi commented Aug 25, 2023

If they explain how to do it, we can talk about it again.

If you are looking for how to build webview here are some indications:

https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/build-instructions.md

https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/quick-start.md

since it is of common interest the webview, I would have also started to study and understand better how to compile it anyway

@uazo
Copy link
Owner

uazo commented Aug 25, 2023

If you are looking for how to build webview here are some indications

no, I was pointing to what he had written, but the message was deleted, I didn't know it could be done, I transcribed it in the comment, it was #159 (comment)

@LeOS-GSI
Copy link

I'm using this script, but with other patches
https://gitlab.com/divested-mobile/mulch

@uazo
Copy link
Owner

uazo commented Aug 25, 2023

from https://gitlab.com/divested-mobile/mulch

The WebView here is not meant to be used as is, but compiled into an OS

is not the same thing
what I am saying it is closer to what https://redmine.stoutner.com/issues/86 would like to do

@LeOS-GSI
Copy link

Ah, ok

@Archeix7
Copy link

So we can wait cromite webview soon?

@jaredmontoya
Copy link

jaredmontoya commented Sep 3, 2023

All we really need is a system webview apk similar to Bromite's. All the hassle of allowing webview to be used by android that @LeOS-GSI mentioned is already gone even on read only systems if you have magisk and lsposed installed and working. Just install and enable https://github.com/neoblackxt/AnyWebView/releases/download/v1.2/AnyWebView_1.2_experimental.apk in lsposed and all webviews will be allowed. (Note: you should install a custom system webview for every user)

Mulch System Webview is better than stock and can be a replacement for Bromite System Webview but I think that Cromite System Webview is still important because:

  • As far as I know Cromite/Bromite has more patches than Mulch (not sure)
  • Bromite is dead and Cromite is expected to be an attempt at it's revival which should also include Bromite System Webview's revival.
  • In the open issue that was mentioned right above it had been mentioned that if Cromite had a System Webview it would fit great for the discussed usecase

As you can see people want Cromite System Webview to exist, so please reconsider supporting it as well @uazo 🙏🙏🙏

@Universalizer
Copy link

#99 (comment)

For current time, (temporary) Chrome Custom Tabs may be solution.

I repeat, temporary solution !

@uazo
Copy link
Owner

uazo commented Dec 16, 2023

by disabling vulkan, everything seems to work except, of course, the site settings

Details

image

@uazo
Copy link
Owner

uazo commented Dec 16, 2023

I wonder if adblock also works, but I don't think so, it will only (I hope) be missing the activation of services.
EDIT: in fact, only the legacy adblock is active

@basilgello
Copy link

As for reducing necessary disk space - I am experimenting with CCACHE_BASEDIR and the build is running now.

@uazo
Copy link
Owner

uazo commented Dec 16, 2023

so, in the end it can be done, and for now without much effort.
the user settings ui is missing, but I think it can be done, retrieving it from the browser part.
and a check has to be made on how it works in general, because I do not know that part of the code.

@basilgello
Copy link

Building both Cromite and Webview in same outdor does save time and space:

ninja -C out/arm64 chrome_public_apk
ninja -C out/arm64 system_webview_apk

But seems you did not remove AWSeedVariationFetcher services from webview's AndroidManifest.xml so my build failed :(

@basilgello
Copy link

The failure is ProGuard trying to keep these classes while they have gone after patches.

@uazo
Copy link
Owner

uazo commented Dec 16, 2023

But seems you did not remove AWSeedVariationFetcher services from webview's AndroidManifest.xml so my build failed :(
The failure is ProGuard trying to keep these classes while they have gone after patches.

I made a clean build, source from the commit, without any changes.

@basilgello
Copy link

basilgello commented Dec 16, 2023

How do you invoke WebView build? I invoke like I posted above - system_webview_apkafter chrome_public_apk. The WebView step fails with ProGuard not finding AWSeedVariationFetcher class to keep. In my patches I did remove these services from AndroidManifest.xml to make the build complete.

@basilgello
Copy link

https://github.com/uazo/cromite/files/13637516/0003-android_webview-Drop-AWVariationSeedFetcher-service.patch this one is needed to build two apks in one outdir sequentially.

@uazo
Copy link
Owner

uazo commented Dec 16, 2023

How do you invoke WebView build?

gn gen --args="import(\"/home/lg/working_dir/bromite/build/bromite.gn_args\") $(cat ../../build_args.gni) target_cpu = \"x64\" system_webview_package_name=\"com.android.webview\" system_webview_shell_package_name=\"org.cromite.webview_shell\"" out/arm64_webview
ninja -C out/arm64_webview system_webview_apk system_webview_shell_apk

I used 'com.android.webview' because in the emulator it only accepted that one, and it was a hassle to activate it! do you need instructions?

In my patches I did remove these services from AndroidManifest.xml to make the build complete.

no changes. I use exactly what is in the repo.
use my docker image if you like. it is exactly the one I use in development and in this test.
here too, do you need instructions? i wanted to write them down for everyone sooner or later :)

@basilgello
Copy link

basilgello commented Dec 16, 2023

I am using your image exactly. Let me try your commandline. Because I am doing both chrome_public_apk and webview_system_apk in the same out/arm64

@uazo
Copy link
Owner

uazo commented Dec 16, 2023

I am using your image exactly

very odd then.

@uazo
Copy link
Owner

uazo commented Dec 16, 2023

Anyway, I am now going to try the build on a test server with 32 cpu (they should have it enabled now) and write down everything I do to get it up and running. full instructions

EDIT: all postponed, they didn't activate it for me... I think they're making fun of me... :)

@basilgello
Copy link

I restarted the build using my patch and ccache and pointing CCACHE_DIR and chromium/src/out to tmpfs. Lets see the ccache hit/miss rates…

@basilgello
Copy link

basilgello commented Dec 16, 2023

Well, with my patch builds for arm/arm64 complete. CCache does not catch duplicate files during first build cycle (I am talking about clang_android_arm/… subdir in webview/arm64) because the cache hit rate is 0. Maybe I tuned it wrong, but here is what I have.

I will now keep ccache directory but remove out/* dirs and rebuild to check if ccache principally works.

EDIT: Also, previous images had /home/lg/working_dir/build_args.gni that you used in in your invocation script: $(cat ../../build_args.gni)

This time it us absent but build passes without it.

@basilgello
Copy link

basilgello commented Dec 16, 2023

Aha, found the issue with missing build_args.gni. It is present in uazo/cromite-build but absent in uazo/cromite. Why need to push two container flavors?

@basilgello
Copy link

So build of system_webview_apk succeeds with both uazo/cromite and uazo/cromite-build images if the following GN arg is added to gn gen:

treat_warnings_as_errors=false

Now on CCache:

ccache is useful only if you keep it between rebuilds of cromite - I was naively thinking there are duplicates of files between arm and arm64 build that ccache can spot. Nope, the first cromite build with empty ccache dir results in 0 hits. However, the second rebuild using the scratch container with ccache directory mounted into container speeds the build several times (21 minutes with vs 106 minutes without). Both arm and arm64 webview + chromePublic takes ~20GB of ccache, AND you can delete chromium/src/out/* and still get fast rebuild!

You told you have 250GB of disk space on server? How about allocating 50-70GB to ccache and mounting it to container? I tested this setup and it really helps. As you dont need chromium/src/out directory you can start a fresh container for every needed build (i.e android/arm, android/arm64, etc) and thus let docker clean temporary volumes for you.

Whrn the new version comes out you just rebuild it using the saved ccache dir. If things go really wrong, ccache dir is destroyed and the build starts fresh.

@SevastianGit
Copy link

So, since the ability to build SystemWebView has been added in the latest commit/release, are we getting prebuilt .apk files anytime soon?

@basilgello
Copy link

basilgello commented Dec 18, 2023

@SevastianGit I can not comment uazo's plans but on my side WebView works on arm/arm64 but presumably only with legacy adblocker support. Cromite browser scores 100/100 in this adblock tester but WebView makes only 28/100.

The newer adblock tester gives 29% for Cromite either, but I have strong about need to investigate their testing protocol.

@uazo uazo mentioned this issue Dec 18, 2023
@uazo
Copy link
Owner

uazo commented Dec 18, 2023

So, since the ability to build SystemWebView has been added in the latest commit/release, are we getting prebuilt .apk files anytime soon?

without hurry. I need to understand the webview code a little bit first.
I don't think I will publish anything unless I first understand how much work goes into making it 100% functional.

@basilgello
Copy link

Feel free to ask questions if needed :)

@uazo uazo added the user report is a user report label Dec 24, 2023
@markg85
Copy link

markg85 commented Jan 23, 2024

Just adding my 5ct here to voice my reason for wanting a cromite webview.

A little user story.
Years ago, on chrome, you had the option to disable AutoPlay. I always used that, i deeply hate autoplay functionality. If you disable that setting (or any setting in chrome for that matter) then it's applied in webview too. Thus your browser experience in chrome and webview is the same.

I have since moved to Brave (and now Cromite) where i'm quite annoyed by the fact that settings i change in either don't apply to the webview part (simply because neither project provides a webview package). This would be solved once there is a Cromite Webview as it and Cromite would have the same browser experience. Thus - finally - after years of being annoyed by auto playing videos in webview components a new solution exists that allows me to disable it. Cromite.

So yeah, i'm all for it! :D

@rhjdvsgsgks
Copy link

I can not comment uazo's plans but on my side WebView works on arm/arm64 but presumably only with legacy adblocker support.

@basilgello
can you share the apk you built here (even it have only legacy adblocker support) ? since there still lot of time we need to wait before the official webview build arrived. a newer webview with no "100% functional" would be better than a unmaintained old webview

@uazo
Copy link
Owner

uazo commented Mar 28, 2024

a newer webview with no "100% functional" would be better than a unmaintained old webview

you think so?

@uazo uazo mentioned this issue Apr 4, 2024
5 tasks
@rhjdvsgsgks
Copy link

a newer webview with no "100% functional" would be better than a unmaintained old webview

you think so?

i mean we dont need to wait for ad blocker (or such fancy stuff) fully functional. (at least) i just need a new webview with old bromite patch applied, to provide some basic privacy protection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need triage I will look into it, I promise! task These are things I tell myself I should do user report is a user report
Projects
None yet
Development

No branches or pull requests