feat: Add ReVanced API and implement cache on it and on Github API

This commit is contained in:
Alberto Ponces
2022-09-11 02:01:06 +01:00
parent fe13234faa
commit 595ecb7660
15 changed files with 454 additions and 260 deletions

View File

@ -46,10 +46,11 @@ class InstallerViewModel extends BaseViewModel {
),
);
await FlutterBackground.enableBackgroundExecution();
} finally {
await handlePlatformChannelMethods();
await runPatcher();
} on Exception {
// ignore
}
await handlePlatformChannelMethods();
await runPatcher();
}
Future<dynamic> handlePlatformChannelMethods() async {
@ -118,10 +119,13 @@ class InstallerViewModel extends BaseViewModel {
update(1.0, 'Aborting...', 'No app or patches selected! Aborting');
}
try {
await FlutterBackground.disableBackgroundExecution();
} finally {
isPatching = false;
if (FlutterBackground.isBackgroundExecutionEnabled) {
await FlutterBackground.disableBackgroundExecution();
}
} on Exception {
// ignore
}
isPatching = false;
}
void installResult(bool installAsRoot) async {