diff --git a/.gitignore b/.gitignore index 0b5eb907c..03db204d1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ build-* liblinphone-sdk liblinphone-iphone-sdk*.zip xcuserdata/ +Classes/LinphoneIOSVersion.h diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 3673649cd..39714f6ee 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -35,6 +35,8 @@ #include "linphone/lpconfig.h" #include "mediastreamer2/mscommon.h" +#import "LinphoneIOSVersion.h" + #define LINPHONE_LOGS_MAX_ENTRY 5000 static void audioRouteChangeListenerCallback ( @@ -1170,7 +1172,7 @@ static LinphoneCoreVTable linphonec_vtable = { NSString *chatDBFileName = [LinphoneManager documentFile:kLinphoneInternalChatDBFilename]; const char* lRootCa = [[LinphoneManager bundleFile:@"rootca.pem"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; - linphone_core_set_user_agent(theLinphoneCore,"LinphoneIPhone", linphone_core_get_version()); + linphone_core_set_user_agent(theLinphoneCore, [[[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] stringByAppendingString:@"Iphone"] UTF8String], LINPHONE_IOS_VERSION); [_contactSipField release]; _contactSipField = [[self lpConfigStringForKey:@"contact_im_type_value" withDefault:@"SIP"] retain]; diff --git a/Tools/git_version.sh b/Tools/git_version.sh new file mode 100755 index 000000000..6f2c6a0b5 --- /dev/null +++ b/Tools/git_version.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# git_version.sh +# +# Copyright (C) 2012 Belledonne Comunications, Grenoble, France +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# Created by Gautier Pelloux-Prayer on 2014/11/03. +# Generate Classes/git_version.h which contains GIT_VERSION preprocessor macro + +linphone_ios_version=$(git describe --always) + +printf "/* LinphoneIOSVersion.h + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#define LINPHONE_IOS_VERSION \"$linphone_ios_version\" +" > $(dirname $0)/../Classes/LinphoneIOSVersion.h diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index d1faab551..bd8627913 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -3647,6 +3647,7 @@ buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "linphone" */; buildPhases = ( 1D60588D0D05DD3D006BFB54 /* Resources */, + 63DCC71D1A07B08E00916627 /* Run Script */, D33CF34715D3985000CD4B85 /* ShellScript */, 1D60588E0D05DD3D006BFB54 /* Sources */, 1D60588F0D05DD3D006BFB54 /* Frameworks */, @@ -3668,6 +3669,7 @@ buildConfigurationList = 22D8F182147548E2008C97DB /* Build configuration list for PBXNativeTarget "linphone-no-gpl-thirdparties" */; buildPhases = ( 22D8F11E147548E2008C97DB /* Resources */, + 63DCC71E1A07B44100916627 /* ShellScript */, D33CF35115D3AC9800CD4B85 /* ShellScript */, 22D8F143147548E2008C97DB /* Sources */, 22D8F15A147548E2008C97DB /* Frameworks */, @@ -4923,6 +4925,33 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 63DCC71D1A07B08E00916627 /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = $SRCROOT/Tools/git_version.sh; + }; + 63DCC71E1A07B44100916627 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = $SRCROOT/Tools/git_version.sh; + }; D33CF34715D3985000CD4B85 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -6259,7 +6288,7 @@ ); ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "b16cf102-d1d6-44ea-80ce-ef7337931580"; + PROVISIONING_PROFILE = ""; WRAPPER_EXTENSION = app; }; name = Debug; @@ -6307,7 +6336,7 @@ "$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins", ); PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "b16cf102-d1d6-44ea-80ce-ef7337931580"; + PROVISIONING_PROFILE = ""; VALIDATE_PRODUCT = YES; WRAPPER_EXTENSION = app; }; @@ -6356,7 +6385,7 @@ "$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins", ); PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "b16cf102-d1d6-44ea-80ce-ef7337931580"; + PROVISIONING_PROFILE = ""; VALIDATE_PRODUCT = YES; WRAPPER_EXTENSION = app; }; @@ -6405,7 +6434,7 @@ "$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins", ); PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "b16cf102-d1d6-44ea-80ce-ef7337931580"; + PROVISIONING_PROFILE = ""; VALIDATE_PRODUCT = YES; WRAPPER_EXTENSION = app; };