diff --git a/Dockerfile b/Dockerfile index 4d5f017..5f1338d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,8 @@ RUN ./gost-install.sh --install COPY utils/linux_chrome_installer.py /opt/flare_bypasser/bin/linux_chrome_installer.py RUN python3 /opt/flare_bypasser/bin/linux_chrome_installer.py \ --version-prefix="$CHROME_VERSION" \ - --install-root=/opt/flare_bypasser/installed_chrome/ || \ + --install-root=/opt/flare_bypasser/installed_chrome/ \ + --arch=$(arch) || \ { echo "Can't install chrome (required version '$CHROME_VERSION')" >&2 ; exit 1 ; } diff --git a/rootfs/opt/flare_bypasser/bin/FlareBypasserRun.sh b/rootfs/opt/flare_bypasser/bin/FlareBypasserRun.sh index f52b0a1..baa400e 100755 --- a/rootfs/opt/flare_bypasser/bin/FlareBypasserRun.sh +++ b/rootfs/opt/flare_bypasser/bin/FlareBypasserRun.sh @@ -82,8 +82,8 @@ chrome_diagnostic() { cat "$CHROME_OUTPUT_FILE" >&2 fi - kill "$XVFB_PID" - kill "$CHROME_PID" + kill "$XVFB_PID" 2>/dev/null + kill "$CHROME_PID" 2>/dev/null return $EXIT_CODE } diff --git a/utils/linux_chrome_installer.py b/utils/linux_chrome_installer.py index 577c030..242a291 100644 --- a/utils/linux_chrome_installer.py +++ b/utils/linux_chrome_installer.py @@ -32,8 +32,15 @@ def unzip_package( shutil.rmtree(unzip_path) -def download_and_install(version_prefix = None, install_root = None): - target_platform = "linux64" +def download_and_install(version_prefix = None, install_root = None, arch = 'x86_64'): + if arch == 'x86_64': + target_platform = "linux64" + elif arch == 'aarch64' : # < Raspberry, ARM based MacOS + target_platform = 'mac-arm64' + elif arch == 'i386': # < Intel based MacOS + target_platform = 'mac-x64' + else : + raise Exception("Unknown platform: " + str(arch)) chrome_download_url = None with urlopen( @@ -86,12 +93,14 @@ def download_and_install(version_prefix = None, install_root = None): parser = argparse.ArgumentParser(description='linux_chrome_installer.') parser.add_argument("-v", "--version-prefix", type=str, default='120.') parser.add_argument("-i", "--install-root", type=str, default='/usr/bin') + parser.add_argument("--arch", type=str, default='x86_64') args = parser.parse_args() try: res = download_and_install( version_prefix = args.version_prefix, - install_root = args.install_root + install_root = args.install_root, + arch = args.arch ) except Exception as e: logging.error("Can't install chrome: " + str(e))