mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-22 10:43:56 +00:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbe5142ca9 | ||
|
|
e74ffac5b0 | ||
|
|
cfb8980e3a | ||
|
|
e06e1bdcbe | ||
|
|
d60ced2f61 | ||
|
|
e68689828e | ||
|
|
ba932758c8 | ||
|
|
ee43fa6311 | ||
|
|
ad6b164d51 | ||
|
|
4a5510acb2 | ||
|
|
970dbc4428 | ||
|
|
f8f37325eb | ||
|
|
bb999019ef | ||
|
|
533b6a155a | ||
|
|
4cdc92388c | ||
|
|
ccc6be1e71 | ||
|
|
b355778a92 | ||
|
|
6a12e8f37a | ||
|
|
59adb91f5f | ||
|
|
53677e2f39 |
75
.releaserc
75
.releaserc
@@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"branches": [
|
|
||||||
"main",
|
|
||||||
{
|
|
||||||
"name": "dev",
|
|
||||||
"prerelease": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
"semantic-release-export-data",
|
|
||||||
"@semantic-release/commit-analyzer",
|
|
||||||
[
|
|
||||||
"@semantic-release/release-notes-generator",
|
|
||||||
{
|
|
||||||
"presetConfig": {
|
|
||||||
"types": [
|
|
||||||
{
|
|
||||||
"type": "build",
|
|
||||||
"section": "Dependency Updates"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "chore",
|
|
||||||
"section": "Other Changes",
|
|
||||||
"hidden": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "perf",
|
|
||||||
"section": "Performance Improvements",
|
|
||||||
"hidden": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "refactor",
|
|
||||||
"section": "Code Improvements",
|
|
||||||
"hidden": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@semantic-release/changelog",
|
|
||||||
"semantic-release-flutter-plugin",
|
|
||||||
[
|
|
||||||
"@semantic-release/git",
|
|
||||||
{
|
|
||||||
"assets": [
|
|
||||||
"CHANGELOG.md",
|
|
||||||
"pubspec.yaml"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"@semantic-release/github",
|
|
||||||
{
|
|
||||||
"assets": [
|
|
||||||
{
|
|
||||||
"path": "build/app/outputs/apk/release/revanced-manager-*.apk"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"successComment": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"@saithodev/semantic-release-backmerge",
|
|
||||||
{
|
|
||||||
"backmergeBranches": [
|
|
||||||
{
|
|
||||||
"from": "main",
|
|
||||||
"to": "dev"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"clearWorkspace": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"okButton": "OK",
|
"okButton": "OK",
|
||||||
"cancelButton": "Cancel",
|
"cancelButton": "Cancel",
|
||||||
|
"dismissButton": "Dismiss",
|
||||||
"quitButton": "Quit",
|
"quitButton": "Quit",
|
||||||
"updateButton": "Update",
|
"updateButton": "Update",
|
||||||
"enabledLabel": "Enabled",
|
"enabledLabel": "Enabled",
|
||||||
@@ -134,6 +135,7 @@
|
|||||||
"setRequiredOption": "Some patches require options to be set:\n\n{patches}\n\nPlease set them before continuing."
|
"setRequiredOption": "Some patches require options to be set:\n\n{patches}\n\nPlease set them before continuing."
|
||||||
},
|
},
|
||||||
"patchOptionsView": {
|
"patchOptionsView": {
|
||||||
|
"resetOptionsTooltip": "Reset patch options",
|
||||||
"viewTitle": "Patch options",
|
"viewTitle": "Patch options",
|
||||||
"saveOptions": "Save",
|
"saveOptions": "Save",
|
||||||
|
|
||||||
@@ -232,7 +234,7 @@
|
|||||||
"universalPatchesLabel": "Show universal patches",
|
"universalPatchesLabel": "Show universal patches",
|
||||||
"universalPatchesHint": "Display all apps and universal patches (may slow down the app list)",
|
"universalPatchesHint": "Display all apps and universal patches (may slow down the app list)",
|
||||||
"versionCompatibilityCheckLabel": "Version compatibility check",
|
"versionCompatibilityCheckLabel": "Version compatibility check",
|
||||||
"versionCompatibilityCheckHint": "Restricts patches to supported versions",
|
"versionCompatibilityCheckHint": "Restricts patches to supported app versions",
|
||||||
|
|
||||||
"aboutLabel": "About",
|
"aboutLabel": "About",
|
||||||
"snackbarMessage": "Copied to clipboard",
|
"snackbarMessage": "Copied to clipboard",
|
||||||
@@ -254,7 +256,7 @@
|
|||||||
"resetStoredPatchesLabel": "Reset patch selection",
|
"resetStoredPatchesLabel": "Reset patch selection",
|
||||||
"resetStoredPatchesHint": "Reset the stored patch selection",
|
"resetStoredPatchesHint": "Reset the stored patch selection",
|
||||||
"resetStoredPatchesDialogTitle": "Reset patch selection?",
|
"resetStoredPatchesDialogTitle": "Reset patch selection?",
|
||||||
"resetStoredPatchesDialogText": "The default selection of patches will be restored..",
|
"resetStoredPatchesDialogText": "The default selection of patches will be restored.",
|
||||||
"resetStoredPatches": "Patch selection has been reset",
|
"resetStoredPatches": "Patch selection has been reset",
|
||||||
|
|
||||||
"resetStoredOptionsLabel": "Reset patch options",
|
"resetStoredOptionsLabel": "Reset patch options",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:device_apps/device_apps.dart';
|
import 'package:device_apps/device_apps.dart';
|
||||||
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||||
@@ -33,6 +34,7 @@ class ManagerAPI {
|
|||||||
Patch? selectedPatch;
|
Patch? selectedPatch;
|
||||||
BuildContext? ctx;
|
BuildContext? ctx;
|
||||||
bool isRooted = false;
|
bool isRooted = false;
|
||||||
|
bool isDynamicThemeAvailable = false;
|
||||||
String storedPatchesFile = '/selected-patches.json';
|
String storedPatchesFile = '/selected-patches.json';
|
||||||
String keystoreFile =
|
String keystoreFile =
|
||||||
'/sdcard/Android/data/app.revanced.manager.flutter/files/revanced-manager.keystore';
|
'/sdcard/Android/data/app.revanced.manager.flutter/files/revanced-manager.keystore';
|
||||||
@@ -59,10 +61,16 @@ class ManagerAPI {
|
|||||||
Future<void> initialize() async {
|
Future<void> initialize() async {
|
||||||
_prefs = await SharedPreferences.getInstance();
|
_prefs = await SharedPreferences.getInstance();
|
||||||
isRooted = await _rootAPI.isRooted();
|
isRooted = await _rootAPI.isRooted();
|
||||||
|
isDynamicThemeAvailable = (await getSdkVersion()) >= 31; // ANDROID_12_SDK_VERSION = 31
|
||||||
storedPatchesFile =
|
storedPatchesFile =
|
||||||
(await getApplicationDocumentsDirectory()).path + storedPatchesFile;
|
(await getApplicationDocumentsDirectory()).path + storedPatchesFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<int> getSdkVersion() async {
|
||||||
|
final AndroidDeviceInfo info = await DeviceInfoPlugin().androidInfo;
|
||||||
|
return info.version.sdkInt;
|
||||||
|
}
|
||||||
|
|
||||||
String getApiUrl() {
|
String getApiUrl() {
|
||||||
return _prefs.getString('apiUrl') ?? defaultApiUrl;
|
return _prefs.getString('apiUrl') ?? defaultApiUrl;
|
||||||
}
|
}
|
||||||
@@ -71,7 +79,6 @@ class ManagerAPI {
|
|||||||
if (url.isEmpty || url == ' ') {
|
if (url.isEmpty || url == ' ') {
|
||||||
url = defaultApiUrl;
|
url = defaultApiUrl;
|
||||||
}
|
}
|
||||||
await _revancedAPI.initialize(url);
|
|
||||||
await _revancedAPI.clearAllCache();
|
await _revancedAPI.clearAllCache();
|
||||||
await _prefs.setString('apiUrl', url);
|
await _prefs.setString('apiUrl', url);
|
||||||
}
|
}
|
||||||
@@ -677,7 +684,7 @@ class ManagerAPI {
|
|||||||
Future<List<String>> getDefaultPatches() async {
|
Future<List<String>> getDefaultPatches() async {
|
||||||
final List<Patch> patches = await getPatches();
|
final List<Patch> patches = await getPatches();
|
||||||
final List<String> defaultPatches = [];
|
final List<String> defaultPatches = [];
|
||||||
if (isVersionCompatibilityCheckEnabled() == false) {
|
if (isVersionCompatibilityCheckEnabled() == true) {
|
||||||
defaultPatches.addAll(
|
defaultPatches.addAll(
|
||||||
patches
|
patches
|
||||||
.where(
|
.where(
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> runPatcher() async {
|
Future<void> runPatcher() async {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await _patcherAPI.runPatcher(
|
await _patcherAPI.runPatcher(
|
||||||
_app.packageName,
|
_app.packageName,
|
||||||
@@ -159,7 +158,7 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
|
|
||||||
// Necessary to reset the state of patches so that they
|
// Necessary to reset the state of patches so that they
|
||||||
// can be reloaded again.
|
// can be reloaded again.
|
||||||
_managerAPI.patches.clear();
|
_managerAPI.patches.clear();
|
||||||
await _patcherAPI.loadPatches();
|
await _patcherAPI.loadPatches();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -184,29 +183,28 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
final info = await AboutInfo.getInfo();
|
final info = await AboutInfo.getInfo();
|
||||||
|
|
||||||
final formattedLogs = [
|
final formattedLogs = [
|
||||||
'```',
|
'- Device Info',
|
||||||
'~ Device Info',
|
|
||||||
'ReVanced Manager: ${info['version']}',
|
'ReVanced Manager: ${info['version']}',
|
||||||
'Build: ${info['flavor']}',
|
'Build: ${info['flavor']}',
|
||||||
'Model: ${info['model']}',
|
'Model: ${info['model']}',
|
||||||
'Android version: ${info['androidVersion']}',
|
'Android version: ${info['androidVersion']}',
|
||||||
'Supported architectures: ${info['supportedArch'].join(", ")}',
|
'Supported architectures: ${info['supportedArch'].join(", ")}',
|
||||||
|
'Root permissions: ${isRooted ? 'Yes' : 'No'}',
|
||||||
'\n~ Patch Info',
|
|
||||||
|
'\n- Patch Info',
|
||||||
'App: ${_app.packageName} v${_app.version}',
|
'App: ${_app.packageName} v${_app.version}',
|
||||||
'Patches version: ${_managerAPI.patchesVersion}',
|
'Patches version: ${_managerAPI.patchesVersion}',
|
||||||
'Patches: ${_patches.map((p) => p.name).toList().join(", ")}',
|
'Patches: ${_patches.map((p) => p.name + (p.options.isEmpty ? '' : ' [${p.options.map((o) => '${o.title}: ${o.value}').join(", ")}]')).toList().join(", ")}',
|
||||||
|
|
||||||
'\n~ Settings',
|
'\n- Settings',
|
||||||
'Allow changing patch selection: ${_managerAPI.isPatchesChangeEnabled()}',
|
'Allow changing patch selection: ${_managerAPI.isPatchesChangeEnabled()}',
|
||||||
'Show universal patches: ${_managerAPI.areUniversalPatchesEnabled()}',
|
|
||||||
'Version compatibility check: ${_managerAPI.isVersionCompatibilityCheckEnabled()}',
|
'Version compatibility check: ${_managerAPI.isVersionCompatibilityCheckEnabled()}',
|
||||||
|
'Show universal patches: ${_managerAPI.areUniversalPatchesEnabled()}',
|
||||||
'Patches source: ${_managerAPI.getPatchesRepo()}',
|
'Patches source: ${_managerAPI.getPatchesRepo()}',
|
||||||
'Integration source: ${_managerAPI.getIntegrationsRepo()}',
|
'Integration source: ${_managerAPI.getIntegrationsRepo()}',
|
||||||
|
|
||||||
'\n~ Logs',
|
'\n- Logs',
|
||||||
logs,
|
logs,
|
||||||
'```',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
Clipboard.setData(ClipboardData(text: formattedLogs.join('\n')));
|
Clipboard.setData(ClipboardData(text: formattedLogs.join('\n')));
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ class PatchOptionsView extends StatelessWidget {
|
|||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.history,
|
Icons.history,
|
||||||
),
|
),
|
||||||
|
tooltip: FlutterI18n.translate(
|
||||||
|
context,
|
||||||
|
'patchOptionsView.resetOptionsTooltip',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ class PatchOptionsViewModel extends BaseViewModel {
|
|||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
CustomMaterialButton(
|
CustomMaterialButton(
|
||||||
label: I18nText('okButton'),
|
label: I18nText('cancelButton'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
@@ -165,7 +165,7 @@ class PatchOptionsViewModel extends BaseViewModel {
|
|||||||
.map((e) {
|
.map((e) {
|
||||||
return CustomCard(
|
return CustomCard(
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
addOption(e);
|
addOption(e);
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
@@ -186,9 +186,9 @@ class PatchOptionsViewModel extends BaseViewModel {
|
|||||||
e.description,
|
e.description,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: Theme.of(context).colorScheme.onSecondaryContainer,
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -80,7 +80,8 @@ class PatcherViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool checkRequiredPatchOption(BuildContext context) {
|
bool checkRequiredPatchOption(BuildContext context) {
|
||||||
if (getNullRequiredOptions(selectedPatches, selectedApp!.packageName).isNotEmpty) {
|
if (getNullRequiredOptions(selectedPatches, selectedApp!.packageName)
|
||||||
|
.isNotEmpty) {
|
||||||
showRequiredOptionDialog(context);
|
showRequiredOptionDialog(context);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -190,7 +191,7 @@ class PatcherViewModel extends BaseViewModel {
|
|||||||
this.selectedPatches.clear();
|
this.selectedPatches.clear();
|
||||||
this.selectedPatches.addAll(patches.where((patch) => !patch.excluded));
|
this.selectedPatches.addAll(patches.where((patch) => !patch.excluded));
|
||||||
}
|
}
|
||||||
if (!_managerAPI.isVersionCompatibilityCheckEnabled()) {
|
if (_managerAPI.isVersionCompatibilityCheckEnabled()) {
|
||||||
this.selectedPatches.removeWhere((patch) => !isPatchSupported(patch));
|
this.selectedPatches.removeWhere((patch) => !isPatchSupported(patch));
|
||||||
}
|
}
|
||||||
if (!_managerAPI.areUniversalPatchesEnabled()) {
|
if (!_managerAPI.areUniversalPatchesEnabled()) {
|
||||||
@@ -199,11 +200,12 @@ class PatcherViewModel extends BaseViewModel {
|
|||||||
.removeWhere((patch) => patch.compatiblePackages.isEmpty);
|
.removeWhere((patch) => patch.compatiblePackages.isEmpty);
|
||||||
}
|
}
|
||||||
final usedPatches = _managerAPI.getUsedPatches(selectedApp!.packageName);
|
final usedPatches = _managerAPI.getUsedPatches(selectedApp!.packageName);
|
||||||
for (final patch in usedPatches){
|
for (final patch in usedPatches) {
|
||||||
if (!patches.any((p) => p.name == patch.name)){
|
if (!patches.any((p) => p.name == patch.name)) {
|
||||||
removedPatches.add('• ${patch.name}');
|
removedPatches.add('• ${patch.name}');
|
||||||
for (final option in patch.options) {
|
for (final option in patch.options) {
|
||||||
_managerAPI.clearPatchOption(selectedApp!.packageName, patch.name, option.key);
|
_managerAPI.clearPatchOption(
|
||||||
|
selectedApp!.packageName, patch.name, option.key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
.where(
|
.where(
|
||||||
(element) =>
|
(element) =>
|
||||||
!element.excluded &&
|
!element.excluded &&
|
||||||
(_managerAPI.isVersionCompatibilityCheckEnabled() ||
|
(!_managerAPI.isVersionCompatibilityCheckEnabled() ||
|
||||||
isPatchSupported(element)),
|
isPatchSupported(element)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -209,7 +209,10 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
query.isEmpty ||
|
query.isEmpty ||
|
||||||
query.length < 2 ||
|
query.length < 2 ||
|
||||||
patch.name.toLowerCase().contains(query.toLowerCase()) ||
|
patch.name.toLowerCase().contains(query.toLowerCase()) ||
|
||||||
patch.name.replaceAll(RegExp(r'[^\w\s]+'), '').toLowerCase().contains(query.toLowerCase()),
|
patch.name
|
||||||
|
.replaceAll(RegExp(r'[^\w\s]+'), '')
|
||||||
|
.toLowerCase()
|
||||||
|
.contains(query.toLowerCase()),
|
||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
if (_managerAPI.areUniversalPatchesEnabled()) {
|
if (_managerAPI.areUniversalPatchesEnabled()) {
|
||||||
@@ -281,7 +284,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
this.selectedPatches.addAll(
|
this.selectedPatches.addAll(
|
||||||
patches.where((patch) => selectedPatches.contains(patch.name)),
|
patches.where((patch) => selectedPatches.contains(patch.name)),
|
||||||
);
|
);
|
||||||
if (!_managerAPI.isVersionCompatibilityCheckEnabled()) {
|
if (_managerAPI.isVersionCompatibilityCheckEnabled()) {
|
||||||
this.selectedPatches.removeWhere((patch) => !isPatchSupported(patch));
|
this.selectedPatches.removeWhere((patch) => !isPatchSupported(patch));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class SManageApiUrl extends BaseViewModel {
|
|||||||
apiUrl = 'https://$apiUrl';
|
apiUrl = 'https://$apiUrl';
|
||||||
}
|
}
|
||||||
_managerAPI.setApiUrl(apiUrl);
|
_managerAPI.setApiUrl(apiUrl);
|
||||||
|
_toast.showBottom('settingsView.restartAppForChanges');
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -6,46 +6,98 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||||
import 'package:revanced_manager/app/app.locator.dart';
|
import 'package:revanced_manager/app/app.locator.dart';
|
||||||
import 'package:revanced_manager/services/manager_api.dart';
|
import 'package:revanced_manager/services/manager_api.dart';
|
||||||
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
|
|
||||||
import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart';
|
import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
|
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
|
||||||
|
|
||||||
final _settingViewModel = SettingsViewModel();
|
class SUpdateThemeUI extends StatefulWidget {
|
||||||
|
const SUpdateThemeUI({super.key});
|
||||||
|
|
||||||
// ignore: constant_identifier_names
|
@override
|
||||||
const int ANDROID_12_SDK_VERSION = 31;
|
State<SUpdateThemeUI> createState() => _SUpdateThemeUIState();
|
||||||
|
}
|
||||||
|
|
||||||
class SUpdateTheme extends BaseViewModel {
|
class _SUpdateThemeUIState extends State<SUpdateThemeUI> {
|
||||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
final ManagerAPI managerAPI = locator<ManagerAPI>();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SettingsSection(
|
||||||
|
title: 'settingsView.appearanceSectionTitle',
|
||||||
|
children: <Widget>[
|
||||||
|
ListTile(
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
|
title: I18nText(
|
||||||
|
'settingsView.themeModeLabel',
|
||||||
|
child: const Text(
|
||||||
|
'',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
trailing: CustomMaterialButton(
|
||||||
|
label: getThemeModeName(),
|
||||||
|
onPressed: () => {showThemeDialog(context)},
|
||||||
|
),
|
||||||
|
onTap: () => {showThemeDialog(context)},
|
||||||
|
),
|
||||||
|
if (managerAPI.isDynamicThemeAvailable)
|
||||||
|
SwitchListTile(
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
|
||||||
|
title: I18nText(
|
||||||
|
'settingsView.dynamicThemeLabel',
|
||||||
|
child: const Text(
|
||||||
|
'',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: I18nText('settingsView.dynamicThemeHint'),
|
||||||
|
value: getDynamicThemeStatus(),
|
||||||
|
onChanged: (value) => {
|
||||||
|
setUseDynamicTheme(
|
||||||
|
context,
|
||||||
|
value,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
bool getDynamicThemeStatus() {
|
bool getDynamicThemeStatus() {
|
||||||
return _managerAPI.getUseDynamicTheme();
|
return managerAPI.getUseDynamicTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setUseDynamicTheme(BuildContext context, bool value) async {
|
Future<void> setUseDynamicTheme(BuildContext context, bool value) async {
|
||||||
await _managerAPI.setUseDynamicTheme(value);
|
await managerAPI.setUseDynamicTheme(value);
|
||||||
final int currentTheme = (DynamicTheme.of(context)!.themeId ~/ 2) * 2;
|
final int currentTheme = (DynamicTheme.of(context)!.themeId ~/ 2) * 2;
|
||||||
await DynamicTheme.of(context)!.setTheme(currentTheme + (value ? 1 : 0));
|
await DynamicTheme.of(context)!.setTheme(currentTheme + (value ? 1 : 0));
|
||||||
notifyListeners();
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
int getThemeMode() {
|
int getThemeMode() {
|
||||||
return _managerAPI.getThemeMode();
|
return managerAPI.getThemeMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setThemeMode(BuildContext context, int value) async {
|
Future<void> setThemeMode(BuildContext context, int value) async {
|
||||||
await _managerAPI.setThemeMode(value);
|
await managerAPI.setThemeMode(value);
|
||||||
final bool isDynamicTheme = DynamicTheme.of(context)!.themeId.isEven;
|
final bool isDynamicTheme = DynamicTheme.of(context)!.themeId.isEven;
|
||||||
await DynamicTheme.of(context)!.setTheme(value * 2 + (isDynamicTheme ? 0 : 1));
|
await DynamicTheme.of(context)!
|
||||||
final bool isLight = value != 2 && (value == 1 || DynamicTheme.of(context)!.theme.brightness == Brightness.light);
|
.setTheme(value * 2 + (isDynamicTheme ? 0 : 1));
|
||||||
|
final bool isLight = value != 2 &&
|
||||||
|
(value == 1 ||
|
||||||
|
DynamicTheme.of(context)!.theme.brightness == Brightness.light);
|
||||||
SystemChrome.setSystemUIOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(
|
||||||
SystemUiOverlayStyle(
|
SystemUiOverlayStyle(
|
||||||
systemNavigationBarIconBrightness:
|
systemNavigationBarIconBrightness:
|
||||||
isLight ? Brightness.dark : Brightness.light,
|
isLight ? Brightness.dark : Brightness.light,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
notifyListeners();
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
I18nText getThemeModeName() {
|
I18nText getThemeModeName() {
|
||||||
@@ -131,63 +183,3 @@ class SUpdateTheme extends BaseViewModel {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final sUpdateTheme = SUpdateTheme();
|
|
||||||
class SUpdateThemeUI extends StatelessWidget {
|
|
||||||
const SUpdateThemeUI({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return SettingsSection(
|
|
||||||
title: 'settingsView.appearanceSectionTitle',
|
|
||||||
children: <Widget>[
|
|
||||||
ListTile(
|
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
|
|
||||||
title: I18nText(
|
|
||||||
'settingsView.themeModeLabel',
|
|
||||||
child: const Text(
|
|
||||||
'',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
trailing: CustomMaterialButton(
|
|
||||||
label: sUpdateTheme.getThemeModeName(),
|
|
||||||
onPressed: () => { sUpdateTheme.showThemeDialog(context) },
|
|
||||||
),
|
|
||||||
onTap: () => { sUpdateTheme.showThemeDialog(context) },
|
|
||||||
),
|
|
||||||
FutureBuilder<int>(
|
|
||||||
future: _settingViewModel.getSdkVersion(),
|
|
||||||
builder: (context, snapshot) => Visibility(
|
|
||||||
visible:
|
|
||||||
snapshot.hasData && snapshot.data! >= ANDROID_12_SDK_VERSION,
|
|
||||||
child: SwitchListTile(
|
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 20.0),
|
|
||||||
title: I18nText(
|
|
||||||
'settingsView.dynamicThemeLabel',
|
|
||||||
child: const Text(
|
|
||||||
'',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
subtitle: I18nText('settingsView.dynamicThemeHint'),
|
|
||||||
value: _settingViewModel.sUpdateTheme.getDynamicThemeStatus(),
|
|
||||||
onChanged: (value) => {
|
|
||||||
_settingViewModel.sUpdateTheme.setUseDynamicTheme(
|
|
||||||
context,
|
|
||||||
value,
|
|
||||||
),
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:cr_file_saver/file_saver.dart';
|
import 'package:cr_file_saver/file_saver.dart';
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
|
||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -14,7 +13,6 @@ import 'package:revanced_manager/services/toast.dart';
|
|||||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_update_language.dart';
|
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_update_language.dart';
|
||||||
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_update_theme.dart';
|
|
||||||
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
|
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
|
||||||
import 'package:share_extend/share_extend.dart';
|
import 'package:share_extend/share_extend.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
@@ -29,7 +27,6 @@ class SettingsViewModel extends BaseViewModel {
|
|||||||
final Toast _toast = locator<Toast>();
|
final Toast _toast = locator<Toast>();
|
||||||
|
|
||||||
final SUpdateLanguage sUpdateLanguage = SUpdateLanguage();
|
final SUpdateLanguage sUpdateLanguage = SUpdateLanguage();
|
||||||
final SUpdateTheme sUpdateTheme = SUpdateTheme();
|
|
||||||
|
|
||||||
void navigateToContributors() {
|
void navigateToContributors() {
|
||||||
_navigationService.navigateTo(Routes.contributorsView);
|
_navigationService.navigateTo(Routes.contributorsView);
|
||||||
@@ -256,11 +253,6 @@ class SettingsViewModel extends BaseViewModel {
|
|||||||
_toast.showBottom('settingsView.resetStoredPatches');
|
_toast.showBottom('settingsView.resetStoredPatches');
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> getSdkVersion() async {
|
|
||||||
final AndroidDeviceInfo info = await DeviceInfoPlugin().androidInfo;
|
|
||||||
return info.version.sdkInt;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> deleteLogs() async {
|
Future<void> deleteLogs() async {
|
||||||
final Directory appCacheDir = await getTemporaryDirectory();
|
final Directory appCacheDir = await getTemporaryDirectory();
|
||||||
final Directory logsDir = Directory('${appCacheDir.path}/logs');
|
final Directory logsDir = Directory('${appCacheDir.path}/logs');
|
||||||
|
|||||||
@@ -48,12 +48,13 @@ class _PatchItemState extends State<PatchItem> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
widget.isSelected = widget.isSelected &&
|
widget.isSelected = widget.isSelected &&
|
||||||
(!widget.isUnsupported ||
|
(!widget.isUnsupported ||
|
||||||
widget._managerAPI.isVersionCompatibilityCheckEnabled()) && !widget.hasUnsupportedPatchOption;
|
!widget._managerAPI.isVersionCompatibilityCheckEnabled()) &&
|
||||||
|
!widget.hasUnsupportedPatchOption;
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||||
child: Opacity(
|
child: Opacity(
|
||||||
opacity: widget.isUnsupported &&
|
opacity: widget.isUnsupported &&
|
||||||
widget._managerAPI.isVersionCompatibilityCheckEnabled() == false
|
widget._managerAPI.isVersionCompatibilityCheckEnabled() == true
|
||||||
? 0.5
|
? 0.5
|
||||||
: 1,
|
: 1,
|
||||||
child: CustomCard(
|
child: CustomCard(
|
||||||
@@ -65,7 +66,7 @@ class _PatchItemState extends State<PatchItem> {
|
|||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (widget.isUnsupported &&
|
if (widget.isUnsupported &&
|
||||||
!widget._managerAPI.isVersionCompatibilityCheckEnabled()) {
|
widget._managerAPI.isVersionCompatibilityCheckEnabled()) {
|
||||||
widget.isSelected = false;
|
widget.isSelected = false;
|
||||||
widget.toast.showBottom('patchItem.unsupportedPatchVersion');
|
widget.toast.showBottom('patchItem.unsupportedPatchVersion');
|
||||||
} else if (widget.isChangeEnabled) {
|
} else if (widget.isChangeEnabled) {
|
||||||
@@ -79,7 +80,7 @@ class _PatchItemState extends State<PatchItem> {
|
|||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
if (!widget.isUnsupported ||
|
if (!widget.isUnsupported ||
|
||||||
widget._managerAPI.isVersionCompatibilityCheckEnabled()) {
|
!widget._managerAPI.isVersionCompatibilityCheckEnabled()) {
|
||||||
widget.onChanged(widget.isSelected);
|
widget.onChanged(widget.isSelected);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -98,7 +99,8 @@ class _PatchItemState extends State<PatchItem> {
|
|||||||
),
|
),
|
||||||
onChanged: (newValue) {
|
onChanged: (newValue) {
|
||||||
if (widget.isUnsupported &&
|
if (widget.isUnsupported &&
|
||||||
!widget._managerAPI.isVersionCompatibilityCheckEnabled()) {
|
widget._managerAPI
|
||||||
|
.isVersionCompatibilityCheckEnabled()) {
|
||||||
widget.isSelected = false;
|
widget.isSelected = false;
|
||||||
widget.toast.showBottom(
|
widget.toast.showBottom(
|
||||||
'patchItem.unsupportedPatchVersion',
|
'patchItem.unsupportedPatchVersion',
|
||||||
@@ -114,7 +116,8 @@ class _PatchItemState extends State<PatchItem> {
|
|||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
if (!widget.isUnsupported ||
|
if (!widget.isUnsupported ||
|
||||||
widget._managerAPI.isVersionCompatibilityCheckEnabled()) {
|
!widget._managerAPI
|
||||||
|
.isVersionCompatibilityCheckEnabled()) {
|
||||||
widget.onChanged(widget.isSelected);
|
widget.onChanged(widget.isSelected);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -154,7 +157,7 @@ class _PatchItemState extends State<PatchItem> {
|
|||||||
runSpacing: 4,
|
runSpacing: 4,
|
||||||
children: [
|
children: [
|
||||||
if (widget.isUnsupported &&
|
if (widget.isUnsupported &&
|
||||||
widget._managerAPI
|
!widget._managerAPI
|
||||||
.isVersionCompatibilityCheckEnabled())
|
.isVersionCompatibilityCheckEnabled())
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8),
|
padding: const EdgeInsets.only(top: 8),
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ class SocialMediaWidget extends StatelessWidget {
|
|||||||
SocialMediaItem(
|
SocialMediaItem(
|
||||||
icon: FaIcon(FontAwesomeIcons.github),
|
icon: FaIcon(FontAwesomeIcons.github),
|
||||||
title: Text('GitHub'),
|
title: Text('GitHub'),
|
||||||
subtitle: Text('github.com/revanced'),
|
subtitle: Text('github.com/ReVanced'),
|
||||||
url: 'https://github.com/revanced',
|
url: 'https://github.com/ReVanced',
|
||||||
),
|
),
|
||||||
SocialMediaItem(
|
SocialMediaItem(
|
||||||
icon: FaIcon(FontAwesomeIcons.discord),
|
icon: FaIcon(FontAwesomeIcons.discord),
|
||||||
@@ -74,10 +74,10 @@ class SocialMediaWidget extends StatelessWidget {
|
|||||||
url: 'https://reddit.com/r/revancedapp',
|
url: 'https://reddit.com/r/revancedapp',
|
||||||
),
|
),
|
||||||
SocialMediaItem(
|
SocialMediaItem(
|
||||||
icon: FaIcon(FontAwesomeIcons.twitter),
|
icon: FaIcon(FontAwesomeIcons.xTwitter),
|
||||||
title: Text('Twitter'),
|
title: Text('X'),
|
||||||
subtitle: Text('@revancedapp'),
|
subtitle: Text('@revancedapp'),
|
||||||
url: 'https://twitter.com/revancedapp',
|
url: 'https://x.com/revancedapp',
|
||||||
),
|
),
|
||||||
SocialMediaItem(
|
SocialMediaItem(
|
||||||
icon: FaIcon(FontAwesomeIcons.youtube),
|
icon: FaIcon(FontAwesomeIcons.youtube),
|
||||||
|
|||||||
7179
package-lock.json
generated
7179
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"devDependencies": {
|
|
||||||
"@saithodev/semantic-release-backmerge": "^3.1.0",
|
|
||||||
"@semantic-release/changelog": "^6.0.3",
|
|
||||||
"@semantic-release/git": "^10.0.1",
|
|
||||||
"semantic-release": "^21.0.1",
|
|
||||||
"semantic-release-export-data": "^1.0.1",
|
|
||||||
"semantic-release-flutter-plugin": "^1.1.2"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
|
|||||||
|
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 1.13.0+101300000
|
version: 1.14.2+101400200
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.0 <4.0.0'
|
sdk: '>=3.0.0 <4.0.0'
|
||||||
@@ -41,7 +41,7 @@ dependencies:
|
|||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_svg: ^2.0.4
|
flutter_svg: ^2.0.4
|
||||||
fluttertoast: ^8.2.1
|
fluttertoast: ^8.2.1
|
||||||
font_awesome_flutter: ^10.4.0
|
font_awesome_flutter: ^10.6.0
|
||||||
get_it: 7.2.0
|
get_it: 7.2.0
|
||||||
google_fonts: ^4.0.3
|
google_fonts: ^4.0.3
|
||||||
http: ^0.13.5
|
http: ^0.13.5
|
||||||
|
|||||||
Reference in New Issue
Block a user