bilelmoussaoui / Hardcode-Tray

Fixes Hardcoded tray icons in Linux
Other
861 stars 63 forks source link

Fix crash when calculating Asar file content offsets #711

Closed acarasimon96 closed 2 years ago

acarasimon96 commented 2 years ago

Fixes #704, #637, #646

Some Electron apps such as Mattermost Desktop 5.0.0 contain a directory named "offset" in their app.asar files, which is treated in code as a dict of dicts representing files and subdirectories. Hardcode Tray expects a string for actual offset values before recalculating them. This fix adds a check to make sure that it only performs the said action on offset numbers.

However, another bug came up as I completed this. For some reason, Hardcode Tray could no longer find unread and mentioned tray icons for Mattermost Desktop 5.0.0, leaving them intact as a result. This PR is complete once I have a fix for that side effect pushed into this PR and no further side effects appear.

Edit: The side effect was rather caused by typos in the proposed changes to mattermost.electron.json. Details are found in my comment on the mentioned issue.