-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Base64 hardcoded icons in binary files #653
Conversation
@BlueManCZ I think @bilelmoussaoui mean why you not use built-in module for asar? |
@varlesh I know. I will look into that. But that work with offset seemed to me brutal OP yesterday. Are there any other applications, that use base64 icon, or we know only about Slack at the moment? |
as i know this app use base64: |
located on app/resources/icon.png.data
|
Alright. But there seems to be no replacement in Papirus nor Numix. |
@BlueManCZ If you want only test it replace another already exist tray icon name. |
Icon blurred, but it's worked nozbe.json:
Added to Papirus... |
@varlesh Yes, worked for me as well. Do you have Slack icon blurred too? |
@BlueManCZ No, Slack draw fine. But i'm only change file path to |
@varlesh Do you know what can cause this? With Papirus theme, the icon seems smaller compared to others. All Papirus icons are affected. |
Can it be caused by different svg format? Numix: Papirus: |
By default on appindicator used 16px... But i'm recommend use patched version with change size to 22px - it's initially standart for Unity. |
patched version: |
The patched version is great, but it doesn't help with the problem, that Papirus icons are smaller than Numix icons. |
@BlueManCZ Set 22px it's looking better. |
@varlesh I guess this works when you have all icons from Papirus. Problem is, I have only the first 2 icons from Papirus (they look smaller). Rest of them is Numix or default hardcoded. And Numix seems to work better with 16px while Papirus with 22px. |
@bilelmoussaoui I just figured out, that in order to actually find a file in Slack's .asar archive, I have to use a slightly modified path: reduce(lambda d, k: d[k], 'files/dist/files/main.bundle.js'.split('/'), asar._header) Hardcode-Tray/HardcodeTray/utils.py Line 231 in 3154427
The real file path in the extracted archive is: I was wondering if it couldn't be related to #637 and #646. Edit:
|
Thanks! |
Keep in mind this needs testing and somebody familiar with project structure should do a review and probably completely rewrite some parts to keep code project-friendly. There is also no error handling.
It also needs optimization. The binary file is currently extracted and packed multiple times, depending on "icons" key in .json database file, so it takes several seconds.
I tested it with multiple versions of Slack and didn't encounter any problem.
The solution I used requires installed npx. (on Ubuntu/Debian
sudo apt install npm
)Closes: #605