mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-11 04:55:37 +02:00
revert: "refactor: update deprecated and minor code refactors (#710)"
This reverts commit 6829d3cdea
.
Signed-off-by: EvadeMaster <93124920+EvadeMaster@users.noreply.github.com>
This commit is contained in:
parent
6d60541626
commit
68ccefc59f
15 changed files with 94 additions and 95 deletions
|
@ -1,6 +1,5 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:device_apps/device_apps.dart';
|
||||
import 'package:injectable/injectable.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
@ -18,10 +17,10 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||
class ManagerAPI {
|
||||
final RevancedAPI _revancedAPI = locator<RevancedAPI>();
|
||||
final GithubAPI _githubAPI = locator<GithubAPI>();
|
||||
final SharedPreferences _prefs = locator<SharedPreferences>();
|
||||
final RootAPI _rootAPI = RootAPI();
|
||||
final String patcherRepo = 'revanced-patcher';
|
||||
final String cliRepo = 'revanced-cli';
|
||||
late SharedPreferences _prefs;
|
||||
String storedPatchesFile = '/selected-patches.json';
|
||||
String defaultApiUrl = 'https://releases.revanced.app/';
|
||||
String defaultRepoUrl = 'https://api.github.com';
|
||||
|
@ -32,6 +31,7 @@ class ManagerAPI {
|
|||
String defaultManagerRepo = 'revanced/revanced-manager';
|
||||
|
||||
Future<void> initialize() async {
|
||||
_prefs = await SharedPreferences.getInstance();
|
||||
storedPatchesFile =
|
||||
(await getApplicationDocumentsDirectory()).path + storedPatchesFile;
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ class ManagerAPI {
|
|||
_revancedAPI.clearAllCache();
|
||||
_githubAPI.clearAllCache();
|
||||
} on Exception catch (e, s) {
|
||||
Sentry.captureException(e, stackTrace: s).ignore();
|
||||
await Sentry.captureException(e, stackTrace: s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ class ManagerAPI {
|
|||
return await _githubAPI.getPatches(repoName);
|
||||
}
|
||||
} on Exception catch (e, s) {
|
||||
Sentry.captureException(e, stackTrace: s).ignore();
|
||||
await Sentry.captureException(e, stackTrace: s);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ class ManagerAPI {
|
|||
return await _githubAPI.getLatestReleaseFile('.jar', repoName);
|
||||
}
|
||||
} on Exception catch (e, s) {
|
||||
Sentry.captureException(e, stackTrace: s).ignore();
|
||||
await Sentry.captureException(e, stackTrace: s);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ class ManagerAPI {
|
|||
return await _githubAPI.getLatestReleaseFile('.apk', repoName);
|
||||
}
|
||||
} on Exception catch (e, s) {
|
||||
Sentry.captureException(e, stackTrace: s).ignore();
|
||||
await Sentry.captureException(e, stackTrace: s);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue