feat: sentry integration.

This commit is contained in:
Aunali321
2022-10-14 23:35:33 +05:30
parent 007b518503
commit f1261398e9
12 changed files with 329 additions and 186 deletions

View File

@@ -1,4 +1,5 @@
import 'package:root/root.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
class RootAPI {
final String _managerDirPath = '/data/local/tmp/revanced-manager';
@@ -9,7 +10,8 @@ class RootAPI {
try {
bool? isRooted = await Root.isRootAvailable();
return isRooted != null && isRooted;
} on Exception {
} on Exception catch (e, s) {
await Sentry.captureException(e, stackTrace: s);
return false;
}
}
@@ -22,7 +24,8 @@ class RootAPI {
return isRooted != null && isRooted;
}
return false;
} on Exception {
} on Exception catch (e, s) {
await Sentry.captureException(e, stackTrace: s);
return false;
}
}
@@ -75,7 +78,8 @@ class RootAPI {
apps.removeWhere((pack) => pack.isEmpty);
return apps.map((pack) => pack.trim()).toList();
}
} on Exception {
} on Exception catch (e, s) {
await Sentry.captureException(e, stackTrace: s);
return List.empty();
}
return List.empty();
@@ -121,7 +125,8 @@ class RootAPI {
await installApk(packageName, patchedFilePath);
await mountApk(packageName, originalFilePath);
return true;
} on Exception {
} on Exception catch (e, s) {
await Sentry.captureException(e, stackTrace: s);
return false;
}
}