1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-23 04:41:16 +00:00

Also replace IPv6 announce server address with domain (fixes #231).

This commit is contained in:
Felix Ableitner 2015-03-10 19:19:20 +01:00
parent 9c91f3f1d0
commit 1a85bd54e7

View file

@ -129,13 +129,20 @@ public class ConfigXml {
} }
// Hardcode default globalAnnounceServer ip. // Hardcode default globalAnnounceServer ip.
Element globalAnnounceServer = (Element) NodeList globalAnnounceServer = options.getElementsByTagName("globalAnnounceServer");
options.getElementsByTagName("globalAnnounceServer").item(0); for (int i = 0; i < globalAnnounceServer.getLength(); i++) {
if (globalAnnounceServer.getTextContent().equals("udp4://announce.syncthing.net:22026")) { Element g = (Element) globalAnnounceServer.item(i);
Log.i(TAG, "Replacing globalAnnounceServer host with ip"); if (g.getTextContent().equals("udp4://announce.syncthing.net:22026")) {
globalAnnounceServer.setTextContent("udp4://194.126.249.5:22026"); Log.i(TAG, "Replacing globalAnnounceServer address with ip");
g.setTextContent("udp4://194.126.249.5:22026");
changed = true; changed = true;
} }
if (g.getTextContent().equals("udp6://announce-v6.syncthing.net:22026")) {
Log.i(TAG, "Replacing IPv6 globalAnnounceServer address with ip");
g.setTextContent("udp6://[2001:470:28:4d6::5]:22026");
changed = true;
}
}
NodeList folders = mConfig.getDocumentElement().getElementsByTagName("folder"); NodeList folders = mConfig.getDocumentElement().getElementsByTagName("folder");
for (int i = 0; i < folders.getLength(); i++) { for (int i = 0; i < folders.getLength(); i++) {