Allow ignore content restrictions
This commit is contained in:
parent
f1d1f3df0c
commit
df19b1b865
@ -5,8 +5,8 @@ apply plugin: 'com.android.application'
|
|||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-android-extensions'
|
||||||
|
|
||||||
def verName = "7.1.3-preview02"
|
def verName = "7.1.3-rc03"
|
||||||
def verCode = 75
|
def verCode = 78
|
||||||
|
|
||||||
def serviceAccountCredentialsFile = rootProject.file("service_account_credentials.json")
|
def serviceAccountCredentialsFile = rootProject.file("service_account_credentials.json")
|
||||||
|
|
||||||
@ -344,6 +344,9 @@ android {
|
|||||||
}
|
}
|
||||||
full {
|
full {
|
||||||
}
|
}
|
||||||
|
fullPlay {
|
||||||
|
versionNameSuffix '-play'
|
||||||
|
}
|
||||||
fullNoEmoji {
|
fullNoEmoji {
|
||||||
versionNameSuffix '-full-no-emoji'
|
versionNameSuffix '-full-no-emoji'
|
||||||
}
|
}
|
||||||
|
@ -13264,7 +13264,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
|||||||
}
|
}
|
||||||
for (int a = 0, N = reasons.size(); a < N; a++) {
|
for (int a = 0, N = reasons.size(); a < N; a++) {
|
||||||
TLRPC.TL_restrictionReason reason = reasons.get(a);
|
TLRPC.TL_restrictionReason reason = reasons.get(a);
|
||||||
if ("all".equals(reason.platform) || "android".equals(reason.platform)) {
|
if ("all".equals(reason.platform) || "android".equals(reason.platform) && !NekoConfig.ignoreContentRestrictions) {
|
||||||
return reason.text;
|
return reason.text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -13369,7 +13369,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
|||||||
closeLast = true;
|
closeLast = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (reason != null) {
|
if (reason != null && !NekoConfig.ignoreContentRestrictions) {
|
||||||
showCantOpenAlert(fragment, reason);
|
showCantOpenAlert(fragment, reason);
|
||||||
} else {
|
} else {
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
|
@ -119,6 +119,8 @@ public class NekoConfig {
|
|||||||
public static boolean autoPauseVideo;
|
public static boolean autoPauseVideo;
|
||||||
public static boolean disableProximityEvents;
|
public static boolean disableProximityEvents;
|
||||||
|
|
||||||
|
public static boolean ignoreContentRestrictions;
|
||||||
|
|
||||||
public static String getOpenPGPAppName() {
|
public static String getOpenPGPAppName() {
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(openPGPApp)) {
|
if (StrUtil.isNotBlank(openPGPApp)) {
|
||||||
@ -249,6 +251,8 @@ public class NekoConfig {
|
|||||||
disableVibration = preferences.getBoolean("disableVibration", false);
|
disableVibration = preferences.getBoolean("disableVibration", false);
|
||||||
autoPauseVideo = preferences.getBoolean("autoPauseVideo", false);
|
autoPauseVideo = preferences.getBoolean("autoPauseVideo", false);
|
||||||
|
|
||||||
|
ignoreContentRestrictions = preferences.getBoolean("ignoreContentRestrictions", false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void toggleShowAddToSavedMessages() {
|
public static void toggleShowAddToSavedMessages() {
|
||||||
@ -779,4 +783,10 @@ public class NekoConfig {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void toggleIgnoreContentRestrictions() {
|
||||||
|
|
||||||
|
preferences.edit().putBoolean("ignoreContentRestrictions",ignoreContentRestrictions = !ignoreContentRestrictions).apply();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -17,6 +17,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
|||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import org.telegram.messenger.AndroidUtilities;
|
import org.telegram.messenger.AndroidUtilities;
|
||||||
|
import org.telegram.messenger.BuildConfig;
|
||||||
import org.telegram.messenger.FileLog;
|
import org.telegram.messenger.FileLog;
|
||||||
import org.telegram.messenger.LocaleController;
|
import org.telegram.messenger.LocaleController;
|
||||||
import org.telegram.messenger.R;
|
import org.telegram.messenger.R;
|
||||||
@ -44,6 +45,7 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
import tw.nekomimi.nekogram.MessageHelper;
|
import tw.nekomimi.nekogram.MessageHelper;
|
||||||
import tw.nekomimi.nekogram.NekoConfig;
|
import tw.nekomimi.nekogram.NekoConfig;
|
||||||
|
import tw.nekomimi.nekogram.NekoXConfig;
|
||||||
|
|
||||||
@SuppressLint("RtlHardcoded")
|
@SuppressLint("RtlHardcoded")
|
||||||
public class NekoExperimentalSettingsActivity extends BaseFragment {
|
public class NekoExperimentalSettingsActivity extends BaseFragment {
|
||||||
@ -62,6 +64,7 @@ public class NekoExperimentalSettingsActivity extends BaseFragment {
|
|||||||
private int mediaPreviewRow;
|
private int mediaPreviewRow;
|
||||||
private int proxyAutoSwitchRow;
|
private int proxyAutoSwitchRow;
|
||||||
private int disableFilteringRow;
|
private int disableFilteringRow;
|
||||||
|
private int ignoreContentRestrictionsRow;
|
||||||
private int unlimitedFavedStickersRow;
|
private int unlimitedFavedStickersRow;
|
||||||
private int unlimitedPinnedDialogsRow;
|
private int unlimitedPinnedDialogsRow;
|
||||||
private int deleteAccountRow;
|
private int deleteAccountRow;
|
||||||
@ -124,6 +127,11 @@ public class NekoExperimentalSettingsActivity extends BaseFragment {
|
|||||||
AndroidUtilities.runOnUIThread(() -> AlertsCreator.processError(currentAccount, error, this, req));
|
AndroidUtilities.runOnUIThread(() -> AlertsCreator.processError(currentAccount, error, this, req));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
} else if (position == ignoreContentRestrictionsRow) {
|
||||||
|
NekoConfig.toggleIgnoreContentRestrictions();
|
||||||
|
if (view instanceof TextCheckCell) {
|
||||||
|
((TextCheckCell) view).setChecked(NekoConfig.ignoreContentRestrictions);
|
||||||
|
}
|
||||||
} else if (position == unlimitedFavedStickersRow) {
|
} else if (position == unlimitedFavedStickersRow) {
|
||||||
NekoConfig.toggleUnlimitedFavedStickers();
|
NekoConfig.toggleUnlimitedFavedStickers();
|
||||||
if (view instanceof TextCheckCell) {
|
if (view instanceof TextCheckCell) {
|
||||||
@ -254,6 +262,7 @@ public class NekoExperimentalSettingsActivity extends BaseFragment {
|
|||||||
mediaPreviewRow = rowCount++;
|
mediaPreviewRow = rowCount++;
|
||||||
proxyAutoSwitchRow = rowCount++;
|
proxyAutoSwitchRow = rowCount++;
|
||||||
disableFilteringRow = rowCount++;
|
disableFilteringRow = rowCount++;
|
||||||
|
ignoreContentRestrictionsRow = !BuildConfig.VERSION_NAME.contains("play") || NekoXConfig.developerMode ? rowCount++ : -1;
|
||||||
unlimitedFavedStickersRow = rowCount++;
|
unlimitedFavedStickersRow = rowCount++;
|
||||||
unlimitedPinnedDialogsRow = rowCount++;
|
unlimitedPinnedDialogsRow = rowCount++;
|
||||||
deleteAccountRow = rowCount++;
|
deleteAccountRow = rowCount++;
|
||||||
@ -388,6 +397,8 @@ public class NekoExperimentalSettingsActivity extends BaseFragment {
|
|||||||
if (position == disableFilteringRow) {
|
if (position == disableFilteringRow) {
|
||||||
textCell.setTextAndValueAndCheck(LocaleController.getString("SensitiveDisableFiltering", R.string.SensitiveDisableFiltering), LocaleController.getString("SensitiveAbout", R.string.SensitiveAbout), sensitiveEnabled, true, true);
|
textCell.setTextAndValueAndCheck(LocaleController.getString("SensitiveDisableFiltering", R.string.SensitiveDisableFiltering), LocaleController.getString("SensitiveAbout", R.string.SensitiveAbout), sensitiveEnabled, true, true);
|
||||||
textCell.setEnabled(sensitiveCanChange, null);
|
textCell.setEnabled(sensitiveCanChange, null);
|
||||||
|
} else if (position == ignoreContentRestrictionsRow) {
|
||||||
|
textCell.setTextAndValueAndCheck(LocaleController.getString("IgnoreContentRestrictions", R.string.IgnoreContentRestrictions), LocaleController.getString("IgnoreContentRestrictionsNotice", R.string.IgnoreContentRestrictionsNotice), NekoConfig.ignoreContentRestrictions, true, true);
|
||||||
} else if (position == unlimitedFavedStickersRow) {
|
} else if (position == unlimitedFavedStickersRow) {
|
||||||
textCell.setTextAndValueAndCheck(LocaleController.getString("UnlimitedFavoredStickers", R.string.UnlimitedFavoredStickers), LocaleController.getString("UnlimitedFavoredStickersAbout", R.string.UnlimitedFavoredStickersAbout), NekoConfig.unlimitedFavedStickers, true, true);
|
textCell.setTextAndValueAndCheck(LocaleController.getString("UnlimitedFavoredStickers", R.string.UnlimitedFavoredStickers), LocaleController.getString("UnlimitedFavoredStickersAbout", R.string.UnlimitedFavoredStickersAbout), NekoConfig.unlimitedFavedStickers, true, true);
|
||||||
} else if (position == smoothKeyboardRow) {
|
} else if (position == smoothKeyboardRow) {
|
||||||
|
@ -54,7 +54,6 @@ public class NekoSettingsActivity extends BaseFragment {
|
|||||||
private int googlePlayRow;
|
private int googlePlayRow;
|
||||||
private int sourceCodeRow;
|
private int sourceCodeRow;
|
||||||
private int translationRow;
|
private int translationRow;
|
||||||
private int donateRow;
|
|
||||||
private int about2Row;
|
private int about2Row;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -104,8 +103,6 @@ public class NekoSettingsActivity extends BaseFragment {
|
|||||||
presentFragment(new NekoExperimentalSettingsActivity());
|
presentFragment(new NekoExperimentalSettingsActivity());
|
||||||
} else if (position == channelRow) {
|
} else if (position == channelRow) {
|
||||||
MessagesController.getInstance(currentAccount).openByUserName("NekogramX", this, 1);
|
MessagesController.getInstance(currentAccount).openByUserName("NekogramX", this, 1);
|
||||||
} else if (position == donateRow) {
|
|
||||||
Browser.openUrl(getParentActivity(), "https://patreon.com/NekoXDev");
|
|
||||||
} else if (position == translationRow) {
|
} else if (position == translationRow) {
|
||||||
Browser.openUrl(getParentActivity(), "https://nekox.crowdin.com/nekox");
|
Browser.openUrl(getParentActivity(), "https://nekox.crowdin.com/nekox");
|
||||||
} else if (position == googlePlayRow) {
|
} else if (position == googlePlayRow) {
|
||||||
@ -143,11 +140,6 @@ public class NekoSettingsActivity extends BaseFragment {
|
|||||||
}
|
}
|
||||||
sourceCodeRow = rowCount++;
|
sourceCodeRow = rowCount++;
|
||||||
translationRow = rowCount++;
|
translationRow = rowCount++;
|
||||||
if ("release".equals(BuildConfig.BUILD_TYPE)) {
|
|
||||||
donateRow = -1;
|
|
||||||
} else {
|
|
||||||
donateRow = rowCount++;
|
|
||||||
}
|
|
||||||
about2Row = rowCount++;
|
about2Row = rowCount++;
|
||||||
|
|
||||||
if (listAdapter != null) {
|
if (listAdapter != null) {
|
||||||
@ -253,13 +245,6 @@ public class NekoSettingsActivity extends BaseFragment {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 6: {
|
|
||||||
TextDetailSettingsCell textCell = (TextDetailSettingsCell) holder.itemView;
|
|
||||||
if (position == donateRow) {
|
|
||||||
textCell.setTextAndValue(LocaleController.getString("Donate", R.string.Donate), LocaleController.getString("DonateAbout", R.string.DonateAbout), false);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,8 +301,6 @@ public class NekoSettingsActivity extends BaseFragment {
|
|||||||
return 3;
|
return 3;
|
||||||
} else if (position == categoriesRow || position == aboutRow) {
|
} else if (position == categoriesRow || position == aboutRow) {
|
||||||
return 4;
|
return 4;
|
||||||
} else if (position == donateRow) {
|
|
||||||
return 6;
|
|
||||||
}
|
}
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -177,4 +177,6 @@
|
|||||||
<string name="PGPImportPrivate">导入私钥</string>
|
<string name="PGPImportPrivate">导入私钥</string>
|
||||||
<string name="ShareMyKey">分享我的公钥</string>
|
<string name="ShareMyKey">分享我的公钥</string>
|
||||||
<string name="DisableVibration">禁用振动</string>
|
<string name="DisableVibration">禁用振动</string>
|
||||||
|
<string name="IgnoreContentRestrictions">忽略内容限制</string>
|
||||||
|
<string name="IgnoreContentRestrictionsNotice">在本机忽略消息针对 Android 平台的限制. 这可能在未来被服务器禁止, 您需要自行评估在当地的合法性.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -233,5 +233,8 @@
|
|||||||
<string name="ShareMyKey">Share My Public Key</string>
|
<string name="ShareMyKey">Share My Public Key</string>
|
||||||
|
|
||||||
<string name="DisableVibration">Disable Vibration</string>
|
<string name="DisableVibration">Disable Vibration</string>
|
||||||
|
<string name="IgnoreContentRestrictions">Ignore Content Restrictions</string>
|
||||||
|
<string name="IgnoreContentRestrictionsNotice">Ignores android restrictions on messages locally. This may be banned by the server in the future, and you will need to evaluate the local legality of this option yourself.</string>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@ -1,3 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
./gradlew TMessagesProj:publishFullRelease
|
./gradlew TMessagesProj:publishFullPlayRelease
|
@ -13,4 +13,5 @@ fi
|
|||||||
rm -rf build/release &&
|
rm -rf build/release &&
|
||||||
mkdir -p build/release &&
|
mkdir -p build/release &&
|
||||||
find TMessagesProj/build/outputs/apk -name "*.apk" -exec cp {} build/release \; &&
|
find TMessagesProj/build/outputs/apk -name "*.apk" -exec cp {} build/release \; &&
|
||||||
|
rm -f build/release/*-debug.apk &&
|
||||||
ghr -delete -n "$1" "$1" build/release
|
ghr -delete -n "$1" "$1" build/release
|
Loading…
Reference in New Issue
Block a user