1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-27 06:41:15 +00:00

Removed API key generation as syncthing does this automatically now.

This commit is contained in:
Felix Ableitner 2015-03-22 00:53:26 +01:00
parent 092c0f4cc9
commit b780fb57f0

View file

@ -15,7 +15,6 @@ import org.xml.sax.SAXException;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Random;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
@ -113,21 +112,6 @@ public class ConfigXml {
Element gui = (Element) mConfig.getDocumentElement() Element gui = (Element) mConfig.getDocumentElement()
.getElementsByTagName("gui").item(0); .getElementsByTagName("gui").item(0);
// Create an API key if it does not exist.
if (gui.getElementsByTagName("apikey").getLength() == 0) {
Log.i(TAG, "Initializing API key with random string");
char[] chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toCharArray();
StringBuilder sb = new StringBuilder();
Random random = new Random();
for (int i = 0; i < 20; i++) {
sb.append(chars[random.nextInt(chars.length)]);
}
Element apiKey = mConfig.createElement("apikey");
apiKey.setTextContent(sb.toString());
gui.appendChild(apiKey);
changed = true;
}
// Hardcode default globalAnnounceServer ip. // Hardcode default globalAnnounceServer ip.
NodeList globalAnnounceServer = options.getElementsByTagName("globalAnnounceServer"); NodeList globalAnnounceServer = options.getElementsByTagName("globalAnnounceServer");
for (int i = 0; i < globalAnnounceServer.getLength(); i++) { for (int i = 0; i < globalAnnounceServer.getLength(); i++) {