diff --git a/.env b/.env deleted file mode 100644 index 4ead69a3..00000000 --- a/.env +++ /dev/null @@ -1,3 +0,0 @@ -sentryDSN= -apiKey= -appId= \ No newline at end of file diff --git a/.github/workflows/commit-build.yml b/.github/workflows/commit-build.yml index bb90180d..553f0651 100644 --- a/.github/workflows/commit-build.yml +++ b/.github/workflows/commit-build.yml @@ -1,35 +1,104 @@ -name: "Android CI Actions" - +name: Android Release on: push: branches: - "**" tags-ignore: - - "v*" # Ignore tags that start with "v" (e.g. v1.0.0) because they are handled by release-build.yml + - "v*" + + pull_request: + branches: + - "**" + + workflow_dispatch: jobs: - release: + version: + name: Create version number runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set env - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Set up JDK 12 - uses: actions/setup-java@v3 with: - java-version: '12' + fetch-depth: 0 + + - name: Fetch all history for all tags and branches + run: | + git config remote.origin.url https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + git fetch --prune --depth=10000 + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.7 + with: + versionSpec: "5.x" + + - name: Use GitVersion + id: gitversion + uses: gittools/actions/gitversion/execute@v0.9.7 + + - name: Create version.txt with nuGetVersion + run: echo ${{ steps.gitversion.outputs.nuGetVersion }} > version.txt + + - name: Upload version.txt + uses: actions/upload-artifact@v2 + with: + name: gitversion + path: version.txt + + build: + name: Create Android Build + needs: version + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Get version.txt + uses: actions/download-artifact@v2 + with: + name: gitversion + + - name: Create new file without newline char from version.txt + run: tr -d '\n' < version.txt > version1.txt + + - name: Read version + id: version + uses: juliangruber/read-file-action@v1 + with: + path: version1.txt + + - name: Update version in YAML + run: sed -i 's/99.99.99+99/${{ steps.version.outputs.content }}+${{ github.run_number }}/g' pubspec.yaml + + - name: Download Android keystore + id: android_keystore + uses: timheuer/base64-to-file@v1.0.3 + with: + fileName: upload-keystore.jks + encodedString: ${{ secrets.SIGNING_KEYSTORE }} + + - name: Create key.properties + run: | + echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties + echo "storePassword=${{ secrets.SIGNING_KEYSTORE_PASSWORD }}" >> android/key.properties + echo "keyPassword=${{ secrets.SIGNING_KEY_PASSWORD }}" >> android/key.properties + echo "keyAlias=${{ secrets.SIGNING_KEY_ALIAS }}" >> android/key.properties + + - uses: actions/setup-java@v3 + with: distribution: 'zulu' + java-version: "12.x" + cache: gradle + - uses: subosito/flutter-action@v2 with: channel: 'stable' - - name: Set environment variables - run: echo $SECRETS | base64 -d > lib/utils/environment.dart - env: - SECRETS: ${{ secrets.SECRETS }} - - name: Set up Flutter + cache: true + + - name: Get dependencies run: flutter pub get + - name: Generate files with Builder run: flutter packages pub run build_runner build --delete-conflicting-outputs + - name: Build with Flutter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -37,6 +106,7 @@ jobs: SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} run: flutter build apk + - name: Sign APK id: sign_apk uses: ilharp/sign-android-release@v1 @@ -46,10 +116,26 @@ jobs: keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }} keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} + - name: Add version to APK run: mv ${{ steps.sign_apk.outputs.signedFile }} revanced-manager-${{ env.RELEASE_VERSION }}.apk + - name: Upload APK uses: actions/upload-artifact@v3 with: name: revanced-manager-${{ env.RELEASE_VERSION }} path: revanced-manager-${{ env.RELEASE_VERSION }}.apk + + # deploy: + # name: Deploy Android Build + # needs: build + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v1 + # - name: Get Android Build from artifacts + # uses: actions/download-artifact@v2 + # with: + # name: android-release + +env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true diff --git a/.github/workflows/pull-request-build.yml b/.github/workflows/pull-request-build.yml index 177e9cf1..99019146 100644 --- a/.github/workflows/pull-request-build.yml +++ b/.github/workflows/pull-request-build.yml @@ -20,10 +20,6 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: 'stable' - - name: Set environment variables - run: echo $SECRETS | base64 -d > lib/utils/environment.dart - env: - SECRETS: ${{ secrets.SECRETS }} - name: Set up Flutter run: flutter pub get - name: Generate files with Builder diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index d0862122..c7401652 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -20,10 +20,6 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: 'stable' - - name: Set environment variables - run: echo $SECRETS | base64 -d > lib/utils/environment.dart - env: - SECRETS: ${{ secrets.SECRETS }} - name: Set up Flutter run: flutter pub get - name: Generate files with Builder diff --git a/android/app/build.gradle b/android/app/build.gradle index 332eb13b..cfb50931 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -71,7 +71,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" // ReVanced - implementation "app.revanced:revanced-patcher:6.4.3" + implementation "app.revanced:revanced-patcher:7.0.0" // Signing & aligning implementation("org.bouncycastle:bcpkix-jdk15on:1.70") diff --git a/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt b/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt index e3da5972..352174a8 100644 --- a/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt +++ b/android/app/src/main/kotlin/app/revanced/manager/flutter/MainActivity.kt @@ -43,7 +43,6 @@ class MainActivity : FlutterActivity() { val integrationsPath = call.argument("integrationsPath") val selectedPatches = call.argument>("selectedPatches") val cacheDirPath = call.argument("cacheDirPath") - val mergeIntegrations = call.argument("mergeIntegrations") val keyStoreFilePath = call.argument("keyStoreFilePath") if (patchBundleFilePath != null && originalFilePath != null && @@ -53,7 +52,6 @@ class MainActivity : FlutterActivity() { integrationsPath != null && selectedPatches != null && cacheDirPath != null && - mergeIntegrations != null && keyStoreFilePath != null ) { runPatcher( @@ -66,7 +64,6 @@ class MainActivity : FlutterActivity() { integrationsPath, selectedPatches, cacheDirPath, - mergeIntegrations, keyStoreFilePath ) } else { @@ -88,7 +85,6 @@ class MainActivity : FlutterActivity() { integrationsPath: String, selectedPatches: List, cacheDirPath: String, - mergeIntegrations: Boolean, keyStoreFilePath: String ) { val originalFile = File(originalFilePath) @@ -139,19 +135,17 @@ class MainActivity : FlutterActivity() { mapOf("progress" to 0.3, "header" to "", "log" to "") ) } - if (mergeIntegrations) { - handler.post { - installerChannel.invokeMethod( - "update", - mapOf( - "progress" to 0.4, - "header" to "Merging integrations...", - "log" to "Merging integrations" - ) + handler.post { + installerChannel.invokeMethod( + "update", + mapOf( + "progress" to 0.4, + "header" to "Merging integrations...", + "log" to "Merging integrations" ) - } - patcher.addFiles(listOf(integrations)) {} + ) } + patcher.addIntegrations(listOf(integrations)) {} handler.post { installerChannel.invokeMethod( diff --git a/android/app/src/main/res/drawable-hdpi/ic_launcher_background.png b/android/app/src/main/res/drawable-hdpi/ic_launcher_background.png new file mode 100644 index 00000000..473330fe Binary files /dev/null and b/android/app/src/main/res/drawable-hdpi/ic_launcher_background.png differ diff --git a/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png index 6501a710..0616301e 100644 Binary files a/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png and b/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-mdpi/ic_launcher_background.png b/android/app/src/main/res/drawable-mdpi/ic_launcher_background.png new file mode 100644 index 00000000..f2e71489 Binary files /dev/null and b/android/app/src/main/res/drawable-mdpi/ic_launcher_background.png differ diff --git a/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png index aa226804..4a454727 100644 Binary files a/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png and b/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/ic_launcher_background.png b/android/app/src/main/res/drawable-xhdpi/ic_launcher_background.png new file mode 100644 index 00000000..5ebd9b9b Binary files /dev/null and b/android/app/src/main/res/drawable-xhdpi/ic_launcher_background.png differ diff --git a/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png index a6a49da2..af465feb 100644 Binary files a/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/ic_launcher_background.png b/android/app/src/main/res/drawable-xxhdpi/ic_launcher_background.png new file mode 100644 index 00000000..fbeb03fc Binary files /dev/null and b/android/app/src/main/res/drawable-xxhdpi/ic_launcher_background.png differ diff --git a/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png index 20aa3857..0c893628 100644 Binary files a/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_background.png b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_background.png new file mode 100644 index 00000000..b7b84772 Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_background.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png index 91c4efff..bc688ad3 100644 Binary files a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png and b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_monochrome.png b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_monochrome.png new file mode 100644 index 00000000..0872d688 Binary files /dev/null and b/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_monochrome.png differ diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index b26e945b..b51aeb83 100644 --- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,6 +1,6 @@ - + - + diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml deleted file mode 100644 index 278b2dcb..00000000 --- a/android/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #1B1B1B - diff --git a/android/build.gradle b/android/build.gradle index c93e8db2..2d13b78c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,6 +1,6 @@ buildscript { ext.cronetVersion = '102.5005.125' - ext.kotlin_version = '1.8.0' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index af82424a..50832291 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon May 09 12:07:41 MSK 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-rc-1-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/assets/i18n/en_US.json b/assets/i18n/en_US.json index 9490cc91..49a95bf5 100644 --- a/assets/i18n/en_US.json +++ b/assets/i18n/en_US.json @@ -79,8 +79,11 @@ "searchBarHint": "Search patches", "doneButton": "Done", "recommended": "Recommended", + "recommendedTooltip": "Select all recommended patches", "all": "All", + "allTooltip": "Select all patches", "none": "None", + "noneTooltip": "Deselect all patches", "loadPatchesSelection": "Load patches selection", "noSavedPatches": "No saved patches for the selected app.\nPress Done to save current selection.", "noPatchesFound": "No patches found for the selected app", @@ -145,8 +148,6 @@ "exportSectionTitle": "Import & export", "aboutLabel": "About", "snackbarMessage": "Copied to clipboard", - "sentryLabel": "Sentry logging", - "sentryHint": "Send anonymous logs to help us improve ReVanced Manager", "restartAppForChanges": "Restart the app to apply changes", "deleteKeystoreLabel": "Delete keystore", "deleteKeystoreHint": "Delete the keystore used to sign the app", diff --git a/lib/app/app.dart b/lib/app/app.dart index 2f10b09a..76c32b19 100644 --- a/lib/app/app.dart +++ b/lib/app/app.dart @@ -1,4 +1,3 @@ -import 'package:revanced_manager/services/crowdin_api.dart'; import 'package:revanced_manager/services/github_api.dart'; import 'package:revanced_manager/services/manager_api.dart'; import 'package:revanced_manager/services/patcher_api.dart'; @@ -38,7 +37,6 @@ import 'package:stacked_services/stacked_services.dart'; LazySingleton(classType: PatcherAPI), LazySingleton(classType: RevancedAPI), LazySingleton(classType: GithubAPI), - LazySingleton(classType: CrowdinAPI), LazySingleton(classType: Toast), ], ) diff --git a/lib/main.dart b/lib/main.dart index 9763504a..d34f9d66 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,15 +4,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:revanced_manager/app/app.locator.dart'; -import 'package:revanced_manager/services/crowdin_api.dart'; import 'package:revanced_manager/services/github_api.dart'; import 'package:revanced_manager/services/manager_api.dart'; import 'package:revanced_manager/services/patcher_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/views/navigation/navigation_view.dart'; -import 'package:revanced_manager/utils/environment.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:stacked_themes/stacked_themes.dart'; import 'package:timezone/data/latest.dart' as tz; @@ -25,36 +22,12 @@ Future main() async { await locator().initialize(); final String apiUrl = locator().getApiUrl(); await locator().initialize(apiUrl); - await locator().initialize(); - final bool isSentryEnabled = locator().isSentryEnabled(); final String repoUrl = locator().getRepoUrl(); locator().initialize(repoUrl); await locator().initialize(); tz.initializeTimeZones(); prefs = await SharedPreferences.getInstance(); - await SentryFlutter.init( - (options) { - options - ..dsn = isSentryEnabled ? Environment.sentryDSN : '' - ..environment = 'alpha' - ..release = '0.1' - ..tracesSampleRate = 1.0 - ..anrEnabled = true - ..enableOutOfMemoryTracking = true - ..sampleRate = isSentryEnabled ? 1.0 : 0.0 - ..beforeSend = (event, hint) { - if (isSentryEnabled) { - return event; - } else { - return null; - } - } as BeforeSendCallback?; - }, - appRunner: () { - runApp(const MyApp()); - }, - ); runApp(const MyApp()); } diff --git a/lib/services/crowdin_api.dart b/lib/services/crowdin_api.dart deleted file mode 100644 index 053d5a41..00000000 --- a/lib/services/crowdin_api.dart +++ /dev/null @@ -1,63 +0,0 @@ -import 'package:dio/dio.dart'; -import 'package:dio_http_cache_lts/dio_http_cache_lts.dart'; -import 'package:injectable/injectable.dart' hide Environment; -import 'package:revanced_manager/utils/environment.dart'; -import 'package:sentry_dio/sentry_dio.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; - -@lazySingleton -class CrowdinAPI { - late Dio _dio = Dio(); - final DioCacheManager _dioCacheManager = DioCacheManager(CacheConfig()); - final apiKey = Environment.crowdinKEY; - - Future initialize() async { - try { - _dio = Dio( - BaseOptions( - baseUrl: 'https://api.crowdin.com/api/v2', - ), - ); - - _dio.interceptors.add(_dioCacheManager.interceptor); - _dio.addSentry( - captureFailedRequests: true, - ); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); - } - } - - Future clearAllCache() async { - try { - await _dioCacheManager.clearAll(); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); - } - } - - Future getLanguages() async { - try { - final response = await _dio.get( - '/projects', - options: buildCacheOptions( - const Duration(hours: 6), - maxStale: const Duration(days: 1), - options: Options( - headers: { - 'Authorization': 'Bearer $apiKey', - }, - contentType: 'application/json', - ), - ), - ); - final List targetLanguages = - await response.data['data'][0]['data']['targetLanguages']; - - return targetLanguages; - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); - return []; - } - } -} diff --git a/lib/services/github_api.dart b/lib/services/github_api.dart index de4676e9..0af9fbb1 100644 --- a/lib/services/github_api.dart +++ b/lib/services/github_api.dart @@ -4,11 +4,10 @@ import 'dart:io'; import 'package:collection/collection.dart'; import 'package:dio/dio.dart'; import 'package:dio_http_cache_lts/dio_http_cache_lts.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:injectable/injectable.dart'; import 'package:revanced_manager/models/patch.dart'; -import 'package:sentry_dio/sentry_dio.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; @lazySingleton class GithubAPI { @@ -38,19 +37,20 @@ class GithubAPI { ); _dio.interceptors.add(_dioCacheManager.interceptor); - _dio.addSentry( - captureFailedRequests: true, - ); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } Future clearAllCache() async { try { await _dioCacheManager.clearAll(); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } @@ -61,8 +61,10 @@ class GithubAPI { options: _cacheOptions, ); return response.data[0]; - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return null; } } @@ -92,10 +94,12 @@ class GithubAPI { '\n' as String, ) .toList(); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); - return List.empty(); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } + return []; } Future getLatestReleaseFile(String extension, String repoName) async { @@ -112,9 +116,10 @@ class GithubAPI { ); } } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); - return null; + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } return null; } @@ -127,10 +132,12 @@ class GithubAPI { final List list = jsonDecode(f.readAsStringSync()); patches = list.map((patch) => Patch.fromJson(patch)).toList(); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); - return List.empty(); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } + return patches; } @@ -142,9 +149,12 @@ class GithubAPI { } else { return 'Unknown'; } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); - return ''; + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } + + return 'Unknown'; } } } diff --git a/lib/services/manager_api.dart b/lib/services/manager_api.dart index 2c79b3bc..c4eaeb60 100644 --- a/lib/services/manager_api.dart +++ b/lib/services/manager_api.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:device_apps/device_apps.dart'; +import 'package:flutter/foundation.dart'; import 'package:injectable/injectable.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:path_provider/path_provider.dart'; @@ -10,7 +11,6 @@ import 'package:revanced_manager/models/patched_application.dart'; import 'package:revanced_manager/services/github_api.dart'; import 'package:revanced_manager/services/revanced_api.dart'; import 'package:revanced_manager/services/root_api.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:shared_preferences/shared_preferences.dart'; @lazySingleton @@ -98,14 +98,6 @@ class ManagerAPI { await _prefs.setBool('useDarkTheme', value); } - bool isSentryEnabled() { - return _prefs.getBool('sentryEnabled') ?? true; - } - - Future setSentryStatus(bool value) async { - await _prefs.setBool('sentryEnabled', value); - } - bool areUniversalPatchesEnabled() { return _prefs.getBool('universalPatchesEnabled') ?? false; } @@ -179,8 +171,10 @@ class ManagerAPI { try { _revancedAPI.clearAllCache(); _githubAPI.clearAllCache(); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } @@ -196,8 +190,10 @@ class ManagerAPI { } else { return await _githubAPI.getPatches(repoName); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return []; } } @@ -213,8 +209,10 @@ class ManagerAPI { } else { return await _githubAPI.getLatestReleaseFile('.jar', repoName); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return null; } } @@ -230,8 +228,10 @@ class ManagerAPI { } else { return await _githubAPI.getLatestReleaseFile('.apk', repoName); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return null; } } diff --git a/lib/services/patcher_api.dart b/lib/services/patcher_api.dart index d5ba92b6..75e253a4 100644 --- a/lib/services/patcher_api.dart +++ b/lib/services/patcher_api.dart @@ -13,7 +13,6 @@ import 'package:revanced_manager/models/patch.dart'; import 'package:revanced_manager/models/patched_application.dart'; import 'package:revanced_manager/services/manager_api.dart'; import 'package:revanced_manager/services/root_api.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:share_extend/share_extend.dart'; @lazySingleton @@ -49,8 +48,10 @@ class PatcherAPI { if (_patches.isEmpty) { _patches = await _managerAPI.getPatches(); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } _patches = List.empty(); } } @@ -91,9 +92,10 @@ class PatcherAPI { filteredApps.add(app); } } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); - continue; + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } } @@ -122,25 +124,6 @@ class PatcherAPI { .toList(); } - bool dependencyNeedsIntegrations(String name) { - return name.contains('integrations') || - _patches.any( - (patch) => - patch.name == name && - (patch.dependencies.any( - (dep) => dependencyNeedsIntegrations(dep), - )), - ); - } - - Future needsIntegrations(List selectedPatches) async { - return selectedPatches.any( - (patch) => patch.dependencies.any( - (dep) => dependencyNeedsIntegrations(dep), - ), - ); - } - Future needsResourcePatching(List selectedPatches) async { return selectedPatches.any( (patch) => patch.dependencies.any( @@ -170,8 +153,10 @@ class PatcherAPI { ); } return originalFilePath; - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return originalFilePath; } } @@ -181,7 +166,6 @@ class PatcherAPI { String originalFilePath, List selectedPatches, ) async { - final bool mergeIntegrations = await needsIntegrations(selectedPatches); final bool includeSettings = await needsSettingsPatch(selectedPatches); if (includeSettings) { try { @@ -193,16 +177,14 @@ class PatcherAPI { if (settingsPatch != null) { selectedPatches.add(settingsPatch); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); - // ignore + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } final File? patchBundleFile = await _managerAPI.downloadPatches(); - File? integrationsFile; - if (mergeIntegrations) { - integrationsFile = await _managerAPI.downloadIntegrations(); - } + final File? integrationsFile = await _managerAPI.downloadIntegrations(); if (patchBundleFile != null) { _dataDir.createSync(); _tmpDir.createSync(); @@ -224,18 +206,16 @@ class PatcherAPI { 'inputFilePath': inputFile.path, 'patchedFilePath': patchedFile.path, 'outFilePath': _outFile!.path, - 'integrationsPath': mergeIntegrations ? integrationsFile!.path : '', + 'integrationsPath': integrationsFile!.path, 'selectedPatches': selectedPatches.map((p) => p.name).toList(), 'cacheDirPath': cacheDir.path, - 'mergeIntegrations': mergeIntegrations, 'keyStoreFilePath': _keyStoreFile.path, }, ); - } on Exception catch (e, s) { + } on Exception catch (e) { if (kDebugMode) { print(e); } - throw await Sentry.captureException(e, stackTrace: s); } } } @@ -256,8 +236,10 @@ class PatcherAPI { await AppInstaller.installApk(_outFile!.path); return await DeviceApps.isAppInstalled(patchedApp.packageName); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return false; } } @@ -268,11 +250,17 @@ class PatcherAPI { try { if (_outFile != null) { final String newName = _getFileName(appName, version); - CRFileSaver.saveFileWithDialog(SaveFileDialogParams( - sourceFilePath: _outFile!.path, destinationFileName: newName,),); + CRFileSaver.saveFileWithDialog( + SaveFileDialogParams( + sourceFilePath: _outFile!.path, + destinationFileName: newName, + ), + ); + } + } on Exception catch (e) { + if (kDebugMode) { + print(e); } - } on Exception catch (e, s) { - Sentry.captureException(e, stackTrace: s); } } @@ -286,8 +274,10 @@ class PatcherAPI { final File shareFile = _outFile!.copySync(newPath); ShareExtend.share(shareFile.path, 'file'); } - } on Exception catch (e, s) { - Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } diff --git a/lib/services/revanced_api.dart b/lib/services/revanced_api.dart index fb78d63c..f7626d45 100644 --- a/lib/services/revanced_api.dart +++ b/lib/services/revanced_api.dart @@ -4,13 +4,12 @@ import 'dart:io'; import 'package:collection/collection.dart'; import 'package:dio/dio.dart'; import 'package:dio_http_cache_lts/dio_http_cache_lts.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'package:injectable/injectable.dart'; import 'package:native_dio_client/native_dio_client.dart'; import 'package:revanced_manager/models/patch.dart'; import 'package:revanced_manager/utils/check_for_gms.dart'; -import 'package:sentry_dio/sentry_dio.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:timeago/timeago.dart'; @lazySingleton @@ -42,19 +41,20 @@ class RevancedAPI { log('ReVanced API: Using CronetEngine + $isGMSInstalled'); } _dio.interceptors.add(_dioCacheManager.interceptor); - _dio.addSentry( - captureFailedRequests: true, - ); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } Future clearAllCache() async { try { await _dioCacheManager.clearAll(); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } @@ -67,8 +67,10 @@ class RevancedAPI { final String name = repo['name']; contributors[name] = repo['contributors']; } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return {}; } return contributors; @@ -79,8 +81,10 @@ class RevancedAPI { final response = await _dio.get('/patches', options: _cacheOptions); final List patches = response.data; return patches.map((patch) => Patch.fromJson(patch)).toList(); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return List.empty(); } } @@ -97,8 +101,10 @@ class RevancedAPI { t['repository'] == repoName && (t['name'] as String).endsWith(extension), ); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return null; } } @@ -115,8 +121,10 @@ class RevancedAPI { if (release != null) { return release['version']; } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return null; } return null; @@ -132,8 +140,10 @@ class RevancedAPI { final String url = release['browser_download_url']; return await DefaultCacheManager().getSingleFile(url); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return null; } return null; @@ -153,8 +163,10 @@ class RevancedAPI { DateTime.parse(release['timestamp'] as String); return format(timestamp, locale: 'en_short'); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return null; } return null; diff --git a/lib/services/root_api.dart b/lib/services/root_api.dart index 0153848d..727bac1d 100644 --- a/lib/services/root_api.dart +++ b/lib/services/root_api.dart @@ -1,5 +1,5 @@ +import 'package:flutter/foundation.dart'; import 'package:root/root.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; class RootAPI { final String _managerDirPath = '/data/local/tmp/revanced-manager'; @@ -10,8 +10,10 @@ class RootAPI { try { final bool? isRooted = await Root.isRootAvailable(); return isRooted != null && isRooted; - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return false; } } @@ -24,8 +26,10 @@ class RootAPI { return isRooted != null && isRooted; } return false; - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return false; } } @@ -78,8 +82,10 @@ class RootAPI { apps.removeWhere((pack) => pack.isEmpty); return apps.map((pack) => pack.trim()).toList(); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return List.empty(); } return List.empty(); @@ -125,8 +131,10 @@ class RootAPI { await installApk(packageName, patchedFilePath); await mountApk(packageName, originalFilePath); return true; - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return false; } } diff --git a/lib/theme.dart b/lib/theme.dart index 8affd911..89c93d52 100644 --- a/lib/theme.dart +++ b/lib/theme.dart @@ -12,7 +12,7 @@ var lightCustomTheme = ThemeData( navigationBarTheme: NavigationBarThemeData( labelTextStyle: MaterialStateProperty.all( TextStyle( - color: lightCustomColorScheme.secondary, + color: lightCustomColorScheme.onSurface, fontWeight: FontWeight.w500, ), ), @@ -33,13 +33,12 @@ var darkCustomTheme = ThemeData( navigationBarTheme: NavigationBarThemeData( labelTextStyle: MaterialStateProperty.all( TextStyle( - color: darkCustomColorScheme.secondary, + color: darkCustomColorScheme.onSurface, fontWeight: FontWeight.w500, ), ), ), canvasColor: const Color(0xff1B1A1D), scaffoldBackgroundColor: const Color(0xff1B1A1D), - toggleableActiveColor: const Color(0xffA5CAFF), textTheme: GoogleFonts.robotoTextTheme(ThemeData.dark().textTheme), ); diff --git a/lib/ui/theme/dynamic_theme_builder.dart b/lib/ui/theme/dynamic_theme_builder.dart index e1fd96b5..65d74c2c 100644 --- a/lib/ui/theme/dynamic_theme_builder.dart +++ b/lib/ui/theme/dynamic_theme_builder.dart @@ -23,48 +23,28 @@ class DynamicThemeBuilder extends StatelessWidget { builder: (lightColorScheme, darkColorScheme) { final ThemeData lightDynamicTheme = ThemeData( useMaterial3: true, - canvasColor: lightColorScheme?.surface, navigationBarTheme: NavigationBarThemeData( - backgroundColor: lightColorScheme?.surface, - indicatorColor: lightColorScheme?.secondaryContainer, labelTextStyle: MaterialStateProperty.all( GoogleFonts.roboto( color: lightColorScheme?.onSurface, fontWeight: FontWeight.w500, ), ), - iconTheme: MaterialStateProperty.all( - IconThemeData( - color: lightColorScheme?.onSecondaryContainer, - ), - ), ), - scaffoldBackgroundColor: lightColorScheme?.surface, colorScheme: lightColorScheme?.harmonized(), - toggleableActiveColor: lightColorScheme?.primary, textTheme: GoogleFonts.robotoTextTheme(ThemeData.light().textTheme), ); final ThemeData darkDynamicTheme = ThemeData( useMaterial3: true, - canvasColor: darkColorScheme?.surface, navigationBarTheme: NavigationBarThemeData( - backgroundColor: darkColorScheme?.surface, - indicatorColor: darkColorScheme?.secondaryContainer, labelTextStyle: MaterialStateProperty.all( GoogleFonts.roboto( color: darkColorScheme?.onSurface, fontWeight: FontWeight.w500, ), ), - iconTheme: MaterialStateProperty.all( - IconThemeData( - color: darkColorScheme?.onSecondaryContainer, - ), - ), ), - scaffoldBackgroundColor: darkColorScheme?.surface, colorScheme: darkColorScheme?.harmonized(), - toggleableActiveColor: darkColorScheme?.primary, textTheme: GoogleFonts.robotoTextTheme(ThemeData.dark().textTheme), ); return DynamicTheme( @@ -90,4 +70,4 @@ class DynamicThemeBuilder extends StatelessWidget { }, ); } -} \ No newline at end of file +} diff --git a/lib/ui/views/app_selector/app_selector_view.dart b/lib/ui/views/app_selector/app_selector_view.dart index 8e661674..ea2c9264 100644 --- a/lib/ui/views/app_selector/app_selector_view.dart +++ b/lib/ui/views/app_selector/app_selector_view.dart @@ -41,14 +41,14 @@ class _AppSelectorViewState extends State { child: Text( '', style: TextStyle( - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), ), ), leading: IconButton( icon: Icon( Icons.arrow_back, - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), onPressed: () => Navigator.of(context).pop(), ), diff --git a/lib/ui/views/app_selector/app_selector_viewmodel.dart b/lib/ui/views/app_selector/app_selector_viewmodel.dart index d7019ae7..21d21d96 100644 --- a/lib/ui/views/app_selector/app_selector_viewmodel.dart +++ b/lib/ui/views/app_selector/app_selector_viewmodel.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:device_apps/device_apps.dart'; import 'package:file_picker/file_picker.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:revanced_manager/app/app.locator.dart'; import 'package:revanced_manager/models/patched_application.dart'; @@ -9,7 +10,6 @@ import 'package:revanced_manager/services/manager_api.dart'; import 'package:revanced_manager/services/patcher_api.dart'; import 'package:revanced_manager/services/toast.dart'; import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:stacked/stacked.dart'; class AppSelectorViewModel extends BaseViewModel { @@ -87,8 +87,10 @@ class AppSelectorViewModel extends BaseViewModel { locator().loadLastSelectedPatches(); } } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } _toast.showBottom('appSelectorView.errorMessage'); } } diff --git a/lib/ui/views/contributors/contributors_view.dart b/lib/ui/views/contributors/contributors_view.dart index ddc66267..3ebebd7a 100644 --- a/lib/ui/views/contributors/contributors_view.dart +++ b/lib/ui/views/contributors/contributors_view.dart @@ -23,7 +23,7 @@ class ContributorsView extends StatelessWidget { child: Text( '', style: GoogleFonts.inter( - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), ), ), diff --git a/lib/ui/views/home/home_view.dart b/lib/ui/views/home/home_view.dart index 892cab49..4d067d5c 100644 --- a/lib/ui/views/home/home_view.dart +++ b/lib/ui/views/home/home_view.dart @@ -7,7 +7,6 @@ import 'package:revanced_manager/ui/views/home/home_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/homeView/available_updates_card.dart'; import 'package:revanced_manager/ui/widgets/homeView/installed_apps_card.dart'; import 'package:revanced_manager/ui/widgets/homeView/latest_commit_card.dart'; -import 'package:revanced_manager/ui/widgets/shared/custom_chip.dart'; import 'package:revanced_manager/ui/widgets/shared/custom_sliver_app_bar.dart'; import 'package:stacked/stacked.dart'; @@ -22,8 +21,6 @@ class HomeView extends StatelessWidget { viewModelBuilder: () => locator(), builder: (context, model, child) => Scaffold( body: RefreshIndicator( - color: Theme.of(context).colorScheme.secondary, - backgroundColor: Theme.of(context).colorScheme.secondaryContainer, onRefresh: () => model.forceRefresh(context), child: CustomScrollView( slivers: [ @@ -34,7 +31,7 @@ class HomeView extends StatelessWidget { child: Text( '', style: GoogleFonts.inter( - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), ), ), @@ -48,7 +45,7 @@ class HomeView extends StatelessWidget { 'homeView.updatesSubtitle', child: Text( '', - style: Theme.of(context).textTheme.headline6, + style: Theme.of(context).textTheme.titleLarge, ), ), const SizedBox(height: 10), @@ -61,27 +58,53 @@ class HomeView extends StatelessWidget { 'homeView.patchedSubtitle', child: Text( '', - style: Theme.of(context).textTheme.headline6, + style: Theme.of(context).textTheme.titleLarge, ), ), const SizedBox(height: 8), Row( children: [ - CustomChip( + ActionChip( + avatar: const Icon(Icons.grid_view), label: I18nText('homeView.installed'), - isSelected: !model.showUpdatableApps, - onSelected: (value) { + side: BorderSide( + color: model.showUpdatableApps + ? Theme.of(context).colorScheme.outline + : Theme.of(context) + .colorScheme + .secondaryContainer, + width: model.showUpdatableApps ? 1 : 1, + ), + backgroundColor: model.showUpdatableApps + ? Theme.of(context).colorScheme.background + : Theme.of(context) + .colorScheme + .secondaryContainer, + onPressed: () { model.toggleUpdatableApps(false); }, ), const SizedBox(width: 10), - CustomChip( + ActionChip( + avatar: const Icon(Icons.update), label: I18nText('homeView.updatesAvailable'), - isSelected: model.showUpdatableApps, - onSelected: (value) { + side: BorderSide( + color: !model.showUpdatableApps + ? Theme.of(context).colorScheme.outline + : Theme.of(context) + .colorScheme + .secondaryContainer, + width: !model.showUpdatableApps ? 1 : 1, + ), + backgroundColor: !model.showUpdatableApps + ? Theme.of(context).colorScheme.background + : Theme.of(context) + .colorScheme + .secondaryContainer, + onPressed: () { model.toggleUpdatableApps(true); }, - ) + ), ], ), const SizedBox(height: 14), diff --git a/lib/ui/views/home/home_viewmodel.dart b/lib/ui/views/home/home_viewmodel.dart index d09ed202..ac553061 100644 --- a/lib/ui/views/home/home_viewmodel.dart +++ b/lib/ui/views/home/home_viewmodel.dart @@ -4,6 +4,7 @@ import 'dart:io'; import 'package:app_installer/app_installer.dart'; import 'package:cross_connectivity/cross_connectivity.dart'; import 'package:device_apps/device_apps.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; @@ -18,7 +19,6 @@ import 'package:revanced_manager/services/toast.dart'; import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart'; import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/homeView/update_confirmation_dialog.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:stacked/stacked.dart'; import 'package:stacked_services/stacked_services.dart'; import 'package:timezone/timezone.dart' as tz; @@ -95,8 +95,10 @@ class HomeViewModel extends BaseViewModel { final int currentVersionInt = int.parse(currentVersion.replaceAll(RegExp('[^0-9]'), '')); return latestVersionInt > currentVersionInt; - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } return false; } } @@ -137,8 +139,10 @@ class HomeViewModel extends BaseViewModel { } else { _toast.showBottom('homeView.errorDownloadMessage'); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } _toast.showBottom('homeView.errorInstallMessage'); } } diff --git a/lib/ui/views/installer/installer_view.dart b/lib/ui/views/installer/installer_view.dart index d9ceda75..0a2c5487 100644 --- a/lib/ui/views/installer/installer_view.dart +++ b/lib/ui/views/installer/installer_view.dart @@ -28,7 +28,7 @@ class InstallerView extends StatelessWidget { title: Text( model.headerLogs, style: GoogleFonts.inter( - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), ), onBackButtonPressed: () => model.onWillPop(context), diff --git a/lib/ui/views/installer/installer_viewmodel.dart b/lib/ui/views/installer/installer_viewmodel.dart index fb891795..c1523dab 100644 --- a/lib/ui/views/installer/installer_viewmodel.dart +++ b/lib/ui/views/installer/installer_viewmodel.dart @@ -1,5 +1,6 @@ // ignore_for_file: use_build_context_synchronously import 'package:device_apps/device_apps.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_background/flutter_background.dart'; @@ -14,7 +15,6 @@ import 'package:revanced_manager/services/root_api.dart'; import 'package:revanced_manager/services/toast.dart'; import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:stacked/stacked.dart'; import 'package:wakelock/wakelock.dart'; @@ -56,9 +56,10 @@ class InstallerViewModel extends BaseViewModel { ), ), ).then((value) => FlutterBackground.enableBackgroundExecution()); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); - // ignore + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } // ignore } } await Wakelock.enable(); @@ -131,14 +132,15 @@ class InstallerViewModel extends BaseViewModel { _app.apkFilePath, _patches, ); - } on Exception catch (e, s) { + } on Exception catch (e) { update( -100.0, 'Aborting...', 'An error occurred! Aborting\nError:\n$e', ); - await Sentry.captureException(e, stackTrace: s); - throw await Sentry.captureException(e, stackTrace: s); + if (kDebugMode) { + print(e); + } } } else { update(-100.0, 'Aborting...', 'No app or patches selected! Aborting'); @@ -146,14 +148,17 @@ class InstallerViewModel extends BaseViewModel { if (FlutterBackground.isBackgroundExecutionEnabled) { try { FlutterBackground.disableBackgroundExecution(); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); - // ignore + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } // ignore } } await Wakelock.disable(); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } @@ -211,24 +216,30 @@ class InstallerViewModel extends BaseViewModel { await _managerAPI.savePatchedApp(_app); } } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } void exportResult() { try { _patcherAPI.exportPatchedFile(_app.name, _app.version); - } on Exception catch (e, s) { - Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } void shareResult() { try { _patcherAPI.sharePatchedFile(_app.name, _app.version); - } on Exception catch (e, s) { - Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } @@ -242,8 +253,10 @@ class InstallerViewModel extends BaseViewModel { locator().selectedApp = null; locator().selectedPatches.clear(); locator().notifyListeners(); - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } diff --git a/lib/ui/views/navigation/navigation_view.dart b/lib/ui/views/navigation/navigation_view.dart index d8fdd5c6..2a78f933 100644 --- a/lib/ui/views/navigation/navigation_view.dart +++ b/lib/ui/views/navigation/navigation_view.dart @@ -42,7 +42,6 @@ class NavigationView extends StatelessWidget { context, 'navigationView.dashboardTab', ), - tooltip: '', ), NavigationDestination( icon: model.isIndexSelected(1) @@ -52,7 +51,6 @@ class NavigationView extends StatelessWidget { context, 'navigationView.patcherTab', ), - tooltip: '', ), NavigationDestination( icon: model.isIndexSelected(2) @@ -62,7 +60,6 @@ class NavigationView extends StatelessWidget { context, 'navigationView.settingsTab', ), - tooltip: '', ), ], ), diff --git a/lib/ui/views/patcher/patcher_view.dart b/lib/ui/views/patcher/patcher_view.dart index de73d07e..38af615d 100644 --- a/lib/ui/views/patcher/patcher_view.dart +++ b/lib/ui/views/patcher/patcher_view.dart @@ -34,7 +34,7 @@ class PatcherView extends StatelessWidget { child: Text( '', style: GoogleFonts.inter( - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), ), ), diff --git a/lib/ui/views/patcher/patcher_viewmodel.dart b/lib/ui/views/patcher/patcher_viewmodel.dart index eaac984e..4b7bdddd 100644 --- a/lib/ui/views/patcher/patcher_viewmodel.dart +++ b/lib/ui/views/patcher/patcher_viewmodel.dart @@ -52,31 +52,33 @@ class PatcherViewModel extends BaseViewModel { Future showPatchConfirmationDialog(BuildContext context) async { final bool isValid = await isValidPatchConfig(); - if (isValid) { - navigateToInstaller(); - } else { - return showDialog( - context: context, - builder: (context) => AlertDialog( - title: I18nText('warning'), - backgroundColor: Theme.of(context).colorScheme.secondaryContainer, - content: I18nText('patcherView.patchDialogText'), - actions: [ - CustomMaterialButton( - isFilled: false, - label: I18nText('noButton'), - onPressed: () => Navigator.of(context).pop(), - ), - CustomMaterialButton( - label: I18nText('yesButton'), - onPressed: () { - Navigator.of(context).pop(); - navigateToInstaller(); - }, - ) - ], - ), - ); + if (context.mounted) { + if (isValid) { + navigateToInstaller(); + } else { + return showDialog( + context: context, + builder: (context) => AlertDialog( + title: I18nText('warning'), + backgroundColor: Theme.of(context).colorScheme.secondaryContainer, + content: I18nText('patcherView.patchDialogText'), + actions: [ + CustomMaterialButton( + isFilled: false, + label: I18nText('noButton'), + onPressed: () => Navigator.of(context).pop(), + ), + CustomMaterialButton( + label: I18nText('yesButton'), + onPressed: () { + Navigator.of(context).pop(); + navigateToInstaller(); + }, + ) + ], + ), + ); + } } } @@ -114,7 +116,8 @@ class PatcherViewModel extends BaseViewModel { await _managerAPI.getSelectedPatches(selectedApp!.originalPackageName); final List patches = _patcherAPI.getFilteredPatches(selectedApp!.originalPackageName); - this.selectedPatches + this + .selectedPatches .addAll(patches.where((patch) => selectedPatches.contains(patch.name))); notifyListeners(); } diff --git a/lib/ui/views/patches_selector/patches_selector_view.dart b/lib/ui/views/patches_selector/patches_selector_view.dart index dcff7409..91f75c9c 100644 --- a/lib/ui/views/patches_selector/patches_selector_view.dart +++ b/lib/ui/views/patches_selector/patches_selector_view.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/patchesSelectorView/patch_item.dart'; -import 'package:revanced_manager/ui/widgets/shared/custom_chip.dart'; import 'package:revanced_manager/ui/widgets/shared/custom_popup_menu.dart'; import 'package:revanced_manager/ui/widgets/shared/search_bar.dart'; import 'package:stacked/stacked.dart'; @@ -50,14 +49,14 @@ class _PatchesSelectorViewState extends State { child: Text( '', style: TextStyle( - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), ), ), leading: IconButton( icon: Icon( Icons.arrow_back, - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), onPressed: () => Navigator.of(context).pop(), ), @@ -74,7 +73,7 @@ class _PatchesSelectorViewState extends State { child: Text( model.patchesVersion!, style: TextStyle( - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), ), ), @@ -135,27 +134,36 @@ class _PatchesSelectorViewState extends State { children: [ Row( children: [ - CustomChip( - label: - I18nText('patchesSelectorView.recommended'), - onSelected: (value) { + ActionChip( + label: I18nText('patchesSelectorView.recommended'), + tooltip: FlutterI18n.translate( + context, + 'patchesSelectorView.recommendedTooltip', + ), + onPressed: () { model.selectRecommendedPatches(); }, ), const SizedBox(width: 8), - CustomChip( + ActionChip( label: I18nText('patchesSelectorView.all'), - onSelected: (value) { - if (value) { - model.selectAllPatcherWarning(context); - } + tooltip: FlutterI18n.translate( + context, + 'patchesSelectorView.allTooltip', + ), + onPressed: () { + model.selectAllPatcherWarning(context); model.selectAllPatches(true); }, ), const SizedBox(width: 8), - CustomChip( + ActionChip( label: I18nText('patchesSelectorView.none'), - onSelected: (value) { + tooltip: FlutterI18n.translate( + context, + 'patchesSelectorView.noneTooltip', + ), + onPressed: () { model.clearPatches(); }, ), diff --git a/lib/ui/views/settings/settingsFragement/settings_manage_api_url.dart b/lib/ui/views/settings/settingsFragment/settings_manage_api_url.dart similarity index 100% rename from lib/ui/views/settings/settingsFragement/settings_manage_api_url.dart rename to lib/ui/views/settings/settingsFragment/settings_manage_api_url.dart diff --git a/lib/ui/views/settings/settingsFragement/settings_manage_sources.dart b/lib/ui/views/settings/settingsFragment/settings_manage_sources.dart similarity index 98% rename from lib/ui/views/settings/settingsFragement/settings_manage_sources.dart rename to lib/ui/views/settings/settingsFragment/settings_manage_sources.dart index 10b3e64d..72825aee 100644 --- a/lib/ui/views/settings/settingsFragement/settings_manage_sources.dart +++ b/lib/ui/views/settings/settingsFragment/settings_manage_sources.dart @@ -152,8 +152,6 @@ class SManageSources extends BaseViewModel { _managerAPI.setPatchesRepo(''); _managerAPI.setIntegrationsRepo(''); Navigator.of(context).pop(); - Navigator.of(context).pop(); - Navigator.of(context).pop(); }, ) ], diff --git a/lib/ui/views/settings/settingsFragement/settings_update_language.dart b/lib/ui/views/settings/settingsFragment/settings_update_language.dart similarity index 95% rename from lib/ui/views/settings/settingsFragement/settings_update_language.dart rename to lib/ui/views/settings/settingsFragment/settings_update_language.dart index 833d4a87..66bb2c3e 100644 --- a/lib/ui/views/settings/settingsFragement/settings_update_language.dart +++ b/lib/ui/views/settings/settingsFragment/settings_update_language.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:revanced_manager/app/app.locator.dart'; import 'package:revanced_manager/main.dart'; -import 'package:revanced_manager/services/crowdin_api.dart'; import 'package:revanced_manager/services/toast.dart'; import 'package:revanced_manager/ui/views/navigation/navigation_viewmodel.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; @@ -16,7 +15,6 @@ import 'package:timeago/timeago.dart' as timeago; final _settingViewModel = SettingsViewModel(); class SUpdateLanguage extends BaseViewModel { - final CrowdinAPI _crowdinAPI = locator(); final Toast _toast = locator(); late SharedPreferences _prefs; String selectedLanguage = 'English'; @@ -43,7 +41,6 @@ class SUpdateLanguage extends BaseViewModel { } Future initLang() async { - languages = await _crowdinAPI.getLanguages(); languages.sort((a, b) => a['name'].compareTo(b['name'])); notifyListeners(); } diff --git a/lib/ui/views/settings/settingsFragement/settings_update_theme.dart b/lib/ui/views/settings/settingsFragment/settings_update_theme.dart similarity index 86% rename from lib/ui/views/settings/settingsFragement/settings_update_theme.dart rename to lib/ui/views/settings/settingsFragment/settings_update_theme.dart index efc54042..684abc96 100644 --- a/lib/ui/views/settings/settingsFragement/settings_update_theme.dart +++ b/lib/ui/views/settings/settingsFragment/settings_update_theme.dart @@ -7,7 +7,6 @@ import 'package:flutter_i18n/widgets/I18nText.dart'; import 'package:revanced_manager/app/app.locator.dart'; import 'package:revanced_manager/services/manager_api.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; -import 'package:revanced_manager/ui/widgets/settingsView/custom_switch_tile.dart'; import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart'; import 'package:stacked/stacked.dart'; @@ -64,8 +63,8 @@ class SUpdateThemeUI extends StatelessWidget { return SettingsSection( title: 'settingsView.appearanceSectionTitle', children: [ - CustomSwitchTile( - padding: const EdgeInsets.symmetric(horizontal: 20.0), + SwitchListTile( + contentPadding: const EdgeInsets.symmetric(horizontal: 20.0), title: I18nText( 'settingsView.darkThemeLabel', child: const Text( @@ -78,7 +77,7 @@ class SUpdateThemeUI extends StatelessWidget { ), subtitle: I18nText('settingsView.darkThemeHint'), value: SUpdateTheme().getDarkThemeStatus(), - onTap: (value) => SUpdateTheme().setUseDarkTheme( + onChanged: (value) => SUpdateTheme().setUseDarkTheme( context, value, ), @@ -88,8 +87,8 @@ class SUpdateThemeUI extends StatelessWidget { builder: (context, snapshot) => Visibility( visible: snapshot.hasData && snapshot.data! >= ANDROID_12_SDK_VERSION, - child: CustomSwitchTile( - padding: const EdgeInsets.symmetric(horizontal: 20.0), + child: SwitchListTile( + contentPadding: const EdgeInsets.symmetric(horizontal: 20.0), title: I18nText( 'settingsView.dynamicThemeLabel', child: const Text( @@ -102,11 +101,12 @@ class SUpdateThemeUI extends StatelessWidget { ), subtitle: I18nText('settingsView.dynamicThemeHint'), value: _settingViewModel.sUpdateTheme.getDynamicThemeStatus(), - onTap: (value) => - _settingViewModel.sUpdateTheme.setUseDynamicTheme( - context, - value, - ), + onChanged: (value) => { + _settingViewModel.sUpdateTheme.setUseDynamicTheme( + context, + value, + ), + }, ), ), ), diff --git a/lib/ui/views/settings/settings_view.dart b/lib/ui/views/settings/settings_view.dart index 01d461e1..e1002b40 100644 --- a/lib/ui/views/settings/settings_view.dart +++ b/lib/ui/views/settings/settings_view.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_i18n/flutter_i18n.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:revanced_manager/ui/views/settings/settingsFragement/settings_update_theme.dart'; +import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_update_theme.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/settingsView/settings_advanced_section.dart'; import 'package:revanced_manager/ui/widgets/settingsView/settings_export_section.dart'; @@ -32,7 +32,7 @@ class SettingsView extends StatelessWidget { child: Text( '', style: GoogleFonts.inter( - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), ), ), @@ -49,8 +49,6 @@ class SettingsView extends StatelessWidget { _settingsDivider, SExportSection(), _settingsDivider, - // SLoggingSection(), - // _settingsDivider, SInfoSection(), ], ), diff --git a/lib/ui/views/settings/settings_viewmodel.dart b/lib/ui/views/settings/settings_viewmodel.dart index 502b7a1e..65df575e 100644 --- a/lib/ui/views/settings/settings_viewmodel.dart +++ b/lib/ui/views/settings/settings_viewmodel.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:cr_file_saver/file_saver.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:file_picker/file_picker.dart'; +import 'package:flutter/foundation.dart'; import 'package:logcat/logcat.dart'; import 'package:path_provider/path_provider.dart'; import 'package:revanced_manager/app/app.locator.dart'; @@ -9,9 +10,8 @@ import 'package:revanced_manager/app/app.router.dart'; import 'package:revanced_manager/services/manager_api.dart'; import 'package:revanced_manager/services/toast.dart'; import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart'; -import 'package:revanced_manager/ui/views/settings/settingsFragement/settings_update_language.dart'; -import 'package:revanced_manager/ui/views/settings/settingsFragement/settings_update_theme.dart'; -import 'package:sentry_flutter/sentry_flutter.dart'; +import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_update_language.dart'; +import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_update_theme.dart'; import 'package:share_extend/share_extend.dart'; import 'package:stacked/stacked.dart'; import 'package:stacked_services/stacked_services.dart'; @@ -28,16 +28,6 @@ class SettingsViewModel extends BaseViewModel { _navigationService.navigateTo(Routes.contributorsView); } - bool isSentryEnabled() { - return _managerAPI.isSentryEnabled(); - } - - void useSentry(bool value) { - _managerAPI.setSentryStatus(value); - _toast.showBottom('settingsView.restartAppForChanges'); - notifyListeners(); - } - bool areUniversalPatchesEnabled() { return _managerAPI.areUniversalPatchesEnabled(); } @@ -74,14 +64,20 @@ class SettingsViewModel extends BaseViewModel { if (outFile.existsSync()) { final String dateTime = DateTime.now().toString().replaceAll(' ', '_').split('.').first; - await CRFileSaver.saveFileWithDialog(SaveFileDialogParams( - sourceFilePath: outFile.path, destinationFileName: 'selected_patches_$dateTime.json',),); + await CRFileSaver.saveFileWithDialog( + SaveFileDialogParams( + sourceFilePath: outFile.path, + destinationFileName: 'selected_patches_$dateTime.json', + ), + ); _toast.showBottom('settingsView.exportedPatches'); } else { _toast.showBottom('settingsView.noExportFileFound'); } - } on Exception catch (e, s) { - Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } } } @@ -100,8 +96,10 @@ class SettingsViewModel extends BaseViewModel { } _toast.showBottom('settingsView.importedPatches'); } - } on Exception catch (e, s) { - await Sentry.captureException(e, stackTrace: s); + } on Exception catch (e) { + if (kDebugMode) { + print(e); + } _toast.showBottom('settingsView.jsonSelectorErrorMessage'); } } diff --git a/lib/ui/widgets/appInfoView/app_info_view.dart b/lib/ui/widgets/appInfoView/app_info_view.dart index b1e0b3cb..ade295ff 100644 --- a/lib/ui/widgets/appInfoView/app_info_view.dart +++ b/lib/ui/widgets/appInfoView/app_info_view.dart @@ -27,7 +27,7 @@ class AppInfoView extends StatelessWidget { child: Text( '', style: GoogleFonts.inter( - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), ), ), @@ -51,13 +51,13 @@ class AppInfoView extends StatelessWidget { Text( app.name, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.headline6, + style: Theme.of(context).textTheme.titleLarge, ), const SizedBox(height: 4), Text( app.version, textAlign: TextAlign.center, - style: Theme.of(context).textTheme.subtitle1, + style: Theme.of(context).textTheme.titleLarge, ), const SizedBox(height: 20), Padding( diff --git a/lib/ui/widgets/homeView/available_updates_card.dart b/lib/ui/widgets/homeView/available_updates_card.dart index db341b6f..a1405ebd 100644 --- a/lib/ui/widgets/homeView/available_updates_card.dart +++ b/lib/ui/widgets/homeView/available_updates_card.dart @@ -28,7 +28,7 @@ class AvailableUpdatesCard extends StatelessWidget { child: Text( '', textAlign: TextAlign.center, - style: Theme.of(context).textTheme.subtitle1!.copyWith( + style: Theme.of(context).textTheme.titleMedium!.copyWith( color: Theme.of(context).colorScheme.secondary, ), ), @@ -53,7 +53,7 @@ class AvailableUpdatesCard extends StatelessWidget { // child: Text( // '', // textAlign: TextAlign.center, - // style: Theme.of(context).textTheme.subtitle1!.copyWith( + // style: Theme.of(context).textTheme.titleMedium!.copyWith( // color: Theme.of(context).colorScheme.secondary, // ), // ), diff --git a/lib/ui/widgets/homeView/installed_apps_card.dart b/lib/ui/widgets/homeView/installed_apps_card.dart index 81917d5b..2eb1119c 100644 --- a/lib/ui/widgets/homeView/installed_apps_card.dart +++ b/lib/ui/widgets/homeView/installed_apps_card.dart @@ -30,7 +30,7 @@ class InstalledAppsCard extends StatelessWidget { child: Text( '', textAlign: TextAlign.center, - style: Theme.of(context).textTheme.subtitle1!.copyWith( + style: Theme.of(context).textTheme.titleMedium!.copyWith( color: Theme.of(context).colorScheme.secondary, ), ), diff --git a/lib/ui/widgets/patchesSelectorView/patch_options_fields.dart b/lib/ui/widgets/patchesSelectorView/patch_options_fields.dart index 9cac726d..3f40e4a5 100644 --- a/lib/ui/widgets/patchesSelectorView/patch_options_fields.dart +++ b/lib/ui/widgets/patchesSelectorView/patch_options_fields.dart @@ -61,7 +61,7 @@ class OptionsFilePicker extends StatelessWidget { child: Text( 'Select File', style: TextStyle( - color: Theme.of(context).textTheme.bodyText1?.color, + color: Theme.of(context).textTheme.bodyLarge?.color, ), ), ), diff --git a/lib/ui/widgets/settingsView/settings_advanced_section.dart b/lib/ui/widgets/settingsView/settings_advanced_section.dart index 73a4de55..2dda210e 100644 --- a/lib/ui/widgets/settingsView/settings_advanced_section.dart +++ b/lib/ui/widgets/settingsView/settings_advanced_section.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_i18n/widgets/I18nText.dart'; -import 'package:revanced_manager/ui/views/settings/settingsFragement/settings_manage_api_url.dart'; -import 'package:revanced_manager/ui/views/settings/settingsFragement/settings_manage_sources.dart'; +import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_manage_api_url.dart'; +import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_manage_sources.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/settingsView/settings_experimental_patches.dart'; import 'package:revanced_manager/ui/widgets/settingsView/settings_experimental_universal_patches.dart'; diff --git a/lib/ui/widgets/settingsView/settings_experimental_patches.dart b/lib/ui/widgets/settingsView/settings_experimental_patches.dart index 964787a1..b5bf97db 100644 --- a/lib/ui/widgets/settingsView/settings_experimental_patches.dart +++ b/lib/ui/widgets/settingsView/settings_experimental_patches.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_i18n/widgets/I18nText.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; -import 'package:revanced_manager/ui/widgets/settingsView/custom_switch_tile.dart'; class SExperimentalPatches extends StatefulWidget { const SExperimentalPatches({super.key}); @@ -15,8 +14,8 @@ final _settingsViewModel = SettingsViewModel(); class _SExperimentalPatchesState extends State { @override Widget build(BuildContext context) { - return CustomSwitchTile( - padding: const EdgeInsets.symmetric(horizontal: 20.0), + return SwitchListTile( + contentPadding: const EdgeInsets.symmetric(horizontal: 20.0), title: I18nText( 'settingsView.experimentalPatchesLabel', child: const Text( @@ -29,7 +28,7 @@ class _SExperimentalPatchesState extends State { ), subtitle: I18nText('settingsView.experimentalPatchesHint'), value: _settingsViewModel.areExperimentalPatchesEnabled(), - onTap: (value) { + onChanged: (value) { setState(() { _settingsViewModel.useExperimentalPatches(value); }); diff --git a/lib/ui/widgets/settingsView/settings_experimental_universal_patches.dart b/lib/ui/widgets/settingsView/settings_experimental_universal_patches.dart index c199259b..38e534fb 100644 --- a/lib/ui/widgets/settingsView/settings_experimental_universal_patches.dart +++ b/lib/ui/widgets/settingsView/settings_experimental_universal_patches.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_i18n/widgets/I18nText.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; -import 'package:revanced_manager/ui/widgets/settingsView/custom_switch_tile.dart'; class SExperimentalUniversalPatches extends StatefulWidget { const SExperimentalUniversalPatches({super.key}); @@ -17,8 +16,8 @@ class _SExperimentalUniversalPatchesState extends State { @override Widget build(BuildContext context) { - return CustomSwitchTile( - padding: const EdgeInsets.symmetric(horizontal: 20.0), + return SwitchListTile( + contentPadding: const EdgeInsets.symmetric(horizontal: 20.0), title: I18nText( 'settingsView.experimentalUniversalPatchesLabel', child: const Text( @@ -31,7 +30,7 @@ class _SExperimentalUniversalPatchesState ), subtitle: I18nText('settingsView.experimentalUniversalPatchesHint'), value: _settingsViewModel.areUniversalPatchesEnabled(), - onTap: (value) { + onChanged: (value) { setState(() { _settingsViewModel.showUniversalPatches(value); }); diff --git a/lib/ui/widgets/settingsView/settings_logging_section.dart b/lib/ui/widgets/settingsView/settings_logging_section.dart deleted file mode 100644 index b06b589c..00000000 --- a/lib/ui/widgets/settingsView/settings_logging_section.dart +++ /dev/null @@ -1,36 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_i18n/widgets/I18nText.dart'; -import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; -import 'package:revanced_manager/ui/widgets/settingsView/custom_switch_tile.dart'; -import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart'; - -final _settingsViewModel = SettingsViewModel(); - -class SLoggingSection extends StatelessWidget { - const SLoggingSection({super.key}); - - @override - Widget build(BuildContext context) { - return SettingsSection( - title: 'settingsView.logsSectionTitle', - children: [ - CustomSwitchTile( - padding: const EdgeInsets.symmetric(horizontal: 20.0), - title: I18nText( - 'settingsView.sentryLabel', - child: const Text( - '', - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w500, - ), - ), - ), - subtitle: I18nText('settingsView.sentryHint'), - value: _settingsViewModel.isSentryEnabled(), - onTap: (value) => _settingsViewModel.useSentry(value), - ), - ], - ); - } -} diff --git a/lib/ui/widgets/shared/custom_chip.dart b/lib/ui/widgets/shared/custom_chip.dart index 524348cd..8f3bb418 100644 --- a/lib/ui/widgets/shared/custom_chip.dart +++ b/lib/ui/widgets/shared/custom_chip.dart @@ -17,7 +17,7 @@ class CustomChip extends StatelessWidget { showCheckmark: false, label: label, selected: isSelected, - labelStyle: Theme.of(context).textTheme.subtitle2!.copyWith( + labelStyle: Theme.of(context).textTheme.titleSmall!.copyWith( color: isSelected ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.secondary, diff --git a/lib/ui/widgets/shared/custom_sliver_app_bar.dart b/lib/ui/widgets/shared/custom_sliver_app_bar.dart index 72c48ce3..144bd6ab 100644 --- a/lib/ui/widgets/shared/custom_sliver_app_bar.dart +++ b/lib/ui/widgets/shared/custom_sliver_app_bar.dart @@ -33,7 +33,7 @@ class CustomSliverAppBar extends StatelessWidget { : IconButton( icon: Icon( Icons.arrow_back, - color: Theme.of(context).textTheme.headline6!.color, + color: Theme.of(context).textTheme.titleLarge!.color, ), onPressed: onBackButtonPressed ?? () => Navigator.of(context).pop(), diff --git a/lib/utils/environment.dart b/lib/utils/environment.dart deleted file mode 100644 index ba671b68..00000000 --- a/lib/utils/environment.dart +++ /dev/null @@ -1,5 +0,0 @@ -// 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 = ''; -} diff --git a/pubspec.yaml b/pubspec.yaml index 92f8e715..05d739e4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,6 @@ environment: sdk: ">=2.17.5 <3.0.0" dependencies: - sentry_flutter: ^6.12.2 animations: ^2.0.4 app_installer: ^1.1.0 collection: ^1.16.0 @@ -73,7 +72,6 @@ dependencies: timezone: ^0.8.0 url_launcher: ^6.1.5 wakelock: ^0.6.2 - sentry_dio: ^6.12.2 flutter_dotenv: ^5.0.2 pub_release: ^8.0.3 flutter_markdown: ^0.6.13 @@ -92,5 +90,4 @@ dev_dependencies: flutter: uses-material-design: true assets: - - assets/i18n/ - - .env + - assets/i18n/ \ No newline at end of file