Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: reorganize and rename settings #1307

Merged
merged 36 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
688979c
reorganize and rename settings
KobeW50 Sep 24, 2023
629fef2
Small consistency fix
KobeW50 Sep 24, 2023
b647c0a
refactor: string
validcube Sep 24, 2023
ea97d9f
refactor(i18n): string
validcube Sep 24, 2023
0a5783c
Update en_US.json
KobeW50 Sep 24, 2023
f891ff6
rename InfoSection to DebugSection
KobeW50 Sep 26, 2023
48310e8
rename ExperimentalPatches to VersionCompatibilityCheck
KobeW50 Sep 26, 2023
80b8376
Update docs settings page
KobeW50 Sep 26, 2023
62a6935
rename ExperimentalPatches to VersionCompatibilityCheck
KobeW50 Sep 26, 2023
0a1759d
Update en_US.json
KobeW50 Sep 26, 2023
52f7720
Update en_US.json
KobeW50 Sep 26, 2023
f7f9d64
correct grammar in string
KobeW50 Sep 26, 2023
9a2f089
remove undesirable user suggestion
KobeW50 Sep 26, 2023
0af521e
feat: add websites to socials
Ushie Oct 4, 2023
0c5683b
refactor: remove `experimental` from universal patches strings
Ushie Oct 4, 2023
0fcc983
fix: enable version compatibility check by default
Ushie Oct 4, 2023
944396f
refactor: move commented code to correct place
Ushie Oct 4, 2023
23c3f4b
refactor: remove unused stuff
Ushie Oct 4, 2023
8c4a4e1
Merge branch 'dev' into dev
Ushie Oct 4, 2023
441e488
feat: use revanced icon for website in socials
Ushie Oct 4, 2023
22ea54d
fix: fonts import in pubspec
Ushie Oct 4, 2023
306ae9f
refactor wording in docs
KobeW50 Oct 10, 2023
0edaaf8
refactor wording of "patches selection"
KobeW50 Oct 10, 2023
9374b03
Merge branch 'dev' into pr/KobeW50/1307-2
Ushie Oct 13, 2023
395e821
use new toggle names in patcher logs
KobeW50 Oct 13, 2023
5687731
Merge branch 'dev' into pr/KobeW50/1307-2
Ushie Oct 13, 2023
2c370f6
docs: reflect new settings order (and small changes)
KobeW50 Oct 13, 2023
b292c09
refactor and reorganize en_US.json
KobeW50 Oct 13, 2023
9b68156
docs: fix incorrect order
KobeW50 Oct 13, 2023
52a47af
docs: typo
KobeW50 Oct 13, 2023
55d195c
refactor strings for requested changes
KobeW50 Oct 13, 2023
8096231
singularize "selections"
KobeW50 Oct 15, 2023
2ee0c90
change "ReVanced Patches" to "patches"
KobeW50 Oct 15, 2023
5cfb989
requested changes
KobeW50 Oct 15, 2023
8f33519
requested changes regarding "keystore"
KobeW50 Oct 15, 2023
02a76e1
Merge branch 'dev' into dev
validcube Oct 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 38 additions & 42 deletions assets/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"noneTooltip": "Deselect all patches",

"loadPatchesSelection": "Load patches selection",
"noSavedPatches": "No saved patches for the selected app.\nPress Done to save current selection.",
"noSavedPatches": "No saved patches for the selected app.\nPress Done to save the current selection.",
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved
"noPatchesFound": "No patches found for the selected app",
"setRequiredOption": "Some patches require options to be set:\n\n{patches}\n\nPlease set them before continuing.",

