mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-18 23:16:50 +08:00
Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
e06e1bdcbe | |||
d60ced2f61 | |||
e68689828e | |||
ba932758c8 | |||
ee43fa6311 | |||
ad6b164d51 | |||
4a5510acb2 | |||
970dbc4428 | |||
f8f37325eb | |||
bb999019ef | |||
533b6a155a | |||
4cdc92388c | |||
ccc6be1e71 | |||
b355778a92 |
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",
|
||||
"cancelButton": "Cancel",
|
||||
"dismissButton": "Dismiss",
|
||||
"quitButton": "Quit",
|
||||
"updateButton": "Update",
|
||||
"enabledLabel": "Enabled",
|
||||
@ -134,6 +135,7 @@
|
||||
"setRequiredOption": "Some patches require options to be set:\n\n{patches}\n\nPlease set them before continuing."
|
||||
},
|
||||
"patchOptionsView": {
|
||||
"resetOptionsTooltip": "Reset patch options",
|
||||
"viewTitle": "Patch options",
|
||||
"saveOptions": "Save",
|
||||
|
||||
@ -232,7 +234,7 @@
|
||||
"universalPatchesLabel": "Show universal patches",
|
||||
"universalPatchesHint": "Display all apps and universal patches (may slow down the app list)",
|
||||
"versionCompatibilityCheckLabel": "Version compatibility check",
|
||||
"versionCompatibilityCheckHint": "Restricts patches to supported versions",
|
||||
"versionCompatibilityCheckHint": "Restricts patches to supported app versions",
|
||||
|
||||
"aboutLabel": "About",
|
||||
"snackbarMessage": "Copied to clipboard",
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'package:device_apps/device_apps.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
@ -33,6 +34,7 @@ class ManagerAPI {
|
||||
Patch? selectedPatch;
|
||||
BuildContext? ctx;
|
||||
bool isRooted = false;
|
||||
bool isDynamicThemeAvailable = false;
|
||||
String storedPatchesFile = '/selected-patches.json';
|
||||
String keystoreFile =
|
||||
'/sdcard/Android/data/app.revanced.manager.flutter/files/revanced-manager.keystore';
|
||||
@ -59,10 +61,16 @@ class ManagerAPI {
|
||||
Future<void> initialize() async {
|
||||
_prefs = await SharedPreferences.getInstance();
|
||||
isRooted = await _rootAPI.isRooted();
|
||||
isDynamicThemeAvailable = (await getSdkVersion()) >= 31; // ANDROID_12_SDK_VERSION = 31
|
||||
storedPatchesFile =
|
||||
(await getApplicationDocumentsDirectory()).path + storedPatchesFile;
|
||||
}
|
||||
|
||||
Future<int> getSdkVersion() async {
|
||||
final AndroidDeviceInfo info = await DeviceInfoPlugin().androidInfo;
|
||||
return info.version.sdkInt;
|
||||
}
|
||||
|
||||
String getApiUrl() {
|
||||
return _prefs.getString('apiUrl') ?? defaultApiUrl;
|
||||
}
|
||||
|
@ -139,7 +139,6 @@ class InstallerViewModel extends BaseViewModel {
|
||||
}
|
||||
|
||||
Future<void> runPatcher() async {
|
||||
|
||||
try {
|
||||
await _patcherAPI.runPatcher(
|
||||
_app.packageName,
|
||||
@ -159,7 +158,7 @@ class InstallerViewModel extends BaseViewModel {
|
||||
|
||||
// Necessary to reset the state of patches so that they
|
||||
// can be reloaded again.
|
||||
_managerAPI.patches.clear();
|
||||
_managerAPI.patches.clear();
|
||||
await _patcherAPI.loadPatches();
|
||||
|
||||
try {
|
||||
@ -184,29 +183,28 @@ class InstallerViewModel extends BaseViewModel {
|
||||
final info = await AboutInfo.getInfo();
|
||||
|
||||
final formattedLogs = [
|
||||
'```',
|
||||
'~ Device Info',
|
||||
'- Device Info',
|
||||
'ReVanced Manager: ${info['version']}',
|
||||
'Build: ${info['flavor']}',
|
||||
'Model: ${info['model']}',
|
||||
'Android version: ${info['androidVersion']}',
|
||||
'Supported architectures: ${info['supportedArch'].join(", ")}',
|
||||
|
||||
'\n~ Patch Info',
|
||||
'Root permissions: ${isRooted ? 'Yes' : 'No'}',
|
||||
|
||||
'\n- Patch Info',
|
||||
'App: ${_app.packageName} v${_app.version}',
|
||||
'Patches version: ${_managerAPI.patchesVersion}',
|
||||
'Patches: ${_patches.map((p) => p.name).toList().join(", ")}',
|
||||
|
||||
'\n~ Settings',
|
||||
'Patches: ${_patches.map((p) => p.name + (p.options.isEmpty ? '' : ' [${p.options.map((o) => '${o.title}: ${o.value}').join(", ")}]')).toList().join(", ")}',
|
||||
|
||||
'\n- Settings',
|
||||
'Allow changing patch selection: ${_managerAPI.isPatchesChangeEnabled()}',
|
||||
'Show universal patches: ${_managerAPI.areUniversalPatchesEnabled()}',
|
||||
'Version compatibility check: ${_managerAPI.isVersionCompatibilityCheckEnabled()}',
|
||||
'Show universal patches: ${_managerAPI.areUniversalPatchesEnabled()}',
|
||||
'Patches source: ${_managerAPI.getPatchesRepo()}',
|
||||
'Integration source: ${_managerAPI.getIntegrationsRepo()}',
|
||||
|
||||
'\n~ Logs',
|
||||
|
||||
'\n- Logs',
|
||||
logs,
|
||||
'```',
|
||||
];
|
||||
|
||||
Clipboard.setData(ClipboardData(text: formattedLogs.join('\n')));
|
||||
|
@ -48,6 +48,10 @@ class PatchOptionsView extends StatelessWidget {
|
||||
icon: const Icon(
|
||||
Icons.history,
|
||||
),
|
||||
tooltip: FlutterI18n.translate(
|
||||
context,
|
||||
'patchOptionsView.resetOptionsTooltip',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -147,7 +147,7 @@ class PatchOptionsViewModel extends BaseViewModel {
|
||||
),
|
||||
actions: [
|
||||
CustomMaterialButton(
|
||||
label: I18nText('okButton'),
|
||||
label: I18nText('cancelButton'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
@ -165,7 +165,7 @@ class PatchOptionsViewModel extends BaseViewModel {
|
||||
.map((e) {
|
||||
return CustomCard(
|
||||
padding: const EdgeInsets.all(4),
|
||||
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||
backgroundColor: Theme.of(context).colorScheme.surface,
|
||||
onTap: () {
|
||||
addOption(e);
|
||||
Navigator.pop(context);
|
||||
@ -186,9 +186,9 @@ class PatchOptionsViewModel extends BaseViewModel {
|
||||
e.description,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context).colorScheme.onSecondaryContainer,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -6,46 +6,98 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_i18n/widgets/I18nText.dart';
|
||||
import 'package:revanced_manager/app/app.locator.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/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
|
||||
const int ANDROID_12_SDK_VERSION = 31;
|
||||
@override
|
||||
State<SUpdateThemeUI> createState() => _SUpdateThemeUIState();
|
||||
}
|
||||
|
||||
class SUpdateTheme extends BaseViewModel {
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
class _SUpdateThemeUIState extends State<SUpdateThemeUI> {
|
||||
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() {
|
||||
return _managerAPI.getUseDynamicTheme();
|
||||
return managerAPI.getUseDynamicTheme();
|
||||
}
|
||||
|
||||
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;
|
||||
await DynamicTheme.of(context)!.setTheme(currentTheme + (value ? 1 : 0));
|
||||
notifyListeners();
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
int getThemeMode() {
|
||||
return _managerAPI.getThemeMode();
|
||||
return managerAPI.getThemeMode();
|
||||
}
|
||||
|
||||
Future<void> setThemeMode(BuildContext context, int value) async {
|
||||
await _managerAPI.setThemeMode(value);
|
||||
await managerAPI.setThemeMode(value);
|
||||
final bool isDynamicTheme = DynamicTheme.of(context)!.themeId.isEven;
|
||||
await DynamicTheme.of(context)!.setTheme(value * 2 + (isDynamicTheme ? 0 : 1));
|
||||
final bool isLight = value != 2 && (value == 1 || DynamicTheme.of(context)!.theme.brightness == Brightness.light);
|
||||
await DynamicTheme.of(context)!
|
||||
.setTheme(value * 2 + (isDynamicTheme ? 0 : 1));
|
||||
final bool isLight = value != 2 &&
|
||||
(value == 1 ||
|
||||
DynamicTheme.of(context)!.theme.brightness == Brightness.light);
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
SystemUiOverlayStyle(
|
||||
systemNavigationBarIconBrightness:
|
||||
isLight ? Brightness.dark : Brightness.light,
|
||||
isLight ? Brightness.dark : Brightness.light,
|
||||
),
|
||||
);
|
||||
notifyListeners();
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
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 '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:flutter/foundation.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/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_theme.dart';
|
||||
import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart';
|
||||
import 'package:share_extend/share_extend.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
@ -29,7 +27,6 @@ class SettingsViewModel extends BaseViewModel {
|
||||
final Toast _toast = locator<Toast>();
|
||||
|
||||
final SUpdateLanguage sUpdateLanguage = SUpdateLanguage();
|
||||
final SUpdateTheme sUpdateTheme = SUpdateTheme();
|
||||
|
||||
void navigateToContributors() {
|
||||
_navigationService.navigateTo(Routes.contributorsView);
|
||||
@ -256,11 +253,6 @@ class SettingsViewModel extends BaseViewModel {
|
||||
_toast.showBottom('settingsView.resetStoredPatches');
|
||||
}
|
||||
|
||||
Future<int> getSdkVersion() async {
|
||||
final AndroidDeviceInfo info = await DeviceInfoPlugin().androidInfo;
|
||||
return info.version.sdkInt;
|
||||
}
|
||||
|
||||
Future<void> deleteLogs() async {
|
||||
final Directory appCacheDir = await getTemporaryDirectory();
|
||||
final Directory logsDir = Directory('${appCacheDir.path}/logs');
|
||||
|
@ -52,8 +52,8 @@ class SocialMediaWidget extends StatelessWidget {
|
||||
SocialMediaItem(
|
||||
icon: FaIcon(FontAwesomeIcons.github),
|
||||
title: Text('GitHub'),
|
||||
subtitle: Text('github.com/revanced'),
|
||||
url: 'https://github.com/revanced',
|
||||
subtitle: Text('github.com/ReVanced'),
|
||||
url: 'https://github.com/ReVanced',
|
||||
),
|
||||
SocialMediaItem(
|
||||
icon: FaIcon(FontAwesomeIcons.discord),
|
||||
@ -74,10 +74,10 @@ class SocialMediaWidget extends StatelessWidget {
|
||||
url: 'https://reddit.com/r/revancedapp',
|
||||
),
|
||||
SocialMediaItem(
|
||||
icon: FaIcon(FontAwesomeIcons.twitter),
|
||||
title: Text('Twitter'),
|
||||
icon: FaIcon(FontAwesomeIcons.xTwitter),
|
||||
title: Text('X'),
|
||||
subtitle: Text('@revancedapp'),
|
||||
url: 'https://twitter.com/revancedapp',
|
||||
url: 'https://x.com/revancedapp',
|
||||
),
|
||||
SocialMediaItem(
|
||||
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'
|
||||
|
||||
version: 1.13.1+101300100
|
||||
version: 1.14.1+101400100
|
||||
|
||||
environment:
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
@ -41,7 +41,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter_svg: ^2.0.4
|
||||
fluttertoast: ^8.2.1
|
||||
font_awesome_flutter: ^10.4.0
|
||||
font_awesome_flutter: ^10.6.0
|
||||
get_it: 7.2.0
|
||||
google_fonts: ^4.0.3
|
||||
http: ^0.13.5
|
||||
|
Reference in New Issue
Block a user