code: private static void changeNetworkUnEncrypted(WifiManager wifiManager, WifiParsedResult wifiResult) {
      WifiConfiguration config = changeNetworkCommon(wifiResult);
      config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
      updateNetwork(wifiManager, config);
    }
docs: Adding an open, unsecured network