mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
Compare commits
12 Commits
alpha-1.2.
...
fix_nonloc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e24728055c | ||
|
|
b2dc99bf26 | ||
|
|
50d144c917 | ||
|
|
da7f57e0af | ||
|
|
2374f8b4c9 | ||
|
|
5b77f28ce0 | ||
|
|
c247e3aa4e | ||
|
|
8e0b71c76f | ||
|
|
88f57893e8 | ||
|
|
b111abb484 | ||
|
|
4415598d3d | ||
|
|
40e14d3e94 |
@@ -11,8 +11,8 @@ android {
|
||||
defaultConfig {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 29
|
||||
versionCode 10215
|
||||
versionName "1.2.15"
|
||||
versionCode 10214
|
||||
versionName "1.2.14"
|
||||
consumerProguardFiles 'proguard-rules.txt'
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
@@ -38,8 +38,8 @@ configurations {
|
||||
|
||||
dependencies {
|
||||
implementation project(path: ':bramble-core', configuration: 'default')
|
||||
tor 'org.briarproject:tor-android:0.3.5.13@zip'
|
||||
tor 'org.briarproject:obfs4proxy-android:0.0.12-dev-40245c4a@zip'
|
||||
tor 'org.briarproject:tor-android:0.3.5.12@zip'
|
||||
tor 'org.briarproject:obfs4proxy-android:0.0.11-2@zip'
|
||||
|
||||
annotationProcessor 'com.google.dagger:dagger-compiler:2.24'
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ dependencyVerification {
|
||||
'org.beanshell:bsh:1.3.0:bsh-1.3.0.jar:9b04edc75d19db54f1b4e8b5355e9364384c6cf71eb0a1b9724c159d779879f8',
|
||||
'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:obfs4proxy-android:0.0.12-dev-40245c4a:obfs4proxy-android-0.0.12-dev-40245c4a.zip:8ab05a8f8391be2cb5ab2b665c281a06d9e3a756bd0f95a40a36ca927866ea82',
|
||||
'org.briarproject:tor-android:0.3.5.13:tor-android-0.3.5.13.zip:e0978db136731dae07774b722970cdae1e462fb5adc82845dd80a7e2d87f356c',
|
||||
'org.briarproject:obfs4proxy-android:0.0.11-2:obfs4proxy-android-0.0.11-2.zip:57e55cbe87aa2aac210fdbb6cd8cdeafe15f825406a08ebf77a8b787aa2c6a8a',
|
||||
'org.briarproject:tor-android:0.3.5.12:tor-android-0.3.5.12.zip:db71fb3290acff79d572af0752570eaf6aad7c4d88c9b9aa0b4d5afe2b9ead9c',
|
||||
'org.checkerframework:checker-compat-qual:2.5.3:checker-compat-qual-2.5.3.jar:d76b9afea61c7c082908023f0cbc1427fab9abd2df915c8b8a3e7a509bccbc6d',
|
||||
'org.checkerframework:checker-qual:2.5.2:checker-qual-2.5.2.jar:64b02691c8b9d4e7700f8ee2e742dce7ea2c6e81e662b7522c9ee3bf568c040a',
|
||||
'org.checkerframework:checker-qual:2.8.1:checker-qual-2.8.1.jar:9103499008bcecd4e948da29b17864abb64304e15706444ae209d17ebe0575df',
|
||||
|
||||
@@ -16,8 +16,8 @@ dependencies {
|
||||
implementation fileTree(dir: 'libs', include: '*.jar')
|
||||
implementation 'net.java.dev.jna:jna:4.5.2'
|
||||
implementation 'net.java.dev.jna:jna-platform:4.5.2'
|
||||
tor 'org.briarproject:tor:0.3.5.13@zip'
|
||||
tor 'org.briarproject:obfs4proxy:0.0.12-dev-40245c4a@zip'
|
||||
tor 'org.briarproject:tor:0.3.5.12@zip'
|
||||
tor 'org.briarproject:obfs4proxy:0.0.7@zip'
|
||||
|
||||
annotationProcessor 'com.google.dagger:dagger-compiler:2.24'
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ dependencyVerification {
|
||||
'org.apache.ant:ant-launcher:1.9.4:ant-launcher-1.9.4.jar:7bccea20b41801ca17bcbc909a78c835d0f443f12d639c77bd6ae3d05861608d',
|
||||
'org.apache.ant:ant:1.9.4:ant-1.9.4.jar:649ae0730251de07b8913f49286d46bba7b92d47c5f332610aa426c4f02161d8',
|
||||
'org.beanshell:bsh:1.3.0:bsh-1.3.0.jar:9b04edc75d19db54f1b4e8b5355e9364384c6cf71eb0a1b9724c159d779879f8',
|
||||
'org.briarproject:obfs4proxy:0.0.12-dev-40245c4a:obfs4proxy-0.0.12-dev-40245c4a.zip:172029e7058b3a83ac93ac4991a44bf76e16ce8d46f558f5836d57da3cb3a766',
|
||||
'org.briarproject:tor:0.3.5.13:tor-0.3.5.13.zip:1c5f0b821ee2aadb0ea04aa96caab3ca0a08370cce8de81c2dfe04d172f8a2a0',
|
||||
'org.briarproject:obfs4proxy:0.0.7:obfs4proxy-0.0.7.zip:5b2f693262ce43a7e130f7cc7d5d1617925330640a2eb6d71085e95df8ee0642',
|
||||
'org.briarproject:tor:0.3.5.12:tor-0.3.5.12.zip:2f542c4befd216f2226bf7c76e3b8b2d99af6f146a8cb28bf727f42014587006',
|
||||
'org.checkerframework:checker-compat-qual:2.5.3:checker-compat-qual-2.5.3.jar:d76b9afea61c7c082908023f0cbc1427fab9abd2df915c8b8a3e7a509bccbc6d',
|
||||
'org.checkerframework:checker-qual:2.5.2:checker-qual-2.5.2.jar:64b02691c8b9d4e7700f8ee2e742dce7ea2c6e81e662b7522c9ee3bf568c040a',
|
||||
'org.codehaus.mojo:animal-sniffer-annotations:1.17:animal-sniffer-annotations-1.17.jar:92654f493ecfec52082e76354f0ebf87648dc3d5cec2e3c3cdb947c016747a53',
|
||||
|
||||
@@ -22,8 +22,8 @@ android {
|
||||
defaultConfig {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 29
|
||||
versionCode 10215
|
||||
versionName "1.2.15"
|
||||
versionCode 10214
|
||||
versionName "1.2.14"
|
||||
applicationId "org.briarproject.briar.android"
|
||||
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
@@ -25,7 +25,7 @@ class BriarAccountManager extends AndroidAccountManager {
|
||||
public void deleteAccount() {
|
||||
synchronized (stateChangeLock) {
|
||||
super.deleteAccount();
|
||||
Localizer.reinitialize();
|
||||
Localizer.reinitialize(appContext);
|
||||
UiUtils.setTheme(appContext,
|
||||
appContext.getString(R.string.pref_theme_light_value));
|
||||
}
|
||||
|
||||
@@ -579,6 +579,7 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
|
||||
@UiThread
|
||||
private void updateContactAddedNotification() {
|
||||
if (contactAddedTotal == 0) return;
|
||||
BriarNotificationBuilder b =
|
||||
new BriarNotificationBuilder(appContext, CONTACT_CHANNEL_ID);
|
||||
b.setSmallIcon(R.drawable.notification_contact_added);
|
||||
@@ -713,4 +714,16 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
|
||||
public void unblockAllBlogPostNotifications() {
|
||||
androidExecutor.runOnUiThread((Runnable) () -> blockBlogs = false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restartNotifications(boolean locked, boolean mayAlertAgain) {
|
||||
androidExecutor.runOnUiThread(() -> {
|
||||
updateForegroundNotification(locked);
|
||||
updateContactNotification(mayAlertAgain);
|
||||
updateBlogPostNotification(mayAlertAgain);
|
||||
updateForumPostNotification(mayAlertAgain);
|
||||
updateGroupMessageNotification(mayAlertAgain);
|
||||
updateContactAddedNotification();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ public class BriarApplicationImpl extends Application
|
||||
Localizer.initialize(prefs);
|
||||
super.attachBaseContext(
|
||||
Localizer.getInstance().setLocale(base));
|
||||
Localizer.getInstance().setLocale(this);
|
||||
setTheme(base, prefs);
|
||||
}
|
||||
|
||||
@@ -82,6 +81,7 @@ public class BriarApplicationImpl extends Application
|
||||
rootLogger.setLevel(IS_DEBUG_BUILD ? FINE : INFO);
|
||||
|
||||
LOG.info("Created");
|
||||
Localizer.getInstance().setLocaleLegacy(this);
|
||||
|
||||
EmojiManager.install(new GoogleEmojiProvider());
|
||||
}
|
||||
@@ -105,7 +105,9 @@ public class BriarApplicationImpl extends Application
|
||||
@Override
|
||||
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
Localizer.getInstance().setLocale(this);
|
||||
Localizer.getInstance().applicationConfigurationChanged(this, newConfig,
|
||||
applicationComponent.androidNotificationManager(),
|
||||
applicationComponent.lockManager().isLocked());
|
||||
}
|
||||
|
||||
private void setTheme(Context ctx, SharedPreferences prefs) {
|
||||
|
||||
@@ -170,7 +170,6 @@ public class BriarService extends Service {
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(Localizer.getInstance().setLocale(base));
|
||||
Localizer.getInstance().setLocale(this);
|
||||
}
|
||||
|
||||
private void showStartupFailureNotification(StartResult result) {
|
||||
|
||||
@@ -6,12 +6,16 @@ import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.briar.api.android.AndroidNotificationManager;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import androidx.core.text.TextUtilsCompat;
|
||||
|
||||
import static android.os.Build.VERSION.SDK_INT;
|
||||
import static androidx.core.view.ViewCompat.LAYOUT_DIRECTION_LTR;
|
||||
import static org.briarproject.briar.android.settings.SettingsFragment.LANGUAGE;
|
||||
|
||||
@NotNullByDefault
|
||||
@@ -21,6 +25,7 @@ public class Localizer {
|
||||
@Nullable
|
||||
private static Localizer INSTANCE;
|
||||
private final Locale systemLocale;
|
||||
@Nullable
|
||||
private final Locale locale;
|
||||
|
||||
private Localizer(SharedPreferences sharedPreferences) {
|
||||
@@ -30,10 +35,17 @@ public class Localizer {
|
||||
|
||||
private Localizer(Locale systemLocale, @Nullable Locale userLocale) {
|
||||
this.systemLocale = systemLocale;
|
||||
if (userLocale == null) locale = systemLocale;
|
||||
else locale = userLocale;
|
||||
locale = userLocale;
|
||||
setLocaleAndSystemConfiguration(locale);
|
||||
}
|
||||
|
||||
private Localizer(Locale systemLocale) {
|
||||
this.systemLocale = systemLocale;
|
||||
locale = null;
|
||||
setLocaleAndSystemConfiguration(systemLocale);
|
||||
}
|
||||
|
||||
|
||||
// Instantiate the Localizer.
|
||||
public static synchronized void initialize(SharedPreferences prefs) {
|
||||
if (INSTANCE == null)
|
||||
@@ -41,9 +53,11 @@ public class Localizer {
|
||||
}
|
||||
|
||||
// Reinstantiate the Localizer with the system locale
|
||||
public static synchronized void reinitialize() {
|
||||
if (INSTANCE != null)
|
||||
INSTANCE = new Localizer(INSTANCE.systemLocale, null);
|
||||
public static synchronized void reinitialize(Context appContext) {
|
||||
if (INSTANCE != null && INSTANCE.locale != null) {
|
||||
INSTANCE = new Localizer(INSTANCE.systemLocale);
|
||||
INSTANCE.forceLocale(appContext, INSTANCE.systemLocale);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the current instance.
|
||||
@@ -64,43 +78,98 @@ public class Localizer {
|
||||
if (tag.contains("-")) {
|
||||
String[] langArray = tag.split("-");
|
||||
return new Locale(langArray[0], langArray[1]);
|
||||
} else
|
||||
} else {
|
||||
return new Locale(tag);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Apply localization to the specified context.
|
||||
*
|
||||
* It updates the configuration of the context's resources object but can
|
||||
* also return a new context derived from the context parameter. Hence
|
||||
* make sure to work with the return value of this method instead of
|
||||
* the context you passed as a parameter.
|
||||
*
|
||||
* This method also has side-effects as it calls Locale#setDefault().
|
||||
*
|
||||
* When using this in attachBaseContext() of Application, Service or
|
||||
* Activity subclasses, it is important to not only apply this method to the
|
||||
* base Context parameter received in that method, but also apply it on the
|
||||
* class itself which also extends Context.
|
||||
*/
|
||||
// Returns the localized version of context
|
||||
public Context setLocale(Context context) {
|
||||
if (locale == null || SDK_INT < 17) return context;
|
||||
Resources res = context.getResources();
|
||||
Configuration conf = res.getConfiguration();
|
||||
Locale currentLocale;
|
||||
if (SDK_INT >= 24) {
|
||||
currentLocale = conf.getLocales().get(0);
|
||||
} else
|
||||
currentLocale = conf.locale;
|
||||
if (locale.equals(currentLocale))
|
||||
return context;
|
||||
Locale.setDefault(locale);
|
||||
updateConfiguration(conf, locale);
|
||||
return context.createConfigurationContext(conf);
|
||||
}
|
||||
|
||||
// For API < 17 only.
|
||||
public void setLocaleLegacy(Context appContext) {
|
||||
if (SDK_INT >= 17 || locale == null) return;
|
||||
forceLocale(appContext, locale);
|
||||
}
|
||||
|
||||
// Forces the update of the resources through the deprecated API.
|
||||
private void forceLocale(Context context, Locale locale) {
|
||||
Resources res = context.getResources();
|
||||
Configuration conf = res.getConfiguration();
|
||||
updateConfiguration(conf, locale);
|
||||
res.updateConfiguration(conf, res.getDisplayMetrics());
|
||||
}
|
||||
|
||||
private void updateConfiguration(Configuration conf, Locale locale) {
|
||||
if (SDK_INT >= 17) {
|
||||
conf.setLocale(locale);
|
||||
context = context.createConfigurationContext(conf);
|
||||
} else
|
||||
} else {
|
||||
conf.locale = locale;
|
||||
//noinspection deprecation
|
||||
res.updateConfiguration(conf, res.getDisplayMetrics());
|
||||
return context;
|
||||
}
|
||||
}
|
||||
|
||||
private void setLocaleAndSystemConfiguration(@Nullable Locale locale) {
|
||||
if (locale == null) return;
|
||||
Locale.setDefault(locale);
|
||||
if (SDK_INT >= 23) return;
|
||||
Resources systemResources = Resources.getSystem();
|
||||
Configuration systemConfiguration = systemResources.getConfiguration();
|
||||
updateConfiguration(systemConfiguration, locale);
|
||||
// DateUtils uses the system resources, so we need to update them too.
|
||||
//noinspection deprecation
|
||||
systemResources.updateConfiguration(systemConfiguration,
|
||||
systemResources.getDisplayMetrics());
|
||||
}
|
||||
|
||||
private Locale getLocaleFromConfig(Configuration config) {
|
||||
if (SDK_INT >= 24) {
|
||||
return config.getLocales().get(0);
|
||||
} else {
|
||||
//noinspection deprecation
|
||||
return config.locale;
|
||||
}
|
||||
}
|
||||
|
||||
public void applicationConfigurationChanged(Context appContext,
|
||||
Configuration newConfig,
|
||||
AndroidNotificationManager androidNotificationManager,
|
||||
boolean locked) {
|
||||
Locale newLocale = getLocaleFromConfig(newConfig);
|
||||
if (locale == null && newLocale != systemLocale) {
|
||||
androidNotificationManager.restartNotifications(locked, false);
|
||||
}
|
||||
if (newLocale == locale) return;
|
||||
setLocaleAndSystemConfiguration(locale);
|
||||
if (SDK_INT < 17) setLocaleLegacy(appContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the language represented by locale
|
||||
* should be offered to the user on this device.
|
||||
* * Android doesn't pick up Asturian on API < 21
|
||||
* * RTL languages are supported since API >= 17
|
||||
*/
|
||||
public static boolean isLocaleSupported(Locale locale) {
|
||||
if (SDK_INT >= 21) return true;
|
||||
if (locale.getLanguage().equals("ast")) return false;
|
||||
if (SDK_INT >= 17) return true;
|
||||
return isLeftToRight(locale);
|
||||
}
|
||||
|
||||
// Exclude RTL locales on API < 17, they won't be laid out correctly
|
||||
private static boolean isLeftToRight(Locale locale) {
|
||||
// TextUtilsCompat returns the wrong direction for Hebrew on some phones
|
||||
String language = locale.getLanguage();
|
||||
if (language.equals("iw") || language.equals("he")) return false;
|
||||
int direction =
|
||||
TextUtilsCompat.getLayoutDirectionFromLocale(locale);
|
||||
return direction == LAYOUT_DIRECTION_LTR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -109,7 +109,6 @@ public abstract class BaseActivity extends AppCompatActivity
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(
|
||||
Localizer.getInstance().setLocale(base));
|
||||
Localizer.getInstance().setLocale(this);
|
||||
}
|
||||
|
||||
public ActivityComponent getActivityComponent() {
|
||||
|
||||
@@ -79,10 +79,9 @@ public class GroupActivity extends
|
||||
|
||||
// start with group disabled and enable when not dissolved
|
||||
setGroupEnabled(false);
|
||||
viewModel.isDissolved().observe(this, dissolved -> {
|
||||
viewModel.isDissolved().observeEvent(this, dissolved -> {
|
||||
setGroupEnabled(!dissolved);
|
||||
// only show dialog when no prior state
|
||||
if (dissolved && state == null) onGroupDissolved();
|
||||
if (dissolved) onGroupDissolved();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -154,7 +153,7 @@ public class GroupActivity extends
|
||||
|
||||
@Override
|
||||
public void onReplyClick(GroupMessageItem item) {
|
||||
Boolean isDissolved = viewModel.isDissolved().getValue();
|
||||
Boolean isDissolved = viewModel.isDissolved().getLastValue();
|
||||
if (isDissolved != null && !isDissolved) super.onReplyClick(item);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import org.briarproject.bramble.api.system.AndroidExecutor;
|
||||
import org.briarproject.bramble.api.system.Clock;
|
||||
import org.briarproject.briar.android.sharing.SharingController;
|
||||
import org.briarproject.briar.android.threaded.ThreadListViewModel;
|
||||
import org.briarproject.briar.android.viewmodel.LiveEvent;
|
||||
import org.briarproject.briar.android.viewmodel.MutableLiveEvent;
|
||||
import org.briarproject.briar.api.android.AndroidNotificationManager;
|
||||
import org.briarproject.briar.api.client.MessageTracker;
|
||||
import org.briarproject.briar.api.client.MessageTracker.GroupCount;
|
||||
@@ -69,8 +71,8 @@ class GroupViewModel extends ThreadListViewModel<GroupMessageItem> {
|
||||
private final MutableLiveData<PrivateGroup> privateGroup =
|
||||
new MutableLiveData<>();
|
||||
private final MutableLiveData<Boolean> isCreator = new MutableLiveData<>();
|
||||
private final MutableLiveData<Boolean> isDissolved =
|
||||
new MutableLiveData<>();
|
||||
private final MutableLiveEvent<Boolean> isDissolved =
|
||||
new MutableLiveEvent<>();
|
||||
|
||||
@Inject
|
||||
GroupViewModel(Application application,
|
||||
@@ -127,7 +129,7 @@ class GroupViewModel extends ThreadListViewModel<GroupMessageItem> {
|
||||
} else if (e instanceof GroupDissolvedEvent) {
|
||||
GroupDissolvedEvent g = (GroupDissolvedEvent) e;
|
||||
if (g.getGroupId().equals(groupId)) {
|
||||
isDissolved.setValue(true);
|
||||
isDissolved.setEvent(true);
|
||||
}
|
||||
} else {
|
||||
super.eventOccurred(e);
|
||||
@@ -162,7 +164,7 @@ class GroupViewModel extends ThreadListViewModel<GroupMessageItem> {
|
||||
loadList(txn -> {
|
||||
// check first if group is dissolved
|
||||
isDissolved
|
||||
.postValue(privateGroupManager.isDissolved(txn, groupId));
|
||||
.postEvent(privateGroupManager.isDissolved(txn, groupId));
|
||||
// now continue to load the items
|
||||
long start = now();
|
||||
List<GroupMessageHeader> headers =
|
||||
@@ -280,7 +282,7 @@ class GroupViewModel extends ThreadListViewModel<GroupMessageItem> {
|
||||
return isCreator;
|
||||
}
|
||||
|
||||
LiveData<Boolean> isDissolved() {
|
||||
LiveEvent<Boolean> isDissolved() {
|
||||
return isDissolved;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ import javax.inject.Inject;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.text.TextUtilsCompat;
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.Preference.OnPreferenceChangeListener;
|
||||
@@ -70,7 +69,6 @@ import static android.provider.Settings.EXTRA_APP_PACKAGE;
|
||||
import static android.provider.Settings.EXTRA_CHANNEL_ID;
|
||||
import static android.provider.Settings.System.DEFAULT_NOTIFICATION_URI;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static androidx.core.view.ViewCompat.LAYOUT_DIRECTION_LTR;
|
||||
import static java.util.Objects.requireNonNull;
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
@@ -296,19 +294,27 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
Locale locale = Localizer.getLocaleFromTag(tag);
|
||||
if (locale == null)
|
||||
throw new IllegalStateException();
|
||||
// Exclude RTL locales on API < 17, they won't be laid out correctly
|
||||
if (SDK_INT < 17 && !isLeftToRight(locale)) {
|
||||
// Check if the locale is supported on this device
|
||||
if (!Localizer.isLocaleSupported(locale)) {
|
||||
if (LOG.isLoggable(INFO))
|
||||
LOG.info("Skipping RTL locale " + tag);
|
||||
LOG.info("Skipping unsupported locale " + tag);
|
||||
continue;
|
||||
}
|
||||
String nativeName = locale.getDisplayName(locale);
|
||||
// Fallback to English if the name is unknown in both native and
|
||||
// current locale.
|
||||
if (nativeName.equals(tag)) {
|
||||
String tmp = locale.getDisplayLanguage(Locale.ENGLISH);
|
||||
if (!tmp.isEmpty() && !tmp.equals(nativeName))
|
||||
nativeName = tmp;
|
||||
String nativeName;
|
||||
// Unknown languages won't be translated to their native name.
|
||||
if (locale.getLanguage().equals("ast")) {
|
||||
nativeName = "Asturianu";
|
||||
} else if (locale.getLanguage().equals("oc")) {
|
||||
nativeName = "Occitan";
|
||||
} else {
|
||||
nativeName = locale.getDisplayName(locale);
|
||||
// Fallback to English if the name is unknown in both native and
|
||||
// current locale.
|
||||
if (nativeName.equals(tag)) {
|
||||
String tmp = locale.getDisplayLanguage(Locale.ENGLISH);
|
||||
if (!tmp.isEmpty() && !tmp.equals(nativeName))
|
||||
nativeName = tmp;
|
||||
}
|
||||
}
|
||||
// Prefix with LRM marker to prevent any RTL direction
|
||||
entries.add("\u200E" + nativeName.substring(0, 1).toUpperCase()
|
||||
@@ -319,13 +325,6 @@ public class SettingsFragment extends PreferenceFragmentCompat
|
||||
language.setEntryValues(entryValues.toArray(new CharSequence[0]));
|
||||
}
|
||||
|
||||
private boolean isLeftToRight(Locale locale) {
|
||||
// TextUtilsCompat returns the wrong direction for Hebrew on some phones
|
||||
String language = locale.getLanguage();
|
||||
if (language.equals("iw") || language.equals("he")) return false;
|
||||
int direction = TextUtilsCompat.getLayoutDirectionFromLocale(locale);
|
||||
return direction == LAYOUT_DIRECTION_LTR;
|
||||
}
|
||||
|
||||
private void setTorNetworkSummary(int torNetworkSetting) {
|
||||
if (torNetworkSetting != PREF_TOR_NETWORK_AUTOMATIC) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.briarproject.briar.android.splash;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
@@ -8,7 +7,6 @@ import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
|
||||
import org.briarproject.briar.R;
|
||||
import org.briarproject.briar.android.Localizer;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
@@ -29,13 +27,6 @@ public class ExpiredActivity extends AppCompatActivity
|
||||
findViewById(R.id.download_briar_button).setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(
|
||||
Localizer.getInstance().setLocale(base));
|
||||
Localizer.getInstance().setLocale(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Uri uri = Uri.parse("https://briarproject.org/download.html");
|
||||
|
||||
@@ -93,4 +93,7 @@ public interface AndroidNotificationManager {
|
||||
void blockAllBlogPostNotifications();
|
||||
|
||||
void unblockAllBlogPostNotifications();
|
||||
|
||||
void restartNotifications(boolean locked, boolean mayAlertAgain);
|
||||
|
||||
}
|
||||
|
||||
@@ -67,11 +67,8 @@
|
||||
<string name="lock_button">قفل کردن برنامه</string>
|
||||
<string name="settings_button">تنظیمات</string>
|
||||
<string name="sign_out_button">خروج</string>
|
||||
<string name="transports_onboarding_text">برای کنترل چگونگی اتصال Briar (برایر) به مخاطبین خود، اینجا را لمس کنید.</string>
|
||||
<!--Transports: Tor-->
|
||||
<string name="transport_tor">اینترنت</string>
|
||||
<string name="tor_device_status_online_wifi">تلفن شما از طریق Wi-Fi به اینترنت دسترسی دارد.</string>
|
||||
<string name="tor_device_status_online_mobile">تلفن شما از طریق دیتا سیمکارت به اینترنت دسترسی دارد.</string>
|
||||
<string name="tor_device_status_offline">تلفن شما دارای دسترسی اینترنتی نیست</string>
|
||||
<string name="tor_plugin_status_enabling">Briar در حال اتصال به اینترنت می باشد</string>
|
||||
<string name="tor_plugin_status_active">Briar به اینترنت متصل شد</string>
|
||||
@@ -465,10 +462,6 @@
|
||||
برای وارد کردن خوراک روی آیکون + ضربه بزنید</string>
|
||||
<string name="blogs_rss_feeds_manage_error">مشکلی با بارگذاری فیدهای شما وجود داشت. لطفا بعدا امتحان کنید.</string>
|
||||
<!--Settings Profile Picture-->
|
||||
<string name="change_profile_picture">برای تغییر تصویر نمایه خود اینجا را لمس کنید.</string>
|
||||
<string name="dialog_confirm_profile_picture_title">تغییر تصویر نمایه</string>
|
||||
<string name="dialog_confirm_profile_picture_remark">تنها مخاطبین شما میتوانند تصویر نمایه شما را مشاهده کنند.</string>
|
||||
<string name="change_profile_picture_failed_message">تاسفیم اما هنگام بروزرسانی تصویر نمایه شما مشکلی رخ داد.</string>
|
||||
<!--Settings Display-->
|
||||
<string name="pref_language_title">زبان و منطقه</string>
|
||||
<string name="pref_language_changed">این تنظیمات زمانی که Briar (برایر) را ری استارت کنید تاثیر خود را می گذارند. لطفا خارج شوید و Briar (برایر) را دوباره راه اندازی کنید.</string>
|
||||
@@ -578,20 +571,17 @@
|
||||
<string name="include_debug_report_feedback">قرار دادن داده های ناشناس درباره این دستگاه</string>
|
||||
<string name="dev_report_basic_info">اطلاعات پایه</string>
|
||||
<string name="dev_report_device_info">اطلاعات دستگاه</string>
|
||||
<string name="dev_report_stacktrace">Stacktrace</string>
|
||||
<string name="dev_report_time_info">اطلاعات زمانی</string>
|
||||
<string name="dev_report_memory">حافظه</string>
|
||||
<string name="dev_report_storage">حافظه</string>
|
||||
<string name="dev_report_connectivity">اتصال</string>
|
||||
<string name="dev_report_build_config">پیکربندی ساخت</string>
|
||||
<string name="dev_report_logcat">لاگ برنامه</string>
|
||||
<string name="dev_report_device_features">ویژگیهای دستگاه</string>
|
||||
<string name="send_report">ارسال گزارش</string>
|
||||
<string name="close">بستن</string>
|
||||
<string name="dev_report_sending">در حال فرستادن نظر...</string>
|
||||
<string name="dev_report_sent">بازخورد ارسال شد</string>
|
||||
<string name="dev_report_saved">گزارش ذخیره شد. دفعه بعدی که وارد Briar (برایر) شدید فرستاده خواهد شد.</string>
|
||||
<string name="dev_report_error">خطا در ارسال گزارش</string>
|
||||
<!--Sign Out-->
|
||||
<string name="progress_title_logout">خروج از Briar (برایر)...</string>
|
||||
<!--Screen Filters & Tapjacking-->
|
||||
@@ -601,9 +591,7 @@
|
||||
این برنامه ها ممکن است روی Briar (برایر) قرار گرفته باشند:
|
||||
|
||||
%1$s</string>
|
||||
<string name="screen_filter_body_api_30">برنامه دیگری بر روی برنامه Briar (برایر) قرار دارد. برای محافظت از امنیت شما، Briar (برایر) هنگامی که برنامه دیگری روی آن باز است، به لمس پاسخ نخواهد داد. \n\nبرای یافتن برنامه مذکور، برنامههای زیر را بررسی کنید.</string>
|
||||
<string name="screen_filter_allow">به این برنامه ها اجازه بده تا روی Briar (برایر) قرار بگیرند</string>
|
||||
<string name="screen_filter_review_apps">بررسی برنامهها</string>
|
||||
<!--Permission Requests-->
|
||||
<string name="permission_camera_title">دسترسی به دوربین</string>
|
||||
<string name="permission_camera_request_body">برای اسکن کردن کد کیوآر دسترسی به دوربین لازم است.</string>
|
||||
@@ -620,7 +608,6 @@ Briar (برایر) موقعیت شما را ذخیره نمیکند و آن
|
||||
<string name="permission_camera_denied_body">شما دسترسی به دوربین را رد کرده اید، اما افزودن مخاطب نیاز به دوربین دارد.
|
||||
|
||||
لطفا اجازه دسترسی را بدهید.</string>
|
||||
<string name="permission_location_denied_body">شما دسترسی به موقعیت خود را ندادهاید اما Briar (برایر) برای یافتن دستگاههای بلوتوث نیاز به این دسترسی دارد.\n\nلطفا این دسترسی را فراهم کنید.</string>
|
||||
<string name="qr_code">کد کیوآر</string>
|
||||
<string name="show_qr_code_fullscreen">نمایش کد کیوآر به صورت فول اسکرین</string>
|
||||
<!--App Locking-->
|
||||
@@ -631,7 +618,6 @@ Briar (برایر) موقعیت شما را ذخیره نمیکند و آن
|
||||
<string name="lock_is_locked">Briar (برایر) قفل می باشد</string>
|
||||
<string name="lock_tap_to_unlock">برای آنلاک کردن کلیک کنید</string>
|
||||
<!--Connections Screen-->
|
||||
<string name="transports_help_text">Briar (برایر) میتواند از طریق اینترنت، Wi-Fi و یا بلوتوث به مخاطبین شما متصل گردد.\n\nارتباط با اینترنت از طریق شبکهی تور صورت میپذیرد.\n\nاگر دسترسی به مخاطب شما از روشهای مختلفی ممکن باشد، Briar (برایر) به صورت موازی از آنها استفاده خواهد کرد.</string>
|
||||
<!--Screenshots-->
|
||||
<!--This is a name to be used in screenshots. Feel free to change it to a local name.-->
|
||||
<string name="screenshot_alice">آلیس</string>
|
||||
|
||||
@@ -425,10 +425,6 @@
|
||||
<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 Profile Picture-->
|
||||
<string name="change_profile_picture">Toca para cambiar a túa imaxe de perfil</string>
|
||||
<string name="dialog_confirm_profile_picture_title">Mudar imaxe de perfil</string>
|
||||
<string name="dialog_confirm_profile_picture_remark">Só os teus contactos poden ver a túa imaxe de perfil</string>
|
||||
<string name="change_profile_picture_failed_message">Lamentámolo, pero algo fallou cando intentamos actualizar a túa imaxe de pefil</string>
|
||||
<!--Settings Display-->
|
||||
<string name="pref_language_title">Idioma & rexión</string>
|
||||
<string name="pref_language_changed">Este axuste terá efecto cando reinicie Briar. Por favor desconecte e volte a iniciar Briar.</string>
|
||||
|
||||
@@ -449,10 +449,6 @@
|
||||
<string name="blogs_rss_feeds_manage_empty_state">אין הזנות RSS להראות\n\nהקש על הצלמית + כדי לייבא הזנה</string>
|
||||
<string name="blogs_rss_feeds_manage_error">הייתה בעיה בטעינת ההזנות שלך. אנא נסה שוב מאוחר יותר.</string>
|
||||
<!--Settings Profile Picture-->
|
||||
<string name="change_profile_picture">הקש כדי לשנות את תמונת הפרופיל שלך</string>
|
||||
<string name="dialog_confirm_profile_picture_title">שנה תמונת פרופיל</string>
|
||||
<string name="dialog_confirm_profile_picture_remark">רק אנשי הקשר שלך יכולים לראות את תמונת הפרופיל שלך</string>
|
||||
<string name="change_profile_picture_failed_message">אנו מצטערים משהו השתבש בעת עדכון תמונת הפרופיל שלך</string>
|
||||
<!--Settings Display-->
|
||||
<string name="pref_language_title">שפה ואזור</string>
|
||||
<string name="pref_language_changed">הגדרה זו תיכנס לתוקף כשתפעיל מחדש את Briar. אנא התנתק והפעל מחדש את Briar.</string>
|
||||
@@ -562,7 +558,6 @@
|
||||
<string name="include_debug_report_feedback">כלול נתונים אלמוניים לגבי מכשיר זה</string>
|
||||
<string name="dev_report_basic_info">מידע בסיסי</string>
|
||||
<string name="dev_report_device_info">מידע מכשיר</string>
|
||||
<string name="dev_report_stacktrace">מחסנית עקיבה (Stacktrace)</string>
|
||||
<string name="dev_report_time_info">מידע זמן</string>
|
||||
<string name="dev_report_memory">זיכרון</string>
|
||||
<string name="dev_report_storage">אחסון</string>
|
||||
|
||||
@@ -425,10 +425,6 @@
|
||||
<string name="blogs_rss_feeds_manage_empty_state">Engin RSS-streymi til að birta\n\nÝttu á + táknið til að flytja inn streymi</string>
|
||||
<string name="blogs_rss_feeds_manage_error">Vandamál hefur komið upp með að hlaða inn streymunum þínum. Reyndu aftur síðar.</string>
|
||||
<!--Settings Profile Picture-->
|
||||
<string name="change_profile_picture">Ýttu til að skipta um auðkennismyndina þína</string>
|
||||
<string name="dialog_confirm_profile_picture_title">Skipta um auðkennismynd</string>
|
||||
<string name="dialog_confirm_profile_picture_remark">Einungis tengiliðirnir þínir geta séð auðkennismyndina þína</string>
|
||||
<string name="change_profile_picture_failed_message">Því miður, eitthvað fór úrskeiðis við að uppfæra auðkennismyndina þína.</string>
|
||||
<!--Settings Display-->
|
||||
<string name="pref_language_title">Tungumál og landsvæði</string>
|
||||
<string name="pref_language_changed">Þessi stilling tekur gildi í næst þegar þú skráir þig inn í Briar. Skráðu þig út og endurræstu Briar.</string>
|
||||
|
||||
@@ -425,10 +425,6 @@
|
||||
<string name="blogs_rss_feeds_manage_empty_state">Nessun feed RSS da mostrare\n\nClicca l\'icona + per importare un feed</string>
|
||||
<string name="blogs_rss_feeds_manage_error">C\'è stato un problema nel caricare i tuoi feeds. Per favore riprova fra poco.</string>
|
||||
<!--Settings Profile Picture-->
|
||||
<string name="change_profile_picture">Tocca per cambiare l\'immagine del profilo</string>
|
||||
<string name="dialog_confirm_profile_picture_title">Cambia immagine profilo</string>
|
||||
<string name="dialog_confirm_profile_picture_remark">Solo i tuoi contatti possono vedere l\'immagine del profilo</string>
|
||||
<string name="change_profile_picture_failed_message">Spiacenti, qualcosa è andato storto aggiornando la tua foto del profilo.</string>
|
||||
<!--Settings Display-->
|
||||
<string name="pref_language_title">Lingua & regione</string>
|
||||
<string name="pref_language_changed">Questa impostazione avrà effetto quando riavvierai Briar. Per favore, esci e riavvia Briar.</string>
|
||||
|
||||
@@ -425,10 +425,6 @@
|
||||
<string name="blogs_rss_feeds_manage_empty_state">Geen RSS-feeds om te tonen\n\nTik op het +-icoon om een feed te importeren</string>
|
||||
<string name="blogs_rss_feeds_manage_error">Er was een probleem met het laden van je feeds. Probeer het alsjeblieft later nog een keer.</string>
|
||||
<!--Settings Profile Picture-->
|
||||
<string name="change_profile_picture">Tik om je profielfoto te wijzigen</string>
|
||||
<string name="dialog_confirm_profile_picture_title">Wijzig profielfoto</string>
|
||||
<string name="dialog_confirm_profile_picture_remark">Alleen je contacten kunnen je profielfoto zien</string>
|
||||
<string name="change_profile_picture_failed_message">Excuses, maar er is iets misgegaan met het updaten van je profielfoto</string>
|
||||
<!--Settings Display-->
|
||||
<string name="pref_language_title">Taal & regio</string>
|
||||
<string name="pref_language_changed">Deze instelling zal werken wanneer u Briar opnieuw opstart. Gelieve uit te loggen en Briar opnieuw te starten.</string>
|
||||
@@ -568,7 +564,7 @@
|
||||
<string name="permission_camera_location_title">Camera en locatie</string>
|
||||
<string name="permission_camera_location_request_body">Om de QR-code in te scannen heeft Briar toegang nodig tot de camera.\n\nOm bluetoothapparaten te ontdekken heeft Briar toestemming nodig tot je locatie.\n\nBriar slaat je locatie niet op en deelt het met niemand.</string>
|
||||
<string name="permission_camera_denied_body">Je hebt toegang tot de camera niet vrijgegeven, terwijl het toevoegen van contacten de camera nodig heeft.\n\nOverweeg alsjeblieft toegang vrij te geven.</string>
|
||||
<string name="permission_location_denied_body">Je hebt geen toegang tot je locatie gegeven, maar Briar heeft deze rechten nodig om apparaten via bluetooth te vinden.\n\nOverweeg a.u.b. deze rechten te geven.</string>
|
||||
<string name="permission_location_denied_body">Je hebt geen toegang tot je locatie gegeven, maar Briar heeft deze rechten nodig om apparaten via bleutooth te vinden.\n\nOverweeg a.u.b. deze rechten te geven.</string>
|
||||
<string name="qr_code">QR-code</string>
|
||||
<string name="show_qr_code_fullscreen">Toon QR-code op volledig scherm</string>
|
||||
<!--App Locking-->
|
||||
|
||||
@@ -435,10 +435,6 @@
|
||||
<string name="blogs_rss_feeds_manage_empty_state">Nici un flux RSS de arătat\n\nAtingeți iconița + pentru a adăuga un flux</string>
|
||||
<string name="blogs_rss_feeds_manage_error">A apărut o eroare la încărcarea fluxurilor dumneavoastră. Vă rugăm să încercați din nou mai târziu.</string>
|
||||
<!--Settings Profile Picture-->
|
||||
<string name="change_profile_picture">Atingeți pentru a vă schimba poza de profil</string>
|
||||
<string name="dialog_confirm_profile_picture_title">Schimbare poză de profil</string>
|
||||
<string name="dialog_confirm_profile_picture_remark">Doar contactele vor vedea poza de contact</string>
|
||||
<string name="change_profile_picture_failed_message">Ne pare rău, dar ceva nu a funcționat cum trebuie la actualizarea pozei de profil</string>
|
||||
<!--Settings Display-->
|
||||
<string name="pref_language_title">Limbă & Regiune</string>
|
||||
<string name="pref_language_changed">Această setare va avea efect după repornirea Briar. Vă rugăm să ieșiți din Briar și să reporniți aplicația.</string>
|
||||
|
||||
@@ -447,10 +447,6 @@
|
||||
<string name="blogs_rss_feeds_manage_empty_state">Нет RSS-лент для отображения\n\nКоснитесь значка + для импорта ленты</string>
|
||||
<string name="blogs_rss_feeds_manage_error">Ошибка при загрузке вашей ленты. Повторите попытку позже.</string>
|
||||
<!--Settings Profile Picture-->
|
||||
<string name="change_profile_picture">Нажмите, чтобы изменить изображение вашего профиля </string>
|
||||
<string name="dialog_confirm_profile_picture_title">Изменить изображение профиля</string>
|
||||
<string name="dialog_confirm_profile_picture_remark">Только ваши контакты могут видеть изображение вашего профиля</string>
|
||||
<string name="change_profile_picture_failed_message">Нам очень жаль, но что-то пошло не так во время обновления изображения вашего профиля.</string>
|
||||
<!--Settings Display-->
|
||||
<string name="pref_language_title">Язык и регион</string>
|
||||
<string name="pref_language_changed">Этот параметр вступит в силу после перезапуска Briar. Пожалуйста, выйдите и перезапустите Briar.</string>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
dependencyVerification {
|
||||
verify = [
|
||||
'junit:junit:4.13.1:junit-4.13.1.jar:c30719db974d6452793fe191b3638a5777005485bae145924044530ffa5f6122',
|
||||
'org.codehaus.mojo.signature:java16:1.1:java16-1.1.signature:53799223a2c98dba2d0add810bed76315460df285c69e4f397ae6098f87dd619',
|
||||
'org.codehaus.mojo:animal-sniffer-ant-tasks:1.16:animal-sniffer-ant-tasks-1.16.jar:890040976fbe2d584619a6a61b1fd2e925b3b5eb342a85eb2762c467c0d64e90',
|
||||
'org.codehaus.mojo:animal-sniffer:1.16:animal-sniffer-1.16.jar:72be8bcc226ba43b937c722a08a07852bfa1b11400089265d5df0ee7b38b1d52',
|
||||
'org.hamcrest:hamcrest-core:1.3:hamcrest-core-1.3.jar:66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9',
|
||||
'org.ow2.asm:asm-all:5.2:asm-all-5.2.jar:7fbffbc1db3422e2101689fd88df8384b15817b52b9b2b267b9f6d2511dc198d',
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user