ungoogled-software / ungoogled-chromium-android

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

Follow the system to enable force dark TAG #64

Closed wanlyg closed 3 years ago

wanlyg commented 3 years ago

Please explain why your feature request fall into the scope of ungoogled-chromium? See ungoogled-chromium#objectives for a detailed list of objectives of this project. [...] Enhancing Features ?I don't know.(:

Please describe the feature you would like to have A clear and concise description of what the problem is. [...] People often need to use the browser in low light environment, too high brightness is harmful to people's eyes

Describe the solution you'd like A clear and concise description of what you want to happen. When the system theme changes, use force dark (chrome://flags/#enable-force-dark) to change the web page theme

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Or by adding a button in the menu to enable the user to manually switch,like kiwi browser.

Additional context Add any other context or screenshots about the feature request here.

I have tested force dark (chrome://flags/#enable-force-dark) and it works well on most websites without the need to install additional plugins

Edit:Chrome private link (chrome://) cannot be displayed

wchen342 commented 3 years ago

So if I understand correctly you want enable-force-dark to follow system theme?

Edit:Chrome private link (chrome://) cannot be displayed

What does this mean?

wanlyg commented 3 years ago

Yes. Github markdown cannot directly parse chrome:// as a jump,Similar to Google @wchen342

wchen342 commented 3 years ago

Oh ok I see. I was just involved in a discussion about dark mode recently and I think this is a worth adding. I will add a flag to let it follow system theme.

wchen342 commented 3 years ago

@wanlyg I digged a little and there is already a flag darken-websites-checkbox-in-themes-setting that does what you required.

I tested it and the flag works. On extension version it will cause a crash which I need to fix but on normal version it works correctly.

wanlyg commented 3 years ago

thank you very much @wchen342

wchen342 commented 3 years ago

The crash seems to stop happening. Not sure what was going on. I will close this for now, but if crash happens let me know.

wanlyg commented 3 years ago

The crash seems to stop happening. Not sure what was going on. I will close this for now, but if crash happens let me know.

The collapse continues. Even without modifying any flags, it still crashes.

I found the following log. @wchen342 Test: v88.0.4324.182-2-Extensions and v88.0.4324.152-3-Extensions

ABI: 'arm64' Timestamp: 2021-02-21 22:28:31+0800 pid: 8141, tid: 8141, name: tensions.stable >>> org.ungoogled.chromium.extensions.stable <<< uid: 10427 signal 5 (SIGTRAP), code -6 (SI_TKILL), fault addr -------- x0 0000007424091b60 x1 0000007ff5b2fdf0 x2 0000007ff5b2fd28 x3 0000000000000018 x4 0000000000000010 x5 00000073c4277930 x6 626564686161636f x7 646e6d666c6f6662 x8 0000000000000001 x9 00000000029d4324 x10 0000000000000000 x11 20c49ba5e353f7cf x12 0000000cc2b13180 x13 00000178f51abf96 x14 00300173750b0f6c x15 000000001fbe7b9b x16 0000000060326e0e x17 ffffffff9fce6807 x18 000000762a0be000 x19 0000000cc2b66c06 x20 00000073258fb000 x21 0000007325eb5000 x22 0000007629547000 x23 00000075040880c8 x24 00000073788ccaf8 x25 0000007629547000 x26 00000000000000ba x27 0000000000000000 x28 0000000000000000 x29 0000007ff5b2fdf0 lr 0000007323eafc1c sp 0000007ff5b2fdc0 pc 000000732290dba8 pst 0000000000000000 backtrace:

00 pc 0000000003589ba8 /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/base.apk!libchrome.so (offset 0x1e72000) (BuildId: 63b97ec40e17cde8bfbc2c770f9bf95736dd2092)

01 pc 0000000004b2bc18 /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/base.apk!libchrome.so (offset 0x1e72000) (BuildId: 63b97ec40e17cde8bfbc2c770f9bf95736dd2092)

02 pc 000000000003e070 /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/oat/arm64/base.odex (art_jni_trampoline+144)

03 pc 00000000001337e8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

04 pc 00000000001a9804 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread, unsigned int, unsigned int, art::JValue, char const)+228) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

05 pc 000000000031c040 /apex/com.android.art/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread, art::ArtMethod, art::ShadowFrame, unsigned short, art::JValue)+376) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

06 pc 0000000000312228 /apex/com.android.art/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod, art::Thread, art::ShadowFrame&, art::Instruction const, unsigned short, art::JValue)+912) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

07 pc 000000000068861c /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+548) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

08 pc 000000000012d994 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

09 pc 00000000001b91aa /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/oat/arm64/base.vdex (Iz.run+22)

10 pc 00000000003094d0 /apex/com.android.art/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.17697368424689695230)+264) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

11 pc 00000000006740c0 /apex/com.android.art/lib64/libart.so (artQuickToInterpreterBridge+776) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

12 pc 000000000013cff8 /apex/com.android.art/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

13 pc 0000000000133564 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

14 pc 00000000001a97e8 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread, unsigned int, unsigned int, art::JValue, char const)+200) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

15 pc 000000000055c6f4 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<art::ArtMethod>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject, art::ArtMethod*, std::__va_list)+468) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

16 pc 000000000055c894 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgs<_jmethodID>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject, _jmethodID*, std::__va_list)+92) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

17 pc 00000000003b0a20 /apex/com.android.art/lib64/libart.so (art::JNI::CallVoidMethodV(_JNIEnv, _jobject, _jmethodID*, std::__va_list)+656) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

18 pc 0000000001fb8a58 /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/base.apk!libchrome.so (offset 0x1e72000) (BuildId: 63b97ec40e17cde8bfbc2c770f9bf95736dd2092)

