mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
[AltPlugin] Fixes crash when device’s serial number is nil
For unknown reasons, AKDevice.serialNumber can sometimes return nil. As a workaround, we just fall back to a hardcoded valid serial number if AKDevice.serialNumber is nil.
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
@interface AKDevice
|
@interface AKDevice
|
||||||
+ (AKDevice *)currentDevice;
|
+ (AKDevice *)currentDevice;
|
||||||
- (NSString *)uniqueDeviceIdentifier;
|
- (NSString *)uniqueDeviceIdentifier;
|
||||||
- (NSString *)serialNumber;
|
- (nullable NSString *)serialNumber;
|
||||||
- (NSString *)serverFriendlyDescription;
|
- (NSString *)serverFriendlyDescription;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
localUserID:headers[@"X-Apple-I-MD-LU"]
|
localUserID:headers[@"X-Apple-I-MD-LU"]
|
||||||
routingInfo:[headers[@"X-Apple-I-MD-RINFO"] longLongValue]
|
routingInfo:[headers[@"X-Apple-I-MD-RINFO"] longLongValue]
|
||||||
deviceUniqueIdentifier:device.uniqueDeviceIdentifier
|
deviceUniqueIdentifier:device.uniqueDeviceIdentifier
|
||||||
deviceSerialNumber:device.serialNumber
|
deviceSerialNumber:device.serialNumber ?: @"C02LKHBBFD57" // serialNumber can be nil, so provide valid fallback serial number.
|
||||||
deviceDescription:device.serverFriendlyDescription
|
deviceDescription:device.serverFriendlyDescription
|
||||||
date:date
|
date:date
|
||||||
locale:[NSLocale currentLocale]
|
locale:[NSLocale currentLocale]
|
||||||
|
|||||||
Reference in New Issue
Block a user