Skip to content
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

Universal app support (new proposal) #456

Merged
merged 11 commits into from
Oct 1, 2021

Conversation

overcurrent
Copy link
Contributor

@overcurrent overcurrent commented Sep 19, 2021

Proposal to add universal app support.

The built dmg and app work on my machine in native (arm64) and Rosetta (Intel emulation) modes including features that require iohook module.

Test package here: https://github.com/overcurrent/razer-macos/releases/download/v0.4.5%2B_universal_app/Razer.macOS-0.4.5-universal.dmg

Please give feedback how this works on your setup.

You can clone this branch by: git clone --recursive --branch universal-app-support https://github.com/overcurrent/razer-macos.git

Build using either:

  1. 'yarn' and 'yarn dist'
    or
  2. edit release.sh to add Apple Dev credentials (if applicable), then run './release.sh' in cloned root folder

@1kc
Copy link
Owner

1kc commented Sep 19, 2021

Works for me! Assume it works for M1 too, this and the other PR can be merged then?

@overcurrent
Copy link
Contributor Author

overcurrent commented Sep 19, 2021

Hi, that’s great news @1kc
Yes it works on M1 too natively.

Merging this PR is enough to fix cross-compilation and add universal app support. This means that PR #451 and #455 can be ignored.

After you merge this PR I would suggest you to make a fork of iohook repository (https://github.com/wilix-team/iohook) yourself and point the submodule iohook to your forked repository instead of mine like this:

Step 1:

Go to your forked iohook repository and modify install.js 'downloadUrl' as follows:

let downloadUrl =
'https://github.com/1kc/iohook/releases/download/v' +
pkgVersion +
'/' +
currentPlatform +
'.tar.gz';

Step 2:

Go back to razer-macos repository and edit .gitmodules and change:
[submodule "iohook"]
path = iohook
url = https://github.com/overcurrent/iohook

to

[submodule "iohook"]
path = iohook
url = https://github.com/1kc/iohook

Then run:
git submodule sync
git submodule update --init --recursive --remote

Create v0.9.3 release to your iohook repository and add there following assets:
https://github.com/overcurrent/iohook/releases/download/v0.9.3/iohook-v0.9.3-electron-v85-darwin-arm64.tar.gz
https://github.com/overcurrent/iohook/releases/download/v0.9.3/iohook-v0.9.3-electron-v85-darwin-x64.tar.gz

Let me know if you need more details @1kc

@overcurrent
Copy link
Contributor Author

@1kc Have you had time to look at this?

@overcurrent
Copy link
Contributor Author

@1kc So how about bringing universal app support for razer-macos? To make things easier you can just merge this PR and I can keep maintaining the iohook fork on my side for now.

@1kc
Copy link
Owner

1kc commented Oct 1, 2021

sorry got caught up a bit. Having a look now @overcurrent

@1kc 1kc merged commit 1deb81c into 1kc:master Oct 1, 2021
@1kc
Copy link
Owner

1kc commented Oct 1, 2021

I've built and ran it on my Intel machine. Works flawlessly!

@1kc
Copy link
Owner

1kc commented Oct 1, 2021

Ive build my unsigned version here, could you let me know if it works? https://a.tmp.ninja/JcyksldQ.dmg

@overcurrent
Copy link
Contributor Author

Ive build my unsigned version here, could you let me know if it works? https://a.tmp.ninja/JcyksldQ.dmg

Hi and thanks @1kc for getting back to this topic.

I could get this to run in both Rosetta layer and native layer (arm64) by approving the app via Security & Privacy.
When I enabled ripple effects for Huntsman (either in Rosetta or arm64 mode) it took me to Security & Privacy settings to grant Accessibility rights for "Razer macOS" as it should but even if I granted the access the ripple effects wouldn't start to work. If I restarted the app it would ask me to grant the permissions again.

I then tried to code sign the app you built using my Developer ID and after that everything started working. My suspicion is that the iohook module is not getting permission from OS X running M1 to do what it wants to do unless the app and its underlying parts are signed by an identified Apple developer.

I will attach link to signed package here later tonight which I built from your upstream master which can be used to provide release package for everybody.

But it's great to know that this build basically does work once signed.

@overcurrent
Copy link
Contributor Author

JCKodel pushed a commit to JCKodel/razer-macos that referenced this pull request Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants