altstoreio / AltStore

AltStore is an alternative app store for non-jailbroken iOS devices.
https://altstore.io
GNU Affero General Public License v3.0
11.39k stars 862 forks source link

Error when sideloading apps (EXC_BAD_ACCESS) #18

Open Smethan opened 4 years ago

Smethan commented 4 years ago

As the title says, whenever I try to sideload an app using the beta, i.e GBA4iOS, Cercube, Rocket for ig, etc., it crashes after around 5 seconds with no communication to AltServer in that time. I can send crash logs, if that would be helpful. As for the device, it's an iPhone XR on iOS 13.1, and all the apps listed above can be sideloaded just fine with impactor

eni9889 commented 4 years ago

This is due to unsigned framework binaries and there is a pending PR to fix it: https://github.com/rileytestut/AltSign/pull/1

Smethan commented 4 years ago

I have tried pulling in your PR and building, now the freshly compiled AltStore just crashes on my phone, says something about a CoreData error

eni9889 commented 4 years ago

Yea same happens to me, don’t know why the PR would cause that will investigate. It’s only an issue on iOS 13 no problems on iOS 12

Smethan commented 4 years ago

Seems like its not an issue with your PR, I built it with a clean pull of the repo and I still got the crash, so it must be something else, and it does seem to be isolated to iOS 13, my iOS 12 device worked fine with it...

eni9889 commented 4 years ago

@Smethan it turns out you need to use Xcode 10.3 to build the project. Xcode 11 has issues.

Smethan commented 4 years ago

Good to know. I’ll build there I suppose

Smethan commented 4 years ago

Alrighty, I've compiled it successfully on Xcode 10.3 and ran it on my phone, it works mostly, but I still get the same EXC_BAD_ACCESS error when trying to sign the same apps

Smethan commented 4 years ago

I've looked into it and apparently its an issue with dereferencing a null pointer at line 79 in ldid.cpp uint32_t data = mach_header.Swap(signature->dataoff); The Xcode static analyzer gave the error "Access to field 'dataoff' results in a dereference of a null pointer (loaded from variable 'signature')"

I don't quite know how I would fix this, as I'm not exactly a C++ developer, but maybe it could help someone else out.

Smethan commented 4 years ago

Update: I bypassed that error by always making signature non-null, but then I got another similar error, so I don't quite know what the real issue here is. Its looking ldid might just have some issues on iOS 13, or just with A12 devices

eni9889 commented 4 years ago

Did you use my branch for both altsign and ldid?

Sent with GitHawk

Smethan commented 4 years ago

Yes. I pulled the regular AltStore repo, deleted the altsign sub module, and then checked yours out along with ldid

Smethan commented 4 years ago

So, it has been a few days, and it seems to me that the Swap() command may be the culprit, as the previous error happened there, and it happens again on the swap command if I bypass that one. I know for a fact that it's a problem within the Entitlements section of the non-dependency ldid, might not be getting the entitlements correctly?