Replies: 6 comments 10 replies
-
I was going through issues today and noticed that this was suggested in #86 |
Beta Was this translation helpful? Give feedback.
-
Thank you @squatto. |
Beta Was this translation helpful? Give feedback.
-
My pleasure! I’m certainly not a security expert, but as long as there isn’t any information being sent out of the app, I can’t think of any negative security impacts of going the wifi SSID route. It’s essentially just string matching, isn’t it? |
Beta Was this translation helpful? Give feedback.
-
Yes, but if, for example, someone who knows your home WiFi SSID and password sets up a router that replicates them in your office, and your Mac connects to it (perhaps temporarily taking down the main router? ), your Mac will be unprotected. |
Beta Was this translation helpful? Give feedback.
-
UPDATE 9/20/24: Do not use this method! Use the updated method found here instead! I threw together a quick brute-force solution for the impatient 😉 This uses AppleScript to get the current wifi network's SSID, determines if it is your home network, and if so, kills BLEUnlock if it is running. If it isn't your home network, it launches BLEUnlock if it isn't already running. As mentioned by @ts1 in this comment, relying solely on the SSID's name is susceptible to spoofing! This script is in NO WAY hardened or secure, and should be used at your own discretion. Put this in -- get the current wifi SSID
set ssid to do shell script "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep -w SSID | awk '{print $2}'"
-- check if we aren't connected to wifi (no SSID)
if ssid = "" then return
-- are we at home?
set atHome to false
if ssid = "your-ssid-here" then set atHome to true
-- is BLEUnlock currently running?
set appName to "BLEUnlock"
set isRunning to false
tell application "System Events"
if exists process appName then
set isRunning to true
end if
end tell
-- if BLEUnlock is running and we are at home, kill it
-- if BLEUnlock is not running and we are not at home, run it
ignoring application responses
if atHome and isRunning then
tell application appName to quit
else if not atHome and not isRunning then
tell application appName to launch
end if
end ignoring Add this to your crontab. This runs the check every 5 minutes. Change as desired... # kill BLEUnlock while at home, launch it while not at home
*/5 * * * * osascript ~/CheckBLEUnlock.scpt 2>&1 Keep in mind, if you add this to your crontab, you won't be able to manually quit BLEUnlock while you're not at home because it will automatically re-launch whenever the script runs. |
Beta Was this translation helpful? Give feedback.
-
I came up with a much better (and MUCH easier) way of doing this than I outlined in my last reply. It is easily accomplished using Shortcuts and a single cronjob. The shortcut essentially does the same thing that the AppleScript in my previous replies was doing: use the name/SSID of the current wifi network to determine if you are at home and open or close BLEUnlock accordingly. You can download the shortcut here: https://www.icloud.com/shortcuts/fa9e18d09e8346e48ae50eb153433d46 There are comments in the shortcut that go over exactly how to set it up. Let me know if you have any questions! |
Beta Was this translation helpful? Give feedback.
-
Ensuring that my machine locks automatically when I walk away is an extremely helpful feature to have while I am at work, but it's really annoying at home 😂 I use my Apple Watch as the monitored BT device, so when I'm at home and it's charging (or someone else is using my laptop, etc.), my machine ends up locking itself at inconvenient times. I could certainly just disable BLEUnlock while I'm at home, but I'll inevitably forget to enable it when I get back to work.
What would be really awesome would be to enable/disable locking based on the location of the device. This would be similar to how focus modes can be enabled based on a location. e.g. my "Work" focus mode turns on when I get my office:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions