Compare commits

..

17 Commits

Author SHA1 Message Date
akwizgran
5cd5fc7e43 Bump version numbers for 1.0.6 release. 2018-06-01 10:20:32 +01:00
akwizgran
abd9db70b9 Update translations, add Polish translation. 2018-06-01 10:18:42 +01:00
akwizgran
5025cf1e40 Merge branch 'remove-removable-drive-plugin' into 'master'
Remove RemovableDrivePlugin, refactor plugin interface

Closes #25

See merge request akwizgran/briar!817
2018-05-31 08:49:32 +00:00
akwizgran
834342fd3a Merge branch 'remove-reblog-scene-transition' into 'master'
Disable reblog scene transition as it even crashes my Android 7.1 device

Closes #785

See merge request akwizgran/briar!821
2018-05-29 15:56:07 +00:00
akwizgran
3028b236e1 Merge branch 'disable-prefetching' into 'master'
Disable pre-fetching in Threaded RecyclerView as a workaround for #1289

See merge request akwizgran/briar!820
2018-05-29 15:47:15 +00:00
Torsten Grote
254422bc02 Disable reblog scene transition as it even crashes my Android 7.1 device
Closes #785
2018-05-29 12:44:41 -03:00
Torsten Grote
c7949d6e00 Disable pre-fetching in Threaded RecyclerView as a workaround for #1289 2018-05-29 12:29:40 -03:00
Torsten Grote
0187264da7 Merge branch '1219-remove-debug-logging' into 'master'
Remove debug logging from setup process

See merge request akwizgran/briar!819
2018-05-28 13:59:22 +00:00
akwizgran
85a18cf53f Remove debug logging from setup process. 2018-05-28 14:34:20 +01:00
akwizgran
3181b695df Remove RemovableDrivePlugin, refactor plugin interface. 2018-05-25 13:57:38 +01:00
akwizgran
b2ac210586 Merge branch 'factor_out_plugin_conf' into 'master'
Make plugins and polling configurable

See merge request akwizgran/briar!814
2018-05-24 16:34:05 +00:00
Torsten Grote
d20340416d Merge branch 'jcenter-tor-binaries' into 'master'
Download Tor binaries from JCenter

See merge request akwizgran/briar!816
2018-05-24 12:21:14 +00:00
akwizgran
9da871718c Download Tor binaries from JCenter. 2018-05-24 10:54:34 +01:00
goapunk
3793cb841b Fix test and poller instantiation 2018-05-23 14:39:01 +02:00
goapunk
c6b88b51f0 Make plugins and polling configurable
* Move PluginConfig out of bramble-android. Projects using bramble now need to provide it.
* Add a PluginConfig#shouldPoll() method which can be used to disable polling altogether.
* Move Poller instantiation to the PluginManager.
2018-05-23 14:39:00 +02:00
Torsten Grote
2f00215a44 Merge branch 'remove-jtorctl-jar' into 'master'
Replace jtorctl jar with JCenter dependency

See merge request akwizgran/briar!815
2018-05-23 11:22:15 +00:00
akwizgran
def62bce5a Replace jtorctl jar with JCenter dependency. 2018-05-22 11:32:19 +01:00
73 changed files with 1092 additions and 1999 deletions

View File

