GODT-1508: Splash screen for rebranding.

* Use old keychain until manual update.
* Improve desktop files migration for windows and linux.
* Revert, need admin rights to change desktop and start menu files.
This commit is contained in:
Jakub
2022-05-04 09:58:44 +02:00
parent 7d41062ae9
commit 865ac44037
15 changed files with 3240 additions and 252 deletions

View File

@ -159,12 +159,8 @@ func New( //nolint:funlen
return nil, api.CheckOtherInstanceAndFocus(settingsObj.GetInt(settings.APIPortKey)) return nil, api.CheckOtherInstanceAndFocus(settingsObj.GetInt(settings.APIPortKey))
} }
if err := migrateMacKeychainBefore220(settingsObj, keychainName); err != nil { if err := migrateRebranding(settingsObj, keychainName); err != nil {
logrus.WithError(err).Warn("Keychain migration failed") logrus.WithError(err).Warn("Rebranding migration failed")
}
if err := migrateStartup220(settingsObj); err != nil {
logrus.WithError(err).Warn("Failed to remove old startup paths")
} }
cachePath, err := locations.ProvideCachePath() cachePath, err := locations.ProvideCachePath()
@ -244,7 +240,7 @@ func New( //nolint:funlen
} }
autostart := &autostart.App{ autostart := &autostart.App{
Name: appName, Name: startupNameForRebranding(appName),
DisplayName: appName, DisplayName: appName,
Exec: []string{exe, "--" + FlagNoWindow}, Exec: []string{exe, "--" + FlagNoWindow},
} }

View File

