This commit is contained in:
世界 2020-04-01 00:44:34 +08:00
parent 491d88ecca
commit 0a3b6a92b3
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
3 changed files with 49 additions and 19 deletions

View File

@ -231,8 +231,8 @@ android {
minSdkVersion 16
targetSdkVersion 29
versionName "6.0.1.0"
versionCode = 4
versionName "6.0.1.1"
versionCode = 5
vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']

View File

@ -1050,7 +1050,9 @@ public class SharedConfig {
public static boolean proxyEnabled;
public static VmessProxy publicProxy; static {
public static VmessProxy publicProxy;
static {
publicProxy = new VmessProxy(VmessLoader.getPublic());
publicProxy.isInternal = true;
@ -1065,7 +1067,7 @@ public class SharedConfig {
boolean proxyEnabledValue = preferences.getBoolean("proxy_enabled", false);
if (currentProxy == null) {
if (proxyEnabledValue && currentProxy == null) {
currentProxy = publicProxy;
@ -1158,25 +1160,22 @@ public class SharedConfig {
}
if (!proxyObj.optBoolean("internal",false)) {
if (proxyObj.optBoolean("internal", false)) continue;
proxyList.add(info);
proxyList.add(info);
if (proxyObj.optBoolean("current", false)) {
if (proxyObj.optBoolean("current", false)) {
currentProxy = publicProxy;
currentProxy = info;
if (info instanceof ExternalSocks5Proxy) {
if (info instanceof ExternalSocks5Proxy) {
((ExternalSocks5Proxy) info).start();
}
((ExternalSocks5Proxy) info).start();
}
}
}
} catch (Exception ex) {
@ -1291,7 +1290,7 @@ public class SharedConfig {
if (info == currentProxy) {
obj.put("current", true);
if (info.isInternal) {
obj.put("internal",true);
obj.put("internal", true);
}
} else if (info.isInternal) {
continue;
@ -1305,7 +1304,7 @@ public class SharedConfig {
File proxyListFile = new File(ApplicationLoader.applicationContext.getFilesDir().getParentFile(), "nekox/proxy_list.json");
try {
FileUtil.writeUtf8String(proxyArray.toString(4),proxyListFile);
FileUtil.writeUtf8String(proxyArray.toString(4), proxyListFile);
} catch (JSONException e) {
FileLog.e(e);
}

View File

@ -285,27 +285,58 @@ public class NekoXConfig {
mkFilter(LocaleController.getString("FilterNameUnmuted", R.string.FilterNameUnmuted),
LocaleController.getString("FilterNameUnmutedDescription", R.string.FilterNameUnmutedDescription),
MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED,
MessagesController.DIALOG_FILTER_FLAG_CONTACTS |
MessagesController.DIALOG_FILTER_FLAG_NON_CONTACTS |
MessagesController.DIALOG_FILTER_FLAG_GROUPS |
MessagesController.DIALOG_FILTER_FLAG_CHANNELS |
MessagesController.DIALOG_FILTER_FLAG_BOTS |
MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED,
(it) -> {
it.contacts = true;
it.non_contacts = true;
it.groups = true;
it.broadcasts = true;
it.bots = true;
it.exclude_muted = true;
});
mkFilter(LocaleController.getString("FilterNameUnread2", R.string.FilterNameUnread2),
LocaleController.getString("FilterNameUnreadDescription", R.string.FilterNameUnreadDescription),
MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_READ,
MessagesController.DIALOG_FILTER_FLAG_CONTACTS |
MessagesController.DIALOG_FILTER_FLAG_NON_CONTACTS |
MessagesController.DIALOG_FILTER_FLAG_GROUPS |
MessagesController.DIALOG_FILTER_FLAG_CHANNELS |
MessagesController.DIALOG_FILTER_FLAG_BOTS |
MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_READ,
(it) -> {
it.contacts = true;
it.non_contacts = true;
it.groups = true;
it.broadcasts = true;
it.bots = true;
it.exclude_read = true;
});
mkFilter(LocaleController.getString("FilterNameUnmutedAndUnread", R.string.FilterNameUnmutedAndUnread),
LocaleController.getString("FilterNameUnmutedAndUnreadDescription", R.string.FilterNameUnmutedAndUnreadDescription),
MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED | MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_READ,
MessagesController.DIALOG_FILTER_FLAG_CONTACTS |
MessagesController.DIALOG_FILTER_FLAG_NON_CONTACTS |
MessagesController.DIALOG_FILTER_FLAG_GROUPS |
MessagesController.DIALOG_FILTER_FLAG_CHANNELS |
MessagesController.DIALOG_FILTER_FLAG_BOTS |
MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_MUTED |
MessagesController.DIALOG_FILTER_FLAG_EXCLUDE_READ,
(it) -> {
it.contacts = true;
it.non_contacts = true;
it.groups = true;
it.broadcasts = true;
it.bots = true;
it.exclude_muted = true;
it.exclude_read = true;
@ -339,7 +370,7 @@ public class NekoXConfig {
internalFilters.add(suggestedFilter);
currId ++;
currId++;
}