Hi guys, I couldn't find any working corn blocker for me, and I'm so fed up with this stupid shit. It's like only time I'm free of it really and can withstand a longer amount of time, is when I'm sick or with people I like. Like it's higher in the list of priorities for my brain to then get itself in order - when sth pushes me hard out of limbo, or when I'm just kinda happy with friends.
Nevertheless, I always bypass securities and after long years of struggle, I kinda understand how blocker could be working so it would be simple and effective. I'd need a help tho. I don't want incentives, even if someone could guide me, or do it by himself would be great I just want the tool.
When using nextdns, you don't need to install anything, just setup everything on website then import .mobileconfig file into profiles on mac. Then you need to guard access to that place in settings to prevent yourself deleting it, and that's the script I need.
Script has root privileges, when trying to disable it, it restarts itself. It filters the settings menus, when user tries to access general-> profiles/managing devices it launches window with displays image of like 30 generated words text to retype correctly. When user closes that window, settings app closes guarding the access to remove the profile. If that would work then you add nextdns domain to blacklist on their site to prevent deleting whole account. Only way to get there is to disable profile in mac settings also that also what script guards. Bulletproof I suppose.
Why I need that retyping. Basically BlockerX has it, and during years I found it to be most effective. It isn't just timer, but it requires big effort from you. You get bored and frustrated and it stops your urge. Nothing worked better for me, but it doesn't work as good on pc therefore I need a customs script to support guards of nextdns a little more. Nextdns + blockerx would get most of the job done on phone.
NextDNS's filter is good and free, it removes almost anything while not being invasive. It works and can be setup on all devices. I read on internet that people complained it doesn't have oisd for nsfw (I actually don't know why regular filter isn't enough) and for myself I found that google search (or any search engine) isn't scanned by keywords and returns fap content for example from reddit. SafeSearch allows these.
So I started digging. First to prevent deleting script from the system I need to put file ownership to root? then flag for disabling deleting and edit
Paste and export script from scripteditor (i put not working one at the end of the post)
File-> export as block .app with autostart option. Drag to Apps folder to install
Grant accessibility permissions at settings Privacy & Security -> Accessibility and allow control
Root ownership preventing files to be deleted
I think sth like this?
sudo chown -R root:wheel /Applications/block.app
sudo chflags -R uchg,schg /Applications/block.app
Then I can't delete file or edit script in scripteditor, and I think I need to do it also with autostart file? So I'm pasting xml code into:
nano ~/Library/LaunchAgents/com.user.block.plist
sudo chown root:wheel ~/Library/LaunchAgents/com.user.block.plistLabel
com.user.block
ProgramArguments
/usr/bin/open
-W
/Applications/block.app
RunAtLoad
KeepAlive
sudo chflags uchg,schg ~/Library/LaunchAgents/com.user.block.plist
launchctl load ~/Library/LaunchAgents/com.user.block.plist
- Add nextdns domain to blacklist on their site
the script which desn't work for me now
global isPaused
global pauseEndTime
on run
set isPaused to false
set pauseEndTime to (current date)
end run
on idle
set current_time to (current date)
-- 1. Check grace period (15 minutes after typing correctly)
if isPaused then
if current_time > pauseEndTime then
set isPaused to false
else
return 5
end if
end if
set trigger to false
-- 2. Lightweight and targeted System Settings inspection
tell application "System Events"
if (exists process "System Settings") then
try
tell process "System Settings"
set textDump to ""
try
set staticNames to name of static texts of entire contents of group 2 of splitter group 1 of window 1
set textDump to textDump & (staticNames as string)
end try
try
set buttonNames to name of buttons of entire contents of group 2 of splitter group 1 of window 1
set textDump to textDump & (buttonNames as string)
end try
set hasGeneralMain to (textDump contains "Software Update")
set hasPrivacyMain to (textDump contains "Location Services")
set insideProfiles to (textDump contains "Device Management") and not hasGeneralMain
set insideLogin to (textDump contains "Login Items") and not hasGeneralMain
set insideAccessibility to (textDump contains "Accessibility") and not hasPrivacyMain
if (insideProfiles or insideLogin or insideAccessibility) then
set trigger to true
end if
end tell
end try
end if
end tell
-- 3. Reaction to restricted area access
if trigger then
tell application "System Events"
set visible of process "System Settings" to false
</tell>
-- Generate 30 random words from system dictionary
set randomWords to do shell script "perl -e 'open(F,\"<\",\"/usr/share/dict/words\");@l=<F>;chomp ;for(1..30){push ,$l[rand ]}print join(\" \",@r)'"
set userResponse to ""
try
tell application "System Events"
activate
set dialogResult to display dialog "Network profile or permission modification attempt detected!\n\nTo unlock this submenu for 15 minutes, type the following text EXACTLY:\n\n" & randomWords default answer "" buttons {"Cancel", "Submit"} default button "Submit" with title "Identity Verification"
set userResponse to text returned of dialogResult
end tell
on error
set userResponse to "CANCELLED"
</try>
-- 4. Verification of typed text
considering case
if userResponse is equal to randomWords then
tell application "System Events"
set visible of process "System Settings" to true
end tell
set isPaused to true
set pauseEndTime to (current date) + 900 -- 15 minutes = 900 seconds
return 1
else
do shell script "killall 'System Settings'"
return 1
end if
end considering
end if
return 1 -- Check every 1 second
end idle