mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: use secrets for keys (#528)
This commit is contained in:
parent
b0c4567cb8
commit
6ea055d486
4
.github/workflows/debug-build.yml
vendored
4
.github/workflows/debug-build.yml
vendored
@ -19,6 +19,10 @@ jobs:
|
|||||||
- uses: subosito/flutter-action@v1
|
- uses: subosito/flutter-action@v1
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
|
- name: Set environment variables
|
||||||
|
run: echo $SECRETS | base64 -d > lib/utils/environment.dart
|
||||||
|
env:
|
||||||
|
SECRETS: ${{ secrets.SECRETS }}
|
||||||
- name: Set up Flutter
|
- name: Set up Flutter
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
- name: Generate files with Builder
|
- name: Generate files with Builder
|
||||||
|
4
.github/workflows/release-build.yml
vendored
4
.github/workflows/release-build.yml
vendored
@ -19,6 +19,10 @@ jobs:
|
|||||||
- uses: subosito/flutter-action@v1
|
- uses: subosito/flutter-action@v1
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
|
- name: Set environment variables
|
||||||
|
run: echo $SECRETS | base64 -d > lib/utils/environment.dart
|
||||||
|
env:
|
||||||
|
SECRETS: ${{ secrets.SECRETS }}
|
||||||
- name: Set up Flutter
|
- name: Set up Flutter
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
- name: Generate files with Builder
|
- name: Generate files with Builder
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -136,4 +136,3 @@ app.*.map.json
|
|||||||
|
|
||||||
Firebase related
|
Firebase related
|
||||||
.firebase
|
.firebase
|
||||||
/lib/utils/environment.dart
|
|
@ -9,6 +9,7 @@ import 'package:revanced_manager/services/patcher_api.dart';
|
|||||||
import 'package:revanced_manager/services/revanced_api.dart';
|
import 'package:revanced_manager/services/revanced_api.dart';
|
||||||
import 'package:revanced_manager/ui/theme/dynamic_theme_builder.dart';
|
import 'package:revanced_manager/ui/theme/dynamic_theme_builder.dart';
|
||||||
import 'package:revanced_manager/ui/views/navigation/navigation_view.dart';
|
import 'package:revanced_manager/ui/views/navigation/navigation_view.dart';
|
||||||
|
import 'package:revanced_manager/utils/environment.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:stacked_themes/stacked_themes.dart';
|
import 'package:stacked_themes/stacked_themes.dart';
|
||||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||||
@ -23,35 +24,34 @@ Future main() async {
|
|||||||
String apiUrl = locator<ManagerAPI>().getApiUrl();
|
String apiUrl = locator<ManagerAPI>().getApiUrl();
|
||||||
await locator<RevancedAPI>().initialize(apiUrl);
|
await locator<RevancedAPI>().initialize(apiUrl);
|
||||||
await locator<CrowdinAPI>().initialize();
|
await locator<CrowdinAPI>().initialize();
|
||||||
// bool isSentryEnabled = locator<ManagerAPI>().isSentryEnabled();
|
bool isSentryEnabled = locator<ManagerAPI>().isSentryEnabled();
|
||||||
locator<GithubAPI>().initialize();
|
locator<GithubAPI>().initialize();
|
||||||
await locator<PatcherAPI>().initialize();
|
await locator<PatcherAPI>().initialize();
|
||||||
tz.initializeTimeZones();
|
tz.initializeTimeZones();
|
||||||
prefs = await SharedPreferences.getInstance();
|
prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
// Remove this section if you are building from source and don't have sentry configured
|
await SentryFlutter.init(
|
||||||
// await SentryFlutter.init(
|
(options) {
|
||||||
// (options) {
|
options
|
||||||
// options
|
..dsn = isSentryEnabled ? Environment.sentryDSN : ''
|
||||||
// ..dsn = isSentryEnabled ? '' : ''
|
..environment = 'alpha'
|
||||||
// ..environment = 'alpha'
|
..release = '0.1'
|
||||||
// ..release = '0.1'
|
..tracesSampleRate = 1.0
|
||||||
// ..tracesSampleRate = 1.0
|
..anrEnabled = true
|
||||||
// ..anrEnabled = true
|
..enableOutOfMemoryTracking = true
|
||||||
// ..enableOutOfMemoryTracking = true
|
..sampleRate = isSentryEnabled ? 1.0 : 0.0
|
||||||
// ..sampleRate = isSentryEnabled ? 1.0 : 0.0
|
..beforeSend = (event, hint) {
|
||||||
// ..beforeSend = (event, hint) {
|
if (isSentryEnabled) {
|
||||||
// if (isSentryEnabled) {
|
return event;
|
||||||
// return event;
|
} else {
|
||||||
// } else {
|
return null;
|
||||||
// return null;
|
}
|
||||||
// }
|
} as BeforeSendCallback?;
|
||||||
// } as BeforeSendCallback?;
|
},
|
||||||
// },
|
appRunner: () {
|
||||||
// appRunner: () {
|
runApp(const MyApp());
|
||||||
// runApp(const MyApp());
|
},
|
||||||
// },
|
);
|
||||||
// );
|
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
lib/utils/environment.dart
Normal file
5
lib/utils/environment.dart
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
// Dummy environment variables used for building the app locally. These automatically get set with correct values during workflow builds.
|
||||||
|
class Environment {
|
||||||
|
static const sentryDSN = '';
|
||||||
|
static const crowdinKEY = '';
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user