From bcc54f7bda9c5efe7ba4d6529b04eaa6e183a911 Mon Sep 17 00:00:00 2001 From: Alexander Frick Date: Tue, 20 Aug 2024 14:26:49 -0500 Subject: [PATCH] update wrappers, scripts, and Th24 UI --- TODO.md | 4 + autobuild.sh | 58 + infra/install_deps.sh => get_repo.sh | 0 infra/DEBUG/build_debug_shell_linux.sh | 83 +- infra/DEBUG/build_debug_shell_win.sh | 69 +- infra/portable/C/THORIUM-PORTABLE.sh.x.c | 1017 +++++++++++++++++ infra/portable/C/THORIUM-SHELL.sh.x.c | 722 ++++++++++++ infra/portable/THORIUM-PORTABLE | Bin 18016 -> 20328 bytes infra/portable/THORIUM-PORTABLE.sh | 66 +- infra/portable/THORIUM-SHELL | Bin 15288 -> 15616 bytes infra/portable/THORIUM-SHELL.sh | 13 +- infra/portable/build_portable_binaries.sh | 63 + infra/thor_ver_linux/wrapper-avx2 | 33 +- infra/thor_ver_linux/wrapper-avx512 | 33 +- infra/thor_ver_linux/wrapper-sse2 | 33 +- infra/thor_ver_linux/wrapper-sse3 | 33 +- infra/thor_ver_linux/wrapper-sse4 | 33 +- other/thorium-2024-ui.patch | 26 +- src/BUILD.gn | 60 +- src/chrome/browser/thorium_flag_entries.h | 18 +- .../browser/ui/startup/bad_flags_prompt.cc | 2 +- src/chrome/browser/ui/thorium_2024.h | 4 +- src/chrome/installer/linux/common/wrapper | 33 +- 23 files changed, 2271 insertions(+), 132 deletions(-) create mode 100755 autobuild.sh rename infra/install_deps.sh => get_repo.sh (100%) create mode 100644 infra/portable/C/THORIUM-PORTABLE.sh.x.c create mode 100644 infra/portable/C/THORIUM-SHELL.sh.x.c create mode 100755 infra/portable/build_portable_binaries.sh diff --git a/TODO.md b/TODO.md index dd80f0c2..b03caa9c 100644 --- a/TODO.md +++ b/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 diff --git a/autobuild.sh b/autobuild.sh new file mode 100755 index 00000000..d9cdfd69 --- /dev/null +++ b/autobuild.sh @@ -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 diff --git a/infra/install_deps.sh b/get_repo.sh similarity index 100% rename from infra/install_deps.sh rename to get_repo.sh diff --git a/infra/DEBUG/build_debug_shell_linux.sh b/infra/DEBUG/build_debug_shell_linux.sh index 770451a8..d04f6f8c 100755 --- a/infra/DEBUG/build_debug_shell_linux.sh +++ b/infra/DEBUG/build_debug_shell_linux.sh @@ -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 diff --git a/infra/DEBUG/build_debug_shell_win.sh b/infra/DEBUG/build_debug_shell_win.sh index 7fd8100f..6bb107c5 100755 --- a/infra/DEBUG/build_debug_shell_win.sh +++ b/infra/DEBUG/build_debug_shell_win.sh @@ -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 diff --git a/infra/portable/C/THORIUM-PORTABLE.sh.x.c b/infra/portable/C/THORIUM-PORTABLE.sh.x.c new file mode 100644 index 00000000..4df60dcd --- /dev/null +++ b/infra/portable/C/THORIUM-PORTABLE.sh.x.c @@ -0,0 +1,1017 @@ +#if 0 + shc Version 4.0.3, Generic Shell Script Compiler + GNU GPL Version 3 Md Jahidul Hamid + + shc -r -v -o ./THORIUM-PORTABLE -f ./THORIUM-PORTABLE.sh +#endif + +static char data [] = +#define lsto_z 1 +#define lsto ((&data[0])) + "\311" +#define chk2_z 19 +#define chk2 ((&data[5])) + "\014\324\100\315\110\155\030\233\317\114\254\035\261\354\274\210" + "\006\176\001\124\072\251\263" +#define tst1_z 22 +#define tst1 ((&data[24])) + "\101\164\212\150\317\133\145\274\236\361\160\312\033\142\021\073" + "\075\144\102\270\362\214\263\273" +#define text_z 4165 +#define text ((&data[723])) + "\324\330\252\334\107\231\022\273\243\033\077\213\375\253\004\010" + "\240\363\052\254\310\153\172\112\160\322\375\054\242\243\222\167" + "\173\074\123\303\326\145\176\171\201\276\005\176\152\012\207\012" + "\375\261\267\306\034\061\020\215\004\016\271\247\261\113\036\055" + "\210\162\361\136\330\157\330\131\056\335\330\230\347\137\242\345" + "\021\132\254\055\214\274\273\220\312\164\070\174\300\127\252\110" + "\311\233\247\242\012\177\373\071\135\323\321\105\063\164\052\104" + "\316\327\162\132\223\055\353\136\242\043\333\142\173\205\253\105" + "\040\122\347\053\322\342\144\057\266\066\164\351\252\237\056\170" + "\166\240\322\012\315\276\151\157\342\105\322\135\312\175\243\353" + "\317\212\027\241\155\174\321\043\262\106\015\134\345\073\324\134" + "\334\247\147\251\146\321\031\110\026\353\246\341\151\111\314\071" + "\323\344\332\100\140\254\144\022\362\162\156\327\256\103\064\212" + "\353\233\064\121\155\116\232\203\071\100\144\243\211\061\334\134" + "\026\266\235\166\143\002\210\125\164\367\055\043\073\141\255\047" + "\375\342\170\152\060\022\356\152\122\122\015\333\204\351\070\232" + "\240\325\021\003\330\232\130\114\222\205\160\315\347\035\364\345" + "\377\155\117\060\200\075\232\323\220\247\256\025\220\347\260\060" + "\275\301\063\225\133\214\342\355\021\122\273\371\160\260\336\160" + "\035\056\240\235\154\072\160\375\341\037\022\162\007\303\242\304" + "\204\326\131\340\142\074\316\164\216\211\155\376\072\114\156\127" + "\172\017\365\347\111\146\344\053\205\367\235\215\272\100\121\077" + "\026\253\040\171\350\356\355\166\170\133\165\262\247\344\012\042" + "\363\377\011\075\146\356\151\354\345\007\171\240\107\313\340\136" + "\166\000\327\136\357\305\325\150\040\112\033\310\057\045\353\043" + "\045\365\140\213\343\312\167\311\321\361\152\030\274\112\167\062" + "\112\117\221\072\024\147\242\064\262\276\375\341\344\350\004\011" + "\335\145\225\301\057\015\212\000\376\364\031\272\077\220\355\212" + "\340\177\304\364\346\147\051\230\045\047\172\011\017\176\023\355" + "\343\251\256\023\266\071\023\265\056\055\157\155\276\135\367\236" + "\335\274\223\303\043\274\134\111\343\326\123\363\125\146\340\071" + "\017\217\114\306\311\140\173\367\215\353\144\114\111\134\352\046" + "\030\175\352\074\072\106\205\036\035\330\021\162\077\362\253\117" + "\201\367\025\113\127\220\102\345\174\247\061\305\003\034\353\034" + "\231\325\130\324\034\336\362\071\267\004\253\366\366\126\106\170" + "\116\133\303\246\354\006\213\150\255\275\056\261\331\031\316\163" + "\357\046\107\013\005\072\105\274\076\360\263\065\107\371\256\225" + "\125\162\073\101\170\307\252\046\204\330\327\135\362\246\320\341" + "\315\030\355\322\122\062\216\220\042\102\306\151\073\164\377\220" + "\346\072\322\137\001\174\205\205\125\135\343\107\003\263\050\320" + "\313\026\242\036\110\061\257\153\163\165\324\256\351\323\077\320" + "\016\021\057\017\215\265\225\342\022\170\052\025\054\122\345\367" + "\151\207\026\227\277\074\174\212\121\141\162\032\247\366\062\046" + "\311\347\213\220\244\356\044\305\111\020\054\233\210\354\031\272" + "\245\137\126\303\010\115\146\233\072\073\317\210\147\310\323\322" + "\335\247\240\214\223\301\003\224\203\213\140\276\120\340\145\167" + "\367\304\240\122\150\024\171\043\106\311\346\371\143\136\365\343" + "\212\105\222\371\014\162\052\221\365\237\177\315\136\146\157\003" + "\320\052\143\160\172\232\300\102\065\360\055\143\123\240\302\132" + "\261\201\316\205\363\023\114\365\025\236\010\267\132\343\015\124" + "\311\376\070\032\034\306\116\175\250\236\177\207\001\224\067\373" + "\104\275\307\303\254\305\113\137\227\344\126\166\362\172\127\174" + "\314\163\141\256\372\310\013\306\126\104\107\362\304\117\352\335" + "\316\344\160\271\005\142\056\221\000\162\200\323\270\070\205\301" + "\257\300\067\370\247\221\236\217\235\223\076\057\222\072\316\335" + "\101\333\076\051\041\340\107\227\327\060\012\064\211\264\353\166" + "\351\167\361\306\261\174\256\313\153\303\015\037\315\113\265\320" + "\032\247\232\244\306\246\316\315\167\302\341\036\017\171\121\147" + "\135\275\031\126\001\227\252\114\245\334\325\301\154\251\356\171" + "\352\257\074\250\132\376\032\301\342\362\352\375\270\207\325\033" + "\332\274\020\011\260\257\106\176\331\346\206\174\367\265\260\046" + "\020\242\324\005\375\044\063\004\170\252\054\355\142\305\232\226" + "\343\203\104\205\043\011\034\230\321\350\270\216\056\004\252\054" + "\046\242\272\176\061\065\132\010\005\114\251\133\236\312\274\321" + "\063\244\072\022\046\102\303\310\076\207\314\204\007\323\203\114" + "\021\155\241\042\163\111\233\243\031\071\334\205\032\137\147\013" + "\006\377\074\015\220\007\153\322\376\217\223\075\021\254\244\347" + "\114\212\373\110\373\065\264\156\356\223\275\362\253\001\036\342" + "\321\056\234\264\371\246\220\057\260\024\216\235\226\225\174\006" + "\116\147\356\117\056\352\322\330\274\247\276\157\200\063\273\371" + "\120\170\172\164\106\305\005\055\000\027\244\260\231\011\075\114" + "\100\235\314\072\053\002\222\013\214\154\317\200\057\362\300\216" + "\021\312\211\151\350\211\306\011\302\376\252\276\067\336\034\145" + "\062\031\337\337\126\276\145\242\232\274\227\071\203\032\236\124" + "\025\026\120\166\223\201\010\374\100\063\010\110\233\076\107\174" + "\262\037\026\354\023\126\243\221\024\120\162\235\300\107\344\300" + "\004\344\324\015\244\034\204\274\110\303\325\205\234\161\155\272" + "\205\250\316\052\047\307\244\207\130\232\136\173\054\041\373\277" + "\265\047\172\135\067\046\326\331\143\137\017\116\172\054\234\367" + "\276\005\346\000\154\224\231\061\357\325\201\144\071\252\313\120" + "\134\050\371\000\054\055\130\122\261\201\116\121\213\057\157\022" + "\154\106\244\143\100\171\067\041\202\325\037\376\052\255\261\314" + "\030\104\373\133\072\204\212\015\130\373\110\103\357\000\077\363" + "\244\257\061\104\114\304\256\130\104\144\011\023\373\075\342\160" + "\103\205\310\100\167\172\357\176\122\275\365\360\367\230\242\134" + "\363\310\114\272\362\266\275\367\006\026\200\115\020\000\221\015" + "\030\146\212\306\366\133\327\006\124\363\011\040\140\105\257\117" + "\337\346\042\315\371\155\004\017\263\265\002\151\161\126\245\256" + "\037\061\144\071\233\151\127\017\101\353\200\141\047\165\362\224" + "\253\215\065\154\033\102\226\355\104\324\305\144\246\301\141\317" + "\211\262\246\050\072\031\236\303\307\351\177\116\051\136\226\361" + "\262\035\312\315\245\074\302\255\042\053\377\330\015\061\052\234" + "\125\342\274\260\323\155\006\141\053\153\275\112\324\160\066\302" + "\306\172\123\042\017\104\160\045\324\046\144\031\306\027\173\271" + "\206\034\163\112\206\315\051\333\211\033\235\160\075\145\316\247" + "\275\350\233\317\314\132\063\215\043\012\223\046\165\121\275\021" + "\321\271\277\342\112\322\072\007\036\244\074\377\321\022\340\115" + "\314\074\264\345\330\032\117\131\044\214\155\216\060\134\270\233" + "\306\305\262\216\363\266\111\252\055\275\344\254\347\347\202\336" + "\145\027\364\364\127\361\150\151\351\273\216\201\160\014\215\135" + "\052\317\302\165\334\344\204\130\376\124\322\022\006\173\235\343" + "\274\016\151\021\071\122\163\047\135\166\367\221\053\035\235\056" + "\334\343\002\242\103\217\325\045\204\011\013\171\352\372\035\227" + "\120\001\004\002\341\307\162\025\373\327\302\060\043\336\047\260" + "\030\047\212\340\116\360\235\316\246\125\201\147\105\157\013\240" + "\010\353\144\025\125\023\340\222\353\354\256\012\253\126\267\314" + "\021\351\345\302\363\214\050\374\063\311\015\162\235\176\053\216" + "\357\015\254\076\330\134\022\335\003\170\207\150\040\155\066\207" + "\061\316\301\253\206\055\057\206\161\067\002\357\305\374\051\326" + "\163\001\307\065\354\264\064\124\317\354\110\003\073\021\236\012" + "\263\047\013\205\060\050\330\260\065\017\270\321\065\143\060\111" + "\157\363\227\222\033\104\271\063\326\231\123\261\114\004\135\170" + "\030\224\070\202\114\331\333\237\223\114\127\224\275\252\027\007" + "\366\326\011\247\273\344\256\010\077\106\236\121\162\150\212\025" + "\035\077\340\176\225\264\037\213\375\241\344\123\111\256\376\171" + "\134\360\276\133\222\320\210\306\202\242\172\144\267\343\125\216" + "\100\362\250\155\366\001\011\131\035\164\336\367\302\325\375\041" + "\376\342\323\240\244\141\263\342\064\031\256\131\043\274\206\173" + "\104\250\000\075\126\046\205\213\225\316\244\207\352\351\212\010" + "\101\272\342\347\043\345\304\024\251\111\070\336\136\220\343\210" + "\254\132\047\104\332\036\243\332\042\144\071\273\353\000\163\227" + "\326\056\163\116\176\002\177\203\264\336\070\132\211\145\357\245" + "\261\205\277\056\314\113\372\257\170\042\200\251\102\240\322\231" + "\062\125\256\244\214\144\273\174\275\153\350\377\266\026\021\213" + "\130\242\164\040\040\015\027\074\163\202\133\041\222\022\206\373" + "\367\251\011\163\370\263\144\100\122\241\055\111\072\166\117\115" + "\271\031\174\203\147\301\157\160\005\002\300\027\150\220\106\042" + "\257\032\304\065\304\100\246\030\105\246\155\006\117\113\264\066" + "\111\127\370\055\102\360\304\104\200\377\051\135\201\074\327\054" + "\050\030\020\320\071\241\230\007\016\266\264\265\267\341\372\257" + "\131\241\262\110\037\265\101\043\132\337\245\173\151\127\036\035" + "\266\167\000\130\265\126\157\167\170\364\323\372\233\256\001\134" + "\076\027\271\321\135\367\372\066\124\020\115\300\274\275\342\057" + "\337\000\134\207\212\140\334\241\377\201\216\262\001\131\176\147" + "\143\334\127\262\032\134\272\355\115\145\274\322\042\337\332\274" + "\262\151\155\310\145\034\236\247\153\255\376\251\044\131\016\212" + "\235\267\061\255\075\156\024\321\271\326\145\130\247\332\074\231" + "\266\172\035\274\002\321\256\322\173\106\011\376\370\300\316\136" + "\117\176\166\245\302\157\055\222\206\264\272\163\040\003\127\345" + "\122\256\146\227\201\256\227\330\225\323\210\010\026\214\136\075" + "\204\377\173\332\032\200\314\076\066\213\272\313\201\163\304\172" + "\045\240\266\125\166\214\131\354\110\377\174\120\374\020\115\254" + "\205\015\273\354\225\111\164\250\002\026\004\344\222\104\127\243" + "\122\051\227\167\176\334\124\311\253\103\107\234\055\024\244\346" + "\102\076\260\043\143\167\343\023\341\155\120\057\105\315\263\210" + "\223\133\033\005\341\313\247\352\252\264\330\235\267\025\337\245" + "\122\021\134\171\102\062\361\160\304\370\215\140\232\102\255\215" + "\045\145\341\344\342\251\133\074\211\366\124\264\213\316\062\252" + "\345\146\144\364\034\067\054\001\146\373\064\322\361\101\007\202" + "\335\074\271\170\102\005\360\226\162\303\203\062\143\326\266\263" + "\301\367\265\140\342\114\307\111\110\054\316\142\210\271\201\174" + "\057\177\375\113\266\326\127\001\014\103\137\072\116\232\324\037" + "\363\024\074\076\152\271\137\217\107\034\376\067\074\143\201\243" + "\253\206\271\241\116\226\251\070\177\000\124\334\001\333\266\216" + "\103\171\165\242\023\345\203\072\373\150\270\034\005\374\021\101" + "\304\076\027\247\026\160\136\316\015\231\351\360\132\163\275\251" + "\022\047\116\236\105\212\320\035\363\007\000\332\057\265\121\340" + "\175\135\236\051\054\013\335\055\024\176\002\156\000\203\334\120" + "\320\007\031\225\145\211\177\107\223\246\350\237\364\361\174\241" + "\024\340\126\303\233\076\211\323\311\352\123\017\325\276\367\133" + "\140\350\237\374\252\330\146\271\300\160\146\221\006\010\312\254" + "\270\141\151\173\272\006\136\235\015\367\007\027\024\104\120\331" + "\057\156\041\306\360\045\144\225\111\132\024\205\332\022\322\106" + "\136\331\120\346\102\307\300\221\157\215\023\167\261\176\136\107" + "\217\177\245\264\201\101\234\014\173\261\365\230\370\233\202\054" + "\246\150\067\313\326\173\316\027\341\047\166\072\326\252\002\205" + "\133\110\230\316\234\072\250\173\351\252\062\312\253\203\052\243" + "\133\144\044\012\142\132\222\201\117\033\275\220\277\305\215\264" + "\231\272\323\160\146\112\052\125\264\072\115\057\054\071\305\227" + "\132\132\215\256\160\136\263\331\175\072\031\363\366\241\275\307" + "\332\155\114\200\135\041\300\074\027\073\372\065\343\113\206\262" + "\075\346\116\144\233\321\307\042\247\044\027\247\026\361\075\153" + "\141\165\344\211\225\216\113\066\117\362\127\231\361\051\060\262" + "\040\053\210\204\243\160\115\046\022\303\145\237\207\127\065\047" + "\174\324\131\355\265\044\301\200\232\234\163\072\266\020\311\232" + "\342\212\003\172\046\051\003\216\055\101\255\151\321\212\335\036" + "\353\055\232\354\034\206\225\124\072\305\133\143\175\103\070\024" + "\140\145\066\171\167\130\206\070\244\350\261\107\000\063\003\050" + "\045\342\325\007\247\341\373\074\041\352\173\126\304\157\166\050" + "\121\302\061\370\261\026\064\241\113\032\336\342\322\360\364\166" + "\310\314\215\067\335\125\162\056\351\153\131\135\014\367\127\132" + "\152\347\325\352\004\011\244\330\310\322\144\361\161\013\115\346" + "\031\211\053\173\301\340\131\272\135\106\355\121\256\113\220\065" + "\107\124\005\261\162\242\061\210\351\063\276\227\313\022\265\263" + "\260\073\234\130\011\226\222\071\210\315\073\326\215\115\065\175" + "\207\323\351\144\071\030\266\015\032\273\125\211\344\117\111\241" + "\140\361\272\367\071\363\377\111\105\215\001\343\322\033\200\142" + "\160\225\204\047\006\154\160\014\232\005\170\150\037\074\262\336" + "\324\077\015\151\221\365\024\273\322\130\013\063\203\217\220\226" + "\121\172\354\310\006\274\054\165\033\345\357\123\375\377\107\116" + "\201\102\243\322\230\246\377\041\116\175\347\147\014\116\231\176" + "\366\121\103\165\174\324\050\271\201\373\254\252\063\240\127\212" + "\216\357\252\272\266\210\324\046\316\252\357\021\144\145\130\057" + "\377\324\232\105\345\335\134\266\276\227\155\304\226\304\274\040" + "\130\246\164\171\200\340\200\172\375\273\020\104\213\204\230\273" + "\123\215\221\201\340\122\054\201\303\033\134\227\131\277\375\164" + "\106\272\035\071\136\246\065\226\376\162\257\030\123\250\354\045" + "\020\151\125\172\076\162\034\363\125\253\152\015\024\005\051\225" + "\366\360\303\044\314\356\176\256\015\141\317\306\101\021\054\135" + "\145\102\063\235\204\223\121\153\266\100\374\011\070\066\001\372" + "\221\135\314\233\254\247\216\275\047\347\260\073\172\254\036\323" + "\173\217\011\074\070\261\070\155\241\343\063\363\355\237\322\135" + "\317\114\001\354\156\252\056\252\350\246\344\334\147\036\057\024" + "\114\270\003\014\014\035\325\077\144\206\226\166\354\222\057\214" + "\015\132\130\052\257\251\020\236\077\360\322\004\166\177\005\204" + "\021\315\170\144\246\341\272\222\126\331\242\120\240\206\163\100" + "\075\153\340\233\072\336\344\063\333\232\200\222\232\174\322\350" + "\072\074\076\256\316\237\121\003\253\324\043\064\007\343\113\151" + "\023\126\130\323\124\123\147\256\212\363\207\031\013\331\342\052" + "\067\055\130\250\275\114\123\025\241\333\005\041\104\056\201\240" + "\344\325\207\004\157\223\136\024\310\374\336\377\132\351\341\343" + "\054\335\326\325\113\263\267\307\111\120\006\042\056\073\071\270" + "\225\041\374\001\125\376\217\104\056\127\051\374\234\331\111\274" + "\307\046\045\027\250\104\013\315\275\200\106\154\362\323\213\126" + "\264\003\144\110\156\373\343\223\317\221\037\172\133\360\160\261" + "\145\075\331\227\343\014\375\353\342\213\012\353\272\235\123\074" + "\210\124\202\151\006\315\212\157\167\214\235\014\311\061\206\120" + "\326\106\254\355\052\244\056\171\152\223\114\146\345\041\162\341" + "\127\361\273\357\120\106\202\003\041\076\354\354\113\201\040\116" + "\120\132\221\111\355\202\343\245\102\323\024\104\370\145\347\223" + "\071\365\131\377\025\324\204\055\117\070\214\272\371\227\026\120" + "\031\171\326\050\311\326\035\353\003\006\055\150\210\147\224\247" + "\154\011\042\266\264\127\200\057\060\254\252\111\011\331\003\162" + "\101\234\071\264\255\376\322\346\267\103\254\270\301\205\306\163" + "\330\375\003\366\123\345\375\046\170\247\120\153\150\235\373\115" + "\305\214\166\017\064\066\346\373\035\051\331\220\205\135\003\306" + "\237\304\254\360\032\176\364\154\243\247\114\126\121\055\320\207" + "\337\213\252\162\144\201\017\250\214\115\216\106\070\355\030\340" + "\241\324\016\067\324\021\130\103\242\342\060\277\200\317\074\171" + "\313\311\170\023\100\301\067\335\312\110\101\061\151\061\131\045" + "\101\117\106\045\177\145\254\065\052\002\316\206\063\057\353\334" + "\345\211\170\222\064\140\051\132\300\315\375\130\067\340\034\016" + "\016\162\220\041\341\252\303\111\221\353\122\205\334\332\141\277" + "\030\235\224\021\234\365\225\375\347\002\112\074\116\015\313\041" + "\046\146\070\350\247\123\201\372\334\146\366\154\125\364\023\376" + "\231\152\107\225\314\333\370\006\136\235\011\263\302\017\206\324" + "\005\260\102\277\022\341\334\167\122\370\126\157\236\121\370\133" + "\311\024\205\010\361\100\015\174\247\254\335\205\366\226\100\157" + "\003\040\103\232\142\266\276\227\314\330\012\026\042\054\060\204" + "\320\142\374\320\370\261\004\001\130\166\307\125\041\337\211\074" + "\315\075\345\235\053\261\074\344\157\133\276\136\111\254\213\363" + "\174\157\173\341\010\260\335\347\234\110\345\252\254\265\140\344" + "\266\007\073\330\103\146\377\150\252\376\031\107\143\276\053\177" + "\307\171\246\353\134\123\352\324\322\262\350\154\157\200\260\271" + "\126\212\112\012\174\077\311\305\255\314\245\276\300\123\255\215" + "\031\365\330\372\155\312\026\235\106\153\331\000\366\051\220\322" + "\104\254\353\146\301\077\046\261\152\337\305\324\015\364\207\342" + "\245\347\045\240\263\362\214\170\171\310\351\230\126\271\167\330" + "\115\372\341\170\356\357\005\306\063\015\021\002\365\220\250\321" + "\057\277\057\312\265\275\321\243\066\317\265\337\363\055\244\336" + "\146\241\003\035\177\105\212\302\103\024\301\301\156\332\256\011" + "\036\024\324\142\036\325\010\157\174\221\213\030\074\316\256\152" + "\351\310\066\151\115\244\133\240\044\176\313\333\365\172\001\325" + "\115\034\035\350\223\342\006\161\137\160\355\370\350\116\165\235" + "\060\145\017\216\120\256\372\305\257\127\347\300\237\234\163\231" + "\173\351\005\150\266\347\240\166\232\042\254\032\316\251\050\035" + "\211\307\350\067\043\363\250\052\363\124\212\035\056\106\214\206" + "\010\370\053\207\013\203\002\170\110\170\356\313\303\143\017\013" + "\352\173\257\232\245\177\225\130\007\026\263\003\042\275\144\145" + "\124\070\151\171\065\122\076\065\327\303\166\356\276\367\272\261" + "\121\023\304\106\146\362\343\230\214\212\041\041\101\230\015\047" + "\357\036\206\051\307\213\275\216\076\356\376\217\331\363\174\260" + "\140\252\046\005\270\023\237\233\001\123\144\234\071\160\270\072" + "\273\130\047\052\007\363\255\135\142\047\106\325\124\035\260\132" + "\030\361\327\204\357\127\131\140\071\020\172\353\077\155\160\362" + "\200\152\234\234\246\312\017\262\230\061\125\113\252\323\131\074" + "\361\245\020\153\035\024\216\232\373\201\055\013\166\027\353\200" + "\154\075\206\174\111\045\302\225\317\114\265\055\376\141\167\257" + "\355\136\037\172\305\065\247\152\220\376\136\067\334\076\264\243" + "\017\070\160\014\321\025\267\301\277\221\320\235\167\354\042\014" + "\002\232\302\236\013\023\266\325\357\253\112\276\317\327\126\370" + "\066\350\337\170\377\144\202\273\243\214\174\316\026\156\021\346" + "\133\070\175\053\133\364\320\063\331\267\061\231\125\040\170\261" + "\202\053\117\043\350\362\175\136\326\040\362\055\250\017\255\244" + "\041\257\224\067\145\041\307\015\356\246\155\066\237\103\360\272" + "\144\015\254\313\253\067\365\126\224\034\267\020\043\213\034\100" + "\227\235\202\013\227\324\167\373\036\360\001\010\267\265\257\165" + "\073\272\213\352\062\115\147\075\061\130\054\114\123\104\310\305" + "\375\061\210\054\150\026\323\075\325\020\315\342\322\311\004\236" + "\360\004\102\033\257\316\165\327\354\215\021\046\022\261\065\040" + "\027\265\170\004\136\210\375\231\073\323\377\217\132\234\204\114" + "\036\161\357\176\151\061\172\156\236\031\315\067\132\065\162\023" + "\240\333\210\347\264\220\227\162\275\011\250\156\311\101\330\231" + "\352\215\104\007\370\217\276\216\324\352\303\035\202\151\045\302" + "\271\376\261\041\023\076\102\341\077\041\054\321\251\346\111\323" + "\336\307\233\023\342\331\037\366\273\342\147\071\355\210\060\023" + "\250\354\357\310\044\111\150\257\303\377\235\153\275\325\001\267" + "\100\351\040\001\265\256\206\005\336\146\033\033\256\073\144\036" + "\111\266\326\376\143\371\224\340\051\250\130\366\345\145\310\351" + "\235\371\071\171\354\046\177\100\033\136\047\077\124\126\343\215" + "\120\377\162\312\371\361\352\105\167\040\144\051\066\302\224\233" + "\235\354\161\212\122\071\215\037\275\363\264\305\233\344\120\354" + "\355\003\306\074\104\075\002\133\231\344\250\243\006\277\336\014" + "\214\074\042\374\312\121\142\100\355\330\153\343\163\363\336\306" + "\102\072\140\325\156\312\126\354\070\267\272\347\354\052\240\274" + "\167\310\260\174\077\117\033\202\304\117\167\075\342\217\340\121" + "\355\113\141\157\250\262\227\130\322\007\370\116\323\317\376\125" + "\014\026\343\116\100\267\133\106\274\313\120\141\015\173\017\344" + "\364\150\140\060\256\060\340\145\334\370\043\063\223\067\250\021" + "\203\323\200\011\370\377\015\132\357\373\327\043\074\162\176\210" + "\201\242\324\273\057\143\041\272\340\325\275\073\250\274\260\267" + "\266\034\102\173\164\054\205\317\274\276\031\104\364\060\030\315" + "\006\337\112\075\050\262\216\244\261\271\305\034\054\072\361\332" + "\044\305\032\365\323\053\045\343\270\332\170\233\354\360\305\001" + "\034\030\347\024\201\156\052\063\050\360\117\124\052\101\057\117" + "\006\111\104\332\164\151\275\055\103\065\311\057\046\217\061\103" + "\250\030\130\052\207\203\135\257\163\255\003\235\356\063\354\365" + "\174\061\317\361\232\215\036\335\303\350\015\351\167\076\055\037" + "\126\205\111\335\010\247\215\174\124\221\032\103\304\006\071\101" + "\070\011\062\322\226\121\260\131\071\275\103\261\373\160\320\122" + "\366\032\060\377\301\275\173\026\116\225\132\022\234\223\124\324" + "\234\206\247\063\327\127\214\021\024\320\302\020\101\223\142\067" + "\255\223\067\157\120\262\206\237\110\340\262\345\163\006\272\020" + "\214\141\103\144\271\317\166\315\240\071\336\341\314\101\030\172" + "\324\120\352\044\002\160\304\113\120\166\061\304\174\353\324\011" + "\115\027\156\006\347\344\324\207\036\262\151\353\363\202\145\307" + "\322\120\354\325\300\260\040\021\047\121\325\243\075\252\255\213" + "\302\033\222\251\000\146\061\036\031\233\011\015\035\157\325\357" + "\277\301\304\200\162\345\222\231\067\150\075\164\022\352\000\324" + "\006\222\176\006\370\260\045\022\113\056\037\150\236\364\130\135" + "\266\034\336\051\001\160\303\071\330\000\255\353\352\256\300\360" + "\100\076\367\071\357\034\113\073\113\153\244\351\137\374\107\026" + "\031\045\100\033\226\003\124\157\003\002\132\356\260\032\337\360" + "\131\326\051\111\363\164\204\076\337\050\050\077\045\157\126\076" + "\225\226\131\053\231\255\233\235\257\365\213\137\020\153\120\152" + "\102\171\264\065\356\070\164\316\141\234\016\206\014\144\304\241" + "\372\036\315\224\314\150\061\173\136\275\333\157\050\053\332\152" + "\245\216\240\223\306\024\141\050\261\160\256\275\324\163\137\317" + "\221\054\144\135\225\225" +#define tst2_z 19 +#define tst2 ((&data[5306])) + "\265\144\173\340\047\341\122\320\110\115\200\076\137\325\341\252" + "\325\037\315\036\254\145\001\076" +#define pswd_z 256 +#define pswd ((&data[5359])) + "\207\031\223\234\173\273\115\353\152\013\300\335\152\217\157\227" + "\364\315\055\212\247\041\335\134\205\131\074\303\100\302\220\307" + "\333\253\021\164\240\271\210\314\327\076\265\020\347\054\237\241" + "\122\003\342\153\271\347\320\014\066\230\235\031\343\067\023\173" + "\342\045\357\202\337\170\117\266\266\005\307\236\061\147\077\203" + "\152\042\357\043\011\277\057\100\130\315\132\073\004\156\267\347" + "\223\246\152\163\036\271\052\324\276\361\162\357\130\262\163\303" + "\324\142\346\336\042\026\036\172\344\171\266\350\347\155\317\173" + "\023\071\357\061\363\031\006\261\013\171\241\144\053\024\047\377" + "\167\016\336\231\044\375\023\010\166\312\361\136\067\301\331\113" + "\372\311\175\356\342\204\240\355\375\101\122\050\126\171\050\316" + "\207\006\147\254\004\173\265\172\105\246\330\175\147\262\311\142" + "\173\106\120\136\312\360\114\307\062\236\360\211\027\031\127\237" + "\040\277\113\044\072\001\236\177\247\167\375\017\052\306\161\245" + "\015\302\004\327\263\120\237\345\356\220\157\006\251\306\246\311" + "\205\362\355\300\363\214\077\232\003\075\251\055\003\033\323\020" + "\335\330\350\220\050\207\166\027\027\345\036\301\254\304\212\062" + "\266\170\362\251\004\062\104\007\157\356\065\163\012\011\204\350" + "\341\044\143\127\337\261\102\112\274\002\050\047\222\227\276\206" + "\144\354\020\013\015\356\150\223\107\244\127\207\147\347\117\103" + "\013\262\232\353\144\334\065\040\337\135\110\162\365\007\370\132" + "\363\011\146\000" +#define msg1_z 65 +#define msg1 ((&data[5679])) + "\077\163\352\307\332\322\026\035\336\311\270\312\055\270\037\230" + "\015\345\026\203\105\104\340\373\107\153\076\255\231\017\343\060" + "\277\215\275\115\260\062\045\246\101\261\234\350\004\076\375\103" + "\372\037\145\324\272\362\154\016\075\314\135\122\107\331\260\254" + "\356\150\373\311\211\214\226\362\015\272\243\335\023\330\225\000" + "\116\164\136\226\346\123\235" +#define date_z 1 +#define date ((&data[5753])) + "\005" +#define shll_z 10 +#define shll ((&data[5754])) + "\301\277\330\153\314\203\276\143\224\247\341" +#define inlo_z 3 +#define inlo ((&data[5765])) + "\304\147\226" +#define xecc_z 15 +#define xecc ((&data[5768])) + "\114\033\061\316\215\271\217\321\047\047\044\264\376\150\320\061" + "\343\377" +#define chk1_z 22 +#define chk1 ((&data[5790])) + "\007\213\365\234\122\307\307\224\367\036\361\235\133\265\055\163" + "\264\264\335\201\031\237\221\217\261\002\213\104\021\351" +#define msg2_z 19 +#define msg2 ((&data[5820])) + "\167\330\353\010\014\155\370\010\166\042\131\264\126\212\203\337" + "\254\165\330\025\327\143\154\301" +#define rlax_z 1 +#define rlax ((&data[5840])) + "\227" +#define opts_z 1 +#define opts ((&data[5841])) + "\201"/* 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 ", +" * 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 ", +"#include ", +"#include ", +"#include ", +"#include ", +"#include ", +"", +"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 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 +#include + +#include +#include +#include +#include +#include +#include + +/* '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 +#include +#include +#include +#define PR_SET_PTRACER 0x59616d61 + +/* Seccomp Sandboxing Init */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#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 : ""); + fprintf(stderr, "argc=%d\n", argc); + if (!argv) { + fprintf(stderr, "argv=\n"); + } else { + for (i = 0; i <= argc ; i++) + fprintf(stderr, "argv[%d]=%.60s\n", i, argv[i] ? argv[i] : ""); + } +} +#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 : ""); +#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 +#include +#include +#include +#include +#include +#include + +#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) 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] : "" + ); + return 1; +} diff --git a/infra/portable/C/THORIUM-SHELL.sh.x.c b/infra/portable/C/THORIUM-SHELL.sh.x.c new file mode 100644 index 00000000..4b324174 --- /dev/null +++ b/infra/portable/C/THORIUM-SHELL.sh.x.c @@ -0,0 +1,722 @@ +#if 0 + shc Version 4.0.3, Generic Shell Script Compiler + GNU GPL Version 3 Md Jahidul Hamid + + 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 ", +" * 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 ", +"#include ", +"#include ", +"#include ", +"#include ", +"#include ", +"", +"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 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 +#include + +#include +#include +#include +#include +#include +#include + +/* '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 +#include +#include +#include +#define PR_SET_PTRACER 0x59616d61 + +/* Seccomp Sandboxing Init */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#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 : ""); + fprintf(stderr, "argc=%d\n", argc); + if (!argv) { + fprintf(stderr, "argv=\n"); + } else { + for (i = 0; i <= argc ; i++) + fprintf(stderr, "argv[%d]=%.60s\n", i, argv[i] ? argv[i] : ""); + } +} +#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 : ""); +#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 +#include +#include +#include +#include +#include +#include + +#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) 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] : "" + ); + return 1; +} diff --git a/infra/portable/THORIUM-PORTABLE b/infra/portable/THORIUM-PORTABLE index 22bf4ff51e2b0b28ff53112e0edde35798181349..36c0014f88c1e0f69c64a98a2281ffa59fdf275b 100755 GIT binary patch delta 7196 zcmZ8mWmuF^w`J%WN$Ktm5n*8HmhMKBp+yjomZ7^xKvGIdI;9%~X$AzPL%Jmdfjh+g z?)TjH$JuAEz4qSg?DIbJW8TFmz(yt@jt!Yjv64d#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V@_4Mpju?v*a*`>`)W`v)hqEWz58T3^E*qyBlSfAIoM`D@4OHx0@_E0 z5|~A2@I7y8?l|5sqL@I9C3CknnY}UkZ<3kvF$Uo{PJ~@&Kf+tSrsMWn$~? z;^oaGB*ZVuFUTk4jY)-SNz~22wRQ;BYmikURE(|w{?-3it8%CgU3mx)AbRoy >(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" "$@" diff --git a/infra/portable/THORIUM-SHELL b/infra/portable/THORIUM-SHELL index ad0e5838739810a55382d37654e557828d3cb7cf..433d11242ff3db8db236d14d1f81ef5f849e2bee 100755 GIT binary patch delta 2474 zcmZXWcT`i^7REzNsKJCf(o2AZASDp+J(QZjPy_{Wl$k*vMUg?U0MbT6C)77^6#)y_ z=mQGKjA9@lRnUhBNKpqxMu?yz0->5Yxi^fi_3j_pXaDxM_xa8}Su6QHGCt-PGMZz4 zo8m4a87+o_pAqr;M3E&C`RUl#-*p-5^+f+`t}}7|YBt1=IZ>arWfrYm!a$VbNI?Ao zq83USRllD@CRaiBZk0o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UCxF>s`%3fpv<2O5e_DgOVMWH4QH#0`n>)+h^^xi}ErK z^^AWte&No#;K_`rQ70u?<2>jz;+b;3mU*{&4rf<~KoJymUthQ?LU@5n>#DQrx6zIW zh!ezz&*0bb>N-Rfh1||8nqfvL-~^Pa|fl=L0t4*fGiFCY(H^E+*5EwbKxv%=@r(4Ki79yhbS zvb8$5WoQCJyNkA^(|@zPezu{;malDBVWvuQ%%;H-GGgg6gYoT8Um`}ayd;kCd diff --git a/infra/portable/THORIUM-SHELL.sh b/infra/portable/THORIUM-SHELL.sh index a8846aaf..8f33c7e5 100755 --- a/infra/portable/THORIUM-SHELL.sh +++ b/infra/portable/THORIUM-SHELL.sh @@ -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" "$@" diff --git a/infra/portable/build_portable_binaries.sh b/infra/portable/build_portable_binaries.sh new file mode 100755 index 00000000..6e2b806c --- /dev/null +++ b/infra/portable/build_portable_binaries.sh @@ -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 diff --git a/infra/thor_ver_linux/wrapper-avx2 b/infra/thor_ver_linux/wrapper-avx2 index 27abfacc..b0d737d4 100644 --- a/infra/thor_ver_linux/wrapper-avx2 +++ b/infra/thor_ver_linux/wrapper-avx2 @@ -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 diff --git a/infra/thor_ver_linux/wrapper-avx512 b/infra/thor_ver_linux/wrapper-avx512 index ae946028..162cf4c9 100644 --- a/infra/thor_ver_linux/wrapper-avx512 +++ b/infra/thor_ver_linux/wrapper-avx512 @@ -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 diff --git a/infra/thor_ver_linux/wrapper-sse2 b/infra/thor_ver_linux/wrapper-sse2 index 2ec08a75..62f7afd9 100644 --- a/infra/thor_ver_linux/wrapper-sse2 +++ b/infra/thor_ver_linux/wrapper-sse2 @@ -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 diff --git a/infra/thor_ver_linux/wrapper-sse3 b/infra/thor_ver_linux/wrapper-sse3 index e31c62f4..4d6581a5 100644 --- a/infra/thor_ver_linux/wrapper-sse3 +++ b/infra/thor_ver_linux/wrapper-sse3 @@ -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 diff --git a/infra/thor_ver_linux/wrapper-sse4 b/infra/thor_ver_linux/wrapper-sse4 index cc58c40c..503df3bf 100644 --- a/infra/thor_ver_linux/wrapper-sse4 +++ b/infra/thor_ver_linux/wrapper-sse4 @@ -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 diff --git a/other/thorium-2024-ui.patch b/other/thorium-2024-ui.patch index 9fa95b58..03b5d48c 100644 --- a/other/thorium-2024-ui.patch +++ b/other/thorium-2024-ui.patch @@ -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; } diff --git a/src/BUILD.gn b/src/BUILD.gn index 846a8e5c..8abc5516 100644 --- a/src/BUILD.gn +++ b/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. diff --git a/src/chrome/browser/thorium_flag_entries.h b/src/chrome/browser/thorium_flag_entries.h index fcd1d9f7..d9c19af1 100644 --- a/src/chrome/browser/thorium_flag_entries.h +++ b/src/chrome/browser/thorium_flag_entries.h @@ -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) diff --git a/src/chrome/browser/ui/startup/bad_flags_prompt.cc b/src/chrome/browser/ui/startup/bad_flags_prompt.cc index 4cf8c196..0e524589 100644 --- a/src/chrome/browser/ui/startup/bad_flags_prompt.cc +++ b/src/chrome/browser/ui/startup/bad_flags_prompt.cc @@ -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 diff --git a/src/chrome/browser/ui/thorium_2024.h b/src/chrome/browser/ui/thorium_2024.h index 8a4bb75a..efce7e3d 100644 --- a/src/chrome/browser/ui/thorium_2024.h +++ b/src/chrome/browser/ui/thorium_2024.h @@ -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_ diff --git a/src/chrome/installer/linux/common/wrapper b/src/chrome/installer/linux/common/wrapper index d9e56956..a92ce668 100644 --- a/src/chrome/installer/linux/common/wrapper +++ b/src/chrome/installer/linux/common/wrapper @@ -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