Expand All @@ -152,10 +152,10 @@
},
"patchItem": {
"unsupportedDialogText": "Selecting this patch may result in patching errors.\n\nApp version: {packageVersion}\nSupported versions:\n{supportedVersions}",
"unsupportedPatchVersion": "Patch is not supported for this app version. Enable the experimental toggle in settings to proceed.",
"unsupportedPatchVersion": "Patch is not supported for this app version.",
"unsupportedRequiredOption": "This patch contains a required option that is not supported by this app",

"patchesChangeWarningDialogText": "It is recommended to use the default selection of patches because changing it may cause unexpected issues.\n\nIf you know what you are doing, you can enable \"Enable changing selection\" in the settings.",
"patchesChangeWarningDialogText": "It is recommended to use the default selection of patches because changing it may cause unexpected issues.\n\nIf you know what you are doing, you can enable \"Allow changing patch selections\" in the settings.",
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved
"patchesChangeWarningDialogButton": "Use default selection"
},
"installerView": {
Expand Down Expand Up @@ -187,10 +187,9 @@

"appearanceSectionTitle": "Appearance",
"teamSectionTitle": "Team",
"infoSectionTitle": "Info",
"debugSectionTitle": "Debugging",
"advancedSectionTitle": "Advanced",
"exportSectionTitle": "Import & export",
"logsSectionTitle": "Logs",

"themeModeLabel": "App theme",
"systemThemeLabel": "System",
Expand All @@ -204,15 +203,15 @@
"englishOption": "English",

"sourcesLabel": "Sources",
"sourcesLabelHint": "Configure your custom sources",
"sourcesLabelHint": "Configure your sources",
"sourcesIntegrationsLabel": "Integrations source",
"sourcesResetDialogTitle": "Reset",
"sourcesResetDialogText": "Are you sure you want to reset custom sources to their default values?",
"apiURLResetDialogText": "Are you sure you want to reset API URL to its default value?",
"sourcesResetDialogText": "Are you sure you want to reset your sources to their default values?",
"apiURLResetDialogText": "Are you sure you want to reset your API URL to its default value?",
"sourcesUpdateNote": "Note: ReVanced Patches will be updated to the latest version automatically.\n\nThis will reveal your IP address to the server.",

"apiURLLabel": "API URL",
"apiURLHint": "Configure your custom API URL",
"apiURLHint": "Configure your API URL",
"selectApiURL": "API URL",
"hostRepositoryLabel": "Repository API",
"orgPatchesLabel": "Patches organization",
Expand All @@ -222,21 +221,20 @@
"contributorsLabel": "Contributors",
"contributorsHint": "A list of contributors of ReVanced",

"logsLabel": "Logs",
"logsHint": "Share Manager's logs",
"logsLabel": "Share logs",
"logsHint": "Share ReVanced Manager logs",

"enablePatchesSelectionLabel": "Enable changing selection",
"enablePatchesSelectionHint": "Enable changing the selection of patches.",
"enablePatchesSelectionLabel": "Allow changing patch selections",
"enablePatchesSelectionHint": "Allow changing the selection of patches",
"enablePatchesSelectionWarningText": "Changing the default selection of patches may cause unexpected issues.\n\nEnable anyways?",
"disablePatchesSelectionWarningText": "You are about to disable changing the selection of patches.\nThe default selection of patches will be restored.\n\nDisable anyways?",

"autoUpdatePatchesLabel": "Auto update patches",
"autoUpdatePatchesHint": "Automatically update ReVanced Patches to the latest version",
"experimentalUniversalPatchesLabel": "Experimental universal patches support",
"experimentalUniversalPatchesHint": "Display all applications to use with universal patches, loading list of apps may be slower",
"experimentalPatchesLabel": "Experimental patches support",
"experimentalPatchesHint": "Enable usage of unsupported patches in any app version",
"enabledExperimentalPatches": "Experimental patches support enabled",
"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",

"aboutLabel": "About",
"snackbarMessage": "Copied to clipboard",
Expand All @@ -246,51 +244,49 @@
"deleteTempDirHint": "Delete unused temporary files",
"deletedTempDir": "Temporary files deleted",

"exportPatchesLabel": "Export patches selection",
"exportPatchesHint": "Export patches selection to a JSON file",
"exportedPatches": "Patches selection exported",
"noExportFileFound": "No patches selection to export",
"exportPatchesLabel": "Export patch selections",
"exportPatchesHint": "Export patch selections to a JSON file",
"exportedPatches": "Patch selections exported",
"noExportFileFound": "No patch selections to export",

"importPatchesLabel": "Import patches selection",
"importPatchesHint": "Import patches selection from a JSON file",
"importedPatches": "Patches selection imported",
"importPatchesLabel": "Import patch selections",
"importPatchesHint": "Import patch selections from a JSON file",
"importedPatches": "Patch selections imported",

"resetStoredPatchesLabel": "Reset patches",
"resetStoredPatchesHint": "Reset the stored patches selection",
"resetStoredPatchesLabel": "Reset patch selections",
"resetStoredPatchesHint": "Reset the stored patch selections",
"resetStoredPatchesDialogTitle": "Reset patch selections?",
"resetStoredPatchesDialogText": "The default selection of patches will be restored..",
"resetStoredPatches": "Patch selections have been reset",

"resetStoredOptionsLabel": "Reset options",
"resetStoredOptionsLabel": "Reset patch options",
"resetStoredOptionsHint": "Reset all patch options",

"resetStoredPatchesDialogTitle": "Reset patches selection?",
"resetStoredPatchesDialogText": "Resetting patches selection will remove all selected patches.",
"resetStoredPatches": "Patches selection has been reset",

"resetStoredOptionsDialogTitle": "Reset options?",
"resetStoredOptionsDialogText": "Resetting options will remove all saved options.",
"resetStoredOptionsDialogTitle": "Reset patch options?",
"resetStoredOptionsDialogText": "Resetting patch options will remove all saved options.",
"resetStoredOptions": "Options have been reset",

"deleteLogsLabel": "Delete logs",
"deleteLogsHint": "Delete collected manager logs",
"deleteLogsLabel": "Clear logs",
"deleteLogsHint": "Delete collected ReVanced Manager logs",
"deletedLogs": "Logs deleted",

"regenerateKeystoreLabel": "Regenerate keystore",
"regenerateKeystoreHint": "Regenerate the keystore used to sign the app",
"regenerateKeystoreHint": "Regenerate the keystore used to sign apps",

"regenerateKeystoreDialogTitle": "Regenerate keystore?",
"regenerateKeystoreDialogText": "Patched apps signed with the old keystore will no longer be able to update.",
"regenerateKeystoreDialogText": "Patched apps signed with the old keystore will no longer be able to be updated.",
"regeneratedKeystore": "Keystore regenerated",

"exportKeystoreLabel": "Export keystore",
"exportKeystoreHint": "Export keystore used to sign apps",
"exportKeystoreHint": "Export the keystore used to sign apps",
"exportedKeystore": "Keystore exported",
"noKeystoreExportFileFound": "No keystore to export",

"importKeystoreLabel": "Import keystore",
"importKeystoreHint": "Import keystore used to sign apps",
"importKeystoreHint": "Import a keystore used to sign apps",
"importedKeystore": "Keystore imported",

"selectKeystorePassword": "Keystore Password",
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved
"selectKeystorePasswordHint": "Select keystore password used to sign the apk",
"selectKeystorePasswordHint": "Select keystore password used to sign apps",

"jsonSelectorErrorMessage": "Unable to use selected JSON file",
"keystoreSelectorErrorMessage": "Unable to use selected KEYSTORE file"
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
32 changes: 18 additions & 14 deletions docs/2_4_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,39 @@ ReVanced Manager has settings that can be configured to your liking.

## ⭐ Essential settings
PalmDevs marked this conversation as resolved.
Show resolved Hide resolved

- ### 🔗 API URL
- ### 🪛 Allow changing patch selections

API to use to fetch updates and ReVanced Patches from.
Allows the user to change the patch selections from the default selections.

- ### 🧬 Sources
- ### 🔍 Version compatibility check

Override the API and download ReVanced Patches from a different source.
Constrains ReVanced Patches to supported app versions. Disable this to patch any version of an app.
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved

- ### 🧪 Experimental ReVanced Patches support
> [!WARNING]
> Disabling this may cause issues if the ReVanced Patches are not compatible with the app version.
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved

Disable checking for the version of the app when applying ReVanced Patches.
- ### 🧑‍🔬 Show universal patches

Reveals ReVanced Patches which can be applied to any app.
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved

> [!WARNING]
> This may cause issues if the ReVanced Patches are not compatible with the app version.
> Because the patches generalize the app, they may not work on all apps.
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved

- ### 🧑‍🔬 Experimental universal support
- ### 🧬 Sources

This will show or hide ReVanced Patches, which are not meant for any app in particular but apply to all apps
Override the API and download ReVanced Patches from a different source.
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved

> [!WARNING]
> Because the patches generalize the app, they may not work on all apps.
- ### 🔗 API URL

API to use to fetch updates and ReVanced Patches from.

- ### 💾 Imports & Exports

You can import, export or reset the following settings:

- 🔑 Keystore
- 📄 ReVanced Patches selection
- ⚙️ Options
- 📄 ReVanced Patch selections
KobeW50 marked this conversation as resolved.
Show resolved Hide resolved
- ⚙️ Patch options

> [!NOTE]
> This is particularly useful if you want to backup or reset your settings.
Expand All @@ -45,4 +49,4 @@ ReVanced Manager has settings that can be configured to your liking.

The next page will bring you back to the usage page.

Continue: [🛠️ Usage](2_usage.md)
Continue: [🛠️ Usage](2_usage.md)
Binary file added fonts/custom-icons.ttf
Binary file not shown.
10 changes: 5 additions & 5 deletions lib/services/manager_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ class ManagerAPI {
await _prefs.setBool('universalPatchesEnabled', value);
}

bool areExperimentalPatchesEnabled() {
return _prefs.getBool('experimentalPatchesEnabled') ?? false;
bool isVersionCompatibilityCheckEnabled() {
return _prefs.getBool('versionCompatibilityCheckEnabled') ?? true;
}

Future<void> enableExperimentalPatchesStatus(bool value) async {
await _prefs.setBool('experimentalPatchesEnabled', value);
Future<void> enableVersionCompatibilityCheckStatus(bool value) async {
await _prefs.setBool('versionCompatibilityCheckEnabled', value);
}

Future<void> setKeystorePassword(String password) async {
Expand Down Expand Up @@ -677,7 +677,7 @@ class ManagerAPI {
Future<List<String>> getDefaultPatches() async {
final List<Patch> patches = await getPatches();
final List<String> defaultPatches = [];
if (areExperimentalPatchesEnabled() == false) {
if (isVersionCompatibilityCheckEnabled() == false) {
defaultPatches.addAll(
patches
.where(
Expand Down
6 changes: 3 additions & 3 deletions lib/ui/views/installer/installer_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ class InstallerViewModel extends BaseViewModel {
'Patches: ${_patches.map((p) => p.name).toList().join(", ")}',

'\n~ Settings',
'Enabled changing patches: ${_managerAPI.isPatchesChangeEnabled()}',
'Enabled universal patches: ${_managerAPI.areUniversalPatchesEnabled()}',
'Enabled experimental patches: ${_managerAPI.areExperimentalPatchesEnabled()}',
'Allow changing patch selections: ${_managerAPI.isPatchesChangeEnabled()}',
'Show universal patches: ${_managerAPI.areUniversalPatchesEnabled()}',
'Version compatibility check: ${_managerAPI.isVersionCompatibilityCheckEnabled()}',
'Patches source: ${_managerAPI.getPatchesRepo()}',
'Integration source: ${_managerAPI.getIntegrationsRepo()}',

Expand Down
2 changes: 1 addition & 1 deletion lib/ui/views/patcher/patcher_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class PatcherViewModel extends BaseViewModel {
this.selectedPatches.clear();
this.selectedPatches.addAll(patches.where((patch) => !patch.excluded));
}
if (!_managerAPI.areExperimentalPatchesEnabled()) {
if (!_managerAPI.isVersionCompatibilityCheckEnabled()) {
this.selectedPatches.removeWhere((patch) => !isPatchSupported(patch));
}
if (!_managerAPI.areUniversalPatchesEnabled()) {
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/views/patches_selector/patches_selector_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
.where(
(element) =>
!element.excluded &&
(_managerAPI.areExperimentalPatchesEnabled() ||
(_managerAPI.isVersionCompatibilityCheckEnabled() ||
isPatchSupported(element)),
),
);
Expand Down Expand Up @@ -281,7 +281,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
this.selectedPatches.addAll(
patches.where((patch) => selectedPatches.contains(patch.name)),
);
if (!_managerAPI.areExperimentalPatchesEnabled()) {
if (!_managerAPI.isVersionCompatibilityCheckEnabled()) {
this.selectedPatches.removeWhere((patch) => !isPatchSupported(patch));
}
} else {
Expand Down
9 changes: 5 additions & 4 deletions lib/ui/views/settings/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_update_theme.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_advanced_section.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_debug_section.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_export_section.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_info_section.dart';
import 'package:revanced_manager/ui/widgets/settingsView/settings_team_section.dart';
import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart';
import 'package:stacked/stacked.dart';
Expand Down Expand Up @@ -41,15 +41,16 @@ class SettingsView extends StatelessWidget {
delegate: SliverChildListDelegate.fixed(
<Widget>[
SUpdateThemeUI(),
// SUpdateLanguageUI(),
// _settingsDivider,
STeamSection(),
// SUpdateLanguageUI(),
_settingsDivider,
SAdvancedSection(),
_settingsDivider,
SExportSection(),
_settingsDivider,
SInfoSection(),
STeamSection(),
_settingsDivider,
SDebugSection(),
],
),
),
Expand Down
8 changes: 4 additions & 4 deletions lib/ui/views/settings/settings_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ class SettingsViewModel extends BaseViewModel {
notifyListeners();
}

bool areExperimentalPatchesEnabled() {
return _managerAPI.areExperimentalPatchesEnabled();
bool isVersionCompatibilityCheckEnabled() {
return _managerAPI.isVersionCompatibilityCheckEnabled();
}

void useExperimentalPatches(bool value) {
_managerAPI.enableExperimentalPatchesStatus(value);
void useVersionCompatibilityCheck(bool value) {
_managerAPI.enableVersionCompatibilityCheckStatus(value);
notifyListeners();
}

Expand Down
15 changes: 7 additions & 8 deletions lib/ui/widgets/patchesSelectorView/patch_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ class _PatchItemState extends State<PatchItem> {
Widget build(BuildContext context) {
widget.isSelected = widget.isSelected &&
(!widget.isUnsupported ||
widget._managerAPI.areExperimentalPatchesEnabled()) &&
!widget.hasUnsupportedPatchOption;
widget._managerAPI.isVersionCompatibilityCheckEnabled()) && !widget.hasUnsupportedPatchOption;
return Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Opacity(
opacity: widget.isUnsupported &&
widget._managerAPI.areExperimentalPatchesEnabled() == false
widget._managerAPI.isVersionCompatibilityCheckEnabled() == false
? 0.5
: 1,
child: CustomCard(
Expand All @@ -66,7 +65,7 @@ class _PatchItemState extends State<PatchItem> {
),
onTap: () {
if (widget.isUnsupported &&
!widget._managerAPI.areExperimentalPatchesEnabled()) {
!widget._managerAPI.isVersionCompatibilityCheckEnabled()) {
widget.isSelected = false;
widget.toast.showBottom('patchItem.unsupportedPatchVersion');
} else if (widget.isChangeEnabled) {
Expand All @@ -80,7 +79,7 @@ class _PatchItemState extends State<PatchItem> {
setState(() {});
}
if (!widget.isUnsupported ||
widget._managerAPI.areExperimentalPatchesEnabled()) {
widget._managerAPI.isVersionCompatibilityCheckEnabled()) {
widget.onChanged(widget.isSelected);
}
},
Expand All @@ -99,7 +98,7 @@ class _PatchItemState extends State<PatchItem> {
),
onChanged: (newValue) {
if (widget.isUnsupported &&
!widget._managerAPI.areExperimentalPatchesEnabled()) {
!widget._managerAPI.isVersionCompatibilityCheckEnabled()) {
widget.isSelected = false;
widget.toast.showBottom(
'patchItem.unsupportedPatchVersion',
Expand All @@ -115,7 +114,7 @@ class _PatchItemState extends State<PatchItem> {
setState(() {});
}
if (!widget.isUnsupported ||
widget._managerAPI.areExperimentalPatchesEnabled()) {
widget._managerAPI.isVersionCompatibilityCheckEnabled()) {
widget.onChanged(widget.isSelected);
}
},
Expand Down Expand Up @@ -156,7 +155,7 @@ class _PatchItemState extends State<PatchItem> {
children: [
if (widget.isUnsupported &&
widget._managerAPI
.areExperimentalPatchesEnabled())
.isVersionCompatibilityCheckEnabled())
Padding(
padding: const EdgeInsets.only(top: 8),
child: TextButton.icon(
Expand Down
Loading