AppVerHook

This commit is contained in:
gdlbo
2022-10-26 10:11:24 +03:00
parent d372b670c0
commit fa2a1b083d
4 changed files with 17 additions and 7 deletions
@@ -1,13 +1,15 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import b.h.g.g.BuildInfo;
public class AppVerHook {
public static String appBuild() {
return String.valueOf(BuildInfo.i.e());
public static int appBuild() {
return getBoolValue("useOldAppVer", false) ? 6561 : BuildInfo.i.e();
}
public static String appVer() {
return BuildInfo.i.d(); // 7.26
return getBoolValue("useOldAppVer", false) ? "6.18.1" : BuildInfo.i.d();
}
}
@@ -251,7 +251,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment {
return true;
});
if (dev()) {
if (dev() && isValidSignature()) {
addMaterialSwitchPreference(this, "autoupdates", requireContext().getString(R.string.checkupdates), "", R.drawable.ic_camera_switch_outline_24, true, (preference, o) -> {
boolean value = (boolean) o;
edit().putBoolean("autoupdates", value).commit();