From 340cf4162ce997f229b1a433c312ed86464b5329 Mon Sep 17 00:00:00 2001 From: renyou Date: Thu, 27 Aug 2020 11:23:30 -0400 Subject: [PATCH] Revert "Pass platform configuration to Dart VM for insecure socket policy (#20733)" (#20812) This reverts commit d241105d7a840a7ba88bc2c0ce4a9f415f83aaab. --- .../io/flutter/embedding/engine/loader/FlutterLoader.java | 7 ++++--- .../darwin/ios/framework/Source/FlutterDartProject.mm | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java b/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java index 3df6fe097f81f..2aee56dee94e3 100644 --- a/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java +++ b/shell/platform/android/io/flutter/embedding/engine/loader/FlutterLoader.java @@ -216,9 +216,10 @@ public void ensureInitializationComplete( } shellArgs.add("--cache-dir-path=" + result.engineCachesPath); - if (!flutterApplicationInfo.clearTextPermitted) { - shellArgs.add("--disallow-insecure-connections"); - } + // TODO(mehmetf): Announce this since it is a breaking change then enable it. + // if (!flutterApplicationInfo.clearTextPermitted) { + // shellArgs.add("--disallow-insecure-connections"); + // } if (flutterApplicationInfo.domainNetworkPolicy != null) { shellArgs.add("--domain-network-policy=" + flutterApplicationInfo.domainNetworkPolicy); } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index f080460f99b8a..4f6a2acdf7b76 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -140,6 +140,12 @@ settings.domain_network_policy = [FlutterDartProject domainNetworkPolicy:appTransportSecurity].UTF8String; + // TODO(mehmetf): We need to announce this change since it is breaking. + // Remove these two lines after we announce and we know which release this is + // going to be part of. + settings.may_insecurely_connect_to_all_domains = true; + settings.domain_network_policy = ""; + #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG // There are no ownership concerns here as all mappings are owned by the // embedder and not the engine.