-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
439 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,3 @@ | ||
# Proton Desktop for Linux arm64 (unofficial) | ||
|
||
Proton Desktop is an [Electron](https://electronjs.org)-based project that offers a native desktop experience for Proton Mail and Proton Calendar. | ||
|
||
This repo is a mirror of official proton mail desktop app hosted in: https://github.com/ProtonMail/inbox-desktop | ||
|
||
I am offering the Linux arm64 rpm version of the app so distros like Fedora Asahi and others are able to use the app until proton team release arm64 version for linux out of the box. | ||
|
||
<p align="center"> | ||
<img src="assets/icons/icon.png" width="256" height="256"> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
{ | ||
"name": "proton-mail", | ||
"productName": "Proton Mail", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"icon": "assets/icons/icon.png", | ||
"description": "Proton official desktop application for Proton Mail and Proton Calendar", | ||
"license": "GPL-3.0", | ||
"author": { | ||
"name": "Proton", | ||
"url": "https://proton.me", | ||
"email": "[email protected]" | ||
}, | ||
"config": { | ||
"appBundleId": "ch.protonmail.desktop", | ||
"appUserModelId": "com.squirrel.proton_mail.ProtonMail", | ||
"copyright": "Copyright (c) 2024, Proton AG <[email protected]>", | ||
"githubUser": "ProtonMail", | ||
"githubRepo": "inbox-desktop" | ||
}, | ||
"main": ".webpack/main", | ||
"scripts": { | ||
"start": "electron-forge start", | ||
|
@@ -19,11 +32,6 @@ | |
"negativity": "electronegativity -i ./src", | ||
"create-uninstaller": "appify ./src/macos/uninstall.sh './src/macos/Proton Mail Uninstaller.app' ./assets/icons/uninstaller.png" | ||
}, | ||
"keywords": [], | ||
"author": { | ||
"name": "Proton" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@doyensec/electronegativity": "^1.10.3", | ||
"@electron-forge/cli": "^7.3.0", | ||
|
@@ -37,6 +45,7 @@ | |
"@electron-forge/plugin-webpack": "^7.3.0", | ||
"@electron-forge/publisher-github": "^7.3.0", | ||
"@electron/fuses": "^1.7.0", | ||
"@types/node": "^20", | ||
"@typescript-eslint/eslint-plugin": "^7.1.0", | ||
"@typescript-eslint/parser": "^7.1.0", | ||
"@vercel/webpack-asset-relocator-loader": "1.7.3", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
declare global { | ||
// eslint-disable-next-line no-var | ||
var oauthProcess: boolean; | ||
// eslint-disable-next-line no-var | ||
var subscriptionProcess: boolean; | ||
} | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,83 @@ | ||
import { ipcMain, shell } from "electron"; | ||
import { IpcMainEvent, ipcMain, shell } from "electron"; | ||
import { saveTrialStatus } from "../store/trialStore"; | ||
import { clearStorage } from "../utils/helpers"; | ||
import { setTrialEnded, updateView } from "../utils/view/viewManagement"; | ||
import { refreshHiddenViews, setTrialEnded, updateView } from "../utils/view/viewManagement"; | ||
import { handleIPCBadge, resetBadge, showNotification } from "./notification"; | ||
import Logger from "electron-log"; | ||
import { DESKTOP_FEATURES, IPCClientUpdateMessage, IPCGetInfoMessage } from "./ipcConstants"; | ||
import { getTheme, setTheme } from "../utils/themes"; | ||
|
||
function isValidClientUpdateMessage(message: unknown): message is IPCClientUpdateMessage { | ||
return Boolean(message && typeof message === "object" && "type" in message && "payload" in message); | ||
} | ||
|
||
export const handleIPCCalls = () => { | ||
ipcMain.on("updateNotification", (_e, count: number) => { | ||
handleIPCBadge(count); | ||
}); | ||
ipcMain.on("userLogout", () => { | ||
clearStorage(true, 500); | ||
resetBadge(); | ||
}); | ||
ipcMain.on("clearAppData", () => { | ||
clearStorage(true, 500); | ||
resetBadge(); | ||
ipcMain.on("hasFeature", (event: IpcMainEvent, message: keyof typeof DESKTOP_FEATURES) => { | ||
event.returnValue = !!DESKTOP_FEATURES[message]; | ||
}); | ||
ipcMain.on("oauthPopupOpened", (_e, payload) => { | ||
global.oauthProcess = payload === "oauthPopupStarted"; | ||
}); | ||
ipcMain.on("openExternal", (_e, url) => { | ||
shell.openExternal(url); | ||
}); | ||
ipcMain.on("trialEnd", (_e, payload) => { | ||
saveTrialStatus(payload); | ||
|
||
if (payload === "trialEnded") { | ||
setTrialEnded(); | ||
ipcMain.on("getInfo", (event: IpcMainEvent, message: IPCGetInfoMessage["type"]) => { | ||
switch (message) { | ||
case "theme": | ||
event.returnValue = getTheme(); | ||
break; | ||
default: | ||
Logger.error(`Invalid getInfo message: ${message}`); | ||
break; | ||
} | ||
}); | ||
ipcMain.on("changeView", (_e, target) => { | ||
updateView(target); | ||
}); | ||
ipcMain.on("showNotification", (_e, payload) => { | ||
showNotification(payload); | ||
|
||
ipcMain.on("clientUpdate", (_e, message: unknown) => { | ||
if (!isValidClientUpdateMessage(message)) { | ||
Logger.error(`Invalid clientUpdate message: ${message}`); | ||
return; | ||
} | ||
|
||
const { type, payload } = message; | ||
|
||
switch (type) { | ||
case "updateNotification": | ||
handleIPCBadge(payload); | ||
break; | ||
case "userLogout": | ||
clearStorage(true, 500); | ||
resetBadge(); | ||
break; | ||
case "clearAppData": | ||
clearStorage(true, 500); | ||
resetBadge(); | ||
break; | ||
case "oauthPopupOpened": | ||
global.oauthProcess = payload === "oauthPopupStarted"; | ||
break; | ||
case "subscriptionModalOpened": | ||
global.subscriptionProcess = payload === "subscriptionModalStarted"; | ||
break; | ||
case "openExternal": | ||
shell.openExternal(payload); | ||
break; | ||
case "trialEnd": | ||
saveTrialStatus(payload); | ||
|
||
if (payload === "trialEnded") { | ||
setTrialEnded(); | ||
} | ||
break; | ||
case "changeView": | ||
updateView(payload); | ||
break; | ||
case "showNotification": | ||
showNotification(payload); | ||
break; | ||
case "updateLocale": | ||
refreshHiddenViews(); | ||
break; | ||
case "setTheme": | ||
setTheme(payload); | ||
break; | ||
default: | ||
Logger.error(`unknown message type: ${type}`); | ||
break; | ||
} | ||
}); | ||
}; |
Oops, something went wrong.