From b780fb57f0f8c6771b24100483d1a4a13fa07daa Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sun, 22 Mar 2015 00:53:26 +0100 Subject: [PATCH] Removed API key generation as syncthing does this automatically now. --- .../nutomic/syncthingandroid/util/ConfigXml.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java b/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java index 0c30f50e..11adaa74 100644 --- a/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java +++ b/src/main/java/com/nutomic/syncthingandroid/util/ConfigXml.java @@ -15,7 +15,6 @@ import org.xml.sax.SAXException; import java.io.File; import java.io.IOException; -import java.util.Random; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -113,21 +112,6 @@ public class ConfigXml { Element gui = (Element) mConfig.getDocumentElement() .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. NodeList globalAnnounceServer = options.getElementsByTagName("globalAnnounceServer"); for (int i = 0; i < globalAnnounceServer.getLength(); i++) {