diff --git a/Casks/w/whatsapp.rb b/Casks/w/whatsapp.rb index 0b13f4c2c7c7..7df1380e8f8a 100644 --- a/Casks/w/whatsapp.rb +++ b/Casks/w/whatsapp.rb @@ -17,8 +17,8 @@ auto_updates true conflicts_with cask: [ - "whatsapp-beta", - "whatsapp-legacy", + "whatsapp@beta", + "whatsapp@legacy", ] depends_on macos: ">= :big_sur" diff --git a/Casks/w/whatsapp@beta.rb b/Casks/w/whatsapp@beta.rb new file mode 100644 index 000000000000..0fee349dde5a --- /dev/null +++ b/Casks/w/whatsapp@beta.rb @@ -0,0 +1,43 @@ +cask "whatsapp@beta" do + version "2.24.8.85" + sha256 "80f292adbf879ad2fb6f72ef42ff4d801289e2a43901dca817b1b599f194b429" + + url "https://web.whatsapp.com/desktop/mac_native/release/?version=#{version}&extension=zip&configuration=Beta&branch=relbranch" + name "WhatsApp Beta" + desc "Native desktop client for WhatsApp" + homepage "https://www.whatsapp.com/" + + livecheck do + url "https://web.whatsapp.com/desktop/mac_native/updates/?branch=relbranch&configuration=Beta" + regex(/version=v?(\d+(?:\.\d+)+)/i) + strategy :sparkle do |item, regex| + item.url.scan(regex).map(&:first) + end + end + + auto_updates true + conflicts_with cask: [ + "whatsapp", + "whatsapp@legacy", + ] + depends_on macos: ">= :big_sur" + + app "WhatsApp.app" + + zap trash: [ + "~/Library/Application Scripts/net.whatsapp.WhatsApp", + "~/Library/Application Scripts/net.whatsapp.WhatsApp.Intents", + "~/Library/Application Scripts/net.whatsapp.WhatsApp.IntentsUI", + "~/Library/Application Scripts/net.whatsapp.WhatsApp.ServiceExtension", + "~/Library/Caches/net.whatsapp.WhatsApp", + "~/Library/Containers/net.whatsapp.WhatsApp", + "~/Library/Containers/net.whatsapp.WhatsApp.Intents", + "~/Library/Containers/net.whatsapp.WhatsApp.ServiceExtension", + "~/Library/Group Containers/group.com.facebook.family", + "~/Library/Group Containers/group.net.whatsapp.family", + "~/Library/Group Containers/group.net.whatsapp.WhatsApp.private", + "~/Library/Group Containers/group.net.whatsapp.WhatsApp.shared", + "~/Library/Group Containers/group.net.whatsapp.WhatsAppSMB.shared", + "~/Library/Saved Application State/net.whatsapp.WhatsApp.savedState", + ] +end diff --git a/Casks/w/whatsapp@legacy.rb b/Casks/w/whatsapp@legacy.rb new file mode 100644 index 000000000000..024e5f0ab29d --- /dev/null +++ b/Casks/w/whatsapp@legacy.rb @@ -0,0 +1,35 @@ +cask "whatsapp@legacy" do + version "2.2416.2" + sha256 "4697863bd8c8a26d1a7a944e873af40d8b288a9780d04667d894391e27b6a4a4" + + url "https://web.whatsapp.com/desktop/mac/files/release-#{version}.zip" + name "WhatsApp Legacy" + desc "Legacy desktop client for WhatsApp" + homepage "https://www.whatsapp.com/" + + livecheck do + url "https://web.whatsapp.com/desktop/mac/releases" + strategy :json do |json| + json["name"] + end + end + + auto_updates true + conflicts_with cask: [ + "whatsapp", + "whatsapp@beta", + ] + + app "WhatsApp.app" + + zap trash: [ + "~/Library/Application Support/WhatsApp", + "~/Library/Application Support/WhatsApp.ShipIt", + "~/Library/Caches/WhatsApp", + "~/Library/Caches/WhatsApp.ShipIt", + "~/Library/Preferences/ByHost/WhatsApp.ShipIt.*.plist", + "~/Library/Preferences/WhatsApp-Helper.plist", + "~/Library/Preferences/WhatsApp.plist", + "~/Library/Saved Application State/WhatsApp.savedState", + ] +end