mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
feat: "New dashboard UI". (#3)
* feat: "New dashboard UI". * fix: some improvenents * fix: fix inconsistencies and light theme. * fix: save patched and installed apps on prefs, improve installer log, improve dashboard with real data (wip) Co-authored-by: Aunali321 <aunvakil.aa@gmail.com> * feat: move chips to a separate widget. Co-authored-by: Alberto Ponces <ponces26@gmail.com>
This commit is contained in:
parent
cd1610d847
commit
106d77ea0c
2
.github/workflows/release-build.yml
vendored
2
.github/workflows/release-build.yml
vendored
@ -19,6 +19,8 @@ jobs:
|
|||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
- name: Set up Flutter
|
- name: Set up Flutter
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
- name: Generate files with Builder
|
||||||
|
run: flutter packages pub run build_runner build --delete-conflicting-outputs
|
||||||
- name: Build with Flutter
|
- name: Build with Flutter
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -42,6 +42,8 @@ version
|
|||||||
# Flutter/Dart/Pub related
|
# Flutter/Dart/Pub related
|
||||||
**/doc/api/
|
**/doc/api/
|
||||||
**/*.g.dart
|
**/*.g.dart
|
||||||
|
**/*.locator.dart
|
||||||
|
**/*.router.dart
|
||||||
.dart_tool/
|
.dart_tool/
|
||||||
.flutter-plugins
|
.flutter-plugins
|
||||||
.flutter-plugins-dependencies
|
.flutter-plugins-dependencies
|
||||||
|
8
.vscode/tasks.json
vendored
8
.vscode/tasks.json
vendored
@ -2,7 +2,7 @@
|
|||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"label": "Build (Serializer)",
|
"label": "Generate (Builder)",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "flutter packages pub run build_runner build --delete-conflicting-outputs",
|
"command": "flutter packages pub run build_runner build --delete-conflicting-outputs",
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
@ -30,7 +30,7 @@
|
|||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Clean (Serializer)",
|
"label": "Clean (Builder)",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "flutter packages pub run build_runner clean",
|
"command": "flutter packages pub run build_runner clean",
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
@ -39,7 +39,7 @@
|
|||||||
"label": "Build all (Android)",
|
"label": "Build all (Android)",
|
||||||
"dependsOrder": "sequence",
|
"dependsOrder": "sequence",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"Build (Serializer)",
|
"Generate (Builder)",
|
||||||
"Build (Android)"
|
"Build (Android)"
|
||||||
],
|
],
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
@ -49,7 +49,7 @@
|
|||||||
"dependsOrder": "sequence",
|
"dependsOrder": "sequence",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"Clean (Flutter)",
|
"Clean (Flutter)",
|
||||||
"Clean (Serializer)"
|
"Clean (Builder)"
|
||||||
],
|
],
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
},
|
},
|
||||||
|
@ -179,10 +179,41 @@ class MainActivity : FlutterActivity() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createPatcher(inputFilePath: String, cacheDirPath: String, resourcePatching: Boolean): Boolean {
|
fun createPatcher(
|
||||||
|
inputFilePath: String,
|
||||||
|
cacheDirPath: String,
|
||||||
|
resourcePatching: Boolean
|
||||||
|
): Boolean {
|
||||||
val inputFile = File(inputFilePath)
|
val inputFile = File(inputFilePath)
|
||||||
val aaptPath = Aapt.binary(applicationContext).absolutePath
|
val aaptPath = Aapt.binary(applicationContext).absolutePath
|
||||||
patcher = Patcher(PatcherOptions(inputFile, cacheDirPath, resourcePatching, aaptPath, cacheDirPath))
|
patcher =
|
||||||
|
Patcher(
|
||||||
|
PatcherOptions(
|
||||||
|
inputFile,
|
||||||
|
cacheDirPath,
|
||||||
|
resourcePatching,
|
||||||
|
aaptPath,
|
||||||
|
cacheDirPath,
|
||||||
|
logger =
|
||||||
|
object : app.revanced.patcher.logging.Logger {
|
||||||
|
override fun error(msg: String) {
|
||||||
|
methodChannel.invokeMethod("updateInstallerLog", msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun warn(msg: String) {
|
||||||
|
methodChannel.invokeMethod("updateInstallerLog", msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun info(msg: String) {
|
||||||
|
methodChannel.invokeMethod("updateInstallerLog", msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun trace(msg: String) {
|
||||||
|
methodChannel.invokeMethod("updateInstallerLog", msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
33
android/app/src/main/res/drawable/ic_notification.xml
Normal file
33
android/app/src/main/res/drawable/ic_notification.xml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="500dp"
|
||||||
|
android:height="500dp"
|
||||||
|
android:viewportWidth="500"
|
||||||
|
android:viewportHeight="500">
|
||||||
|
<group>
|
||||||
|
<clip-path
|
||||||
|
android:pathData="M-178.57,-178.57l857.14,0l0,857.14l-857.14,0z"/>
|
||||||
|
<path
|
||||||
|
android:pathData="m168.25,119.79c24.4,-19.54 54.46,-32.33 87.3,-35.59l0,0 0,0.33 0,33.21c-21.87,2.69 -41.82,10.53 -58.8,22.17zM170.8,381.13c23.72,18.25 52.71,30.31 84.75,33.51l0,-33.21c-20.61,-2.43 -39.71,-9.62 -56.24,-20.42zM288.76,84.7l0,33.21c23.75,3.32 46.16,12.95 64.76,27.9l23.75,-24.57c-25.24,-20.92 -56.13,-33.38 -88.51,-36.53zM353.52,355.53c-18.76,14.61 -41.18,24.08 -64.76,27.06l0,33.21c32.55,-3.49 63.43,-16.61 88.51,-37.53zM384.16,324.48 L458.88,249.75L400.76,249.75L400.76,183.33l-33.21,0l0,66.42L309.44,249.75Z"
|
||||||
|
android:fillColor="#000"
|
||||||
|
android:fillType="evenOdd"/>
|
||||||
|
<group>
|
||||||
|
<clip-path
|
||||||
|
android:pathData="m168.25,119.79c24.4,-19.54 54.46,-32.33 87.3,-35.59l0,0 0,0.33 0,33.21c-21.87,2.69 -41.82,10.53 -58.8,22.17zM170.8,381.13c23.72,18.25 52.71,30.31 84.75,33.51l0,-33.21c-20.61,-2.43 -39.71,-9.62 -56.24,-20.42zM288.76,84.7l0,33.21c23.75,3.32 46.16,12.95 64.76,27.9l23.75,-24.57c-25.24,-20.92 -56.13,-33.38 -88.51,-36.53zM353.52,355.53c-18.76,14.61 -41.18,24.08 -64.76,27.06l0,33.21c32.55,-3.49 63.43,-16.61 88.51,-37.53zM384.16,324.48 L458.88,249.75L400.76,249.75L400.76,183.33l-33.21,0l0,66.42L309.44,249.75Z"/>
|
||||||
|
<group>
|
||||||
|
<clip-path
|
||||||
|
android:pathData="M500,500L0,500L0,0l500,0z"/>
|
||||||
|
<group>
|
||||||
|
<clip-path
|
||||||
|
android:pathData="M500,500L0,500L0,0l500,0z"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<clip-path
|
||||||
|
android:pathData="M500,500L0,500L0,0l500,0z"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<path
|
||||||
|
android:pathData="m72.7,408.42 l179.8,-126.92c23.56,-16.64 23.56,-43.64 0,-60.28L72.7,94.31c-23.56,-16.63 -42.7,-6.72 -42.7,22.12l0,269.86c0,28.84 19.13,38.76 42.7,22.12z"
|
||||||
|
android:fillColor="#000"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
@ -7,18 +7,12 @@
|
|||||||
"homeView": {
|
"homeView": {
|
||||||
"widgetTitle": "Dashboard",
|
"widgetTitle": "Dashboard",
|
||||||
"updatesSubtitle": "ReVanced Updates",
|
"updatesSubtitle": "ReVanced Updates",
|
||||||
"patchedSubtitle": "Patched Applications"
|
"patchedSubtitle": "Patched Applications",
|
||||||
},
|
"updatesAvailable": "Updates Available",
|
||||||
"availableUpdatesCard": {
|
"installed": "Installed"
|
||||||
"widgetTitle": "Updates Available",
|
|
||||||
"patchButton": "Patch All",
|
|
||||||
"changelogLabel": "Changelog"
|
|
||||||
},
|
},
|
||||||
"applicationItem": {
|
"applicationItem": {
|
||||||
"patchButton": "Patch"
|
"patchButton": "Patch",
|
||||||
},
|
|
||||||
"installedAppsCard": {
|
|
||||||
"widgetTitle": "Total Installed",
|
|
||||||
"changelogLabel": "Changelog"
|
"changelogLabel": "Changelog"
|
||||||
},
|
},
|
||||||
"latestCommitCard": {
|
"latestCommitCard": {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 22 KiB |
@ -1,6 +0,0 @@
|
|||||||
<svg width="20" height="17" viewBox="0 0 20 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.5714 10.9953C20.4762 9.88627 20.4762 7.11373 18.5714 6.00471L8.92857 0.39032C7.02381 -0.718696 4.64286 0.667579 4.64286 2.88561V4.46595L2.14286 3.01037C1.19048 2.45586 3.61997e-07 3.149 3.61997e-07 4.25801L0 12.742C-3.33951e-08 13.851 1.19048 14.5441 2.14286 13.9896L4.64286 12.534V14.1144C4.64286 16.3324 7.02381 17.7187 8.92857 16.6097L18.5714 10.9953ZM4.64286 4.46595L4.64286 12.534L9.42857 9.74764C10.381 9.19313 10.381 7.80687 9.42857 7.25236L4.64286 4.46595Z" fill="#FF6B78"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.5714 10.9953C20.4762 9.88627 20.4762 7.11373 18.5714 6.00471L8.92857 0.39032C7.02381 -0.718696 4.64286 0.667579 4.64286 2.88561V4.46595L2.14286 3.01037C1.19048 2.45586 3.61997e-07 3.149 3.61997e-07 4.25801L0 12.742C-3.33951e-08 13.851 1.19048 14.5441 2.14286 13.9896L4.64286 12.534V14.1144C4.64286 16.3324 7.02381 17.7187 8.92857 16.6097L18.5714 10.9953ZM4.64286 4.46595L4.64286 12.534L9.42857 9.74764C10.381 9.19313 10.381 7.80687 9.42857 7.25236L4.64286 4.46595Z" fill="#FF4151"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.5714 6.00471C20.4762 7.11373 20.4762 9.88627 18.5714 10.9953L8.92857 16.6097C7.02381 17.7187 4.64286 16.3324 4.64286 14.1144V12.534L9.42857 9.74764C10.381 9.19313 10.381 7.80687 9.42857 7.25236L4.64286 4.46595V2.88561C4.64286 0.667579 7.02381 -0.718696 8.92857 0.39032L18.5714 6.00471Z" fill="#FF6B78"/>
|
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.5714 6.00471C20.4762 7.11373 20.4762 9.88627 18.5714 10.9953L8.92857 16.6097C7.02381 17.7187 4.64286 16.3324 4.64286 14.1144V12.534L9.42857 9.74764C10.381 9.19313 10.381 7.80687 9.42857 7.25236L4.64286 4.46595V2.88561C4.64286 0.667579 7.02381 -0.718696 8.92857 0.39032L18.5714 6.00471Z" fill="white"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 1.8 KiB |
@ -5,6 +5,7 @@ import 'package:revanced_manager/services/root_api.dart';
|
|||||||
import 'package:revanced_manager/ui/views/app_selector/app_selector_view.dart';
|
import 'package:revanced_manager/ui/views/app_selector/app_selector_view.dart';
|
||||||
import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/views/contributors/contributors_view.dart';
|
import 'package:revanced_manager/ui/views/contributors/contributors_view.dart';
|
||||||
|
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/views/installer/installer_view.dart';
|
import 'package:revanced_manager/ui/views/installer/installer_view.dart';
|
||||||
import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||||
@ -31,6 +32,7 @@ import 'package:stacked_themes/stacked_themes.dart';
|
|||||||
LazySingleton(classType: PatcherAPI),
|
LazySingleton(classType: PatcherAPI),
|
||||||
LazySingleton(classType: ManagerAPI),
|
LazySingleton(classType: ManagerAPI),
|
||||||
LazySingleton(classType: RootAPI),
|
LazySingleton(classType: RootAPI),
|
||||||
|
LazySingleton(classType: HomeViewModel),
|
||||||
LazySingleton(classType: PatcherViewModel),
|
LazySingleton(classType: PatcherViewModel),
|
||||||
LazySingleton(classType: AppSelectorViewModel),
|
LazySingleton(classType: AppSelectorViewModel),
|
||||||
LazySingleton(classType: PatchesSelectorViewModel),
|
LazySingleton(classType: PatchesSelectorViewModel),
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// StackedLocatorGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
// ignore_for_file: public_member_api_docs, depend_on_referenced_packages
|
|
||||||
|
|
||||||
import 'package:stacked_core/stacked_core.dart';
|
|
||||||
import 'package:stacked_services/stacked_services.dart';
|
|
||||||
import 'package:stacked_themes/stacked_themes.dart';
|
|
||||||
|
|
||||||
import '../services/manager_api.dart';
|
|
||||||
import '../services/patcher_api.dart';
|
|
||||||
import '../services/root_api.dart';
|
|
||||||
import '../ui/views/app_selector/app_selector_viewmodel.dart';
|
|
||||||
import '../ui/views/installer/installer_viewmodel.dart';
|
|
||||||
import '../ui/views/patcher/patcher_viewmodel.dart';
|
|
||||||
import '../ui/views/patches_selector/patches_selector_viewmodel.dart';
|
|
||||||
|
|
||||||
final locator = StackedLocator.instance;
|
|
||||||
|
|
||||||
Future<void> setupLocator(
|
|
||||||
{String? environment, EnvironmentFilter? environmentFilter}) async {
|
|
||||||
// Register environments
|
|
||||||
locator.registerEnvironment(
|
|
||||||
environment: environment, environmentFilter: environmentFilter);
|
|
||||||
|
|
||||||
// Register dependencies
|
|
||||||
locator.registerLazySingleton(() => NavigationService());
|
|
||||||
locator.registerLazySingleton(() => PatcherAPI());
|
|
||||||
locator.registerLazySingleton(() => ManagerAPI());
|
|
||||||
locator.registerLazySingleton(() => RootAPI());
|
|
||||||
locator.registerLazySingleton(() => PatcherViewModel());
|
|
||||||
locator.registerLazySingleton(() => AppSelectorViewModel());
|
|
||||||
locator.registerLazySingleton(() => PatchesSelectorViewModel());
|
|
||||||
locator.registerLazySingleton(() => InstallerViewModel());
|
|
||||||
locator.registerLazySingleton(() => ThemeService.getInstance());
|
|
||||||
}
|
|
@ -1,231 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// StackedRouterGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
// ignore_for_file: public_member_api_docs, unused_import, non_constant_identifier_names
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:stacked/stacked.dart';
|
|
||||||
import 'package:stacked_services/stacked_services.dart';
|
|
||||||
|
|
||||||
import '../main.dart';
|
|
||||||
import '../ui/views/app_selector/app_selector_view.dart';
|
|
||||||
import '../ui/views/contributors/contributors_view.dart';
|
|
||||||
import '../ui/views/installer/installer_view.dart';
|
|
||||||
import '../ui/views/patches_selector/patches_selector_view.dart';
|
|
||||||
import '../ui/views/root_checker/root_checker_view.dart';
|
|
||||||
import '../ui/views/settings/settings_view.dart';
|
|
||||||
|
|
||||||
class Routes {
|
|
||||||
static const String navigation = '/Navigation';
|
|
||||||
static const String appSelectorView = '/app-selector-view';
|
|
||||||
static const String patchesSelectorView = '/patches-selector-view';
|
|
||||||
static const String installerView = '/installer-view';
|
|
||||||
static const String settingsView = '/settings-view';
|
|
||||||
static const String contributorsView = '/contributors-view';
|
|
||||||
static const String rootCheckerView = '/root-checker-view';
|
|
||||||
static const all = <String>{
|
|
||||||
navigation,
|
|
||||||
appSelectorView,
|
|
||||||
patchesSelectorView,
|
|
||||||
installerView,
|
|
||||||
settingsView,
|
|
||||||
contributorsView,
|
|
||||||
rootCheckerView,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
class StackedRouter extends RouterBase {
|
|
||||||
@override
|
|
||||||
List<RouteDef> get routes => _routes;
|
|
||||||
final _routes = <RouteDef>[
|
|
||||||
RouteDef(Routes.navigation, page: Navigation),
|
|
||||||
RouteDef(Routes.appSelectorView, page: AppSelectorView),
|
|
||||||
RouteDef(Routes.patchesSelectorView, page: PatchesSelectorView),
|
|
||||||
RouteDef(Routes.installerView, page: InstallerView),
|
|
||||||
RouteDef(Routes.settingsView, page: SettingsView),
|
|
||||||
RouteDef(Routes.contributorsView, page: ContributorsView),
|
|
||||||
RouteDef(Routes.rootCheckerView, page: RootCheckerView),
|
|
||||||
];
|
|
||||||
@override
|
|
||||||
Map<Type, StackedRouteFactory> get pagesMap => _pagesMap;
|
|
||||||
final _pagesMap = <Type, StackedRouteFactory>{
|
|
||||||
Navigation: (data) {
|
|
||||||
return MaterialPageRoute<dynamic>(
|
|
||||||
builder: (context) => const Navigation(),
|
|
||||||
settings: data,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
AppSelectorView: (data) {
|
|
||||||
return MaterialPageRoute<dynamic>(
|
|
||||||
builder: (context) => const AppSelectorView(),
|
|
||||||
settings: data,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
PatchesSelectorView: (data) {
|
|
||||||
return MaterialPageRoute<dynamic>(
|
|
||||||
builder: (context) => const PatchesSelectorView(),
|
|
||||||
settings: data,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
InstallerView: (data) {
|
|
||||||
var args = data.getArgs<InstallerViewArguments>(
|
|
||||||
orElse: () => InstallerViewArguments(),
|
|
||||||
);
|
|
||||||
return MaterialPageRoute<dynamic>(
|
|
||||||
builder: (context) => InstallerView(key: args.key),
|
|
||||||
settings: data,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
SettingsView: (data) {
|
|
||||||
return MaterialPageRoute<dynamic>(
|
|
||||||
builder: (context) => const SettingsView(),
|
|
||||||
settings: data,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
ContributorsView: (data) {
|
|
||||||
return MaterialPageRoute<dynamic>(
|
|
||||||
builder: (context) => const ContributorsView(),
|
|
||||||
settings: data,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
RootCheckerView: (data) {
|
|
||||||
return MaterialPageRoute<dynamic>(
|
|
||||||
builder: (context) => const RootCheckerView(),
|
|
||||||
settings: data,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ************************************************************************
|
|
||||||
/// Arguments holder classes
|
|
||||||
/// *************************************************************************
|
|
||||||
|
|
||||||
/// InstallerView arguments holder class
|
|
||||||
class InstallerViewArguments {
|
|
||||||
final Key? key;
|
|
||||||
InstallerViewArguments({this.key});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ************************************************************************
|
|
||||||
/// Extension for strongly typed navigation
|
|
||||||
/// *************************************************************************
|
|
||||||
|
|
||||||
extension NavigatorStateExtension on NavigationService {
|
|
||||||
Future<dynamic> navigateToNavigation({
|
|
||||||
int? routerId,
|
|
||||||
bool preventDuplicates = true,
|
|
||||||
Map<String, String>? parameters,
|
|
||||||
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
|
||||||
transition,
|
|
||||||
}) async {
|
|
||||||
return navigateTo(
|
|
||||||
Routes.navigation,
|
|
||||||
id: routerId,
|
|
||||||
preventDuplicates: preventDuplicates,
|
|
||||||
parameters: parameters,
|
|
||||||
transition: transition,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<dynamic> navigateToAppSelectorView({
|
|
||||||
int? routerId,
|
|
||||||
bool preventDuplicates = true,
|
|
||||||
Map<String, String>? parameters,
|
|
||||||
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
|
||||||
transition,
|
|
||||||
}) async {
|
|
||||||
return navigateTo(
|
|
||||||
Routes.appSelectorView,
|
|
||||||
id: routerId,
|
|
||||||
preventDuplicates: preventDuplicates,
|
|
||||||
parameters: parameters,
|
|
||||||
transition: transition,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<dynamic> navigateToPatchesSelectorView({
|
|
||||||
int? routerId,
|
|
||||||
bool preventDuplicates = true,
|
|
||||||
Map<String, String>? parameters,
|
|
||||||
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
|
||||||
transition,
|
|
||||||
}) async {
|
|
||||||
return navigateTo(
|
|
||||||
Routes.patchesSelectorView,
|
|
||||||
id: routerId,
|
|
||||||
preventDuplicates: preventDuplicates,
|
|
||||||
parameters: parameters,
|
|
||||||
transition: transition,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<dynamic> navigateToInstallerView({
|
|
||||||
Key? key,
|
|
||||||
int? routerId,
|
|
||||||
bool preventDuplicates = true,
|
|
||||||
Map<String, String>? parameters,
|
|
||||||
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
|
||||||
transition,
|
|
||||||
}) async {
|
|
||||||
return navigateTo(
|
|
||||||
Routes.installerView,
|
|
||||||
arguments: InstallerViewArguments(key: key),
|
|
||||||
id: routerId,
|
|
||||||
preventDuplicates: preventDuplicates,
|
|
||||||
parameters: parameters,
|
|
||||||
transition: transition,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<dynamic> navigateToSettingsView({
|
|
||||||
int? routerId,
|
|
||||||
bool preventDuplicates = true,
|
|
||||||
Map<String, String>? parameters,
|
|
||||||
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
|
||||||
transition,
|
|
||||||
}) async {
|
|
||||||
return navigateTo(
|
|
||||||
Routes.settingsView,
|
|
||||||
id: routerId,
|
|
||||||
preventDuplicates: preventDuplicates,
|
|
||||||
parameters: parameters,
|
|
||||||
transition: transition,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<dynamic> navigateToContributorsView({
|
|
||||||
int? routerId,
|
|
||||||
bool preventDuplicates = true,
|
|
||||||
Map<String, String>? parameters,
|
|
||||||
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
|
||||||
transition,
|
|
||||||
}) async {
|
|
||||||
return navigateTo(
|
|
||||||
Routes.contributorsView,
|
|
||||||
id: routerId,
|
|
||||||
preventDuplicates: preventDuplicates,
|
|
||||||
parameters: parameters,
|
|
||||||
transition: transition,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<dynamic> navigateToRootCheckerView({
|
|
||||||
int? routerId,
|
|
||||||
bool preventDuplicates = true,
|
|
||||||
Map<String, String>? parameters,
|
|
||||||
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
|
||||||
transition,
|
|
||||||
}) async {
|
|
||||||
return navigateTo(
|
|
||||||
Routes.rootCheckerView,
|
|
||||||
id: routerId,
|
|
||||||
preventDuplicates: preventDuplicates,
|
|
||||||
parameters: parameters,
|
|
||||||
transition: transition,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,21 +1,43 @@
|
|||||||
import 'package:revanced_manager/models/patch.dart';
|
import 'dart:typed_data';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'patched_application.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
class PatchedApplication {
|
class PatchedApplication {
|
||||||
final String name;
|
final String name;
|
||||||
final String packageName;
|
final String packageName;
|
||||||
final String version;
|
final String version;
|
||||||
final String apkFilePath;
|
final String apkFilePath;
|
||||||
|
@JsonKey(
|
||||||
|
fromJson: bytesFromString,
|
||||||
|
toJson: bytesToString,
|
||||||
|
)
|
||||||
|
final Uint8List icon;
|
||||||
|
final DateTime patchDate;
|
||||||
final bool isRooted;
|
final bool isRooted;
|
||||||
final bool isFromStorage;
|
final bool isFromStorage;
|
||||||
final List<Patch> appliedPatches;
|
final List<String> appliedPatches;
|
||||||
|
|
||||||
PatchedApplication({
|
PatchedApplication({
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.packageName,
|
required this.packageName,
|
||||||
required this.version,
|
required this.version,
|
||||||
required this.apkFilePath,
|
required this.apkFilePath,
|
||||||
|
required this.icon,
|
||||||
|
required this.patchDate,
|
||||||
required this.isRooted,
|
required this.isRooted,
|
||||||
required this.isFromStorage,
|
required this.isFromStorage,
|
||||||
this.appliedPatches = const <Patch>[],
|
this.appliedPatches = const <String>[],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
factory PatchedApplication.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$PatchedApplicationFromJson(json);
|
||||||
|
|
||||||
|
Map toJson() => _$PatchedApplicationToJson(this);
|
||||||
|
|
||||||
|
static Uint8List bytesFromString(String pictureUrl) =>
|
||||||
|
Uint8List.fromList(pictureUrl.codeUnits);
|
||||||
|
|
||||||
|
static String bytesToString(Uint8List bytes) => String.fromCharCodes(bytes);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ var lightTheme = ThemeData.light().copyWith(
|
|||||||
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
|
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
|
||||||
const EdgeInsets.symmetric(
|
const EdgeInsets.symmetric(
|
||||||
vertical: 8,
|
vertical: 8,
|
||||||
horizontal: 12,
|
horizontal: 14,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
backgroundColor: MaterialStateProperty.all<Color>(
|
backgroundColor: MaterialStateProperty.all<Color>(
|
||||||
@ -70,7 +70,7 @@ var darkTheme = ThemeData.dark().copyWith(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
colorScheme: const ColorScheme.dark(
|
colorScheme: const ColorScheme.dark(
|
||||||
primary: Color(0x1B222B6B),
|
primary: Color(0xff11161C),
|
||||||
secondary: Color(0xff7792BA),
|
secondary: Color(0xff7792BA),
|
||||||
tertiary: Color(0xff8691A0),
|
tertiary: Color(0xff8691A0),
|
||||||
background: Color(0xff0A0D11),
|
background: Color(0xff0A0D11),
|
||||||
|
@ -4,7 +4,6 @@ import 'package:file_picker/file_picker.dart';
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:package_archive_info/package_archive_info.dart';
|
|
||||||
import 'package:revanced_manager/app/app.locator.dart';
|
import 'package:revanced_manager/app/app.locator.dart';
|
||||||
import 'package:revanced_manager/models/patched_application.dart';
|
import 'package:revanced_manager/models/patched_application.dart';
|
||||||
import 'package:revanced_manager/services/patcher_api.dart';
|
import 'package:revanced_manager/services/patcher_api.dart';
|
||||||
@ -39,6 +38,8 @@ class AppSelectorViewModel extends BaseViewModel {
|
|||||||
packageName: application.packageName,
|
packageName: application.packageName,
|
||||||
version: application.versionName!,
|
version: application.versionName!,
|
||||||
apkFilePath: application.apkFilePath,
|
apkFilePath: application.apkFilePath,
|
||||||
|
icon: application.icon,
|
||||||
|
patchDate: DateTime.now(),
|
||||||
isRooted: isRooted,
|
isRooted: isRooted,
|
||||||
isFromStorage: isFromStorage,
|
isFromStorage: isFromStorage,
|
||||||
);
|
);
|
||||||
@ -57,13 +58,17 @@ class AppSelectorViewModel extends BaseViewModel {
|
|||||||
);
|
);
|
||||||
if (result != null && result.files.single.path != null) {
|
if (result != null && result.files.single.path != null) {
|
||||||
File apkFile = File(result.files.single.path!);
|
File apkFile = File(result.files.single.path!);
|
||||||
PackageArchiveInfo? packageArchiveInfo =
|
ApplicationWithIcon? application =
|
||||||
await PackageArchiveInfo.fromPath(apkFile.path);
|
await DeviceApps.getAppFromStorage(apkFile.path, true)
|
||||||
|
as ApplicationWithIcon?;
|
||||||
|
if (application != null) {
|
||||||
PatchedApplication app = PatchedApplication(
|
PatchedApplication app = PatchedApplication(
|
||||||
name: packageArchiveInfo.appName,
|
name: application.appName,
|
||||||
packageName: packageArchiveInfo.packageName,
|
packageName: application.packageName,
|
||||||
version: packageArchiveInfo.version,
|
version: application.versionName!,
|
||||||
apkFilePath: result.files.single.path!,
|
apkFilePath: result.files.single.path!,
|
||||||
|
icon: application.icon,
|
||||||
|
patchDate: DateTime.now(),
|
||||||
isRooted: isRooted,
|
isRooted: isRooted,
|
||||||
isFromStorage: isFromStorage,
|
isFromStorage: isFromStorage,
|
||||||
);
|
);
|
||||||
@ -72,6 +77,7 @@ class AppSelectorViewModel extends BaseViewModel {
|
|||||||
locator<PatcherViewModel>().dimPatchCard = false;
|
locator<PatcherViewModel>().dimPatchCard = false;
|
||||||
locator<PatcherViewModel>().notifyListeners();
|
locator<PatcherViewModel>().notifyListeners();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} on Exception {
|
} on Exception {
|
||||||
Fluttertoast.showToast(
|
Fluttertoast.showToast(
|
||||||
msg: FlutterI18n.translate(
|
msg: FlutterI18n.translate(
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
import 'package:revanced_manager/app/app.locator.dart';
|
||||||
import 'package:revanced_manager/theme.dart';
|
import 'package:revanced_manager/theme.dart';
|
||||||
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/available_updates_card.dart';
|
import 'package:revanced_manager/ui/widgets/available_updates_card.dart';
|
||||||
|
import 'package:revanced_manager/ui/widgets/dashboard_raw_chip.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/installed_apps_card.dart';
|
import 'package:revanced_manager/ui/widgets/installed_apps_card.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/latest_commit_card.dart';
|
import 'package:revanced_manager/ui/widgets/latest_commit_card.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
@ -13,8 +15,9 @@ class HomeView extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ViewModelBuilder.reactive(
|
return ViewModelBuilder<HomeViewModel>.reactive(
|
||||||
viewModelBuilder: () => HomeViewModel(),
|
disposeViewModel: false,
|
||||||
|
viewModelBuilder: () => locator<HomeViewModel>(),
|
||||||
builder: (context, model, child) => Scaffold(
|
builder: (context, model, child) => Scaffold(
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
@ -30,6 +33,7 @@ class HomeView extends StatelessWidget {
|
|||||||
'',
|
'',
|
||||||
style: GoogleFonts.inter(
|
style: GoogleFonts.inter(
|
||||||
fontSize: 28,
|
fontSize: 28,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -40,6 +44,7 @@ class HomeView extends StatelessWidget {
|
|||||||
'',
|
'',
|
||||||
style: GoogleFonts.inter(
|
style: GoogleFonts.inter(
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
color: isDark
|
color: isDark
|
||||||
? const Color(0xffD1E1FA)
|
? const Color(0xffD1E1FA)
|
||||||
: const Color(0xff384E6E),
|
: const Color(0xff384E6E),
|
||||||
@ -48,7 +53,8 @@ class HomeView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
LatestCommitCard(
|
LatestCommitCard(
|
||||||
color: Theme.of(context).colorScheme.primary),
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
const SizedBox(height: 14),
|
const SizedBox(height: 14),
|
||||||
I18nText(
|
I18nText(
|
||||||
'homeView.patchedSubtitle',
|
'homeView.patchedSubtitle',
|
||||||
@ -62,14 +68,30 @@ class HomeView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
DashboardChip(
|
||||||
|
label: "homeView.updatesAvailable",
|
||||||
|
isSelected: model.showUpdatableApps,
|
||||||
|
onSelected: (value) {
|
||||||
|
model.toggleUpdatableApps(value);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
DashboardChip(
|
||||||
|
label: "homeView.installed",
|
||||||
|
isSelected: !model.showUpdatableApps,
|
||||||
|
onSelected: (value) {
|
||||||
|
model.toggleUpdatableApps(false);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
const SizedBox(height: 14),
|
const SizedBox(height: 14),
|
||||||
AvailableUpdatesCard(
|
model.showUpdatableApps
|
||||||
color: Theme.of(context).colorScheme.primary,
|
? const AvailableUpdatesCard()
|
||||||
),
|
: const InstalledAppsCard()
|
||||||
const SizedBox(height: 15),
|
|
||||||
InstalledAppsCard(
|
|
||||||
color: Theme.of(context).colorScheme.primary,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1,8 +1,28 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
import 'package:injectable/injectable.dart';
|
||||||
import 'package:revanced_manager/app/app.locator.dart';
|
import 'package:revanced_manager/app/app.locator.dart';
|
||||||
|
import 'package:revanced_manager/models/patched_application.dart';
|
||||||
import 'package:revanced_manager/services/manager_api.dart';
|
import 'package:revanced_manager/services/manager_api.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
|
@lazySingleton
|
||||||
class HomeViewModel extends BaseViewModel {
|
class HomeViewModel extends BaseViewModel {
|
||||||
|
bool showUpdatableApps = true;
|
||||||
|
|
||||||
|
void toggleUpdatableApps(bool value) {
|
||||||
|
showUpdatableApps = value;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
Future downloadPatches() => locator<ManagerAPI>().downloadPatches();
|
Future downloadPatches() => locator<ManagerAPI>().downloadPatches();
|
||||||
Future downloadIntegrations() => locator<ManagerAPI>().downloadIntegrations();
|
Future downloadIntegrations() => locator<ManagerAPI>().downloadIntegrations();
|
||||||
|
|
||||||
|
Future<List<PatchedApplication>> getPatchedApps(bool isUpdatable) async {
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
List<String> patchedApps = prefs.getStringList('patchedApps') ?? [];
|
||||||
|
return patchedApps
|
||||||
|
.map((app) => PatchedApplication.fromJson(json.decode(app)))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:revanced_manager/app/app.locator.dart';
|
import 'package:revanced_manager/app/app.locator.dart';
|
||||||
import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/installer/installer_viewmodel.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
@ -81,9 +82,8 @@ class InstallerView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: SelectableText(
|
child: SelectableText(
|
||||||
model.logs,
|
model.logs,
|
||||||
style: const TextStyle(
|
style: GoogleFonts.jetBrainsMono(
|
||||||
fontFamily: 'monospace',
|
fontSize: 12,
|
||||||
fontSize: 15,
|
|
||||||
height: 1.5,
|
height: 1.5,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -7,6 +7,7 @@ import 'package:revanced_manager/services/patcher_api.dart';
|
|||||||
import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/app_selector/app_selector_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
class InstallerViewModel extends BaseViewModel {
|
class InstallerViewModel extends BaseViewModel {
|
||||||
@ -23,7 +24,7 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
notificationText: 'ReVanced Manager is patching',
|
notificationText: 'ReVanced Manager is patching',
|
||||||
notificationImportance: AndroidNotificationImportance.Default,
|
notificationImportance: AndroidNotificationImportance.Default,
|
||||||
notificationIcon: AndroidResource(
|
notificationIcon: AndroidResource(
|
||||||
name: 'ic_launcher_foreground',
|
name: 'ic_notification',
|
||||||
defType: 'drawable',
|
defType: 'drawable',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -34,12 +35,14 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void addLog(String message) {
|
void addLog(String message) {
|
||||||
|
if (message.isNotEmpty && !message.startsWith('Merging L')) {
|
||||||
if (logs.isNotEmpty) {
|
if (logs.isNotEmpty) {
|
||||||
logs += '\n';
|
logs += '\n';
|
||||||
}
|
}
|
||||||
logs += message;
|
logs += message;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void updateProgress(double value) {
|
void updateProgress(double value) {
|
||||||
progress = value;
|
progress = value;
|
||||||
@ -61,29 +64,25 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
List<Patch> selectedPatches =
|
List<Patch> selectedPatches =
|
||||||
locator<PatchesSelectorViewModel>().selectedPatches;
|
locator<PatchesSelectorViewModel>().selectedPatches;
|
||||||
if (selectedPatches.isNotEmpty) {
|
if (selectedPatches.isNotEmpty) {
|
||||||
addLog('Initializing installer...');
|
addLog('Initializing installer');
|
||||||
if (selectedApp.isRooted && !selectedApp.isFromStorage) {
|
if (selectedApp.isRooted && !selectedApp.isFromStorage) {
|
||||||
addLog('Checking if an old patched version exists...');
|
addLog('Checking if an old patched version exists');
|
||||||
bool oldExists =
|
bool oldExists =
|
||||||
await locator<PatcherAPI>().checkOldPatch(selectedApp);
|
await locator<PatcherAPI>().checkOldPatch(selectedApp);
|
||||||
addLog('Done');
|
|
||||||
if (oldExists) {
|
if (oldExists) {
|
||||||
addLog('Deleting old patched version...');
|
addLog('Deleting old patched version');
|
||||||
await locator<PatcherAPI>().deleteOldPatch(selectedApp);
|
await locator<PatcherAPI>().deleteOldPatch(selectedApp);
|
||||||
addLog('Done');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addLog('Creating working directory...');
|
addLog('Creating working directory');
|
||||||
bool? isSuccess = await locator<PatcherAPI>().initPatcher();
|
bool? isSuccess = await locator<PatcherAPI>().initPatcher();
|
||||||
if (isSuccess != null && isSuccess) {
|
if (isSuccess != null && isSuccess) {
|
||||||
addLog('Done');
|
|
||||||
updateProgress(0.1);
|
updateProgress(0.1);
|
||||||
addLog('Copying original apk...');
|
addLog('Copying original apk');
|
||||||
isSuccess = await locator<PatcherAPI>().copyInputFile(apkFilePath);
|
isSuccess = await locator<PatcherAPI>().copyInputFile(apkFilePath);
|
||||||
if (isSuccess != null && isSuccess) {
|
if (isSuccess != null && isSuccess) {
|
||||||
addLog('Done');
|
|
||||||
updateProgress(0.2);
|
updateProgress(0.2);
|
||||||
addLog('Creating patcher...');
|
addLog('Creating patcher');
|
||||||
bool resourcePatching = false;
|
bool resourcePatching = false;
|
||||||
if (selectedApp.packageName == 'com.google.android.youtube' ||
|
if (selectedApp.packageName == 'com.google.android.youtube' ||
|
||||||
selectedApp.packageName ==
|
selectedApp.packageName ==
|
||||||
@ -95,31 +94,26 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
);
|
);
|
||||||
if (isSuccess != null && isSuccess) {
|
if (isSuccess != null && isSuccess) {
|
||||||
if (selectedApp.packageName == 'com.google.android.youtube') {
|
if (selectedApp.packageName == 'com.google.android.youtube') {
|
||||||
addLog('Done');
|
|
||||||
updateProgress(0.3);
|
updateProgress(0.3);
|
||||||
addLog('Merging integrations...');
|
addLog('Merging integrations');
|
||||||
isSuccess = await locator<PatcherAPI>().mergeIntegrations();
|
isSuccess = await locator<PatcherAPI>().mergeIntegrations();
|
||||||
}
|
}
|
||||||
if (isSuccess != null && isSuccess) {
|
if (isSuccess != null && isSuccess) {
|
||||||
addLog('Done');
|
|
||||||
updateProgress(0.5);
|
updateProgress(0.5);
|
||||||
addLog('Applying patches...');
|
|
||||||
isSuccess =
|
isSuccess =
|
||||||
await locator<PatcherAPI>().applyPatches(selectedPatches);
|
await locator<PatcherAPI>().applyPatches(selectedPatches);
|
||||||
if (isSuccess != null && isSuccess) {
|
if (isSuccess != null && isSuccess) {
|
||||||
addLog('Done');
|
|
||||||
updateProgress(0.7);
|
updateProgress(0.7);
|
||||||
addLog('Repacking patched apk...');
|
addLog('Repacking patched apk');
|
||||||
isSuccess = await locator<PatcherAPI>().repackPatchedFile();
|
isSuccess = await locator<PatcherAPI>().repackPatchedFile();
|
||||||
if (isSuccess != null && isSuccess) {
|
if (isSuccess != null && isSuccess) {
|
||||||
addLog('Done');
|
|
||||||
updateProgress(0.9);
|
updateProgress(0.9);
|
||||||
addLog('Signing patched apk...');
|
addLog('Signing patched apk');
|
||||||
isSuccess = await locator<PatcherAPI>().signPatchedFile();
|
isSuccess = await locator<PatcherAPI>().signPatchedFile();
|
||||||
if (isSuccess != null && isSuccess) {
|
if (isSuccess != null && isSuccess) {
|
||||||
addLog('Done');
|
|
||||||
showButtons = true;
|
showButtons = true;
|
||||||
updateProgress(1.0);
|
updateProgress(1.0);
|
||||||
|
addLog('Finished');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,13 +122,13 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isSuccess == null || !isSuccess) {
|
if (isSuccess == null || !isSuccess) {
|
||||||
addLog('An error occurred! Aborting...');
|
addLog('An error occurred! Aborting');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
addLog('No patches selected! Aborting...');
|
addLog('No patches selected! Aborting');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
addLog('No app selected! Aborting...');
|
addLog('No app selected! Aborting');
|
||||||
}
|
}
|
||||||
await FlutterBackground.disableBackgroundExecution();
|
await FlutterBackground.disableBackgroundExecution();
|
||||||
isPatching = false;
|
isPatching = false;
|
||||||
@ -145,13 +139,14 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
locator<AppSelectorViewModel>().selectedApp;
|
locator<AppSelectorViewModel>().selectedApp;
|
||||||
if (selectedApp != null) {
|
if (selectedApp != null) {
|
||||||
addLog(selectedApp.isRooted
|
addLog(selectedApp.isRooted
|
||||||
? 'Installing patched file using root method...'
|
? 'Installing patched file using root method'
|
||||||
: 'Installing patched file using nonroot method...');
|
: 'Installing patched file using nonroot method');
|
||||||
isInstalled = await locator<PatcherAPI>().installPatchedFile(selectedApp);
|
isInstalled = await locator<PatcherAPI>().installPatchedFile(selectedApp);
|
||||||
if (isInstalled) {
|
if (isInstalled) {
|
||||||
addLog('Done');
|
addLog('Done');
|
||||||
|
await saveApp(selectedApp);
|
||||||
} else {
|
} else {
|
||||||
addLog('An error occurred! Aborting...');
|
addLog('An error occurred! Aborting');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -181,4 +176,14 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
DeviceApps.openApp(selectedApp.packageName);
|
DeviceApps.openApp(selectedApp.packageName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> saveApp(PatchedApplication selectedApp) async {
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
List<String> patchedApps = prefs.getStringList('patchedApps') ?? [];
|
||||||
|
String app = selectedApp.toJson().toString();
|
||||||
|
if (!patchedApps.contains(app)) {
|
||||||
|
patchedApps.add(app);
|
||||||
|
prefs.setStringList('patchedApps', patchedApps);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,57 +1,114 @@
|
|||||||
|
import 'dart:typed_data';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:revanced_manager/constants.dart';
|
import 'package:revanced_manager/constants.dart';
|
||||||
|
import 'package:revanced_manager/theme.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/patch_text_button.dart';
|
import 'package:revanced_manager/ui/widgets/patch_text_button.dart';
|
||||||
|
import 'package:expandable/expandable.dart';
|
||||||
|
import 'package:timeago/timeago.dart';
|
||||||
|
|
||||||
class ApplicationItem extends StatelessWidget {
|
class ApplicationItem extends StatelessWidget {
|
||||||
final String asset;
|
final Uint8List icon;
|
||||||
final String name;
|
final String name;
|
||||||
final String releaseDate;
|
final DateTime patchDate;
|
||||||
|
final String? changelog;
|
||||||
|
final bool isUpdatableApp;
|
||||||
final Function()? onPressed;
|
final Function()? onPressed;
|
||||||
|
|
||||||
const ApplicationItem({
|
const ApplicationItem({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.asset,
|
required this.icon,
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.releaseDate,
|
required this.patchDate,
|
||||||
|
this.changelog = '',
|
||||||
|
required this.isUpdatableApp,
|
||||||
required this.onPressed,
|
required this.onPressed,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final isSVG = asset.endsWith('.svg');
|
return ExpandablePanel(
|
||||||
return ListTile(
|
theme: const ExpandableThemeData(
|
||||||
horizontalTitleGap: 12.0,
|
hasIcon: false,
|
||||||
leading: isSVG
|
animationDuration: Duration(milliseconds: 450),
|
||||||
? SvgPicture.asset(
|
),
|
||||||
asset,
|
header: Container(
|
||||||
height: 26,
|
height: 60,
|
||||||
width: 26,
|
decoration: BoxDecoration(
|
||||||
)
|
borderRadius: const BorderRadius.all(
|
||||||
: Image.asset(
|
Radius.circular(16),
|
||||||
asset,
|
),
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 12.0),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 60,
|
||||||
|
child: Image.memory(
|
||||||
|
icon,
|
||||||
height: 39,
|
height: 39,
|
||||||
width: 39,
|
width: 39,
|
||||||
),
|
),
|
||||||
title: Text(
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
SizedBox(
|
||||||
|
width: MediaQuery.of(context).size.width - 250,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
name,
|
name,
|
||||||
style: GoogleFonts.roboto(
|
style: GoogleFonts.roboto(
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
subtitle: Text(
|
Text(
|
||||||
releaseDate,
|
format(patchDate),
|
||||||
|
style: robotoTextStyle.copyWith(
|
||||||
|
color: Theme.of(context).colorScheme.tertiary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
isUpdatableApp
|
||||||
|
? Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
|
child: PatchTextButton(
|
||||||
|
text: 'applicationItem.patchButton',
|
||||||
|
onPressed: onPressed,
|
||||||
|
borderColor: isDark
|
||||||
|
? const Color(0xff4D5054)
|
||||||
|
: const Color.fromRGBO(119, 146, 168, 1),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
collapsed: const Text(""),
|
||||||
|
expanded: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
I18nText(
|
||||||
|
'applicationItem.changelogLabel',
|
||||||
|
child: Text(
|
||||||
|
'',
|
||||||
|
style: robotoTextStyle.copyWith(fontWeight: FontWeight.w700),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
changelog!,
|
||||||
style: robotoTextStyle,
|
style: robotoTextStyle,
|
||||||
),
|
),
|
||||||
trailing: PatchTextButton(
|
],
|
||||||
text: FlutterI18n.translate(
|
|
||||||
context,
|
|
||||||
'applicationItem.patchButton',
|
|
||||||
),
|
),
|
||||||
onPressed: onPressed,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,94 +1,36 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:revanced_manager/app/app.locator.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:revanced_manager/models/patched_application.dart';
|
||||||
|
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/application_item.dart';
|
import 'package:revanced_manager/ui/widgets/application_item.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/patch_text_button.dart';
|
|
||||||
|
|
||||||
class AvailableUpdatesCard extends StatelessWidget {
|
class AvailableUpdatesCard extends StatelessWidget {
|
||||||
final Color? color;
|
|
||||||
const AvailableUpdatesCard({
|
const AvailableUpdatesCard({
|
||||||
Key? key,
|
Key? key,
|
||||||
this.color = const Color(0xff1B222B),
|
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Column(
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
color: color,
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 12),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
FutureBuilder<List<PatchedApplication>>(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12.0),
|
future: locator<HomeViewModel>().getPatchedApps(true),
|
||||||
child: Row(
|
builder: (context, snapshot) =>
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
snapshot.hasData && snapshot.data!.length > 1
|
||||||
children: [
|
? ListView.builder(
|
||||||
I18nText(
|
itemBuilder: (context, index) => ApplicationItem(
|
||||||
'availableUpdatesCard.widgetTitle',
|
icon: snapshot.data![index].icon,
|
||||||
child: Text(
|
name: snapshot.data![index].name,
|
||||||
'',
|
patchDate: snapshot.data![index].patchDate,
|
||||||
style: GoogleFonts.inter(
|
isUpdatableApp: true,
|
||||||
fontSize: 16,
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
PatchTextButton(
|
|
||||||
text: FlutterI18n.translate(
|
|
||||||
context,
|
|
||||||
'availableUpdatesCard.patchButton',
|
|
||||||
),
|
|
||||||
onPressed: () => {},
|
onPressed: () => {},
|
||||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
),
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
ApplicationItem(
|
|
||||||
asset: 'assets/images/revanced.svg',
|
|
||||||
name: 'ReVanced',
|
|
||||||
releaseDate: '2 days ago',
|
|
||||||
onPressed: () => {},
|
|
||||||
),
|
|
||||||
ApplicationItem(
|
|
||||||
asset: 'assets/images/reddit.png',
|
|
||||||
name: 'ReReddit',
|
|
||||||
releaseDate: 'Released 1 month ago',
|
|
||||||
onPressed: () => {},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
I18nText(
|
|
||||||
'availableUpdatesCard.changelogLabel',
|
|
||||||
child: Text(
|
|
||||||
'',
|
|
||||||
style: GoogleFonts.roboto(
|
|
||||||
color: Theme.of(context).colorScheme.tertiary,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
Text(
|
|
||||||
'fix: we made the player even worse (you love)',
|
|
||||||
style: GoogleFonts.roboto(
|
|
||||||
color: Theme.of(context).colorScheme.tertiary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
Text(
|
|
||||||
'chore: guhhughghu',
|
|
||||||
style: GoogleFonts.roboto(
|
|
||||||
color: Theme.of(context).colorScheme.tertiary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
51
lib/ui/widgets/dashboard_raw_chip.dart
Normal file
51
lib/ui/widgets/dashboard_raw_chip.dart
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
import 'package:revanced_manager/theme.dart';
|
||||||
|
|
||||||
|
class DashboardChip extends StatelessWidget {
|
||||||
|
final String label;
|
||||||
|
final bool isSelected;
|
||||||
|
final Function(bool)? onSelected;
|
||||||
|
const DashboardChip({
|
||||||
|
Key? key,
|
||||||
|
required this.label,
|
||||||
|
required this.isSelected,
|
||||||
|
this.onSelected,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return RawChip(
|
||||||
|
showCheckmark: false,
|
||||||
|
label: I18nText(label),
|
||||||
|
selected: isSelected,
|
||||||
|
labelStyle: GoogleFonts.inter(
|
||||||
|
color: isSelected
|
||||||
|
? isDark
|
||||||
|
? const Color(0xff95C0FE)
|
||||||
|
: Theme.of(context).colorScheme.secondary
|
||||||
|
: isDark
|
||||||
|
? Colors.grey
|
||||||
|
: Colors.grey[700],
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
selectedColor: const Color.fromRGBO(118, 155, 209, 0.42),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
side: BorderSide(
|
||||||
|
width: 1,
|
||||||
|
color: isDark
|
||||||
|
? isSelected
|
||||||
|
? const Color.fromRGBO(118, 155, 209, 0.42)
|
||||||
|
: Colors.grey
|
||||||
|
: isSelected
|
||||||
|
? const Color.fromRGBO(118, 155, 209, 0.42)
|
||||||
|
: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onSelected: onSelected,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -1,70 +1,36 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:revanced_manager/app/app.locator.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:revanced_manager/models/patched_application.dart';
|
||||||
|
import 'package:revanced_manager/ui/views/home/home_viewmodel.dart';
|
||||||
import 'package:revanced_manager/ui/widgets/application_item.dart';
|
import 'package:revanced_manager/ui/widgets/application_item.dart';
|
||||||
|
|
||||||
class InstalledAppsCard extends StatelessWidget {
|
class InstalledAppsCard extends StatelessWidget {
|
||||||
final Color? color;
|
|
||||||
const InstalledAppsCard({
|
const InstalledAppsCard({
|
||||||
Key? key,
|
Key? key,
|
||||||
this.color = const Color(0xff1B222B),
|
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Column(
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
color: color,
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 20),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
I18nText(
|
FutureBuilder<List<PatchedApplication>>(
|
||||||
'installedAppsCard.widgetTitle',
|
future: locator<HomeViewModel>().getPatchedApps(false),
|
||||||
child: Text(
|
builder: (context, snapshot) =>
|
||||||
'',
|
snapshot.hasData && snapshot.data!.length > 1
|
||||||
style: GoogleFonts.inter(
|
? ListView.builder(
|
||||||
fontSize: 16,
|
itemBuilder: (context, index) => ApplicationItem(
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
icon: snapshot.data![index].icon,
|
||||||
fontWeight: FontWeight.w500,
|
name: snapshot.data![index].name,
|
||||||
),
|
patchDate: snapshot.data![index].patchDate,
|
||||||
),
|
isUpdatableApp: false,
|
||||||
),
|
|
||||||
ApplicationItem(
|
|
||||||
asset: 'assets/images/revanced.svg',
|
|
||||||
name: 'ReVanced',
|
|
||||||
releaseDate: '2 days ago',
|
|
||||||
onPressed: () => {},
|
onPressed: () => {},
|
||||||
),
|
),
|
||||||
I18nText(
|
)
|
||||||
'installedAppsCard.changelogLabel',
|
: Container(),
|
||||||
child: Text(
|
|
||||||
'',
|
|
||||||
style: GoogleFonts.roboto(
|
|
||||||
color: Theme.of(context).colorScheme.tertiary,
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
Text(
|
|
||||||
'fix: we made the player even worse (you love)',
|
|
||||||
style: GoogleFonts.roboto(
|
|
||||||
color: Theme.of(context).colorScheme.tertiary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
Text(
|
|
||||||
'chore: guhhughghu',
|
|
||||||
style: GoogleFonts.roboto(
|
|
||||||
color: Theme.of(context).colorScheme.tertiary,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,6 +89,7 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
|||||||
),
|
),
|
||||||
onPressed: () => {},
|
onPressed: () => {},
|
||||||
backgroundColor: Theme.of(context).colorScheme.secondary,
|
backgroundColor: Theme.of(context).colorScheme.secondary,
|
||||||
|
borderColor: Theme.of(context).colorScheme.secondary,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
import 'package:revanced_manager/constants.dart';
|
import 'package:revanced_manager/constants.dart';
|
||||||
|
import 'package:revanced_manager/theme.dart';
|
||||||
|
|
||||||
class PatchTextButton extends StatelessWidget {
|
class PatchTextButton extends StatelessWidget {
|
||||||
final String text;
|
final String text;
|
||||||
@ -26,14 +28,23 @@ class PatchTextButton extends StatelessWidget {
|
|||||||
width: 1,
|
width: 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(
|
||||||
|
const EdgeInsets.symmetric(
|
||||||
|
horizontal: 16,
|
||||||
|
vertical: 4,
|
||||||
),
|
),
|
||||||
|
)),
|
||||||
|
child: I18nText(text,
|
||||||
child: Text(
|
child: Text(
|
||||||
text,
|
'',
|
||||||
style: interTextStyle.copyWith(
|
style: interTextStyle.copyWith(
|
||||||
color: backgroundColor == Colors.transparent
|
color: backgroundColor == Colors.transparent
|
||||||
? const Color.fromRGBO(119, 146, 186, 1)
|
? const Color.fromRGBO(119, 146, 186, 1)
|
||||||
: Colors.white),
|
: isDark
|
||||||
|
? Colors.black
|
||||||
|
: Colors.white,
|
||||||
),
|
),
|
||||||
|
)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,12 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
app_installer: ^1.1.0
|
app_installer: ^1.1.0
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
device_apps: ^2.2.0
|
device_apps:
|
||||||
|
git:
|
||||||
|
url: https://github.com/ponces/flutter_plugin_device_apps
|
||||||
|
ref: appinfo-from-storage
|
||||||
dio: ^4.0.6
|
dio: ^4.0.6
|
||||||
|
expandable: ^5.0.1
|
||||||
file_picker: ^5.0.1
|
file_picker: ^5.0.1
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
@ -28,7 +32,6 @@ dependencies:
|
|||||||
http: ^0.13.4
|
http: ^0.13.4
|
||||||
injectable: ^1.5.3
|
injectable: ^1.5.3
|
||||||
json_annotation: ^4.6.0
|
json_annotation: ^4.6.0
|
||||||
package_archive_info: ^0.1.0
|
|
||||||
path_provider: ^2.0.11
|
path_provider: ^2.0.11
|
||||||
root: ^2.0.2
|
root: ^2.0.2
|
||||||
share_extend: ^2.0.0
|
share_extend: ^2.0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user