From 3ce9f08833e020307a695d19e7cea3cb6e0589fa Mon Sep 17 00:00:00 2001 From: he3als <65787561+he3als@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:22:38 +0100 Subject: [PATCH] fix(location): option for Find My Device, call settingsPages.cmd --- src/playbook/Configuration/tweaks.yml | 1 - .../privacy/disable-location-tracking.yml | 14 -------------- .../tweaks/qol/set-hidden-settings-pages.yml | 4 ++-- .../Location/Disable Location (default).cmd | 11 +++++++++-- .../Location/Enable Location.cmd | 17 +++++++++++++++-- 5 files changed, 26 insertions(+), 21 deletions(-) delete mode 100644 src/playbook/Configuration/tweaks/privacy/disable-location-tracking.yml diff --git a/src/playbook/Configuration/tweaks.yml b/src/playbook/Configuration/tweaks.yml index ac435d963b..039e8f6db0 100644 --- a/src/playbook/Configuration/tweaks.yml +++ b/src/playbook/Configuration/tweaks.yml @@ -84,7 +84,6 @@ actions: - !task: {path: 'tweaks\privacy\disable-activity-feed.yml'} - !task: {path: 'tweaks\privacy\disable-app-launch-tracking.yml'} - !task: {path: 'tweaks\privacy\disable-experimentation.yml'} - - !task: {path: 'tweaks\privacy\disable-location-tracking.yml'} - !task: {path: 'tweaks\privacy\disable-lockscreen-camera.yml'} - !task: {path: 'tweaks\privacy\disable-online-speech-recognition.yml'} - !task: {path: 'tweaks\privacy\disable-pca.yml'} diff --git a/src/playbook/Configuration/tweaks/privacy/disable-location-tracking.yml b/src/playbook/Configuration/tweaks/privacy/disable-location-tracking.yml deleted file mode 100644 index 3a57400420..0000000000 --- a/src/playbook/Configuration/tweaks/privacy/disable-location-tracking.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: Disable Location Tracking -description: Disables location tracking feature (also called Find My Device) for privacy -actions: - - !registryValue: - path: 'HKLM\SOFTWARE\Policies\Microsoft\FindMyDevice' - value: 'AllowFindMyDevice' - data: '0' - type: REG_DWORD - - !registryValue: - path: 'HKLM\SOFTWARE\Policies\Microsoft\FindMyDevice' - value: 'LocationSyncEnabled' - data: '0' - type: REG_DWORD diff --git a/src/playbook/Configuration/tweaks/qol/set-hidden-settings-pages.yml b/src/playbook/Configuration/tweaks/qol/set-hidden-settings-pages.yml index 76c3b86730..92101bb5f1 100644 --- a/src/playbook/Configuration/tweaks/qol/set-hidden-settings-pages.yml +++ b/src/playbook/Configuration/tweaks/qol/set-hidden-settings-pages.yml @@ -8,7 +8,7 @@ actions: - !registryValue: path: 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' value: 'SettingsPageVisibility' - data: 'hide:recovery;maps;maps-downloadmaps;findmydevice;privacy;privacy-speechtyping;privacy-speech;privacy-feedback;privacy-activityhistory;search-permissions;privacy-general;sync;cortana-windowssearch;mobile-devices;mobile-devices-addphone;workplace;backup' + data: 'hide:recovery;maps;maps-downloadmaps;privacy;privacy-speechtyping;privacy-speech;privacy-feedback;privacy-activityhistory;search-permissions;privacy-general;sync;cortana-windowssearch;mobile-devices;mobile-devices-addphone;workplace;backup' type: REG_SZ builds: [ '<22000' ] @@ -16,6 +16,6 @@ actions: - !registryValue: path: 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' value: 'SettingsPageVisibility' - data: 'hide:recovery;maps;maps-downloadmaps;findmydevice;privacy;privacy-feedback;privacy-activityhistory;search-permissions;privacy-general;sync;cortana-windowssearch;mobile-devices;mobile-devices-addphone;workplace;family-group;deviceusage;home' + data: 'hide:recovery;maps;maps-downloadmaps;privacy;privacy-feedback;privacy-activityhistory;search-permissions;privacy-general;sync;cortana-windowssearch;mobile-devices;mobile-devices-addphone;workplace;family-group;deviceusage;home' type: REG_SZ builds: [ '>=22000' ] diff --git a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Location/Disable Location (default).cmd b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Location/Disable Location (default).cmd index 3b6d304fe9..da204d4fa2 100644 --- a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Location/Disable Location (default).cmd +++ b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Location/Disable Location (default).cmd @@ -18,6 +18,8 @@ fltmc > nul 2>&1 || ( sc config lfsvc start=disabled sc config MapsBroker start=disabled reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowSearchToUseLocation /t REG_DWORD /d 0 /f + reg add "HKLM\SOFTWARE\Policies\Microsoft\FindMyDevice" /v AllowFindMyDevice /t REG_DWORD /d 0 /f + reg add "HKLM\SOFTWARE\Policies\Microsoft\FindMyDevice" /v LocationSyncEnabled /t REG_DWORD /d 0 /f ) > nul ( @@ -26,10 +28,15 @@ fltmc > nul 2>&1 || ( taskkill /f /im SystemSettings.exe ) > nul 2>&1 -"%windir%\AtlasModules\Scripts\settingsPages.cmd" /hide privacy-location +for %%a in ( + "privacy-location" + "findmydevice" +) do ( + call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /hide %%~a /silent +) if "%~1"=="/silent" exit /b -echo Finished, please reboot your device for changes to apply. +echo Finished. pause exit /b \ No newline at end of file diff --git a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Location/Enable Location.cmd b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Location/Enable Location.cmd index b048a18fb2..bd0ea0e4df 100644 --- a/src/playbook/Executables/AtlasDesktop/3. General Configuration/Location/Enable Location.cmd +++ b/src/playbook/Executables/AtlasDesktop/3. General Configuration/Location/Enable Location.cmd @@ -25,7 +25,7 @@ fltmc > nul 2>&1 || ( taskkill /f /im SystemSettings.exe ) > nul 2>&1 -"%windir%\AtlasModules\Scripts\settingsPages.cmd" /unhide privacy-location +call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /unhide privacy-location if "%~1"=="/silent" exit /b @@ -34,6 +34,19 @@ choice /c:yn /n /m "Would you like to allow Windows Search to use your location? if %errorlevel%==1 reg delete %key% /f > nul if %errorlevel%==2 reg add %key% /t REG_DWORD /d 0 /f > nul -echo Finished, please reboot your device for changes to apply. +set key1="HKLM\SOFTWARE\Policies\Microsoft\FindMyDevice" +choice /c:yn /n /m "Would you like to unlock Find My Device functionality? [Y/N] " +if %errorlevel%==1 ( + reg delete %key1% /f > nul + call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /unhide findmydevice /silent +) +if %errorlevel%==2 ( + reg add %key1% /v AllowFindMyDevice /t REG_DWORD /d 0 /f > nul + reg add %key1% /v LocationSyncEnabled /t REG_DWORD /d 0 /f > nul +) + +echo] +echo Finished. +start ms-settings:privacy-location pause exit /b \ No newline at end of file