cask 'malwarebytes-anti-malware' do
  version '1.2.6.730'
  sha256 '7dae32d455fdf3fb52a4fc02ff5d86b582d2dc7bc7e5349ad06e517323d76a97'

  # data-cdn.mbamupdates.com was verified as official when first introduced to the cask
  url "https://data-cdn.mbamupdates.com/web/mbam-mac-#{version}.dmg"
  appcast 'https://data-cdn.mbamupdates.com/v1/mbam-mac/updates.xml',
          checkpoint: '0dce8c4b9ea6d25e1e146a40233fc6b936932852a26d82faae1e54f39768a14f'
  name 'Malwarebytes Anti-Malware for Mac'
  name 'AdwareMedic'
  homepage 'https://www.malwarebytes.com/mac/'

  depends_on macos: '>= :lion'

  app 'Malwarebytes Anti-Malware.app'

  uninstall launchctl: 'com.malwarebytes.HelperTool'

  zap delete: [
                '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.malwarebytes.antimalware.sfl',
                '~/Library/Application Support/com.malwarebytes.antimalware',
                '~/Library/Application Support/com.malware.antimalware',
                '~/Library/Application Support/Malwarebytes',
                '~/Library/Application Support/Malwarebytes Anti-Malware',
                '~/Library/Application Support/com.malwarebytes.breachremediation',
                '~/Library/Caches/com.malwarebytes.antimalware',
                '~/Library/Caches/com.malwarebytes.Malwarebytes-Anti-Malware-Service',
                '~/Library/Caches/com.malwarebytes.Malwarebytes-XPC-Service',
                '~/Library/Preferences/com.malwarebytes.antimalware.plist',
                '~/Library/Preferences/com.malwarebytes.Malwarebytes-Anti-Malware.plist',
                '~/Library/Preferences/com.malwarebytes.breachremediation.plist',
                '~/Library/Saved Application State/com.malwarebytes.antimalware.savedState',
                '/Library/PrivilegedHelperTools/com.malwarebytes.MBAMHelperTool',
                '/Library/PrivilegedHelperTools/com.malwarebytes.MBAMHelperTool.plist',
                '/Library/PrivilegedHelperTools/com.malwarebytes.HelperTool',
                '/Library/PrivilegedHelperTools/com.malwarebytes.HelperTool.plist',
                '/Library/LaunchDaemons/com.malwarebytes.MBAMHelperTool.plist',
                '/Library/LaunchDaemons/com.malwarebytes.HelperTool.plist',
              ]
end
