mirror of
https://github.com/Alex313031/thorium.git
synced 2025-01-08 10:47:44 -03:00
update wrappers, scripts, and Th24 UI
This commit is contained in:
parent
c655491002
commit
bcc54f7bda
23 changed files with 2271 additions and 132 deletions
4
TODO.md
4
TODO.md
|
@ -46,3 +46,7 @@ Remove media/filters/win/media_foundation_audio_decoder.cc in M127
|
|||
Make hover over link always show full url without delay
|
||||
|
||||
https://source.chromium.org/chromium/chromium/src/+/99fe5ddf4ecd908fd52d1d03565176f2f481c79e
|
||||
|
||||
Make UA and hints report chrome, and set hints
|
||||
|
||||
fix thorium and shell portable --temp profile
|
||||
|
|
58
autobuild.sh
Executable file
58
autobuild.sh
Executable file
|
@ -0,0 +1,58 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (c) 2024 Alex313031.
|
||||
|
||||
## !! NOT FOR RELEASE BUILDS !! ##
|
||||
## Only for testing and automation, as it only produces debug and non-debug
|
||||
## AVX builds, as well as thorium_shell (content_shell) and thorium_ui_debug_shell (views_examples_with_content).
|
||||
|
||||
YEL='\033[1;33m' # Yellow
|
||||
CYA='\033[1;96m' # Cyan
|
||||
RED='\033[1;31m' # Red
|
||||
GRE='\033[1;32m' # Green
|
||||
c0='\033[0m' # Reset Text
|
||||
bold='\033[1m' # Bold Text
|
||||
underline='\033[4m' # Underline Text
|
||||
|
||||
# Error handling
|
||||
yell() { echo "$0: $*" >&2; }
|
||||
die() { yell "$*"; exit 111; }
|
||||
try() { "$@" || die "${RED}Failed $*"; }
|
||||
|
||||
# --help
|
||||
displayHelp () {
|
||||
printf "\n" &&
|
||||
printf "${bold}${GRE}Script to build Thorium on Linux.${c0}\n" &&
|
||||
printf "${underline}${YEL}Usage:${c0} build.sh # (where # is number of jobs)${c0}\n" &&
|
||||
printf "\n"
|
||||
}
|
||||
case $1 in
|
||||
--help) displayHelp; exit 0;;
|
||||
esac
|
||||
|
||||
# chromium/src dir env variable
|
||||
if [ -z "${CR_DIR}" ]; then
|
||||
CR_SRC_DIR="$HOME/chromium/src"
|
||||
export CR_SRC_DIR
|
||||
else
|
||||
CR_SRC_DIR="${CR_DIR}"
|
||||
export CR_SRC_DIR
|
||||
fi
|
||||
|
||||
printf "\n" &&
|
||||
printf "${YEL}Building Thorium for Linux...\n" &&
|
||||
printf "${CYA}\n" &&
|
||||
|
||||
# Build Thorium
|
||||
export NINJA_SUMMARIZE_BUILD=1 &&
|
||||
export NINJA_STATUS="[%r processes, %f/%t @ %o/s | %e sec. ] " &&
|
||||
|
||||
cd ${CR_SRC_DIR} &&
|
||||
autoninja -C out/thorium thorium chrome_sandbox chromedriver clear_key_cdm thorium_shell policy_templates -j$@ &&
|
||||
|
||||
printf "\n" &&
|
||||
cat ~/thorium/logos/thorium_logo_ascii_art.txt &&
|
||||
printf "\n" &&
|
||||
|
||||
printf "${GRE}${bold}Build Completed! ${YEL}${bold}You can now run \'./package.sh\' to build installation packages.\n" &&
|
||||
tput sgr0
|
|
@ -46,46 +46,49 @@ cd ${CR_SRC_DIR} &&
|
|||
autoninja -C out/thorium thorium_ui_debug_shell minidump_stackwalk dump_syms -j$@ &&
|
||||
cd ~/thorium/infra/DEBUG &&
|
||||
|
||||
mkdir -v -p ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
mkdir -v -p ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/lib &&
|
||||
mkdir -v -p ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
mkdir -v -p ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
mkdir -v -p ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/lib &&
|
||||
mkdir -v -p ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
|
||||
cp -r -f -v ./icons/icon_16.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_24.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_32.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_48.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_64.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_128.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_256.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_256.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
# cp -r -f -v ./icons/thorium_debug_shell.ico ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
cp -r -f -v DEBUG_SHELL_README.md ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/README.md &&
|
||||
cp -r -f -v Thorium_Debug_Shell.sh ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/locales ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/test_fonts ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/resources ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/ui ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/libffmpeg.so ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/libffmpeg.so ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/lib &&
|
||||
# cp -r -f -v ~/chromium/src/out/thorium/libblink_test_plugin.so ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
# cp -r -f -v ~/chromium/src/out/thorium/libmojo_core.so ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/icudtl.dat ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/content_resources.pak ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/libEGL.so ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/libGLESv2.so ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/libvk_swiftshader.so ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/libvulkan.so.1 ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/vk_swiftshader_icd.json ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/v8_context_snapshot.bin ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/ui_resources_100_percent.pak ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/ui_test.pak ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/ui_test_200_percent.pak ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/views_examples_resources.pak ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/thorium_ui_debug_shell ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/minidump_stackwalk ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/dump_syms ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/ClearKeyCdm ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/ClearKeyCdm/_platform_specific/linux_x64/libclearkeycdm.so ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/lib &&
|
||||
cp -r -f -v ./icons/icon_16.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_24.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_32.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_48.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_64.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_128.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_256.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_256.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
# cp -r -f -v ./icons/thorium_debug_shell.ico ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
cp -r -f -v DEBUG_SHELL_README.md ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/README.md &&
|
||||
cp -r -f -v Thorium_Debug_Shell.sh ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/locales ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/test_fonts ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/resources ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/ui ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/libffmpeg.so ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/libffmpeg.so ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/lib &&
|
||||
# cp -r -f -v ${CR_SRC_DIR}/out/thorium/libblink_test_plugin.so ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
# cp -r -f -v ${CR_SRC_DIR}/out/thorium/libmojo_core.so ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/icudtl.dat ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/content_resources.pak ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/libEGL.so ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/libGLESv2.so ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/libvk_swiftshader.so ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/libvulkan.so.1 ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/vk_swiftshader_icd.json ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/v8_context_snapshot.bin ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/ui_resources_100_percent.pak ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/ui_test.pak ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/ui_test_200_percent.pak ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/views_examples_resources.pak ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/thorium_ui_debug_shell ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/minidump_stackwalk ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/dump_syms ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/ClearKeyCdm ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/ClearKeyCdm/_platform_specific/linux_x64/libclearkeycdm.so ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/lib &&
|
||||
|
||||
printf "${GRE}Thorium UI Debug Shell Build Completed.\n" &&
|
||||
cd ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
zip -r ../Thorium_UI_Debug_Shell.zip * &&
|
||||
|
||||
printf "${GRE}Thorium UI Debug Shell Build Completed!\n" &&
|
||||
tput sgr0
|
||||
|
|
|
@ -33,39 +33,44 @@ printf "${CYA}\n" &&
|
|||
# Build Thorium UI Debug Shell
|
||||
export NINJA_SUMMARIZE_BUILD=1 &&
|
||||
|
||||
autoninja -C ~/chromium/src/out/thorium thorium_ui_debug_shell -j$@ &&
|
||||
autoninja -C ${CR_SRC_DIR}/out/thorium thorium_ui_debug_shell minidump_stackwalk dump_syms -j$@ &&
|
||||
|
||||
mkdir -v -p ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
mkdir -v -p ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
mkdir -v -p ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
# mkdir -v -p ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/lib &&
|
||||
mkdir -v -p ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
|
||||
cp -r -f -v ./icons/icon_16.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_24.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_32.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_48.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_64.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_128.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_256.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_256.png ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ./icons/thorium_debug_shell.ico ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
cp -r -f -v DEBUG_SHELL_README.md ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/README.md &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/locales ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/test_fonts ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/resources ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/ui ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/blink_test_plugin.dll ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/icudtl.dat ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/content_resources.pak ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/libEGL.dll ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/libGLESv2.dll ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/vk_swiftshader.dll ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/vulkan-1.dll ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/vk_swiftshader_icd.json ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/v8_context_snapshot.bin ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/ui_resources_100_percent.pak ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/ui_test.pak ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/ui_test_200_percent.pak ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/views_examples_resources.pak ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ~/chromium/src/out/thorium/thorium_ui_debug_shell.exe ~/chromium/src/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ./icons/icon_16.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_24.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_32.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_48.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_64.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_128.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_256.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/icons &&
|
||||
cp -r -f -v ./icons/icon_256.png ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ./icons/thorium_debug_shell.ico ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
cp -r -f -v DEBUG_SHELL_README.md ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/README.md &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/locales ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/test_fonts ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/resources ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/ui ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/blink_test_plugin.dll ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/icudtl.dat ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/content_resources.pak ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/libEGL.dll ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/libGLESv2.dll ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/vk_swiftshader.dll ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/vulkan-1.dll ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/vk_swiftshader_icd.json ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/v8_context_snapshot.bin ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/ffmpeg.dll ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/ui_resources_100_percent.pak ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/ui_test.pak ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/ui_test_200_percent.pak ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/views_examples_resources.pak ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
cp -r -f -v ${CR_SRC_DIR}/out/thorium/thorium_ui_debug_shell.exe ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell/ &&
|
||||
|
||||
printf "${GRE}Thorium UI Debug Shell Build Completed.\n" &&
|
||||
cd ${CR_SRC_DIR}/out/thorium/Thorium_UI_Debug_Shell &&
|
||||
zip -r ../Thorium_UI_Debug_Shell.zip * &&
|
||||
|
||||
printf "${GRE}Thorium UI Debug Shell Build Completed!\n" &&
|
||||
tput sgr0
|
||||
|
|
1017
infra/portable/C/THORIUM-PORTABLE.sh.x.c
Normal file
1017
infra/portable/C/THORIUM-PORTABLE.sh.x.c
Normal file
File diff suppressed because it is too large
Load diff
722
infra/portable/C/THORIUM-SHELL.sh.x.c
Normal file
722
infra/portable/C/THORIUM-SHELL.sh.x.c
Normal file
|
@ -0,0 +1,722 @@
|
|||
#if 0
|
||||
shc Version 4.0.3, Generic Shell Script Compiler
|
||||
GNU GPL Version 3 Md Jahidul Hamid <jahidulhamid@yahoo.com>
|
||||
|
||||
shc -r -v -o ./THORIUM-SHELL -f ./THORIUM-SHELL.sh
|
||||
#endif
|
||||
|
||||
static char data [] =
|
||||
#define msg2_z 19
|
||||
#define msg2 ((&data[0]))
|
||||
"\265\056\004\341\320\071\333\322\273\173\340\045\150\055\363\331"
|
||||
"\131\122\311\162\102"
|
||||
#define chk1_z 22
|
||||
#define chk1 ((&data[23]))
|
||||
"\165\332\300\237\170\340\352\265\133\014\352\134\211\371\232\001"
|
||||
"\044\367\324\100\110\034\103\177"
|
||||
#define rlax_z 1
|
||||
#define rlax ((&data[45]))
|
||||
"\031"
|
||||
#define opts_z 1
|
||||
#define opts ((&data[46]))
|
||||
"\341"
|
||||
#define xecc_z 15
|
||||
#define xecc ((&data[49]))
|
||||
"\170\030\231\266\253\203\277\201\350\333\064\025\177\133\042\366"
|
||||
"\064\213\314\340"
|
||||
#define text_z 452
|
||||
#define text ((&data[103]))
|
||||
"\345\362\247\113\214\263\334\377\365\162\154\367\347\106\214\020"
|
||||
"\277\116\077\121\246\354\106\036\005\322\352\345\215\075\141\162"
|
||||
"\057\011\276\274\177\205\315\335\064\272\103\252\006\304\276\135"
|
||||
"\376\003\100\132\167\115\204\066\125\176\026\117\176\345\102\230"
|
||||
"\222\311\124\063\010\103\000\022\076\135\013\275\164\020\361\015"
|
||||
"\200\323\022\207\046\105\342\253\016\163\307\200\323\004\167\170"
|
||||
"\116\262\227\022\360\065\054\365\300\256\050\244\367\100\335\036"
|
||||
"\061\222\267\062\034\047\143\345\203\250\331\103\127\044\063\165"
|
||||
"\047\146\077\155\264\207\060\216\025\064\024\101\366\047\005\305"
|
||||
"\203\252\105\264\155\124\072\212\142\177\054\377\306\041\214\225"
|
||||
"\362\213\026\247\145\206\173\370\115\076\004\113\370\225\230\152"
|
||||
"\271\206\375\305\100\321\164\274\300\212\013\154\373\226\021\367"
|
||||
"\265\305\325\206\237\205\101\014\021\321\125\053\110\045\206\306"
|
||||
"\210\314\173\243\347\243\045\346\220\064\212\262\275\230\320\206"
|
||||
"\104\106\211\345\307\224\106\352\376\302\247\047\301\041\136\002"
|
||||
"\320\156\246\235\225\244\231\245\115\354\336\341\252\373\105\320"
|
||||
"\040\147\263\213\262\000\021\014\014\164\304\153\210\352\156\032"
|
||||
"\147\375\072\365\252\371\214\100\344\313\010\020\142\127\011\156"
|
||||
"\273\237\232\033\353\077\163\275\214\355\062\234\326\272\062\216"
|
||||
"\123\146\041\256\230\301\100\221\211\371\214\053\374\361\330\160"
|
||||
"\102\254\273\060\342\015\115\050\324\113\245\107\232\137\045\246"
|
||||
"\106\264\371\250\226\301\044\142\102\005\251\172\212\356\322\010"
|
||||
"\223\221\375\167\313\173\065\051\221\206\257\170\375\251\205\344"
|
||||
"\327\043\051\226\265\025\332\241\273\213\332\226\116\301\255\276"
|
||||
"\004\022\045\230\275\351\160\075\161\142\101\263\064\215\002\246"
|
||||
"\124\207\307\200\047\201\077\222\373\066\322\343\042\073\362\031"
|
||||
"\103\033\013\343\104\260\135\117\174\302\311\300\242\340\247\367"
|
||||
"\254\104\047\321\113\375\371\201\112\131\277\102\031\332\310\131"
|
||||
"\043\264\177\136\137\202\165\343\165\154\207\242\112\361\210\301"
|
||||
"\151\034\235\326\257\375\200\171\072\310\311\201\037\011\036\016"
|
||||
"\324\075\146\015\041\014\055\374\275\232\273\262\015\050\252\364"
|
||||
"\157\066\005\057\205\104\200\054\061\307\112\066\231\065\034\046"
|
||||
"\162\176\231\241\210\130\136\105\362\031\370\377\102\242\364\261"
|
||||
"\331\371\340\137\076\141\213\160\050\325\247\302\013\303\351"
|
||||
#define tst1_z 22
|
||||
#define tst1 ((&data[611]))
|
||||
"\037\237\315\314\147\236\203\043\075\111\102\242\262\275\264\037"
|
||||
"\130\156\251\325\022\255\156\312\333\175"
|
||||
#define pswd_z 256
|
||||
#define pswd ((&data[688]))
|
||||
"\007\316\331\252\302\212\204\274\153\343\372\314\156\153\365\104"
|
||||
"\022\267\117\326\240\315\030\044\355\342\377\153\362\315\002\372"
|
||||
"\233\334\244\136\147\050\032\322\014\024\237\172\200\224\276\222"
|
||||
"\113\016\151\354\061\275\116\330\326\253\337\210\047\173\302\114"
|
||||
"\027\064\362\167\121\155\370\235\352\262\313\377\150\253\376\373"
|
||||
"\245\247\147\326\144\265\256\073\140\216\303\210\012\205\324\042"
|
||||
"\271\307\231\013\064\222\250\037\104\164\036\254\040\034\250\305"
|
||||
"\303\017\233\050\305\112\143\046\331\047\256\343\254\203\006\146"
|
||||
"\112\237\161\177\061\032\236\166\216\275\043\256\331\313\163\235"
|
||||
"\333\017\306\241\131\052\307\062\121\165\026\375\370\034\144\103"
|
||||
"\273\325\302\355\357\141\144\176\036\207\055\370\122\240\226\056"
|
||||
"\260\135\317\011\207\226\074\331\014\123\327\005\157\073\110\053"
|
||||
"\020\013\031\000\155\175\176\214\004\253\204\127\114\033\205\374"
|
||||
"\171\124\006\000\353\103\332\367\226\261\374\005\354\105\061\374"
|
||||
"\120\112\375\275\310\173\111\314\047\316\043\163\352\250\160\143"
|
||||
"\375\167\144\350\272\076\340\121\357\335\127\333\042\210\330\163"
|
||||
"\323\325\060\233\121\172\147\170\111\213\354\064\063\135\227\061"
|
||||
"\324\374\032\216\072\372\340\052\327\067\006\372\277\336\155\222"
|
||||
"\264\236\055\005\031\225\176\142\040\152\226\124\310\056\205\234"
|
||||
"\053\240\053\145\333\201\020\310\144\020\063\126\336\066\120\171"
|
||||
"\023\364\330\172\035\362\115\052\007\354\244\207\201\143\032\314"
|
||||
"\161\203\271\115\004\312\026\150\332\112"
|
||||
#define tst2_z 19
|
||||
#define tst2 ((&data[985]))
|
||||
"\017\062\224\074\067\352\121\266\106\042\363\246\257\277\303\224"
|
||||
"\044\355\356\256\166\131\004\012"
|
||||
#define msg1_z 65
|
||||
#define msg1 ((&data[1008]))
|
||||
"\135\114\237\142\170\302\266\052\046\356\261\174\346\012\330\061"
|
||||
"\311\257\052\271\005\161\000\066\141\340\104\032\202\303\363\333"
|
||||
"\273\207\302\304\172\025\306\302\340\226\314\042\302\066\232\364"
|
||||
"\372\347\033\056\212\050\057\276\066\017\214\343\275\336\053\007"
|
||||
"\366\246\077\004\112\360\214\313\124\246\230\306\051\122\023\056"
|
||||
"\034\052\227"
|
||||
#define chk2_z 19
|
||||
#define chk2 ((&data[1091]))
|
||||
"\260\365\276\077\222\144\077\311\015\324\024\103\044\354\021\261"
|
||||
"\141\270\153\342\206\145"
|
||||
#define date_z 1
|
||||
#define date ((&data[1111]))
|
||||
"\301"
|
||||
#define shll_z 10
|
||||
#define shll ((&data[1113]))
|
||||
"\352\075\052\144\327\305\121\035\130\344\277\367"
|
||||
#define inlo_z 3
|
||||
#define inlo ((&data[1124]))
|
||||
"\055\367\145"
|
||||
#define lsto_z 1
|
||||
#define lsto ((&data[1127]))
|
||||
"\151"/* End of data[] */;
|
||||
#define hide_z 4096
|
||||
#define SETUID 0 /* Define as 1 to call setuid(0) at start of script */
|
||||
#define DEBUGEXEC 0 /* Define as 1 to debug execvp calls */
|
||||
#define TRACEABLE 1 /* Define as 1 to enable ptrace the executable */
|
||||
#define HARDENING 0 /* Define as 1 to disable ptrace/dump the executable */
|
||||
#define BUSYBOXON 0 /* Define as 1 to enable work with busybox */
|
||||
|
||||
#if HARDENING
|
||||
static const char * shc_x[] = {
|
||||
"/*",
|
||||
" * Copyright 2019 - Intika <intika@librefox.org>",
|
||||
" * Replace ******** with secret read from fd 21",
|
||||
" * Also change arguments location of sub commands (sh script commands)",
|
||||
" * gcc -Wall -fpic -shared -o shc_secret.so shc_secret.c -ldl",
|
||||
" */",
|
||||
"",
|
||||
"#define _GNU_SOURCE /* needed to get RTLD_NEXT defined in dlfcn.h */",
|
||||
"#define PLACEHOLDER \"********\"",
|
||||
"#include <dlfcn.h>",
|
||||
"#include <stdlib.h>",
|
||||
"#include <string.h>",
|
||||
"#include <unistd.h>",
|
||||
"#include <stdio.h>",
|
||||
"#include <signal.h>",
|
||||
"",
|
||||
"static char secret[128000]; //max size",
|
||||
"typedef int (*pfi)(int, char **, char **);",
|
||||
"static pfi real_main;",
|
||||
"",
|
||||
"// copy argv to new location",
|
||||
"char **copyargs(int argc, char** argv){",
|
||||
" char **newargv = malloc((argc+1)*sizeof(*argv));",
|
||||
" char *from,*to;",
|
||||
" int i,len;",
|
||||
"",
|
||||
" for(i = 0; i<argc; i++){",
|
||||
" from = argv[i];",
|
||||
" len = strlen(from)+1;",
|
||||
" to = malloc(len);",
|
||||
" memcpy(to,from,len);",
|
||||
" // zap old argv space",
|
||||
" memset(from,'\\0',len);",
|
||||
" newargv[i] = to;",
|
||||
" argv[i] = 0;",
|
||||
" }",
|
||||
" newargv[argc] = 0;",
|
||||
" return newargv;",
|
||||
"}",
|
||||
"",
|
||||
"static int mymain(int argc, char** argv, char** env) {",
|
||||
" //fprintf(stderr, \"Inject main argc = %d\\n\", argc);",
|
||||
" return real_main(argc, copyargs(argc,argv), env);",
|
||||
"}",
|
||||
"",
|
||||
"int __libc_start_main(int (*main) (int, char**, char**),",
|
||||
" int argc,",
|
||||
" char **argv,",
|
||||
" void (*init) (void),",
|
||||
" void (*fini)(void),",
|
||||
" void (*rtld_fini)(void),",
|
||||
" void (*stack_end)){",
|
||||
" static int (*real___libc_start_main)() = NULL;",
|
||||
" int n;",
|
||||
"",
|
||||
" if (!real___libc_start_main) {",
|
||||
" real___libc_start_main = dlsym(RTLD_NEXT, \"__libc_start_main\");",
|
||||
" if (!real___libc_start_main) abort();",
|
||||
" }",
|
||||
"",
|
||||
" n = read(21, secret, sizeof(secret));",
|
||||
" if (n > 0) {",
|
||||
" int i;",
|
||||
"",
|
||||
" if (secret[n - 1] == '\\n') secret[--n] = '\\0';",
|
||||
" for (i = 1; i < argc; i++)",
|
||||
" if (strcmp(argv[i], PLACEHOLDER) == 0)",
|
||||
" argv[i] = secret;",
|
||||
" }",
|
||||
"",
|
||||
" real_main = main;",
|
||||
"",
|
||||
" return real___libc_start_main(mymain, argc, argv, init, fini, rtld_fini, stack_end);",
|
||||
"}",
|
||||
"",
|
||||
0};
|
||||
#endif /* HARDENING */
|
||||
|
||||
/* rtc.c */
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* 'Alleged RC4' */
|
||||
|
||||
static unsigned char stte[256], indx, jndx, kndx;
|
||||
|
||||
/*
|
||||
* Reset arc4 stte.
|
||||
*/
|
||||
void stte_0(void)
|
||||
{
|
||||
indx = jndx = kndx = 0;
|
||||
do {
|
||||
stte[indx] = indx;
|
||||
} while (++indx);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set key. Can be used more than once.
|
||||
*/
|
||||
void key(void * str, int len)
|
||||
{
|
||||
unsigned char tmp, * ptr = (unsigned char *)str;
|
||||
while (len > 0) {
|
||||
do {
|
||||
tmp = stte[indx];
|
||||
kndx += tmp;
|
||||
kndx += ptr[(int)indx % len];
|
||||
stte[indx] = stte[kndx];
|
||||
stte[kndx] = tmp;
|
||||
} while (++indx);
|
||||
ptr += 256;
|
||||
len -= 256;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Crypt data.
|
||||
*/
|
||||
void arc4(void * str, int len)
|
||||
{
|
||||
unsigned char tmp, * ptr = (unsigned char *)str;
|
||||
while (len > 0) {
|
||||
indx++;
|
||||
tmp = stte[indx];
|
||||
jndx += tmp;
|
||||
stte[indx] = stte[jndx];
|
||||
stte[jndx] = tmp;
|
||||
tmp += stte[indx];
|
||||
*ptr ^= stte[tmp];
|
||||
ptr++;
|
||||
len--;
|
||||
}
|
||||
}
|
||||
|
||||
/* End of ARC4 */
|
||||
|
||||
#if HARDENING
|
||||
|
||||
#include <sys/ptrace.h>
|
||||
#include <sys/wait.h>
|
||||
#include <signal.h>
|
||||
#include <sys/prctl.h>
|
||||
#define PR_SET_PTRACER 0x59616d61
|
||||
|
||||
/* Seccomp Sandboxing Init */
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <linux/filter.h>
|
||||
#include <linux/seccomp.h>
|
||||
#include <linux/audit.h>
|
||||
|
||||
#define ArchField offsetof(struct seccomp_data, arch)
|
||||
|
||||
#define Allow(syscall) \
|
||||
BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, SYS_##syscall, 0, 1), \
|
||||
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW)
|
||||
|
||||
struct sock_filter filter[] = {
|
||||
/* validate arch */
|
||||
BPF_STMT(BPF_LD+BPF_W+BPF_ABS, ArchField),
|
||||
BPF_JUMP( BPF_JMP+BPF_JEQ+BPF_K, AUDIT_ARCH_X86_64, 1, 0),
|
||||
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL),
|
||||
|
||||
/* load syscall */
|
||||
BPF_STMT(BPF_LD+BPF_W+BPF_ABS, offsetof(struct seccomp_data, nr)),
|
||||
|
||||
/* list of allowed syscalls */
|
||||
Allow(exit_group), /* exits a process */
|
||||
Allow(brk), /* for malloc(), inside libc */
|
||||
Allow(mmap), /* also for malloc() */
|
||||
Allow(munmap), /* for free(), inside libc */
|
||||
|
||||
/* and if we don't match above, die */
|
||||
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL),
|
||||
};
|
||||
struct sock_fprog filterprog = {
|
||||
.len = sizeof(filter)/sizeof(filter[0]),
|
||||
.filter = filter
|
||||
};
|
||||
|
||||
/* Seccomp Sandboxing - Set up the restricted environment */
|
||||
void seccomp_hardening() {
|
||||
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0)) {
|
||||
perror("Could not start seccomp:");
|
||||
exit(1);
|
||||
}
|
||||
if (prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, &filterprog) == -1) {
|
||||
perror("Could not start seccomp:");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
/* End Seccomp Sandboxing Init */
|
||||
|
||||
void shc_x_file() {
|
||||
FILE *fp;
|
||||
int line = 0;
|
||||
|
||||
if ((fp = fopen("/tmp/shc_x.c", "w")) == NULL ) {exit(1); exit(1);}
|
||||
for (line = 0; shc_x[line]; line++) fprintf(fp, "%s\n", shc_x[line]);
|
||||
fflush(fp);fclose(fp);
|
||||
}
|
||||
|
||||
int make() {
|
||||
char * cc, * cflags, * ldflags;
|
||||
char cmd[4096];
|
||||
|
||||
cc = getenv("CC");
|
||||
if (!cc) cc = "cc";
|
||||
|
||||
sprintf(cmd, "%s %s -o %s %s", cc, "-Wall -fpic -shared", "/tmp/shc_x.so", "/tmp/shc_x.c -ldl");
|
||||
if (system(cmd)) {remove("/tmp/shc_x.c"); return -1;}
|
||||
remove("/tmp/shc_x.c"); return 0;
|
||||
}
|
||||
|
||||
void arc4_hardrun(void * str, int len) {
|
||||
//Decode locally
|
||||
char tmp2[len];
|
||||
char tmp3[len+1024];
|
||||
memcpy(tmp2, str, len);
|
||||
|
||||
unsigned char tmp, * ptr = (unsigned char *)tmp2;
|
||||
int lentmp = len;
|
||||
int pid, status;
|
||||
pid = fork();
|
||||
|
||||
shc_x_file();
|
||||
if (make()) {exit(1);}
|
||||
|
||||
setenv("LD_PRELOAD","/tmp/shc_x.so",1);
|
||||
|
||||
if(pid==0) {
|
||||
|
||||
//Start tracing to protect from dump & trace
|
||||
if (ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) {
|
||||
kill(getpid(), SIGKILL);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
//Decode Bash
|
||||
while (len > 0) {
|
||||
indx++;
|
||||
tmp = stte[indx];
|
||||
jndx += tmp;
|
||||
stte[indx] = stte[jndx];
|
||||
stte[jndx] = tmp;
|
||||
tmp += stte[indx];
|
||||
*ptr ^= stte[tmp];
|
||||
ptr++;
|
||||
len--;
|
||||
}
|
||||
|
||||
//Do the magic
|
||||
sprintf(tmp3, "%s %s", "'********' 21<<<", tmp2);
|
||||
|
||||
//Exec bash script //fork execl with 'sh -c'
|
||||
system(tmp2);
|
||||
|
||||
//Empty script variable
|
||||
memcpy(tmp2, str, lentmp);
|
||||
|
||||
//Clean temp
|
||||
remove("/tmp/shc_x.so");
|
||||
|
||||
//Sinal to detach ptrace
|
||||
ptrace(PTRACE_DETACH, 0, 0, 0);
|
||||
exit(0);
|
||||
}
|
||||
else {wait(&status);}
|
||||
|
||||
/* Seccomp Sandboxing - Start */
|
||||
seccomp_hardening();
|
||||
|
||||
exit(0);
|
||||
}
|
||||
#endif /* HARDENING */
|
||||
|
||||
/*
|
||||
* Key with file invariants.
|
||||
*/
|
||||
int key_with_file(char * file)
|
||||
{
|
||||
struct stat statf[1];
|
||||
struct stat control[1];
|
||||
|
||||
if (stat(file, statf) < 0)
|
||||
return -1;
|
||||
|
||||
/* Turn on stable fields */
|
||||
memset(control, 0, sizeof(control));
|
||||
control->st_ino = statf->st_ino;
|
||||
control->st_dev = statf->st_dev;
|
||||
control->st_rdev = statf->st_rdev;
|
||||
control->st_uid = statf->st_uid;
|
||||
control->st_gid = statf->st_gid;
|
||||
control->st_size = statf->st_size;
|
||||
control->st_mtime = statf->st_mtime;
|
||||
control->st_ctime = statf->st_ctime;
|
||||
key(control, sizeof(control));
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if DEBUGEXEC
|
||||
void debugexec(char * sh11, int argc, char ** argv)
|
||||
{
|
||||
int i;
|
||||
fprintf(stderr, "shll=%s\n", sh11 ? sh11 : "<null>");
|
||||
fprintf(stderr, "argc=%d\n", argc);
|
||||
if (!argv) {
|
||||
fprintf(stderr, "argv=<null>\n");
|
||||
} else {
|
||||
for (i = 0; i <= argc ; i++)
|
||||
fprintf(stderr, "argv[%d]=%.60s\n", i, argv[i] ? argv[i] : "<null>");
|
||||
}
|
||||
}
|
||||
#endif /* DEBUGEXEC */
|
||||
|
||||
void rmarg(char ** argv, char * arg)
|
||||
{
|
||||
for (; argv && *argv && *argv != arg; argv++);
|
||||
for (; argv && *argv; argv++)
|
||||
*argv = argv[1];
|
||||
}
|
||||
|
||||
void chkenv_end(void);
|
||||
|
||||
int chkenv(int argc)
|
||||
{
|
||||
char buff[512];
|
||||
unsigned long mask, m;
|
||||
int l, a, c;
|
||||
char * string;
|
||||
extern char ** environ;
|
||||
|
||||
mask = (unsigned long)getpid();
|
||||
stte_0();
|
||||
key(&chkenv, (void*)&chkenv_end - (void*)&chkenv);
|
||||
key(&data, sizeof(data));
|
||||
key(&mask, sizeof(mask));
|
||||
arc4(&mask, sizeof(mask));
|
||||
sprintf(buff, "x%lx", mask);
|
||||
string = getenv(buff);
|
||||
#if DEBUGEXEC
|
||||
fprintf(stderr, "getenv(%s)=%s\n", buff, string ? string : "<null>");
|
||||
#endif
|
||||
l = strlen(buff);
|
||||
if (!string) {
|
||||
/* 1st */
|
||||
sprintf(&buff[l], "=%lu %d", mask, argc);
|
||||
putenv(strdup(buff));
|
||||
return 0;
|
||||
}
|
||||
c = sscanf(string, "%lu %d%c", &m, &a, buff);
|
||||
if (c == 2 && m == mask) {
|
||||
/* 3rd */
|
||||
rmarg(environ, &string[-l - 1]);
|
||||
return 1 + (argc - a);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void chkenv_end(void){}
|
||||
|
||||
#if HARDENING
|
||||
|
||||
static void gets_process_name(const pid_t pid, char * name) {
|
||||
char procfile[BUFSIZ];
|
||||
sprintf(procfile, "/proc/%d/cmdline", pid);
|
||||
FILE* f = fopen(procfile, "r");
|
||||
if (f) {
|
||||
size_t size;
|
||||
size = fread(name, sizeof (char), sizeof (procfile), f);
|
||||
if (size > 0) {
|
||||
if ('\n' == name[size - 1])
|
||||
name[size - 1] = '\0';
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
||||
void hardening() {
|
||||
prctl(PR_SET_DUMPABLE, 0);
|
||||
prctl(PR_SET_PTRACER, -1);
|
||||
|
||||
int pid = getppid();
|
||||
char name[256] = {0};
|
||||
gets_process_name(pid, name);
|
||||
|
||||
if ( (strcmp(name, "bash") != 0)
|
||||
&& (strcmp(name, "/bin/bash") != 0)
|
||||
&& (strcmp(name, "sh") != 0)
|
||||
&& (strcmp(name, "/bin/sh") != 0)
|
||||
&& (strcmp(name, "sudo") != 0)
|
||||
&& (strcmp(name, "/bin/sudo") != 0)
|
||||
&& (strcmp(name, "/usr/bin/sudo") != 0)
|
||||
&& (strcmp(name, "gksudo") != 0)
|
||||
&& (strcmp(name, "/bin/gksudo") != 0)
|
||||
&& (strcmp(name, "/usr/bin/gksudo") != 0)
|
||||
&& (strcmp(name, "kdesu") != 0)
|
||||
&& (strcmp(name, "/bin/kdesu") != 0)
|
||||
&& (strcmp(name, "/usr/bin/kdesu") != 0)
|
||||
)
|
||||
{
|
||||
printf("Operation not permitted\n");
|
||||
kill(getpid(), SIGKILL);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* HARDENING */
|
||||
|
||||
#if !TRACEABLE
|
||||
|
||||
#define _LINUX_SOURCE_COMPAT
|
||||
#include <sys/ptrace.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if !defined(PT_ATTACHEXC) /* New replacement for PT_ATTACH */
|
||||
#if !defined(PTRACE_ATTACH) && defined(PT_ATTACH)
|
||||
#define PT_ATTACHEXC PT_ATTACH
|
||||
#elif defined(PTRACE_ATTACH)
|
||||
#define PT_ATTACHEXC PTRACE_ATTACH
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void untraceable(char * argv0)
|
||||
{
|
||||
char proc[80];
|
||||
int pid, mine;
|
||||
|
||||
switch(pid = fork()) {
|
||||
case 0:
|
||||
pid = getppid();
|
||||
/* For problematic SunOS ptrace */
|
||||
#if defined(__FreeBSD__)
|
||||
sprintf(proc, "/proc/%d/mem", (int)pid);
|
||||
#else
|
||||
sprintf(proc, "/proc/%d/as", (int)pid);
|
||||
#endif
|
||||
close(0);
|
||||
mine = !open(proc, O_RDWR|O_EXCL);
|
||||
if (!mine && errno != EBUSY)
|
||||
mine = !ptrace(PT_ATTACHEXC, pid, 0, 0);
|
||||
if (mine) {
|
||||
kill(pid, SIGCONT);
|
||||
} else {
|
||||
perror(argv0);
|
||||
kill(pid, SIGKILL);
|
||||
}
|
||||
_exit(mine);
|
||||
case -1:
|
||||
break;
|
||||
default:
|
||||
if (pid == waitpid(pid, 0, 0))
|
||||
return;
|
||||
}
|
||||
perror(argv0);
|
||||
_exit(1);
|
||||
}
|
||||
#endif /* !TRACEABLE */
|
||||
|
||||
char * xsh(int argc, char ** argv)
|
||||
{
|
||||
char * scrpt;
|
||||
int ret, i, j;
|
||||
char ** varg;
|
||||
char * me = argv[0];
|
||||
if (me == NULL) { me = getenv("_"); }
|
||||
if (me == 0) { fprintf(stderr, "E: neither argv[0] nor $_ works."); exit(1); }
|
||||
|
||||
ret = chkenv(argc);
|
||||
stte_0();
|
||||
key(pswd, pswd_z);
|
||||
arc4(msg1, msg1_z);
|
||||
arc4(date, date_z);
|
||||
if (date[0] && (atoll(date)<time(NULL)))
|
||||
return msg1;
|
||||
arc4(shll, shll_z);
|
||||
arc4(inlo, inlo_z);
|
||||
arc4(xecc, xecc_z);
|
||||
arc4(lsto, lsto_z);
|
||||
arc4(tst1, tst1_z);
|
||||
key(tst1, tst1_z);
|
||||
arc4(chk1, chk1_z);
|
||||
if ((chk1_z != tst1_z) || memcmp(tst1, chk1, tst1_z))
|
||||
return tst1;
|
||||
arc4(msg2, msg2_z);
|
||||
if (ret < 0)
|
||||
return msg2;
|
||||
varg = (char **)calloc(argc + 10, sizeof(char *));
|
||||
if (!varg)
|
||||
return 0;
|
||||
if (ret) {
|
||||
arc4(rlax, rlax_z);
|
||||
if (!rlax[0] && key_with_file(shll))
|
||||
return shll;
|
||||
arc4(opts, opts_z);
|
||||
#if HARDENING
|
||||
arc4_hardrun(text, text_z);
|
||||
exit(0);
|
||||
/* Seccomp Sandboxing - Start */
|
||||
seccomp_hardening();
|
||||
#endif
|
||||
arc4(text, text_z);
|
||||
arc4(tst2, tst2_z);
|
||||
key(tst2, tst2_z);
|
||||
arc4(chk2, chk2_z);
|
||||
if ((chk2_z != tst2_z) || memcmp(tst2, chk2, tst2_z))
|
||||
return tst2;
|
||||
/* Prepend hide_z spaces to script text to hide it. */
|
||||
scrpt = malloc(hide_z + text_z);
|
||||
if (!scrpt)
|
||||
return 0;
|
||||
memset(scrpt, (int) ' ', hide_z);
|
||||
memcpy(&scrpt[hide_z], text, text_z);
|
||||
} else { /* Reexecute */
|
||||
if (*xecc) {
|
||||
scrpt = malloc(512);
|
||||
if (!scrpt)
|
||||
return 0;
|
||||
sprintf(scrpt, xecc, me);
|
||||
} else {
|
||||
scrpt = me;
|
||||
}
|
||||
}
|
||||
j = 0;
|
||||
#if BUSYBOXON
|
||||
varg[j++] = "busybox";
|
||||
varg[j++] = "sh";
|
||||
#else
|
||||
varg[j++] = argv[0]; /* My own name at execution */
|
||||
#endif
|
||||
if (ret && *opts)
|
||||
varg[j++] = opts; /* Options on 1st line of code */
|
||||
if (*inlo)
|
||||
varg[j++] = inlo; /* Option introducing inline code */
|
||||
varg[j++] = scrpt; /* The script itself */
|
||||
if (*lsto)
|
||||
varg[j++] = lsto; /* Option meaning last option */
|
||||
i = (ret > 1) ? ret : 0; /* Args numbering correction */
|
||||
while (i < argc)
|
||||
varg[j++] = argv[i++]; /* Main run-time arguments */
|
||||
varg[j] = 0; /* NULL terminated array */
|
||||
#if DEBUGEXEC
|
||||
debugexec(shll, j, varg);
|
||||
#endif
|
||||
execvp(shll, varg);
|
||||
return shll;
|
||||
}
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
#if SETUID
|
||||
setuid(0);
|
||||
#endif
|
||||
#if DEBUGEXEC
|
||||
debugexec("main", argc, argv);
|
||||
#endif
|
||||
#if HARDENING
|
||||
hardening();
|
||||
#endif
|
||||
#if !TRACEABLE
|
||||
untraceable(argv[0]);
|
||||
#endif
|
||||
argv[1] = xsh(argc, argv);
|
||||
fprintf(stderr, "%s%s%s: %s\n", argv[0],
|
||||
errno ? ": " : "",
|
||||
errno ? strerror(errno) : "",
|
||||
argv[1] ? argv[1] : "<null>"
|
||||
);
|
||||
return 1;
|
||||
}
|
Binary file not shown.
|
@ -43,7 +43,7 @@ find "$(pwd)/.config/thorium/Crash Reports/pending/" -mtime +30 \
|
|||
APPNAME=thorium
|
||||
|
||||
# Set DESKTOP variable
|
||||
# DESKTOP="thorium-browser-stable"
|
||||
# DESKTOP="thorium-portable"
|
||||
|
||||
# Set XDG Title variable
|
||||
TITLE="Thorium Portable"
|
||||
|
@ -58,11 +58,73 @@ export CHROME_VERSION_EXTRA="stable, (Portable)"
|
|||
# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
|
||||
export GNOME_DISABLE_CRASH_DIALOG=SET_BY_THORIUM
|
||||
|
||||
# Set config home.
|
||||
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$(pwd)/.config}
|
||||
|
||||
usage () {
|
||||
echo "thorium-browser [-h|--help] [--temp-profile] [options] [URL]"
|
||||
echo
|
||||
echo " -h, -help, or --help This help screen"
|
||||
echo " --temp-profile Start with a new and temporary profile"
|
||||
echo " --safe-mode Disable all chrome://flags flags"
|
||||
echo
|
||||
echo " Other supported options are:"
|
||||
MANWIDTH=80 man thorium-browser | sed -e '1,/OPTIONS/d; /ENVIRONMENT/,$d'
|
||||
echo " See 'man thorium-browser' for more details"
|
||||
}
|
||||
|
||||
want_temp_profile=0
|
||||
is_safe_mode=0
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h | --help | -help )
|
||||
usage
|
||||
exit 0 ;;
|
||||
--temp-profile )
|
||||
want_temp_profile=1
|
||||
shift ;;
|
||||
--safe-mode )
|
||||
is_safe_mode=1
|
||||
shift ;;
|
||||
-- ) # Stop option processing
|
||||
shift
|
||||
break ;;
|
||||
* ) # Else
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Allow users to override command-line options with a file.
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium-flags.conf)"
|
||||
fi
|
||||
|
||||
# Sanitize std{in,out,err} because they'll be shared with untrusted child
|
||||
# processes (http://crbug.com/376567).
|
||||
exec < /dev/null
|
||||
exec > >(exec cat)
|
||||
exec 2> >(exec cat >&2)
|
||||
|
||||
if [ $want_temp_profile -eq 1 ] ; then
|
||||
TEMP_PROFILE=`mktemp -d`
|
||||
echo "Using temporary profile: $TEMP_PROFILE"
|
||||
PROFILE="$TEMP_PROFILE"
|
||||
CACHE="$TEMP_PROFILE/cache"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS"
|
||||
else
|
||||
PROFILE="$HERE/.config/thorium"
|
||||
CACHE="$HERE/.config/cache"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS"
|
||||
fi
|
||||
|
||||
if [ $is_safe_mode -eq 1 ] ; then
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --no-experiments"
|
||||
fi
|
||||
|
||||
# Launch Thorium
|
||||
# Note: exec -a below is a bashism.
|
||||
exec -a "$0" "$HERE/thorium" "--user-data-dir=$(pwd)/.config/thorium" "--disk-cache-dir=$(pwd)/.config/cache" "--disable-machine-id" "--disable-encryption" "$@"
|
||||
exec -a "$0" "$HERE/thorium" "--disable-machine-id" "--disable-encryption" "--user-data-dir=$PROFILE" "--disk-cache-dir=$CACHE" "$CHROME_USER_FLAGS" "$@"
|
||||
|
|
Binary file not shown.
|
@ -2,4 +2,15 @@
|
|||
|
||||
# Copyright (c) 2024 Alex313031
|
||||
|
||||
./thorium_shell --user-data-dir=$(pwd)/.config/thorium-shell --enable-experimental-web-platform-features --enable-clear-hevc-for-testing $@
|
||||
export SHELL_WRAPPER="`readlink -f "$0"`"
|
||||
|
||||
HERE="`dirname "$SHELL_WRAPPER"`"
|
||||
|
||||
PROFILE="$HERE/.config/thorium-shell"
|
||||
CACHE="$HERE/.config/cache"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
|
||||
# Launch thorium_shell
|
||||
# Note: exec -a below is a bashism.
|
||||
exec -a "$0" "$HERE/thorium_shell" "--user-data-dir=$PROFILE" "--disk-cache-dir=$CACHE" "--enable-experimental-web-platform-features" "--enable-clear-hevc-for-testing" "$@"
|
||||
|
|
63
infra/portable/build_portable_binaries.sh
Executable file
63
infra/portable/build_portable_binaries.sh
Executable file
|
@ -0,0 +1,63 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (c) 2024 Alex313031.
|
||||
|
||||
YEL='\033[1;33m' # Yellow
|
||||
RED='\033[1;31m' # Red
|
||||
GRE='\033[1;32m' # Green
|
||||
c0=$'\033[0m' # Reset Text
|
||||
bold=$'\033[1m' # Bold Text
|
||||
underline=$'\033[4m' # Underline Text
|
||||
|
||||
# Error handling
|
||||
yell() { echo "$0: $*" >&2; }
|
||||
die() { yell "$*"; exit 111; }
|
||||
try() { "$@" || die "${RED}Failed $*"; }
|
||||
|
||||
# --help
|
||||
displayHelp () {
|
||||
printf "\n" &&
|
||||
printf "${bold}${GRE}Script to re-generate the portable binaries.${c0}\n" &&
|
||||
printf "${bold}${GRE}It simply uses \`shc\` to compile the *.sh scripts.${c0}\n" &&
|
||||
printf "${bold}${GRE}Use the --help flag to show this help.${c0}\n" &&
|
||||
printf "\n"
|
||||
}
|
||||
case $1 in
|
||||
--help) displayHelp; exit 0;;
|
||||
esac
|
||||
|
||||
printf "\n" &&
|
||||
printf "${bold}${GRE}Script to re-generate the portable binaries.${c0}\n" &&
|
||||
printf "${bold}${GRE}It simply uses \`shc\` to compile the *.sh scripts.${c0}\n" &&
|
||||
printf "${bold}${GRE}Use the --help flag to show this help.${c0}\n" &&
|
||||
printf "\n"
|
||||
|
||||
# The point of all this is to have a binary that can simply
|
||||
# be double-clicked, instead of having to set exec permissions
|
||||
# on the .sh scripts, and then run them from the command line.
|
||||
# Some OSes and file managers (like Thunar) have options to
|
||||
# allow executing bash scripts, but this is not garunteed,
|
||||
# and decreases the security of the system.
|
||||
|
||||
# shc -r relaxes security to make a redistributable binary
|
||||
# There isn't anything malicious here so it's OK
|
||||
|
||||
# Cleanup old binaries
|
||||
rm -r -v ./THORIUM-PORTABLE &&
|
||||
rm -r -v ./THORIUM-SHELL &&
|
||||
rm -f -v ./C/THORIUM-PORTABLE.sh.x.c &&
|
||||
rm -f -v ./C/THORIUM-SHELL.sh.x.c &&
|
||||
|
||||
sleep 1s &&
|
||||
|
||||
shc -r -v -o ./THORIUM-PORTABLE -f ./THORIUM-PORTABLE.sh &&
|
||||
shc -r -v -o ./THORIUM-SHELL -f ./THORIUM-SHELL.sh &&
|
||||
|
||||
# Move generated C files for possible future use
|
||||
mv -f -v ./THORIUM-PORTABLE.sh.x.c ./C/ &&
|
||||
mv -f -v ./THORIUM-SHELL.sh.x.c ./C/ &&
|
||||
|
||||
printf "\n" &&
|
||||
printf "${GRE}Done!\n" &&
|
||||
printf "\n" &&
|
||||
tput sgr0
|
|
@ -43,7 +43,7 @@ find "$HOME/.config/thorium/Crash Reports/pending/" -mtime +30 \
|
|||
APPNAME=thorium
|
||||
|
||||
# Set DESKTOP variable
|
||||
# DESKTOP="thorium-browser-stable"
|
||||
# DESKTOP="thorium-browser"
|
||||
|
||||
# Set XDG Title variable
|
||||
TITLE="Thorium Browser"
|
||||
|
@ -64,8 +64,9 @@ XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
|
|||
usage () {
|
||||
echo "thorium-browser [-h|--help] [--temp-profile] [options] [URL]"
|
||||
echo
|
||||
echo " -h or --help This help screen"
|
||||
echo " -h, -help, or --help This help screen"
|
||||
echo " --temp-profile Start with a new and temporary profile"
|
||||
echo " --safe-mode Disable all chrome://flags flags"
|
||||
echo
|
||||
echo " Other supported options are:"
|
||||
MANWIDTH=80 man thorium-browser | sed -e '1,/OPTIONS/d; /ENVIRONMENT/,$d'
|
||||
|
@ -73,6 +74,7 @@ usage () {
|
|||
}
|
||||
|
||||
want_temp_profile=0
|
||||
is_safe_mode=0
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h | --help | -help )
|
||||
|
@ -81,17 +83,20 @@ while [ $# -gt 0 ]; do
|
|||
--temp-profile )
|
||||
want_temp_profile=1
|
||||
shift ;;
|
||||
-- ) # Stop option prcessing
|
||||
--safe-mode )
|
||||
is_safe_mode=1
|
||||
shift ;;
|
||||
-- ) # Stop option processing
|
||||
shift
|
||||
break ;;
|
||||
* )
|
||||
* ) # Else
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Allow users to override command-line options with a file.
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium-flags.conf)"
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium/thorium-flags.conf)"
|
||||
fi
|
||||
|
||||
# Sanitize std{in,out,err} because they'll be shared with untrusted child
|
||||
|
@ -103,7 +108,21 @@ exec 2> >(exec cat >&2)
|
|||
if [ $want_temp_profile -eq 1 ] ; then
|
||||
TEMP_PROFILE=`mktemp -d`
|
||||
echo "Using temporary profile: $TEMP_PROFILE"
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE"
|
||||
PROFILE="$TEMP_PROFILE"
|
||||
CACHE="$TEMP_PROFILE/cache"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE --disk-cache-dir=$CACHE"
|
||||
else
|
||||
PROFILE="$XDG_CONFIG_HOME/thorium"
|
||||
CACHE="$XDG_CONFIG_HOME/thorium"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS"
|
||||
fi
|
||||
|
||||
if [ $is_safe_mode -eq 1 ] ; then
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --no-experiments"
|
||||
fi
|
||||
|
||||
# Launch Thorium
|
||||
|
|
|
@ -43,7 +43,7 @@ find "$HOME/.config/thorium/Crash Reports/pending/" -mtime +30 \
|
|||
APPNAME=thorium
|
||||
|
||||
# Set DESKTOP variable
|
||||
# DESKTOP="thorium-browser-stable"
|
||||
# DESKTOP="thorium-browser"
|
||||
|
||||
# Set XDG Title variable
|
||||
TITLE="Thorium Browser"
|
||||
|
@ -64,8 +64,9 @@ XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
|
|||
usage () {
|
||||
echo "thorium-browser [-h|--help] [--temp-profile] [options] [URL]"
|
||||
echo
|
||||
echo " -h or --help This help screen"
|
||||
echo " -h, -help, or --help This help screen"
|
||||
echo " --temp-profile Start with a new and temporary profile"
|
||||
echo " --safe-mode Disable all chrome://flags flags"
|
||||
echo
|
||||
echo " Other supported options are:"
|
||||
MANWIDTH=80 man thorium-browser | sed -e '1,/OPTIONS/d; /ENVIRONMENT/,$d'
|
||||
|
@ -73,6 +74,7 @@ usage () {
|
|||
}
|
||||
|
||||
want_temp_profile=0
|
||||
is_safe_mode=0
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h | --help | -help )
|
||||
|
@ -81,17 +83,20 @@ while [ $# -gt 0 ]; do
|
|||
--temp-profile )
|
||||
want_temp_profile=1
|
||||
shift ;;
|
||||
-- ) # Stop option prcessing
|
||||
--safe-mode )
|
||||
is_safe_mode=1
|
||||
shift ;;
|
||||
-- ) # Stop option processing
|
||||
shift
|
||||
break ;;
|
||||
* )
|
||||
* ) # Else
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Allow users to override command-line options with a file.
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium-flags.conf)"
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium/thorium-flags.conf)"
|
||||
fi
|
||||
|
||||
# Sanitize std{in,out,err} because they'll be shared with untrusted child
|
||||
|
@ -103,7 +108,21 @@ exec 2> >(exec cat >&2)
|
|||
if [ $want_temp_profile -eq 1 ] ; then
|
||||
TEMP_PROFILE=`mktemp -d`
|
||||
echo "Using temporary profile: $TEMP_PROFILE"
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE"
|
||||
PROFILE="$TEMP_PROFILE"
|
||||
CACHE="$TEMP_PROFILE/cache"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE --disk-cache-dir=$CACHE"
|
||||
else
|
||||
PROFILE="$XDG_CONFIG_HOME/thorium"
|
||||
CACHE="$XDG_CONFIG_HOME/thorium"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS"
|
||||
fi
|
||||
|
||||
if [ $is_safe_mode -eq 1 ] ; then
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --no-experiments"
|
||||
fi
|
||||
|
||||
# Launch Thorium
|
||||
|
|
|
@ -43,7 +43,7 @@ find "$HOME/.config/thorium/Crash Reports/pending/" -mtime +30 \
|
|||
APPNAME=thorium
|
||||
|
||||
# Set DESKTOP variable
|
||||
# DESKTOP="thorium-browser-stable"
|
||||
# DESKTOP="thorium-browser"
|
||||
|
||||
# Set XDG Title variable
|
||||
TITLE="Thorium Browser"
|
||||
|
@ -64,8 +64,9 @@ XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
|
|||
usage () {
|
||||
echo "thorium-browser [-h|--help] [--temp-profile] [options] [URL]"
|
||||
echo
|
||||
echo " -h or --help This help screen"
|
||||
echo " -h, -help, or --help This help screen"
|
||||
echo " --temp-profile Start with a new and temporary profile"
|
||||
echo " --safe-mode Disable all chrome://flags flags"
|
||||
echo
|
||||
echo " Other supported options are:"
|
||||
MANWIDTH=80 man thorium-browser | sed -e '1,/OPTIONS/d; /ENVIRONMENT/,$d'
|
||||
|
@ -73,6 +74,7 @@ usage () {
|
|||
}
|
||||
|
||||
want_temp_profile=0
|
||||
is_safe_mode=0
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h | --help | -help )
|
||||
|
@ -81,17 +83,20 @@ while [ $# -gt 0 ]; do
|
|||
--temp-profile )
|
||||
want_temp_profile=1
|
||||
shift ;;
|
||||
-- ) # Stop option prcessing
|
||||
--safe-mode )
|
||||
is_safe_mode=1
|
||||
shift ;;
|
||||
-- ) # Stop option processing
|
||||
shift
|
||||
break ;;
|
||||
* )
|
||||
* ) # Else
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Allow users to override command-line options with a file.
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium-flags.conf)"
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium/thorium-flags.conf)"
|
||||
fi
|
||||
|
||||
# Sanitize std{in,out,err} because they'll be shared with untrusted child
|
||||
|
@ -103,7 +108,21 @@ exec 2> >(exec cat >&2)
|
|||
if [ $want_temp_profile -eq 1 ] ; then
|
||||
TEMP_PROFILE=`mktemp -d`
|
||||
echo "Using temporary profile: $TEMP_PROFILE"
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE"
|
||||
PROFILE="$TEMP_PROFILE"
|
||||
CACHE="$TEMP_PROFILE/cache"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE --disk-cache-dir=$CACHE"
|
||||
else
|
||||
PROFILE="$XDG_CONFIG_HOME/thorium"
|
||||
CACHE="$XDG_CONFIG_HOME/thorium"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS"
|
||||
fi
|
||||
|
||||
if [ $is_safe_mode -eq 1 ] ; then
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --no-experiments"
|
||||
fi
|
||||
|
||||
# Launch Thorium
|
||||
|
|
|
@ -43,7 +43,7 @@ find "$HOME/.config/thorium/Crash Reports/pending/" -mtime +30 \
|
|||
APPNAME=thorium
|
||||
|
||||
# Set DESKTOP variable
|
||||
# DESKTOP="thorium-browser-stable"
|
||||
# DESKTOP="thorium-browser"
|
||||
|
||||
# Set XDG Title variable
|
||||
TITLE="Thorium Browser"
|
||||
|
@ -64,8 +64,9 @@ XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
|
|||
usage () {
|
||||
echo "thorium-browser [-h|--help] [--temp-profile] [options] [URL]"
|
||||
echo
|
||||
echo " -h or --help This help screen"
|
||||
echo " -h, -help, or --help This help screen"
|
||||
echo " --temp-profile Start with a new and temporary profile"
|
||||
echo " --safe-mode Disable all chrome://flags flags"
|
||||
echo
|
||||
echo " Other supported options are:"
|
||||
MANWIDTH=80 man thorium-browser | sed -e '1,/OPTIONS/d; /ENVIRONMENT/,$d'
|
||||
|
@ -73,6 +74,7 @@ usage () {
|
|||
}
|
||||
|
||||
want_temp_profile=0
|
||||
is_safe_mode=0
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h | --help | -help )
|
||||
|
@ -81,17 +83,20 @@ while [ $# -gt 0 ]; do
|
|||
--temp-profile )
|
||||
want_temp_profile=1
|
||||
shift ;;
|
||||
-- ) # Stop option prcessing
|
||||
--safe-mode )
|
||||
is_safe_mode=1
|
||||
shift ;;
|
||||
-- ) # Stop option processing
|
||||
shift
|
||||
break ;;
|
||||
* )
|
||||
* ) # Else
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Allow users to override command-line options with a file.
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium-flags.conf)"
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium/thorium-flags.conf)"
|
||||
fi
|
||||
|
||||
# Sanitize std{in,out,err} because they'll be shared with untrusted child
|
||||
|
@ -103,7 +108,21 @@ exec 2> >(exec cat >&2)
|
|||
if [ $want_temp_profile -eq 1 ] ; then
|
||||
TEMP_PROFILE=`mktemp -d`
|
||||
echo "Using temporary profile: $TEMP_PROFILE"
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE"
|
||||
PROFILE="$TEMP_PROFILE"
|
||||
CACHE="$TEMP_PROFILE/cache"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE --disk-cache-dir=$CACHE"
|
||||
else
|
||||
PROFILE="$XDG_CONFIG_HOME/thorium"
|
||||
CACHE="$XDG_CONFIG_HOME/thorium"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS"
|
||||
fi
|
||||
|
||||
if [ $is_safe_mode -eq 1 ] ; then
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --no-experiments"
|
||||
fi
|
||||
|
||||
# Launch Thorium
|
||||
|
|
|
@ -43,7 +43,7 @@ find "$HOME/.config/thorium/Crash Reports/pending/" -mtime +30 \
|
|||
APPNAME=thorium
|
||||
|
||||
# Set DESKTOP variable
|
||||
# DESKTOP="thorium-browser-stable"
|
||||
# DESKTOP="thorium-browser"
|
||||
|
||||
# Set XDG Title variable
|
||||
TITLE="Thorium Browser"
|
||||
|
@ -64,8 +64,9 @@ XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
|
|||
usage () {
|
||||
echo "thorium-browser [-h|--help] [--temp-profile] [options] [URL]"
|
||||
echo
|
||||
echo " -h or --help This help screen"
|
||||
echo " -h, -help, or --help This help screen"
|
||||
echo " --temp-profile Start with a new and temporary profile"
|
||||
echo " --safe-mode Disable all chrome://flags flags"
|
||||
echo
|
||||
echo " Other supported options are:"
|
||||
MANWIDTH=80 man thorium-browser | sed -e '1,/OPTIONS/d; /ENVIRONMENT/,$d'
|
||||
|
@ -73,6 +74,7 @@ usage () {
|
|||
}
|
||||
|
||||
want_temp_profile=0
|
||||
is_safe_mode=0
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h | --help | -help )
|
||||
|
@ -81,17 +83,20 @@ while [ $# -gt 0 ]; do
|
|||
--temp-profile )
|
||||
want_temp_profile=1
|
||||
shift ;;
|
||||
-- ) # Stop option prcessing
|
||||
--safe-mode )
|
||||
is_safe_mode=1
|
||||
shift ;;
|
||||
-- ) # Stop option processing
|
||||
shift
|
||||
break ;;
|
||||
* )
|
||||
* ) # Else
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Allow users to override command-line options with a file.
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium-flags.conf)"
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium/thorium-flags.conf)"
|
||||
fi
|
||||
|
||||
# Sanitize std{in,out,err} because they'll be shared with untrusted child
|
||||
|
@ -103,7 +108,21 @@ exec 2> >(exec cat >&2)
|
|||
if [ $want_temp_profile -eq 1 ] ; then
|
||||
TEMP_PROFILE=`mktemp -d`
|
||||
echo "Using temporary profile: $TEMP_PROFILE"
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE"
|
||||
PROFILE="$TEMP_PROFILE"
|
||||
CACHE="$TEMP_PROFILE/cache"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE --disk-cache-dir=$CACHE"
|
||||
else
|
||||
PROFILE="$XDG_CONFIG_HOME/thorium"
|
||||
CACHE="$XDG_CONFIG_HOME/thorium"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS"
|
||||
fi
|
||||
|
||||
if [ $is_safe_mode -eq 1 ] ; then
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --no-experiments"
|
||||
fi
|
||||
|
||||
# Launch Thorium
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
diff --git a/chrome/browser/ui/layout_constants.cc b/chrome/browser/ui/layout_constants.cc
|
||||
index bba403a7e5068..52d3d6485cecb 100644
|
||||
index bba403a7e5068..e6cba4e30c0a0 100644
|
||||
--- a/chrome/browser/ui/layout_constants.cc
|
||||
+++ b/chrome/browser/ui/layout_constants.cc
|
||||
@@ -1,12 +1,14 @@
|
||||
|
@ -24,7 +24,7 @@ index bba403a7e5068..52d3d6485cecb 100644
|
|||
// to the white space above and below.
|
||||
- const int bookmark_bar_attached_vertical_margin =
|
||||
- features::IsChromeRefresh2023() ? 6 : 4;
|
||||
+ const int bookmark_bar_attached_vertical_margin = Th24State() ? 4 : 6;
|
||||
+ const int bookmark_bar_attached_vertical_margin = Th24State() ? 2 : 6;
|
||||
return GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT) +
|
||||
bookmark_bar_attached_vertical_margin;
|
||||
}
|
||||
|
@ -43,7 +43,23 @@ index bba403a7e5068..52d3d6485cecb 100644
|
|||
case TAB_SEPARATOR_HEIGHT:
|
||||
// TODO (crbug.com/1451400): ChromeRefresh2023 needs different values for
|
||||
// this constant.
|
||||
@@ -139,7 +146,7 @@ int GetLayoutConstant(LayoutConstant constant) {
|
||||
@@ -125,9 +132,13 @@ int GetLayoutConstant(LayoutConstant constant) {
|
||||
case TOOLBAR_DIVIDER_CORNER_RADIUS:
|
||||
return 1;
|
||||
case TOOLBAR_DIVIDER_HEIGHT:
|
||||
- return touch_ui ? 20 : 16;
|
||||
+ if (Th24State()) {
|
||||
+ return 20;
|
||||
+ } else {
|
||||
+ return touch_ui ? 20 : 16;
|
||||
+ }
|
||||
case TOOLBAR_DIVIDER_SPACING:
|
||||
- return 9;
|
||||
+ return Th24State() ? 8 : 9;
|
||||
case TOOLBAR_DIVIDER_WIDTH:
|
||||
return 2;
|
||||
case TOOLBAR_ELEMENT_PADDING:
|
||||
@@ -139,7 +150,7 @@ int GetLayoutConstant(LayoutConstant constant) {
|
||||
return GetLayoutConstant(TOOLBAR_ELEMENT_PADDING);
|
||||
}
|
||||
case TOOLBAR_STANDARD_SPACING:
|
||||
|
@ -52,12 +68,12 @@ index bba403a7e5068..52d3d6485cecb 100644
|
|||
return touch_ui ? 12 : 9;
|
||||
} else {
|
||||
return touch_ui ? 12 : 8;
|
||||
@@ -149,7 +156,7 @@ int GetLayoutConstant(LayoutConstant constant) {
|
||||
@@ -149,7 +160,7 @@ int GetLayoutConstant(LayoutConstant constant) {
|
||||
case DOWNLOAD_ICON_SIZE:
|
||||
return features::IsChromeRefresh2023() ? 20 : 16;
|
||||
case TOOLBAR_CORNER_RADIUS:
|
||||
- return 8;
|
||||
+ return Th24State() ? 0 : 8;
|
||||
+ return Th24State() ? 0 : 2;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
60
src/BUILD.gn
60
src/BUILD.gn
|
@ -42,6 +42,10 @@ if (is_android) {
|
|||
import("//build/config/android/config.gni")
|
||||
}
|
||||
|
||||
if (current_cpu == "arm" || current_cpu == "arm64") {
|
||||
import("//build/config/arm.gni")
|
||||
}
|
||||
|
||||
if (is_fuchsia) {
|
||||
import("//build/config/fuchsia/generate_runner_scripts.gni")
|
||||
import("//third_party/fuchsia-gn-sdk/src/component.gni")
|
||||
|
@ -73,7 +77,7 @@ if (is_official_build) {
|
|||
|
||||
# Thorium target that simply pulls in the chrome target as a dependency
|
||||
group("thorium") {
|
||||
if (is_win || is_linux || is_mac) {
|
||||
if (is_win || is_linux || is_mac || is_chromeos || is_fuchsia) {
|
||||
deps = [ "//chrome:chrome" ]
|
||||
}
|
||||
|
||||
|
@ -82,6 +86,60 @@ group("thorium") {
|
|||
}
|
||||
}
|
||||
|
||||
# Thorium target that builds everything for a release build
|
||||
# according to the platform
|
||||
group("thorium_all") {
|
||||
testonly = true
|
||||
|
||||
if (is_win || is_linux || is_mac) {
|
||||
deps = [
|
||||
"//chrome:chrome",
|
||||
"//chrome/test/chromedriver:chromedriver",
|
||||
"//components/policy:policy_templates",
|
||||
"//content/shell:thorium_shell",
|
||||
"//media/cdm/library_cdm/clear_key_cdm:clear_key_cdm"
|
||||
]
|
||||
if (is_debug) {
|
||||
deps += [ "//ui/views/examples:thorium_ui_debug_shell" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (is_linux) {
|
||||
deps += [ "//sandbox/linux:chrome_sandbox" ]
|
||||
}
|
||||
|
||||
if (is_win) {
|
||||
deps += [
|
||||
"//chrome:chrome_dll",
|
||||
"//components/policy:pack_policy_templates"
|
||||
]
|
||||
if (is_official_build) {
|
||||
deps += [
|
||||
"//chrome/installer/mini_installer:mini_installer",
|
||||
"//chrome/installer/setup:setup"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if (is_android) {
|
||||
if (current_cpu == "arm") {
|
||||
deps += [
|
||||
"//android_webview:system_webview_apk",
|
||||
"//chrome/android:chrome_public_apk",
|
||||
"//content/shell/android:content_shell_apk"
|
||||
]
|
||||
} else if (current_cpu == "arm64") {
|
||||
deps += [
|
||||
"//android_webview:system_webview_64_apk",
|
||||
"//chrome/android:chrome_public_apk",
|
||||
"//content/shell/android:content_shell_apk"
|
||||
]
|
||||
} else {
|
||||
deps += [ "//android_webview:system_webview_64_apk" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# The `gn_all` target is used to list all of the main targets in the build, so
|
||||
# that we can figure out which BUILD.gn files to process, following the process
|
||||
# described at the top of this file.
|
||||
|
|
|
@ -79,7 +79,8 @@
|
|||
|
||||
{"custom-ntp",
|
||||
"Custom New Tab Page",
|
||||
"Allows setting a custom URL for the New Tab Page (NTP). Value can be internal (e.g. `about:blank` or `chrome://new-tab-page`), external (e.g. `example.com`), or local (e.g. `file:///tmp/startpage.html`). "
|
||||
"Allows setting a custom URL for the New Tab Page (NTP). Value can be internal (e.g. `about:blank` or `chrome://new-tab-page`), "
|
||||
"external (e.g. `example.com`), or local (e.g. `file:///tmp/startpage.html`). "
|
||||
"This applies for incognito windows as well when not set to a `chrome://` internal page.",
|
||||
kOsDesktop, ORIGIN_LIST_VALUE_TYPE("custom-ntp", "")},
|
||||
{"hide-sidepanel-button",
|
||||
|
@ -99,9 +100,10 @@
|
|||
#endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
|
||||
|
||||
{"autoplay-policy",
|
||||
"Disable/Enable AutoPlay",
|
||||
"Allows setting the AutoPlay policy. Use `No User Gesture Required` to enable AutoPlay, use `Document User Activation Required` to disable AutoPlay "
|
||||
"and force all sites to require a click to initiate media playback. `User Gesture Required` is the default, and blocks most AutoPlay annoyances, while allowing some (i.e. WebAudio) to continue.",
|
||||
"Configure AutoPlay Policy",
|
||||
"Allows setting the AutoPlay policy. `No User Gesture Required` enables AutoPlay. `Document User Activation Required` disables AutoPlay, "
|
||||
"and forces all sites to require a click to initiate media playback; this is the default if unset. `User Gesture Required` blocks "
|
||||
"most AutoPlay annoyances, while still allowing some (i.e. WebAudio) to continue.",
|
||||
kOsDesktop, MULTI_VALUE_TYPE(kAutoplayPolicyChoices)},
|
||||
{"allow-insecure-downloads",
|
||||
"Allow Insecure Downloads",
|
||||
|
@ -155,8 +157,9 @@
|
|||
"Enabled by default, but may break some configurations. Thorium flag.",
|
||||
kOsLinux, FEATURE_VALUE_TYPE(media::kVaapiVideoDecodeLinuxGL)},
|
||||
{"gtk-version",
|
||||
"Choose the GTK Version",
|
||||
"Choose whether to use the GTK3 or GTK4 backend. It should match the default GTK used by the system.",
|
||||
"GTK Version Override",
|
||||
"Choose whether to use the GTK3 or GTK4 backend. It should be set to match the default GTK used by the system, "
|
||||
"but can be overridden for testing or experimenting.",
|
||||
kOsLinux, MULTI_VALUE_TYPE(kGtkVersionChoices)},
|
||||
{"vaapi-on-nvidia-gpus",
|
||||
"VAAPI on nVidia GPUs",
|
||||
|
@ -195,7 +198,8 @@
|
|||
#if !BUILDFLAG(IS_ANDROID)
|
||||
{"media-router",
|
||||
"Enable/Disable Media Router",
|
||||
"Media router is a component responsible for pairing Thorium to devices and endpoints, for streaming and rendering media sources on those devices. This is used, for example, for Cast.",
|
||||
"Media router is a component responsible for pairing Thorium to devices and endpoints, "
|
||||
"for streaming and rendering media sources on those devices. This is used, for example, for Cast.",
|
||||
kOsDesktop, FEATURE_VALUE_TYPE(media_router::kMediaRouter)},
|
||||
#endif // BUILDFLAG(IS_ANDROID)
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ const char* const kBadFlags[] = {
|
|||
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
// This flag gives extensions more powers.
|
||||
extensions::switches::kExtensionsOnChromeURLs,
|
||||
// extensions::switches::kExtensionsOnChromeURLs, (Disabled by Alex313031)
|
||||
#endif
|
||||
|
||||
// TODO(crbug.com/40118868): Revisit the macro expression once build flag switch
|
||||
|
|
|
@ -6,10 +6,12 @@
|
|||
#define CHROME_BROWSER_UI_THORIUM_2024_UI_H_
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "ui/base/ui_base_features.h"
|
||||
|
||||
static bool Th24State() {
|
||||
static const bool chrome_2024 = features::IsChromeRefresh2023();
|
||||
static const bool thorium_2024 = base::CommandLine::ForCurrentProcess()->HasSwitch("thorium-2024");
|
||||
return thorium_2024;
|
||||
return thorium_2024 && chrome_2024;
|
||||
}
|
||||
|
||||
#endif // CHROME_BROWSER_UI_THORIUM_2024_UI_H_
|
||||
|
|
|
@ -43,7 +43,7 @@ find "$HOME/.config/thorium/Crash Reports/pending/" -mtime +30 \
|
|||
APPNAME=thorium
|
||||
|
||||
# Set DESKTOP variable
|
||||
# DESKTOP="thorium-browser-stable"
|
||||
# DESKTOP="thorium-browser"
|
||||
|
||||
# Set XDG Title variable
|
||||
TITLE="Thorium Browser"
|
||||
|
@ -64,8 +64,9 @@ XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
|
|||
usage () {
|
||||
echo "thorium-browser [-h|--help] [--temp-profile] [options] [URL]"
|
||||
echo
|
||||
echo " -h or --help This help screen"
|
||||
echo " -h, -help, or --help This help screen"
|
||||
echo " --temp-profile Start with a new and temporary profile"
|
||||
echo " --safe-mode Disable all chrome://flags flags"
|
||||
echo
|
||||
echo " Other supported options are:"
|
||||
MANWIDTH=80 man thorium-browser | sed -e '1,/OPTIONS/d; /ENVIRONMENT/,$d'
|
||||
|
@ -73,6 +74,7 @@ usage () {
|
|||
}
|
||||
|
||||
want_temp_profile=0
|
||||
is_safe_mode=0
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h | --help | -help )
|
||||
|
@ -81,17 +83,20 @@ while [ $# -gt 0 ]; do
|
|||
--temp-profile )
|
||||
want_temp_profile=1
|
||||
shift ;;
|
||||
-- ) # Stop option prcessing
|
||||
--safe-mode )
|
||||
is_safe_mode=1
|
||||
shift ;;
|
||||
-- ) # Stop option processing
|
||||
shift
|
||||
break ;;
|
||||
* )
|
||||
* ) # Else
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Allow users to override command-line options with a file.
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium-flags.conf)"
|
||||
if [[ -f $XDG_CONFIG_HOME/thorium/thorium-flags.conf ]]; then
|
||||
CHROME_USER_FLAGS="$(cat $XDG_CONFIG_HOME/thorium/thorium-flags.conf)"
|
||||
fi
|
||||
|
||||
# Sanitize std{in,out,err} because they'll be shared with untrusted child
|
||||
|
@ -103,7 +108,21 @@ exec 2> >(exec cat >&2)
|
|||
if [ $want_temp_profile -eq 1 ] ; then
|
||||
TEMP_PROFILE=`mktemp -d`
|
||||
echo "Using temporary profile: $TEMP_PROFILE"
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE"
|
||||
PROFILE="$TEMP_PROFILE"
|
||||
CACHE="$TEMP_PROFILE/cache"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --user-data-dir=$TEMP_PROFILE --disk-cache-dir=$CACHE"
|
||||
else
|
||||
PROFILE="$XDG_CONFIG_HOME/thorium"
|
||||
CACHE="$XDG_CONFIG_HOME/thorium"
|
||||
export PROFILE
|
||||
export CACHE
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS"
|
||||
fi
|
||||
|
||||
if [ $is_safe_mode -eq 1 ] ; then
|
||||
CHROME_USER_FLAGS="$CHROME_USER_FLAGS --no-experiments"
|
||||
fi
|
||||
|
||||
# Launch Thorium
|
||||
|
|
Loading…
Reference in a new issue