@ -18,16 +18,11 @@
package base package base
import ( import (
"errors"
"os" "os"
"path/filepath" "path/filepath"
"runtime"
"github.com/Masterminds/semver/v3"
"github.com/ProtonMail/proton-bridge/internal/config/settings"
"github.com/ProtonMail/proton-bridge/internal/constants" "github.com/ProtonMail/proton-bridge/internal/constants"
"github.com/ProtonMail/proton-bridge/internal/locations" "github.com/ProtonMail/proton-bridge/internal/locations"
"github.com/ProtonMail/proton-bridge/pkg/keychain"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -112,122 +107,6 @@ func migrateUpdatesFrom16x(configName string, locations *locations.Locations) er
return moveIfExists(oldUpdatesPath, newUpdatesPath) return moveIfExists(oldUpdatesPath, newUpdatesPath)
} }
// migrateMacKeychainBefore220 deals with write access restriction to mac
// keychain passwords which are caused by application renaming. The old
// passwords are copied under new name in order to have write access afer
// renaming.
func migrateMacKeychainBefore220(settingsObj *settings.Settings, keychainName string) error {
l := logrus.WithField("pkg", "app/base/migration")
if runtime.GOOS != "darwin" {
return nil
}
if shouldContinue, err := isBefore220(settingsObj); !shouldContinue || err != nil {
return err
}
l.Warn("Migrating mac keychain")
helperConstructor, ok := keychain.Helpers["macos-keychain"]
if !ok {
return errors.New("cannot find macos-keychain helper")
}
oldKC, err := helperConstructor("ProtonMailBridgeService")
if err != nil {
l.WithError(err).Error("Keychain constructor failed")
return err
}
idByURL, err := oldKC.List()
if err != nil {
l.WithError(err).Error("List old keychain failed")
return err
}
newKC, err := keychain.NewKeychain(settingsObj, keychainName)
if err != nil {
return err
}
for url, id := range idByURL {
li := l.WithField("id", id).WithField("url", url)
userID, secret, err := oldKC.Get(url)
if err != nil {
li.WithField("userID", userID).
WithField("err", err).
Error("Faild to get old item")
continue
}
if _, _, err := newKC.Get(userID); err == nil {
li.Warn("Skipping migration, item already exists.")
continue
}
if err := newKC.Put(userID, secret); err != nil {
li.WithError(err).Error("Failed to migrate user")
}
li.Info("Item migrated")
}
return nil
}
// migrateStartup220 removes old startup links. The creation of new links is
// handled by bridge initialisation.
func migrateStartup220(settingsObj *settings.Settings) error {
if shouldContinue, err := isBefore220(settingsObj); !shouldContinue || err != nil {
return err
}
logrus.WithField("pkg", "app/base/migration").Warn("Migrating autostartup links")
path, err := os.UserHomeDir()
if err != nil {
return err
}
switch runtime.GOOS {
case "windows":
path = filepath.Join(path, `AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ProtonMail Bridge.lnk`)
case "linux":
path = filepath.Join(path, `.config/autostart/ProtonMail Bridge.desktop`)
case "darwin":
path = filepath.Join(path, `Library/LaunchAgents/ProtonMail Bridge.plist`)
default:
return errors.New("unknown GOOS")
}
return os.Remove(path)
}
// isBefore220 decide if last used version was older than 2.2.0. If cannot decide it returns false with error.
func isBefore220(settingsObj *settings.Settings) (bool, error) {
lastUsedVersion := settingsObj.Get(settings.LastVersionKey)
// Skipping migration: it is first bridge start or cache was cleared.
if lastUsedVersion == "" {
return false, nil
}
v220 := semver.MustParse("2.2.0")
lastVer, err := semver.NewVersion(lastUsedVersion)
// Skipping migration: Should not happen but cannot decide what to do.
if err != nil {
return false, err
}
// Skipping migration: 2.2.0>= was already used hence old stuff was already migrated.
if !lastVer.LessThan(v220) {
return false, nil
}
return true, nil
}
func moveIfExists(source, destination string) error { func moveIfExists(source, destination string) error {
l := logrus.WithField("source", source).WithField("destination", destination) l := logrus.WithField("source", source).WithField("destination", destination)

View File

@ -0,0 +1,197 @@
// Copyright (c) 2022 Proton AG
//
// This file is part of Proton Mail Bridge.
//
// Proton Mail Bridge is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Proton Mail Bridge is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
package base
import (
"errors"
"os"
"path/filepath"
"runtime"
"strings"
"github.com/ProtonMail/proton-bridge/internal/config/settings"
"github.com/ProtonMail/proton-bridge/pkg/keychain"
"github.com/hashicorp/go-multierror"
"github.com/sirupsen/logrus"
)
const darwin = "darwin"
func migrateRebranding(settingsObj *settings.Settings, keychainName string) (result error) {
if err := migrateStartupBeforeRebranding(); err != nil {
result = multierror.Append(result, err)
}
lastUsedVersion := settingsObj.Get(settings.LastVersionKey)
// Skipping migration: it is first bridge start or cache was cleared.
if lastUsedVersion == "" {
settingsObj.SetBool(settings.RebrandingMigrationKey, true)
return
}
// Skipping rest of migration: already done
if settingsObj.GetBool(settings.RebrandingMigrationKey) {
return
}
switch runtime.GOOS {
case "windows", "linux":
// GODT-1260 we would need admin rights to changes desktop files
// and start menu items.
settingsObj.SetBool(settings.RebrandingMigrationKey, true)
case darwin:
if shouldContinue, err := isMacBeforeRebranding(); !shouldContinue || err != nil {
if err != nil {
result = multierror.Append(result, err)
}
break
}
if err := migrateMacKeychainBeforeRebranding(settingsObj, keychainName); err != nil {
result = multierror.Append(result, err)
}
settingsObj.SetBool(settings.RebrandingMigrationKey, true)
}
return result
}
// migrateMacKeychainBeforeRebranding deals with write access restriction to
// mac keychain passwords which are caused by application renaming. The old
// passwords are copied under new name in order to have write access afer
// renaming.
func migrateMacKeychainBeforeRebranding(settingsObj *settings.Settings, keychainName string) error {
l := logrus.WithField("pkg", "app/base/migration")
l.Warn("Migrating mac keychain")
helperConstructor, ok := keychain.Helpers["macos-keychain"]
if !ok {
return errors.New("cannot find macos-keychain helper")
}
oldKC, err := helperConstructor("ProtonMailBridgeService")
if err != nil {
l.WithError(err).Error("Keychain constructor failed")
return err
}
idByURL, err := oldKC.List()
if err != nil {
l.WithError(err).Error("List old keychain failed")
return err
}
newKC, err := keychain.NewKeychain(settingsObj, keychainName)
if err != nil {
return err
}
for url, id := range idByURL {
li := l.WithField("id", id).WithField("url", url)
userID, secret, err := oldKC.Get(url)
if err != nil {
li.WithField("userID", userID).
WithField("err", err).
Error("Faild to get old item")
continue
}
if _, _, err := newKC.Get(userID); err == nil {
li.Warn("Skipping migration, item already exists.")
continue
}
if err := newKC.Put(userID, secret); err != nil {
li.WithError(err).Error("Failed to migrate user")
}
li.Info("Item migrated")
}
return nil
}
// migrateStartupBeforeRebranding removes old startup links. The creation of new links is
// handled by bridge initialisation.
func migrateStartupBeforeRebranding() error {
path, err := os.UserHomeDir()
if err != nil {
return err
}
switch runtime.GOOS {
case "windows":
path = filepath.Join(path, `AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ProtonMail Bridge.lnk`)
case "linux":
path = filepath.Join(path, `.config/autostart/ProtonMail Bridge.desktop`)
case darwin:
path = filepath.Join(path, `Library/LaunchAgents/ProtonMail Bridge.plist`)
default:
return errors.New("unknown GOOS")
}
if _, err := os.Stat(path); os.IsNotExist(err) {
return nil
}
logrus.WithField("pkg", "app/base/migration").Warn("Migrating autostartup links")
return os.Remove(path)
}
// startupNameForRebranding returns the name for autostart launcher based on
// type of rebranded instance i.e. update or manual.
//
// This only affects darwin when udpate re-writes the old startup and then
// manual installed it would not run proper exe. Therefore we return "old" name
// for updates and "new" name for manual which would be properly migrated.
//
// For orther (linux and windows) the link is always pointing to launcher which
// path didn't changed.
func startupNameForRebranding(origin string) string {
if runtime.GOOS == darwin {
if path, err := os.Executable(); err == nil && strings.Contains(path, "ProtonMail Bridge") {
return "ProtonMail Bridge"
}
}
// No need to solve for other OS. See comment above.
return origin
}
// isBeforeRebranding decide if last used version was older than 2.2.0. If
// cannot decide it returns false with error.
func isMacBeforeRebranding() (bool, error) {
// previous version | update | do mac migration |
// | first | false |
// cleared-cache | manual | false |
// cleared-cache | in-app | false |
// old | in-app | false |
// old in-app | in-app | false |
// old | manual | true |
// old in-app | manual | true |
// manual | in-app | false |
// Skip if it was in-app update and not manual
if path, err := os.Executable(); err != nil || strings.Contains(path, "ProtonMail Bridge") {
return false, err
}
return true, nil
}

View File

@ -18,14 +18,21 @@
// Package bridge provides core functionality of Bridge app. // Package bridge provides core functionality of Bridge app.
package bridge package bridge
import "github.com/ProtonMail/proton-bridge/internal/config/settings"
// IsAutostartEnabled checks if link file exits.
func (b *Bridge) IsAutostartEnabled() bool { func (b *Bridge) IsAutostartEnabled() bool {
return b.autostart.IsEnabled() return b.autostart.IsEnabled()
} }
// EnableAutostart creates link and sets the preferences.
func (b *Bridge) EnableAutostart() error { func (b *Bridge) EnableAutostart() error {
b.settings.SetBool(settings.AutostartKey, true)
return b.autostart.Enable() return b.autostart.Enable()
} }
// DisableAutostart removes link and sets the preferences.
func (b *Bridge) DisableAutostart() error { func (b *Bridge) DisableAutostart() error {
b.settings.SetBool(settings.AutostartKey, false)
return b.autostart.Disable() return b.autostart.Disable()
} }

View File

@ -54,6 +54,7 @@ const (
FetchWorkers = "fetch_workers" FetchWorkers = "fetch_workers"
AttachmentWorkers = "attachment_workers" AttachmentWorkers = "attachment_workers"
ColorScheme = "color_scheme" ColorScheme = "color_scheme"
RebrandingMigrationKey = "rebranding_migrated"
) )
type Settings struct { type Settings struct {

View File

@ -97,10 +97,6 @@ ApplicationWindow {
property bool _showSetup: false property bool _showSetup: false
currentIndex: { currentIndex: {
if (backend.showSplashScreen) {
return 3
}
// show welcome when there are no users or only one non-logged-in user is present // show welcome when there are no users or only one non-logged-in user is present
if (backend.users.count === 0) { if (backend.users.count === 0) {
return 1 return 1
@ -167,14 +163,6 @@ ApplicationWindow {
} }
} }
SplashScreen { // 3
id: splashScreen
colorScheme: root.colorScheme
backend: root.backend
Layout.fillHeight: true
Layout.fillWidth: true
}
} }
NotificationPopups { NotificationPopups {
@ -184,6 +172,12 @@ ApplicationWindow {
backend: root.backend backend: root.backend
} }
SplashScreen {
id: splashScreen
colorScheme: root.colorScheme
backend: root.backend
}
function showLocalCacheSettings() { contentWrapper.showLocalCacheSettings() } function showLocalCacheSettings() { contentWrapper.showLocalCacheSettings() }
function showSettings() { contentWrapper.showSettings() } function showSettings() { contentWrapper.showSettings() }
function showHelp() { contentWrapper.showHelp() } function showHelp() { contentWrapper.showHelp() }

View File

@ -23,126 +23,86 @@ import QtQuick.Controls.impl 2.12
import Proton 4.0 import Proton 4.0
Rectangle { Dialog {
id: root id: root
property ColorScheme colorScheme
property var backend property var backend
color: root.colorScheme.background_norm shouldShow: root.backend.showSplashScreen
modal: true
topPadding : 0
leftPadding : 0
rightPadding : 0
ColumnLayout { ColumnLayout {
anchors.centerIn: root
//width: 320
spacing: 20 spacing: 20
Label { Image {
Layout.bottomMargin: 12;
Layout.alignment: Qt.AlignHCenter;
colorScheme: root.colorScheme;
text: "What's new in Bridge"
type: Label.Heading
horizontalAlignment: Text.AlignCenter
}
Repeater {
model: ListModel {
ListElement { icon: "ic-illustrative-view-html-code" ; title: qsTr("New interface") ; description: qsTr("Entirely redesigned GUI with more intuitive setup.")}
ListElement { icon: "ic-card-identity" ; title: qsTr("Status view") ; description: qsTr("Important notifications and available storage at a glance.")}
ListElement { icon: "ic-drive" ; title: qsTr("Local cache") ; description: qsTr("New and improved cache for major stability and performance enhancements.")}
}
Item {
implicitWidth: children[0].implicitWidth
implicitHeight: children[0].implicitHeight
RowLayout {
id: row
spacing: 25
Item {
Layout.topMargin: itemTitle.height/2
Layout.alignment: Qt.AlignTop
Layout.preferredWidth: 24
Layout.preferredHeight: 24
ColorImage {
anchors.top: parent.top
anchors.left: parent.left
color: root.colorScheme.interaction_norm
source: "./icons/"+model.icon+".svg"
width: parent.width
sourceSize.width: parent.width
}
}
ColumnLayout {
spacing: 0
Label {
id: itemTitle
colorScheme: root.colorScheme
text: model.title
type: Label.Body_bold
}
Label {
Layout.preferredWidth: 320
colorScheme: root.colorScheme
text: model.description
wrapMode: Text.WordWrap
}
}
}
}
}
Item {
Layout.alignment: Qt.AlignHCenter;
implicitWidth: children[0].width
implicitHeight: children[0].height
RowLayout {
spacing: 10
Label {
colorScheme: root.colorScheme;
text: qsTr("Full release notes")
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
type: Label.LabelType.Body
sourceSize.width: 400
sourceSize.height: 225
Layout.preferredWidth: 400
Layout.preferredHeight: 225
source: "./icons/img-splash.png"
}
Label {
colorScheme: root.colorScheme;
Layout.alignment: Qt.AlignHCenter;
Layout.leftMargin: 24
Layout.rightMargin: 24
Layout.preferredWidth: 336
type: Label.Title
horizontalAlignment: Text.AlignHCenter
text: qsTr("Updated Proton, unified protection")
}
Label {
colorScheme: root.colorScheme
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter;
Layout.preferredWidth: 336
Layout.leftMargin: 24
Layout.rightMargin: 24
wrapMode: Text.WordWrap
type: Label.Body
horizontalAlignment: Text.AlignHCenter
textFormat: Text.StyledText
text: qsTr("Introducing Protons refreshed look.<br/>") +
qsTr("Many services, one mission. Welcome to an Internet where privacy is the default. ") +
link("https://proton.me/news/updated-proton",qsTr("Learn More"))
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
color: root.colorScheme.interaction_norm
} }
ColorImage {
color: root.colorScheme.interaction_norm
source: "./icons/ic-external-link.svg"
width: 16
sourceSize.width: 16
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: Qt.openUrlExternally(root.backend.releaseNotesLink)
}
}
Button { Button {
Layout.topMargin: 12
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: 24
Layout.rightMargin: 24
colorScheme: root.colorScheme colorScheme: root.colorScheme
text: "Start using Bridge" text: "Got it"
onClicked: root.backend.showSplashScreen = false onClicked: root.backend.showSplashScreen = false
} }
Image {
Layout.alignment: Qt.AlignHCenter
sourceSize.width: 164
sourceSize.height: 32
Layout.preferredWidth: 164
Layout.preferredHeight: 32
source: "./icons/img-proton-logos.svg"
}
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,63 @@
<svg width="164" height="32" viewBox="0 0 164 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.91309 8.64043C5.91309 8.2476 6.37094 8.03268 6.67315 8.28365L14.6667 14.922C15.4397 15.5639 16.5604 15.5639 17.3334 14.922L25.3269 8.28366C25.6291 8.03268 26.087 8.2476 26.087 8.64043V22.2612C26.087 23.4137 25.1526 24.3481 24 24.3481H8.00004C6.84745 24.3481 5.91309 23.4137 5.91309 22.2612V8.64043Z" fill="#6D4AFF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.7236 13.7655L18.7247 13.7664L14.699 17.3224C14.0133 17.9282 12.9882 17.9435 12.2847 17.3584L5.91309 12.0594V8.63848C5.91309 8.24565 6.37094 8.03073 6.67315 8.2817L14.6667 14.9201C15.4397 15.562 16.5604 15.562 17.3334 14.9201L18.7236 13.7655Z" fill="url(#paint0_linear_2302_47705)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.7971 11.2151V24.3481H24C25.1526 24.3481 26.087 23.4137 26.087 22.2611V8.64045C26.087 8.24762 25.6291 8.03266 25.3269 8.28368L21.7971 11.2151Z" fill="url(#paint1_linear_2302_47705)"/>
<path d="M52.4445 8.11523C51.356 8.11523 50.4735 8.99769 50.4735 10.0862V21.9123C50.4735 23.0009 51.356 23.8834 52.4445 23.8834H62.5186V19.0653C62.5186 17.8558 63.4991 16.8753 64.7086 16.8753H69.5266V10.0862C69.5266 8.99769 68.6442 8.11523 67.5556 8.11523H52.4445Z" fill="url(#paint2_linear_2302_47705)"/>
<path d="M52.4445 8.11523C51.356 8.11523 50.4735 8.99769 50.4735 10.0862V21.9123C50.4735 23.0009 51.356 23.8834 52.4445 23.8834H62.5186V19.0653C62.5186 17.8558 63.4991 16.8753 64.7086 16.8753H69.5266V10.0862C69.5266 8.99769 68.6442 8.11523 67.5556 8.11523H52.4445Z" fill="url(#paint3_radial_2302_47705)"/>
<path d="M63.0661 17.6175C62.7253 18.0035 62.5185 18.5107 62.5185 19.0661V23.8842H59.124V22.9671C59.124 22.4986 59.2909 22.0454 59.5948 21.6887L63.0661 17.6152L63.0661 17.6175Z" fill="#BFD8FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M65.4751 8.11523H52.4445C51.356 8.11523 50.4735 8.99769 50.4735 10.0862V10.4695H63.9421C64.7888 10.4695 65.4751 11.1559 65.4751 12.0025V16.8753H69.5266V10.0862C69.5266 8.99769 68.6442 8.11523 67.5556 8.11523H65.6941H65.4751Z" fill="url(#paint4_linear_2302_47705)"/>
<path d="M64.4348 21.3822H65.1279C65.1566 21.5028 65.2266 21.6096 65.3258 21.6839C65.4249 21.7583 65.547 21.7956 65.6708 21.7894C65.984 21.7894 66.1902 21.6165 66.1902 21.364C66.1902 21.1115 65.9749 20.9705 65.5487 20.9705H65.2727V20.4002H65.5116C65.9233 20.4002 66.0917 20.2486 66.0917 20.0211C66.0917 19.7936 65.9089 19.6374 65.6564 19.6374C65.5432 19.6307 65.4319 19.6684 65.3461 19.7427C65.2604 19.8169 65.2071 19.9218 65.1976 20.0348H64.5334C64.5569 19.6374 64.8701 19.0664 65.6564 19.0664C66.2881 19.0664 66.7233 19.4266 66.7233 19.9316C66.7241 20.094 66.673 20.2524 66.5775 20.3837C66.4821 20.515 66.3472 20.6125 66.1925 20.6619V20.6709C66.3729 20.7038 66.5354 20.8003 66.6505 20.943C66.7657 21.0857 66.8257 21.265 66.8196 21.4482C66.8196 21.9957 66.3184 22.3581 65.6685 22.3581C64.9777 22.3604 64.4864 21.9676 64.4348 21.3822Z" fill="#6D4AFF"/>
<path d="M68.0302 19.1191H68.5352V22.31H67.8845V19.863L67.2574 20.2885V19.6431L68.0302 19.1191Z" fill="#6D4AFF"/>
<path d="M93.9131 22.261V9.7393C93.9131 8.58671 94.8474 7.65234 96 7.65234H99.9139C100.309 7.65234 100.693 7.77837 101.012 8.01208L102.322 8.97377C102.64 9.20748 103.025 9.3335 103.419 9.3335H112C113.153 9.3335 114.087 10.2679 114.087 11.4205V22.261C114.087 23.4136 113.153 24.348 112 24.348H96C94.8474 24.348 93.9131 23.4136 93.9131 22.261Z" fill="url(#paint5_linear_2302_47705)"/>
<path d="M93.9131 22.261V9.7393C93.9131 8.58671 94.8474 7.65234 96 7.65234H99.9139C100.309 7.65234 100.693 7.77837 101.012 8.01208L102.322 8.97377C102.64 9.20748 103.025 9.3335 103.419 9.3335H112C113.153 9.3335 114.087 10.2679 114.087 11.4205V22.261C114.087 23.4136 113.153 24.348 112 24.348H96C94.8474 24.348 93.9131 23.4136 93.9131 22.261Z" fill="url(#paint6_radial_2302_47705)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M103.419 9.3335H104.754H109.913H112C113.153 9.3335 114.087 10.2678 114.087 11.4205V22.261C114.087 23.4137 113.153 24.348 112 24.348H109.797V13.4588C109.797 12.5587 109.065 11.8305 108.165 11.8357L100.263 11.8812C99.9223 11.8832 99.5899 11.7781 99.3126 11.5809L97.5529 10.3295C97.2781 10.1341 96.9493 10.0292 96.6122 10.0292H93.9131V9.7393C93.9131 8.58667 94.8474 7.65234 96 7.65234H99.9139C100.309 7.65234 100.693 7.77836 101.012 8.01206L102.322 8.97379C102.64 9.20748 103.025 9.3335 103.419 9.3335Z" fill="url(#paint7_linear_2302_47705)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M146.124 24.3322C146.883 25.7082 148.834 25.7827 149.696 24.4687L157.736 12.2167C158.588 10.9174 157.773 9.17537 156.229 8.99833L140.426 7.18626C138.741 6.99307 137.542 8.78343 138.361 10.2681L146.124 24.3322Z" fill="url(#paint8_linear_2302_47705)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M146.124 24.3322C146.883 25.7082 148.834 25.7827 149.696 24.4687L157.736 12.2167C158.588 10.9174 157.773 9.17537 156.229 8.99833L140.426 7.18626C138.741 6.99307 137.542 8.78343 138.361 10.2681L146.124 24.3322Z" fill="url(#paint9_linear_2302_47705)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M147.29 21.9765L146.577 23.049C146.287 23.4836 145.641 23.4568 145.388 22.9999L146.124 24.3324C146.255 24.57 146.422 24.7688 146.612 24.9283L146.612 24.9282C147.524 25.6925 148.982 25.5558 149.696 24.4687L157.736 12.2167C158.588 10.9174 157.772 9.17539 156.228 8.99836L140.426 7.18626C138.741 6.9931 137.542 8.78346 138.361 10.2681L138.424 10.3811L151.874 11.9374C152.731 12.0366 153.184 13.0043 152.71 13.7257L147.29 21.9765Z" fill="url(#paint10_linear_2302_47705)"/>
<defs>
<linearGradient id="paint0_linear_2302_47705" x1="21.1305" y1="16.0853" x2="16.5321" y2="-3.54607" gradientUnits="userSpaceOnUse">
<stop stop-color="#E2DBFF"/>
<stop offset="1" stop-color="#6D4AFF"/>
</linearGradient>
<linearGradient id="paint1_linear_2302_47705" x1="32.2319" y1="34.9858" x2="16.5393" y2="1.46296" gradientUnits="userSpaceOnUse">
<stop offset="0.271019" stop-color="#E2DBFF"/>
<stop offset="1" stop-color="#6D4AFF"/>
</linearGradient>
<linearGradient id="paint2_linear_2302_47705" x1="60.0001" y1="1.81548" x2="61.298" y2="20.2516" gradientUnits="userSpaceOnUse">
<stop offset="0.988738" stop-color="#6D4AFF"/>
</linearGradient>
<radialGradient id="paint3_radial_2302_47705" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(63.4494 0.0669251) rotate(110.421) scale(27.2247 36.2787)">
<stop offset="0.556057" stop-color="#54B7FF" stop-opacity="0"/>
<stop offset="0.994421" stop-color="#54B7FF"/>
</radialGradient>
<linearGradient id="paint4_linear_2302_47705" x1="69.5266" y1="16.6837" x2="57.6142" y2="0.25498" gradientUnits="userSpaceOnUse">
<stop stop-color="#C8E8FF"/>
<stop offset="0.307532" stop-color="#BDAEFF"/>
<stop offset="1" stop-color="#6D4AFF"/>
</linearGradient>
<linearGradient id="paint5_linear_2302_47705" x1="104.015" y1="-0.798116" x2="105.578" y2="21.2045" gradientUnits="userSpaceOnUse">
<stop offset="0.988738" stop-color="#6D4AFF"/>
</linearGradient>
<radialGradient id="paint6_radial_2302_47705" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(110.469 0.333684) rotate(116.076) scale(29.0915 45.26)">
<stop offset="0.556057" stop-color="#FF62C0" stop-opacity="0"/>
<stop offset="0.994421" stop-color="#FF62C0"/>
</radialGradient>
<linearGradient id="paint7_linear_2302_47705" x1="87.1305" y1="4.86974" x2="112.348" y2="32.5799" gradientUnits="userSpaceOnUse">
<stop stop-color="#6D4AFF"/>
<stop offset="0.35934" stop-color="#AE8CFF"/>
<stop offset="1" stop-color="#F8CCFF"/>
</linearGradient>
<linearGradient id="paint8_linear_2302_47705" x1="149.077" y1="-3.88232" x2="149.757" y2="19.2346" gradientUnits="userSpaceOnUse">
<stop offset="0.988738" stop-color="#6D4AFF"/>
</linearGradient>
<linearGradient id="paint9_linear_2302_47705" x1="149.21" y1="-0.682113" x2="143.559" y2="23.6447" gradientUnits="userSpaceOnUse">
<stop offset="0.47989" stop-color="#24ECC6" stop-opacity="0"/>
<stop offset="0.994421" stop-color="#24ECC6"/>
</linearGradient>
<linearGradient id="paint10_linear_2302_47705" x1="151.078" y1="26.3101" x2="138.551" y2="4.88666" gradientUnits="userSpaceOnUse">
<stop offset="0.0660125" stop-color="#ABFFEF"/>
<stop offset="0.44988" stop-color="#CAC9FF"/>
<stop offset="1" stop-color="#6D4AFF"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 937 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 213 KiB

View File

@ -112,10 +112,9 @@ func (f *FrontendQt) setShowSplashScreen() {
return return
} }
// Current splash screen contains update on "What's new" in facelift. // Current splash screen contains update on rebranding. Therefore, it
// Therefore, it should be shown only if the last used version was less // should be shown only if the last used version was less than 2.2.0.
// than 1.9.0. if ver.LessThan(semver.MustParse("2.2.0")) {
if ver.LessThan(semver.MustParse("1.9.0")) {
f.qml.SetShowSplashScreen(true) f.qml.SetShowSplashScreen(true)
} }
} }

View File

@ -77,12 +77,14 @@ func (f *FrontendQt) changeLocalCache(enableDiskCache bool, diskCachePath *core.
func (f *FrontendQt) setIsAutostartOn() { func (f *FrontendQt) setIsAutostartOn() {
// GODT-1507 Windows: autostart needs to be created after Qt is initialized. // GODT-1507 Windows: autostart needs to be created after Qt is initialized.
// GODT-1206: if preferences file says it should be on enable it here.
f.firstTimeAutostart.Do(func() { f.firstTimeAutostart.Do(func() {
if !f.bridge.IsFirstStart() { shouldAutostartBeOn := f.settings.GetBool(settings.AutostartKey)
return if f.bridge.IsFirstStart() || shouldAutostartBeOn {
}
if err := f.bridge.EnableAutostart(); err != nil { if err := f.bridge.EnableAutostart(); err != nil {
f.log.WithError(err).Error("Failed to enable autostart") f.log.WithField("prefs", shouldAutostartBeOn).WithError(err).Error("Failed to enable first autostart")
}
return
} }
}) })
f.qml.SetIsAutostartOn(f.bridge.IsAutostartEnabled()) f.qml.SetIsAutostartOn(f.bridge.IsAutostartEnabled())

View File

@ -15,16 +15,22 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>. // along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
//go:build darwin
// +build darwin // +build darwin
package keychain package keychain
import ( import (
"fmt" "fmt"
"os"
"strings" "strings"
) )
// hostURL uniquely identifies the app's keychain items within the system keychain. // hostURL uniquely identifies the app's keychain items within the system keychain.
func hostURL(keychainName string) string { func hostURL(keychainName string) string {
// Skip when it was in-app update and not manual
if path, err := os.Executable(); err == nil && strings.Contains(path, "ProtonMail Bridge") {
return fmt.Sprintf("ProtonMail%vService", strings.Title(keychainName))
}
return fmt.Sprintf("Proton Mail %v", strings.Title(keychainName)) return fmt.Sprintf("Proton Mail %v", strings.Title(keychainName))
} }

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (c) 2022 Proton Technologies AG # Copyright (c) 2022 Proton AG
# #
# This file is part of Proton Mail Bridge. # This file is part of Proton Mail Bridge.
# #