mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
refactor: Disable update for dev build (#1662)
This commit is contained in:
parent
edc8ef4f44
commit
c900d09cf8
@ -36,6 +36,7 @@ class ManagerAPI {
|
|||||||
Patch? selectedPatch;
|
Patch? selectedPatch;
|
||||||
BuildContext? ctx;
|
BuildContext? ctx;
|
||||||
bool isRooted = false;
|
bool isRooted = false;
|
||||||
|
bool releaseBuild = false;
|
||||||
bool suggestedAppVersionSelected = true;
|
bool suggestedAppVersionSelected = true;
|
||||||
bool isDynamicThemeAvailable = false;
|
bool isDynamicThemeAvailable = false;
|
||||||
String storedPatchesFile = '/selected-patches.json';
|
String storedPatchesFile = '/selected-patches.json';
|
||||||
@ -68,6 +69,9 @@ class ManagerAPI {
|
|||||||
(await getSdkVersion()) >= 31; // ANDROID_12_SDK_VERSION = 31
|
(await getSdkVersion()) >= 31; // ANDROID_12_SDK_VERSION = 31
|
||||||
storedPatchesFile =
|
storedPatchesFile =
|
||||||
(await getApplicationDocumentsDirectory()).path + storedPatchesFile;
|
(await getApplicationDocumentsDirectory()).path + storedPatchesFile;
|
||||||
|
if (kReleaseMode) {
|
||||||
|
releaseBuild = !(await getCurrentManagerVersion()).contains('-dev');
|
||||||
|
}
|
||||||
|
|
||||||
// Migrate to new API URL if not done yet as the old one is sunset.
|
// Migrate to new API URL if not done yet as the old one is sunset.
|
||||||
final bool hasMigrated = _prefs.getBool('migratedToNewApiUrl') ?? false;
|
final bool hasMigrated = _prefs.getBool('migratedToNewApiUrl') ?? false;
|
||||||
|
@ -34,6 +34,7 @@ class HomeViewModel extends BaseViewModel {
|
|||||||
final Toast _toast = locator<Toast>();
|
final Toast _toast = locator<Toast>();
|
||||||
final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
final flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
|
||||||
bool showUpdatableApps = false;
|
bool showUpdatableApps = false;
|
||||||
|
bool releaseBuild = false;
|
||||||
List<PatchedApplication> patchedInstalledApps = [];
|
List<PatchedApplication> patchedInstalledApps = [];
|
||||||
String _currentManagerVersion = '';
|
String _currentManagerVersion = '';
|
||||||
String _currentPatchesVersion = '';
|
String _currentPatchesVersion = '';
|
||||||
@ -127,6 +128,9 @@ class HomeViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> hasManagerUpdates() async {
|
Future<bool> hasManagerUpdates() async {
|
||||||
|
if (!_managerAPI.releaseBuild) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
_latestManagerVersion =
|
_latestManagerVersion =
|
||||||
await _managerAPI.getLatestManagerVersion() ?? _currentManagerVersion;
|
await _managerAPI.getLatestManagerVersion() ?? _currentManagerVersion;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user