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

Build packages with finalpackage and include rootful package #1

Merged
merged 3 commits into from
Dec 27, 2023

Conversation

tulir
Copy link
Member

@tulir tulir commented Dec 20, 2023

No description provided.

run: make package
run: |
export PACKAGE_BUILDNAME=$(git rev-parse --short HEAD)-rootless
make package THEOS_PACKAGE_SCHEME=rootless FINALPACKAGE=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason that we have yet to understand, this package doesn't seem to work on any of our test devices when we build with FINALPACKAGE=1. Have you tested that this works on one of your test devices with that option enabled?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI when toggling between compiling for rootful and rootless, you need to make clean instead of just making the package. For instance, this is how I compile for both rootful and rootless in my jailbreak tweaks:

For rootful:

make clean package FINALPACKAGE=1 

For rootless:

make clean package THEOS_PACKAGE_SCHEME=rootless FINALPACKAGE=1

This may or not be the issue. I'm putting this out there since it stumped me for a while too. If you do not make clean in between switching the target scheme, the tweak will not function on device. Hope this helps.

Copy link

@reese-allison reese-allison Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you able to successfully run this tweak on a rootful device? I tried doing exactly as you suggested, cleaning and removing the rootless variable and I cannot get it to work on checkra1n iOS 12

@Limekiller
Copy link

Limekiller commented Dec 22, 2023

I was able to build for rootful and get it working. I made the changes to the Makefile described here: /~https://github.com/ThatStella7922/phone-registration-provider , which allowed the package to install (using a 5S 12.5.7 with Chimera). At first I wasn't getting a registration code and it wasn't creating the beepserv_state file. I found out that this was because it never got past the conditional at 418 of Tweak.x, so I commented out lines 414-419 and re-built the package (super cludgy, I know). This worked though! By watching the oslog I was able to see the registration code and get registered with Beeper Mini. So it seems to me (someone who is brand new to jailbreaking and all of this) that the Makefile needs to be updated in order to allow the built package to install on rootful, and also the conditional in Tweak.x needs to be investigated as it seems to always evaluate to true in some cases causing the function to return even when it shouldn't. I had to remove it in order for the tweak to work for me.

