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

Hardcode software_name to "macOS" #11

Closed
wants to merge 1 commit into from
Closed

Conversation

jetfir3
Copy link
Contributor

@jetfir3 jetfir3 commented Dec 29, 2023

  • on macOS 10.15 and earlier, the software_name reports as "Mac OS X" and this breaks reteival of albert push cert causing Beeper Mini to crash after entering registration code.

macOS 11+ reports software_name as "macOS".

With software_name reporting as "Mac OS X" the following error can been seen in logcat:
com.beeper.chat.booper.ipc.BridgeCrashedException: {"level":"fatal","error":"failed to generate albert push certificate: failed to decode device cert","time":"2023-12-28T12:58:40.124078741Z","message":"Failed to configure iMessage"}

Once mac-registration-provider is re-built with the software_name "spoofed" to "macOS", the issue is gone and the app then prompts for Apple ID sign-in.

It may be best to set this hardcoded value on the Beeper/Beeper Mini side of things... but, for now, this specific code change allows Beeper Mini to register while running this binary on macOS 10.15.x.

Additional changes in versions.go for macOS 10.14 and below will be needed as the current error handling with panic causes the binary to fail as the various commands to obtain hardware/software info fail on macOS 10.14 and earlier.

- on macOS 10.15 and earlier, the software_name reports as "Mac OS X" and this breaks reteival of albert push cert causing Beeper Mini to crash after entering registration code.
@jetfir3
Copy link
Contributor Author

jetfir3 commented Dec 29, 2023

The current "quick fix" for 10.14.6 and below (not contained in this PR) is to remove the panic code which allows the binary to continue running -- assuming the correct binary offsets for the macOS version are added as well. I'll be providing offsets for 10.14.6 and 10.15.1-10.15.7 in a PR after I submit this.

The change in this PR DOES allow Catalina to work, with no further changes.

If no one submits a PR to fix handling in 10.14 and below, I'll try to fix it myself when I have a bit more time.

@tulir
Copy link
Member

tulir commented Dec 29, 2023

It might be more correct to fix this hack: https://github.com/beeper/imessage/blob/main/imessage/direct/albert/activationinfo.go#L74, in other places where the software name is used, it's probably actually supposed to be Mac OS X on older versions (definitely wasn't macOS before 11.0)

@jetfir3
Copy link
Contributor Author

jetfir3 commented Dec 29, 2023

Possibly! That line of code would certainly explain things failing, as there was no logic to handle Mac OS X.

I had mentioned this issue and my "workaround" in the pypush discord and another user tried grabbing the cert "manually" while using "Mac OS X" as their DeviceClass and that also failed.. so it's possible it may need something else like Mac OSX or some other variant to satisfy things. I have personally not tested this further than just forcing "mac-registration-provider" to set my deviceclass/software_name to macOS on my 10.14 machine.

jetfir3 added a commit to jetfir3/imessage that referenced this pull request Dec 29, 2023
- this properly addresses the issue first addressed in beeper/mac-registration-provider#11 when using macOS devices prior to Big Sur
@jetfir3
Copy link
Contributor Author

jetfir3 commented Dec 29, 2023

@tulir
I've added a PR to the beeper/imessage repo to address this issue rather than deal with a workaround in this repo.
See here, beeper/imessage#11

and an update to my mention of things not working on 10.14.6 or earlier -- I've realized this is due to system_profiler SPHardwareDataType -json since the -json flag was not added until Catalina. Prior versions only had the -xml option. Not sure of the best way to address this... either switching everything over to -xml or adding a condition if -json is not present.

@jetfir3 jetfir3 closed this Dec 30, 2023
tulir pushed a commit to beeper/imessage that referenced this pull request Jan 9, 2024
- this properly addresses the issue first addressed in beeper/mac-registration-provider#11 when using macOS devices prior to Big Sur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants