build(Needs bump): Bump ReVanced Patcher (#2242)

Co-authored-by: aAbed <aabedhkhan@gmail.com>
This commit is contained in:
oSumAtrIX
2024-10-26 17:41:49 +02:00
committed by GitHub
parent 4db4789a06
commit 8d0d782ab5
20 changed files with 135 additions and 291 deletions

View File

@ -40,11 +40,6 @@ class ContributorsView extends StatelessWidget {
contributors: model.patchesContributors,
),
const SizedBox(height: 20),
ContributorsCard(
title: 'ReVanced Integrations',
contributors: model.integrationsContributors,
),
const SizedBox(height: 20),
ContributorsCard(
title: 'ReVanced CLI',
contributors: model.cliContributors,

View File

@ -6,19 +6,18 @@ class ContributorsViewModel extends BaseViewModel {
final ManagerAPI _managerAPI = locator<ManagerAPI>();
List<dynamic> patcherContributors = [];
List<dynamic> patchesContributors = [];
List<dynamic> integrationsContributors = [];
List<dynamic> cliContributors = [];
List<dynamic> managerContributors = [];
String repoName(String repo) => repo.split('/').last;
Future<void> getContributors() async {
final Map<String, List<dynamic>> contributors =
await _managerAPI.getContributors();
patcherContributors = contributors[_managerAPI.defaultPatcherRepo] ?? [];
patchesContributors = contributors[_managerAPI.defaultPatchesRepo] ?? [];
integrationsContributors =
contributors[_managerAPI.defaultIntegrationsRepo] ?? [];
cliContributors = contributors[_managerAPI.defaultCliRepo] ?? [];
managerContributors = contributors[_managerAPI.defaultManagerRepo] ?? [];
patcherContributors = contributors[repoName(_managerAPI.defaultPatcherRepo)] ?? [];
patchesContributors = contributors[repoName(_managerAPI.defaultPatchesRepo)] ?? [];
cliContributors = contributors[repoName(_managerAPI.defaultCliRepo)] ?? [];
managerContributors = contributors[repoName(_managerAPI.defaultManagerRepo)] ?? [];
notifyListeners();
}
}

View File

@ -311,11 +311,8 @@ class HomeViewModel extends BaseViewModel {
_toast.showBottom(t.homeView.downloadingMessage);
final String patchesVersion =
await _managerAPI.getLatestPatchesVersion() ?? '0.0.0';
final String integrationsVersion =
await _managerAPI.getLatestIntegrationsVersion() ?? '0.0.0';
if (patchesVersion != '0.0.0' && integrationsVersion != '0.0.0') {
if (patchesVersion != '0.0.0') {
await _managerAPI.setCurrentPatchesVersion(patchesVersion);
await _managerAPI.setCurrentIntegrationsVersion(integrationsVersion);
_toast.showBottom(t.homeView.downloadedMessage);
forceRefresh(context);
} else {

View File

@ -330,7 +330,6 @@ class InstallerViewModel extends BaseViewModel {
'Version compatibility check: ${_managerAPI.isVersionCompatibilityCheckEnabled()}',
'Show universal patches: ${_managerAPI.areUniversalPatchesEnabled()}',
'Patches source: ${_managerAPI.getPatchesRepo()}',
'Integration source: ${_managerAPI.getIntegrationsRepo()}', //
'\n- Logs',
logsTrimmed.join('\n'),

View File

@ -44,20 +44,20 @@ class PatchOptionsView extends StatelessWidget {
child: Column(
children: [
for (final Option option in model.modifiedOptions)
if (option.valueType == 'String' ||
option.valueType == 'Int')
if (option.type == 'kotlin.String' ||
option.type == 'kotlin.Int')
IntAndStringPatchOption(
patchOption: option,
model: model,
)
else if (option.valueType == 'Boolean')
else if (option.type == 'kotlin.Boolean')
BooleanPatchOption(
patchOption: option,
model: model,
)
else if (option.valueType == 'StringArray' ||
option.valueType == 'IntArray' ||
option.valueType == 'LongArray')
else if (option.type == 'kotlin.collections.List<kotlin.String>' ||
option.type == 'kotlin.collections.List<kotlin.Int>' ||
option.type == 'kotlin.collections.List<kotlin.Long>')
IntStringLongListPatchOption(
patchOption: option,
model: model,

View File

@ -74,7 +74,7 @@ class PatchOptionsViewModel extends BaseViewModel {
title: option.title,
description: option.description,
values: option.values,
valueType: option.valueType,
type: option.type,
value: value,
required: option.required,
key: option.key,
@ -90,7 +90,7 @@ class PatchOptionsViewModel extends BaseViewModel {
title: option.title,
description: option.description,
values: option.values,
valueType: option.valueType,
type: option.type,
value: option.value is List ? option.value.toList() : option.value,
required: option.required,
key: option.key,

View File

@ -14,16 +14,11 @@ class SManageSources extends BaseViewModel {
final TextEditingController _orgPatSourceController = TextEditingController();
final TextEditingController _patSourceController = TextEditingController();
final TextEditingController _orgIntSourceController = TextEditingController();
final TextEditingController _intSourceController = TextEditingController();
Future<void> showSourcesDialog(BuildContext context) async {
final String patchesRepo = _managerAPI.getPatchesRepo();
final String integrationsRepo = _managerAPI.getIntegrationsRepo();
_orgPatSourceController.text = patchesRepo.split('/')[0];
_patSourceController.text = patchesRepo.split('/')[1];
_orgIntSourceController.text = integrationsRepo.split('/')[0];
_intSourceController.text = integrationsRepo.split('/')[1];
return showDialog(
context: context,
builder: (context) => AlertDialog(
@ -72,38 +67,6 @@ class SManageSources extends BaseViewModel {
hintText: patchesRepo.split('/')[1],
),
),
const SizedBox(height: 8),
// Integrations owner's name
TextField(
controller: _orgIntSourceController,
autocorrect: false,
onChanged: (value) => notifyListeners(),
decoration: InputDecoration(
icon: Icon(
Icons.merge_outlined,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
border: const OutlineInputBorder(),
labelText: t.settingsView.orgIntegrationsLabel,
hintText: integrationsRepo.split('/')[0],
),
),
const SizedBox(height: 8),
// Integrations repository's name
TextField(
controller: _intSourceController,
autocorrect: false,
onChanged: (value) => notifyListeners(),
decoration: InputDecoration(
icon: const Icon(
Icons.merge_outlined,
color: Colors.transparent,
),
border: const OutlineInputBorder(),
labelText: t.settingsView.sourcesIntegrationsLabel,
hintText: integrationsRepo.split('/')[1],
),
),
const SizedBox(height: 20),
Text(t.settingsView.sourcesUpdateNote),
],
@ -113,8 +76,6 @@ class SManageSources extends BaseViewModel {
onPressed: () {
_orgPatSourceController.clear();
_patSourceController.clear();
_orgIntSourceController.clear();
_intSourceController.clear();
Navigator.of(context).pop();
},
child: Text(t.cancelButton),
@ -124,11 +85,7 @@ class SManageSources extends BaseViewModel {
_managerAPI.setPatchesRepo(
'${_orgPatSourceController.text.trim()}/${_patSourceController.text.trim()}',
);
_managerAPI.setIntegrationsRepo(
'${_orgIntSourceController.text.trim()}/${_intSourceController.text.trim()}',
);
_managerAPI.setCurrentPatchesVersion('0.0.0');
_managerAPI.setCurrentIntegrationsVersion('0.0.0');
_managerAPI.setLastUsedPatchesVersion();
_toast.showBottom(t.settingsView.restartAppForChanges);
Navigator.of(context).pop();
@ -154,9 +111,7 @@ class SManageSources extends BaseViewModel {
FilledButton(
onPressed: () {
_managerAPI.setPatchesRepo('');
_managerAPI.setIntegrationsRepo('');
_managerAPI.setCurrentPatchesVersion('0.0.0');
_managerAPI.setCurrentIntegrationsVersion('0.0.0');
_toast.showBottom(t.settingsView.restartAppForChanges);
Navigator.of(context)
..pop()

View File

@ -56,7 +56,6 @@ class SettingsViewModel extends BaseViewModel {
void useAlternativeSources(bool value) {
_managerAPI.useAlternativeSources(value);
_managerAPI.setCurrentPatchesVersion('0.0.0');
_managerAPI.setCurrentIntegrationsVersion('0.0.0');
_managerAPI.setLastUsedPatchesVersion();
notifyListeners();
}