@@ -1,11 +1,5 @@
import de.undercouch.gradle.tasks.download.Download
import de.undercouch.gradle.tasks.download.Verify
import java.security.NoSuchAlgorithmException
apply plugin: 'com.android.library'
apply plugin: 'witness'
apply plugin: 'de.undercouch.download'
android {
compileSdkVersion 27
@@ -14,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 10005
versionName "1.0.5"
versionCode 10006
versionName "1.0.6"
consumerProguardFiles 'proguard-rules.txt'
}
@@ -25,9 +19,14 @@ android {
}
}
configurations {
tor
}
dependencies {
implementation project(path: ':bramble-core', configuration: 'default')
implementation fileTree(dir: 'libs', include: '*.jar')
implementation 'org.briarproject:jtorctl:0.3'
tor 'org.briarproject:tor-android:0.2.9.15@zip'
annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2'
@@ -92,6 +91,8 @@ dependencyVerification {
'org.apache.httpcomponents:httpmime:4.1:httpmime-4.1.jar:31629566148e8a47688ae43b420abc3ecd783ed15b33bebc00824bf24c9b15aa',
'org.bouncycastle:bcpkix-jdk15on:1.56:bcpkix-jdk15on-1.56.jar:7043dee4e9e7175e93e0b36f45b1ec1ecb893c5f755667e8b916eb8dd201c6ca',
'org.bouncycastle:bcprov-jdk15on:1.56:bcprov-jdk15on-1.56.jar:963e1ee14f808ffb99897d848ddcdb28fa91ddda867eb18d303e82728f878349',
'org.briarproject:jtorctl:0.3:jtorctl-0.3.jar:f2939238a097898998432effe93b0334d97a787972ab3a91a8973a1d309fc864',
'org.briarproject:tor-android:0.2.9.15:tor-android-0.2.9.15.zip:34a6474ee219ffa52e0f3393e917dda6ed03d320b02247d4fa5075aa4094ee6d',
'org.codehaus.groovy:groovy-all:2.4.12:groovy-all-2.4.12.jar:6a56af4bd48903d56bec62821876cadefafd007360cc6bd0d8f7aa8d72b38be4',
'org.codehaus.mojo:animal-sniffer-annotations:1.14:animal-sniffer-annotations-1.14.jar:2068320bd6bad744c3673ab048f67e30bef8f518996fa380033556600669905d',
'org.glassfish.jaxb:jaxb-core:2.2.11:jaxb-core-2.2.11.jar:37bcaee8ebb04362c8352a5bf6221b86967ecdab5164c696b10b9a2bb587b2aa',
@@ -112,81 +113,9 @@ dependencyVerification {
]
}
ext.torBinaryDir = 'src/main/res/raw'
ext.torVersion = '0.2.9.14'
ext.geoipVersion = '2017-11-06'
ext.torDownloadUrl = 'https://briarproject.org/build/'
def torBinaries = [
"tor_arm" : '1710ea6c47b7f4c1a88bdf4858c7893837635db10e8866854eed8d61629f50e8',
"tor_arm_pie": '974e6949507db8fa2ea45231817c2c3677ed4ccf5488a2252317d744b0be1917',
"tor_x86" : '3a5e45b3f051fcda9353b098b7086e762ffe7ba9242f7d7c8bf6523faaa8b1e9',
"tor_x86_pie": 'd1d96d8ce1a4b68accf04850185780d10cd5563d3552f7e1f040f8ca32cb4e51',
"geoip" : '8239b98374493529a29096e45fc5877d4d6fdad0146ad8380b291f90d61484ea'
]
def verifyOrDeleteBinary(name, chksum, alreadyVerified) {
return tasks.create("verifyOrDeleteBinary${name}", VerifyOrDelete) {
src "${torBinaryDir}/${name}.zip"
algorithm 'SHA-256'
checksum chksum
result alreadyVerified
onlyIf {
src.exists()
}
}
}
def downloadBinary(name, chksum, alreadyVerified) {
return tasks.create([
name: "downloadBinary${name}",
type: Download,
dependsOn: verifyOrDeleteBinary(name, chksum, alreadyVerified)]) {
src "${torDownloadUrl}${name}.zip"
.replace('tor_', "tor-${torVersion}-")
.replace('geoip', "geoip-${geoipVersion}")
.replaceAll('_', '-')
dest "${torBinaryDir}/${name}.zip"
onlyIf {
!dest.exists()
}
}
}
def verifyBinary(name, chksum) {
boolean[] alreadyVerified = [false]
return tasks.create([
name : "verifyBinary${name}",
type : Verify,
dependsOn: downloadBinary(name, chksum, alreadyVerified)]) {
src "${torBinaryDir}/${name}.zip"
algorithm 'SHA-256'
checksum chksum
onlyIf {
!alreadyVerified[0]
}
}
}
project.afterEvaluate {
torBinaries.every { name, checksum ->
preBuild.dependsOn.add(verifyBinary(name, checksum))
}
}
class VerifyOrDelete extends Verify {
boolean[] result
@TaskAction
@Override
void verify() throws IOException, NoSuchAlgorithmException {
try {
super.verify()
result[0] = true
} catch (Exception e) {
println "${src} failed verification - deleting"
src.delete()
}
copy {
from configurations.tor.collect { zipTree(it) }
into 'src/main/res/raw'
}
}

View File

@@ -1,12 +1,10 @@
package org.briarproject.bramble;
import org.briarproject.bramble.plugin.AndroidPluginModule;
import org.briarproject.bramble.system.AndroidSystemModule;
import dagger.Module;
@Module(includes = {
AndroidPluginModule.class,
AndroidSystemModule.class
})
public class BrambleAndroidModule {

View File

@@ -1,67 +0,0 @@
package org.briarproject.bramble.plugin;
import android.app.Application;
import android.content.Context;
import org.briarproject.bramble.api.event.EventBus;
import org.briarproject.bramble.api.lifecycle.IoExecutor;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.plugin.BackoffFactory;
import org.briarproject.bramble.api.plugin.PluginConfig;
import org.briarproject.bramble.api.plugin.duplex.DuplexPluginFactory;
import org.briarproject.bramble.api.plugin.simplex.SimplexPluginFactory;
import org.briarproject.bramble.api.system.AndroidExecutor;
import org.briarproject.bramble.api.system.LocationUtils;
import org.briarproject.bramble.api.system.Scheduler;
import org.briarproject.bramble.plugin.bluetooth.AndroidBluetoothPluginFactory;
import org.briarproject.bramble.plugin.tcp.AndroidLanTcpPluginFactory;
import org.briarproject.bramble.plugin.tor.TorPluginFactory;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import javax.net.SocketFactory;
import dagger.Module;
import dagger.Provides;
@Module
public class AndroidPluginModule {
@Provides
PluginConfig providePluginConfig(@IoExecutor Executor ioExecutor,
@Scheduler ScheduledExecutorService scheduler,
AndroidExecutor androidExecutor, SecureRandom random,
SocketFactory torSocketFactory, BackoffFactory backoffFactory,
Application app, LocationUtils locationUtils, EventBus eventBus) {
Context appContext = app.getApplicationContext();
DuplexPluginFactory bluetooth =
new AndroidBluetoothPluginFactory(ioExecutor, androidExecutor,
appContext, random, eventBus, backoffFactory);
DuplexPluginFactory tor = new TorPluginFactory(ioExecutor, scheduler,
appContext, locationUtils, eventBus, torSocketFactory,
backoffFactory);
DuplexPluginFactory lan = new AndroidLanTcpPluginFactory(ioExecutor,
scheduler, backoffFactory, appContext);
Collection<DuplexPluginFactory> duplex =
Arrays.asList(bluetooth, tor, lan);
@NotNullByDefault
PluginConfig pluginConfig = new PluginConfig() {
@Override
public Collection<DuplexPluginFactory> getDuplexFactories() {
return duplex;
}
@Override
public Collection<SimplexPluginFactory> getSimplexFactories() {
return Collections.emptyList();
}
};
return pluginConfig;
}
}

View File

@@ -50,7 +50,6 @@ import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -334,7 +333,7 @@ class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
return zin;
}
private InputStream getConfigInputStream() throws IOException {
private InputStream getConfigInputStream() {
int resId = getResourceId("torrc");
return appContext.getResources().openRawResource(resId);
}
@@ -499,7 +498,7 @@ class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
}
@Override
public void stop() throws PluginException {
public void stop() {
running = false;
tryToClose(socket);
if (networkStateReceiver != null)
@@ -533,20 +532,16 @@ class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
}
@Override
public void poll(Collection<ContactId> connected) {
public void poll(Map<ContactId, TransportProperties> contacts) {
if (!isRunning()) return;
backoff.increment();
Map<ContactId, TransportProperties> remote =
callback.getRemoteProperties();
for (Entry<ContactId, TransportProperties> e : remote.entrySet()) {
ContactId c = e.getKey();
if (!connected.contains(c)) connectAndCallBack(c, e.getValue());
for (Entry<ContactId, TransportProperties> e : contacts.entrySet()) {
connectAndCallBack(e.getKey(), e.getValue());
}
}
private void connectAndCallBack(ContactId c, TransportProperties p) {
ioExecutor.execute(() -> {
if (!isRunning()) return;
DuplexTransportConnection d = createConnection(p);
if (d != null) {
backoff.reset();
@@ -556,13 +551,8 @@ class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
}
@Override
public DuplexTransportConnection createConnection(ContactId c) {
public DuplexTransportConnection createConnection(TransportProperties p) {
if (!isRunning()) return null;
return createConnection(callback.getRemoteProperties(c));
}
@Nullable
private DuplexTransportConnection createConnection(TransportProperties p) {
String onion = p.get(PROP_ONION);
if (StringUtils.isNullOrEmpty(onion)) return null;
if (!ONION.matcher(onion).matches()) {

View File

@@ -15,7 +15,6 @@ import java.util.List;
import java.util.logging.Logger;
import static android.content.Context.MODE_PRIVATE;
import static java.util.logging.Level.INFO;
public class AndroidUtils {
@@ -59,57 +58,28 @@ public class AndroidUtils {
&& !address.equals(FAKE_BLUETOOTH_ADDRESS);
}
public static void logDataDirContents(Context ctx) {
if (LOG.isLoggable(INFO)) {
LOG.info("Contents of data directory:");
logFileOrDir(new File(ctx.getApplicationInfo().dataDir));
}
}
private static void logFileOrDir(File f) {
LOG.info(f.getAbsolutePath() + " " + f.length());
if (f.isDirectory()) {
File[] children = f.listFiles();
if (children == null) {
LOG.info("Could not list files in " + f.getAbsolutePath());
} else {
for (File child : children) logFileOrDir(child);
}
}
}
public static void deleteAppData(Context ctx, SharedPreferences... clear) {
// Clear and commit shared preferences
for (SharedPreferences prefs : clear) {
boolean cleared = prefs.edit().clear().commit();
if (LOG.isLoggable(INFO)) {
if (cleared) LOG.info("Cleared shared preferences");
else LOG.info("Could not clear shared preferences");
}
if (!prefs.edit().clear().commit())
LOG.warning("Could not clear shared preferences");
}
// Delete files, except lib and shared_prefs directories
File dataDir = new File(ctx.getApplicationInfo().dataDir);
if (LOG.isLoggable(INFO))
LOG.info("Deleting app data from " + dataDir.getAbsolutePath());
File[] children = dataDir.listFiles();
if (children != null) {
if (children == null) {
LOG.warning("Could not list files in app data dir");
} else {
for (File child : children) {
String name = child.getName();
if (!name.equals("lib") && !name.equals("shared_prefs")) {
if (LOG.isLoggable(INFO))
LOG.info("Deleting " + child.getAbsolutePath());
IoUtils.deleteFileOrDir(child);
}
}
} else if (LOG.isLoggable(INFO)) {
LOG.info("Could not list files in " + dataDir.getAbsolutePath());
}
// Recreate the cache dir as some OpenGL drivers expect it to exist
boolean recreated = new File(dataDir, "cache").mkdir();
if (LOG.isLoggable(INFO)) {
if (recreated) LOG.info("Recreated cache dir");
else LOG.info("Could not recreate cache dir");
}
if (!new File(dataDir, "cache").mkdir())
LOG.warning("Could not recreate cache dir");
}
public static File getReportDir(Context ctx) {

View File

@@ -0,0 +1,6 @@
package org.briarproject.bramble.api.plugin;
public interface FileConstants {
String PROP_PATH = "path";
}

View File

@@ -2,8 +2,9 @@ package org.briarproject.bramble.api.plugin;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.properties.TransportProperties;
import java.util.Collection;
import java.util.Map;
@NotNullByDefault
public interface Plugin {
@@ -39,21 +40,19 @@ public interface Plugin {
boolean isRunning();
/**
* Returns true if the plugin's {@link #poll(Collection)} method should be
* called periodically to attempt to establish connections.
* Returns true if the plugin should be polled periodically to attempt to
* establish connections.
*/
boolean shouldPoll();
/**
* Returns the desired interval in milliseconds between calls to the
* plugin's {@link #poll(Collection)} method.
* Returns the desired interval in milliseconds between polling attempts.
*/
int getPollingInterval();
/**
* Attempts to establish connections to contacts, passing any created
* connections to the callback. To avoid creating redundant connections,
* the plugin may exclude the given contacts from polling.
* Attempts to establish connections to the given contacts, passing any
* created connections to the callback.
*/
void poll(Collection<ContactId> connected);
void poll(Map<ContactId, TransportProperties> contacts);
}

View File

@@ -1,12 +1,9 @@
package org.briarproject.bramble.api.plugin;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.properties.TransportProperties;
import org.briarproject.bramble.api.settings.Settings;
import java.util.Map;
/**
* An interface through which a transport plugin interacts with the rest of
* the application.
@@ -25,17 +22,7 @@ public interface PluginCallback {
TransportProperties getLocalProperties();
/**
* Returns the plugin's remote transport properties.
*/
Map<ContactId, TransportProperties> getRemoteProperties();
/**
* Returns the plugin's remote transport properties for the given contact.
*/
TransportProperties getRemoteProperties(ContactId c);
/**
* Merges the given settings with the namespaced settings
* Merges the given settings with the plugin's settings
*/
void mergeSettings(Settings s);
@@ -45,34 +32,12 @@ public interface PluginCallback {
void mergeLocalProperties(TransportProperties p);
/**
* Presents the user with a choice among two or more named options and
* returns the user's response. The message may consist of a translatable
* format string and arguments.
*
* @return an index into the array of options indicating the user's choice,
* or -1 if the user cancelled the choice.
*/
int showChoice(String[] options, String... message);
/**
* Asks the user to confirm an action and returns the user's response. The
* message may consist of a translatable format string and arguments.
*/
boolean showConfirmationMessage(String... message);
/**
* Shows a message to the user. The message may consist of a translatable
* format string and arguments.
*/
void showMessage(String... message);
/**
* Signal that the transport got enabled.
* Signals that the transport is enabled.
*/
void transportEnabled();
/**
* Signal that the transport got disabled.
* Signals that the transport is disabled.
*/
void transportDisabled();
}

View File

@@ -12,4 +12,6 @@ public interface PluginConfig {
Collection<DuplexPluginFactory> getDuplexFactories();
Collection<SimplexPluginFactory> getSimplexFactories();
boolean shouldPoll();
}

View File

@@ -22,11 +22,6 @@ public interface TransportConnectionWriter {
*/
int getMaxIdleTime();
/**
* Returns the capacity of the transport connection in bytes.
*/
long getCapacity();
/**
* Returns an output stream for writing to the transport connection.
*/

View File

@@ -71,11 +71,6 @@ public abstract class AbstractDuplexTransportConnection
return plugin.getMaxIdleTime();
}
@Override
public long getCapacity() {
return Long.MAX_VALUE;
}
@Override
public OutputStream getOutputStream() throws IOException {
return AbstractDuplexTransportConnection.this.getOutputStream();

View File

@@ -1,10 +1,10 @@
package org.briarproject.bramble.api.plugin.duplex;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.data.BdfList;
import org.briarproject.bramble.api.keyagreement.KeyAgreementListener;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.plugin.Plugin;
import org.briarproject.bramble.api.properties.TransportProperties;
import javax.annotation.Nullable;
@@ -15,12 +15,11 @@ import javax.annotation.Nullable;
public interface DuplexPlugin extends Plugin {
/**
* Attempts to create and return a connection to the given contact using
* the current transport and configuration properties. Returns null if a
* connection cannot be created.
* Attempts to create and return a connection using the given transport
* properties. Returns null if a connection cannot be created.
*/
@Nullable
DuplexTransportConnection createConnection(ContactId c);
DuplexTransportConnection createConnection(TransportProperties p);
/**
* Returns true if the plugin supports short-range key agreement.

View File

@@ -5,7 +5,8 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.plugin.PluginCallback;
/**
* An interface for handling connections created by a duplex transport plugin.
* An interface through which a duplex plugin interacts with the rest of the
* application.
*/
@NotNullByDefault
public interface DuplexPluginCallback extends PluginCallback {

View File

@@ -1,10 +1,10 @@
package org.briarproject.bramble.api.plugin.simplex;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.plugin.Plugin;
import org.briarproject.bramble.api.plugin.TransportConnectionReader;
import org.briarproject.bramble.api.plugin.TransportConnectionWriter;
import org.briarproject.bramble.api.properties.TransportProperties;
import javax.annotation.Nullable;
@@ -15,18 +15,16 @@ import javax.annotation.Nullable;
public interface SimplexPlugin extends Plugin {
/**
* Attempts to create and return a reader for the given contact using the
* current transport and configuration properties. Returns null if a reader
* cannot be created.
* Attempts to create and return a reader for the given transport
* properties. Returns null if a reader cannot be created.
*/
@Nullable
TransportConnectionReader createReader(ContactId c);
TransportConnectionReader createReader(TransportProperties p);
/**
* Attempts to create and return a writer for the given contact using the
* current transport and configuration properties. Returns null if a writer
* cannot be created.
* Attempts to create and return a writer for the given transport
* properties. Returns null if a writer cannot be created.
*/
@Nullable
TransportConnectionWriter createWriter(ContactId c);
TransportConnectionWriter createWriter(TransportProperties p);
}

View File

@@ -7,8 +7,8 @@ import org.briarproject.bramble.api.plugin.TransportConnectionReader;
import org.briarproject.bramble.api.plugin.TransportConnectionWriter;
/**
* An interface for handling readers and writers created by a simplex transport
* plugin.
* An interface through which a simplex plugin interacts with the rest of the
* application.
*/
@NotNullByDefault
public interface SimplexPluginCallback extends PluginCallback {

View File

@@ -1,26 +0,0 @@
package org.briarproject.bramble.api.ui;
public interface UiCallback {
/**
* Presents the user with a choice among two or more named options and
* returns the user's response. The message may consist of a translatable
* format string and arguments.
*
* @return an index into the array of options indicating the user's choice,
* or -1 if the user cancelled the choice.
*/
int showChoice(String[] options, String... message);
/**
* Asks the user to confirm an action and returns the user's response. The
* message may consist of a translatable format string and arguments.
*/
boolean showConfirmationMessage(String... message);
/**
* Shows a message to the user. The message may consist of a translatable
* format string and arguments.
*/
void showMessage(String... message);
}

View File

@@ -13,7 +13,7 @@ import java.util.logging.Logger;
import javax.annotation.Nullable;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
@NotNullByDefault
public class IoUtils {
@@ -25,18 +25,21 @@ public class IoUtils {
delete(f);
} else if (f.isDirectory()) {
File[] children = f.listFiles();
if (children != null)
if (children == null) {
if (LOG.isLoggable(WARNING)) {
LOG.warning("Could not list files in "
+ f.getAbsolutePath());
}
} else {
for (File child : children) deleteFileOrDir(child);
}
delete(f);
}
}
private static void delete(File f) {
boolean deleted = f.delete();
if (LOG.isLoggable(INFO)) {
if (deleted) LOG.info("Deleted " + f.getAbsolutePath());
else LOG.info("Could not delete " + f.getAbsolutePath());
}
if (!f.delete() && LOG.isLoggable(WARNING))
LOG.warning("Could not delete " + f.getAbsolutePath());
}
public static void copyAndClose(InputStream in, OutputStream out) {

View File

@@ -22,19 +22,6 @@ public class OsUtils {
return os != null && os.contains("Mac OS");
}
public static boolean isMacLeopardOrNewer() {
if (!isMac() || version == null) return false;
try {
String[] v = version.split("\\.");
if (v.length != 3) return false;
int major = Integer.parseInt(v[0]);
int minor = Integer.parseInt(v[1]);
return major >= 10 && minor >= 5;
} catch (NumberFormatException e) {
return false;
}
}
public static boolean isLinux() {
return os != null && os.contains("Linux") && !isAndroid();
}

View File

@@ -8,6 +8,7 @@ import org.briarproject.bramble.api.lifecycle.Service;
import org.briarproject.bramble.api.lifecycle.ServiceException;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.plugin.ConnectionManager;
import org.briarproject.bramble.api.plugin.ConnectionRegistry;
import org.briarproject.bramble.api.plugin.Plugin;
import org.briarproject.bramble.api.plugin.PluginCallback;
import org.briarproject.bramble.api.plugin.PluginConfig;
@@ -29,17 +30,19 @@ import org.briarproject.bramble.api.properties.TransportProperties;
import org.briarproject.bramble.api.properties.TransportPropertyManager;
import org.briarproject.bramble.api.settings.Settings;
import org.briarproject.bramble.api.settings.SettingsManager;
import org.briarproject.bramble.api.ui.UiCallback;
import org.briarproject.bramble.api.system.Clock;
import org.briarproject.bramble.api.system.Scheduler;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Logger;
@@ -57,12 +60,15 @@ class PluginManagerImpl implements PluginManager, Service {
Logger.getLogger(PluginManagerImpl.class.getName());
private final Executor ioExecutor;
private final ScheduledExecutorService scheduler;
private final EventBus eventBus;
private final PluginConfig pluginConfig;
private final ConnectionManager connectionManager;
private final ConnectionRegistry connectionRegistry;
private final SettingsManager settingsManager;
private final TransportPropertyManager transportPropertyManager;
private final UiCallback uiCallback;
private final SecureRandom random;
private final Clock clock;
private final Map<TransportId, Plugin> plugins;
private final List<SimplexPlugin> simplexPlugins;
private final List<DuplexPlugin> duplexPlugins;
@@ -70,27 +76,41 @@ class PluginManagerImpl implements PluginManager, Service {
private final AtomicBoolean used = new AtomicBoolean(false);
@Inject
PluginManagerImpl(@IoExecutor Executor ioExecutor, EventBus eventBus,
PluginManagerImpl(@IoExecutor Executor ioExecutor,
@Scheduler ScheduledExecutorService scheduler, EventBus eventBus,
PluginConfig pluginConfig, ConnectionManager connectionManager,
ConnectionRegistry connectionRegistry,
SettingsManager settingsManager,
TransportPropertyManager transportPropertyManager,
UiCallback uiCallback) {
SecureRandom random, Clock clock) {
this.ioExecutor = ioExecutor;
this.scheduler = scheduler;
this.eventBus = eventBus;
this.pluginConfig = pluginConfig;
this.connectionManager = connectionManager;
this.connectionRegistry = connectionRegistry;
this.settingsManager = settingsManager;
this.transportPropertyManager = transportPropertyManager;
this.uiCallback = uiCallback;
this.random = random;
this.clock = clock;
plugins = new ConcurrentHashMap<>();
simplexPlugins = new CopyOnWriteArrayList<>();
duplexPlugins = new CopyOnWriteArrayList<>();
startLatches = new ConcurrentHashMap<>();
}
@Override
public void startService() throws ServiceException {
public void startService() {
if (used.getAndSet(true)) throw new IllegalStateException();
// Instantiate the poller
if (pluginConfig.shouldPoll()) {
LOG.info("Starting poller");
Poller poller = new Poller(ioExecutor, scheduler, connectionManager,
connectionRegistry, this, transportPropertyManager, random,
clock);
eventBus.addListener(poller);
}
// Instantiate the simplex plugins and start them asynchronously
LOG.info("Starting simplex plugins");
for (SimplexPluginFactory f : pluginConfig.getSimplexFactories()) {
@@ -273,26 +293,6 @@ class PluginManagerImpl implements PluginManager, Service {
}
}
@Override
public Map<ContactId, TransportProperties> getRemoteProperties() {
try {
return transportPropertyManager.getRemoteProperties(id);
} catch (DbException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
return Collections.emptyMap();
}
}
@Override
public TransportProperties getRemoteProperties(ContactId c) {
try {
return transportPropertyManager.getRemoteProperties(c, id);
} catch (DbException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
return new TransportProperties();
}
}
@Override
public void mergeSettings(Settings s) {
try {
@@ -311,21 +311,6 @@ class PluginManagerImpl implements PluginManager, Service {
}
}
@Override
public int showChoice(String[] options, String... message) {
return uiCallback.showChoice(options, message);
}
@Override
public boolean showConfirmationMessage(String... message) {
return uiCallback.showConfirmationMessage(message);
}
@Override
public void showMessage(String... message) {
uiCallback.showMessage(message);
}
@Override
public void transportEnabled() {
eventBus.broadcast(new TransportEnabledEvent(id));

View File

@@ -1,18 +1,10 @@
package org.briarproject.bramble.plugin;
import org.briarproject.bramble.api.event.EventBus;
import org.briarproject.bramble.api.lifecycle.IoExecutor;
import org.briarproject.bramble.api.lifecycle.LifecycleManager;
import org.briarproject.bramble.api.plugin.BackoffFactory;
import org.briarproject.bramble.api.plugin.ConnectionManager;
import org.briarproject.bramble.api.plugin.ConnectionRegistry;
import org.briarproject.bramble.api.plugin.PluginManager;
import org.briarproject.bramble.api.system.Clock;
import org.briarproject.bramble.api.system.Scheduler;
import java.security.SecureRandom;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import javax.inject.Inject;
import javax.inject.Singleton;
@@ -26,8 +18,6 @@ public class PluginModule {
public static class EagerSingletons {
@Inject
PluginManager pluginManager;
@Inject
Poller poller;
}
@Provides
@@ -35,19 +25,6 @@ public class PluginModule {
return new BackoffFactoryImpl();
}
@Provides
@Singleton
Poller providePoller(@IoExecutor Executor ioExecutor,
@Scheduler ScheduledExecutorService scheduler,
ConnectionManager connectionManager,
ConnectionRegistry connectionRegistry, PluginManager pluginManager,
SecureRandom random, Clock clock, EventBus eventBus) {
Poller poller = new Poller(ioExecutor, scheduler, connectionManager,
connectionRegistry, pluginManager, random, clock);
eventBus.addListener(poller);
return poller;
}
@Provides
@Singleton
ConnectionManager provideConnectionManager(

View File

@@ -2,6 +2,7 @@ package org.briarproject.bramble.plugin;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.contact.event.ContactStatusChangedEvent;
import org.briarproject.bramble.api.db.DbException;
import org.briarproject.bramble.api.event.Event;
import org.briarproject.bramble.api.event.EventListener;
import org.briarproject.bramble.api.lifecycle.IoExecutor;
@@ -19,10 +20,13 @@ import org.briarproject.bramble.api.plugin.event.ConnectionOpenedEvent;
import org.briarproject.bramble.api.plugin.event.TransportDisabledEvent;
import org.briarproject.bramble.api.plugin.event.TransportEnabledEvent;
import org.briarproject.bramble.api.plugin.simplex.SimplexPlugin;
import org.briarproject.bramble.api.properties.TransportProperties;
import org.briarproject.bramble.api.properties.TransportPropertyManager;
import org.briarproject.bramble.api.system.Clock;
import org.briarproject.bramble.api.system.Scheduler;
import java.security.SecureRandom;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executor;
@@ -33,10 +37,10 @@ import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Logger;
import javax.annotation.concurrent.ThreadSafe;
import javax.inject.Inject;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
@ThreadSafe
@NotNullByDefault
@@ -49,22 +53,24 @@ class Poller implements EventListener {
private final ConnectionManager connectionManager;
private final ConnectionRegistry connectionRegistry;
private final PluginManager pluginManager;
private final TransportPropertyManager transportPropertyManager;
private final SecureRandom random;
private final Clock clock;
private final Lock lock;
private final Map<TransportId, ScheduledPollTask> tasks; // Locking: lock
@Inject
Poller(@IoExecutor Executor ioExecutor,
@Scheduler ScheduledExecutorService scheduler,
ConnectionManager connectionManager,
ConnectionRegistry connectionRegistry, PluginManager pluginManager,
TransportPropertyManager transportPropertyManager,
SecureRandom random, Clock clock) {
this.ioExecutor = ioExecutor;
this.scheduler = scheduler;
this.connectionManager = connectionManager;
this.connectionRegistry = connectionRegistry;
this.pluginManager = pluginManager;
this.transportPropertyManager = transportPropertyManager;
this.random = random;
this.clock = clock;
lock = new ReentrantLock();
@@ -120,10 +126,15 @@ class Poller implements EventListener {
private void connectToContact(ContactId c, SimplexPlugin p) {
ioExecutor.execute(() -> {
TransportId t = p.getId();
if (!connectionRegistry.isConnected(c, t)) {
TransportConnectionWriter w = p.createWriter(c);
if (connectionRegistry.isConnected(c, t)) return;
try {
TransportProperties props =
transportPropertyManager.getRemoteProperties(c, t);
TransportConnectionWriter w = p.createWriter(props);
if (w != null)
connectionManager.manageOutgoingConnection(c, t, w);
} catch (DbException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
}
});
}
@@ -131,10 +142,15 @@ class Poller implements EventListener {
private void connectToContact(ContactId c, DuplexPlugin p) {
ioExecutor.execute(() -> {
TransportId t = p.getId();
if (!connectionRegistry.isConnected(c, t)) {
DuplexTransportConnection d = p.createConnection(c);
if (connectionRegistry.isConnected(c, t)) return;
try {
TransportProperties props =
transportPropertyManager.getRemoteProperties(c, t);
DuplexTransportConnection d = p.createConnection(props);
if (d != null)
connectionManager.manageOutgoingConnection(c, t, d);
} catch (DbException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
}
});
}
@@ -186,7 +202,17 @@ class Poller implements EventListener {
private void poll(Plugin p) {
TransportId t = p.getId();
if (LOG.isLoggable(INFO)) LOG.info("Polling plugin " + t);
p.poll(connectionRegistry.getConnectedContacts(t));
try {
Map<ContactId, TransportProperties> remote =
transportPropertyManager.getRemoteProperties(t);
Collection<ContactId> connected =
connectionRegistry.getConnectedContacts(t);
remote = new HashMap<>(remote);
remote.keySet().removeAll(connected);
if (!remote.isEmpty()) p.poll(remote);
} catch (DbException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
}
}
private class ScheduledPollTask {

View File

@@ -26,7 +26,6 @@ import org.briarproject.bramble.util.StringUtils;
import java.io.IOException;
import java.security.SecureRandom;
import java.util.Collection;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
@@ -250,19 +249,16 @@ abstract class BluetoothPlugin<SS> implements DuplexPlugin, EventListener {
}
@Override
public void poll(Collection<ContactId> connected) {
public void poll(Map<ContactId, TransportProperties> contacts) {
if (!isRunning() || !shouldAllowContactConnections()) return;
backoff.increment();
// Try to connect to known devices in parallel
Map<ContactId, TransportProperties> remote =
callback.getRemoteProperties();
for (Entry<ContactId, TransportProperties> e : remote.entrySet()) {
ContactId c = e.getKey();
if (connected.contains(c)) continue;
for (Entry<ContactId, TransportProperties> e : contacts.entrySet()) {
String address = e.getValue().get(PROP_ADDRESS);
if (StringUtils.isNullOrEmpty(address)) continue;
String uuid = e.getValue().get(PROP_UUID);
if (StringUtils.isNullOrEmpty(uuid)) continue;
ContactId c = e.getKey();
ioExecutor.execute(() -> {
if (!isRunning() || !shouldAllowContactConnections()) return;
if (!connectionLimiter.canOpenContactConnection()) return;
@@ -308,10 +304,9 @@ abstract class BluetoothPlugin<SS> implements DuplexPlugin, EventListener {
}
@Override
public DuplexTransportConnection createConnection(ContactId c) {
public DuplexTransportConnection createConnection(TransportProperties p) {
if (!isRunning() || !shouldAllowContactConnections()) return null;
if (!connectionLimiter.canOpenContactConnection()) return null;
TransportProperties p = callback.getRemoteProperties(c);
String address = p.get(PROP_ADDRESS);
if (StringUtils.isNullOrEmpty(address)) return null;
String uuid = p.get(PROP_UUID);

View File

@@ -1,27 +1,21 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.plugin.TransportConnectionReader;
import org.briarproject.bramble.api.plugin.TransportConnectionWriter;
import org.briarproject.bramble.api.plugin.simplex.SimplexPlugin;
import org.briarproject.bramble.api.plugin.simplex.SimplexPluginCallback;
import org.briarproject.bramble.api.properties.TransportProperties;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Collection;
import java.util.Locale;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Logger;
import javax.annotation.Nullable;
import static java.util.logging.Level.WARNING;
import static org.briarproject.bramble.api.transport.TransportConstants.MIN_STREAM_LENGTH;
import static org.briarproject.bramble.api.plugin.FileConstants.PROP_PATH;
import static org.briarproject.bramble.util.StringUtils.isNullOrEmpty;
@NotNullByDefault
abstract class FilePlugin implements SimplexPlugin {
@@ -29,25 +23,15 @@ abstract class FilePlugin implements SimplexPlugin {
private static final Logger LOG =
Logger.getLogger(FilePlugin.class.getName());
protected final Executor ioExecutor;
protected final SimplexPluginCallback callback;
protected final int maxLatency;
protected final AtomicBoolean used = new AtomicBoolean(false);
protected volatile boolean running = false;
protected abstract void writerFinished(File f, boolean exception);
@Nullable
protected abstract File chooseOutputDirectory();
protected abstract void readerFinished(File f, boolean exception,
boolean recognised);
protected abstract Collection<File> findFilesByName(String filename);
protected abstract void writerFinished(File f);
protected abstract void readerFinished(File f);
protected FilePlugin(Executor ioExecutor, SimplexPluginCallback callback,
int maxLatency) {
this.ioExecutor = ioExecutor;
FilePlugin(SimplexPluginCallback callback, int maxLatency) {
this.callback = callback;
this.maxLatency = maxLatency;
}
@@ -58,81 +42,36 @@ abstract class FilePlugin implements SimplexPlugin {
}
@Override
public int getMaxIdleTime() {
return Integer.MAX_VALUE; // We don't need keepalives
}
@Override
public boolean isRunning() {
return running;
}
@Override
public TransportConnectionReader createReader(ContactId c) {
return null;
}
@Override
public TransportConnectionWriter createWriter(ContactId c) {
if (!running) return null;
return createWriter(createConnectionFilename());
}
private String createConnectionFilename() {
StringBuilder s = new StringBuilder(12);
for (int i = 0; i < 8; i++) s.append((char) ('a' + Math.random() * 26));
s.append(".dat");
return s.toString();
}
// Package access for testing
boolean isPossibleConnectionFilename(String filename) {
return filename.toLowerCase(Locale.US).matches("[a-z]{8}\\.dat");
}
@Nullable
private TransportConnectionWriter createWriter(String filename) {
if (!running) return null;
File dir = chooseOutputDirectory();
if (dir == null || !dir.exists() || !dir.isDirectory()) return null;
File f = new File(dir, filename);
public TransportConnectionReader createReader(TransportProperties p) {
if (!isRunning()) return null;
String path = p.get(PROP_PATH);
if (isNullOrEmpty(path)) return null;
try {
long capacity = dir.getFreeSpace();
if (capacity < MIN_STREAM_LENGTH) return null;
OutputStream out = new FileOutputStream(f);
return new FileTransportWriter(f, out, capacity, this);
File file = new File(path);
FileInputStream in = new FileInputStream(file);
return new FileTransportReader(file, in, this);
} catch (IOException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
f.delete();
return null;
}
}
protected void createReaderFromFile(File f) {
if (!running) return;
ioExecutor.execute(new ReaderCreator(f));
}
private class ReaderCreator implements Runnable {
private final File file;
private ReaderCreator(File file) {
this.file = file;
}
@Override
public void run() {
if (isPossibleConnectionFilename(file.getName())) {
try {
FileInputStream in = new FileInputStream(file);
callback.readerCreated(new FileTransportReader(file, in,
FilePlugin.this));
} catch (IOException e) {
if (LOG.isLoggable(WARNING))
LOG.log(WARNING, e.toString(), e);
}
@Override
public TransportConnectionWriter createWriter(TransportProperties p) {
if (!isRunning()) return null;
String path = p.get(PROP_PATH);
if (isNullOrEmpty(path)) return null;
try {
File file = new File(path);
if (!file.exists() && !file.createNewFile()) {
LOG.info("Failed to create file");
return null;
}
FileOutputStream out = new FileOutputStream(file);
return new FileTransportWriter(file, out, this);
} catch (IOException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
return null;
}
}
}

View File

@@ -38,9 +38,6 @@ class FileTransportReader implements TransportConnectionReader {
} catch (IOException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
}
if (recognised) {
file.delete();
plugin.readerFinished(file);
}
plugin.readerFinished(file, exception, recognised);
}
}

View File

@@ -18,14 +18,11 @@ class FileTransportWriter implements TransportConnectionWriter {
private final File file;
private final OutputStream out;
private final long capacity;
private final FilePlugin plugin;
FileTransportWriter(File file, OutputStream out, long capacity,
FilePlugin plugin) {
FileTransportWriter(File file, OutputStream out, FilePlugin plugin) {
this.file = file;
this.out = out;
this.capacity = capacity;
this.plugin = plugin;
}
@@ -39,11 +36,6 @@ class FileTransportWriter implements TransportConnectionWriter {
return plugin.getMaxIdleTime();
}
@Override
public long getCapacity() {
return capacity;
}
@Override
public OutputStream getOutputStream() {
return out;
@@ -56,7 +48,6 @@ class FileTransportWriter implements TransportConnectionWriter {
} catch (IOException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
}
if (exception) file.delete();
else plugin.writerFinished(file);
plugin.writerFinished(file, exception);
}
}

View File

@@ -207,20 +207,16 @@ abstract class TcpPlugin implements DuplexPlugin {
}
@Override
public void poll(Collection<ContactId> connected) {
public void poll(Map<ContactId, TransportProperties> contacts) {
if (!isRunning()) return;
backoff.increment();
Map<ContactId, TransportProperties> remote =
callback.getRemoteProperties();
for (Entry<ContactId, TransportProperties> e : remote.entrySet()) {
ContactId c = e.getKey();
if (!connected.contains(c)) connectAndCallBack(c, e.getValue());
for (Entry<ContactId, TransportProperties> e : contacts.entrySet()) {
connectAndCallBack(e.getKey(), e.getValue());
}
}
private void connectAndCallBack(ContactId c, TransportProperties p) {
ioExecutor.execute(() -> {
if (!isRunning()) return;
DuplexTransportConnection d = createConnection(p);
if (d != null) {
backoff.reset();
@@ -230,13 +226,8 @@ abstract class TcpPlugin implements DuplexPlugin {
}
@Override
public DuplexTransportConnection createConnection(ContactId c) {
public DuplexTransportConnection createConnection(TransportProperties p) {
if (!isRunning()) return null;
return createConnection(callback.getRemoteProperties(c));
}
@Nullable
private DuplexTransportConnection createConnection(TransportProperties p) {
for (InetSocketAddress remote : getRemoteSocketAddresses(p)) {
if (!isConnectable(remote)) {
if (LOG.isLoggable(INFO)) {

View File

@@ -2,6 +2,7 @@ package org.briarproject.bramble.plugin;
import org.briarproject.bramble.api.event.EventBus;
import org.briarproject.bramble.api.plugin.ConnectionManager;
import org.briarproject.bramble.api.plugin.ConnectionRegistry;
import org.briarproject.bramble.api.plugin.PluginConfig;
import org.briarproject.bramble.api.plugin.PluginException;
import org.briarproject.bramble.api.plugin.TransportId;
@@ -13,16 +14,18 @@ import org.briarproject.bramble.api.plugin.simplex.SimplexPluginCallback;
import org.briarproject.bramble.api.plugin.simplex.SimplexPluginFactory;
import org.briarproject.bramble.api.properties.TransportPropertyManager;
import org.briarproject.bramble.api.settings.SettingsManager;
import org.briarproject.bramble.api.ui.UiCallback;
import org.briarproject.bramble.api.system.Clock;
import org.briarproject.bramble.test.BrambleTestCase;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.lib.concurrent.Synchroniser;
import org.junit.Test;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import static org.briarproject.bramble.test.TestUtils.getTransportId;
@@ -34,15 +37,20 @@ public class PluginManagerImplTest extends BrambleTestCase {
setThreadingPolicy(new Synchroniser());
}};
Executor ioExecutor = Executors.newSingleThreadExecutor();
ScheduledExecutorService scheduler =
context.mock(ScheduledExecutorService.class);
SecureRandom random = new SecureRandom();
Clock clock = context.mock(Clock.class);
EventBus eventBus = context.mock(EventBus.class);
PluginConfig pluginConfig = context.mock(PluginConfig.class);
ConnectionManager connectionManager =
context.mock(ConnectionManager.class);
ConnectionRegistry connectionRegistry =
context.mock(ConnectionRegistry.class);
SettingsManager settingsManager =
context.mock(SettingsManager.class);
TransportPropertyManager transportPropertyManager =
context.mock(TransportPropertyManager.class);
UiCallback uiCallback = context.mock(UiCallback.class);
// Two simplex plugin factories: both create plugins, one fails to start
SimplexPluginFactory simplexFactory =
@@ -71,6 +79,8 @@ public class PluginManagerImplTest extends BrambleTestCase {
will(returnValue(simplexFailId));
allowing(duplexPlugin).getId();
will(returnValue(duplexId));
allowing(pluginConfig).shouldPoll();
will(returnValue(false));
// start()
// First simplex plugin
oneOf(pluginConfig).getSimplexFactories();
@@ -112,9 +122,9 @@ public class PluginManagerImplTest extends BrambleTestCase {
oneOf(duplexPlugin).stop();
}});
PluginManagerImpl p = new PluginManagerImpl(ioExecutor, eventBus,
pluginConfig, connectionManager, settingsManager,
transportPropertyManager, uiCallback);
PluginManagerImpl p = new PluginManagerImpl(ioExecutor, scheduler,
eventBus, pluginConfig, connectionManager, connectionRegistry,
settingsManager, transportPropertyManager, random, clock);
// Two plugins should be started and stopped
p.startService();

View File

@@ -15,6 +15,8 @@ import org.briarproject.bramble.api.plugin.event.ConnectionOpenedEvent;
import org.briarproject.bramble.api.plugin.event.TransportDisabledEvent;
import org.briarproject.bramble.api.plugin.event.TransportEnabledEvent;
import org.briarproject.bramble.api.plugin.simplex.SimplexPlugin;
import org.briarproject.bramble.api.properties.TransportProperties;
import org.briarproject.bramble.api.properties.TransportPropertyManager;
import org.briarproject.bramble.api.system.Clock;
import org.briarproject.bramble.test.BrambleMockTestCase;
import org.briarproject.bramble.test.ImmediateExecutor;
@@ -24,13 +26,15 @@ import org.jmock.lib.legacy.ClassImposteriser;
import org.junit.Test;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static java.util.Collections.singletonMap;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.briarproject.bramble.test.TestUtils.getTransportId;
@@ -44,6 +48,8 @@ public class PollerTest extends BrambleMockTestCase {
context.mock(ConnectionRegistry.class);
private final PluginManager pluginManager =
context.mock(PluginManager.class);
private final TransportPropertyManager transportPropertyManager =
context.mock(TransportPropertyManager.class);
private final Clock clock = context.mock(Clock.class);
private final ScheduledFuture future = context.mock(ScheduledFuture.class);
private final SecureRandom random;
@@ -51,6 +57,7 @@ public class PollerTest extends BrambleMockTestCase {
private final Executor ioExecutor = new ImmediateExecutor();
private final TransportId transportId = getTransportId();
private final ContactId contactId = new ContactId(234);
private final TransportProperties properties = new TransportProperties();
private final int pollingInterval = 60 * 1000;
private final long now = System.currentTimeMillis();
@@ -66,8 +73,8 @@ public class PollerTest extends BrambleMockTestCase {
SimplexPlugin simplexPlugin1 =
context.mock(SimplexPlugin.class, "simplexPlugin1");
TransportId simplexId1 = getTransportId();
List<SimplexPlugin> simplexPlugins = Arrays.asList(simplexPlugin,
simplexPlugin1);
List<SimplexPlugin> simplexPlugins =
asList(simplexPlugin, simplexPlugin1);
TransportConnectionWriter simplexWriter =
context.mock(TransportConnectionWriter.class);
@@ -76,8 +83,8 @@ public class PollerTest extends BrambleMockTestCase {
TransportId duplexId = getTransportId();
DuplexPlugin duplexPlugin1 =
context.mock(DuplexPlugin.class, "duplexPlugin1");
List<DuplexPlugin> duplexPlugins = Arrays.asList(duplexPlugin,
duplexPlugin1);
List<DuplexPlugin> duplexPlugins =
asList(duplexPlugin, duplexPlugin1);
DuplexTransportConnection duplexConnection =
context.mock(DuplexTransportConnection.class);
@@ -96,8 +103,12 @@ public class PollerTest extends BrambleMockTestCase {
will(returnValue(simplexId1));
oneOf(connectionRegistry).isConnected(contactId, simplexId1);
will(returnValue(false));
// Get the transport properties
oneOf(transportPropertyManager).getRemoteProperties(contactId,
simplexId1);
will(returnValue(properties));
// Connect to the contact
oneOf(simplexPlugin1).createWriter(contactId);
oneOf(simplexPlugin1).createWriter(properties);
will(returnValue(simplexWriter));
// Pass the connection to the connection manager
oneOf(connectionManager).manageOutgoingConnection(contactId,
@@ -105,7 +116,7 @@ public class PollerTest extends BrambleMockTestCase {
// Get the duplex plugins
oneOf(pluginManager).getDuplexPlugins();
will(returnValue(duplexPlugins));
// The first plugin supports polling
// The duplex plugin supports polling
oneOf(duplexPlugin).shouldPoll();
will(returnValue(true));
// Check whether the contact is already connected
@@ -113,8 +124,12 @@ public class PollerTest extends BrambleMockTestCase {
will(returnValue(duplexId));
oneOf(connectionRegistry).isConnected(contactId, duplexId);
will(returnValue(false));
// Get the transport properties
oneOf(transportPropertyManager).getRemoteProperties(contactId,
duplexId);
will(returnValue(properties));
// Connect to the contact
oneOf(duplexPlugin).createConnection(contactId);
oneOf(duplexPlugin).createConnection(properties);
will(returnValue(duplexConnection));
// Pass the connection to the connection manager
oneOf(connectionManager).manageOutgoingConnection(contactId,
@@ -125,7 +140,8 @@ public class PollerTest extends BrambleMockTestCase {
}});
Poller p = new Poller(ioExecutor, scheduler, connectionManager,
connectionRegistry, pluginManager, random, clock);
connectionRegistry, pluginManager, transportPropertyManager,
random, clock);
p.eventOccurred(new ContactStatusChangedEvent(contactId, true));
}
@@ -165,8 +181,12 @@ public class PollerTest extends BrambleMockTestCase {
// Check whether the contact is already connected
oneOf(connectionRegistry).isConnected(contactId, transportId);
will(returnValue(false));
// Get the transport properties
oneOf(transportPropertyManager).getRemoteProperties(contactId,
transportId);
will(returnValue(properties));
// Connect to the contact
oneOf(plugin).createConnection(contactId);
oneOf(plugin).createConnection(properties);
will(returnValue(duplexConnection));
// Pass the connection to the connection manager
oneOf(connectionManager).manageOutgoingConnection(contactId,
@@ -174,15 +194,15 @@ public class PollerTest extends BrambleMockTestCase {
}});
Poller p = new Poller(ioExecutor, scheduler, connectionManager,
connectionRegistry, pluginManager, random, clock);
connectionRegistry, pluginManager, transportPropertyManager,
random, clock);
p.eventOccurred(new ConnectionClosedEvent(contactId, transportId,
false));
}
@Test
public void testRescheduleOnConnectionOpened() throws Exception {
public void testRescheduleOnConnectionOpened() {
Plugin plugin = context.mock(Plugin.class);
context.checking(new Expectations() {{
@@ -205,14 +225,15 @@ public class PollerTest extends BrambleMockTestCase {
}});
Poller p = new Poller(ioExecutor, scheduler, connectionManager,
connectionRegistry, pluginManager, random, clock);
connectionRegistry, pluginManager, transportPropertyManager,
random, clock);
p.eventOccurred(new ConnectionOpenedEvent(contactId, transportId,
false));
}
@Test
public void testRescheduleDoesNotReplaceEarlierTask() throws Exception {
public void testRescheduleDoesNotReplaceEarlierTask() {
Plugin plugin = context.mock(Plugin.class);
context.checking(new Expectations() {{
@@ -248,7 +269,8 @@ public class PollerTest extends BrambleMockTestCase {
}});
Poller p = new Poller(ioExecutor, scheduler, connectionManager,
connectionRegistry, pluginManager, random, clock);
connectionRegistry, pluginManager, transportPropertyManager,
random, clock);
p.eventOccurred(new ConnectionOpenedEvent(contactId, transportId,
false));
@@ -257,7 +279,7 @@ public class PollerTest extends BrambleMockTestCase {
}
@Test
public void testRescheduleReplacesLaterTask() throws Exception {
public void testRescheduleReplacesLaterTask() {
Plugin plugin = context.mock(Plugin.class);
context.checking(new Expectations() {{
@@ -296,7 +318,8 @@ public class PollerTest extends BrambleMockTestCase {
}});
Poller p = new Poller(ioExecutor, scheduler, connectionManager,
connectionRegistry, pluginManager, random, clock);
connectionRegistry, pluginManager, transportPropertyManager,
random, clock);
p.eventOccurred(new ConnectionOpenedEvent(contactId, transportId,
false));
@@ -306,8 +329,7 @@ public class PollerTest extends BrambleMockTestCase {
@Test
public void testPollsOnTransportEnabled() throws Exception {
Plugin plugin = context.mock(Plugin.class);
List<ContactId> connected = Collections.singletonList(contactId);
DuplexPlugin plugin = context.mock(DuplexPlugin.class);
context.checking(new Expectations() {{
allowing(plugin).getId();
@@ -335,20 +357,69 @@ public class PollerTest extends BrambleMockTestCase {
oneOf(scheduler).schedule(with(any(Runnable.class)),
with((long) (pollingInterval * 0.5)), with(MILLISECONDS));
will(returnValue(future));
// Poll the plugin
// Get the transport properties and connected contacts
oneOf(transportPropertyManager).getRemoteProperties(transportId);
will(returnValue(singletonMap(contactId, properties)));
oneOf(connectionRegistry).getConnectedContacts(transportId);
will(returnValue(connected));
oneOf(plugin).poll(connected);
will(returnValue(emptyList()));
// Poll the plugin
oneOf(plugin).poll(singletonMap(contactId, properties));
}});
Poller p = new Poller(ioExecutor, scheduler, connectionManager,
connectionRegistry, pluginManager, random, clock);
connectionRegistry, pluginManager, transportPropertyManager,
random, clock);
p.eventOccurred(new TransportEnabledEvent(transportId));
}
@Test
public void testCancelsPollingOnTransportDisabled() throws Exception {
public void testDoesNotPollIfAllContactsAreConnected() throws Exception {
DuplexPlugin plugin = context.mock(DuplexPlugin.class);
context.checking(new Expectations() {{
allowing(plugin).getId();
will(returnValue(transportId));
// Get the plugin
oneOf(pluginManager).getPlugin(transportId);
will(returnValue(plugin));
// The plugin supports polling
oneOf(plugin).shouldPoll();
will(returnValue(true));
// Schedule a polling task immediately
oneOf(clock).currentTimeMillis();
will(returnValue(now));
oneOf(scheduler).schedule(with(any(Runnable.class)), with(0L),
with(MILLISECONDS));
will(returnValue(future));
will(new RunAction());
// Running the polling task schedules the next polling task
oneOf(plugin).getPollingInterval();
will(returnValue(pollingInterval));
oneOf(random).nextDouble();
will(returnValue(0.5));
oneOf(clock).currentTimeMillis();
will(returnValue(now));
oneOf(scheduler).schedule(with(any(Runnable.class)),
with((long) (pollingInterval * 0.5)), with(MILLISECONDS));
will(returnValue(future));
// Get the transport properties and connected contacts
oneOf(transportPropertyManager).getRemoteProperties(transportId);
will(returnValue(singletonMap(contactId, properties)));
oneOf(connectionRegistry).getConnectedContacts(transportId);
will(returnValue(singletonList(contactId)));
// All contacts are connected, so don't poll the plugin
}});
Poller p = new Poller(ioExecutor, scheduler, connectionManager,
connectionRegistry, pluginManager, transportPropertyManager,
random, clock);
p.eventOccurred(new TransportEnabledEvent(transportId));
}
@Test
public void testCancelsPollingOnTransportDisabled() {
Plugin plugin = context.mock(Plugin.class);
context.checking(new Expectations() {{
@@ -371,7 +442,8 @@ public class PollerTest extends BrambleMockTestCase {
}});
Poller p = new Poller(ioExecutor, scheduler, connectionManager,
connectionRegistry, pluginManager, random, clock);
connectionRegistry, pluginManager, transportPropertyManager,
random, clock);
p.eventOccurred(new TransportEnabledEvent(transportId));
p.eventOccurred(new TransportDisabledEvent(transportId));

View File

@@ -23,8 +23,6 @@ import java.net.ServerSocket;
import java.net.Socket;
import java.util.Collections;
import java.util.Comparator;
import java.util.Hashtable;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
@@ -40,7 +38,6 @@ import static org.junit.Assert.assertTrue;
public class LanTcpPluginTest extends BrambleTestCase {
private final ContactId contactId = new ContactId(234);
private final Backoff backoff = new TestBackoff();
@Test
@@ -160,12 +157,10 @@ public class LanTcpPluginTest extends BrambleTestCase {
error.set(true);
}
}).start();
// Tell the plugin about the port
// Connect to the port
TransportProperties p = new TransportProperties();
p.put("ipPorts", addrString + ":" + port);
callback.remote.put(contactId, p);
// Connect to the port
DuplexTransportConnection d = plugin.createConnection(contactId);
DuplexTransportConnection d = plugin.createConnection(p);
assertNotNull(d);
// Check that the connection was accepted
assertTrue(latch.await(5, SECONDS));
@@ -281,7 +276,7 @@ public class LanTcpPluginTest extends BrambleTestCase {
}
@Test
public void testComparatorPrefersNonZeroPorts() throws Exception {
public void testComparatorPrefersNonZeroPorts() {
Comparator<InetSocketAddress> comparator = new LanAddressComparator();
InetSocketAddress nonZero = new InetSocketAddress("1.2.3.4", 1234);
InetSocketAddress zero = new InetSocketAddress("1.2.3.4", 0);
@@ -294,7 +289,7 @@ public class LanTcpPluginTest extends BrambleTestCase {
}
@Test
public void testComparatorPrefersLongerPrefixes() throws Exception {
public void testComparatorPrefersLongerPrefixes() {
Comparator<InetSocketAddress> comparator = new LanAddressComparator();
InetSocketAddress prefix192 = new InetSocketAddress("192.168.0.1", 0);
InetSocketAddress prefix172 = new InetSocketAddress("172.16.0.1", 0);
@@ -314,7 +309,7 @@ public class LanTcpPluginTest extends BrambleTestCase {
}
@Test
public void testComparatorPrefersSiteLocalToLinkLocal() throws Exception {
public void testComparatorPrefersSiteLocalToLinkLocal() {
Comparator<InetSocketAddress> comparator = new LanAddressComparator();
InetSocketAddress prefix192 = new InetSocketAddress("192.168.0.1", 0);
InetSocketAddress prefix172 = new InetSocketAddress("172.16.0.1", 0);
@@ -345,8 +340,6 @@ public class LanTcpPluginTest extends BrambleTestCase {
@NotNullByDefault
private static class Callback implements DuplexPluginCallback {
private final Map<ContactId, TransportProperties> remote =
new Hashtable<>();
private final CountDownLatch propertiesLatch = new CountDownLatch(1);
private final CountDownLatch connectionsLatch = new CountDownLatch(1);
private final TransportProperties local = new TransportProperties();
@@ -361,16 +354,6 @@ public class LanTcpPluginTest extends BrambleTestCase {
return local;
}
@Override
public Map<ContactId, TransportProperties> getRemoteProperties() {
return remote;
}
@Override
public TransportProperties getRemoteProperties(ContactId c) {
return remote.get(c);
}
@Override
public void mergeSettings(Settings s) {
}
@@ -381,20 +364,6 @@ public class LanTcpPluginTest extends BrambleTestCase {
propertiesLatch.countDown();
}
@Override
public int showChoice(String[] options, String... message) {
return -1;
}
@Override
public boolean showConfirmationMessage(String... message) {
return false;
}
@Override
public void showMessage(String... message) {
}
@Override
public void incomingConnectionCreated(DuplexTransportConnection d) {
connectionsLatch.countDown();

View File

@@ -20,7 +20,7 @@ public class CaptureArgumentAction<T> implements Action {
}
@Override
public Object invoke(Invocation invocation) throws Throwable {
public Object invoke(Invocation invocation) {
captured.set(capturedClass.cast(invocation.getParameter(index)));
return null;
}

View File

@@ -9,13 +9,14 @@ import org.briarproject.bramble.api.plugin.simplex.SimplexPluginCallback;
import org.briarproject.bramble.api.plugin.simplex.SimplexPluginFactory;
import java.util.Collection;
import java.util.Collections;
import javax.annotation.Nullable;
import dagger.Module;
import dagger.Provides;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.briarproject.bramble.test.TestUtils.getTransportId;
@Module
@@ -51,12 +52,17 @@ public class TestPluginConfigModule {
@Override
public Collection<DuplexPluginFactory> getDuplexFactories() {
return Collections.emptyList();
return emptyList();
}
@Override
public Collection<SimplexPluginFactory> getSimplexFactories() {
return Collections.singletonList(simplex);
return singletonList(simplex);
}
@Override
public boolean shouldPoll() {
return false;
}
};
return pluginConfig;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -10,20 +10,20 @@ import org.briarproject.bramble.api.plugin.duplex.DuplexPluginFactory;
import org.briarproject.bramble.api.plugin.simplex.SimplexPluginFactory;
import org.briarproject.bramble.api.reliability.ReliabilityLayerFactory;
import org.briarproject.bramble.plugin.bluetooth.JavaBluetoothPluginFactory;
import org.briarproject.bramble.plugin.file.RemovableDrivePluginFactory;
import org.briarproject.bramble.plugin.modem.ModemPluginFactory;
import org.briarproject.bramble.plugin.tcp.LanTcpPluginFactory;
import org.briarproject.bramble.plugin.tcp.WanTcpPluginFactory;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.concurrent.Executor;
import dagger.Module;
import dagger.Provides;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
@Module
public class DesktopPluginModule extends PluginModule {
@@ -41,12 +41,8 @@ public class DesktopPluginModule extends PluginModule {
backoffFactory);
DuplexPluginFactory wan = new WanTcpPluginFactory(ioExecutor,
backoffFactory, shutdownManager);
SimplexPluginFactory removable =
new RemovableDrivePluginFactory(ioExecutor);
Collection<SimplexPluginFactory> simplex =
Collections.singletonList(removable);
Collection<DuplexPluginFactory> duplex =
Arrays.asList(bluetooth, modem, lan, wan);
asList(bluetooth, modem, lan, wan);
@NotNullByDefault
PluginConfig pluginConfig = new PluginConfig() {
@@ -57,7 +53,12 @@ public class DesktopPluginModule extends PluginModule {
@Override
public Collection<SimplexPluginFactory> getSimplexFactories() {
return simplex;
return emptyList();
}
@Override
public boolean shouldPoll() {
return true;
}
};
return pluginConfig;

View File

@@ -1,28 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import javax.annotation.Nullable;
@NotNullByDefault
class LinuxRemovableDriveFinder extends UnixRemovableDriveFinder {
@Override
protected String getMountCommand() {
return "/bin/mount";
}
@Override
@Nullable
protected String parseMountPoint(String line) {
// The format is "/dev/foo on /bar/baz type bam (opt1,opt2)"
String pattern = "^/dev/[^ ]+ on (.*) type [^ ]+ \\([^)]+\\)$";
String path = line.replaceFirst(pattern, "$1");
return path.equals(line) ? null : path;
}
@Override
protected boolean isRemovableDriveMountPoint(String path) {
return path.startsWith("/mnt/") || path.startsWith("/media/");
}
}

View File

@@ -1,12 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
@NotNullByDefault
class LinuxRemovableDriveMonitor extends UnixRemovableDriveMonitor {
@Override
protected String[] getPathsToWatch() {
return new String[] {"/mnt", "/media"};
}
}

View File

@@ -1,28 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import javax.annotation.Nullable;
@NotNullByDefault
class MacRemovableDriveFinder extends UnixRemovableDriveFinder {
@Override
protected String getMountCommand() {
return "/sbin/mount";
}
@Override
@Nullable
protected String parseMountPoint(String line) {
// The format is "/dev/foo on /bar/baz (opt1, opt2)"
String pattern = "^/dev/[^ ]+ on (.*) \\([^)]+\\)$";
String path = line.replaceFirst(pattern, "$1");
return path.equals(line) ? null : path;
}
@Override
protected boolean isRemovableDriveMountPoint(String path) {
return path.startsWith("/Volumes/");
}
}

View File

@@ -1,12 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
@NotNullByDefault
class MacRemovableDriveMonitor extends UnixRemovableDriveMonitor {
@Override
protected String[] getPathsToWatch() {
return new String[] {"/Volumes"};
}
}

View File

@@ -1,84 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.concurrent.Executor;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Logger;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
@MethodsNotNullByDefault
@ParametersNotNullByDefault
class PollingRemovableDriveMonitor implements RemovableDriveMonitor, Runnable {
private static final Logger LOG =
Logger.getLogger(PollingRemovableDriveMonitor.class.getName());
private final Executor ioExecutor;
private final RemovableDriveFinder finder;
private final int pollingInterval;
private final Lock pollingLock = new ReentrantLock();
private final Condition stopPolling = pollingLock.newCondition();
private volatile boolean running = false;
private volatile Callback callback = null;
PollingRemovableDriveMonitor(Executor ioExecutor,
RemovableDriveFinder finder, int pollingInterval) {
this.ioExecutor = ioExecutor;
this.finder = finder;
this.pollingInterval = pollingInterval;
}
@Override
public void start(Callback callback) throws IOException {
this.callback = callback;
running = true;
ioExecutor.execute(this);
}
@Override
public void stop() throws IOException {
running = false;
pollingLock.lock();
try {
stopPolling.signalAll();
} finally {
pollingLock.unlock();
}
}
@Override
public void run() {
try {
Collection<File> drives = finder.findRemovableDrives();
while (running) {
pollingLock.lock();
try {
stopPolling.await(pollingInterval, MILLISECONDS);
} finally {
pollingLock.unlock();
}
if (!running) return;
Collection<File> newDrives = finder.findRemovableDrives();
for (File f : newDrives) {
if (!drives.contains(f)) callback.driveInserted(f);
}
drives = newDrives;
}
} catch (InterruptedException e) {
LOG.warning("Interrupted while waiting to poll");
Thread.currentThread().interrupt();
} catch (IOException e) {
callback.exceptionThrown(e);
}
}
}

View File

@@ -1,13 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
@NotNullByDefault
interface RemovableDriveFinder {
Collection<File> findRemovableDrives() throws IOException;
}

View File

@@ -1,21 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import java.io.File;
import java.io.IOException;
@NotNullByDefault
interface RemovableDriveMonitor {
void start(Callback c) throws IOException;
void stop() throws IOException;
interface Callback {
void driveInserted(File root);
void exceptionThrown(IOException e);
}
}

View File

@@ -1,140 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.plugin.PluginException;
import org.briarproject.bramble.api.plugin.TransportId;
import org.briarproject.bramble.api.plugin.simplex.SimplexPluginCallback;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.Executor;
import java.util.logging.Logger;
import static java.util.logging.Level.WARNING;
@NotNullByDefault
class RemovableDrivePlugin extends FilePlugin
implements RemovableDriveMonitor.Callback {
static final TransportId ID =
new TransportId("org.briarproject.bramble.file");
private static final Logger LOG =
Logger.getLogger(RemovableDrivePlugin.class.getName());
private final RemovableDriveFinder finder;
private final RemovableDriveMonitor monitor;
RemovableDrivePlugin(Executor ioExecutor, SimplexPluginCallback callback,
RemovableDriveFinder finder, RemovableDriveMonitor monitor,
int maxLatency) {
super(ioExecutor, callback, maxLatency);
this.finder = finder;
this.monitor = monitor;
}
@Override
public TransportId getId() {
return ID;
}
@Override
public void start() throws PluginException {
if (used.getAndSet(true)) throw new IllegalStateException();
running = true;
try {
monitor.start(this);
} catch (IOException e) {
throw new PluginException(e);
}
}
@Override
public void stop() throws PluginException {
running = false;
try {
monitor.stop();
} catch (IOException e) {
throw new PluginException(e);
}
}
@Override
public boolean shouldPoll() {
return false;
}
@Override
public int getPollingInterval() {
throw new UnsupportedOperationException();
}
@Override
public void poll(Collection<ContactId> connected) {
throw new UnsupportedOperationException();
}
@Override
protected File chooseOutputDirectory() {
try {
List<File> drives = new ArrayList<>(finder.findRemovableDrives());
if (drives.isEmpty()) return null;
String[] paths = new String[drives.size()];
for (int i = 0; i < paths.length; i++) {
paths[i] = drives.get(i).getPath();
}
int i = callback.showChoice(paths, "REMOVABLE_DRIVE_CHOOSE_DRIVE");
if (i == -1) return null;
return drives.get(i);
} catch (IOException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
return null;
}
}
@Override
protected void readerFinished(File f) {
callback.showMessage("REMOVABLE_DRIVE_READ_FINISHED");
}
@Override
protected void writerFinished(File f) {
callback.showMessage("REMOVABLE_DRIVE_WRITE_FINISHED");
}
@Override
protected Collection<File> findFilesByName(String filename) {
List<File> matches = new ArrayList<>();
try {
for (File drive : finder.findRemovableDrives()) {
File[] files = drive.listFiles();
if (files != null) {
for (File f : files) {
if (f.isFile() && filename.equals(f.getName()))
matches.add(f);
}
}
}
} catch (IOException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
}
return matches;
}
@Override
public void driveInserted(File root) {
File[] files = root.listFiles();
if (files != null) {
for (File f : files) if (f.isFile()) createReaderFromFile(f);
}
}
@Override
public void exceptionThrown(IOException e) {
if (LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
}
}

View File

@@ -1,63 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.plugin.TransportId;
import org.briarproject.bramble.api.plugin.simplex.SimplexPlugin;
import org.briarproject.bramble.api.plugin.simplex.SimplexPluginCallback;
import org.briarproject.bramble.api.plugin.simplex.SimplexPluginFactory;
import org.briarproject.bramble.util.OsUtils;
import java.util.concurrent.Executor;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class RemovableDrivePluginFactory implements SimplexPluginFactory {
// Maximum latency 14 days (Royal Mail or lackadaisical carrier pigeon)
private static final int MAX_LATENCY = 14 * 24 * 60 * 60 * 1000;
private static final int POLLING_INTERVAL = 10 * 1000; // 10 seconds
private final Executor ioExecutor;
public RemovableDrivePluginFactory(Executor ioExecutor) {
this.ioExecutor = ioExecutor;
}
@Override
public TransportId getId() {
return RemovableDrivePlugin.ID;
}
@Override
public int getMaxLatency() {
return MAX_LATENCY;
}
@Override
public SimplexPlugin createPlugin(SimplexPluginCallback callback) {
RemovableDriveFinder finder;
RemovableDriveMonitor monitor;
if (OsUtils.isLinux()) {
finder = new LinuxRemovableDriveFinder();
monitor = new LinuxRemovableDriveMonitor();
} else if (OsUtils.isMacLeopardOrNewer()) {
finder = new MacRemovableDriveFinder();
monitor = new MacRemovableDriveMonitor();
} else if (OsUtils.isMac()) {
// JNotify requires OS X 10.5 or newer, so we have to poll
finder = new MacRemovableDriveFinder();
monitor = new PollingRemovableDriveMonitor(ioExecutor, finder,
POLLING_INTERVAL);
} else if (OsUtils.isWindows()) {
finder = new WindowsRemovableDriveFinder();
monitor = new PollingRemovableDriveMonitor(ioExecutor, finder,
POLLING_INTERVAL);
} else {
return null;
}
return new RemovableDrivePlugin(ioExecutor, callback, finder, monitor,
MAX_LATENCY);
}
}

View File

@@ -1,48 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import javax.annotation.Nullable;
@NotNullByDefault
abstract class UnixRemovableDriveFinder implements RemovableDriveFinder {
protected abstract String getMountCommand();
@Nullable
protected abstract String parseMountPoint(String line);
protected abstract boolean isRemovableDriveMountPoint(String path);
@Override
public List<File> findRemovableDrives() throws IOException {
List<File> drives = new ArrayList<>();
Process p = new ProcessBuilder(getMountCommand()).start();
Scanner s = new Scanner(p.getInputStream(), "UTF-8");
try {
while (s.hasNextLine()) {
String line = s.nextLine();
String[] tokens = line.split(" ");
if (tokens.length < 3) continue;
// The general format is "/dev/foo on /bar/baz ..."
if (tokens[0].startsWith("/dev/") && tokens[1].equals("on")) {
// The path may contain spaces so we can't use tokens[2]
String path = parseMountPoint(line);
if (path != null && isRemovableDriveMountPoint(path)) {
File f = new File(path);
if (f.exists() && f.isDirectory()) drives.add(f);
}
}
}
} finally {
s.close();
}
return drives;
}
}

View File

@@ -1,129 +0,0 @@
package org.briarproject.bramble.plugin.file;
import net.contentobjects.jnotify.JNotify;
import net.contentobjects.jnotify.JNotifyListener;
import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import javax.annotation.Nullable;
@MethodsNotNullByDefault
@ParametersNotNullByDefault
abstract class UnixRemovableDriveMonitor implements RemovableDriveMonitor,
JNotifyListener {
//TODO: rationalise this in a further refactor
private static final Lock staticLock = new ReentrantLock();
// The following are locking: staticLock
private static boolean triedLoad = false;
private static Throwable loadError = null;
private final Lock lock = new ReentrantLock();
// The following are locking: lock
private final List<Integer> watches = new ArrayList<>();
private boolean started = false;
private Callback callback = null;
protected abstract String[] getPathsToWatch();
@Nullable
private static Throwable tryLoad() {
try {
Class.forName("net.contentobjects.jnotify.JNotify");
return null;
} catch (UnsatisfiedLinkError | ClassNotFoundException e) {
return e;
}
}
private static void checkEnabled() throws IOException {
staticLock.lock();
try {
if (!triedLoad) {
loadError = tryLoad();
triedLoad = true;
}
if (loadError != null) throw new IOException(loadError.toString());
} finally {
staticLock.unlock();
}
}
@Override
public void start(Callback callback) throws IOException {
checkEnabled();
List<Integer> watches = new ArrayList<>();
int mask = JNotify.FILE_CREATED;
for (String path : getPathsToWatch()) {
if (new File(path).exists())
watches.add(JNotify.addWatch(path, mask, false, this));
}
lock.lock();
try {
if (started) throw new AssertionError();
if (this.callback != null) throw new AssertionError();
started = true;
this.callback = callback;
this.watches.addAll(watches);
} finally {
lock.unlock();
}
}
@Override
public void stop() throws IOException {
checkEnabled();
List<Integer> watches;
lock.lock();
try {
if (!started) throw new AssertionError();
if (callback == null) throw new AssertionError();
started = false;
callback = null;
watches = new ArrayList<>(this.watches);
this.watches.clear();
} finally {
lock.unlock();
}
for (Integer w : watches) JNotify.removeWatch(w);
}
@Override
public void fileCreated(int wd, String rootPath, String name) {
Callback callback;
lock.lock();
try {
callback = this.callback;
} finally {
lock.unlock();
}
if (callback != null)
callback.driveInserted(new File(rootPath + "/" + name));
}
@Override
public void fileDeleted(int wd, String rootPath, String name) {
throw new UnsupportedOperationException();
}
@Override
public void fileModified(int wd, String rootPath, String name) {
throw new UnsupportedOperationException();
}
@Override
public void fileRenamed(int wd, String rootPath, String oldName,
String newName) {
throw new UnsupportedOperationException();
}
}

View File

@@ -1,34 +0,0 @@
package org.briarproject.bramble.plugin.file;
import com.sun.jna.platform.win32.Kernel32;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@NotNullByDefault
class WindowsRemovableDriveFinder implements RemovableDriveFinder {
// http://msdn.microsoft.com/en-us/library/windows/desktop/aa364939.aspx
private static final int DRIVE_REMOVABLE = 2;
@Override
public Collection<File> findRemovableDrives() throws IOException {
File[] roots = File.listRoots();
if (roots == null) throw new IOException();
List<File> drives = new ArrayList<>();
for (File root : roots) {
try {
int type = Kernel32.INSTANCE.GetDriveType(root.getPath());
if (type == DRIVE_REMOVABLE) drives.add(root);
} catch (RuntimeException e) {
throw new IOException(e);
}
}
return drives;
}
}

View File

@@ -17,7 +17,7 @@ import org.briarproject.bramble.util.StringUtils;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Logger;
@@ -115,7 +115,7 @@ class ModemPlugin implements DuplexPlugin, Modem.Callback {
}
@Override
public void poll(Collection<ContactId> connected) {
public void poll(Map<ContactId, TransportProperties> contacts) {
throw new UnsupportedOperationException();
}
@@ -139,17 +139,16 @@ class ModemPlugin implements DuplexPlugin, Modem.Callback {
}
@Override
public DuplexTransportConnection createConnection(ContactId c) {
public DuplexTransportConnection createConnection(TransportProperties p) {
if (!running) return null;
// Get the ISO 3166 code for the caller's country
String fromIso = callback.getLocalProperties().get("iso3166");
if (StringUtils.isNullOrEmpty(fromIso)) return null;
// Get the ISO 3166 code for the callee's country
TransportProperties properties = callback.getRemoteProperties(c);
String toIso = properties.get("iso3166");
String toIso = p.get("iso3166");
if (StringUtils.isNullOrEmpty(toIso)) return null;
// Get the callee's phone number
String number = properties.get("number");
String number = p.get("number");
if (StringUtils.isNullOrEmpty(number)) return null;
// Convert the number into direct dialling form
number = CountryCodes.translate(number, fromIso, toIso);

View File

@@ -1,26 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.test.BrambleTestCase;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class LinuxRemovableDriveFinderTest extends BrambleTestCase {
@Test
public void testParseMountPoint() {
LinuxRemovableDriveFinder f = new LinuxRemovableDriveFinder();
String line = "/dev/sda3 on / type ext3"
+ " (rw,errors=remount-ro,commit=0)";
assertEquals("/", f.parseMountPoint(line));
line = "gvfs-fuse-daemon on /home/alice/.gvfs"
+ " type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=alice)";
assertEquals(null, f.parseMountPoint(line)); // Can't be parsed
line = "fusectl on /sys/fs/fuse/connections type fusectl (rw)";
assertEquals(null, f.parseMountPoint(line)); // Can't be parsed
line = "/dev/sdd1 on /media/HAZ SPACE(!) type vfat"
+ " (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,"
+ "shortname=mixed,dmask=0077,utf8=1,showexec,flush)";
assertEquals("/media/HAZ SPACE(!)", f.parseMountPoint(line));
}
}

View File

@@ -1,24 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.test.BrambleTestCase;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class MacRemovableDriveFinderTest extends BrambleTestCase {
@Test
public void testParseMountPoint() {
MacRemovableDriveFinder f = new MacRemovableDriveFinder();
String line = "/dev/disk0s3 on / (local, journaled)";
assertEquals("/", f.parseMountPoint(line));
line = "devfs on /dev (local)";
assertEquals(null, f.parseMountPoint(line)); // Can't be parsed
line = "<volfs> on /.vol";
assertEquals(null, f.parseMountPoint(line)); // Can't be parsed
line = "automount -nsl [117] on /Network (automounted)";
assertEquals(null, f.parseMountPoint(line)); // Can't be parsed
line = "/dev/disk1s1 on /Volumes/HAZ SPACE(!) (local, nodev, nosuid)";
assertEquals("/Volumes/HAZ SPACE(!)", f.parseMountPoint(line));
}
}

View File

@@ -1,107 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.plugin.file.RemovableDriveMonitor.Callback;
import org.briarproject.bramble.test.BrambleTestCase;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicBoolean;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
public class PollingRemovableDriveMonitorTest extends BrambleTestCase {
@Test
public void testOneCallbackPerFile() throws Exception {
// Create a finder that returns no files the first time, then two files
File file1 = new File("foo");
File file2 = new File("bar");
@NotNullByDefault
RemovableDriveFinder finder = new RemovableDriveFinder() {
private AtomicBoolean firstCall = new AtomicBoolean(true);
@Override
public Collection<File> findRemovableDrives() throws IOException {
if (firstCall.getAndSet(false)) return Collections.emptyList();
else return Arrays.asList(file1, file2);
}
};
// Create a callback that waits for two files
CountDownLatch latch = new CountDownLatch(2);
List<File> detected = new ArrayList<>();
@NotNullByDefault
Callback callback = new Callback() {
@Override
public void driveInserted(File f) {
detected.add(f);
latch.countDown();
}
@Override
public void exceptionThrown(IOException e) {
fail();
}
};
// Create the monitor and start it
RemovableDriveMonitor monitor = new PollingRemovableDriveMonitor(
Executors.newCachedThreadPool(), finder, 1);
monitor.start(callback);
// Wait for the monitor to detect the files
assertTrue(latch.await(10, SECONDS));
monitor.stop();
// Check that both files were detected
assertEquals(2, detected.size());
assertTrue(detected.contains(file1));
assertTrue(detected.contains(file2));
}
@Test
public void testExceptionCallback() throws Exception {
// Create a finder that throws an exception the second time it's polled
RemovableDriveFinder finder = new RemovableDriveFinder() {
private AtomicBoolean firstCall = new AtomicBoolean(true);
@Override
public Collection<File> findRemovableDrives() throws IOException {
if (firstCall.getAndSet(false)) return Collections.emptyList();
else throw new IOException();
}
};
// Create a callback that waits for an exception
CountDownLatch latch = new CountDownLatch(1);
@NotNullByDefault
Callback callback = new Callback() {
@Override
public void driveInserted(File root) {
fail();
}
@Override
public void exceptionThrown(IOException e) {
latch.countDown();
}
};
// Create the monitor and start it
RemovableDriveMonitor monitor = new PollingRemovableDriveMonitor(
Executors.newCachedThreadPool(), finder, 1);
monitor.start(callback);
assertTrue(latch.await(10, SECONDS));
monitor.stop();
}
}

View File

@@ -1,378 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.plugin.TransportConnectionWriter;
import org.briarproject.bramble.api.plugin.simplex.SimplexPluginCallback;
import org.briarproject.bramble.plugin.file.RemovableDriveMonitor.Callback;
import org.briarproject.bramble.test.BrambleTestCase;
import org.briarproject.bramble.test.ImmediateExecutor;
import org.briarproject.bramble.test.TestUtils;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.lib.concurrent.Synchroniser;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executor;
import static org.briarproject.bramble.api.transport.TransportConstants.MIN_STREAM_LENGTH;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
public class RemovableDrivePluginTest extends BrambleTestCase {
private final File testDir = TestUtils.getTestDirectory();
private final ContactId contactId = new ContactId(234);
@Before
public void setUp() {
testDir.mkdirs();
}
@Test
public void testWriterIsNullIfNoDrivesAreFound() throws Exception {
List<File> drives = Collections.emptyList();
Mockery context = new Mockery() {{
setThreadingPolicy(new Synchroniser());
}};
Executor executor = context.mock(Executor.class);
SimplexPluginCallback callback =
context.mock(SimplexPluginCallback.class);
RemovableDriveFinder finder =
context.mock(RemovableDriveFinder.class);
RemovableDriveMonitor monitor =
context.mock(RemovableDriveMonitor.class);
context.checking(new Expectations() {{
oneOf(monitor).start(with(any(Callback.class)));
oneOf(finder).findRemovableDrives();
will(returnValue(drives));
}});
RemovableDrivePlugin plugin = new RemovableDrivePlugin(executor,
callback, finder, monitor, 0);
plugin.start();
assertNull(plugin.createWriter(contactId));
context.assertIsSatisfied();
}
@Test
public void testWriterIsNullIfNoDriveIsChosen() throws Exception {
File drive1 = new File(testDir, "1");
File drive2 = new File(testDir, "2");
List<File> drives = new ArrayList<>();
drives.add(drive1);
drives.add(drive2);
Mockery context = new Mockery() {{
setThreadingPolicy(new Synchroniser());
}};
Executor executor = context.mock(Executor.class);
SimplexPluginCallback callback =
context.mock(SimplexPluginCallback.class);
RemovableDriveFinder finder =
context.mock(RemovableDriveFinder.class);
RemovableDriveMonitor monitor =
context.mock(RemovableDriveMonitor.class);
context.checking(new Expectations() {{
oneOf(monitor).start(with(any(Callback.class)));
oneOf(finder).findRemovableDrives();
will(returnValue(drives));
oneOf(callback).showChoice(with(any(String[].class)),
with(any(String[].class)));
will(returnValue(-1)); // The user cancelled the choice
}});
RemovableDrivePlugin plugin = new RemovableDrivePlugin(executor,
callback, finder, monitor, 0);
plugin.start();
assertNull(plugin.createWriter(contactId));
File[] files = drive1.listFiles();
assertTrue(files == null || files.length == 0);
context.assertIsSatisfied();
}
@Test
public void testWriterIsNullIfOutputDirDoesNotExist() throws Exception {
File drive1 = new File(testDir, "1");
File drive2 = new File(testDir, "2");
List<File> drives = new ArrayList<>();
drives.add(drive1);
drives.add(drive2);
Mockery context = new Mockery() {{
setThreadingPolicy(new Synchroniser());
}};
Executor executor = context.mock(Executor.class);
SimplexPluginCallback callback =
context.mock(SimplexPluginCallback.class);
RemovableDriveFinder finder =
context.mock(RemovableDriveFinder.class);
RemovableDriveMonitor monitor =
context.mock(RemovableDriveMonitor.class);
context.checking(new Expectations() {{
oneOf(monitor).start(with(any(Callback.class)));
oneOf(finder).findRemovableDrives();
will(returnValue(drives));
oneOf(callback).showChoice(with(any(String[].class)),
with(any(String[].class)));
will(returnValue(0)); // The user chose drive1 but it doesn't exist
}});
RemovableDrivePlugin plugin = new RemovableDrivePlugin(executor,
callback, finder, monitor, 0);
plugin.start();
assertNull(plugin.createWriter(contactId));
File[] files = drive1.listFiles();
assertTrue(files == null || files.length == 0);
context.assertIsSatisfied();
}
@Test
public void testWriterIsNullIfOutputDirIsAFile() throws Exception {
File drive1 = new File(testDir, "1");
File drive2 = new File(testDir, "2");
List<File> drives = new ArrayList<>();
drives.add(drive1);
drives.add(drive2);
// Create drive1 as a file rather than a directory
assertTrue(drive1.createNewFile());
Mockery context = new Mockery() {{
setThreadingPolicy(new Synchroniser());
}};
Executor executor = context.mock(Executor.class);
SimplexPluginCallback callback =
context.mock(SimplexPluginCallback.class);
RemovableDriveFinder finder =
context.mock(RemovableDriveFinder.class);
RemovableDriveMonitor monitor =
context.mock(RemovableDriveMonitor.class);
context.checking(new Expectations() {{
oneOf(monitor).start(with(any(Callback.class)));
oneOf(finder).findRemovableDrives();
will(returnValue(drives));
oneOf(callback).showChoice(with(any(String[].class)),
with(any(String[].class)));
will(returnValue(0)); // The user chose drive1 but it's not a dir
}});
RemovableDrivePlugin plugin = new RemovableDrivePlugin(executor,
callback, finder, monitor, 0);
plugin.start();
assertNull(plugin.createWriter(contactId));
File[] files = drive1.listFiles();
assertTrue(files == null || files.length == 0);
context.assertIsSatisfied();
}
@Test
public void testWriterIsNotNullIfOutputDirIsADir() throws Exception {
File drive1 = new File(testDir, "1");
File drive2 = new File(testDir, "2");
List<File> drives = new ArrayList<>();
drives.add(drive1);
drives.add(drive2);
// Create drive1 as a directory
assertTrue(drive1.mkdir());
Mockery context = new Mockery() {{
setThreadingPolicy(new Synchroniser());
}};
Executor executor = context.mock(Executor.class);
SimplexPluginCallback callback =
context.mock(SimplexPluginCallback.class);
RemovableDriveFinder finder =
context.mock(RemovableDriveFinder.class);
RemovableDriveMonitor monitor =
context.mock(RemovableDriveMonitor.class);
context.checking(new Expectations() {{
oneOf(monitor).start(with(any(Callback.class)));
oneOf(finder).findRemovableDrives();
will(returnValue(drives));
oneOf(callback).showChoice(with(any(String[].class)),
with(any(String[].class)));
will(returnValue(0)); // The user chose drive1
}});
RemovableDrivePlugin plugin = new RemovableDrivePlugin(executor,
callback, finder, monitor, 0);
plugin.start();
assertNotNull(plugin.createWriter(contactId));
// The output file should exist and should be empty
File[] files = drive1.listFiles();
assertNotNull(files);
assertEquals(1, files.length);
assertEquals(0, files[0].length());
context.assertIsSatisfied();
}
@Test
public void testWritingToWriter() throws Exception {
File drive1 = new File(testDir, "1");
File drive2 = new File(testDir, "2");
List<File> drives = new ArrayList<>();
drives.add(drive1);
drives.add(drive2);
// Create drive1 as a directory
assertTrue(drive1.mkdir());
Mockery context = new Mockery() {{
setThreadingPolicy(new Synchroniser());
}};
Executor executor = context.mock(Executor.class);
SimplexPluginCallback callback =
context.mock(SimplexPluginCallback.class);
RemovableDriveFinder finder =
context.mock(RemovableDriveFinder.class);
RemovableDriveMonitor monitor =
context.mock(RemovableDriveMonitor.class);
context.checking(new Expectations() {{
oneOf(monitor).start(with(any(Callback.class)));
oneOf(finder).findRemovableDrives();
will(returnValue(drives));
oneOf(callback).showChoice(with(any(String[].class)),
with(any(String[].class)));
will(returnValue(0)); // The user chose drive1
oneOf(callback).showMessage(with(any(String[].class)));
}});
RemovableDrivePlugin plugin = new RemovableDrivePlugin(executor,
callback, finder, monitor, 0);
plugin.start();
TransportConnectionWriter writer = plugin.createWriter(contactId);
assertNotNull(writer);
// The output file should exist and should be empty
File[] files = drive1.listFiles();
assertNotNull(files);
assertEquals(1, files.length);
assertEquals(0, files[0].length());
// Writing to the output stream should increase the size of the file
OutputStream out = writer.getOutputStream();
out.write(new byte[1234]);
out.flush();
out.close();
// Disposing of the writer should not delete the file
writer.dispose(false);
assertTrue(files[0].exists());
assertEquals(1234, files[0].length());
context.assertIsSatisfied();
}
@Test
public void testEmptyDriveIsIgnored() throws Exception {
Mockery context = new Mockery() {{
setThreadingPolicy(new Synchroniser());
}};
Executor executor = context.mock(Executor.class);
SimplexPluginCallback callback =
context.mock(SimplexPluginCallback.class);
RemovableDriveFinder finder =
context.mock(RemovableDriveFinder.class);
RemovableDriveMonitor monitor =
context.mock(RemovableDriveMonitor.class);
context.checking(new Expectations() {{
oneOf(monitor).start(with(any(Callback.class)));
}});
RemovableDrivePlugin plugin = new RemovableDrivePlugin(executor,
callback, finder, monitor, 0);
plugin.start();
plugin.driveInserted(testDir);
context.assertIsSatisfied();
}
@Test
public void testFilenames() {
Mockery context = new Mockery() {{
setThreadingPolicy(new Synchroniser());
}};
Executor executor = context.mock(Executor.class);
SimplexPluginCallback callback =
context.mock(SimplexPluginCallback.class);
RemovableDriveFinder finder =
context.mock(RemovableDriveFinder.class);
RemovableDriveMonitor monitor =
context.mock(RemovableDriveMonitor.class);
RemovableDrivePlugin plugin = new RemovableDrivePlugin(executor,
callback, finder, monitor, 0);
assertFalse(plugin.isPossibleConnectionFilename("abcdefg.dat"));
assertFalse(plugin.isPossibleConnectionFilename("abcdefghi.dat"));
assertFalse(plugin.isPossibleConnectionFilename("abcdefgh_dat"));
assertFalse(plugin.isPossibleConnectionFilename("abcdefgh.rat"));
assertTrue(plugin.isPossibleConnectionFilename("abcdefgh.dat"));
assertTrue(plugin.isPossibleConnectionFilename("ABCDEFGH.DAT"));
context.assertIsSatisfied();
}
@Test
public void testReaderIsCreated() throws Exception {
Mockery context = new Mockery() {{
setThreadingPolicy(new Synchroniser());
}};
SimplexPluginCallback callback =
context.mock(SimplexPluginCallback.class);
RemovableDriveFinder finder =
context.mock(RemovableDriveFinder.class);
RemovableDriveMonitor monitor =
context.mock(RemovableDriveMonitor.class);
context.checking(new Expectations() {{
oneOf(monitor).start(with(any(Callback.class)));
oneOf(callback).readerCreated(with(any(FileTransportReader.class)));
}});
RemovableDrivePlugin plugin = new RemovableDrivePlugin(
new ImmediateExecutor(), callback, finder, monitor, 0);
plugin.start();
File f = new File(testDir, "abcdefgh.dat");
OutputStream out = new FileOutputStream(f);
out.write(new byte[MIN_STREAM_LENGTH]);
out.flush();
out.close();
assertEquals(MIN_STREAM_LENGTH, f.length());
plugin.driveInserted(testDir);
context.assertIsSatisfied();
}
@After
public void tearDown() {
TestUtils.deleteTestDirectory(testDir);
}
}

View File

@@ -1,112 +0,0 @@
package org.briarproject.bramble.plugin.file;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.plugin.file.RemovableDriveMonitor.Callback;
import org.briarproject.bramble.test.BrambleTestCase;
import org.briarproject.bramble.test.TestUtils;
import org.briarproject.bramble.util.OsUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
public class UnixRemovableDriveMonitorTest extends BrambleTestCase {
private final File testDir = TestUtils.getTestDirectory();
@Before
public void setUp() {
testDir.mkdirs();
}
@Test
public void testNonexistentDir() throws Exception {
if (!(OsUtils.isLinux() || OsUtils.isMacLeopardOrNewer())) {
System.err.println("WARNING: Skipping test, can't run on this OS");
return;
}
File doesNotExist = new File(testDir, "doesNotExist");
RemovableDriveMonitor monitor = createMonitor(doesNotExist);
@NotNullByDefault
Callback callback = new Callback() {
@Override
public void driveInserted(File root) {
fail();
}
@Override
public void exceptionThrown(IOException e) {
fail();
}
};
monitor.start(callback);
monitor.stop();
}
@Test
public void testOneCallbackPerFile() throws Exception {
if (!(OsUtils.isLinux() || OsUtils.isMacLeopardOrNewer())) {
System.err.println("WARNING: Skipping test, can't run on this OS");
return;
}
// Create a callback that will wait for two files before stopping
List<File> detected = new ArrayList<>();
CountDownLatch latch = new CountDownLatch(2);
@NotNullByDefault
Callback callback = new Callback() {
@Override
public void driveInserted(File f) {
detected.add(f);
latch.countDown();
}
@Override
public void exceptionThrown(IOException e) {
fail();
}
};
// Create the monitor and start it
RemovableDriveMonitor monitor = createMonitor(testDir);
monitor.start(callback);
// Create two files in the test directory
File file1 = new File(testDir, "1");
File file2 = new File(testDir, "2");
assertTrue(file1.createNewFile());
assertTrue(file2.createNewFile());
// Wait for the monitor to detect the files
assertTrue(latch.await(5, SECONDS));
monitor.stop();
// Check that both files were detected
assertEquals(2, detected.size());
assertTrue(detected.contains(file1));
assertTrue(detected.contains(file2));
}
@After
public void tearDown() {
TestUtils.deleteTestDirectory(testDir);
}
private RemovableDriveMonitor createMonitor(File dir) {
@NotNullByDefault
RemovableDriveMonitor monitor = new UnixRemovableDriveMonitor() {
@Override
protected String[] getPathsToWatch() {
return new String[] {dir.getPath()};
}
};
return monitor;
}
}

View File

@@ -1,6 +1,5 @@
package org.briarproject.bramble.plugin.modem;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.plugin.duplex.DuplexPluginCallback;
import org.briarproject.bramble.api.properties.TransportProperties;
import org.briarproject.bramble.test.BrambleTestCase;
@@ -66,7 +65,6 @@ public class ModemPluginTest extends BrambleTestCase {
TransportProperties remote = new TransportProperties();
remote.put("iso3166", ISO_1336);
remote.put("number", NUMBER);
ContactId contactId = new ContactId(234);
context.checking(new Expectations() {{
// start()
oneOf(serialPortList).getPortNames();
@@ -78,14 +76,12 @@ public class ModemPluginTest extends BrambleTestCase {
// createConnection()
oneOf(callback).getLocalProperties();
will(returnValue(local));
oneOf(callback).getRemoteProperties(contactId);
will(returnValue(remote));
oneOf(modem).dial(NUMBER);
will(returnValue(true));
}});
plugin.start();
// A connection should be returned
assertNotNull(plugin.createConnection(contactId));
assertNotNull(plugin.createConnection(remote));
context.assertIsSatisfied();
}
@@ -105,7 +101,6 @@ public class ModemPluginTest extends BrambleTestCase {
TransportProperties remote = new TransportProperties();
remote.put("iso3166", ISO_1336);
remote.put("number", NUMBER);
ContactId contactId = new ContactId(234);
context.checking(new Expectations() {{
// start()
oneOf(serialPortList).getPortNames();
@@ -117,14 +112,12 @@ public class ModemPluginTest extends BrambleTestCase {
// createConnection()
oneOf(callback).getLocalProperties();
will(returnValue(local));
oneOf(callback).getRemoteProperties(contactId);
will(returnValue(remote));
oneOf(modem).dial(NUMBER);
will(returnValue(false));
}});
plugin.start();
// No connection should be returned
assertNull(plugin.createConnection(contactId));
assertNull(plugin.createConnection(remote));
context.assertIsSatisfied();
}
@@ -144,7 +137,6 @@ public class ModemPluginTest extends BrambleTestCase {
TransportProperties remote = new TransportProperties();
remote.put("iso3166", ISO_1336);
remote.put("number", NUMBER);
ContactId contactId = new ContactId(234);
context.checking(new Expectations() {{
// start()
oneOf(serialPortList).getPortNames();
@@ -156,8 +148,6 @@ public class ModemPluginTest extends BrambleTestCase {
// createConnection()
oneOf(callback).getLocalProperties();
will(returnValue(local));
oneOf(callback).getRemoteProperties(contactId);
will(returnValue(remote));
oneOf(modem).dial(NUMBER);
will(throwException(new IOException()));
// resetModem()
@@ -170,7 +160,7 @@ public class ModemPluginTest extends BrambleTestCase {
}});
plugin.start();
// No connection should be returned
assertNull(plugin.createConnection(contactId));
assertNull(plugin.createConnection(remote));
context.assertIsSatisfied();
}
}

View File

@@ -238,8 +238,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 10005
versionName "1.0.5"
versionCode 10006
versionName "1.0.6"
applicationId "org.briarproject.briar.android"
resValue "string", "app_package", "org.briarproject.briar.android"
resValue "string", "app_name", "Briar"

View File

@@ -1,6 +1,7 @@
package org.briarproject.briar.android;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.StrictMode;
@@ -8,12 +9,22 @@ import org.briarproject.bramble.api.crypto.CryptoComponent;
import org.briarproject.bramble.api.crypto.PublicKey;
import org.briarproject.bramble.api.db.DatabaseConfig;
import org.briarproject.bramble.api.event.EventBus;
import org.briarproject.bramble.api.lifecycle.IoExecutor;
import org.briarproject.bramble.api.lifecycle.LifecycleManager;
import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
import org.briarproject.bramble.api.plugin.BackoffFactory;
import org.briarproject.bramble.api.plugin.PluginConfig;
import org.briarproject.bramble.api.plugin.duplex.DuplexPluginFactory;
import org.briarproject.bramble.api.plugin.simplex.SimplexPluginFactory;
import org.briarproject.bramble.api.reporting.DevConfig;
import org.briarproject.bramble.api.ui.UiCallback;
import org.briarproject.bramble.api.system.AndroidExecutor;
import org.briarproject.bramble.api.system.LocationUtils;
import org.briarproject.bramble.api.system.Scheduler;
import org.briarproject.bramble.plugin.bluetooth.AndroidBluetoothPluginFactory;
import org.briarproject.bramble.plugin.tcp.AndroidLanTcpPluginFactory;
import org.briarproject.bramble.plugin.tor.TorPluginFactory;
import org.briarproject.bramble.util.AndroidUtils;
import org.briarproject.bramble.util.StringUtils;
import org.briarproject.briar.api.android.AndroidNotificationManager;
@@ -23,14 +34,21 @@ import org.briarproject.briar.api.android.ScreenFilterMonitor;
import java.io.File;
import java.security.GeneralSecurityException;
import java.security.SecureRandom;
import java.util.Collection;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.net.SocketFactory;
import dagger.Module;
import dagger.Provides;
import static android.content.Context.MODE_PRIVATE;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static org.briarproject.bramble.api.reporting.ReportingConstants.DEV_ONION_ADDRESS;
import static org.briarproject.bramble.api.reporting.ReportingConstants.DEV_PUBLIC_KEY_HEX;
@@ -47,27 +65,9 @@ public class AppModule {
}
private final Application application;
private final UiCallback uiCallback;
public AppModule(Application application) {
this.application = application;
uiCallback = new UiCallback() {
@Override
public int showChoice(String[] options, String... message) {
throw new UnsupportedOperationException();
}
@Override
public boolean showConfirmationMessage(String... message) {
throw new UnsupportedOperationException();
}
@Override
public void showMessage(String... message) {
throw new UnsupportedOperationException();
}
};
}
@Provides
@@ -76,11 +76,6 @@ public class AppModule {
return application;
}
@Provides
UiCallback provideUICallback() {
return uiCallback;
}
@Provides
@Singleton
DatabaseConfig provideDatabaseConfig(Application app) {
@@ -97,6 +92,43 @@ public class AppModule {
return databaseConfig;
}
@Provides
PluginConfig providePluginConfig(@IoExecutor Executor ioExecutor,
@Scheduler ScheduledExecutorService scheduler,
AndroidExecutor androidExecutor, SecureRandom random,
SocketFactory torSocketFactory, BackoffFactory backoffFactory,
Application app, LocationUtils locationUtils, EventBus eventBus) {
Context appContext = app.getApplicationContext();
DuplexPluginFactory bluetooth =
new AndroidBluetoothPluginFactory(ioExecutor, androidExecutor,
appContext, random, eventBus, backoffFactory);
DuplexPluginFactory tor = new TorPluginFactory(ioExecutor, scheduler,
appContext, locationUtils, eventBus,
torSocketFactory, backoffFactory);
DuplexPluginFactory lan = new AndroidLanTcpPluginFactory(ioExecutor,
scheduler, backoffFactory, appContext);
Collection<DuplexPluginFactory> duplex = asList(bluetooth, tor, lan);
@NotNullByDefault
PluginConfig pluginConfig = new PluginConfig() {
@Override
public Collection<DuplexPluginFactory> getDuplexFactories() {
return duplex;
}
@Override
public Collection<SimplexPluginFactory> getSimplexFactories() {
return emptyList();
}
@Override
public boolean shouldPoll() {
return true;
}
};
return pluginConfig;
}
@Provides
@Singleton
DevConfig provideDevConfig(Application app, CryptoComponent crypto) {

View File

@@ -1,13 +1,9 @@
package org.briarproject.briar.android.blog;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.UiThread;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.RecyclerView;
@@ -27,7 +23,6 @@ import org.briarproject.briar.api.blog.BlogPostHeader;
import javax.annotation.Nullable;
import static android.support.v4.app.ActivityOptionsCompat.makeSceneTransitionAnimation;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
import static org.briarproject.briar.android.activity.BriarActivity.GROUP_ID;
@@ -35,7 +30,6 @@ import static org.briarproject.briar.android.blog.BasePostFragment.POST_ID;
import static org.briarproject.briar.android.util.UiUtils.TEASER_LENGTH;
import static org.briarproject.briar.android.util.UiUtils.getSpanned;
import static org.briarproject.briar.android.util.UiUtils.getTeaser;
import static org.briarproject.briar.android.util.UiUtils.isSamsung7;
import static org.briarproject.briar.android.util.UiUtils.makeLinksClickable;
import static org.briarproject.briar.api.blog.MessageType.POST;
@@ -135,18 +129,7 @@ class BlogPostViewHolder extends RecyclerView.ViewHolder {
Intent i = new Intent(ctx, ReblogActivity.class);
i.putExtra(GROUP_ID, item.getGroupId().getBytes());
i.putExtra(POST_ID, item.getId().getBytes());
if (Build.VERSION.SDK_INT >= 23 && !isSamsung7()) {
ActivityOptionsCompat options =
makeSceneTransitionAnimation((Activity) ctx, layout,
getTransitionName(item.getId()));
ActivityCompat.startActivity(ctx, i,
options.toBundle());
} else {
// work-around for android bug #224270
// work-around for Samsung Android 7 bug #1007
ctx.startActivity(i);
}
ctx.startActivity(i);
});
// comments

View File

@@ -19,7 +19,6 @@ import java.util.logging.Logger;
import javax.annotation.Nullable;
import javax.inject.Inject;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
@NotNullByDefault
@@ -156,21 +155,16 @@ public class ConfigControllerImpl implements ConfigController {
SharedPreferences defaultPrefs =
PreferenceManager.getDefaultSharedPreferences(ctx);
AndroidUtils.deleteAppData(ctx, briarPrefs, defaultPrefs);
AndroidUtils.logDataDirContents(ctx);
}
@Override
public boolean accountExists() {
String hex = getEncryptedDatabaseKey();
boolean exists = hex != null && databaseConfig.databaseExists();
if (LOG.isLoggable(INFO)) LOG.info("Account exists: " + exists);
return exists;
return hex != null && databaseConfig.databaseExists();
}
@Override
public boolean accountSignedIn() {
boolean signedIn = databaseConfig.getEncryptionKey() != null;
if (LOG.isLoggable(INFO)) LOG.info("Signed in: " + signedIn);
return signedIn;
return databaseConfig.getEncryptionKey() != null;
}
}

View File

@@ -9,7 +9,6 @@ import org.briarproject.bramble.api.crypto.PasswordStrengthEstimator;
import org.briarproject.bramble.api.crypto.SecretKey;
import org.briarproject.bramble.api.db.DatabaseConfig;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.util.AndroidUtils;
import org.briarproject.briar.android.controller.handler.ResultHandler;
import org.briarproject.briar.android.controller.handler.UiResultHandler;
@@ -103,14 +102,11 @@ public class SetupControllerImpl extends PasswordControllerImpl
if (password == null) throw new IllegalStateException();
cryptoExecutor.execute(() -> {
LOG.info("Creating account");
AndroidUtils.logDataDirContents(setupActivity);
databaseConfig.setLocalAuthorName(authorName);
SecretKey key = crypto.generateSecretKey();
databaseConfig.setEncryptionKey(key);
String hex = encryptDatabaseKey(key, password);
storeEncryptedDatabaseKey(hex);
LOG.info("Created account");
AndroidUtils.logDataDirContents(setupActivity);
resultHandler.onResult(null);
});
}

View File

@@ -8,7 +8,6 @@ import android.support.v7.preference.PreferenceManager;
import android.transition.Fade;
import org.briarproject.bramble.api.system.AndroidExecutor;
import org.briarproject.bramble.util.AndroidUtils;
import org.briarproject.briar.R;
import org.briarproject.briar.android.activity.ActivityComponent;
import org.briarproject.briar.android.activity.BaseActivity;
@@ -45,11 +44,9 @@ public class SplashScreenActivity extends BaseActivity {
setContentView(R.layout.splash);
if (configController.accountSignedIn()) {
LOG.info("Already signed in, not showing splash screen");
startActivity(new Intent(this, OpenDatabaseActivity.class));
finish();
} else {
LOG.info("Showing splash screen");
new Handler().postDelayed(() -> {
startNextActivity();
supportFinishAfterTransition();
@@ -67,7 +64,6 @@ public class SplashScreenActivity extends BaseActivity {
LOG.info("Expired");
startActivity(new Intent(this, ExpiredActivity.class));
} else {
AndroidUtils.logDataDirContents(this);
if (configController.accountExists()) {
LOG.info("Account exists");
startActivity(new Intent(this, OpenDatabaseActivity.class));
@@ -80,10 +76,8 @@ public class SplashScreenActivity extends BaseActivity {
}
private void setPreferencesDefaults() {
androidExecutor.runOnBackgroundThread(() -> {
PreferenceManager.setDefaultValues(SplashScreenActivity.this,
R.xml.panic_preferences, false);
LOG.info("Finished setting panic preference defaults");
});
androidExecutor.runOnBackgroundThread(() ->
PreferenceManager.setDefaultValues(SplashScreenActivity.this,
R.xml.panic_preferences, false));
}
}

View File

@@ -89,6 +89,8 @@ public abstract class ThreadListActivity<G extends NamedGroup, I extends ThreadI
textInput.setListener(this);
list = findViewById(R.id.list);
layoutManager = new LinearLayoutManager(this);
// FIXME pre-fetching messes with read state, find better solution #1289
layoutManager.setItemPrefetchEnabled(false);
list.setLayoutManager(layoutManager);
adapter = createAdapter(layoutManager);
list.setAdapter(adapter);

View File

@@ -158,6 +158,8 @@
<string name="blogs_rss_remove_feed_ok">Dilemel</string>
<!--Settings Network-->
<!--Settings Security and Panic-->
<string name="security_settings_title">Surentezh</string>
<string name="change_password">Cheñch ar ger-tremen</string>
<string name="lock_setting_title">Digevreañ</string>
<!--Settings Notifications-->
<!--Settings Feedback-->

View File

@@ -2,50 +2,50 @@
<resources>
<!--Setup-->
<string name="setup_title">Benvingut a Briar</string>
<string name="setup_name_explanation">El vostre sobrenom es mostrarà al costat de qualsevol contingut que publiqueu. No podeu canviar-lo després de crear el compte.</string>
<string name="setup_name_explanation">El vostre sobrenom etiquetarà tot el que publiqueu. Després de crear el compte ja no podreu canviar el sobrenom.</string>
<string name="setup_next">Següent</string>
<string name="setup_password_intro">Trieu una contrasenya</string>
<string name="setup_password_explanation">El vostre compte Briar s\'emmagatzema encriptada al vostre dispositiu, no al núvol. Si oblideu la vostra contrasenya o desinstal·leu Briar, no hi ha forma de recuperar el vostre compte.\n\nTrieu una contrasenya llarga que sigui difícil d\'endevinar, com ara quatre paraules aleatòries o deu lletres, números i símbols aleatoris.</string>
<string name="setup_doze_title">Connexions de fons</string>
<string name="setup_doze_intro">Per rebre missatges, Briar necessita estar connectat en segon pla.</string>
<string name="setup_doze_explanation">Per rebre missatges, Briar necessita estar connectat en segon pla. Desactiveu les optimitzacions de la bateria perquè Briar es mantingui connectat.</string>
<string name="setup_password_intro">Establiu una contrasenya</string>
<string name="setup_password_explanation">El compte de Briar s\'emmagatzema xifrat en el vostre dispositiu, no en el núvol. Si oblideu la contrasenya o desinstal·leu Briar no podreu recuperar el vostre compte ni les dades associades.\n\nTrieu una contrasenya llarga que sigui difícil d\'endevinar, com ara quatre paraules aleatòries o deu lletres, números i símbols aleatoris.</string>
<string name="setup_doze_title">Connexions en segon pla</string>
<string name="setup_doze_intro">Per rebre missatges Briar necessita estar connectat en segon pla.</string>
<string name="setup_doze_explanation">Per rebre missatges Briar necessita estar connectat en segon pla. Desactiveu les optimitzacions de la bateria per permetre que Briar resti sempre connectat.</string>
<string name="setup_doze_button">Permet connexions</string>
<string name="choose_nickname">Trieu el sobrenom</string>
<string name="choose_password">Trieu la contrasenya</string>
<string name="confirm_password">Confirmeu la contrasenya</string>
<string name="name_too_long">El nom és massa llarg</string>
<string name="password_too_weak">La contrasenya és dèbil</string>
<string name="password_too_weak">La contrasenya és massa feble</string>
<string name="passwords_do_not_match">Les contrasenyes no coincideixen</string>
<string name="create_account_button">Crear compte</string>
<string name="create_account_button">Crea el compte</string>
<string name="more_info">Més informació</string>
<string name="don_t_ask_again">No ho tornis a preguntar</string>
<string name="setup_huawei_text">Feu clic al botó següent i assegureu-vos que Briar està protegit a la pantalla «Aplicacions protegides».</string>
<string name="setup_huawei_button">Protegeix el Briar</string>
<string name="setup_huawei_help">Si Briar no s\'afegeix a la llista d\'aplicacions protegides, no podrà executar-se en segon pla.</string>
<string name="warning_dozed">%s no ha pogut executar-se en segon pla</string>
<string name="don_t_ask_again">No tornis a preguntar-ho</string>
<string name="setup_huawei_text">Feu clic al botó següent i assegureu-vos de que Briar està protegit a la pantalla «Aplicacions protegides».</string>
<string name="setup_huawei_button">Protegeix Briar</string>
<string name="setup_huawei_help">Si no afegiu Briar a la llista d\'aplicacions protegides, s\'evitarà que Briar s\'executi en segon pla.</string>
<string name="warning_dozed">%s no s\'ha pogut executar en segon pla</string>
<!--Login-->
<string name="enter_password">Introdueix la teva contrasenya:</string>
<string name="try_again">La contrasenya és incorrecta, torna-ho a provar</string>
<string name="enter_password">Escriviu la vostra contrasenya:</string>
<string name="try_again">La contrasenya és incorrecta, torni a escriure-la</string>
<string name="sign_in_button">Inicia la sessió</string>
<string name="forgotten_password">He oblidat la contrasenya</string>
<string name="forgotten_password">No recordo la contrasenya</string>
<string name="dialog_title_lost_password">Contrasenya perduda</string>
<string name="dialog_message_lost_password">El vostre compte de Briar s\'emmagatzema xifrat al vostre dispositiu, no al núvol; per tant no podem restaurar-ne la contrasenya. Voleu esborrar el compte i tornar a començar?\n\nAlerta: les vostres identitats, contactes i missatges es perdran per sempre.</string>
<string name="dialog_message_lost_password">El vostre compte de Briar s\'emmagatzema només en el vostre dispositiu i xifrat. La contrasenya, doncs, no es pot restablir. Voleu esborrar el compte i crear-ne un de nou?\n\nAtenció! Si esborreu el compte la vostra identitat, els contactes i els missatges antics es perdran per sempre.</string>
<string name="startup_failed_notification_title">Briar no s\'ha pogut iniciar</string>
<string name="startup_failed_notification_text">Toqueu per obtenir més informació.</string>
<string name="startup_failed_notification_text">Feu un toc per obtenir més informació.</string>
<string name="startup_failed_activity_title">Error iniciant Briar</string>
<string name="startup_failed_db_error">Per alguna raó, la vostra base de dades de Briar ha estat corrompuda i no es pot reparar. El vostre compte, les dades i els contactes s\'han perdut. Malhauradament, has de reinstal·lar Briar o crear un nou compte triant \"He oblidat la contrasenya\" en la pantalla on poses la contrasenya.</string>
<string name="startup_failed_data_too_old_error">El teu compte es va crear amb una versió antiga d\'aquesta app i no es pot obrir amb aquesta versió. O bé reinstal·les la versió antiga o crea un nou compte triant \"Ho oblidat la contrasenya\" en la pantalla on poses la contrasenya.</string>
<string name="startup_failed_data_too_new_error">Aquesta versió de l\'aplicació és massa antiga. Actualitzeu a la versió més recent i torneu-ho a provar.</string>
<string name="startup_failed_service_error">Briar no ha pogut engegar un connector necessari. La solució sol ser reinstal·lar Briar. De tota manera, tingueu en compte que si ho feu perdreu el vostre compte i totes les dades associades, doncs Briar no usa servidors centrals per desar les vostres dades.</string>
<string name="startup_failed_db_error">Per alguna raó, la base de dades de Briar s\'ha corromput i no es pot adobar. El vostre compte, les dades i els contactes s\'han perdut. Malauradament, heu de reinstal·lar Briar o crear un nou compte triant l\'opció \"No recordo la contrasenya\" quan se us demani la contrasenya.</string>
<string name="startup_failed_data_too_old_error">El vostre compte va ser creat amb una versió antiga de Briar i no es pot obrir amb la versió actual. O bé reinstal·leu la versió antiga o creeu un nou compte triant l\'opció \"No recordo la contrasenya\" quan se us demana la contrasenya.</string>
<string name="startup_failed_data_too_new_error">Aquesta versió de Briar és massa antiga. Actualitzeu Briar a la darrera versió i torneu a provar-ho.</string>
<string name="startup_failed_service_error">Briar no ha pogut engegar un connector imprescindible. La reinstal·lació de Briar acostuma a resoldre aquest problema. Tingueu en compte que si reinstal·leu, perdreu el vostre compte i les dades associades doncs Briar no usa servidors centrals per desar-les.</string>
<plurals name="expiry_warning">
<item quantity="one">Aquesta és una versió de prova de Briar. El vostre compte expira en %d dia i no es pot renovar.</item>
<item quantity="other">Aquesta és una versió de prova de Briar. El vostre compte expira en %d dies i no es pot renovar.</item>
<item quantity="other">Aquesta és una versió de prova de Briar. El vostre compte expira en %d dies i no es pot renovar.</item>
</plurals>
<string name="expiry_update">S\'ha ampliat la data de venciment de la prova. El vostre compte caducarà ara en %d dies.</string>
<string name="expiry_date_reached">Aquest programa ha caducat.\nGràcies per haver-lo provat!</string>
<string name="download_briar">Per continuar utilitzant Briar, baixeu la versió 1.0.</string>
<string name="download_briar">Per continuar fent servir Briar, descarregueu-vos la versió 1.0.</string>
<string name="create_new_account">Haureu de crear un compte nou, però podeu utilitzar el mateix sobrenom.</string>
<string name="download_briar_button">Baixa Briar 1.0</string>
<string name="download_briar_button">Descarrega Briar 1.0</string>
<string name="startup_open_database">S\'està desxifrant la base de dades...</string>
<string name="startup_migrate_database">S\'està actualitzant la base de dades...</string>
<!--Navigation Drawer-->
@@ -66,24 +66,24 @@
<string name="ongoing_notification_text">Toca per a obrir Briar.</string>
<plurals name="private_message_notification_text">
<item quantity="one">Missatge privat nou.</item>
<item quantity="other">1%d missatges privats nous.</item>
<item quantity="other">%d missatges privats nous.</item>
</plurals>
<plurals name="group_message_notification_text">
<item quantity="one">Missatge de grup nou.</item>
<item quantity="other">1%d missatges de grup nous</item>
<item quantity="other">%d missatges de grup nous</item>
</plurals>
<plurals name="forum_post_notification_text">
<item quantity="one"> Un nou missatge del fòrum.</item>
<item quantity="other">%d nous missatges del fòrum.</item>
<item quantity="other">%d missatges nous al fòrum.</item>
</plurals>
<plurals name="blog_post_notification_text">
<item quantity="one">Una nova publicacions al bloc.</item>
<item quantity="other">%d noves publicacions al blog.</item>
<item quantity="other">%d publicacions noves al blog.</item>
</plurals>
<!--Misc-->
<string name="now">Ara</string>
<string name="show">Mostrar</string>
<string name="hide">Ocultar</string>
<string name="show">Mostra</string>
<string name="hide">Oculta</string>
<string name="ok">D\'acord</string>
<string name="cancel">Cancel·la</string>
<string name="got_it">D\'acord</string>
@@ -98,38 +98,38 @@
<string name="open">Obre</string>
<string name="no_data">Sense dades</string>
<string name="ellipsis">...</string>
<string name="text_too_long">El text introduït és massa llarg</string>
<string name="text_too_long">El text és massa llarg</string>
<string name="show_onboarding">Mostra el diàleg d\'ajuda.</string>
<string name="fix">Corregeix</string>
<string name="help">Ajuda</string>
<string name="sorry">Ens sap greu</string>
<!--Contacts and Private Conversations-->
<string name="no_contacts">No hi ha contactes\n\nPulsa l\'icona + per afegir un contacte</string>
<string name="no_contacts">No hi ha cap contacte\n\nPulseu l\'icona + per afegir un contacte</string>
<string name="date_no_private_messages">Sense missatges.</string>
<string name="no_private_messages">No hi ha missatges</string>
<string name="message_hint">Escriu el missatge.</string>
<string name="delete_contact">Suprimeix contacte</string>
<string name="dialog_title_delete_contact">Confirma la supressió del contacte</string>
<string name="dialog_message_delete_contact">Estàs segur que vols esborrar aquest contacte i tots els missatges que hi has intercanviat?</string>
<string name="contact_deleted_toast">Contacte suprimit</string>
<string name="no_private_messages">No hi ha cap missatge</string>
<string name="message_hint">Escriviu un missatge</string>
<string name="delete_contact">Suprimeix el contacte</string>
<string name="dialog_title_delete_contact">Confirmeu la supressió del contacte</string>
<string name="dialog_message_delete_contact">Esteu convençut de suprimir aquest contacte i tots els missatges que us heu intercanviat?</string>
<string name="contact_deleted_toast">S\'ha suprimit el contacte</string>
<!--Adding Contacts-->
<string name="add_contact_title">Afegir contacte</string>
<string name="face_to_face">T\'has de trobar amb la persona que vols afegir com a contacte.\n\nAixò evitarà que algú suplanti la teva identitat o llegeixi els teus missatges.</string>
<string name="add_contact_title">Afegeix un contacte</string>
<string name="face_to_face">Heu de coincidir en el mateix lloc amb la persona que voleu afegir com a contacte.\n\nD\'aquesta manera evitareu que algú suplanti les vostres identitats o pugui llegir els vostres missatges en el futur.</string>
<string name="continue_button">Continua</string>
<string name="connection_failed">La connexió ha fallat</string>
<string name="try_again_button">Torna-ho a provar</string>
<string name="waiting_for_contact_to_scan">Esperant que el teu contacte escanegi i connecti\u2026</string>
<string name="waiting_for_contact_to_scan">Esperant que el vostre contacte escanegi i es connecti\u2026</string>
<string name="exchanging_contact_details">Intercanviant els detalls del contacte\u2026</string>
<string name="contact_added_toast">Contacte afegit: %s</string>
<string name="contact_already_exists">El contacte %s ja existeix</string>
<string name="contact_already_exists">El contacte %s ja existia</string>
<string name="contact_exchange_failed">L\'intercanvi de contactes ha fallat</string>
<string name="qr_code_invalid">El codi QR és invàlid</string>
<string name="qr_code_unsupported">El codi QR que intenteu escanejar pertany a una versió antiga de %s que ja no és compatible.\n\nAssegureu-vos que tots dos estiguin executant la versió més recent i torneu-ho a provar.</string>
<string name="qr_code_unsupported">El codi QR que intenteu escanejar pertany a una versió antiga de %s que ja no és compatible.\n\nAssegureu-vos que tothom està executant la darrera versió i torneu a provar-ho.</string>
<string name="camera_error">Error de la càmera</string>
<string name="connecting_to_device">Connectant al dispositiu\u2026</string>
<string name="connecting_to_device">Connectant-se al dispositiu\u2026</string>
<string name="authenticating_with_device">Autenticant-se amb el dispositiu\u2026</string>
<string name="connection_aborted_local">S\'ha avortat la connexió! Això podria significar que algú intenta interferir amb la vostra connexió</string>
<string name="connection_aborted_remote">El teu contacte ha avortat la connexió! Això podria significar que algú està provant d\'interferir la vostra connexió</string>
<string name="connection_aborted_remote">El vostre contacte ha avortat la connexió! Això podria significar que algú està provant d\'interferir la vostra connexió</string>
<!--Introductions-->
<string name="introduction_onboarding_title">Introdueix els teus contactes</string>
<string name="introduction_onboarding_text">Pots presentar els teus contactes entre si, de manera que no necessiten trobar-se en persona per a donar-se d\'alta com a contactes a Briar.</string>

View File

@@ -124,6 +124,7 @@
<string name="contact_already_exists">Yhteystieto %s on jo olemassa</string>
<string name="contact_exchange_failed">Yhteystietojen vaihto epäonnistui</string>
<string name="qr_code_invalid">QR koodi on virheellinen</string>
<string name="qr_code_unsupported">Skannaamasi QR-koodi kuuluu %s:in vanhaan versioon, jonka tuki on loppunut.\n\nVarmista että kumpikin teistä käyttää uusinta versiota ja yritä uudelleen.</string>
<string name="camera_error">Kameravirhe</string>
<string name="connecting_to_device">Yhdistetään laitteeseen\u2026</string>
<string name="authenticating_with_device">Tunnistaudutaan laitteen kanssa\u2026</string>
@@ -144,6 +145,7 @@
<string name="introduction_request_exists_received">%1$s on pyytänyt, että sinut esitellään käyttäjälle %2$s, mutta %2$s on jo yhteystiedoissasi. %1$s ei välttämättä tiedä tätä, joten voit silti vastata:</string>
<string name="introduction_request_answered_received">%1$s on pyytänyt, että sinut esitellään käyttäjälle %2$s.</string>
<string name="introduction_response_accepted_sent">Olet hyväksynyt esittelyn käyttäjälle %1$s.</string>
<string name="introduction_response_accepted_sent_info">Ennen kuin %1$s voidaan lisätä sinun yhteystietoihin, hänen täytyy myös hyväksyä esittely. Tämä voi viedä vähän aikaa.</string>
<string name="introduction_response_declined_sent">Olet kieltäytynyt esittelystä käyttäjälle %1$s.</string>
<string name="introduction_response_accepted_received">%1$s hyväksyi esittelyn käyttäjälle %2$s.</string>
<string name="introduction_response_declined_received">%1$s kieltäytyi esittelystä käyttäjälle %2$s.</string>
@@ -263,6 +265,7 @@
<string name="blogs_blog_post_created">Blogikirjoitus julkaistu</string>
<string name="blogs_blog_post_received">Uusi blogikirjoitus vastaanotettu</string>
<string name="blogs_blog_post_scroll_to">Vieritä kohtaan</string>
<string name="blogs_feed_empty_state">Ei kirjoituksia\n\nYhteyshenkilöitesi ja seuraamiesi blogien kirjoitukset tulevat näkymään tässä\n\nNapauta kynää kirjoittaaksesi jotain</string>
<string name="blogs_remove_blog">Poista blogi</string>
<string name="blogs_remove_blog_dialog_message">Oletko varma, että haluat poistaa tämän blogin?\n\nKirjoitukset poistuvat sinun laitteelta, mutta ei muiden laitteilta.\n\nKäyttäjät joiden kanssa olet jakanut tämän blogin eivät välttämättä saa uusia päivityksiä.</string>
<string name="blogs_remove_blog_ok">Poista</string>

View File

@@ -1,7 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!--Setup-->
<string name="setup_title">Benvida a Briar</string>
<string name="setup_name_explanation">O seu alcume mostrarase xunto a todas as mensaxes que publique. Pode cambialo tras crear a súa conta.</string>
<string name="setup_next">Seguinte</string>
<string name="setup_password_intro">Escolla un Contrasinal</string>
<string name="setup_password_explanation">A súa conta en Briar gárdase cifrada no seu dispositivo, non na nube. Si esquece o contrasinal ou desinstala Briar, non haberá xeito de recuperar a súa conta.\n\nEscolla un contrasinal longo que sexa difícil de supoñer, algo como catro palabras ao chou, ou dez letras aleatorias, números e símbolos.</string>
<string name="setup_doze_title">Conexións en segundo plano</string>
<string name="setup_doze_intro">Para recibir mensaxes, Briar precisa estar conectada en segundo plano.</string>
<string name="setup_doze_explanation">Para recibir mensaxes, Briar precisa estar conectada en segundo plano. Por favor desactive as optimizacións de batería para que Briar poida permanecer conectada.</string>
<string name="setup_doze_button">Permitir conexións</string>
<string name="choose_nickname">Escolle o teu alcume</string>
<string name="choose_password">Escolle a túa clave</string>
<string name="confirm_password">Confirma a túa clave</string>
@@ -9,6 +17,12 @@
<string name="password_too_weak">A clave é demasiado débil</string>
<string name="passwords_do_not_match">As claves non coinciden</string>
<string name="create_account_button">Crea a conta</string>
<string name="more_info">Máis información</string>
<string name="don_t_ask_again">Non preguntar de novo</string>
<string name="setup_huawei_text">Por favor toque o botón inferior e asegúrese de que Briar está protexida na pantalla \"Apps Protexidas\"</string>
<string name="setup_huawei_button">Protexer Briar</string>
<string name="setup_huawei_help">Si Briar non se engade ao listado de apps protexidas, non poderá funcionar en segundo plano.</string>
<string name="warning_dozed">%s non foi quen de funcionar en segundo plano</string>
<!--Login-->
<string name="enter_password">Introduce a túa clave:</string>
<string name="try_again">Clave incorrecta, tenteo de novo</string>
@@ -17,9 +31,23 @@
<string name="dialog_title_lost_password">Clave perdida</string>
<string name="dialog_message_lost_password">Briar almacena a súa configuración encriptada no dispositivo, non na nube, así que non podemos restabelecer a súa clave. Querrías borrar a túa conta e empezar de novo?\n\nPrecaución: As túas identidades, contactos e mensaxes serán eliminadas de forma permanente.</string>
<string name="startup_failed_notification_title">Briar non puido iniciarse</string>
<string name="startup_failed_notification_text">Toque para máis información.</string>
<string name="startup_failed_activity_title">Fallo de Inicio de Briar</string>
<string name="startup_failed_db_error">Por algún motivo, a súa base de datos de Briar está defectuosa sen remedio. A súa conta, os seus datos e contactos perdéronse. Desgraciadamente, debe reinstalar Briar ou crear unha nova conta escollendo \'Esquecín o meu contrasinal\' cando se lle solicite o contrasinal.</string>
<string name="startup_failed_data_too_old_error">A súa conta foi creada con unha versión anterior da aplicación e non se pode abrir con esta versión. Deberá reinstalar a versión anterior ou ben crear unha nova conta escollendo \'Esquecín o meu contrasinal\' cando se lle solicite o contrasinal.</string>
<string name="startup_failed_data_too_new_error">Esta versión da app é moi antiga. Actualice por favor a última versión e inténteo de novo.</string>
<string name="startup_failed_service_error"> Briar non puido iniciar un complemento necesario. Xeralmente reinstalar Briar resolve este problema. Teña en conta que entón perderá a súa conta e todos os datos asociados a esta pois Briar non está a utilizar servidores centrais para almacenar os seus datos.</string>
<plurals name="expiry_warning">
<item quantity="one">Esta versión de Briar é para probas. A conta caducará en %d día e non se pode anovar.</item>
<item quantity="other">Esta versión de Briar é para probas. A conta caducará en %d días e non se pode anovar.</item>
</plurals>
<string name="expiry_update">A data de caducidade de probas foi alongada. Agora a súa conta caduca en %d días.</string>
<string name="expiry_date_reached">Este software caducou.\nGrazas por probalo!</string>
<string name="download_briar">Para continuar utilizando Briar, descargue por favor a versión 1.0.</string>
<string name="create_new_account">Precisa crear unha nova conta, pero pode utilizar o mesmo alcume.</string>
<string name="download_briar_button">Descargar Briar 1.0</string>
<string name="startup_open_database">Descifrando a Base de datos...</string>
<string name="startup_migrate_database">Actualizando a Base de datos...</string>
<!--Navigation Drawer-->
<string name="nav_drawer_open_description">Abra a gaveta de navegación</string>
<string name="nav_drawer_close_description">Peche a gaveta de navegación</string>
@@ -36,6 +64,22 @@
<!--Notifications-->
<string name="ongoing_notification_title">Conectado a Briar</string>
<string name="ongoing_notification_text">Toque para abrir Briar</string>
<plurals name="private_message_notification_text">
<item quantity="one">Nova mensaxe privada.</item>
<item quantity="other">%d novas mensaxes privadas.</item>
</plurals>
<plurals name="group_message_notification_text">
<item quantity="one">Nova mensaxe de grupo.</item>
<item quantity="other">%d novas mensaxes de grupo.</item>
</plurals>
<plurals name="forum_post_notification_text">
<item quantity="one">Nova publicación de foro.</item>
<item quantity="other">%d nova publicación de foro.</item>
</plurals>
<plurals name="blog_post_notification_text">
<item quantity="one">Nova publicación de blog.</item>
<item quantity="other">%d novas publicacións de blog.</item>
</plurals>
<!--Misc-->
<string name="now">agora</string>
<string name="show">Amosar</string>
@@ -56,24 +100,68 @@
<string name="ellipsis">...</string>
<string name="text_too_long">O texto inserido e demasiado longo</string>
<string name="show_onboarding">Amosar xanela de axuda</string>
<string name="fix">Arranxar</string>
<string name="help">Axuda</string>
<string name="sorry">Desculpe</string>
<!--Contacts and Private Conversations-->
<string name="no_contacts">Sen contactos a mostrar\n\nToque na icona + para engadir contactos</string>
<string name="date_no_private_messages">Sen mensaxes</string>
<string name="no_private_messages">Sen mensaxes que mostrar</string>
<string name="message_hint">Esciba unha mensaxe</string>
<string name="delete_contact">Eliminar contacto</string>
<string name="dialog_title_delete_contact">Confirme a eliminación do contacto</string>
<string name="dialog_message_delete_contact">Segura de querer eliminar este contacto e todas as mensaxes que intercambiaron?</string>
<string name="contact_deleted_toast">Contacto eliminado</string>
<!--Adding Contacts-->
<string name="add_contact_title">Engada un contacto</string>
<string name="face_to_face">Debe encontrarse coa persoa que quere engadir como contacto.\n\nEsto evitará que calquera poida suplantala ou ler as súas mensaxes no futuro.</string>
<string name="continue_button">Continuar</string>
<string name="connection_failed">Fallou a conexión</string>
<string name="try_again_button">Tenteo de novo</string>
<string name="waiting_for_contact_to_scan">Agardando polo contacto para escanear e conectar\u2026</string>
<string name="exchanging_contact_details">Intercambiando detalles do contacto\u2026</string>
<string name="contact_added_toast">Contacto engadido: %s</string>
<string name="contact_already_exists">O contacto %s xa existe</string>
<string name="contact_exchange_failed">Fallo no intercambio de contacto</string>
<string name="qr_code_invalid">O código QR non é válido</string>
<string name="qr_code_unsupported">O código QR que intenta escanear pertence a unha versión antiga de %s que xa non está soportada.\n\nPor favor, asegúrese que ambas utilizan a última versión e inténteno de novo.</string>
<string name="camera_error">Fallo na cámara</string>
<string name="connecting_to_device">Conectando co dispositivo\u2026</string>
<string name="authenticating_with_device">Autenticándose co dispositivo\u2026</string>
<string name="connection_aborted_local">Conexión cancelada! Esto podería significar que alguén está intentando entremeterse na súa conexión.</string>
<string name="connection_aborted_remote">Conexión rexeitada polo seu contacto! Esto podería indicar que alguén está intentando interferir na súa conexión</string>
<!--Introductions-->
<string name="introduction_onboarding_title">Presente os seus contactos</string>
<string name="introduction_onboarding_text">Pode presentar aos seus contactos, así non precisan encontrarse en persoa para conectar a través de Briar.</string>
<string name="introduction_activity_title">Escoller contacto</string>
<string name="introduction_not_possible">Xa ten unha presentación en progreso con estes contactos. Por favor, deixe que remate o proceso. Si vostede ou os contactos se conectan con pouca asiduidade esto podería levar algún tempo.</string>
<string name="introduction_message_title">Introducir Contactos</string>
<string name="introduction_message_hint">Engadir unha mensaxe (opcional)</string>
<string name="introduction_button">Preséntese</string>
<string name="introduction_sent">Enviouse a súa presentación.</string>
<string name="introduction_error">Algo fallou ao enviar a presentación.</string>
<string name="introduction_response_error">Fallo respondendo a presentación</string>
<string name="introduction_request_sent">Solicitou presentar %1$s a %2$s.</string>
<string name="introduction_request_received">%1$s solicitou presentala a %2$s. Quere engadir a %2$s ao seu listado de contactos?</string>
<string name="introduction_request_exists_received">%1$s solicitou presentala a %2$s, pero %2$s xa está no seu listado de contactos. Xa que %1$s podería non sabelo, pode responder igualmente:</string>
<string name="introduction_request_answered_received">%1$s solicitou presentala a %2$s.</string>
<string name="introduction_response_accepted_sent">Aceptou a presentación a %1$s.</string>
<string name="introduction_response_accepted_sent_info">Antes de engadir %1$s aos seus contactos, eles precisan aceptar a presentación tamén. Esto podería levar algún tempo.</string>
<string name="introduction_response_declined_sent">Vostede rexeitou a presentación a %1$s.</string>
<string name="introduction_response_accepted_received">%1$s aceptou a presentación a %2$s.</string>
<string name="introduction_response_declined_received">%1$s rexeitou a presentación a %2$s.</string>
<string name="introduction_response_declined_received_by_introducee">%1$s di que %2$srexeitou a presentación.</string>
<plurals name="introduction_notification_text">
<item quantity="one">Novo contacto engadido.</item>
<item quantity="other">%d novos contactos engadidos.</item>
</plurals>
<!--Private Groups-->
<string name="groups_list_empty">Sen grupos para mostrar\n\nToque na icona + para crear un grupo, ou pida aos seus contactos que compartan grupos con vostede</string>
<string name="groups_created_by">Creado por %s</string>
<plurals name="messages">
<item quantity="one">%d mensaxe</item>
<item quantity="other">%d mensaxes</item>
</plurals>
<string name="groups_group_is_empty">Este grupo está valeiro</string>
<string name="groups_group_is_dissolved">Este grupo foi disolto</string>
<string name="groups_remove">Eliminar</string>
@@ -81,51 +169,228 @@
<string name="groups_create_group_button">Crear Grupo</string>
<string name="groups_create_group_invitation_button">Enviar Convite</string>
<string name="groups_create_group_hint">Escolla un nome para o seu grupo privado</string>
<string name="groups_invitation_sent">Enviouse o convite de grupo</string>
<string name="groups_message_sent">Mensaxe enviada</string>
<string name="groups_member_list">Lista de Membros</string>
<string name="groups_invite_members">Convidar a Membros</string>
<string name="groups_member_created_you">Vostede creou o grupo</string>
<string name="groups_member_created">%s creou o grupo</string>
<string name="groups_member_joined_you">Vostede ingresou no grupo</string>
<string name="groups_member_joined">%s uníuse ao grupo</string>
<string name="groups_leave">Deixar Grupo</string>
<string name="groups_leave_dialog_title">Confirme que deixa o Grupo</string>
<string name="groups_leave_dialog_message">Está certo de que quere deixar este grupo?</string>
<string name="groups_dissolve">Desfacer o grupo</string>
<string name="groups_dissolve_dialog_title">Confirme a disolución do grupo</string>
<string name="groups_dissolve_dialog_message">Segura de querer desfacer o grupo?\n\nO resto da membresía non poderá continuar a conversa e podería non recibir as últimas mensaxes.</string>
<string name="groups_dissolve_button">Desfacer</string>
<string name="groups_dissolved_dialog_title">O grupo foi desfeito</string>
<string name="groups_dissolved_dialog_message">A persoa creadora do grupo desfíxoo.\n\nXa non poderá escribir mensaxes ao grupo e podería non ter recibido todas as mensaxes que foran escritas.</string>
<!--Private Group Invitations-->
<string name="groups_invitations_title">Convites de Grupo</string>
<string name="groups_invitations_invitation_sent">Convidou a %1$s a unirse ao grupo \"%2$s\".</string>
<string name="groups_invitations_invitation_received">%1$s convidouna a unirse ao grupo \"%2$s\".</string>
<string name="groups_invitations_joined">Xa está no grupo</string>
<string name="groups_invitations_declined">Rexeitou o convite ao grupo</string>
<plurals name="groups_invitations_open">
<item quantity="one">%d convite de grupo aberto</item>
<item quantity="other">%d convites de grupo abertos</item>
</plurals>
<string name="groups_invitations_response_accepted_sent">Aceptou o convite de grupo de %s.</string>
<string name="groups_invitations_response_declined_sent">Rexeitou o convite de grupo de %s.</string>
<string name="groups_invitations_response_accepted_received">%s aceptou o convite de grupo.</string>
<string name="groups_invitations_response_declined_received">%s rexeitou o convite de grupo.</string>
<string name="sharing_status_groups">Só a persoa creadora poder convidar a novos membros ao grupo. Abaixo está a membresía do grupo.</string>
<!--Private Groups Revealing Contacts-->
<string name="groups_reveal_contacts">Revelar contactos</string>
<string name="groups_reveal_dialog_message">Pode escoller si revela os contactos a todos os compoñentes actuais e futuros do grupo.\n\Si revela os contactos a conexión do grupo será máis rápida e fiable, xa que poderá comunicarse cos contactos revelados incluso si a creadora do grupo non está en liña.</string>
<string name="groups_reveal_visible">A relación do contacto é visible para o grupo</string>
<string name="groups_reveal_visible_revealed_by_us">A relación co contacto é visible para o grupo (revelada por vostede)</string>
<string name="groups_reveal_visible_revealed_by_contact">A relación con contacto é visible para o grupo (revelada por %s)</string>
<string name="groups_reveal_invisible">A relación co contacto non é visible para o grupo</string>
<!--Forums-->
<string name="no_forums">Si foros que mostrar\n\nToque na icona + para crear un foro, ou solicite aos contactos que compartan foros con vostede</string>
<string name="create_forum_title">Crear Foro</string>
<string name="choose_forum_hint">Escolla un nome para o seu foro</string>
<string name="create_forum_button">Crear Foro</string>
<string name="forum_created_toast">Foro creado</string>
<string name="no_forum_posts">Sen publicacións que mostrar</string>
<string name="no_posts">Non hai mensaxes</string>
<plurals name="posts">
<item quantity="one">%d publicación</item>
<item quantity="other">%d publicacións</item>
</plurals>
<string name="forum_new_entry_posted">Entrada ao foro enviada</string>
<string name="forum_new_message_hint">Nova Entrada</string>
<string name="forum_message_reply_hint">Nova Resposta</string>
<string name="btn_reply">Respostar</string>
<string name="forum_leave">Deixar foro</string>
<string name="dialog_title_leave_forum">Confirme a saída do foro</string>
<string name="dialog_message_leave_forum">Segura de querer deixar este foro?\n\nTodos os contactos cos que comparteu este foro poderían deixar de recibir actualizacións.</string>
<string name="dialog_button_leave">Saír</string>
<string name="forum_left_toast">Saír do foro</string>
<!--Forum Sharing-->
<string name="forum_share_button">Compartir Foro</string>
<string name="contacts_selected">Contactos selecionados</string>
<string name="activity_share_toolbar_header">Escolla Contactos</string>
<string name="no_contacts_selector">Sen contactos que mostrar\n\nPor favor, volte aquí tras engadir un contacto</string>
<string name="forum_shared_snackbar">Foro compartido cos contactos escollidos</string>
<string name="forum_share_message">Engadir unha mensaxe (opcional)</string>
<string name="forum_share_error">Algo fallou ao compartir este foro.</string>
<string name="forum_invitation_received">%1$s compartiu este foro \"%2$s\" con vostede.</string>
<string name="forum_invitation_sent">Compartiu este foro \"%1$s\" con %2$s.</string>
<string name="forum_invitations_title">Convites a foros</string>
<string name="forum_invitation_exists">Xa aceptara o convite a este foro\n\nAceptando máis convites fará a súa conexión ao foro máis rápida e fiable.</string>
<string name="forum_joined_toast">Uniuse ao foro</string>
<string name="forum_declined_toast">Rexeitou o convite</string>
<string name="shared_by_format">Compartido por %s</string>
<string name="forum_invitation_already_sharing">Xa compartindo</string>
<string name="forum_invitation_response_accepted_sent">Aceptou o convite de %s ao foro.</string>
<string name="forum_invitation_response_declined_sent">Rexeitou o convite de %s ao foro.</string>
<string name="forum_invitation_response_accepted_received">%s aceptou o convite ao foro.</string>
<string name="forum_invitation_response_declined_received">%s rexeitou o convite ao foro.</string>
<string name="sharing_status">Estado do compartido</string>
<string name="sharing_status_forum">Calquera compoñente do foro pode compartilo cos seus contactos. Vostede pode compartir este foro cos seguintes contactos. Pode haber outras persoas que vostede non pode ver.</string>
<string name="shared_with">Compartido con %1$d (%2$d en liña)</string>
<plurals name="forums_shared">
<item quantity="one">%d foro compartido por contactos</item>
<item quantity="other">%d foros compartidos por contactos</item>
</plurals>
<string name="nobody">Ninguén</string>
<!--Blogs-->
<string name="blogs_other_blog_empty_state">Sen publicacións que mostrar</string>
<string name="read_more">ler mais</string>
<string name="blogs_write_blog_post">Escribir entrada de Blog</string>
<string name="blogs_write_blog_post_body_hint">Escriba a súa entrada no blog</string>
<string name="blogs_publish_blog_post">Publicar</string>
<string name="blogs_blog_post_created">Entrada no blog creada</string>
<string name="blogs_blog_post_received">Nova entrada de blog recibida</string>
<string name="blogs_blog_post_scroll_to">Desplazarse a</string>
<string name="blogs_feed_empty_state">Sen entradas que mostrar\n\nAs entradas dos seus contactos e blogs aos que está subscrita aparecerán aquí\n\nToque na icona do lapis para escribir unha entrada</string>
<string name="blogs_remove_blog">Eliminar Blog</string>
<string name="blogs_remove_blog_dialog_message">Segura de que quere eliminar este blog?\n\nAs entradas eliminaranse do seu dispositivo pero non dos dispositivos de outras persoas.\n\nCalquera contacto co que compartira este blog podería deixar de recibir actualizacións.</string>
<string name="blogs_remove_blog_ok">Eliminar</string>
<string name="blogs_blog_removed">Blog eliminado</string>
<string name="blogs_reblog_comment_hint">Engadir un comentario (optativo)</string>
<string name="blogs_reblog_button">Compartir</string>
<!--Blog Sharing-->
<string name="blogs_sharing_share">Compartir blog</string>
<string name="blogs_sharing_error">Algo fallou ao compartir o blog</string>
<string name="blogs_sharing_button">Compartir blog</string>
<string name="blogs_sharing_snackbar">Blog compartido cos contactos escollidos</string>
<string name="blogs_sharing_response_accepted_sent">Aceptou o convite ao blog de %s.</string>
<string name="blogs_sharing_response_declined_sent">Rexeitou o convite ao blog de %s.</string>
<string name="blogs_sharing_response_accepted_received">%s aceptou o convite ao blog.</string>
<string name="blogs_sharing_response_declined_received">%s rexeitou o convite ao blog.</string>
<string name="blogs_sharing_invitation_received">%1$s compartiu o blog \"%2$s\" con vostede.</string>
<string name="blogs_sharing_invitation_sent">Vostede compartiu o blog \"%1$s\" con %2$s.</string>
<string name="blogs_sharing_invitations_title">Convites a Blog</string>
<string name="blogs_sharing_joined_toast">Subscrita ao blog</string>
<string name="blogs_sharing_declined_toast">Rexeitou o convite</string>
<string name="sharing_status_blog">Calquera que se subscribe a un blog pode compartilo cos seus contactos. Pode compartir este blog cos seguintes contactos. Podería haber outras subscritoras que vostede non pode ver.</string>
<!--RSS Feeds-->
<string name="blogs_rss_feeds_import">Importar fonte RSS</string>
<string name="blogs_rss_feeds_import_button">Importar</string>
<string name="blogs_rss_feeds_import_hint">Introduza o URL da fonte RSS</string>
<string name="blogs_rss_feeds_import_error">Lamentámolo! Algo fallou ao importar a fonte.</string>
<string name="blogs_rss_feeds_manage">Xestionar Fontes RSS</string>
<string name="blogs_rss_feeds_manage_imported">Importado:</string>
<string name="blogs_rss_feeds_manage_author">Autor/a:</string>
<string name="blogs_rss_feeds_manage_updated">Última actualización:</string>
<string name="blogs_rss_remove_feed">Eliminar fonte</string>
<string name="blogs_rss_remove_feed_dialog_message">Está segura de que quere eliminar esta fonte?\n\nAs entradas eliminaranse do seu dispositivo pero non dos dispositivos de outras persoas\n\nTodas as persoas coas que compartiu esta fonte poderían deixar de recibir actualizacións.</string>
<string name="blogs_rss_remove_feed_ok">Eliminar</string>
<string name="blogs_rss_feeds_manage_delete_error">Non se puido eliminar a fonte!</string>
<string name="blogs_rss_feeds_manage_empty_state">Sen fontes RSS que mostrar\n\nToque na icona + para importar unha fonte</string>
<string name="blogs_rss_feeds_manage_error">Aconteceu un problema ao cargar as súas fontes. Por favor, inténteo máis tarde.</string>
<!--Settings Network-->
<string name="network_settings_title">Redes</string>
<string name="bluetooth_setting">Conectar vía Bluetooth</string>
<string name="bluetooth_setting_enabled">En claquera momento que un contacto estea preto</string>
<string name="bluetooth_setting_disabled">Só ao engadir contactos</string>
<string name="tor_network_setting">Conectar vía Tor</string>
<string name="tor_network_setting_never">Nunca</string>
<string name="tor_network_setting_wifi">Só utilizando Wi-Fi</string>
<string name="tor_network_setting_always">Utilizando Wi-Fi ou datos móbiles</string>
<!--Settings Security and Panic-->
<string name="security_settings_title">Seguridade</string>
<string name="change_password">Cambiar contrasinal</string>
<string name="current_password">Introduza o contrasinal actual:</string>
<string name="choose_new_password">Novo contrasinal:</string>
<string name="confirm_new_password">Confirme o contrasinal:</string>
<string name="password_changed">Cambiou o contrasinal</string>
<string name="panic_setting">Axustes do botón do pánico</string>
<string name="panic_setting_title">Botón do pánico</string>
<string name="panic_setting_hint">Axuste como debe reaccionar Briar cando utilice a app botón do pánico</string>
<string name="panic_app_setting_title">App Botón do pánico</string>
<string name="unknown_app">unha aplicación descoñecida</string>
<string name="panic_app_setting_summary">Non se estableceu unha app</string>
<string name="panic_app_setting_none">Ningún</string>
<string name="dialog_title_connect_panic_app">Confirme a App do pánico</string>
<string name="dialog_message_connect_panic_app">Está segura de querer permitir a %1$s activar accións destrutivas do botón do pánico?</string>
<string name="lock_setting_title">Finalizar sesión</string>
<string name="lock_setting_summary">Desconecte de Briar si o botón do pánico se preme</string>
<string name="purge_setting_title">Eliminar conta</string>
<string name="purge_setting_summary">Elimina a súa conta en Briar si se preme o botón do pánico. Coidado: Esto eliminará permanentemente as súas identidade, contactos e mensaxes</string>
<string name="uninstall_setting_title">Desinstalar Briar</string>
<string name="uninstall_setting_summary">Esto require confirmación manual no evento do pánico</string>
<!--Settings Notifications-->
<string name="notification_settings_title">Notificacións</string>
<string name="notify_private_messages_setting_title">Mensaxes privadas</string>
<string name="notify_private_messages_setting_summary">Mostra alertas para mensaxes privadas</string>
<string name="notify_private_messages_setting_summary_26">Configurar alertas para mensaxes privadas</string>
<string name="notify_group_messages_setting_title">Mensaxes de grupo</string>
<string name="notify_group_messages_setting_summary">Mostra alertas para mensaxes de grupo</string>
<string name="notify_group_messages_setting_summary_26">Configurar alertas para mensaxes de grupo</string>
<string name="notify_forum_posts_setting_title">Entradas no foro</string>
<string name="notify_forum_posts_setting_summary">Mostra alertas para mensaxes nos foros</string>
<string name="notify_forum_posts_setting_summary_26">Configurar alertas para mensaxes nos foros</string>
<string name="notify_blog_posts_setting_title">Entradas no Blog</string>
<string name="notify_blog_posts_setting_summary">Mostra alertas para entradas no blog</string>
<string name="notify_blog_posts_setting_summary_26">Configurar alertas para entradas no blog</string>
<string name="notify_vibration_setting">Vibrar</string>
<string name="notify_lock_screen_setting_title">Bloquear pantalla</string>
<string name="notify_lock_screen_setting_summary">Mostra notificacións na pantalla bloqueada</string>
<string name="notify_sound_setting">Son</string>
<string name="notify_sound_setting_default">Son por omisión</string>
<string name="notify_sound_setting_disabled">Ningún</string>
<string name="choose_ringtone_title">Escolla son</string>
<string name="cannot_load_ringtone">Non se cargou o son</string>
<!--Settings Feedback-->
<string name="feedback_settings_title">Comente</string>
<string name="send_feedback">Envíe comentario</string>
<!--Link Warning-->
<string name="link_warning_title">Aviso de ligazón</string>
<string name="link_warning_intro">Vai abrir a seguinte ligazón nunha aplicación externa.</string>
<string name="link_warning_text">Esto pode utilizarse para identificala. Pense si confía na persoa que lle enviou a ligazón e considere abrila con Orfox.</string>
<string name="link_warning_open_link">Abrir ligazón</string>
<!--Crash Reporter-->
<string name="crash_report_title">Informe de fallo de Briar</string>
<string name="briar_crashed">Lamentámolo, Briar fallou.</string>
<string name="not_your_fault">Non é culpa súa.</string>
<string name="please_send_report">Axúdenos por favor a mellorar Briar enviándonos un informe do fallo.</string>
<string name="report_is_encrypted">Prometemos que o informe está cifrado e enviado con seguridade.</string>
<string name="feedback_title">Comente</string>
<string name="describe_crash">Describa que aconteceu (optativo)</string>
<string name="enter_feedback">Escriba o seu comentario</string>
<string name="optional_contact_email">O seu enderezo e-mail (optativo)</string>
<string name="include_debug_report_crash">Incluír datos anónimos sobre o fallo</string>
<string name="include_debug_report_feedback">Incluír datos anónimos sobre este dispositivo</string>
<string name="could_not_load_report_data">Non se puideron cargar os datos do informe.</string>
<string name="send_report">Enviar informe</string>
<string name="close">Pechar</string>
<string name="dev_report_saved">Informe gardado. Enviarase a seguinte vez que se conecte con Briar.</string>
<!--Sign Out-->
<string name="progress_title_logout">Desconectando de Briar...</string>
<!--Screen Filters & Tapjacking-->
<string name="screen_filter_title">Detectouse unha sobreescrita da pantalla</string>
<string name="screen_filter_body">Outra aplicación estase mostrando enriba de Briar. Para protexer a súa seguridade, Briar non responderá a toques cando outra aplicación está debuxando enriba.\n\nAs seguintes aplicacións poderían estar debuxando enriba:\n\n%1$s</string>
<string name="screen_filter_allow">Permitir a estas aplicación mostrarse enriba</string>
<!--Permission Requests-->
<string name="permission_camera_title">Permiso da cámara</string>
<string name="permission_camera_request_body">Para escanear códigos QR, Briar precisa acceso a cámara.</string>
<string name="permission_camera_denied_body">Denegou o permiso de acceso a cámara, pero é necesario para engadir contactos.\n\nPor favor, considere conceder o permiso.</string>
<string name="permission_camera_denied_toast">Non concedeu o acceso a cámara</string>
<string name="qr_code">Código QR</string>
<string name="show_qr_code_fullscreen">Mostrar o código QR a pantalla completa</string>
</resources>

View File

@@ -31,7 +31,11 @@
<string name="dialog_title_lost_password">पासवर्ड खो गया</string>
<string name="dialog_message_lost_password">आपका ब्रियर खाता आपके डिवाइस पर एन्क्रिप्ट किया गया है, बादल में नहीं, इसलिए हम आपका पासवर्ड रीसेट नहीं कर सकते। क्या आप अपना खाता हटाना चाहते हैं और फिर से शुरू करना चाहते हैं? \ N \ n सावधानी: आपकी पहचान, संपर्क और संदेश स्थायी रूप से खो जाएंगे</string>
<string name="startup_failed_notification_title">बियर शुरू नहीं हो सका</string>
<string name="startup_failed_notification_text">अधिक जानकारी के लिए टैप करें।</string>
<string name="startup_failed_activity_title">ब्रियर स्टार्टअप विफलता</string>
<string name="startup_failed_db_error">किसी कारण से, आपका ब्रियर डेटाबेस मरम्मत से परे दूषित हो गया है। आपका खाता, आपका डेटा और आपके सभी संपर्क खो गए हैं। दुर्भाग्यवश, आपको पासवर्ड प्रॉम्प्ट पर \'मेरा पासवर्ड भूल गया है\' चुनकर ब्रियर को पुनर्स्थापित करने या एक नया खाता सेट अप करने की आवश्यकता है।</string>
<string name="startup_failed_data_too_old_error">आपका खाता इस ऐप के पुराने संस्करण के साथ बनाया गया था और इस संस्करण के साथ खोला नहीं जा सकता है। आपको या तो पुराने संस्करण को पुनर्स्थापित करना होगा या पासवर्ड प्रॉम्प्ट पर \'मैं अपना पासवर्ड भूल गया हूं\' चुनकर एक नया खाता सेट करना होगा।</string>
<string name="startup_failed_data_too_new_error">ऐप का यह संस्करण बहुत पुराना है। कृपया नवीनतम संस्करण में अपग्रेड करें और पुनः प्रयास करें।</string>
<string name="startup_failed_service_error">ब्रियर एक आवश्यक प्लगइन प्रारंभ करने में असमर्थ था बरिअर को पुनः स्थापित करना आमतौर पर इस समस्या को हल करता है हालांकि, कृपया ध्यान दें कि बियर आपके डेटा को स्टोर करने के लिए केंद्रीय सर्वर का उपयोग नहीं कर रहा है, इसके बाद आप अपने खाता और उसके साथ जुड़े सभी डेटा खो देंगे।</string>
<plurals name="expiry_warning">
<item quantity="one">यह Briar का एक परीक्षण संस्करण है आपका खाता %dदिनों में समाप्त हो जाएगा और नवीनीकरण नहीं किया जा सकता है</item>
@@ -39,6 +43,11 @@
</plurals>
<string name="expiry_update">परीक्षण समाप्ति तिथि बढ़ा दी गई है। आपका खाता अब %d दिनों में समाप्त हो जाएगा</string>
<string name="expiry_date_reached">यह सॉफ्टवेयर समाप्त हो गया है। \n परीक्षण के लिए धन्यवाद!</string>
<string name="download_briar">ब्रियर का उपयोग जारी रखने के लिए, कृपया संस्करण 1.0 डाउनलोड करें।</string>
<string name="create_new_account">आपको एक नया खाता बनाना होगा, लेकिन आप उसी उपनाम का उपयोग कर सकते हैं।</string>
<string name="download_briar_button">ब्रायर 1.0 डाउनलोड करें</string>
<string name="startup_open_database">डेटाबेस डिक्रिप्ट कर रहा है ...</string>
<string name="startup_migrate_database">डाटाबेस का उन्नयन ...</string>
<!--Navigation Drawer-->
<string name="nav_drawer_open_description">नेविगेशन ड्रॉवर खोलें</string>
<string name="nav_drawer_close_description">नेविगेशन ड्रॉवर को बंद करें</string>
@@ -93,8 +102,11 @@
<string name="show_onboarding">सहायता संवाद दिखाएं</string>
<string name="fix">ठीक कर</string>
<string name="help">सहायता</string>
<string name="sorry">माफ़ कीजिये</string>
<!--Contacts and Private Conversations-->
<string name="no_contacts">कोई संपर्क दिखाने के लिए \ n \ n टैप + आइकन टैप करने के लिए कोई संपर्क नहीं है</string>
<string name="date_no_private_messages">कोई संदेश नहीं।</string>
<string name="no_private_messages">दिखाने के लिए कोई संदेश नहीं</string>
<string name="message_hint">संदेश लिखें</string>
<string name="delete_contact">संपर्क मिटा दें</string>
<string name="dialog_title_delete_contact">संपर्क हटाने की पुष्टि करें</string>
@@ -112,6 +124,7 @@
<string name="contact_already_exists">संपर्क%s पहले से मौजूद है</string>
<string name="contact_exchange_failed">संपर्क विनिमय विफल</string>
<string name="qr_code_invalid">QR कोड अमान्य है</string>
<string name="qr_code_unsupported">क्यूआर कोड जिसे आप स्कैन करने का प्रयास कर रहे हैं वह पुराने संस्करण से संबंधित है %sजिसका अब समर्थित नहीं है। \ N \ n कृपया सुनिश्चित करें कि आप दोनों नवीनतम संस्करण चला रहे हैं और फिर पुन: प्रयास करें।</string>
<string name="camera_error">कैमरा त्रुटि</string>
<string name="connecting_to_device">उपकरण \ u2026 से कनेक्ट हो रहा है</string>
<string name="authenticating_with_device">डिवाइस के साथ प्रमाणीकरण \ u2026</string>
@@ -121,6 +134,7 @@
<string name="introduction_onboarding_title">अपने संपर्कों का परिचय दें</string>
<string name="introduction_onboarding_text">आप अपने संपर्कों को एक दूसरे से जोड़ सकते हैं, इसलिए उन्हें ब्रियर से जुड़ने के लिए व्यक्तिगत रूप से मिलने की जरूरत नहीं है।</string>
<string name="introduction_activity_title">संपर्क का चयन करें</string>
<string name="introduction_not_possible">इन संपर्कों के साथ आपके पास पहले से ही एक परिचय प्रगति है। कृपया इसे पहले खत्म करने की अनुमति दें। यदि आप या आपके संपर्क शायद ही कभी ऑनलाइन हैं, तो इसमें कुछ समय लग सकता है।</string>
<string name="introduction_message_title">संपर्कों का परिचय</string>
<string name="introduction_message_hint">एक संदेश जोड़ें (वैकल्पिक)</string>
<string name="introduction_button">परिचय करें</string>
@@ -132,6 +146,7 @@
<string name="introduction_request_exists_received">%1$sने आपको%2$s में लाने के लिए कहा है, लेकिन%2$s आपकी संपर्क सूची में पहले से मौजूद है। चूंकि%1$s शायद यह नहीं जान पाए, आप फिर भी जवाब दे सकते हैं:</string>
<string name="introduction_request_answered_received">%1$sने आपको%2$s में पेश करने को कहा है</string>
<string name="introduction_response_accepted_sent">आपने%1$s की शुरूआत स्वीकार कर ली है</string>
<string name="introduction_response_accepted_sent_info">आपके %1$sसंपर्कों में शामिल होने से पहले, उन्हें भी परिचय स्वीकार करने की आवश्यकता है। इसमें कुछ समय लग सकता है।</string>
<string name="introduction_response_declined_sent">आपने%1$s की शुरुआत करने से मना कर दिया</string>
<string name="introduction_response_accepted_received">%1$s%2$s की शुरूआत स्वीकार कर ली</string>
<string name="introduction_response_declined_received">%1$s%2$sकी शुरूआत में गिरावट आई</string>
@@ -141,6 +156,7 @@
<item quantity="other">%dनया संपर्क जोड़ा।</item>
</plurals>
<!--Private Groups-->
<string name="groups_list_empty">कोई समूह दिखाने के लिए \ n \ n समूह बनाने के लिए + आइकन टैप करें, या अपने संपर्कों को समूहों के साथ साझा करने के लिए कहें</string>
<string name="groups_created_by">के द्वारा बनाई गई%s</string>
<plurals name="messages">
<item quantity="one">संदेशों%d</item>
@@ -193,10 +209,12 @@
<string name="groups_reveal_visible_revealed_by_contact">संपर्क संबंध समूह को दिखाई देता है (%s द्वारा पता चला है)</string>
<string name="groups_reveal_invisible">संपर्क संबंध समूह को दिखाई नहीं दे रहा है</string>
<!--Forums-->
<string name="no_forums">कोई फोरम दिखाने के लिए \ n \ n फोरम बनाने के लिए + आइकन टैप करें, या अपने संपर्कों को आपके साथ मंच साझा करने के लिए कहें</string>
<string name="create_forum_title">फोरम बनाएँ</string>
<string name="choose_forum_hint">अपने मंच का नाम चुनें</string>
<string name="create_forum_button">फोरम बनाएँ</string>
<string name="forum_created_toast">फोरम बनाया</string>
<string name="no_forum_posts">दिखाने के लिए कोई पोस्ट नहीं</string>
<string name="no_posts">कोई पोस्ट नहीं</string>
<plurals name="posts">
<item quantity="one">%dपदों</item>
@@ -208,17 +226,23 @@
<string name="btn_reply">जवाब दें</string>
<string name="forum_leave">फोरम छोड़ें</string>
<string name="dialog_title_leave_forum">फोरम छोड़ने की पुष्टि करें</string>
<string name="dialog_message_leave_forum">क्या आप वाकई इस मंच को छोड़ना चाहते हैं? \ N \ n आपके द्वारा इस मंच को साझा करने वाले किसी भी संपर्क के साथ अपडेट प्राप्त करना बंद हो सकता है।</string>
<string name="dialog_button_leave">छोड़ना</string>
<string name="forum_left_toast">वाम मंच</string>
<!--Forum Sharing-->
<string name="forum_share_button">शेयर फ़ोरम</string>
<string name="contacts_selected">संपर्क चयनित</string>
<string name="activity_share_toolbar_header">संपर्क चुनें</string>
<string name="no_contacts_selector">कोई संपर्क दिखाने के लिए \ n \ n संपर्क जोड़ने के बाद यहां वापस आएं</string>
<string name="forum_shared_snackbar">चयनित संपर्कों के साथ फ़ोरम साझा किया गया</string>
<string name="forum_share_message">एक संदेश जोड़ें (वैकल्पिक)</string>
<string name="forum_share_error">इस फ़ोरम को साझा करने में कोई त्रुटि थी।</string>
<string name="forum_invitation_received">%1$sने आपके साथ \"%2$s\" मंच साझा किया है</string>
<string name="forum_invitation_sent">आपने%2$s के साथ \"%1$s\" मंच साझा किया है</string>
<string name="forum_invitations_title">फोरम निमंत्रण</string>
<string name="forum_invitation_exists">आपने पहले से ही इस मंच पर एक निमंत्रण स्वीकार कर लिया है। \ N \ n अधिक आमंत्रण स्वीकार करने से मंच से आपका कनेक्शन तेजी से और अधिक विश्वसनीय हो जाएगा।</string>
<string name="forum_joined_toast">फोरम में शामिल</string>
<string name="forum_declined_toast">आमंत्रण में कमी आई</string>
<string name="shared_by_format">%s द्वारा साझा किया गया</string>
<string name="forum_invitation_already_sharing">पहले से ही साझा करना</string>
<string name="forum_invitation_response_accepted_sent">आपने%s से मंच निमंत्रण स्वीकार कर लिया है</string>
@@ -234,14 +258,19 @@
</plurals>
<string name="nobody">कोई भी नहीं</string>
<!--Blogs-->
<string name="blogs_other_blog_empty_state">दिखाने के लिए कोई पोस्ट नहीं</string>
<string name="read_more">अधिक पढ़ें</string>
<string name="blogs_write_blog_post">ब्लॉग पोस्ट लिखें</string>
<string name="blogs_write_blog_post_body_hint">अपना ब्लॉग पोस्ट टाइप करें</string>
<string name="blogs_publish_blog_post">प्रकाशित करना</string>
<string name="blogs_blog_post_created">ब्लॉग पोस्ट बनाया</string>
<string name="blogs_blog_post_received">नया ब्लॉग पोस्ट प्राप्त हुआ</string>
<string name="blogs_blog_post_scroll_to">स्क्रॉल टू</string>
<string name="blogs_feed_empty_state">दिखाने के लिए कोई पोस्ट नहीं \ n \ n आपके संपर्कों और ब्लॉगों से पोस्ट की जाने वाली पोस्ट यहां दिखाई देगी \ n \ n एक पोस्ट लिखने के लिए पेन आइकन टैप करें</string>
<string name="blogs_remove_blog">ब्लॉग निकालें</string>
<string name="blogs_remove_blog_dialog_message">क्या आप वाकई इस ब्लॉग को हटाना चाहते हैं? \ N \ n पोस्ट आपके डिवाइस से हटा दिए जाएंगे, लेकिन अन्य लोगों के डिवाइस से नहीं। \ N \ n आपके द्वारा इस ब्लॉग को साझा करने वाले किसी भी संपर्क को अपडेट प्राप्त करना बंद हो सकता है।</string>
<string name="blogs_remove_blog_ok">हटाना</string>
<string name="blogs_blog_removed">ब्लॉग हटा दिया गया</string>
<string name="blogs_reblog_comment_hint">एक टिप्पणी जोड़ें (वैकल्पिक)</string>
<string name="blogs_reblog_button">पुनः ब्लॉग</string>
<!--Blog Sharing-->
@@ -256,6 +285,8 @@
<string name="blogs_sharing_invitation_received">%1$sने आपके साथ \"%2$s\" ब्लॉग को साझा किया है</string>
<string name="blogs_sharing_invitation_sent">आपने %1$s को%2$s के साथ साझा किया है</string>
<string name="blogs_sharing_invitations_title">ब्लॉग आमंत्रण</string>
<string name="blogs_sharing_joined_toast">ब्लॉग के लिए सदस्यता लें</string>
<string name="blogs_sharing_declined_toast">आमंत्रण में कमी आई</string>
<string name="sharing_status_blog">जो कोई भी ब्लॉग के लिए सदस्यता लेता है, उसे अपने संपर्कों के साथ साझा कर सकता है आप इस ब्लॉग को निम्नलिखित संपर्कों के साथ साझा कर रहे हैं। ऐसे अन्य सदस्य भी हो सकते हैं जिन्हें आप नहीं देख सकते हैं।</string>
<!--RSS Feeds-->
<string name="blogs_rss_feeds_import">आरएसएस फ़ीड आयात करें</string>
@@ -267,8 +298,10 @@
<string name="blogs_rss_feeds_manage_author">लेखक:</string>
<string name="blogs_rss_feeds_manage_updated">आखरी अपडेट:</string>
<string name="blogs_rss_remove_feed">फ़ीड निकालें</string>
<string name="blogs_rss_remove_feed_dialog_message">क्या आप वाकई इस फीड को हटाना चाहते हैं? \ N \ n पोस्ट आपके डिवाइस से हटा दिए जाएंगे, लेकिन अन्य लोगों के डिवाइस से नहीं। \ N \ n आपके द्वारा इस फ़ीड को साझा करने वाले किसी भी संपर्क को अपडेट प्राप्त करना बंद हो सकता है।</string>
<string name="blogs_rss_remove_feed_ok">हटाना</string>
<string name="blogs_rss_feeds_manage_delete_error">फीड हटाया नहीं जा सका!</string>
<string name="blogs_rss_feeds_manage_empty_state">कोई आरएसएस फ़ीड दिखाने के लिए फ़ीड नहीं करता \ n \ n फ़ीड आयात करने के लिए + आइकन टैप करें</string>
<string name="blogs_rss_feeds_manage_error">आपकी फ़ीड लोड करने में एक समस्या थी बाद में पुन: प्रयास करें।</string>
<!--Settings Network-->
<string name="network_settings_title">नेटवर्क</string>
@@ -305,12 +338,16 @@
<string name="notification_settings_title">सूचनाएं</string>
<string name="notify_private_messages_setting_title">निजी संदेश</string>
<string name="notify_private_messages_setting_summary">निजी संदेशों के लिए अलर्ट दिखाएं</string>
<string name="notify_private_messages_setting_summary_26">निजी संदेशों के लिए अलर्ट कॉन्फ़िगर करें</string>
<string name="notify_group_messages_setting_title">समूह संदेश</string>
<string name="notify_group_messages_setting_summary">समूह संदेशों के लिए अलर्ट्स दिखाएं</string>
<string name="notify_group_messages_setting_summary_26">समूह संदेशों के लिए अलर्ट कॉन्फ़िगर करें</string>
<string name="notify_forum_posts_setting_title">फ़ोरम पोस्ट</string>
<string name="notify_forum_posts_setting_summary">फ़ोरम पोस्ट के लिए अलर्ट्स दिखाएं</string>
<string name="notify_forum_posts_setting_summary_26">फोरम पोस्ट के लिए अलर्ट कॉन्फ़िगर करें</string>
<string name="notify_blog_posts_setting_title">वेबदैनिकी डाक</string>
<string name="notify_blog_posts_setting_summary">ब्लॉग पोस्ट के लिए अलर्ट्स दिखाएं</string>
<string name="notify_blog_posts_setting_summary_26">ब्लॉग पोस्ट के लिए अलर्ट कॉन्फ़िगर करें</string>
<string name="notify_vibration_setting">कांपना</string>
<string name="notify_lock_screen_setting_title">लॉक स्क्रीन</string>
<string name="notify_lock_screen_setting_summary">लॉक स्क्रीन पर सूचनाएं दिखाएं</string>
@@ -354,4 +391,6 @@
<string name="permission_camera_request_body">QR कोड को स्कैन करने के लिए, Briar को कैमरे तक पहुंच की आवश्यकता है।</string>
<string name="permission_camera_denied_body">आपने कैमरे तक पहुंच से वंचित किया है, लेकिन संपर्क जोड़ने के लिए कैमरे का उपयोग करने की आवश्यकता है। \ N \ n कृपया पहुंच प्रदान करने पर विचार करें।</string>
<string name="permission_camera_denied_toast">कैमरा अनुमति नहीं दी गई थी</string>
<string name="qr_code">क्यूआर कोड</string>
<string name="show_qr_code_fullscreen">क्यूआर कोड पूर्णस्क्रीन दिखाएं</string>
</resources>

View File

@@ -0,0 +1,351 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!--Setup-->
<string name="setup_title">Witaj w Briar</string>
<string name="setup_name_explanation">Twoja nazwa użytkownika będzie wyświetlana przy każdej zamieszczonej przez Ciebie treści. Nie można jej zmienić po tworzeniu konta.</string>
<string name="setup_next">Dalej</string>
<string name="setup_password_intro">Wybierz Hasło</string>
<string name="setup_password_explanation">Twoje konto Briar jest przechowywane i szyfrowane na Twoim urządzeniu nie w chmurze. Jeśli zapomnisz hasła lub odinstalujesz Briar, nie ma możliwości aby odzyskać Twoje konto.\n\nWybierz długie hasło, które jest trudne do odgadnięcia, czyli takie z losowymi literami numerami i symbolami.</string>
<string name="setup_doze_title">Połączenia w Tle</string>
<string name="setup_doze_intro">Aby otrzymywać wiadomości, Briar musi utrzymywać połączenie w tle.</string>
<string name="setup_doze_explanation">Aby otrzymywać wiadomości, Briar musi utrzymywać połączenie w tle. Wyłącz optymalizacje baterii aby Briar mógł zostać połączony.</string>
<string name="setup_doze_button">Pozwól na Połączenia</string>
<string name="choose_nickname">Wybierz nazwę użytkownika</string>
<string name="choose_password">Wybierz hasło</string>
<string name="confirm_password">Potwierdź hasło</string>
<string name="name_too_long">Nazwa użytkownika jest zbyt długa</string>
<string name="password_too_weak">Hasło jest zbyt długie</string>
<string name="passwords_do_not_match">Hasła się nie zgadzają</string>
<string name="create_account_button">Utwórz Konto</string>
<string name="more_info">Więcej Informacji</string>
<string name="don_t_ask_again">Nie pytaj ponownie</string>
<string name="setup_huawei_text">Proszę dotknąć przycisku poniżej i upewnić się, że Briar jest na liście chronionych aplikacji.</string>
<string name="setup_huawei_button">Chroń Briar</string>
<string name="setup_huawei_help">Jeśli Briar nie będzie na liście chronionych aplikacji nie będzie miał możliwości aby działać w tle.</string>
<string name="warning_dozed">%s nie był wstanie działać w tle</string>
<!--Login-->
<string name="enter_password">Wpisz swoje hasło:</string>
<string name="try_again">Złe hasło, spróbuj ponownie</string>
<string name="sign_in_button">Zaloguj Się</string>
<string name="forgotten_password">Przypomnij hasło</string>
<string name="dialog_title_lost_password">Nie pamiętam hasła</string>
<string name="startup_failed_notification_title">Briar nie mógł się uruchomić</string>
<string name="startup_failed_notification_text">Więcej informacji</string>
<string name="startup_failed_activity_title">Briar nie mógł się uruchomić</string>
<string name="expiry_date_reached">Ten program wygasł.\nDziękujemy za testy!</string>
<string name="download_briar">Aby dalej korzystać z Briar, proszę pobrać wersję 1.0.</string>
<string name="create_new_account">Będzie potrzeba stworzenia nowego konta, ale możesz użyć takiej samej nazwy użytkownika.</string>
<string name="download_briar_button">Pobierz Briar 1.0</string>
<string name="startup_open_database">Deszyfruję Bazę Danych...</string>
<string name="startup_migrate_database">Aktualizuję Bazę Danych...</string>
<!--Navigation Drawer-->
<string name="nav_drawer_open_description">Otwórz panel nawigacji</string>
<string name="nav_drawer_close_description">Zamknij panel nawigacji</string>
<string name="contact_list_button">Kontakty</string>
<string name="groups_button">Grupy Prywatne</string>
<string name="forums_button">Fora</string>
<string name="blogs_button">Blogi</string>
<string name="settings_button">Ustawienia</string>
<string name="sign_out_button">Wyloguj się</string>
<!--Transports-->
<string name="transport_tor">Internet</string>
<string name="transport_bt">Bluetooth</string>
<string name="transport_lan">Wi-Fi</string>
<!--Notifications-->
<string name="ongoing_notification_title">Zalogowany w Briar</string>
<string name="ongoing_notification_text">Dotknij aby otworzyć Briar</string>
<plurals name="private_message_notification_text">
<item quantity="one">Nowa prywatna wiadomość</item>
<item quantity="few">%d prywatnych wiadomości.</item>
<item quantity="many">%d prywatnych wiadomości. </item>
<item quantity="other">%d prywatnych wiadomości.</item>
</plurals>
<plurals name="group_message_notification_text">
<item quantity="one">Nowa wiadomość grupowa.</item>
<item quantity="few">%dwiadomości grupowych. </item>
<item quantity="many">%dwiadomości grupowych. </item>
<item quantity="other">%d wiadomości grupowych.</item>
</plurals>
<plurals name="forum_post_notification_text">
<item quantity="one">Nowy post z forum.</item>
<item quantity="few">%d nowych postów z forum. </item>
<item quantity="many">%d nowych postów z forum. </item>
<item quantity="other">%d nowych postów z forum.</item>
</plurals>
<plurals name="blog_post_notification_text">
<item quantity="one">Nowy post z bloga.</item>
<item quantity="few">%d nowych postów z bloga. </item>
<item quantity="many">%d nowych postów z bloga. </item>
<item quantity="other">%d nowych postów z bloga.</item>
</plurals>
<!--Misc-->
<string name="now">teraz</string>
<string name="show">Pokaż</string>
<string name="hide">Ukryj</string>
<string name="ok">OK</string>
<string name="cancel">Anuluj</string>
<string name="got_it">Rozumiem</string>
<string name="delete">Usuń</string>
<string name="accept">Akceptuj</string>
<string name="decline">Odrzuć</string>
<string name="options">Opcje</string>
<string name="online">Online</string>
<string name="offline">Offline</string>
<string name="send">Wyślij</string>
<string name="allow">Pozwól</string>
<string name="open">Otwórz</string>
<string name="no_data">Brak danych</string>
<string name="ellipsis">...</string>
<string name="text_too_long">Wprowadzony tekst jest zbyt długi</string>
<string name="show_onboarding">Pokaż okno pomocy</string>
<string name="fix">Napraw</string>
<string name="help">Pomoc</string>
<string name="sorry">Przepraszam</string>
<!--Contacts and Private Conversations-->
<string name="no_contacts">Brak kontaktów do wyświetlenia\n\nDotknij ikonkę + aby dodać kontakt</string>
<string name="date_no_private_messages">Brak wiadomości.</string>
<string name="no_private_messages">Brak wiadomości do pokazania</string>
<string name="message_hint">Typ wiadomości</string>
<string name="delete_contact">Usuń kontakt</string>
<string name="dialog_title_delete_contact">Potwierdź usunięcie kontaktu</string>
<string name="dialog_message_delete_contact">Czy na pewno chcesz usunąć ten kontakt i wszystkie wymienione z nim wiadomości?</string>
<string name="contact_deleted_toast">Kontakt usunięty</string>
<!--Adding Contacts-->
<string name="add_contact_title">Dodaj kontakt</string>
<string name="face_to_face">Musisz spotkać się z osobą którą chcesz dodać jako kontakt.\n\nTo uniemożliwi komukolwiek podszyć się pod Ciebie lub czytać wysyłane wiadomości.</string>
<string name="continue_button">Kontynuuj</string>
<string name="connection_failed">Połączenie nieudane</string>
<string name="try_again_button">Spróbuj ponownie</string>
<string name="waiting_for_contact_to_scan">Czekanie aż ktoś zeskanuje kod i połączy się\u2026</string>
<string name="exchanging_contact_details">Wymienianie szczegółów dotyczących kontatku\u2026</string>
<string name="contact_added_toast">Kontakt dodany: %s</string>
<string name="contact_already_exists">Kontakt %s już istnieje</string>
<string name="contact_exchange_failed">Wymiana kontaktów nie powiodła się</string>
<string name="qr_code_invalid">Kod QR jest nie prawidłowy</string>
<string name="camera_error">Błąd aparatu</string>
<string name="connecting_to_device">Łączenie z urządzeniem\u2026</string>
<string name="authenticating_with_device">Autoryzowanie z urządzeniem\u2026</string>
<!--Introductions-->
<string name="introduction_activity_title">Wybierz kontakt</string>
<string name="introduction_message_hint">Dodaj wiadomość (opcjonalne)</string>
<plurals name="introduction_notification_text">
<item quantity="one">Nowy kontakt został dodany.</item>
<item quantity="few">%d nowych kontaktów zostało dodanych.</item>
<item quantity="many">%d nowych kontaktów zostało dodanych.</item>
<item quantity="other">%d nowych kontaktów zostało dodanych.</item>
</plurals>
<!--Private Groups-->
<string name="groups_created_by">Stworzone przez %s</string>
<plurals name="messages">
<item quantity="one">%d wiadomość</item>
<item quantity="few">%d wiadomości</item>
<item quantity="many">%d wiadomości</item>
<item quantity="other">%d wiadomości</item>
</plurals>
<string name="groups_group_is_empty">Grupa jest pusta</string>
<string name="groups_group_is_dissolved">Ta grupa została rozwiązana</string>
<string name="groups_remove">Usuń</string>
<string name="groups_create_group_title">Stwórz Grupę Prywatną</string>
<string name="groups_create_group_button">Stwórz Grupę</string>
<string name="groups_create_group_invitation_button">Wyślij Zaproszenie</string>
<string name="groups_create_group_hint">Wybierz nazwę dla twojej prywatnej grupy</string>
<string name="groups_invitation_sent">Zaproszenie do grupy zostało wysłane</string>
<string name="groups_message_sent">Wiadomość wysłana</string>
<string name="groups_member_list">Lista Użytkowników</string>
<string name="groups_invite_members">Zaproś Użytkowników</string>
<string name="groups_member_created_you">Stworzyłeś grupę</string>
<string name="groups_member_created">%s stworzył grupę</string>
<string name="groups_member_joined_you">Dołączyłeś do grupy</string>
<string name="groups_member_joined">%s dołączył/a do grupy</string>
<string name="groups_leave">Opuść Grupę</string>
<string name="groups_leave_dialog_title">Potwierdź Opuszczenie Grupy</string>
<string name="groups_leave_dialog_message">Jesteś pewny, że chcesz opuścić tą grupę?</string>
<string name="groups_dissolve">Rozwiąż Grupę</string>
<string name="groups_dissolve_dialog_title">Potwierdź Rozwiązanie Grupy</string>
<string name="groups_dissolve_button">Rozwiąż</string>
<string name="groups_dissolved_dialog_title">Grupa Została Rozwiązana</string>
<!--Private Group Invitations-->
<string name="groups_invitations_title">Zaproszenia do Grup</string>
<string name="groups_invitations_invitation_sent">Zaprosiłeś %1$s aby dołączył do grupy \"%2$s\".</string>
<string name="groups_invitations_invitation_received">%1$s zaprosił cię abyś dołączył do grupy \"%2$s\".</string>
<string name="groups_invitations_joined">Dołączyłeś do grupy</string>
<string name="groups_invitations_declined">Zaproszenie do grupy odrzucone</string>
<plurals name="groups_invitations_open">
<item quantity="one">%d otwórz zaproszenie do grupy</item>
<item quantity="few">%dotwórz zaproszenia do grup </item>
<item quantity="many">%dotwórz zaproszenia do grup </item>
<item quantity="other">%d otwórz zaproszenia do grup</item>
</plurals>
<string name="groups_invitations_response_accepted_sent">Przyjąłeś zaproszenie do grupy od %s.</string>
<string name="groups_invitations_response_declined_sent">Odrzuciłeś zaproszenie do grupy od %s.</string>
<string name="groups_invitations_response_accepted_received">%s przyjął zaproszenie do grupy.</string>
<string name="groups_invitations_response_declined_received">%s odrzucił zaproszenie do grupy.</string>
<string name="sharing_status_groups">Tylko osoba która utworzyła grupę może zapraszać nowych użytkowników do grupy. Poniżej są osoby, które dołączyły do grupy.</string>
<!--Private Groups Revealing Contacts-->
<!--Forums-->
<string name="create_forum_title">Stwórz Forum</string>
<string name="choose_forum_hint">Wybierz nazwę dla swojego forum</string>
<string name="create_forum_button">Stwórz Forum</string>
<string name="forum_created_toast">Forum stworzone</string>
<string name="no_forum_posts">Brak postów do pokazania</string>
<string name="no_posts">Brak postów</string>
<plurals name="posts">
<item quantity="one">%d post</item>
<item quantity="few">%d postów</item>
<item quantity="many">%d postów</item>
<item quantity="other">%d postów</item>
</plurals>
<string name="forum_new_message_hint">Nowy Wpis</string>
<string name="forum_message_reply_hint">Nowa Odpowiedź</string>
<string name="btn_reply">Odpowiedz</string>
<string name="forum_leave">Opuść Forum</string>
<string name="dialog_title_leave_forum">Potwierdź Opuszczenie Forum</string>
<string name="dialog_button_leave">Opuść</string>
<string name="forum_left_toast">Opuścił/a Forum</string>
<!--Forum Sharing-->
<string name="forum_share_button">Udostępnij Forum</string>
<string name="contacts_selected">Zaznaczone kontakty</string>
<string name="activity_share_toolbar_header">Wybierz Kontakty</string>
<string name="forum_share_message">Dodaj wiadomość (opcjonalne)</string>
<string name="forum_invitations_title">Zaproszenia do for</string>
<string name="forum_joined_toast">Dołączył do forum</string>
<string name="forum_declined_toast">Zaproszenie odrzucone</string>
<string name="shared_by_format">Udostępnione przez %s</string>
<string name="forum_invitation_already_sharing">Już udostępnione</string>
<string name="forum_invitation_response_accepted_sent">Przyjąłeś zaproszenie do forum od %s</string>
<string name="forum_invitation_response_declined_sent">Odrzuciłeś zaproszenie do forum od %s</string>
<string name="forum_invitation_response_accepted_received">%s przyjął zaproszenie do forum.</string>
<string name="forum_invitation_response_declined_received">%s odrzucił zaproszenie do forum.</string>
<string name="sharing_status">Status Udostępniania</string>
<plurals name="forums_shared">
<item quantity="one">%d forum udostępnione przez kontakty </item>
<item quantity="few">%d for udostępnionych przez kontakty </item>
<item quantity="many">%d for udostępnionych przez kontakty </item>
<item quantity="other">%d for udostępnionych przez kontakty</item>
</plurals>
<string name="nobody">Nikt</string>
<!--Blogs-->
<string name="blogs_other_blog_empty_state">Brak postów do pokazania</string>
<string name="read_more">czytaj więcej</string>
<string name="blogs_write_blog_post">Napisz Post Bloga</string>
<string name="blogs_write_blog_post_body_hint">Napisz swój wpis na bloga</string>
<string name="blogs_publish_blog_post">Opublikuj</string>
<string name="blogs_blog_post_created">Wpis na Bloga Utworzony</string>
<string name="blogs_blog_post_received">Otrzymano Nowy Wpis z Bloga</string>
<string name="blogs_blog_post_scroll_to">Przewiń Do</string>
<string name="blogs_remove_blog">Usuń Blog</string>
<string name="blogs_remove_blog_ok">Usuń</string>
<string name="blogs_blog_removed">Blog usunięty</string>
<string name="blogs_reblog_comment_hint">Dodaj komentarz (opcjonalne)</string>
<string name="blogs_reblog_button">Podaj dalej</string>
<!--Blog Sharing-->
<string name="blogs_sharing_share">Udostępnij Blog</string>
<string name="blogs_sharing_error">Wystąpił błąd podczas udostępniania tego bloga.</string>
<string name="blogs_sharing_button">Udostępnij Blog</string>
<string name="blogs_sharing_snackbar">Blog udostępniony wybranym kontaktom</string>
<string name="blogs_sharing_response_accepted_sent">Zaakceptowano zaproszenie do bloga od %s</string>
<string name="blogs_sharing_response_declined_sent">Odrzucono zaproszenie do bloga od %s</string>
<string name="blogs_sharing_response_accepted_received">Użytkownik %s zaakceptował zaproszenie do bloga.</string>
<string name="blogs_sharing_response_declined_received">Użytkownik %s odrzucił zaproszenie do bloga.</string>
<string name="blogs_sharing_invitation_received">%1$s udostępnił/a Ci blog \"%2$s\"</string>
<string name="blogs_sharing_invitation_sent">Udostępniasz blog \"%1$s\" użytkownikowi %2$s.</string>
<string name="blogs_sharing_invitations_title">Zaproszenia do Blogów</string>
<string name="blogs_sharing_joined_toast">Zasubskrybowano blog</string>
<string name="blogs_sharing_declined_toast">Zaproszenie odrzucone</string>
<!--RSS Feeds-->
<string name="blogs_rss_feeds_import">Zaimportuj RSS</string>
<string name="blogs_rss_feeds_import_button">Zaimportuj</string>
<string name="blogs_rss_feeds_import_hint">Wprowadź adres URL do RSS</string>
<string name="blogs_rss_feeds_import_error">Wystąpił błąd podczas importowania.</string>
<string name="blogs_rss_feeds_manage">Zarządzaj RSS</string>
<string name="blogs_rss_feeds_manage_imported">Zaimportowane:</string>
<string name="blogs_rss_feeds_manage_author">Autor:</string>
<string name="blogs_rss_feeds_manage_updated">Ostatnio Zaktualizowane:</string>
<string name="blogs_rss_remove_feed">Usuń RSS</string>
<string name="blogs_rss_remove_feed_ok">Usuń</string>
<string name="blogs_rss_feeds_manage_delete_error">Kanał nie mógł zostać usunięty!</string>
<!--Settings Network-->
<string name="network_settings_title">Sieci</string>
<string name="bluetooth_setting">Połącz przez Bluetooth</string>
<string name="bluetooth_setting_enabled">Zawsze wtedy gdy kontakty są w pobliżu</string>
<string name="bluetooth_setting_disabled">Tylko gdy dodaję kontakty</string>
<string name="tor_network_setting">Połącz przez Tor</string>
<string name="tor_network_setting_never">Nigdy</string>
<string name="tor_network_setting_wifi">Tylko gdy używam Wi-Fi</string>
<string name="tor_network_setting_always">Gdy używam Wi-Fi lub sieci komórkowej</string>
<!--Settings Security and Panic-->
<string name="security_settings_title">Bezpieczeństwo</string>
<string name="change_password">Zmień hasło</string>
<string name="current_password">Wprowadź swoje aktualne hasło:</string>
<string name="choose_new_password">Wpisz swoje nowe hasło:</string>
<string name="confirm_new_password">Potwierdź swoje nowe hasło:</string>
<string name="password_changed">Hasło zostało zmienione.</string>
<string name="panic_setting">Konfiguracja przycisku wyjścia awaryjnego</string>
<string name="panic_setting_title">Przycisk wyjścia awaryjnego</string>
<string name="panic_setting_hint">Skonfiguruj jak Briar ma zareagować gdy wciśniesz przycisk wyjścia awaryjnego</string>
<string name="panic_app_setting_title">Aplikacja Przycisku Wyjścia Awaryjnego</string>
<string name="unknown_app">nie znana aplikacja</string>
<string name="panic_app_setting_summary">Żadna aplikacja nie została ustawiona</string>
<string name="panic_app_setting_none">Brak</string>
<string name="dialog_title_connect_panic_app">Potwierdź Awaryjną Aplikację</string>
<string name="dialog_message_connect_panic_app">Czy na pewno chcesz pozwolić %1$s aby działała jako przycisk wyjścia awaryjnego?</string>
<string name="lock_setting_title">Wyloguj się</string>
<string name="lock_setting_summary">Wyloguj się z Briar jeśli przycisk zostanie wciśnięty</string>
<string name="purge_setting_title">Skasuj Konto</string>
<string name="purge_setting_summary">Skasuj Twoje konto Briar jeśli przycisk wyjścia awaryjnego zostanie wciśnięty. Ostrzeżenie: Ta akcja usunie permanentnie Twoje konto, kontakty i wiadomości</string>
<string name="uninstall_setting_title">Odinstaluj Briar</string>
<string name="uninstall_setting_summary">To wymaga manualnego potwierdzenia w przypadku aktywowania</string>
<!--Settings Notifications-->
<string name="notification_settings_title">Powiadomienia</string>
<string name="notify_private_messages_setting_title">Prywatne wiadomości</string>
<string name="notify_private_messages_setting_summary">Pokaż powiadomienia dla prywatnych wiadomości</string>
<string name="notify_private_messages_setting_summary_26">Skonfiguruj powiadomienia dla prywatnych wiadomości</string>
<string name="notify_group_messages_setting_title">Wiadomości grupowe</string>
<string name="notify_group_messages_setting_summary">Pokaż powiadomienia dla aplikacji grupowych</string>
<string name="notify_group_messages_setting_summary_26">Skonfiguruj powiadomienia dla wiadomości grupowych</string>
<string name="notify_forum_posts_setting_title">Posty na forum</string>
<string name="notify_forum_posts_setting_summary">Pokazuj powiadomienia dla postów w forach</string>
<string name="notify_forum_posts_setting_summary_26">Skonfiguruj powiadomienia dla postów w forach</string>
<string name="notify_blog_posts_setting_title">Wpisy na blogach</string>
<string name="notify_blog_posts_setting_summary">Pokazuj powiadomienia dla wpisów na blogach</string>
<string name="notify_blog_posts_setting_summary_26">Skonfiguruj alerty dla wpisów na blogach</string>
<string name="notify_vibration_setting">Wibruj</string>
<string name="notify_lock_screen_setting_title">Ekran blokady</string>
<string name="notify_lock_screen_setting_summary">Pokaż powiadomienia na zablokowanym ekranie</string>
<string name="notify_sound_setting">Dźwięk</string>
<string name="notify_sound_setting_default">Domyślny dzwonek</string>
<string name="notify_sound_setting_disabled">Brak</string>
<string name="choose_ringtone_title">Wybierz dzwonek</string>
<string name="cannot_load_ringtone">Nie mogę załadować dzwonka</string>
<!--Settings Feedback-->
<string name="feedback_settings_title">Wsparcie</string>
<!--Link Warning-->
<string name="link_warning_open_link">Otwórz Link</string>
<!--Crash Reporter-->
<string name="crash_report_title">Zgłoś błąd w Briar</string>
<string name="briar_crashed">Przepraszamy, wystąpił błąd w Briar</string>
<string name="not_your_fault">To nie Twoja wina.</string>
<string name="please_send_report">Proszę pomóż nam ulepszać Briar wysyłając raport z usterki.</string>
<string name="report_is_encrypted">Raport z usterki jest zaszyfrowany i wysyłany bezpiecznie.</string>
<string name="feedback_title">Wsparcie</string>
<string name="describe_crash">Opisz co się stało (opcjonalne)</string>
<string name="enter_feedback">Wprowadź swoje uwagi</string>
<string name="optional_contact_email">Twój adres email (opcjonalne)</string>
<string name="include_debug_report_crash">Załącz anonimowe dane na temat usterki</string>
<string name="include_debug_report_feedback">Załącz anonimowe dane o tym urządzeniu</string>
<string name="could_not_load_report_data">Nie można było załadować danych.</string>
<string name="send_report">Wyślij raport</string>
<string name="close">Zamknij</string>
<string name="dev_report_saved">Raport zapisany. Zostanie wysłany następnym razem kiedy zalogujesz się do Briar.</string>
<!--Sign Out-->
<string name="progress_title_logout">Wylogowywanie z Briar...</string>
<!--Screen Filters & Tapjacking-->
<string name="screen_filter_title">Wykryto nakładkę na ekran</string>
<string name="screen_filter_allow">Pozwól tym aplikacjom na pozostanie na pierwszym planie</string>
<!--Permission Requests-->
<string name="permission_camera_title">Dostęp do aparatu</string>
<string name="permission_camera_request_body">Aby zeskanować kod QR, Briar potrzebuje mieć dostęp do aparatu.</string>
<string name="permission_camera_denied_toast">Dostęp do aparatu nie został przyznany</string>
<string name="qr_code">Kod QR</string>
<string name="show_qr_code_fullscreen">Pokaż QR na pełnym ekranie</string>
</resources>

View File

@@ -238,8 +238,8 @@
<item quantity="many">%d постов</item>
<item quantity="other">%d постов</item>
</plurals>
<string name="forum_new_entry_posted">Опубликована запись форума</string>
<string name="forum_new_message_hint">Новая запись</string>
<string name="forum_new_entry_posted">Пост в форуме опубликован</string>
<string name="forum_new_message_hint">Новый пост</string>
<string name="forum_message_reply_hint">Новый ответ</string>
<string name="btn_reply">Ответ</string>
<string name="forum_leave">Покинуть форум</string>
@@ -268,7 +268,7 @@
<string name="forum_invitation_response_accepted_received">%sпринял приглашение на форум.</string>
<string name="forum_invitation_response_declined_received">%s отклонил приглашение на форум.</string>
<string name="sharing_status">Статус общего доступа</string>
<string name="sharing_status_forum">Любой участник форума может поделиться своими контактами. Вы делитесь этим форумом со следующими контактами. Могут быть и другие участники, которых вы не видите.</string>
<string name="sharing_status_forum">Любой участник форума может поделиться им со своими контактами. Вы делитесь этим форумом со следующими контактами. Могут быть и другие участники, которых вы не видите.</string>
<string name="shared_with">Совместно с %1$d (%2$d в сети)</string>
<plurals name="forums_shared">
<item quantity="one">%d форум, общий с контактами</item>

View File

@@ -21,7 +21,6 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'net.ltgt.gradle:gradle-apt-plugin:0.9'
classpath 'de.undercouch:gradle-download-task:3.2.0'
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.4.3'
classpath files('libs/gradle-witness.jar')
}