I played around with this more and the issue is not with the conditional, but that the function can't write to .beepserv_state when triggered by identityservicesd, but CAN when triggered by Settings -- so when the function is triggered by Settings without this conditional in place, that is what allows the state file to get written to, therefore allowing Settings to display a code in the UI. The actual fix here isn't with the conditional but in figuring out how to allow the function to write to the state file when triggered by identityservicesd (and I think this should be fixed by #16, but I haven't tested it).

In light of this, I tested restarting identityservicesd while watching the logs in order to get the code, manually updating the state file with said code and secret, and replacing the package with a version that has the conditional in place, so the state file wouldn't keep getting overwritten by the Settings app (which produces a different code than identityservicesd). This should replicate the behavior of the original tweak, but I still am unable to send iMessages, only receive, and even that only for a little bit before getting unregistered -- so the same behavior as before. At this point I think the only thing to do is wait to see if this gets ironed out by Beeper in the next few weeks.

@reese-allison
Copy link

I was able to build for rootful and get it working. I made the changes to the Makefile described here: ThatStella7922/phone-registration-provider , which allowed the package to install (using a 5S 12.5.7 with Chimera). At first I wasn't getting a registration code and it wasn't creating the beepserv_state file. I found out that this was because it never got past the conditional at 418 of Tweak.x, so I commented out lines 414-419 and re-built the package (super cludgy, I know). This worked though! By watching the oslog I was able to see the registration code and get registered with Beeper Mini. So it seems to me (someone who is brand new to jailbreaking and all of this) that the Makefile needs to be updated in order to allow the built package to install on rootful, and also the conditional in Tweak.x needs to be investigated as it seems to always evaluate to true in some cases causing the function to return even when it shouldn't. I had to remove it in order for the tweak to work for me.

I was able to pull the registration code from the logs, so this worked for me on an iPhone 6. Thanks @Limekiller!

@Hellohi3654
Copy link

I was able to build for rootful and get it working. I made the changes to the Makefile described here: /~https://github.com/ThatStella7922/phone-registration-provider , which allowed the package to install (using a 5S 12.5.7 with Chimera). At first I wasn't getting a registration code and it wasn't creating the beepserv_state file. I found out that this was because it never got past the conditional at 418 of Tweak.x, so I commented out lines 414-419 and re-built the package (super cludgy, I know). This worked though! By watching the oslog I was able to see the registration code and get registered with Beeper Mini. So it seems to me (someone who is brand new to jailbreaking and all of this) that the Makefile needs to be updated in order to allow the built package to install on rootful, and also the conditional in Tweak.x needs to be investigated as it seems to always evaluate to true in some cases causing the function to return even when it shouldn't. I had to remove it in order for the tweak to work for me.

Tried this but failed with this error

Dec 23 21:07:53 iPhone-5S Preferences[2210] <Notice>: [TweakInject] Injecting /usr/lib/TweakInject/beepserv.dylib into com.apple.Preferences
Dec 23 21:07:53 iPhone-5S kernel_task[0] <Notice>: AMFI: '/usr/lib/TweakInject/beepserv.dylib' has no CMS blob?
Dec 23 21:07:53 iPhone-5S kernel_task[0] <Notice>: AMFI: '/usr/lib/TweakInject/beepserv.dylib': Unrecoverable CT signature issue, bailing out.
Dec 23 21:07:53 iPhone-5S kernel_task[0] <Notice>: AMFI: code signature validation failed.
Dec 23 21:07:53 iPhone-5S Preferences[2210] <Notice>: [TweakInject] FALIURE: 'dlopen(/usr/lib/TweakInject/beepserv.dylib, 9): no suitable image found.  Did find:
        /usr/lib/TweakInject/beepserv.dylib: code signature invalid for '/usr/lib/TweakInject/beepserv.dylib'

@reese-allison
Copy link

Now that it's working, it deregisters after a few minutes. It keeps saying to sign back into Apple on Beeper mini and my phone number leaves my account.

@Limekiller
Copy link

@reese-allison It seems that users on supported devices are facing that too. fwiw, mine was doing that all of yesterday until late in the evening, but since then I haven't had to re-sign in.

@Hellohi3654
Copy link

I was able to build for rootful and get it working. I made the changes to the Makefile described here: /~https://github.com/ThatStella7922/phone-registration-provider , which allowed the package to install (using a 5S 12.5.7 with Chimera). At first I wasn't getting a registration code and it wasn't creating the beepserv_state file. I found out that this was because it never got past the conditional at 418 of Tweak.x, so I commented out lines 414-419 and re-built the package (super cludgy, I know). This worked though! By watching the oslog I was able to see the registration code and get registered with Beeper Mini. So it seems to me (someone who is brand new to jailbreaking and all of this) that the Makefile needs to be updated in order to allow the built package to install on rootful, and also the conditional in Tweak.x needs to be investigated as it seems to always evaluate to true in some cases causing the function to return even when it shouldn't. I had to remove it in order for the tweak to work for me.

Got it working with this method on my iPhone 5s running 12.5.7 with Chimera

Except after I try and login on Beeper Cloud it gives this error

Login failed: RegisterIDS failed: failed to fetch validation data: Couldn't retrieve validation data: Error Domain=com.beeper.beepserv Code=2 "(null)" UserInfo={Error Reason=No account had a valid registration}

Does it not work with Beeper Cloud?
Can't use Beeper Mini have the Google sign in error which I can't fix

@jawshoeadan
Copy link

jawshoeadan commented Dec 25, 2023

I was able to build for rootful and get it working. I made the changes to the Makefile described here: /~https://github.com/ThatStella7922/phone-registration-provider , which allowed the package to install (using a 5S 12.5.7 with Chimera). At first I wasn't getting a registration code and it wasn't creating the beepserv_state file. I found out that this was because it never got past the conditional at 418 of Tweak.x, so I commented out lines 414-419 and re-built the package (super cludgy, I know). This worked though! By watching the oslog I was able to see the registration code and get registered with Beeper Mini. So it seems to me (someone who is brand new to jailbreaking and all of this) that the Makefile needs to be updated in order to allow the built package to install on rootful, and also the conditional in Tweak.x needs to be investigated as it seems to always evaluate to true in some cases causing the function to return even when it shouldn't. I had to remove it in order for the tweak to work for me.

I'm having issues building. Did you build this PR or main? Also, do you happen to have a pre-compiled deb you could share?

Edit: Nvm I got it! if anyone needs the deb here it is: com.beeper.beepserv_0.1.1-2+debug_iphoneos-arm.deb.zip

@Hellohi3654
Copy link

I was able to build for rootful and get it working. I made the changes to the Makefile described here: /~https://github.com/ThatStella7922/phone-registration-provider , which allowed the package to install (using a 5S 12.5.7 with Chimera). At first I wasn't getting a registration code and it wasn't creating the beepserv_state file. I found out that this was because it never got past the conditional at 418 of Tweak.x, so I commented out lines 414-419 and re-built the package (super cludgy, I know). This worked though! By watching the oslog I was able to see the registration code and get registered with Beeper Mini. So it seems to me (someone who is brand new to jailbreaking and all of this) that the Makefile needs to be updated in order to allow the built package to install on rootful, and also the conditional in Tweak.x needs to be investigated as it seems to always evaluate to true in some cases causing the function to return even when it shouldn't. I had to remove it in order for the tweak to work for me.

I'm having issues building. Did you build this PR or main? Also, do you happen to have a pre-compiled deb you could share?

Edit: Nvm I got it! if anyone needs the deb here it is: com.beeper.beepserv_0.1.1-2+debug_iphoneos-arm.deb.zip

You can also grab my build from the actions on my fork
/~https://github.com/Hellohi3654/phone-registration-provider/actions/runs/7305765101

@Limekiller
Copy link

For anyone subscribed to this PR that saw my original comment, check out my edit -- instead of removing the conditional I'd suggest trying #16 instead. I think this might fix the underlying issue with the code not appearing in the Settings app (although you'll still need to make the Makefile changes. Also, I haven't actually tested it myself.)

@itsjunetime
Copy link
Contributor

Thanks all for your comments! I'll merge this in now so that we can get rootful builds going, and I'll start taking a look at the other mentioned issues. If you have more to say on any other specific issues mentioned here, please keep your comments to those specific issues so that it's easier to track them.

@itsjunetime itsjunetime merged commit 1215621 into main Dec 27, 2023
@itsjunetime itsjunetime deleted the tulir/build-rootful branch December 27, 2023 18:09
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.

7 participants