Skip to content

Commit

Permalink
fix(location): option for Find My Device, call settingsPages.cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Jul 16, 2024
1 parent d492b6c commit 3ce9f08
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/playbook/Configuration/tweaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ 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' ]

# Windows 11
- !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' ]
Original file line number Diff line number Diff line change
Expand Up @@ -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

(
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit 3ce9f08

Please sign in to comment.