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:
EvadeMaster 2023-03-03 18:06:24 +07:00
parent 6d60541626
commit 68ccefc59f
No known key found for this signature in database
GPG key ID: 90BAB50981420F89
15 changed files with 94 additions and 95 deletions

View file

@ -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;
}
}