├── .gitignore ├── Installer.bat ├── Uninstaller.bat ├── .github ├── FUNDING.yml └── workflows │ └── release.yml ├── LICENSE ├── Galaxy_Book4_Ultra_Spoofer.bat ├── BackupRegistryValues.cmd ├── README.md ├── GalaxyBookDisabler.ps1 └── GalaxyBookEnabler.ps1 /.gitignore: -------------------------------------------------------------------------------- 1 | InstallScriptLog.txt 2 | -------------------------------------------------------------------------------- /Installer.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | powershell -ExecutionPolicy Bypass -File "GalaxyBookEnabler.ps1" 3 | -------------------------------------------------------------------------------- /Uninstaller.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | powershell -ExecutionPolicy Bypass -File "GalaxyBookDisabler.ps1" 3 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [Bananz0] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | polar: # Replace with a single Polar username 14 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Glen Muthoka 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Create Release 2 | 3 | on: 4 | push: 5 | tags: 6 | - '*' 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v2 15 | 16 | - name: Install zip 17 | run: sudo apt-get install zip 18 | 19 | - name: Zip repository 20 | run: zip -r repo.zip * -x "*.git/*" "*.workflows/*" "*.github/*" LICENSE .gitignore README.md 21 | 22 | 23 | 24 | - name: Create Release 25 | id: create_release 26 | uses: actions/create-release@v1 27 | env: 28 | GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} 29 | with: 30 | tag_name: ${{ github.ref }} 31 | release_name: Release ${{ github.ref }} 32 | draft: false 33 | prerelease: false 34 | 35 | - name: Upload Release Asset 36 | id: upload-release-asset 37 | uses: actions/upload-release-asset@v1 38 | env: 39 | GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} 40 | with: 41 | upload_url: ${{ steps.create_release.outputs.upload_url }} 42 | asset_path: ./repo.zip 43 | asset_name: GalaxyBookEnabler.zip 44 | asset_content_type: application/zip -------------------------------------------------------------------------------- /Galaxy_Book4_Ultra_Spoofer.bat: -------------------------------------------------------------------------------- 1 | set "params=%*" && cd /d "%~dp0" && pushd "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B ) 2 | reg add "HKLM\HARDWARE\DESCRIPTION\System\BIOS" /v BaseBoardManufacturer /t REG_SZ /d "SAMSUNG ELECTRONICS CO., LTD." /f 3 | reg add "HKLM\HARDWARE\DESCRIPTION\System\BIOS" /v BaseBoardProduct /t REG_SZ /d "NP960XGL-XG1US" /f 4 | reg add "HKLM\HARDWARE\DESCRIPTION\System\BIOS" /v SystemFamily /t REG_SZ /d "Galaxy Book4 Ultra" /f 5 | reg add "HKLM\HARDWARE\DESCRIPTION\System\BIOS" /v SystemManufacturer /t REG_SZ /d "SAMSUNG ELECTRONICS CO., LTD." /f 6 | reg add "HKLM\HARDWARE\DESCRIPTION\System\BIOS" /v SystemProductName /t REG_SZ /d "NP960XGL-XG1US" /f 7 | reg add "HKLM\HARDWARE\DESCRIPTION\System\BIOS" /v SystemSKU /t REG_SZ /d "6531064" /f 8 | reg add "HKLM\HARDWARE\DESCRIPTION\System\BIOS" /v SystemVersion /t REG_SZ /d "Ultra" /f 9 | reg add "HKLM\SYSTEM\ControlSet001\Control\SystemInformation" /v SystemManufacturer /t REG_SZ /d "SAMSUNG ELECTRONICS CO., LTD." /f 10 | reg add "HKLM\SYSTEM\ControlSet001\Control\SystemInformation" /v SystemProductName /t REG_SZ /d "NP960XGL-XG1US" /f 11 | reg add "HKLM\SYSTEM\HardwareConfig\Current" /v SystemFamily /t REG_SZ /d "Galaxy Book4 Ultra" /f 12 | reg add "HKLM\SYSTEM\HardwareConfig\Current" /v SystemManufacturer /t REG_SZ /d "SAMSUNG ELECTRONICS CO., LTD." /f 13 | reg add "HKLM\SYSTEM\HardwareConfig\Current" /v SystemProductName /t REG_SZ /d "NP960XGL-XG1US" /f 14 | reg add "HKLM\SYSTEM\HardwareConfig\Current" /v SystemSKU /t REG_SZ /d "6531064" /f 15 | reg add "HKLM\SYSTEM\HardwareConfig\Current" /v SystemVersion /t REG_SZ /d "Ultra" /f 16 | exit 17 | 18 | -------------------------------------------------------------------------------- /BackupRegistryValues.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal enabledelayedexpansion 3 | 4 | :: Backup current registry values 5 | set "backupfile=RegistryBackup_%date:~-4%-%date:~-7,2%-%date:~-10,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%.txt" 6 | 7 | :: Elevate to admin 8 | set "params=%*" 9 | cd /d "%~dp0" 10 | pushd "%~dp0" 11 | if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" 12 | fsutil dirty query %systemdrive% 1>nul 2>nul || ( 13 | echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" 14 | "%temp%\getadmin.vbs" 15 | exit /B 16 | ) 17 | 18 | :: Create backup 19 | ( 20 | echo Backup created: %date% %time% 21 | echo ****************************************** 22 | 23 | echo [HKLM\HARDWARE\DESCRIPTION\System\BIOS] 24 | for %%k in ( 25 | "BaseBoardManufacturer" 26 | "BaseBoardProduct" 27 | "SystemFamily" 28 | "SystemManufacturer" 29 | "SystemProductName" 30 | "SystemSKU" 31 | "SystemVersion" 32 | ) do ( 33 | reg query "HKLM\HARDWARE\DESCRIPTION\System\BIOS" /v "%%~k" 2>nul || echo %%k: Not Found 34 | ) 35 | 36 | echo. 37 | echo [HKLM\SYSTEM\ControlSet001\Control\SystemInformation] 38 | for %%k in ( 39 | "SystemManufacturer" 40 | "SystemProductName" 41 | ) do ( 42 | reg query "HKLM\SYSTEM\ControlSet001\Control\SystemInformation" /v "%%~k" 2>nul || echo %%k: Not Found 43 | ) 44 | 45 | echo. 46 | echo [HKLM\SYSTEM\HardwareConfig\Current] 47 | for %%k in ( 48 | "SystemFamily" 49 | "SystemManufacturer" 50 | "SystemProductName" 51 | "SystemSKU" 52 | "SystemVersion" 53 | ) do ( 54 | reg query "HKLM\SYSTEM\HardwareConfig\Current" /v "%%~k" 2>nul || echo %%k: Not Found 55 | ) 56 | ) > "%backupfile%" 57 | 58 | echo Backup saved to: "%backupfile%" 59 | echo Press any key to exit... 60 | pause >nul -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GalaxyBookEnabler 2 | 3 | ## Introduction 4 | 5 | The GalaxyBookEnabler script is designed to enable some features that are typically limited to Galaxy Books, including Quick Share, Multi Control, and Samsung Notes. 6 | 7 | Please read this readme carefully to understand the script's purpose and usage. Note that Quick Share functionality may depend on your Wi-Fi card, and results may vary. 8 | 9 | ## Disclaimer 10 | 11 | The PowerShell script is designed to run on PowerShell 7. To ensure compatibility, consider installing it using either `winget install Microsoft.PowerShell` or obtaining it directly from the Microsoft Store. 12 | 13 | ## Installation 14 | 15 | To install the script, follow these steps: 16 | 17 | 1. Run the GalaxyBookEnabler script as an administrator in PowerShell. 18 | 19 | The script automates the installation process, making your laptop appear as a Galaxy Book, which is necessary as this spoof resets every boot. 20 | 21 | ## System Requirements 22 | 23 | Before using the script, ensure you have the following software packages installed: 24 | 25 | - [Samsung Account](https://apps.microsoft.com/detail/9P98T77876KZ?hl=en-us&gl=US) 26 | - [Samsung Continuity Service](https://apps.microsoft.com/detail/samsung-continuity-service/9NGW9K44GQ5F?hl=en-GB&gl=US) 27 | - [Samsung Cloud Assistant](https://apps.microsoft.com/detail/9NFWHCHM52HQ?hl=en-us&gl=US) 28 | 29 | For optional features, you can install: 30 | 31 | - [Quick Share (Optional)](https://apps.microsoft.com/detail/9PCTGDFXVZLJ?hl=en-us&gl=US) 32 | - [Samsung Notes (Optional)](https://apps.microsoft.com/detail/9NBLGGH43VHV?query=samsung+note&hl=en-us&gl=US) 33 | - [Multi Control (Optional)](https://apps.microsoft.com/detail/samsung-multi-control/9N3L4FZ03Q99?hl=en-us&gl=US) 34 | 35 | You can download these apps from the Microsoft Store or use [this alternative source](https://store.rg-adguard.net/) to get the executable installer as a backup. 36 | 37 | ## Important Notes 38 | 39 | - The script installs a batch file into the User folder, which runs automatically on startup to enable the Galaxy Book features. 40 | - The script is necessary because the spoof resets every time the system reboots. 41 | 42 | ## Disclaimer 43 | 44 | I am not responsible for any issues or consequences that may arise from using this script. Users should be aware of the potential risks and use the script at their own discretion. 45 | 46 | ## Possible Changes 47 | 48 | Please note that Samsung may release updates or changes that could affect the script's functionality. Users should be aware of this potential. 49 | 50 | ## Credits 51 | 52 | Credits to [@obrobrio2000](https://github.com/obrobrio2000) for the initial script. This is a slightly modified version of their work. 53 | 54 | ## License 55 | 56 | This script is provided under the [MIT License](LICENSE). 57 | 58 | 59 | -------------------------------------------------------------------------------- /GalaxyBookDisabler.ps1: -------------------------------------------------------------------------------- 1 | # GalaxyBookEnabler_Uninstaller.ps1 2 | # Run this script as Administrator to remove all components 3 | 4 | # Common parameters 5 | $TaskName = "GalaxyBookEnabler" 6 | $Username = [System.Environment]::UserName 7 | $GalaxyBookEnablerDirectory = "C:\Users\$Username\GalaxyBookEnablerScript" 8 | $LogFilePath = Join-Path -Path $PSScriptRoot -ChildPath 'UninstallLog.txt' 9 | 10 | # List of all package IDs used in the installer 11 | $packageIds = @( 12 | # Core packages 13 | "9P98T77876KZ", # Samsung Continuity Service 14 | "9NGW9K44GQ5F", # Samsung Account 15 | "9NFWHCHM52HQ", # Samsung Cloud Assistant 16 | "9NJNNJTTFL45", # Samsung Bluetooth Sync 17 | "9P2TBWSHK6HJ", # Samsung Settings 18 | "9NL68DVFP841", # Samsung Settings Runtime 19 | "9NQ3HDB99VBF", # Samsung Update 20 | 21 | # Additional packages 22 | "9NHTLWTKFZNB", # Galaxy Buds 23 | "9N3L4FZ03Q99", # Samsung Multi Control 24 | "9PCTGDFXVZLJ", # Quick Share 25 | "9NBLGGH4XDV0", # Samsung Device Care 26 | "9NBLGGH5GB0M", # Samsung Flow 27 | "9NBLGGH4N9R9", # Samsung Gallery 28 | "9NBLGGH43VHV", # Samsung Notes 29 | "9mwjxxlchbgk", # Samsung Phone 30 | "9WZDNCRFHWGG", # Samsung Printer Experience 31 | "9P5025MM7WDT", # Samsung Screen Recorder 32 | "9p312b4tzffh", # Samsung Studio 33 | "9PLTXW5DX5KB", # Second Screen 34 | "9N3ZBH5V7HX6", # SmartThings 35 | "9mvnw0xh7hs5", # Storage Share 36 | "9phl04njnt67" # Nearby Devices 37 | ) 38 | 39 | function Write-Log { 40 | param([string]$Message) 41 | $Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" 42 | $LogMessage = "$Timestamp - $Message" 43 | Add-Content -Path $LogFilePath -Value $LogMessage 44 | } 45 | 46 | # Check for admin privileges 47 | if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { 48 | Write-Host "Restarting with elevated privileges..." 49 | Start-Process powershell "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs 50 | exit 51 | } 52 | 53 | try { 54 | Write-Host "Starting uninstallation process..." 55 | Write-Log "Uninstallation started" 56 | 57 | # Remove scheduled task 58 | if (Get-ScheduledTask -TaskName $TaskName -ErrorAction SilentlyContinue) { 59 | Unregister-ScheduledTask -TaskName $TaskName -Confirm:$false 60 | Write-Host "Removed scheduled task: $TaskName" 61 | Write-Log "Removed scheduled task: $TaskName" 62 | } 63 | 64 | # Remove installation directory 65 | if (Test-Path $GalaxyBookEnablerDirectory) { 66 | Remove-Item -Path $GalaxyBookEnablerDirectory -Recurse -Force 67 | Write-Host "Removed directory: $GalaxyBookEnablerDirectory" 68 | Write-Log "Removed directory: $GalaxyBookEnablerDirectory" 69 | } 70 | 71 | # Uninstall packages 72 | foreach ($packageId in $packageIds) { 73 | try { 74 | Write-Host "Uninstalling package: $packageId" 75 | winget uninstall --id $packageId --silent --accept-source-agreements 76 | Write-Log "Successfully uninstalled package: $packageId" 77 | } 78 | catch { 79 | Write-Host "Error uninstalling $packageId - $_" 80 | Write-Log "Error uninstalling $packageId - $_" 81 | } 82 | } 83 | 84 | # Final cleanup 85 | Write-Host "`nUninstallation complete!" 86 | Write-Host "The following items were removed:" 87 | Write-Host "- All scheduled tasks created by the installer" 88 | Write-Host "- GalaxyBookEnabler program directory" 89 | Write-Host "- All associated Samsung packages" 90 | Write-Log "Uninstallation completed successfully" 91 | } 92 | catch { 93 | Write-Host "Critical error during uninstallation: $_" 94 | Write-Log "Critical error: $_" 95 | exit 1 96 | } 97 | 98 | Write-Host "`nPress any key to exit..." 99 | $null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") -------------------------------------------------------------------------------- /GalaxyBookEnabler.ps1: -------------------------------------------------------------------------------- 1 | Import-Module ScheduledTasks 2 | 3 | # Define the script directory 4 | $Username = [System.Environment]::UserName 5 | $UserFolder = "C:\Users\$Username" 6 | $GalaxyBookEnablerDirectory = Join-Path -Path $UserFolder -ChildPath 'GalaxyBookEnablerScript' 7 | $BatchFilePath = Join-Path -Path $GalaxyBookEnablerDirectory -ChildPath 'Galaxy_Book4_Ultra_Spoofer.bat' 8 | $firstrun = $true 9 | $TaskName = "GalaxyBookEnabler" 10 | 11 | # Set up a log file path 12 | $LogFilePath = Join-Path -Path $PSScriptRoot -ChildPath 'InstallScriptLog.txt' 13 | $ScriptDirectory = $PSScriptRoot 14 | 15 | #Task details 16 | $TaskAction = New-ScheduledTaskAction -Execute $BatchFilePath 17 | $TaskTrigger = New-ScheduledTaskTrigger -AtStartup 18 | $TaskPrincipal = New-ScheduledTaskPrincipal -UserId "NT AUTHORITY\SYSTEM" -LogonType ServiceAccount 19 | $TaskTrigger.Repetition = $null # Remove the repetition settings 20 | $TaskTrigger.ExecutionTimeLimit = 'PT1M' 21 | $TaskTrigger.Enabled = $true 22 | $TaskTrigger = New-ScheduledTaskTrigger -AtStartup 23 | $TaskCondition = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries 24 | $TaskDescription = "This spoofs a working Samsung Galaxy Book for QuickShare and other Samsung features." 25 | $TaskPrincipal.RunLevel = "Highest" 26 | 27 | # Function to install a package 28 | function InstallPackage($packageName, $packageId) { 29 | try { 30 | Write-Output "Installing $packageName..." 31 | winget install --accept-source-agreements --accept-package-agreements --id $packageId 32 | Write-Output "Installation of $packageName completed successfully." 33 | } catch { 34 | Write-Output "Error installing $packageName $_" 35 | Write-Log "Error installing $packageName $_" 36 | } 37 | } 38 | 39 | # Function to install all packages 40 | function InstallAllPackages { 41 | InstallPackage 'Galaxy Buds' '9NHTLWTKFZNB' 42 | InstallPackage 'Samsung Multi Control' '9N3L4FZ03Q99' 43 | InstallPackage 'Quick Share' '9PCTGDFXVZLJ' 44 | InstallPackage 'Samsung Device Care' '9NBLGGH4XDV0' 45 | InstallPackage 'Samsung Flow' '9NBLGGH5GB0M' 46 | InstallPackage 'Samsung Gallery' '9NBLGGH4N9R9' 47 | InstallPackage 'Samsung Notes' '9NBLGGH43VHV' 48 | InstallPackage 'Samsung Phone' '9mwjxxlchbgk' 49 | InstallPackage 'Samsung Printer Experience' '9WZDNCRFHWGG' 50 | InstallPackage 'Samsung Screen Recorder' '9P5025MM7WDT' 51 | InstallPackage 'Samsung Studio' '9p312b4tzffh' 52 | InstallPackage 'Second Screen' '9PLTXW5DX5KB' 53 | InstallPackage 'SmartThings' '9N3ZBH5V7HX6' 54 | InstallPackage 'Storage Share' '9mvnw0xh7hs5' 55 | InstallPackage 'Nearby Devices' '9phl04njnt67' 56 | } 57 | 58 | # Function to log messages 59 | function Write-Log { 60 | param ( 61 | [string]$Message 62 | ) 63 | 64 | # Get the current timestamp 65 | $Timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" 66 | 67 | # Format the log message 68 | $LogMessage = "$Timestamp - $Message" 69 | 70 | # Append the log message to the log file 71 | Add-Content -Path $LogFilePath -Value $LogMessage 72 | } 73 | 74 | # Check if the script is running with administrative privileges 75 | $isAdmin = ([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-32-544" -or ([System.Security.Principal.WindowsIdentity]::GetCurrent()).groups -match "S-1-5-18" 76 | 77 | if (-not $isAdmin) { 78 | # Explain the importance of running the script with administrative privileges 79 | Write-Output "Please note that this script needs administrative privileges to perform these tasks." 80 | Write-Output "" 81 | # Prompt user for consent 82 | $confirmation = Read-Host "Do you want to run this script with administrative privileges? Press 'Y' to agree, or any other key to exit" 83 | 84 | if ($confirmation -eq 'Y' -or $confirmation -eq 'y') { 85 | try { 86 | Start-Process -FilePath "powershell" -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$($MyInvocation.MyCommand.Path)`"" -Verb RunAs -ErrorAction Stop 87 | # Exit the current instance of the script after triggering the relaunch 88 | exit 89 | } catch { 90 | Write-Output "Error relaunching the script as an administrator: $_" 91 | Write-Log "Error relaunching the script as an administrator: $_" 92 | Write-Output "Exiting..." 93 | Write-Output "" 94 | exit 1 95 | } 96 | } else { 97 | exit 0 98 | } 99 | } else { 100 | Write-Output "Script is running with administrative privileges." 101 | Write-Output "" 102 | } 103 | 104 | # Check if the Galaxy_Book4_Ultra_Spoofer.bat file already exists in the GalaxyBookEnabler directory 105 | if (Test-Path -Path $BatchFilePath) { 106 | Write-Output "The Galaxy_Book4_Ultra_Spoofer.bat file is already present in the GalaxyBookEnabler directory." 107 | Write-Log "The Galaxy_Book4_Ultra_Spoofer.bat file is already present in the GalaxyBookEnabler directory." 108 | $firstrun = $false 109 | } 110 | 111 | # Check if the scheduled task with the name "GalaxyBookEnabler" already exists 112 | $task = Get-ScheduledTask -TaskName $TaskName -ErrorAction SilentlyContinue 113 | 114 | if ($task) { 115 | Write-Output "The scheduled task with the name 'GalaxyBookEnabler' is already present." 116 | Write-Log "The scheduled task with the name 'GalaxyBookEnabler' is already present." 117 | $firstrun = $false 118 | } 119 | 120 | if ($firstrun -ne $true) { 121 | Write-Output "" 122 | Write-Output "This script has already been run. Skipping the initial setup steps." 123 | Write-Output "" 124 | $userchoice = Read-Host "Press (C) to continue with the installation of software packages, 125 | (D) to delete the GalaxyBookEnabler directory and remove the scheduled task, or any other key to exit." 126 | Write-Output "" 127 | if ($userchoice -eq'D') 128 | { 129 | try { 130 | Unregister-ScheduledTask -TaskName $TaskName -Confirm:$false -ErrorAction SilentlyContinue 131 | Remove-Item $GalaxyBookEnablerDirectory -Recurse -Force -ErrorAction SilentlyContinue 132 | Write-Output "Scheduled task and GalaxyBookEnabler directory have been removed." 133 | Write-Log "Scheduled task and GalaxyBookEnabler directory have been removed." 134 | #Ask to exit or continue with the script 135 | $userchoice2 = Read-Host "Press (C) to continue with the installation of software packages, or any other key to exit." 136 | if ($userchoice2 -eq 'C') { 137 | Write-Output "Continuing with the installation of software packages..." 138 | Write-Output "" 139 | } else { 140 | Write-Output "Exiting..." 141 | Write-Output "" 142 | exit 0 143 | } 144 | 145 | } catch { 146 | Write-Output "Error removing scheduled task and GalaxyBookEnabler directory: $_" 147 | Write-Log "Error removing scheduled task and GalaxyBookEnabler directory: $_" 148 | } 149 | } elseif ($userchoice -eq 'C') { 150 | Write-Output "Continuing with the installation of software packages..." 151 | } else { 152 | Write-Output "Exiting..." 153 | Write-Output "" 154 | exit 0 155 | } 156 | } 157 | 158 | # Inform the user about the purpose of the script and ask for consent 159 | Write-Output "This script is designed to automate the installation of certain software packages on your system." 160 | Write-Output "It will also create a scheduled task to run a batch file at startup for software installation." 161 | Write-Output "" 162 | Write-Output "Please read and understand the actions it will perform before proceeding." 163 | Write-Output "" 164 | 165 | # Provide a brief description of the script's actions 166 | Write-Output "Actions to be performed:" 167 | Write-Output "1. Creation of 'GalaxyBookEnabler' directory in your user folder." 168 | Write-Output "2. Scheduling a task to run a batch file at startup for software installation." 169 | Write-Output "3. Prompting you to select and install software packages." 170 | Write-Output "" 171 | 172 | # Ask for user consent 173 | $confirmation = Read-Host "Do you consent to run this script? (Type 'Y' for Yes, or any other key to exit)" 174 | 175 | # Check if the user consents 176 | if ($confirmation -ne 'Y' -and $confirmation -ne 'y') { 177 | Write-Output "You chose not to run the script. Exiting..." 178 | Write-Output "" 179 | exit 1 180 | }else{ 181 | Write-Log "User consent obtained." } 182 | 183 | 184 | # Create a new directory 'GalaxyBookEnabler' if it doesn't exist 185 | try { 186 | if (-not (Test-Path $GalaxyBookEnablerDirectory -PathType Container)) { 187 | New-Item -Path $GalaxyBookEnablerDirectory -ItemType Directory -ErrorAction Stop 188 | } 189 | } catch { 190 | Write-Output "Error creating directory: $_" 191 | Write-Output "Exiting..." 192 | Write-Output "" 193 | Write-Log "Error creating directory: $_" 194 | exit 1 195 | } 196 | 197 | # Define the source path for the batch file (assuming it's in the same directory as the script) 198 | $SourceBatchFilePath = Join-Path -Path $PSScriptRoot -ChildPath 'Galaxy_Book4_Ultra_Spoofer.bat' 199 | $BatchFilePath = Join-Path -Path $GalaxyBookEnablerDirectory -ChildPath 'Galaxy_Book4_Ultra_Spoofer.bat' 200 | 201 | # Check if the source and destination paths are the same if second time running 202 | $sourceContentHash = Get-FileHash -Path $SourceBatchFilePath -Algorithm SHA256 | Select-Object -ExpandProperty Hash 203 | if (Test-Path $BatchFilePath) { 204 | $destinationContentHash = Get-FileHash -Path $BatchFilePath -Algorithm SHA256 | Select-Object -ExpandProperty Hash 205 | 206 | if ((Test-Path $SourceBatchFilePath) -and (Test-Path $BatchFilePath) -and ($sourceContentHash -eq $destinationContentHash)) { 207 | Write-Output "Source and destination file contents are the same. No need to copy." 208 | } else { 209 | # Prompt user for confirmation to replace the file 210 | $replaceConfirmation = Read-Host "Destination file already exists and has different contents. Do you want to replace it? (Y/N)" 211 | 212 | if ($replaceConfirmation -eq 'Y') { 213 | try { 214 | # Copy the batch file to the 'GalaxyBookEnabler' directory 215 | Copy-Item -Path $SourceBatchFilePath -Destination $BatchFilePath -Force -ErrorAction Stop 216 | Write-Output "Batch file copied successfully." 217 | Write-Output "" 218 | Write-Log "Batch file copied successfully." 219 | } catch { 220 | Write-Output "Error copying batch file: $_" 221 | Write-Log "Error copying batch file: $_" 222 | Write-Output "Exiting..." 223 | Write-Output "" 224 | exit 1 225 | } 226 | } else { 227 | Write-Output "User chose not to replace the file. Exiting..." 228 | Write-Log "User chose not to replace the file. Exiting..." 229 | Write-Output "" 230 | break 231 | } 232 | } 233 | } else { 234 | # Destination file doesn't exist, proceed with copying 235 | try { 236 | Copy-Item -Path $SourceBatchFilePath -Destination $BatchFilePath -Force -ErrorAction Stop 237 | Write-Output "Batch file copied successfully." 238 | Write-Output "" 239 | Write-Log "Batch file copied successfully." 240 | } catch { 241 | Write-Output "Error copying batch file: $_" 242 | Write-Log "Error copying batch file: $_" 243 | Write-Output "Exiting..." 244 | Write-Output "" 245 | exit 1 246 | } 247 | } 248 | 249 | Clear-Host 250 | 251 | try { 252 | Unregister-ScheduledTask -TaskName $TaskName -Confirm:$false -ErrorAction SilentlyContinue 253 | Register-ScheduledTask -TaskName $TaskName -Action $TaskAction -Trigger $TaskTrigger -Principal $TaskPrincipal -Settings $TaskCondition -Description $TaskDescription -ErrorAction Stop 254 | Write-Output "Scheduled task registered successfully." 255 | Write-Output "" 256 | } catch { 257 | Write-Output "Error registering scheduled task: $_" 258 | Write-Log "Error registering scheduled task: $_" 259 | Write-Output "Exiting..." 260 | Write-Output "" 261 | exit 1 262 | } 263 | 264 | try{ 265 | Start-ScheduledTask -TaskName $TaskName 266 | 267 | # Wait for the task to complete, checking its status directly 268 | $taskCompleted = $false 269 | while (-not $taskCompleted) { 270 | $taskStatus = Get-ScheduledTask -TaskName $TaskName | Select-Object -ExpandProperty State 271 | if ($taskStatus -eq 'Ready') { 272 | $taskCompleted = $true 273 | } else { 274 | Start-Sleep -Seconds 5 # Wait for a few seconds before checking again 275 | } 276 | } 277 | 278 | if ($taskCompleted) { 279 | Write-Output "The scheduled task completed successfully." 280 | Write-Output "" 281 | Clear-Host 282 | Write-Output "For most of the Samsung Services to work, the following need to be installed." 283 | # Initialize variables 284 | $CoreInstall = $false 285 | $AltInstall = $false 286 | 287 | # Define software package options 288 | $packageOptions = [ordered]@{ 289 | '1' = @{ 290 | Name = "Samsung Continuity Service" 291 | Id = "9P98T77876KZ" 292 | } 293 | '2' = @{ 294 | Name = "Samsung Account" 295 | Id = "9NGW9K44GQ5F" 296 | } 297 | '3' = @{ 298 | Name = "Samsung Cloud Assistant" 299 | Id = "9NFWHCHM52HQ" 300 | } 301 | '4' = @{ 302 | Name = "Samsung Bluetooth Sync" 303 | Id = "9NJNNJTTFL45" 304 | } 305 | '5' = @{ 306 | Name = "Samsung Settings Runtime" 307 | Id = "9NL68DVFP841" 308 | } 309 | '6' = @{ 310 | Name = "Samsung Settings" 311 | Id = "9P2TBWSHK6HJ" 312 | } 313 | '7' = @{ 314 | Name = "Samsung Update" 315 | Id = "9NQ3HDB99VBF" 316 | } 317 | } 318 | 319 | # Display package options 320 | Write-Output "" 321 | Write-Output "Please select the packages to install:" 322 | foreach ($option in $packageOptions.Keys) { 323 | Write-Output "$option. $($packageOptions[$option].Name)" 324 | } 325 | 326 | # Get user input 327 | $UserPrompt = Read-Host "Do you want to proceed with the installation? (Y)es or (N)o:" 328 | Write-Output "" 329 | 330 | # Validate user input 331 | if ($UserPrompt -eq 'Y' -or $UserPrompt -eq 'y') { 332 | $CoreInstall = $true 333 | $selectedPackage = $packageOptions[$UserPrompt] 334 | Write-Output "Installing $($selectedPackage.Name)..." 335 | try { 336 | # Install all the packages with for loop 337 | foreach ($packageKey in $packageOptions.Keys) { 338 | $selectedPackage = $packageOptions[$packageKey] 339 | InstallPackage $selectedPackage.Name $selectedPackage.Id 340 | Write-Log "Installation of $($selectedPackage.Name) completed successfully." 341 | Write-Output "" 342 | } 343 | } catch { 344 | # Handle installation errors 345 | Write-Output "" 346 | $ErrorMessage = "Error installing $($selectedPackage.Name): $_" 347 | Write-Output $ErrorMessage 348 | Write-Log $ErrorMessage 349 | } 350 | 351 | } else { 352 | Write-Output "No valid option selected. If needed, you can install the apps from the Microsoft Store or an alternative source." 353 | Write-Output "" 354 | } 355 | 356 | # If core packages were installed, offer the option to install additional packages 357 | if ($CoreInstall) { 358 | $selectedPackages = @() 359 | do { 360 | Clear-Host # Clear the console screen 361 | 362 | # Print currently selected packages 363 | Write-Output "Selected packages: $($selectedPackages -join ', ')" 364 | Write-Output "" 365 | $packageOptions = @{ 366 | '1' = 'Galaxy Buds' 367 | '2' = 'Samsung Multi Control' 368 | '3' = 'Quick Share' 369 | '4' = 'Samsung Device Care' 370 | '5' = 'Samsung Flow' 371 | '6' = 'Samsung Gallery' 372 | '7' = 'Samsung Notes' 373 | '8' = 'Samsung Phone' 374 | '9' = 'Samsung Printer Experience' 375 | '10' = 'Samsung Screen Recorder' 376 | '11' = 'Samsung Studio' 377 | '12' = 'Second Screen' 378 | '13' = 'SmartThings' 379 | '14' = 'Storage Share' 380 | '15' = 'Nearby Devices' 381 | '16' = 'All' 382 | '17' = 'Finish selection' 383 | } 384 | 385 | foreach ($key in ($packageOptions.Keys | Sort-Object { [int]$_ })) { 386 | Write-Output "$key. $($packageOptions[$key])" 387 | } 388 | 389 | $UserPrompt = Read-Host "Select packages to install ( Press 17 to finish selection)" 390 | 391 | # Validate user input 392 | if ($UserPrompt -in $packageOptions.Keys){ 393 | switch ($UserPrompt) { 394 | '1' { 395 | if ('Galaxy Buds' -in $selectedPackages) { 396 | $selectedPackages = $selectedPackages -ne 'Galaxy Buds' 397 | } else { 398 | $selectedPackages += 'Galaxy Buds' 399 | } 400 | } 401 | '2' { 402 | if ('Samsung Multi Control' -in $selectedPackages) { 403 | $selectedPackages = $selectedPackages -ne 'Samsung Multi Control' 404 | } else { 405 | $selectedPackages += 'Samsung Multi Control' 406 | } 407 | } 408 | '3' { 409 | if ('Quick Share' -in $selectedPackages) { 410 | $selectedPackages = $selectedPackages -ne 'Quick Share' 411 | } else { 412 | $selectedPackages += 'Quick Share' 413 | } 414 | } 415 | '4' { 416 | if ('Samsung Device Care' -in $selectedPackages) { 417 | $selectedPackages = $selectedPackages -ne 'Samsung Device Care' 418 | } else { 419 | $selectedPackages += 'Samsung Device Care' 420 | } 421 | } 422 | '5' { 423 | if ('Samsung Flow' -in $selectedPackages) { 424 | $selectedPackages = $selectedPackages -ne 'Samsung Flow' 425 | } else { 426 | $selectedPackages += 'Samsung Flow' 427 | } 428 | } 429 | '6' { 430 | if ('Samsung Gallery' -in $selectedPackages) { 431 | $selectedPackages = $selectedPackages -ne 'Samsung Gallery' 432 | } else { 433 | $selectedPackages += 'Samsung Gallery' 434 | } 435 | } 436 | '7' { 437 | if ('Samsung Notes' -in $selectedPackages) { 438 | $selectedPackages = $selectedPackages -ne 'Samsung Notes' 439 | } else { 440 | $selectedPackages += 'Samsung Notes' 441 | } 442 | } 443 | '8' { 444 | if ('Samsung Phone' -in $selectedPackages) { 445 | $selectedPackages = $selectedPackages -ne 'Samsung Phone' 446 | } else { 447 | $selectedPackages += 'Samsung Phone' 448 | } 449 | } 450 | '9' { 451 | if ('Samsung Printer Experience' -in $selectedPackages) { 452 | $selectedPackages = $selectedPackages -ne 'Samsung Printer Experience' 453 | } else { 454 | $selectedPackages += 'Samsung Printer Experience' 455 | } 456 | } 457 | '10' { 458 | if ('Samsung Screen Recorder' -in $selectedPackages) { 459 | $selectedPackages = $selectedPackages -ne 'Samsung Screen Recorder' 460 | } else { 461 | $selectedPackages += 'Samsung Screen Recorder' 462 | } 463 | } 464 | '11' { 465 | if ('Samsung Studio' -in $selectedPackages) { 466 | $selectedPackages = $selectedPackages -ne 'Samsung Studio' 467 | } else { 468 | $selectedPackages += 'Samsung Studio' 469 | } 470 | } 471 | '12' { 472 | if ('Second Screen' -in $selectedPackages) { 473 | $selectedPackages = $selectedPackages -ne 'Second Screen' 474 | } else { 475 | $selectedPackages += 'Second Screen' 476 | } 477 | } 478 | '13' { 479 | if ('SmartThings' -in $selectedPackages) { 480 | $selectedPackages = $selectedPackages -ne 'SmartThings' 481 | } else { 482 | $selectedPackages += 'SmartThings' 483 | } 484 | } 485 | '14' { 486 | if ('Storage Share' -in $selectedPackages) { 487 | $selectedPackages = $selectedPackages -ne 'Storage Share' 488 | } else { 489 | $selectedPackages += 'Storage Share' 490 | } 491 | } 492 | '15' { 493 | if ('Nearby Devices' -in $selectedPackages) { 494 | $selectedPackages = $selectedPackages -ne 'Nearby Devices' 495 | } else { 496 | $selectedPackages += 'Nearby Devices' 497 | } 498 | } 499 | '16' { 500 | $allPackages = @( 501 | 'Galaxy Buds', 'Samsung Multi Control', 'Quick Share', 502 | 'Samsung Device Care', 'Samsung Flow', 'Samsung Gallery', 503 | 'Samsung Notes', 'Samsung Phone', 'Samsung Printer Experience', 504 | 'Samsung Screen Recorder', 'Samsung Studio', 'Second Screen', 505 | 'SmartThings', 'Storage Share', 'Nearby Devices' 506 | ) 507 | foreach ($package in $allPackages) { 508 | if ($package -notin $selectedPackages) { 509 | $selectedPackages += $package 510 | } 511 | } 512 | } 513 | '17' { Write-Output "Finishing package selection." } 514 | } 515 | } 516 | } while ($UserPrompt -ne '17') 517 | 518 | # Install selected packages 519 | if ($selectedPackages.Count -gt 0) { 520 | Clear-Host 521 | Write-Output "Installing selected packages..." 522 | foreach ($package in $selectedPackages) { 523 | switch ($package) { 524 | 'Galaxy Buds' { 525 | InstallPackage 'Galaxy Buds' '9NHTLWTKFZNB' 526 | } 527 | 'Samsung Multi Control' { 528 | InstallPackage 'Samsung Multi Control' '9N3L4FZ03Q99' 529 | } 530 | 'Quick Share' { 531 | InstallPackage 'Quick Share' '9PCTGDFXVZLJ' 532 | } 533 | 'Samsung Device Care' { 534 | InstallPackage 'Samsung Device Care' '9NBLGGH4XDV0' 535 | } 536 | 'Samsung Flow' { 537 | InstallPackage 'Samsung Flow' '9NBLGGH5GB0M' 538 | } 539 | 'Samsung Gallery' { 540 | InstallPackage 'Samsung Gallery' '9NBLGGH4N9R9' 541 | } 542 | 'Samsung Notes' { 543 | InstallPackage 'Samsung Notes' '9NBLGGH43VHV' 544 | } 545 | 'Samsung Phone' { 546 | InstallPackage 'Samsung Phone' '9mwjxxlchbgk' 547 | } 548 | 'Samsung Printer Experience' { 549 | InstallPackage 'Samsung Printer Experience' '9WZDNCRFHWGG' 550 | } 551 | 'Samsung Screen Recorder' { 552 | InstallPackage 'Samsung Screen Recorder' '9P5025MM7WDT' 553 | } 554 | 'Samsung Studio' { 555 | InstallPackage 'Samsung Studio' '9p312b4tzffh' 556 | } 557 | 'Second Screen' { 558 | InstallPackage 'Second Screen' '9PLTXW5DX5KB' 559 | } 560 | 'SmartThings' { 561 | InstallPackage 'SmartThings' '9N3ZBH5V7HX6' 562 | } 563 | 'Storage Share' { 564 | InstallPackage 'Storage Share' '9mvnw0xh7hs5' 565 | } 566 | 'Nearby Devices' { 567 | InstallPackage 'Nearby Devices' '9phl04njnt67' 568 | } 569 | } 570 | } 571 | } else { 572 | Write-Output "No additional packages were selected for installation." 573 | } 574 | } else { 575 | Write-Output "No core packages were installed, skipping additional package installation." 576 | } 577 | 578 | # Final message 579 | if ($AltInstall -or $CoreInstall) { 580 | Write-Output "You have successfully installed the selected packages." 581 | } else { 582 | Write-Output "No packages were installed." 583 | } 584 | } else { 585 | Write-Output "The scheduled task did not complete successfully. Current working directory has been left as is." 586 | } 587 | Write-Log "Script execution completed." 588 | 589 | Write-Output "Please delete the Script directory after the installation is complete." 590 | $deleteConfirmation = Read-Host 591 | } catch { 592 | Write-Output "Error checking task completion: $_" 593 | Write-Log "Error checking task completion: $_" 594 | } 595 | 596 | Write-Output "Press any key to exit..." 597 | $null = Read-Host --------------------------------------------------------------------------------