mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-27 21:31:29 +00:00
Removed API key generation as syncthing does this automatically now.
This commit is contained in:
parent
092c0f4cc9
commit
b780fb57f0
1 changed files with 0 additions and 16 deletions
|
@ -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++) {
|
||||
|
|
Loading…
Reference in a new issue