// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. #include "IOSRuntimeSettings.h" #include "HAL/FileManager.h" #include "Misc/Paths.h" UIOSRuntimeSettings::UIOSRuntimeSettings(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { bEnableGameCenterSupport = true; bEnableCloudKitSupport = false; bSupportsPortraitOrientation = true; BundleDisplayName = TEXT("UE4 Game"); BundleName = TEXT("MyUE4Game"); BundleIdentifier = TEXT("com.YourCompany.GameNameNoSpaces"); VersionInfo = TEXT("1.0.0"); FrameRateLock = EPowerUsageFrameRateLock::PUFRL_30; bSupportsIPad = true; bSupportsIPhone = true; MinimumiOSVersion = EIOSVersion::IOS_8; EnableRemoteShaderCompile = false; bGeneratedSYMFile = false; bGeneratedSYMBundle = false; bGenerateXCArchive = false; bDevForArmV7 = false; bDevForArm64 = true; bDevForArmV7S = false; bShipForArmV7 = false; bShipForArm64 = true; bShipForArmV7S = false; bShipForBitcode = false; bUseRSync = true; AdditionalPlistData = TEXT(""); AdditionalLinkerFlags = TEXT(""); AdditionalShippingLinkerFlags = TEXT(""); bTreatRemoteAsSeparateController = false; bAllowRemoteRotation = true; bUseRemoteAsVirtualJoystick = true; bUseRemoteAbsoluteDpadValues = false; bEnableRemoteNotificationsSupport = false; } #if WITH_EDITOR void UIOSRuntimeSettings::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) { Super::PostEditChangeProperty(PropertyChangedEvent); // Ensure that at least one orientation is supported if (!bSupportsPortraitOrientation && !bSupportsUpsideDownOrientation && !bSupportsLandscapeLeftOrientation && !bSupportsLandscapeRightOrientation) { bSupportsPortraitOrientation = true; UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UIOSRuntimeSettings, bSupportsPortraitOrientation)), GetDefaultConfigFilename()); } // Ensure that at least one API is supported if (!bSupportsMetal && !bSupportsOpenGLES2 && !bSupportsMetalMRT) { bSupportsOpenGLES2 = true; UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UIOSRuntimeSettings, bSupportsOpenGLES2)), GetDefaultConfigFilename()); } // Ensure that at least arm64 is selected for shipping and dev if (!bDevForArmV7 && !bDevForArm64 && !bDevForArmV7S) { bDevForArm64 = true; UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UIOSRuntimeSettings, bDevForArm64)), GetDefaultConfigFilename()); } if (!bShipForArmV7 && !bShipForArm64 && !bShipForArmV7S) { bShipForArm64 = true; UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UIOSRuntimeSettings, bShipForArm64)), GetDefaultConfigFilename()); } } void UIOSRuntimeSettings::PostInitProperties() { Super::PostInitProperties(); // We can have a look for potential keys if (!RemoteServerName.IsEmpty() && !RSyncUsername.IsEmpty()) { SSHPrivateKeyLocation = TEXT(""); const FString DefaultKeyFilename = TEXT("RemoteToolChainPrivate.key"); const FString RelativeFilePathLocation = FPaths::Combine(TEXT("SSHKeys"), *RemoteServerName, *RSyncUsername, *DefaultKeyFilename); TCHAR Path[4096]; FPlatformMisc::GetEnvironmentVariable(TEXT("APPDATA"), Path, ARRAY_COUNT(Path)); TArray PossibleKeyLocations; PossibleKeyLocations.Add(FPaths::Combine(*FPaths::GameDir(), TEXT("Build"), TEXT("NotForLicensees"), *RelativeFilePathLocation)); PossibleKeyLocations.Add(FPaths::Combine(*FPaths::GameDir(), TEXT("Build"), TEXT("NoRedist"), *RelativeFilePathLocation)); PossibleKeyLocations.Add(FPaths::Combine(*FPaths::GameDir(), TEXT("Build"), *RelativeFilePathLocation)); PossibleKeyLocations.Add(FPaths::Combine(*FPaths::EngineDir(), TEXT("Build"), TEXT("NotForLicensees"), *RelativeFilePathLocation)); PossibleKeyLocations.Add(FPaths::Combine(*FPaths::EngineDir(), TEXT("Build"), TEXT("NoRedist"), *RelativeFilePathLocation)); PossibleKeyLocations.Add(FPaths::Combine(*FPaths::EngineDir(), TEXT("Build"), *RelativeFilePathLocation)); PossibleKeyLocations.Add(FPaths::Combine(Path, TEXT("Unreal Engine"), TEXT("UnrealBuildTool"), *RelativeFilePathLocation)); // Find a potential path that we will use if the user hasn't overridden. // For information purposes only for (const FString& NextLocation : PossibleKeyLocations) { if (IFileManager::Get().FileSize(*NextLocation) > 0) { SSHPrivateKeyLocation = NextLocation; break; } } } // switch IOS_6.1 and IOS_7 to IOS_8 if (MinimumiOSVersion < EIOSVersion::IOS_8) { MinimumiOSVersion = EIOSVersion::IOS_8; } } #endif