Skip to content

Commit

Permalink
Merge branch 'hotfix/7.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljfischer committed May 24, 2021
2 parents 62d1859 + 5a75e1c commit e3160f1
Show file tree
Hide file tree
Showing 29 changed files with 667 additions and 360 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
# Changelog
## 7.1.1
### Versions
* Supports [SDL RPC Spec 7.1.0](https://github.com/smartdevicelink/rpc_spec/releases/tag/7.1.0) and [SDL Protocol Spec 5.4.0](https://github.com/smartdevicelink/protocol_spec/releases/tag/5.4.0).

### Testing
* Xcode 12.5
* iOS 14.5.1
* Core:
* Manticore (Core v7.0.0, Generic HMI v0.9.0)
* Ford Sync 3.4 (19353_DEVTEST)
* Ford Sync 3.0 (17276_DEVTEST)
* Ford Sync 4.0 (20016_DEVTEST)
* Core v6.1.2 with sdl_hmi v5.3.0 and generic_hmi v0.8.1
* Core v7.1.1 with generic_hmi v0.10.0

### Bug Fixes
* Fixed initial StartServiceACK being timed out too soon with many app connections to module (https://github.com/smartdevicelink/sdl_ios/issues/1783, https://github.com/smartdevicelink/sdl_ios/issues/1795, https://github.com/smartdevicelink/sdl_ios/issues/1847)
* Fixed RPC encryption fails when RPCs have multi-frame payloads (https://github.com/smartdevicelink/sdl_ios/issues/1954)
* Fixed a crash when the head unit sends a StartServiceACK to elevate the RPC service to encryption (https://github.com/smartdevicelink/sdl_ios/issues/1966)
* Fixed encrypted RPCs fail without a callback when encryption isn't set up (https://github.com/smartdevicelink/sdl_ios/issues/1971)
* Fixed the file manager not sending images when `ListFiles` is encrypted (https://github.com/smartdevicelink/sdl_ios/issues/1975)

## 7.1.0 (Since RC 1)
### Versions
* Supports [SDL RPC Spec 7.1.0](https://github.com/smartdevicelink/rpc_spec/releases/tag/7.1.0) and [SDL Protocol Spec 5.4.0](https://github.com/smartdevicelink/protocol_spec/releases/tag/5.4.0).
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
.library(name: "SmartDeviceLinkSwift", targets: ["SmartDeviceLinkSwift"])
],
dependencies: [
.package(name: "BiSON", url: "https://github.com/smartdevicelink/bson_c_lib.git", from: "1.2")
.package(name: "BiSON", url: "https://github.com/smartdevicelink/bson_c_lib.git", from: "1.2.0")
],
targets: [
.target(
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink-iOS.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "SmartDeviceLink-iOS"
s.version = "7.1.0"
s.version = "7.1.1"
s.summary = "Connect your app with cars!"
s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS"
s.license = { :type => "New BSD", :file => "LICENSE" }
Expand Down
41 changes: 30 additions & 11 deletions SmartDeviceLink-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,7 @@
88D2AAE41F682BB20078D5B2 /* SDLLogConstantsSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 88D2AAE31F682BB20078D5B2 /* SDLLogConstantsSpec.m */; };
88D79EED255D8D5B005FACB1 /* SDLPresentAlertOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 88D79EEB255D8D5B005FACB1 /* SDLPresentAlertOperation.h */; };
88D79EEE255D8D5B005FACB1 /* SDLPresentAlertOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 88D79EEC255D8D5B005FACB1 /* SDLPresentAlertOperation.m */; };
88D930262630686100DA9E44 /* SDLFileManagerSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D9F50821BEA5C6100FEF399 /* SDLFileManagerSpec.m */; };
88DDD0F9229ECA57002F9623 /* SDLIAPConstantsSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 88DDD0F8229ECA57002F9623 /* SDLIAPConstantsSpec.m */; };
88DF998D22035CC600477AC1 /* EAAccessory+OCMock.m in Sources */ = {isa = PBXBuildFile; fileRef = 88DF998C22035CC600477AC1 /* EAAccessory+OCMock.m */; };
88DF998F22035D1700477AC1 /* SDLIAPSessionSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 88DF998E22035D1700477AC1 /* SDLIAPSessionSpec.m */; };
Expand Down Expand Up @@ -7903,7 +7904,7 @@
TargetAttributes = {
5D4019AE1A76EC350006B0C2 = {
CreatedOnToolsVersion = 6.1.1;
ProvisioningStyle = Manual;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.BackgroundModes = {
enabled = 1;
Expand All @@ -7916,6 +7917,7 @@
5D61FA1B1A84237100846EE7 = {
CreatedOnToolsVersion = 6.1.1;
LastSwiftMigration = 1210;
ProvisioningStyle = Automatic;
};
5D61FA251A84237100846EE7 = {
CreatedOnToolsVersion = 6.1.1;
Expand Down Expand Up @@ -8994,6 +8996,7 @@
162E83791A9BDE8B00906325 /* SDLDeviceStatusSpec.m in Sources */,
162E83821A9BDE8B00906325 /* SDLImageSpec.m in Sources */,
162E834A1A9BDE8B00906325 /* SDLAddSubMenuResponseSpec.m in Sources */,
88D930262630686100DA9E44 /* SDLFileManagerSpec.m in Sources */,
162E830C1A9BDE8B00906325 /* SDLWarningLightStatusSpec.m in Sources */,
881BBF5B255ADB8300761B7E /* SDLAlertViewSpec.m in Sources */,
1EE8C45F1F3884FF00FDC2CF /* SDLSetInteriorVehicleDataSpec.m in Sources */,
Expand Down Expand Up @@ -9375,14 +9378,16 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = NCVC2MHU7M;
INFOPLIST_FILE = "$(SRCROOT)/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 7.1.0;
MARKETING_VERSION = 7.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SDLTestApp;
PRODUCT_NAME = "SDL Example";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
name = Debug;
Expand All @@ -9391,14 +9396,16 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = NCVC2MHU7M;
INFOPLIST_FILE = "$(SRCROOT)/Example Apps/Example ObjC/SmartDeviceLink-Example-ObjC-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 7.1.0;
MARKETING_VERSION = 7.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SDLTestApp;
PRODUCT_NAME = "SDL Example";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
};
name = Release;
Expand All @@ -9420,9 +9427,13 @@
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -9439,9 +9450,11 @@
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 7.1.0;
MARKETING_VERSION = 7.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.smartdevicelink;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
RUN_CLANG_STATIC_ANALYZER = YES;
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = YES;
Expand Down Expand Up @@ -9470,9 +9483,13 @@
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -9485,9 +9502,11 @@
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 7.1.0;
MARKETING_VERSION = 7.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.smartdevicelink;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
RUN_CLANG_STATIC_ANALYZER = YES;
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = YES;
Expand Down Expand Up @@ -9581,7 +9600,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Example Apps/Example Swift/SmartDeviceLink-Example-Swift-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 7.1.0;
MARKETING_VERSION = 7.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SDLTestApp;
PRODUCT_NAME = "SDL Example Swift";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -9603,7 +9622,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Example Apps/Example Swift/SmartDeviceLink-Example-Swift-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 7.1.0;
MARKETING_VERSION = 7.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SDLTestApp;
PRODUCT_NAME = "SDL Example Swift";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -9650,7 +9669,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 7.1.0;
MARKETING_VERSION = 7.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SmartDeviceLinkSwift;
PRODUCT_NAME = "$(TARGET_NAME)";
RUN_CLANG_STATIC_ANALYZER = YES;
Expand Down Expand Up @@ -9701,7 +9720,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 7.1.0;
MARKETING_VERSION = 7.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.smartdevicelink.SmartDeviceLinkSwift;
PRODUCT_NAME = "$(TARGET_NAME)";
RUN_CLANG_STATIC_ANALYZER = YES;
Expand Down
2 changes: 1 addition & 1 deletion SmartDeviceLink.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "SmartDeviceLink"
s.version = "7.1.0"
s.version = "7.1.1"
s.summary = "Connect your app with cars!"
s.homepage = "https://github.com/smartdevicelink/SmartDeviceLink-iOS"
s.license = { :type => "New BSD", :file => "LICENSE" }
Expand Down
1 change: 1 addition & 0 deletions SmartDeviceLink/private/SDLError.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSError *)sdl_encryption_lifecycle_notReadyError;
+ (NSError *)sdl_encryption_lifecycle_encryption_off;
+ (NSError *)sdl_encryption_lifecycle_nak;
+ (NSError *)sdl_encryption_unknown;

#pragma mark SDLManager

Expand Down
12 changes: 12 additions & 0 deletions SmartDeviceLink/private/SDLError.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ + (NSError *)sdl_encryption_lifecycle_nak {

}

+ (NSError *)sdl_encryption_unknown {
NSDictionary<NSString *, NSString *> *userInfo = @{
NSLocalizedDescriptionKey: @"Encryption received an unknown error",
NSLocalizedFailureReasonErrorKey: @"We don't know the reason for the failure",
NSLocalizedRecoverySuggestionErrorKey: @"Ensure that encryption is properly set up"
};

return [NSError errorWithDomain:SDLErrorDomainEncryptionLifecycleManager
code:SDLEncryptionLifecycleManagerErrorNAK
userInfo:userInfo];
}

#pragma mark - SDLManager

+ (NSError *)sdl_lifecycle_rpcErrorWithDescription:(nullable NSString *)description andReason:(nullable NSString *)reason {
Expand Down
46 changes: 22 additions & 24 deletions SmartDeviceLink/private/SDLLifecycleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ - (void)didEnterStateConnected {
__weak typeof(self) weakSelf = self;
[self sendConnectionManagerRequest:regRequest withResponseHandler:^(__kindof SDLRPCRequest *_Nullable request, __kindof SDLRPCResponse *_Nullable response, NSError *_Nullable error) {
// If the success BOOL is NO or we received an error at this point, we failed. Call the ready handler and transition to the DISCONNECTED state.
if (error != nil || ![response.success boolValue]) {
if (error != nil || !response.success.boolValue) {
SDLLogE(@"Failed to register the app. Error: %@, Response: %@", error, response);
if (weakSelf.readyHandler) {
weakSelf.readyHandler(NO, error);
Expand Down Expand Up @@ -626,7 +626,7 @@ - (void)didEnterStateUnregistering {
__weak typeof(self) weakSelf = self;
[self sdl_sendConnectionRequest:unregisterRequest
withResponseHandler:^(__kindof SDLRPCRequest *_Nullable request, __kindof SDLRPCResponse *_Nullable response, NSError *_Nullable error) {
if (error != nil || ![response.success boolValue]) {
if (error != nil || !response.success.boolValue) {
SDLLogE(@"SDL Error unregistering, we are going to hard disconnect: %@, response: %@", error, response);
}

Expand All @@ -647,12 +647,11 @@ - (void)sdl_sendAppIcon:(nullable SDLFile *)appIcon withCompletion:(void (^)(voi
[self.fileManager uploadFile:appIcon completionHandler:^(BOOL success, NSUInteger bytesAvailable, NSError *_Nullable error) {
// These errors could be recoverable (particularly "cannot overwrite"), so we'll still attempt to set the app icon
if (error != nil) {
if (error.code == SDLFileManagerErrorCannotOverwrite) {
if ([error.domain isEqualToString:SDLErrorDomainFileManager] && error.code == SDLFileManagerErrorCannotOverwrite) {
SDLLogW(@"Failed to upload app icon: A file with this name already exists on the system");
} else {
SDLLogW(@"Unexpected error uploading app icon: %@", error);
completion();
return;
return completion();
}
}

Expand All @@ -666,8 +665,7 @@ - (void)sdl_sendAppIcon:(nullable SDLFile *)appIcon withCompletion:(void (^)(voi
SDLLogW(@"Error setting up app icon: %@", error);
}

// We've succeeded or failed
completion();
return completion();
}];
}];
}
Expand Down Expand Up @@ -753,19 +751,6 @@ - (void)sendConnectionRequest:(__kindof SDLRPCRequest *)request withResponseHand

return;
}

if (!request.isPayloadProtected && [self.encryptionLifecycleManager rpcRequiresEncryption:request]) {
request.payloadProtected = YES;
}

if (request.isPayloadProtected && !self.encryptionLifecycleManager.isEncryptionReady) {
SDLLogW(@"Encryption Manager not ready, request not sent (%@)", request);
if (handler) {
handler(request, nil, [NSError sdl_encryption_lifecycle_notReadyError]);
}

return;
}

[SDLGlobals runSyncOnSerialSubQueue:self.lifecycleQueue block:^{
[self sdl_sendConnectionRequest:request withResponseHandler:handler];
Expand Down Expand Up @@ -799,20 +784,29 @@ - (void)sdl_sendConnectionRequest:(__kindof SDLRPCMessage *)request withResponse
}

// Before we send a message, we have to check if we need to adapt the RPC. When adapting the RPC, there could be multiple RPCs that need to be sent.
NSError *error = nil;
NSArray<SDLRPCMessage *> *messages = [SDLLifecycleRPCAdapter adaptRPC:request direction:SDLRPCDirectionOutgoing];
for (SDLRPCMessage *message in messages) {
BOOL successfullySent = NO;
if ([request isKindOfClass:SDLRPCRequest.class]) {
// Generate and add a correlation ID to the request. When a response for the request is returned from Core, it will have the same correlation ID
SDLRPCRequest *requestRPC = (SDLRPCRequest *)message;
NSNumber *corrID = [self sdl_getNextCorrelationId];
requestRPC.correlationID = corrID;
[self.responseDispatcher storeRequest:requestRPC handler:handler];
[self.protocolHandler.protocol sendRPC:requestRPC];
successfullySent = [self.protocolHandler.protocol sendRPC:requestRPC error:&error];
} else if ([request isKindOfClass:SDLRPCResponse.class] || [request isKindOfClass:SDLRPCNotification.class]) {
[self.protocolHandler.protocol sendRPC:message];
successfullySent = [self.protocolHandler.protocol sendRPC:message error:&error];
} else {
SDLLogE(@"Will not send an RPC with unknown type, %@. The request should be of type SDLRPCRequest, SDLRPCResponse, or SDLRPCNotification.", request.class);
}

if (!successfullySent) {
if (handler != nil) {
handler(request, nil, error);
}
break;
}
}
}

Expand Down Expand Up @@ -869,10 +863,14 @@ - (void)sdl_rpcServiceDidConnect {
// Ignore the connection while we are reconnecting. The proxy needs to be disposed and restarted in order to ensure correct state. https://github.com/smartdevicelink/sdl_ios/issues/1172
if (![self.lifecycleStateMachine isCurrentState:SDLLifecycleStateReady]
&& ![self.lifecycleStateMachine isCurrentState:SDLLifecycleStateReconnecting]) {
SDLLogD(@"Transport connected");
SDLLogD(@"RPC Service connected");

dispatch_async(self.lifecycleQueue, ^{
[self sdl_transitionToState:SDLLifecycleStateConnected];
if ([self.lifecycleState isEqualToString:SDLLifecycleStateStarted]) {
[self sdl_transitionToState:SDLLifecycleStateConnected];
} else {
SDLLogW(@"RPC service connected while already connected. This is probably an encryption update. We will stay in our current state: %@", self.lifecycleState);
}
});
}
}
Expand Down
Loading

0 comments on commit e3160f1

Please sign in to comment.