Build from Source
Provisioning profile “iOS Team Provisioning Profile: …” doesn’t support the Associated Domains, Fonts, iCloud, and Push Notifications capability.
Follow the README to build Blink Shell in Xcode. With a free developer account, these entitlements are not supported, and therefore breaks functionality like WebAuthn.
Crash on Start
Crash log contains Termination Reason: SIGNAL 5 Trace/BPT trap: 5
, which indicates that it’s a memory safety issue from programming errors.
On the line where the program crashed, Blink constructs a URL from BlinkPaths.groupContainerPath()
without null-safety checks.
BlinkPaths.groupContainerPath()
in turn calls the containerURLForSecurityApplicationGroupIdentifier
method on the default NSFileManager
, which in iOS, returns nil
when the group identifier invalid for the app, i.e. missing from it’s App Groups Entitlement.
AltStore Modifications
App Groups in Entitlements
AltStore replaces the original app group with a new one to workaround Apple’s restrictions. In func updateAppGroups
, each app group identifier is appended with a .
and the team identifier used to sign the app.
File Providers
Any NSExtensionFileProviderDocumentGroup
is rewritten into the new app group as well.
The filter
and min
chain ensures that the shortest matching candidate is found.
App bundle IDs
The parentBundleID
is also modified to include the team ID.
Verification
Crash explicitly and log app group ID on successful invocation.
Before iOS 10, NSLog(@"app group %@ found", groupID);
can be used instead.
Fix
NSString *groupID = [XCConfig infoPlistFullGroupID];
The key used to search for the group’s container directory is BLINK_GROUP_ID
from XCConfig
, which is stored in BlinkConfig/Info.plist
.
You can use the variable TEAM_ID
from the developer_setup.xcconfig
file if you have followed Blink’s guidance on building and installing Blink yourself.
Hardcoding the team ID or modifying Blink’s code to auto-detect the new app group would work as well.
References
- https://developer.apple.com/documentation/xcode/identifying-the-cause-of-common-crashes#Determine-whether-the-crash-is-a-Swift-runtime-error
- https://github.com/blinksh/blink/blob/77d3cec7ff7dc7f2389d372d1d10dba9b9d6aaec/Blink/Migrator/Migrator.swift#L42
- https://github.com/altstoreio/AltStore/blob/7d7e098ef5e48fe346430e068271d1b1ae49817b/AltServer/Devices/ALTDeviceManager%2BInstallation.swift#L849
- https://stackoverflow.com/a/45957891