sohsatoh / ReProvision-Reborn

On-device signing utility for iOS
GNU Affero General Public License v3.0
100 stars 13 forks source link

Background crash on 0.8.2 #16

Closed nomakewan closed 2 years ago

nomakewan commented 2 years ago

Describe the bug Woke up today to find a crash report via cr4shed that appears to have been triggered when the app intended to resign unc0ver. I do not have the beta "True Background Signing" enabled, so this would normally cause a pop-up notification stating that I must unlock my iPhone in order to resign unc0ver. Instead, the application crashed, and unlocking the device did not initiate automatic resigning as normal. I was able to open the application and sign unc0ver by pressing the 'Sign' button without issue. I have attached the crash log to this post.

To Reproduce Steps to reproduce the behavior:

  1. Set time to re-sign as low as possible.
  2. Make sure iDevice is locked.
  3. Wait for timer to expire.
  4. ReProvision-Reborn will crash in the background.

Expected behavior With true background signing disabled, when the timer expires, a notification should trigger telling the user to unlock their device so that the automatic resigning can begin. Upon unlocking, automatic resigning should initiate without further user interaction.

Device (please complete the following information):

Additional context reprovisioncrash.log

markdesilva commented 2 years ago

Same problem, Signing manually has no issues, but background signing crashes.

Using Cr4shed shows that the reason for my crash on this iphone7 Plus is:

"Collection <__NSArrayM: 0x28325d740> was mutated while being enumerated"

On my iphone 6s plus, the error is:

"Collection <__NSArrayM: 0x283fb3f60> was mutated while being enumerated"

However background signing works fine on my ipad mini 4, no issues whatsoever.

Automatic resign is set for when 6 days left. True backgruond re-sign is on. Force resign is on. Re-sign in low power mode is on.

For all 3 devices. All 3 devices have almost identical cydia tweaks as well.

Thanks!

sohsatoh commented 2 years ago

Hi, I've noticed the problem and am in the process of fixing it. The fix will be committed to the development branch, but if you guys don't mind, could you try a debug build after the fix?

nomakewan commented 2 years ago

That should be fine. Simple as removing the tweak from Cydia and then installing the debug build using dpkg in the terminal, I assume?

sohsatoh commented 2 years ago

@nomakewan I just uploaded the debug build to my personal repository. So, you can install it from any package manager:)

Repo: https://repo.satoh.dev/

nomakewan commented 2 years ago

I've got the debug build installed now, and have set refresh down to 6 days. I'll let it cycle through a few days in a row to make sure the crash is squashed. Thanks!

markdesilva commented 2 years ago

Debug build installed, 2 hours left till it refreshes. Will let you know what happens. Thanks.

markdesilva commented 2 years ago

Hi, an update. It resigned on the first day, but only after I unlocked my phone.

2nd day it didn't sign. Even after unlocking my phone it didn't sign. Its now at 5 days 22 hours. No signing initiated at all.

Thanks.

nomakewan commented 2 years ago

I updated to 0.8.3debug4 and left my phone alone, locked, and set to resign at 6 days. unc0ver never showed up in the "expiring soon" list as it approached that time. It is now at 5 days 23 hours, and still not due for re-signing. Additionally, after re-launching Reprovision, I got a notification that 0.8.3debug4 was available on the debug repo, but I am already running 0.8.3debug4.

sohsatoh commented 2 years ago

You can see next fire date on ReProvision Reborn.

nomakewan commented 2 years ago

Indeed. It states the next fire date is in 30 minutes from right now. I will update at that time. Interesting though that unc0ver still does not appear in the "expiring soon" list, though. Perhaps this is based on the actual closeness to the real expiration, and not how close the app is to the user-specified resign period?

nomakewan commented 2 years ago

Update: No notification appeared on my home screen asking to unlock my device, nor did the application crash. When I unlocked my device just now (roughly 40 minutes after the fire date), Reprovision signed the app in the background successfully without interaction.

markdesilva commented 2 years ago

Same thing happened here. No notice to unlock, no resigning. I unlocked my phone to do something and after a while I got message from Reprovision Reborn that my uc0ver was signed.

How exactly is the "true background signing" supposed to work?

Update: No notification appeared on my home screen asking to unlock my device, nor did the application crash. When I unlocked my device just now (roughly 40 minutes after the fire date), Reprovision signed the app in the background successfully without interaction.

sohsatoh commented 2 years ago

Seems like "true background signing" is buggy. It does not works as the private API header describes.

I can think of several other ways, all of which will have an impact on the battery. I'm still trying to work out what to do.

nomakewan commented 2 years ago

As a reminder, I am not using True Background Signing as it was marked as a beta feature, so I kept it disabled. For me, I'm simply used to seeing the "Unlock device to sign application" notification on my lockscreen. Since the application is no longer crashing for me, that notification not firing off appears to be the only bug remaining as far as my original bug report goes.

markdesilva commented 2 years ago

I'm ok with the battery impact actually, unless its going to be a drain of more than 10% extra. Thanks.

Seems like "true background signing" is buggy. It does not works as the private API header describes.

I can think of several other ways, all of which will have an impact on the battery. I'm still trying to work out what to do.

sohsatoh commented 2 years ago

Okay. Looks like crash itself is fixed so I will close this issue. Please open another issue for true background resign.