Remove Locations module.
This commit is contained in:
parent
61bcec42a8
commit
458a1e7903
@ -292,19 +292,19 @@ module Hbc
|
|||||||
ohai "Enabling accessibility access"
|
ohai "Enabling accessibility access"
|
||||||
if MacOS.version <= :mountain_lion
|
if MacOS.version <= :mountain_lion
|
||||||
@command.run!("/usr/bin/touch",
|
@command.run!("/usr/bin/touch",
|
||||||
args: [Hbc.pre_mavericks_accessibility_dotfile],
|
args: [MacOS.pre_mavericks_accessibility_dotfile],
|
||||||
sudo: true)
|
sudo: true)
|
||||||
elsif MacOS.version <= :yosemite
|
elsif MacOS.version <= :yosemite
|
||||||
@command.run!("/usr/bin/sqlite3",
|
@command.run!("/usr/bin/sqlite3",
|
||||||
args: [
|
args: [
|
||||||
Hbc.tcc_db,
|
MacOS.tcc_db,
|
||||||
"INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL);",
|
"INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL);",
|
||||||
],
|
],
|
||||||
sudo: true)
|
sudo: true)
|
||||||
elsif MacOS.version <= :el_capitan
|
elsif MacOS.version <= :el_capitan
|
||||||
@command.run!("/usr/bin/sqlite3",
|
@command.run!("/usr/bin/sqlite3",
|
||||||
args: [
|
args: [
|
||||||
Hbc.tcc_db,
|
MacOS.tcc_db,
|
||||||
"INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL,NULL);",
|
"INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','#{bundle_identifier}',0,1,1,NULL,NULL);",
|
||||||
],
|
],
|
||||||
sudo: true)
|
sudo: true)
|
||||||
@ -325,7 +325,7 @@ module Hbc
|
|||||||
ohai "Disabling accessibility access"
|
ohai "Disabling accessibility access"
|
||||||
@command.run!("/usr/bin/sqlite3",
|
@command.run!("/usr/bin/sqlite3",
|
||||||
args: [
|
args: [
|
||||||
Hbc.tcc_db,
|
MacOS.tcc_db,
|
||||||
"DELETE FROM access WHERE client='#{bundle_identifier}';",
|
"DELETE FROM access WHERE client='#{bundle_identifier}';",
|
||||||
],
|
],
|
||||||
sudo: true)
|
sudo: true)
|
||||||
|
|||||||
@ -19,14 +19,6 @@ module Hbc
|
|||||||
def default_tap
|
def default_tap
|
||||||
@default_tap ||= Tap.fetch("homebrew", "homebrew-cask")
|
@default_tap ||= Tap.fetch("homebrew", "homebrew-cask")
|
||||||
end
|
end
|
||||||
|
|
||||||
def tcc_db
|
|
||||||
@tcc_db ||= Pathname.new("/Library/Application Support/com.apple.TCC/TCC.db")
|
|
||||||
end
|
|
||||||
|
|
||||||
def pre_mavericks_accessibility_dotfile
|
|
||||||
@pre_mavericks_accessibility_dotfile ||= Pathname.new("/private/var/db/.AccessibilityAPIEnabled")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -255,5 +255,13 @@ module OS
|
|||||||
def mdfind_query(*ids)
|
def mdfind_query(*ids)
|
||||||
ids.map! { |id| "kMDItemCFBundleIdentifier == #{id}" }.join(" || ")
|
ids.map! { |id| "kMDItemCFBundleIdentifier == #{id}" }.join(" || ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def tcc_db
|
||||||
|
@tcc_db ||= Pathname.new("/Library/Application Support/com.apple.TCC/TCC.db")
|
||||||
|
end
|
||||||
|
|
||||||
|
def pre_mavericks_accessibility_dotfile
|
||||||
|
@pre_mavericks_accessibility_dotfile ||= Pathname.new("/private/var/db/.AccessibilityAPIEnabled")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -16,7 +16,7 @@ describe "Accessibility Access", :cask do
|
|||||||
it "can enable accessibility access in macOS releases prior to Mavericks" do
|
it "can enable accessibility access in macOS releases prior to Mavericks" do
|
||||||
expect(fake_system_command).to receive(:run!).with(
|
expect(fake_system_command).to receive(:run!).with(
|
||||||
"/usr/bin/touch",
|
"/usr/bin/touch",
|
||||||
args: [Hbc.pre_mavericks_accessibility_dotfile],
|
args: [MacOS.pre_mavericks_accessibility_dotfile],
|
||||||
sudo: true,
|
sudo: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ describe "Accessibility Access", :cask do
|
|||||||
it "can enable accessibility access" do
|
it "can enable accessibility access" do
|
||||||
expect(fake_system_command).to receive(:run!).with(
|
expect(fake_system_command).to receive(:run!).with(
|
||||||
"/usr/bin/sqlite3",
|
"/usr/bin/sqlite3",
|
||||||
args: [Hbc.tcc_db, "INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','com.example.BasicCask',0,1,1,NULL);"],
|
args: [MacOS.tcc_db, "INSERT OR REPLACE INTO access VALUES('kTCCServiceAccessibility','com.example.BasicCask',0,1,1,NULL);"],
|
||||||
sudo: true,
|
sudo: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ describe "Accessibility Access", :cask do
|
|||||||
it "can disable accessibility access" do
|
it "can disable accessibility access" do
|
||||||
expect(fake_system_command).to receive(:run!).with(
|
expect(fake_system_command).to receive(:run!).with(
|
||||||
"/usr/bin/sqlite3",
|
"/usr/bin/sqlite3",
|
||||||
args: [Hbc.tcc_db, "DELETE FROM access WHERE client='com.example.BasicCask';"],
|
args: [MacOS.tcc_db, "DELETE FROM access WHERE client='com.example.BasicCask';"],
|
||||||
sudo: true,
|
sudo: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user