1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-23 03:11:30 +00:00

Set user/password in config instead of removed STGUIAUTH (fixes #704).

This commit is contained in:
Felix Ableitner 2016-08-02 21:04:51 +02:00
parent 0085455209
commit 50f98e3f69
36 changed files with 81 additions and 143 deletions

View file

@ -25,6 +25,7 @@ dependencies {
compile 'com.android.support:design:24.1.1'
compile 'com.google.zxing:android-integration:3.2.1'
compile 'com.google.code.gson:gson:2.7'
compile 'org.mindrot:jbcrypt:0.3m'
androidTestCompile 'com.squareup.okhttp:mockwebserver:2.4.0'
}

View file

@ -7,6 +7,7 @@ import android.net.http.SslError;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.View;
import android.webkit.HttpAuthHandler;
@ -16,6 +17,7 @@ import android.webkit.WebViewClient;
import com.nutomic.syncthingandroid.R;
import com.nutomic.syncthingandroid.syncthing.SyncthingService;
import com.nutomic.syncthingandroid.util.ConfigXml;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@ -44,6 +46,8 @@ public class WebGuiActivity extends SyncthingActivity
private X509Certificate mCaCert;
private ConfigXml mConfig;
/**
* Hides the loading screen and shows the WebView once it is fully loaded.
*/
@ -53,7 +57,7 @@ public class WebGuiActivity extends SyncthingActivity
* Catch (self-signed) SSL errors and test if they correspond to Syncthing's certificate.
*/
@Override
public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
try {
int sdk = android.os.Build.VERSION.SDK_INT;
if (sdk >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
@ -82,8 +86,10 @@ public class WebGuiActivity extends SyncthingActivity
}
}
public void onReceivedHttpAuthRequest (WebView view, HttpAuthHandler handler, String host, String realm) {
handler.proceed(getService().getApi().getGuiUser(), getService().getApi().getGuiPassword());
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
String password = PreferenceManager.getDefaultSharedPreferences(WebGuiActivity.this)
.getString("web_gui_password", "");
handler.proceed(mConfig.getUserName(), password);
}
@Override
@ -106,6 +112,7 @@ public class WebGuiActivity extends SyncthingActivity
setContentView(R.layout.activity_web_gui);
mLoadingView = findViewById(R.id.loading);
mConfig = new ConfigXml(this);
loadCaCert();
mWebView = (WebView) findViewById(R.id.webview);

View file

@ -44,8 +44,10 @@ public class SettingsFragment extends PreferenceFragment
private static final String DEVICE_NAME_KEY = "deviceName";
private static final String USAGE_REPORT_ACCEPTED = "urAccepted";
private static final String ADDRESS = "address";
private static final String GUI_USER = "gui_user";
private static final String GUI_PASSWORD = "gui_password";
private static final String USER = "user";
// Note that this preference is seperate from the syncthing config value. While Syncthing
// stores a password hash, we store the plaintext password in the Android preferences.
private static final String PASSWORD = "web_gui_password";
private static final String EXPORT_CONFIG = "export_config";
private static final String IMPORT_CONFIG = "import_config";
private static final String STTRACE = "sttrace";
@ -96,6 +98,13 @@ public class SettingsFragment extends PreferenceFragment
Preference address = mGuiScreen.findPreference(ADDRESS);
address.setOnPreferenceChangeListener(this);
applyPreference(address, api.getValue(RestApi.TYPE_GUI, ADDRESS));
Preference user = mGuiScreen.findPreference(USER);
user.setOnPreferenceChangeListener(this);
applyPreference(user, api.getValue(RestApi.TYPE_GUI, USER));
Preference password = mGuiScreen.findPreference(PASSWORD);
password.setOnPreferenceChangeListener(this);
}
}
@ -113,7 +122,6 @@ public class SettingsFragment extends PreferenceFragment
}
}
/**
* Loads layout, sets version from Rest API.
*
@ -139,8 +147,6 @@ public class SettingsFragment extends PreferenceFragment
Preference appVersion = screen.findPreference(APP_VERSION_KEY);
mOptionsScreen = (PreferenceScreen) screen.findPreference(SYNCTHING_OPTIONS_KEY);
mGuiScreen = (PreferenceScreen) screen.findPreference(SYNCTHING_GUI_KEY);
final Preference user = screen.findPreference(GUI_USER);
Preference password = screen.findPreference(GUI_PASSWORD);
Preference sttrace = findPreference(STTRACE);
try {
@ -159,8 +165,6 @@ public class SettingsFragment extends PreferenceFragment
screen.findPreference(EXPORT_CONFIG).setOnPreferenceClickListener(this);
screen.findPreference(IMPORT_CONFIG).setOnPreferenceClickListener(this);
screen.findPreference(SYNCTHING_RESET).setOnPreferenceClickListener(this);
user.setOnPreferenceChangeListener(this);
password.setOnPreferenceChangeListener(this);
sttrace.setOnPreferenceChangeListener(this);
}
@ -256,32 +260,22 @@ public class SettingsFragment extends PreferenceFragment
} else if (preference.getKey().equals(ADDRESS)) {
mSyncthingService.getApi().setValue(
RestApi.TYPE_GUI, preference.getKey(), o, false, getActivity());
} else if (preference.getKey().equals(USER)) {
mSyncthingService.getApi().setValue(
RestApi.TYPE_GUI, preference.getKey(), o, false, getActivity());
} else if (preference.getKey().equals(PASSWORD)) {
mSyncthingService.getApi().setValue(
RestApi.TYPE_GUI, "password", o, false, getActivity());
}
// Avoid any code injection.
int error = 0;
if (preference.getKey().equals(STTRACE)) {
if (((String) o).matches("[a-z, ]*"))
requireRestart = true;
else
error = R.string.toast_invalid_sttrace;
} else if (preference.getKey().equals(GUI_USER)) {
String s = (String) o;
if (!s.contains(":") && !s.contains("'"))
requireRestart = true;
else
error = R.string.toast_invalid_username;
} else if (preference.getKey().equals(GUI_PASSWORD)) {
String s = (String) o;
if (!s.contains(":") && !s.contains("'"))
requireRestart = true;
else
error = R.string.toast_invalid_password;
}
if (error != 0) {
Toast.makeText(getActivity(), error, Toast.LENGTH_SHORT).show();
return false;
else {
Toast.makeText(getActivity(), R.string.toast_invalid_sttrace, Toast.LENGTH_SHORT).show();
return false;
}
}
if (requireRestart)

View file

@ -173,10 +173,6 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
private final String mApiKey;
private final String mGuiUser;
private final String mGuiPassword;
private final String mHttpsCertPath;
private JSONObject mConfig;
@ -207,13 +203,11 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
*/
private final Map<String, String> mCacheFolderPathLookup = new HashMap<String, String>();
public RestApi(Context context, String url, String apiKey, String guiUser, String guiPassword,
OnApiAvailableListener apiListener, OnConfigChangedListener configListener) {
public RestApi(Context context, String url, String apiKey, OnApiAvailableListener apiListener,
OnConfigChangedListener configListener) {
mContext = context;
mUrl = url;
mApiKey = apiKey;
mGuiUser = guiUser;
mGuiPassword = guiPassword;
mHttpsCertPath = mContext.getFilesDir() + "/" + SyncthingService.HTTPS_CERT_FILE;
mOnApiAvailableListener = apiListener;
mOnConfigChangedListener = configListener;
@ -1079,18 +1073,6 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
return new Device();
}
public String getApiKey() {
return mApiKey;
}
public String getGuiUser() {
return mGuiUser;
}
public String getGuiPassword() {
return mGuiPassword;
}
/**
* Returns value of usage reporting preference.
*/

View file

@ -120,8 +120,6 @@ public class SyncthingRunnable implements Runnable {
env.put("STTRACE", sp.getString("sttrace", ""));
env.put("STNORESTART", "1");
env.put("STNOUPGRADE", "1");
env.put("STGUIAUTH", sp.getString("gui_user", "") + ":" +
sp.getString("gui_password", ""));
if (sp.getBoolean("use_tor", false)) {
env.put("all_proxy", "socks5://localhost:9050");
env.put("ALL_PROXY_NO_FALLBACK", "1");

View file

@ -305,22 +305,8 @@ public class SyncthingService extends Service implements
@Override
@TargetApi(21)
public void onCreate() {
super.onCreate();
PRNGFixes.apply();
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
if (isFirstStart()) {
char[] chars =
"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray();
StringBuilder sb = new StringBuilder();
SecureRandom random = new SecureRandom();
for (int i = 0; i < 20; i++)
sb.append(chars[random.nextInt(chars.length)]);
String user = Build.MODEL.replaceAll("[^a-zA-Z0-9 ]", "");
Log.i(TAG, "Generated GUI username and password (username is " + user + ")");
sp.edit().putString("gui_user", user)
.putString("gui_password", sb.toString()).apply();
}
mDeviceStateHolder = new DeviceStateHolder(SyncthingService.this);
registerReceiver(mDeviceStateHolder, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
@ -328,9 +314,9 @@ public class SyncthingService extends Service implements
registerReceiver(mPowerSaveModeChangedReceiver,
new IntentFilter(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED));
}
new StartupTask(sp.getString("gui_user",""), sp.getString("gui_password","")).execute();
sp.registerOnSharedPreferenceChangeListener(this);
new StartupTask().execute();
PreferenceManager.getDefaultSharedPreferences(this)
.registerOnSharedPreferenceChangeListener(this);
}
/**
@ -339,13 +325,6 @@ public class SyncthingService extends Service implements
* {@code Pair<String, String>}.
*/
private class StartupTask extends AsyncTask<Void, Void, Pair<String, String>> {
String mGuiUser;
String mGuiPassword;
public StartupTask(String guiUser, String guiPassword) {
mGuiUser = guiUser;
mGuiPassword = guiPassword;
}
@Override
protected Pair<String, String> doInBackground(Void... voids) {
@ -368,7 +347,6 @@ public class SyncthingService extends Service implements
}
mApi = new RestApi(SyncthingService.this, urlAndKey.first, urlAndKey.second,
mGuiUser, mGuiPassword,
new RestApi.OnApiAvailableListener() {
@Override
public void onApiAvailable() {

View file

@ -3,11 +3,13 @@ package com.nutomic.syncthingandroid.util;
import android.content.Context;
import android.os.Build;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.util.Log;
import com.nutomic.syncthingandroid.R;
import com.nutomic.syncthingandroid.syncthing.SyncthingRunnable;
import org.mindrot.jbcrypt.BCrypt;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@ -16,6 +18,7 @@ import org.xml.sax.SAXException;
import java.io.File;
import java.io.IOException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Locale;
@ -96,6 +99,7 @@ public class ConfigXml {
if (isFirstStart) {
changeDefaultFolder();
generateLoginInfo();
}
updateIfNeeded();
}
@ -116,6 +120,10 @@ public class ConfigXml {
return getGuiElement().getElementsByTagName("apikey").item(0).getTextContent();
}
public String getUserName() {
return getGuiElement().getElementsByTagName("user").item(0).getTextContent();
}
/**
* Updates the config file.
* <p/>
@ -225,7 +233,7 @@ public class ConfigXml {
/**
* Change default folder id to camera and path to camera folder path.
*/
public void changeDefaultFolder() {
private void changeDefaultFolder() {
Element folder = (Element) mConfig.getDocumentElement()
.getElementsByTagName("folder").item(0);
String model = Build.MODEL
@ -240,6 +248,36 @@ public class ConfigXml {
saveChanges();
}
/**
* Generates username and config, stores them in config and preferences.
*
* We have to store the plaintext password in preferences, because we need it in
* WebGuiActivity. The password in the config is hashed, so we can't use it directly.
*/
private void generateLoginInfo() {
char[] chars =
"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray();
StringBuilder password = new StringBuilder();
SecureRandom random = new SecureRandom();
for (int i = 0; i < 20; i++)
password.append(chars[random.nextInt(chars.length)]);
String user = Build.MODEL.replaceAll("[^a-zA-Z0-9 ]", "");
Log.i(TAG, "Generated GUI username and password (username is " + user + ")");
Node userNode = mConfig.createElement("user");
getGuiElement().appendChild(userNode);
userNode.setTextContent(user);
Node passwordNode = mConfig.createElement("password");
getGuiElement().appendChild(passwordNode);
String hashed = BCrypt.hashpw(password.toString(), BCrypt.gensalt());
passwordNode.setTextContent(hashed);
PreferenceManager.getDefaultSharedPreferences(mContext).edit()
.putString("web_gui_password", password.toString())
.apply();
}
/**
* Writes updated mConfig back to file.
*/

View file

@ -20,7 +20,6 @@
android:orientation="vertical">
<ProgressBar
android:id="@+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp" />

View file

@ -7,7 +7,6 @@
android:theme="?alertDialogTheme">
<ProgressBar
android:id="@+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/abc_action_bar_content_inset_material"

View file

@ -100,7 +100,6 @@
android:paddingRight="@dimen/abc_action_bar_content_inset_material">
<TextView
android:id="@+id/cpu_usage_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cpu_usage"
@ -124,7 +123,6 @@
android:paddingRight="@dimen/abc_action_bar_content_inset_material">
<TextView
android:id="@+id/ram_usage_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/ram_usage"
@ -196,7 +194,6 @@
android:paddingRight="@dimen/abc_action_bar_content_inset_material">
<TextView
android:id="@+id/announce_server_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/announce_server"

View file

@ -6,7 +6,6 @@
tools:context=".fragments.FolderFragment">
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="?android:listDivider"

View file

@ -182,9 +182,7 @@
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">В настройките на STTRACE са разрешени само символите a-z и \',\'</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Символите : и \' ме могат да бъдат ползвани като част от потребителско име</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Символите : и \' ме могат да бъдат ползвани като част от парола</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Нулиране на базата данни</string>
<!--Syncthing was reset-->

View file

@ -194,9 +194,7 @@ Všechny problémy, se kterými se setkáte, nahlašte prosím přes Github.</st
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">V STTRACE jsou povoleny pouze znaky a-z a \',\'</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">V uživatelském jménu nejsou povoleny znaky : a \'</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">V heslu nejsou povoleny znaky : a \'</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Resetovat databázi</string>
<!--Syncthing was reset-->

View file

@ -185,9 +185,7 @@ Bitte auftretenden Probleme via Github melden.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Nur a-z und \',\' sind in STTRACE Optionen errlaubt</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Die Zeichen : und \' sind im Benutzernamen nicht erlaubt</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Die Zeichen : und \' sind im Passwort nicht erlaubt</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Datenbank zurücksetzen</string>
<!--Syncthing was reset-->

View file

@ -185,9 +185,7 @@ Por favor reporte cualquier problema que encuentre por medio de Github.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Sólo (a-z) y (\',\') están permitidos en las opciones de STTRACE</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Los caracteres : y \' no están permitidos en el nombre de usuario</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Los caracteres : y \' no están permitidos en la contraseña</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Reiniciar Base de Datos</string>
<!--Syncthing was reset-->

View file

@ -177,9 +177,7 @@ Por favor informe de qualquier problema que encuentres via Github.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Sólo se permiten a-z y \',\' en las opciones STTRACE</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">No se permiten los carácteres : y \' en el nombre de usuario</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">No se permiten los carácteres : y \' en la contraseña</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Restablecer base de datos</string>
<!--Syncthing was reset-->

View file

@ -191,9 +191,7 @@ S\'il vous plait, signalez les problèmes que vous rencontrez via Gihub.</string
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Seuls, les caractères a-z et \',\' sont autorisés dans les options STTRACE</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Les caractères : et \' ne sont pas autorisés dans le nom d\'utilisateur</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Les caractères : et \' ne sont pas autorisés dans le mot de passe</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Remise à zéro de la base de données</string>
<!--Syncthing was reset-->

View file

@ -194,9 +194,7 @@ Riferisci tramite Github i problemi che incontri.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Solo le lettere da a-z e la virgola \',\' sono consentiti nelle opzioni STTRACE</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">I caratteri : (duepunti) e \' (apostrofo) non sono consentiti nel nome utente</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">I caratteri : (duepunti) e \' (apostrofo) non sono consentiti nella password</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Reset del Database</string>
<!--Syncthing was reset-->

View file

@ -194,9 +194,7 @@
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">STTRACE オプションでは、a-z および \',\' のみ使用できます。</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">ユーザー名に 文字 : および \' は使用できません</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">パスワードに 文字 : および \' は使用できません</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">データベースをリセット</string>
<!--Syncthing was reset-->

View file

@ -193,9 +193,7 @@
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">STTRACE 옵션에서는 a-z 와 \'.\' 외의 문자를 사용할 수 없습니다.</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">문자 :와 \'은 사용자명으로 사용할 수 없습니다</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">문자 :와 \'은 비밀번호로 사용할 수 없습니다</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">데이터베이스 리셋</string>
<!--Syncthing was reset-->

View file

@ -194,9 +194,7 @@ Vennligst rapporter eventuelle problemer som oppstår via GitHub.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Bare a-z og \',\' er tillatt som STTRACE-valg</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Tegnene : og \' er ikke tillatt i brukernavn</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Tegnene : og \' er ikke tillatt i passord</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Nullstill database</string>
<!--Syncthing was reset-->

View file

@ -194,9 +194,7 @@ Gelieve alle problemen die je tegenkomt via GitHub te melden.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Enkel a-z en \',\' zijn toegestaan in STTRACE-opties</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Tekens : en \' zijn niet toegestaan in gebruikersnaam</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Tekens : en \' zijn niet toegestaan in wachtwoord</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Database opnieuw instellen</string>
<!--Syncthing was reset-->

View file

@ -194,9 +194,7 @@ Om du skulle støyte på problem, ver snill å rapportere dei via Github.</strin
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Berre a-z og \',\' er tillatne i STTRACE-alternativ</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Teikna : og \' er ikkje tillatne i brukernamn</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Teikna : og \' er ikkje tillatne i passord</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Nullstill database</string>
<!--Syncthing was reset-->

View file

@ -181,9 +181,7 @@ Proszę zgłaszać błędy programu w serwisie Github.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Tylko znaki a-z oraz „,” są dopuszczalne w STTRACE</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Znaki „:” oraz „\'” są niedozwolone w nazwie użytkownika</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Znaki „:” oraz „\'” są niedozwolone w haśle</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Przywróć pierwotny stan bazy danych</string>
<!--Syncthing was reset-->

View file

@ -194,9 +194,7 @@ Por favor, informe-nos sobre quaisquer problemas via Github.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Somente a-z e \",\" (vírgula) são permitidos nas opções do STTRACE</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Caracteres \":\" (dois-pontos) e \"\'\" (apóstrofo) não são permitidos no nome de usuário</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Caracteres \":\" (dois-pontos) e \"\'\" (apóstrofo) não são permitidos na senha</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Limpar banco de dados</string>
<!--Syncthing was reset-->

View file

@ -172,9 +172,7 @@ Relate quaisquer problemas que encontre via Github, por favor.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Apenas é permitido usar a-z e \';\' nas opções do STTRACE</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Os caracteres : e \' não são permitidos no nome de utilizador</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Os caracteres : e \' não são permitidos na senha</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Reiniciar a base de dados</string>
<!--Syncthing was reset-->

View file

@ -188,9 +188,7 @@
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">В настройках STTRACE можно использовать только символы a-z и \',\'</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Символы : и \' запрещено использовать в имени пользователя</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Символы : и \' запрещено использовать в пароле</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Сбросить базу данных</string>
<!--Syncthing was reset-->

View file

@ -170,9 +170,7 @@ Aby ste mohli zdielať dáta s ostatnými zariadeniami, musíte najprv pridať i
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">V STTRACE options sú povolené iba znaky a-z a \',\'</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Dvojbodka a apostrof nie sú v uživatelskom mene povolené</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Dvojbodka a apostrof nie sú v hesle povolené</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Resetovať Databázu</string>
<!--Syncthing was reset-->

View file

@ -194,9 +194,7 @@ Vänligen rapportera eventuella problem du stöter på via Github.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Endast a-z och \',\' är tillåtna i STTRACE alternativ</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Tecknena : och \' tillåts inte i användarnamnet</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Tecknet : och \' tillåts inte i lösenordet</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Återställ databas</string>
<!--Syncthing was reset-->

View file

@ -194,9 +194,7 @@ Vänligen rapportera eventuella problem du stöter på via Github.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Endast a-z och \',\' är tillåtna i STTRACE alternativ</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Tecknena : och \' tillåts inte i användarnamnet</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Tecknena : och \' tillåts inte i lösenordet</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Återställ databas</string>
<!--Syncthing was reset-->

View file

@ -177,9 +177,7 @@ Lütfen, herhangi bir sorunla karşılaştığınızda Github üzerinden bildiri
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">STTRACE seçenekleri içinde sadece a-z ve \',\' karakterleri kullanabilirsiniz</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Kullanıcı adı içinde : ve \' karakterleri kullanamazsınız</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Parola içinde : ve \' karakterleri kullanamazsınız</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Veritabanını Sıfırla</string>
<!--Syncthing was reset-->

View file

@ -185,9 +185,7 @@ Xin báo cáo mọi vấn đề phát sinh thông qua Github.</string>
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">Chỉ cho phép a-z và \',\' trong tuỳ chọn STTRACE</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">Không cho phép : và \' trong tên người dùng</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">Không cho phép : và \' trong mật khẩu</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">Cài lại CSDL</string>
<!--Syncthing was reset-->

View file

@ -194,9 +194,7 @@
<!--Toast after entering invalid STTRACE params-->
<string name="toast_invalid_sttrace">STTRACE 选项仅允许 a-z 与逗号</string>
<!--Toast after entering invalid username-->
<string name="toast_invalid_username">用户名不允许存在符号 \'</string>
<!--Toast after entering invalid password-->
<string name="toast_invalid_password">密码不允许存在符号 \'</string>
<!--Title for the preference to reset Syncthing indexes-->
<string name="streset_title">重置数据库</string>
<!--Syncthing was reset-->

View file

@ -325,12 +325,6 @@ Please report any problems you encounter via Github.</string>
<!-- Toast after entering invalid STTRACE params -->
<string name="toast_invalid_sttrace">Only a-z and \',\' are allowed in STTRACE options</string>
<!-- Toast after entering invalid username -->
<string name="toast_invalid_username">Characters : and \' are not allowed in username</string>
<!-- Toast after entering invalid password -->
<string name="toast_invalid_password">Characters : and \' are not allowed in password</string>
<!-- Title for the preference to reset Syncthing indexes -->
<string name="streset_title">Reset Database</string>

View file

@ -41,11 +41,6 @@
<item name="android:background">@null</item>
</style>
<style name="Widget.Syncthing.Switch" parent="@style/Widget.AppCompat.CompoundButton.Switch" >
<item name="android:paddingLeft">4dp</item>
<item name="android:minHeight">48dp</item>
</style>
<style name="Widget.Syncthing.DrawerArrowToggle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">false</item>
<item name="color">@android:color/white</item>

View file

@ -116,12 +116,13 @@
android:inputType="textNoSuggestions" />
<EditTextPreference
android:key="gui_user"
android:key="user"
android:title="@string/gui_user"
android:inputType="textCapWords" />
android:inputType="textCapWords"
android:persistent="false" />
<EditTextPreference
android:key="gui_password"
android:key="web_gui_password"
android:title="@string/gui_password"
android:inputType="textVisiblePassword" />