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

Fix the crash of -[NSNull _fastCStringContents:] #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dreampiggy
Copy link

@dreampiggy
Copy link
Author

dreampiggy commented Jun 27, 2020

Some API break changes in the master vs the commit AltStore used. Please pay attention:

-- (instancetype)initWithName:(NSString *)name identifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithName:(NSString *)name identifier:(NSString *)identifier type:(ALTDeviceType)type NS_DESIGNATED_INITIALIZER;

Comment on lines +19 to +20
@property (nonatomic, copy, nullable) id machineName;
@property (nonatomic, copy, nullable) id machineIdentifier;
Copy link
Owner

@rileytestut rileytestut Aug 31, 2020

Choose a reason for hiding this comment

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

Changing these property types from NSString (which it should be) to id doesn't really seem to address the underlying issue, which is that when parsing certificates the machineName and machineIdentifier keys might be "null" (from what I understand). Plus, this makes working with this library from Swift much more frustrating due to type erasure.

Copy link
Author

Choose a reason for hiding this comment

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

This API is from Apple, they use NSNull. You have to do compatible hack...
If I'm the author of Apple's Private Framework, I will not use suck a hack logic (return NSNull instead of nil)

Copy link
Owner

Choose a reason for hiding this comment

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

I understand, but it'd be better to update -[ALTCertificate initWithResponseDictionary:] to explicitly check for NULL values and assign nil instead to those properties, rather than assign the NSNull object directly and change the public API.

@dreampiggy
Copy link
Author

Any update ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants