mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-22 20:31:16 +00:00
Also replace IPv6 announce server address with domain (fixes #231).
This commit is contained in:
parent
9c91f3f1d0
commit
1a85bd54e7
1 changed files with 13 additions and 6 deletions
|
@ -129,12 +129,19 @@ public class ConfigXml {
|
|||
}
|
||||
|
||||
// Hardcode default globalAnnounceServer ip.
|
||||
Element globalAnnounceServer = (Element)
|
||||
options.getElementsByTagName("globalAnnounceServer").item(0);
|
||||
if (globalAnnounceServer.getTextContent().equals("udp4://announce.syncthing.net:22026")) {
|
||||
Log.i(TAG, "Replacing globalAnnounceServer host with ip");
|
||||
globalAnnounceServer.setTextContent("udp4://194.126.249.5:22026");
|
||||
changed = true;
|
||||
NodeList globalAnnounceServer = options.getElementsByTagName("globalAnnounceServer");
|
||||
for (int i = 0; i < globalAnnounceServer.getLength(); i++) {
|
||||
Element g = (Element) globalAnnounceServer.item(i);
|
||||
if (g.getTextContent().equals("udp4://announce.syncthing.net:22026")) {
|
||||
Log.i(TAG, "Replacing globalAnnounceServer address with ip");
|
||||
g.setTextContent("udp4://194.126.249.5:22026");
|
||||
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");
|
||||
|
|
Loading…
Reference in a new issue