Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions src/Core/src/Hosting/Dispatching/AppHostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,6 @@ public static MauiAppBuilder ConfigureEnvironmentVariables(this MauiAppBuilder b

IDictionary environmentVariables = Environment.GetEnvironmentVariables();

#if ANDROID
const string androidEnvVarFilePath = "/data/local/tmp/ide-launchenv.txt";

// For Android we read the environment variables from a text file that is written to the device/emulator
// If the file not exists, we will use the default environment variables which is less stable
if (OperatingSystem.IsAndroid() && System.IO.File.Exists(androidEnvVarFilePath))
{
var envVarLines = System.IO.File.ReadAllLines(androidEnvVarFilePath);

var fileEnvironmentVariables = envVarLines
.Select(line => line.Split('=', 2))
.ToDictionary(parts => parts[0], parts => parts[1]);

// Merge file environment variables into the existing environment variables
foreach (var kvp in fileEnvironmentVariables)
{
environmentVariables[kvp.Key] = kvp.Value;
}
}
#endif

string devTunnelId = environmentVariables["DEVTUNNEL_ID"]?.ToString() ?? string.Empty;

var variablesToInclude = new HashSet<string>
Expand Down