Skip to content

Commit

Permalink
fix: Log saved patch option values (ReVanced#1420)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAabedKhan authored Nov 7, 2023
1 parent e6a8f4e commit e7d8285
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/ui/views/installer/installer_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ class InstallerViewModel extends BaseViewModel {

Future<void> copyLogs() async {
final info = await AboutInfo.getInfo();
dynamic getValue(String patchName, Option option) {
final Option? savedOption = _managerAPI.getPatchOption(_app.packageName, patchName, option.key);
if (savedOption != null) {
return savedOption.value;
} else {
return option.value;
}
}

final formattedLogs = [
'- Device Info',
Expand All @@ -194,7 +202,7 @@ class InstallerViewModel extends BaseViewModel {
'\n- Patch Info',
'App: ${_app.packageName} v${_app.version}',
'Patches version: ${_managerAPI.patchesVersion}',
'Patches: ${_patches.map((p) => p.name + (p.options.isEmpty ? '' : ' [${p.options.map((o) => '${o.title}: ${o.value}').join(", ")}]')).toList().join(", ")}',
'Patches: ${_patches.map((p) => p.name + (p.options.isEmpty ? '' : ' [${p.options.map((o) => '${o.title}: ${getValue(p.name, o)}').join(", ")}]')).toList().join(", ")}',

'\n- Settings',
'Allow changing patch selection: ${_managerAPI.isPatchesChangeEnabled()}',
Expand Down

0 comments on commit e7d8285

Please sign in to comment.