Skip to content

Latest commit

 

History

History
19 lines (17 loc) · 2.77 KB

HOW THE APP WORKS.MD

File metadata and controls

19 lines (17 loc) · 2.77 KB

How does it works?

1. When starting up the application

  • The app tries to check if there is internet connection by trying to dns resolve threema.ch, else, the app closes itself
  • The app checks then for update using the GitHub Api and prompts the user to update if needed
  • The app tries to connect to Discord RPC to show Rich Presence
  • The app finally checks if there is already another instance of the app running, and closes itself

2. Loading Threema

  • The app will change his user agent. This will allow the Threema For Desktop to show up with a Laptop in your Connected Devices list.
  • Then, Electron will load Threema Web and inject some CSS to hide Threema Web and use Dark Mode if the user have his computer using dark mode.
  • The app patches Notifications used by Therema Web to make them clickable.
  • The app listen to "devtools-open" event to show warning on console about security
  • The app is looking for the user to open "About" window, and patches the window to show Threema For Desktop credits.
  • For getting unread notification badge, you can check here, I get an event when the page title changes, I check how much messages are unread using a regex, then I set application badge with the amount. If we have 9 unread messages or less, app will show the amount. Else, it will show a dot.
  • Finally, the app checks if a user is clicking on a link and open it in the default browser

Remember,

I have no way to read your messages, everything is kept on your mobile phone, and the app is fully open source. You can then just ask your favorite JS/TS Developer to audit the source code. If you enjoy this app, remember to drop a ⭐on the repo