From a3c4c2eb18b075e87dfbf51cf0bc094ad728585c Mon Sep 17 00:00:00 2001 From: uerceg Date: Tue, 3 Sep 2024 23:04:21 +0200 Subject: [PATCH 01/11] refac: add input params type validation for certain public web bridge apis --- AdjustBridge/AdjustBridgeRegister.m | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/AdjustBridge/AdjustBridgeRegister.m b/AdjustBridge/AdjustBridgeRegister.m index 751b18ec8..d6acdfb51 100644 --- a/AdjustBridge/AdjustBridgeRegister.m +++ b/AdjustBridge/AdjustBridgeRegister.m @@ -225,6 +225,10 @@ function canSend(okCheck, errReason) { }, addGlobalCallbackParameter: function(key, value) { + if (typeof key !== 'string' || typeof value !== 'string') { + console.log('Passed key or value is not of string type'); + return; + } this._postMessage("adjust_addGlobalCallbackParameter", { _key: key, _keyType: typeof key, _value: value, _valueType: typeof value @@ -232,6 +236,10 @@ function canSend(okCheck, errReason) { }, removeGlobalCallbackParameter: function(key) { + if (typeof key !== 'string') { + console.log('Passed key is not of string type'); + return; + } this._postMessage("adjust_removeGlobalCallbackParameter", { _key: key, _keyType: typeof key }); }, @@ -240,6 +248,10 @@ function canSend(okCheck, errReason) { }, addGlobalPartnerParameter: function(key, value) { + if (typeof key !== 'string' || typeof value !== 'string') { + console.log('Passed key or value is not of string type'); + return; + } this._postMessage("adjust_addGlobalPartnerParameter", { _key: key, _keyType: typeof key, _value: value, _valueType: typeof value @@ -247,6 +259,10 @@ function canSend(okCheck, errReason) { }, removeGlobalPartnerParameter: function(key) { + if (typeof key !== 'string') { + console.log('Passed key is not of string type'); + return; + } this._postMessage("adjust_removeGlobalPartnerParameter", { _key: key, _keyType: typeof key }); }, @@ -308,12 +324,20 @@ function canSend(okCheck, errReason) { }; AdjustThirdPartySharing.prototype.addGranularOption = function(partnerName, key, value) { + if (typeof partnerName !== 'string' || typeof key !== 'string' || typeof value !== 'string') { + console.log('Passed partnerName, key or value is not of string type'); + return; + } this.granularOptions.push(partnerName); this.granularOptions.push(key); this.granularOptions.push(value); }; AdjustThirdPartySharing.prototype.addPartnerSharingSetting = function(partnerName, key, value) { + if (typeof partnerName !== 'string' || typeof key !== 'string' || typeof value !== 'boolean') { + console.log('Passed partnerName or key is not of string type or value is not of boolean type'); + return; + } this.partnerSharingSettings.push(partnerName); this.partnerSharingSettings.push(key); this.partnerSharingSettings.push(value); From 13b6f99231b1750ce65406f38fd7566b40caac74 Mon Sep 17 00:00:00 2001 From: uerceg Date: Tue, 3 Sep 2024 23:05:01 +0200 Subject: [PATCH 02/11] fix: update handling of global callback/partner param removal --- AdjustBridge/AdjustBridge.m | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/AdjustBridge/AdjustBridge.m b/AdjustBridge/AdjustBridge.m index da8bdd64e..9c9061a6b 100644 --- a/AdjustBridge/AdjustBridge.m +++ b/AdjustBridge/AdjustBridge.m @@ -173,10 +173,8 @@ - (void)handleMessageFromWebview:(NSDictionary *)message { [Adjust addGlobalCallbackParameter:value forKey:key]; } else if ([methodName isEqual:ADJWBRemoveGlobalCallbackParameterMethodName]) { - if (![parameters isKindOfClass:[NSString class]]) { - return; - } - [Adjust removeGlobalCallbackParameterForKey:(NSString *)parameters]; + NSString *key = [parameters objectForKey:ADJWBKvKeyKey]; + [Adjust removeGlobalCallbackParameterForKey:key]; } else if ([methodName isEqual:ADJWBRemoveGlobalCallbackParametersMethodName]) { [Adjust removeGlobalCallbackParameters]; @@ -187,10 +185,8 @@ - (void)handleMessageFromWebview:(NSDictionary *)message { [Adjust addGlobalPartnerParameter:value forKey:key]; } else if ([methodName isEqual:ADJWBRemoveGlobalPartnerParameterMethodName]) { - if (![parameters isKindOfClass:[NSString class]]) { - return; - } - [Adjust removeGlobalPartnerParameterForKey:(NSString *)parameters]; + NSString *key = [parameters objectForKey:ADJWBKvKeyKey]; + [Adjust removeGlobalPartnerParameterForKey:key]; } else if ([methodName isEqual:ADJWBRemoveGlobalPartnerParametersMethodName]) { [Adjust removeGlobalPartnerParameters]; From 3c51f54438bdab94741b0ad92b8b3eda1708fca0 Mon Sep 17 00:00:00 2001 From: uerceg Date: Tue, 3 Sep 2024 23:23:28 +0200 Subject: [PATCH 03/11] chore: clean up test app comments --- .../AdjustWebBridgeTestApp/AdjustTestApp-WebView.html | 6 ------ 1 file changed, 6 deletions(-) diff --git a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/AdjustTestApp-WebView.html b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/AdjustTestApp-WebView.html index 178601436..7dfbebd34 100644 --- a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/AdjustTestApp-WebView.html +++ b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/AdjustTestApp-WebView.html @@ -23,12 +23,6 @@

Webview



function startButton() { console.log('btnStartTestSession'); - - - - - - TestLibraryBridge.startTestSession(); } From 9c42971e0a85cb07329b59351ac6842ebe2b097e Mon Sep 17 00:00:00 2001 From: uerceg Date: Tue, 3 Sep 2024 23:24:43 +0200 Subject: [PATCH 04/11] fix: pass partner sharing setting value as boolean --- .../AdjustWebBridgeTestApp/TestLibraryBridge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.js b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.js index 946104f2a..8397c3f35 100644 --- a/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.js +++ b/AdjustTests/AdjustWebBridgeTestApp/AdjustWebBridgeTestApp/TestLibraryBridge.js @@ -621,7 +621,7 @@ AdjustCommandExecutor.prototype.thirdPartySharing = function(params) { for (var i = 0; i < partnerSharingSettings.length; i = i + 3) { var partnerName = partnerSharingSettings[i]; var key = partnerSharingSettings[i + 1]; - var value = partnerSharingSettings[i + 2]; + var value = partnerSharingSettings[i + 2] == 'true'; adjustThirdPartySharing.addPartnerSharingSetting(partnerName, key, value); } } From 3e877b1063dbe05246aaa189178d35d478b0c4af Mon Sep 17 00:00:00 2001 From: uerceg Date: Tue, 3 Sep 2024 23:27:30 +0200 Subject: [PATCH 05/11] feat: update version number to 5.0.1 --- Adjust.podspec | 2 +- Adjust/Adjust.h | 2 +- Adjust/Internal/ADJUtil.m | 2 +- AdjustBridge/AdjustBridgeRegister.m | 2 +- VERSION | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Adjust.podspec b/Adjust.podspec index 5c6826a46..7a8ba046d 100644 --- a/Adjust.podspec +++ b/Adjust.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Adjust" s.module_name = "AdjustSdk" - s.version = "5.0.0" + s.version = "5.0.1" s.summary = "This is the iOS SDK of Adjust. You can read more about it at https://adjust.com." s.homepage = "https://github.com/adjust/ios_sdk" s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/Adjust/Adjust.h b/Adjust/Adjust.h index 3ada002a9..8b780a6c1 100644 --- a/Adjust/Adjust.h +++ b/Adjust/Adjust.h @@ -2,7 +2,7 @@ // Adjust.h // Adjust SDK // -// V5.0.0 +// V5.0.1 // Created by Christian Wellenbrock (@wellle) on 23rd July 2013. // Copyright (c) 2012-Present Adjust GmbH. All rights reserved. // diff --git a/Adjust/Internal/ADJUtil.m b/Adjust/Internal/ADJUtil.m index 6fa08d107..8b06e2033 100644 --- a/Adjust/Internal/ADJUtil.m +++ b/Adjust/Internal/ADJUtil.m @@ -31,7 +31,7 @@ static NSRegularExpression *goLinkUniversalLinkRegex = nil; static NSRegularExpression *excludedDeeplinkRegex = nil; -static NSString * const kClientSdk = @"ios5.0.0"; +static NSString * const kClientSdk = @"ios5.0.1"; static NSString * const kDeeplinkParam = @"deep_link="; static NSString * const kSchemeDelimiter = @"://"; static NSString * const kDefaultScheme = @"AdjustUniversalScheme"; diff --git a/AdjustBridge/AdjustBridgeRegister.m b/AdjustBridge/AdjustBridgeRegister.m index d6acdfb51..ec6a25b9c 100644 --- a/AdjustBridge/AdjustBridgeRegister.m +++ b/AdjustBridge/AdjustBridgeRegister.m @@ -172,7 +172,7 @@ function canSend(okCheck, errReason) { if (this.sdkPrefix) { return this.sdkPrefix; } else { - return 'web-bridge5.0.0'; + return 'web-bridge5.0.1'; } }, diff --git a/VERSION b/VERSION index 0062ac971..6b244dcd6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.0.0 +5.0.1 From b6df9e1b2205f50368a0524bc1e2a87b28cf756d Mon Sep 17 00:00:00 2001 From: uerceg Date: Tue, 3 Sep 2024 23:32:04 +0200 Subject: [PATCH 06/11] docs: update changelog --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06630b73f..6444216d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +### Version 5.0.1 (4th September 2024) +#### Fixed +- Fixed `removeGlobalCallbackParameter` and `removeGlobalPartnerParameter` web bridge methods. + +#### Changed +- Added validation when passing callback / partner parameters and third party sharing granular options / partner sharing setting parameters in web bridge. + +--- + ### Version 5.0.0 (2nd August 2024) We're excited to release our major new SDK version (v5). Among many internal improvements, our spoofing protection solution is now included out of the box, reinforcing our commitment to accurate, actionable, and fraud-free data. @@ -17,6 +26,7 @@ In case you were using beta version of the SDK v5, please switch to the official - Fixed occasional crashes when processing resolved deep links. --- + ### Version 4.38.3 (23rd May 2024) #### Fixed - Added missing `WKNavigationDelegate` methods to the `WebBridge` implementation. From 4d13ae87f07097aafaf56834b3bd1524978d3842 Mon Sep 17 00:00:00 2001 From: Aditi3 Date: Wed, 11 Sep 2024 13:01:48 +0200 Subject: [PATCH 07/11] build: let pods generate umbrella header automatically --- Adjust.podspec | 1 - 1 file changed, 1 deletion(-) diff --git a/Adjust.podspec b/Adjust.podspec index 7a8ba046d..8c5004a8a 100644 --- a/Adjust.podspec +++ b/Adjust.podspec @@ -13,7 +13,6 @@ Pod::Spec.new do |s| s.ios.weak_framework = 'AdSupport' s.tvos.weak_framework = 'AdSupport' s.default_subspec = 'Adjust' - s.module_map = 'ModuleMap/module.modulemap' s.subspec 'Adjust' do |adj| adj.source_files = 'Adjust/**/*.{h,m}', 'UmbrellaHeaders/sdk/*.{h,m}' From 4863db56c5b6077e4bd4bb235f2094ebaa186bd2 Mon Sep 17 00:00:00 2001 From: uerceg Date: Fri, 13 Sep 2024 16:24:19 +0200 Subject: [PATCH 08/11] docs: update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6444216d6..e3174f38a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ -### Version 5.0.1 (4th September 2024) +### Version 5.0.1 (13th September 2024) #### Fixed +- Fixed `Adjust.modulemap not found` error in certain CocoaPods integration cases. - Fixed `removeGlobalCallbackParameter` and `removeGlobalPartnerParameter` web bridge methods. #### Changed From fa35cd3aec017251bd76ba6eec0dae1325875f36 Mon Sep 17 00:00:00 2001 From: uerceg Date: Fri, 13 Sep 2024 17:12:18 +0200 Subject: [PATCH 09/11] test: fix deferred deep link testing logic --- .../AdjustTestApp/ATAAdjustCommandExecutor.m | 8 ++++---- .../Delegates/ATAAdjustDelegateDeferredDeeplink.m | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AdjustTests/AdjustTestApp/AdjustTestApp/ATAAdjustCommandExecutor.m b/AdjustTests/AdjustTestApp/AdjustTestApp/ATAAdjustCommandExecutor.m index 3fe5f37e8..d9bec7848 100644 --- a/AdjustTests/AdjustTestApp/AdjustTestApp/ATAAdjustCommandExecutor.m +++ b/AdjustTests/AdjustTestApp/AdjustTestApp/ATAAdjustCommandExecutor.m @@ -347,11 +347,11 @@ - (void)config:(NSDictionary *)parameters { if ([parameters objectForKey:@"deferredDeeplinkCallback"]) { NSLog(@"deferredDeeplinkCallback detected"); NSString *shouldOpenDeeplinkS = [parameters objectForKey:@"deferredDeeplinkCallback"][0]; + BOOL shouldOpenDeeplink = [shouldOpenDeeplinkS boolValue]; self.adjustDelegate = - [[ATAAdjustDelegateDeferredDeeplink alloc] - initWithTestLibrary:self.testLibrary - extraPath:self.extraPath - andReturnValue:[shouldOpenDeeplinkS boolValue]]; + [[ATAAdjustDelegateDeferredDeeplink alloc] initWithTestLibrary:self.testLibrary + extraPath:self.extraPath + andReturnValue:shouldOpenDeeplink]; } if ([parameters objectForKey:@"skanCallback"]) { diff --git a/AdjustTests/AdjustTestApp/AdjustTestApp/Delegates/ATAAdjustDelegateDeferredDeeplink.m b/AdjustTests/AdjustTestApp/AdjustTestApp/Delegates/ATAAdjustDelegateDeferredDeeplink.m index 43fc29e5a..f1e3343b8 100644 --- a/AdjustTests/AdjustTestApp/AdjustTestApp/Delegates/ATAAdjustDelegateDeferredDeeplink.m +++ b/AdjustTests/AdjustTestApp/AdjustTestApp/Delegates/ATAAdjustDelegateDeferredDeeplink.m @@ -32,7 +32,7 @@ - (id)initWithTestLibrary:(ATLTestLibrary *)testLibrary extraPath:(NSString *)ex return self; } -- (BOOL)adjustDeeplinkResponse:(nullable NSURL *)deeplink { +- (BOOL)adjustDeferredDeeplinkReceived:(nullable NSURL *)deeplink { NSLog(@"Deferred deep link callback called!"); NSLog(@"Deep link: %@", deeplink); From 847e49f954ad5534a8d67dc2ea4ce61d5bc8e40b Mon Sep 17 00:00:00 2001 From: Aditi3 Date: Fri, 13 Sep 2024 18:28:54 +0200 Subject: [PATCH 10/11] fix: return string value for deferredDeeplinkCallback --- AdjustBridge/AdjustBridgeRegister.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/AdjustBridge/AdjustBridgeRegister.m b/AdjustBridge/AdjustBridgeRegister.m index ec6a25b9c..36b12eac7 100644 --- a/AdjustBridge/AdjustBridgeRegister.m +++ b/AdjustBridge/AdjustBridgeRegister.m @@ -101,8 +101,12 @@ function canSend(okCheck, errReason) { _handleCallbackFromObjC: function(callback, callbackId) { window[callbackId] = function(value) { - const parsedValue = JSON.parse(value); - callback(parsedValue); + if(callbackId.includes("adjust_deferredDeeplinkCallback")) { + callback(value); + } else { + const parsedValue = JSON.parse(value); + callback(parsedValue); + } }; }, From 8f9054545de4cb8e7ca2966cb843fb23ddb19d86 Mon Sep 17 00:00:00 2001 From: uerceg Date: Sat, 14 Sep 2024 09:46:05 +0200 Subject: [PATCH 11/11] docs: update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3174f38a..16c484ebc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ -### Version 5.0.1 (13th September 2024) +### Version 5.0.1 (14th September 2024) #### Fixed - Fixed `Adjust.modulemap not found` error in certain CocoaPods integration cases. - Fixed `removeGlobalCallbackParameter` and `removeGlobalPartnerParameter` web bridge methods. +- Fixed deferred deep link callback not getting triggered issue in the web bridge. #### Changed - Added validation when passing callback / partner parameters and third party sharing granular options / partner sharing setting parameters in web bridge.