@@ -379,10 +379,9 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
379
379
await this . createIpa ( projectRoot , projectData , buildConfig ) ;
380
380
}
381
381
382
- private async setupSigningFromProvision ( projectRoot : string , projectData : IProjectData , provision ?: any ) : Promise < void > {
382
+ private async setupSigningFromProvision ( projectRoot : string , projectData : IProjectData , provision ?: string ) : Promise < void > {
383
383
if ( provision ) {
384
- const pbxprojPath = path . join ( projectRoot , projectData . projectName + ".xcodeproj" , "project.pbxproj" ) ;
385
- const xcode = Xcode . open ( pbxprojPath ) ;
384
+ const xcode = Xcode . open ( this . getPbxProjPath ( projectData ) ) ;
386
385
const signing = xcode . getSigning ( projectData . projectName ) ;
387
386
388
387
let shouldUpdateXcode = false ;
@@ -428,11 +427,16 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
428
427
}
429
428
430
429
private async setupSigningForDevice ( projectRoot : string , buildConfig : IiOSBuildConfig , projectData : IProjectData ) : Promise < void > {
431
- const pbxprojPath = path . join ( projectRoot , projectData . projectName + ".xcodeproj" , "project.pbxproj" ) ;
432
- const xcode = Xcode . open ( pbxprojPath ) ;
430
+ const xcode = Xcode . open ( this . getPbxProjPath ( projectData ) ) ;
433
431
const signing = xcode . getSigning ( projectData . projectName ) ;
434
432
435
- if ( ( this . readXCConfigProvisioningProfile ( projectData ) || this . readXCConfigProvisioningProfileForIPhoneOs ( projectData ) ) && ( ! signing || signing . style !== "Manual" ) ) {
433
+ const hasProvisioningProfileInXCConfig =
434
+ this . readXCConfigProvisioningProfileSpecifierForIPhoneOs ( projectData ) ||
435
+ this . readXCConfigProvisioningProfileSpecifier ( projectData ) ||
436
+ this . readXCConfigProvisioningProfileForIPhoneOs ( projectData ) ||
437
+ this . readXCConfigProvisioningProfile ( projectData ) ;
438
+
439
+ if ( hasProvisioningProfileInXCConfig && ( ! signing || signing . style !== "Manual" ) ) {
436
440
xcode . setManualSigningStyle ( projectData . projectName ) ;
437
441
xcode . save ( ) ;
438
442
} else if ( ! buildConfig . provision && ! ( signing && signing . style === "Manual" && ! buildConfig . teamId ) ) {
@@ -623,7 +627,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
623
627
624
628
if ( provision ) {
625
629
let projectRoot = path . join ( projectData . platformsDir , "ios" ) ;
626
- await this . setupSigningFromProvision ( projectRoot , provision ) ;
630
+ await this . setupSigningFromProvision ( projectRoot , projectData , provision ) ;
627
631
}
628
632
629
633
let project = this . createPbxProj ( projectData ) ;
@@ -844,6 +848,35 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
844
848
return Promise . resolve ( ) ;
845
849
}
846
850
851
+ public checkForChanges ( changesInfo : IProjectChangesInfo , options : IProjectChangesOptions , projectData : IProjectData ) : void {
852
+ const provision = options . provision ;
853
+ if ( provision !== undefined ) {
854
+ // Check if the native project's signing is set to the provided provision...
855
+ const pbxprojPath = this . getPbxProjPath ( projectData ) ;
856
+
857
+ if ( this . $fs . exists ( pbxprojPath ) ) {
858
+ const xcode = Xcode . open ( pbxprojPath ) ;
859
+ const signing = xcode . getSigning ( projectData . projectName ) ;
860
+ if ( signing && signing . style === "Manual" ) {
861
+ for ( let name in signing . configurations ) {
862
+ let config = signing . configurations [ name ] ;
863
+ if ( config . uuid !== provision && config . name !== provision ) {
864
+ changesInfo . signingChanged = true ;
865
+ break ;
866
+ }
867
+ }
868
+ } else {
869
+ // Specifying provisioning profile requires "Manual" signing style.
870
+ // If the current signing style was not "Manual" it was probably "Automatic" or,
871
+ // it was not uniform for the debug and release build configurations.
872
+ changesInfo . signingChanged = true ;
873
+ }
874
+ } else {
875
+ changesInfo . signingChanged = true ;
876
+ }
877
+ }
878
+ }
879
+
847
880
private getAllLibsForPluginWithFileExtension ( pluginData : IPluginData , fileExtension : string ) : string [ ] {
848
881
let filterCallback = ( fileName : string , pluginPlatformsFolderPath : string ) => path . extname ( fileName ) === fileExtension ;
849
882
return this . getAllNativeLibrariesForPlugin ( pluginData , IOSProjectService . IOS_PLATFORM_NAME , filterCallback ) ;
@@ -1186,6 +1219,14 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
1186
1219
return this . readXCConfig ( "PROVISIONING_PROFILE[sdk=iphoneos*]" , projectData ) ;
1187
1220
}
1188
1221
1222
+ private readXCConfigProvisioningProfileSpecifier ( projectData : IProjectData ) : string {
1223
+ return this . readXCConfig ( "PROVISIONING_PROFILE_SPECIFIER" , projectData ) ;
1224
+ }
1225
+
1226
+ private readXCConfigProvisioningProfileSpecifierForIPhoneOs ( projectData : IProjectData ) : string {
1227
+ return this . readXCConfig ( "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" , projectData ) ;
1228
+ }
1229
+
1189
1230
private async getDevelopmentTeam ( projectData : IProjectData , teamId ?: string ) : Promise < string > {
1190
1231
teamId = teamId || this . readTeamId ( projectData ) ;
1191
1232
0 commit comments