19 pc 00000000035f43a8 /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/base.apk!libchrome.so (offset 0x1e72000) (BuildId: 63b97ec40e17cde8bfbc2c770f9bf95736dd2092)

20 pc 00000000035f4258 /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/base.apk!libchrome.so (offset 0x1e72000) (BuildId: 63b97ec40e17cde8bfbc2c770f9bf95736dd2092)

21 pc 00000000035f4464 /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/base.apk!libchrome.so (offset 0x1e72000) (BuildId: 63b97ec40e17cde8bfbc2c770f9bf95736dd2092)

22 pc 00000000035a6084 /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/base.apk!libchrome.so (offset 0x1e72000) (BuildId: 63b97ec40e17cde8bfbc2c770f9bf95736dd2092)

23 pc 00000000035b56e4 /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/base.apk!libchrome.so (offset 0x1e72000) (BuildId: 63b97ec40e17cde8bfbc2c770f9bf95736dd2092)

24 pc 00000000035e6954 /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/base.apk!libchrome.so (offset 0x1e72000) (BuildId: 63b97ec40e17cde8bfbc2c770f9bf95736dd2092)

25 pc 00000000035e6700 /data/app/~~80wE3bcuWWv2RSn4SG6LMg==/org.ungoogled.chromium.extensions.stable-i36gSb8q7paiWaDFF-y9jw==/base.apk!libchrome.so (offset 0x1e72000) (BuildId: 63b97ec40e17cde8bfbc2c770f9bf95736dd2092)

26 pc 000000000001a064 /system/lib64/libutils.so (android::Looper::pollInner(int)+916) (BuildId: 1ad02ac752c5c0f96e3c37ff141b7ae7)

27 pc 0000000000019c68 /system/lib64/libutils.so (android::Looper::pollOnce(int, int, int, void**)+112) (BuildId: 1ad02ac752c5c0f96e3c37ff141b7ae7)

28 pc 00000000001120f4 /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv, _jobject, long, int)+44) (BuildId: a3d6b606e17e7b29e62ca8e345435817)

29 pc 0000000000210adc /system/framework/arm64/boot-framework.oat (art_jni_trampoline+140) (BuildId: b5c1f188048971ceb3b92c5d3439c2086c6d9e30)

30 pc 000000000065a87c /system/framework/arm64/boot-framework.oat (android.os.MessageQueue.next+188) (BuildId: b5c1f188048971ceb3b92c5d3439c2086c6d9e30)

31 pc 00000000006571b8 /system/framework/arm64/boot-framework.oat (android.os.Looper.loop+792) (BuildId: b5c1f188048971ceb3b92c5d3439c2086c6d9e30)

32 pc 0000000000411f0c /system/framework/arm64/boot-framework.oat (android.app.ActivityThread.main+748) (BuildId: b5c1f188048971ceb3b92c5d3439c2086c6d9e30)

33 pc 00000000001337e8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

34 pc 00000000001a9804 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread, unsigned int, unsigned int, art::JValue, char const)+228) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

35 pc 000000000055ce14 /apex/com.android.art/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject, _jobject, _jobject*, unsigned long)+1364) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

36 pc 00000000004dba28 /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv, _jobject, _jobject, _jobjectArray)+48) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

37 pc 000000000008a6f4 /apex/com.android.art/javalib/arm64/boot.oat (art_jni_trampoline+180) (BuildId: fd3cf054c28fb5d3737a5d92c072cfb27c32c982)

38 pc 00000000008a7938 /system/framework/arm64/boot-framework.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+136) (BuildId: b5c1f188048971ceb3b92c5d3439c2086c6d9e30)

39 pc 00000000008b04a4 /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2212) (BuildId: b5c1f188048971ceb3b92c5d3439c2086c6d9e30)

40 pc 00000000001337e8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

41 pc 00000000001a9804 /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread, unsigned int, unsigned int, art::JValue, char const)+228) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

42 pc 000000000055b830 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<art::ArtMethod>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject, art::ArtMethod*, std::__va_list)+448) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

43 pc 000000000055bcf4 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject, _jmethodID*, std::__va_list)+92) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

44 pc 000000000043ecbc /apex/com.android.art/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv, _jclass, _jmethodID*, std::__va_list)+652) (BuildId: 0c7b97bff86f819968533f31a62bfee1)

45 pc 000000000009948c /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass, _jmethodID, ...)+124) (BuildId: a3d6b606e17e7b29e62ca8e345435817)

46 pc 00000000000a0a0c /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector const&, bool)+844) (BuildId: a3d6b606e17e7b29e62ca8e345435817)

47 pc 0000000000003570 /system/bin/app_process64 (main+1320) (BuildId: 6f75dcc0a5b19a9a1499688c6172bfad)

48 pc 0000000000049a34 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: 1396decda2402ad44693b1fab6036fe6)

jenabaivab commented 3 years ago

@wchen342 whenever the dark mode is enabled from flags, there are constant white flashed when loading pages. Can those be removed? I tried using dark reader extension in conjunction with force-dark-mode flag, but the flashes are consistent.

wchen342 commented 3 years ago

I think that is harware specific. If it happens with the non-extension version then it is most likely an upstream (chromium) problem so you shall report the problem to them.

wanlyg commented 3 years ago

I have tested that this function works well in ChromeModernPublic version, and the Extensions-ChromeModernPublic variant crashes @wchen342

wchen342 commented 3 years ago

@wanlyg The above post is about the flashing. I know the crash is extension specific.

wchen342 commented 3 years ago

See https://github.com/ungoogled-software/ungoogled-chromium-android#extensions.