feat: Fake High Performance Device

This commit is contained in:
xtaodada 2022-10-21 23:08:31 +08:00
parent 81d63a1dd9
commit 8992ffbe39
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
5 changed files with 14 additions and 1 deletions

View File

@ -67,6 +67,7 @@ import tw.nekomimi.nekogram.utils.AlertUtil;
import tw.nekomimi.nekogram.utils.EnvUtil;
import tw.nekomimi.nekogram.utils.FileUtil;
import tw.nekomimi.nekogram.utils.UIUtil;
import xyz.nextalone.nagram.NaConfig;
import static com.v2ray.ang.V2RayConfig.SSR_PROTOCOL;
import static com.v2ray.ang.V2RayConfig.SS_PROTOCOL;
@ -2385,6 +2386,9 @@ public class SharedConfig {
FileLog.d("device performance info selected_class = " + devicePerformanceClass + " (cpu_count = " + cpuCount + ", freq = " + maxCpuFreq + ", memoryClass = " + memoryClass + ", android version " + androidVersion + ", manufacture " + Build.MANUFACTURER + ")");
}
}
if (NaConfig.INSTANCE.getFakeHighPerformanceDevice().Bool()) {
devicePerformanceClass = PERFORMANCE_CLASS_HIGH;
}
return devicePerformanceClass;
}

View File

@ -97,6 +97,7 @@ public class NekoExperimentalSettingsActivity extends BaseFragment {
private final AbstractConfigCell audioEnhanceRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getNoiseSuppressAndVoiceEnhance()));
private final AbstractConfigCell showRPCErrorRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getShowRPCError()));
private final AbstractConfigCell customArtworkApiRow = cellGroup.appendCell(new ConfigCellTextInput(null, NaConfig.INSTANCE.getCustomArtworkApi(), "", null));
private final AbstractConfigCell fakeHighPerformanceDeviceRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getFakeHighPerformanceDevice()));
private final AbstractConfigCell divider1 = cellGroup.appendCell(new ConfigCellDivider());
private UndoView tooltip;

View File

@ -334,6 +334,12 @@ object NaConfig {
ConfigItem.configTypeBool,
false
)
val fakeHighPerformanceDevice =
addConfig(
"FakeHighPerformanceDevice",
ConfigItem.configTypeBool,
false
)
private fun addConfig(
k: String,

View File

@ -66,5 +66,6 @@
<string name="CustomPoor">自定义长按快捷回复词</string>
<string name="CustomPoorHint">默认破烂</string>
<string name="CustomEditedMessage">自定义已编辑消息提示词</string>
<string name="HidePremiumOnlyChannel">隐藏大会员皮套</string>
<string name="HidePremiumOnlyChannel">切换皮套隐藏大会员专享</string>
<string name="FakeHighPerformanceDevice">伪装高性能设备</string>
</resources>

View File

@ -68,4 +68,5 @@
<string name="CustomPoorHint">Default pool</string>
<string name="CustomEditedMessage">Custom Edited Message word</string>
<string name="HidePremiumOnlyChannel">Hide Premium Only Channel</string>
<string name="FakeHighPerformanceDevice">Fake High Performance Device</string>
</resources>