mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-13 02:14:31 +01:00
fix: add some minor improvements and fix release builds
This commit is contained in:
parent
70a50c7177
commit
2cd9f99aa3
13 changed files with 169 additions and 146 deletions
|
@ -52,6 +52,8 @@ android {
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
shrinkResources false
|
||||||
|
minifyEnabled false
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ class MainActivity : FlutterActivity() {
|
||||||
path,
|
path,
|
||||||
DexClassLoader(
|
DexClassLoader(
|
||||||
path,
|
path,
|
||||||
context.cacheDir.path,
|
applicationContext.cacheDir.path,
|
||||||
null,
|
null,
|
||||||
javaClass.classLoader
|
javaClass.classLoader
|
||||||
)
|
)
|
||||||
|
@ -180,7 +180,7 @@ class MainActivity : FlutterActivity() {
|
||||||
|
|
||||||
fun createPatcher(inputFilePath: String, cacheDirPath: String): Boolean {
|
fun createPatcher(inputFilePath: String, cacheDirPath: String): Boolean {
|
||||||
val inputFile = File(inputFilePath)
|
val inputFile = File(inputFilePath)
|
||||||
val aaptPath = Aapt.binary(context).absolutePath
|
val aaptPath = Aapt.binary(applicationContext).absolutePath
|
||||||
patcher = Patcher(PatcherOptions(inputFile, cacheDirPath, true, aaptPath, cacheDirPath))
|
patcher = Patcher(PatcherOptions(inputFile, cacheDirPath, true, aaptPath, cacheDirPath))
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
// StackedLocatorGenerator
|
// StackedLocatorGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
// ignore_for_file: public_member_api_docs, depend_on_referenced_packages, implementation_imports
|
// ignore_for_file: public_member_api_docs, depend_on_referenced_packages
|
||||||
|
|
||||||
import 'package:stacked_core/stacked_core.dart';
|
import 'package:stacked_core/stacked_core.dart';
|
||||||
import 'package:stacked_services/src/navigation/navigation_service.dart';
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
import 'package:stacked_themes/src/theme_service.dart';
|
import 'package:stacked_themes/stacked_themes.dart';
|
||||||
|
|
||||||
import '../services/patcher_api.dart';
|
import '../services/patcher_api.dart';
|
||||||
import '../ui/views/app_selector/app_selector_viewmodel.dart';
|
import '../ui/views/app_selector/app_selector_viewmodel.dart';
|
||||||
|
|
|
@ -4,165 +4,176 @@
|
||||||
// StackedRouterGenerator
|
// StackedRouterGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
// ignore_for_file: no_leading_underscores_for_library_prefixes, implementation_imports
|
// ignore_for_file: public_member_api_docs, unused_import, non_constant_identifier_names
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/src/foundation/key.dart' as _i7;
|
|
||||||
import 'package:stacked/stacked.dart' as _i1;
|
|
||||||
import 'package:stacked_services/stacked_services.dart' as _i8;
|
|
||||||
|
|
||||||
import '../ui/views/app_selector/app_selector_view.dart' as _i2;
|
import 'package:flutter/material.dart';
|
||||||
import '../ui/views/contributors/contributors_view.dart' as _i6;
|
import 'package:stacked/stacked.dart';
|
||||||
import '../ui/views/installer/installer_view.dart' as _i4;
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
import '../ui/views/patches_selector/patches_selector_view.dart' as _i3;
|
|
||||||
import '../ui/views/settings/settings_view.dart' as _i5;
|
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/settings/settings_view.dart';
|
||||||
|
|
||||||
class Routes {
|
class Routes {
|
||||||
static const appSelectorView = '/app-selector-view';
|
static const String appSelectorView = '/app-selector-view';
|
||||||
|
static const String patchesSelectorView = '/patches-selector-view';
|
||||||
static const patchesSelectorView = '/patches-selector-view';
|
static const String installerView = '/installer-view';
|
||||||
|
static const String settingsView = '/settings-view';
|
||||||
static const installerView = '/installer-view';
|
static const String contributorsView = '/contributors-view';
|
||||||
|
|
||||||
static const settingsView = '/settings-view';
|
|
||||||
|
|
||||||
static const contributorsView = '/contributors-view';
|
|
||||||
|
|
||||||
static const all = <String>{
|
static const all = <String>{
|
||||||
appSelectorView,
|
appSelectorView,
|
||||||
patchesSelectorView,
|
patchesSelectorView,
|
||||||
installerView,
|
installerView,
|
||||||
settingsView,
|
settingsView,
|
||||||
contributorsView
|
contributorsView,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
class StackedRouter extends _i1.RouterBase {
|
class StackedRouter extends RouterBase {
|
||||||
final _routes = <_i1.RouteDef>[
|
@override
|
||||||
_i1.RouteDef(Routes.appSelectorView, page: _i2.AppSelectorView),
|
List<RouteDef> get routes => _routes;
|
||||||
_i1.RouteDef(Routes.patchesSelectorView, page: _i3.PatchesSelectorView),
|
final _routes = <RouteDef>[
|
||||||
_i1.RouteDef(Routes.installerView, page: _i4.InstallerView),
|
RouteDef(Routes.appSelectorView, page: AppSelectorView),
|
||||||
_i1.RouteDef(Routes.settingsView, page: _i5.SettingsView),
|
RouteDef(Routes.patchesSelectorView, page: PatchesSelectorView),
|
||||||
_i1.RouteDef(Routes.contributorsView, page: _i6.ContributorsView)
|
RouteDef(Routes.installerView, page: InstallerView),
|
||||||
|
RouteDef(Routes.settingsView, page: SettingsView),
|
||||||
|
RouteDef(Routes.contributorsView, page: ContributorsView),
|
||||||
];
|
];
|
||||||
|
@override
|
||||||
final _pagesMap = <Type, _i1.StackedRouteFactory>{
|
Map<Type, StackedRouteFactory> get pagesMap => _pagesMap;
|
||||||
_i2.AppSelectorView: (data) {
|
final _pagesMap = <Type, StackedRouteFactory>{
|
||||||
|
AppSelectorView: (data) {
|
||||||
return MaterialPageRoute<dynamic>(
|
return MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i2.AppSelectorView(),
|
builder: (context) => const AppSelectorView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i3.PatchesSelectorView: (data) {
|
PatchesSelectorView: (data) {
|
||||||
return MaterialPageRoute<dynamic>(
|
return MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i3.PatchesSelectorView(),
|
builder: (context) => const PatchesSelectorView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i4.InstallerView: (data) {
|
InstallerView: (data) {
|
||||||
final args = data.getArgs<InstallerViewArguments>(
|
var args = data.getArgs<InstallerViewArguments>(
|
||||||
orElse: () => const InstallerViewArguments(),
|
orElse: () => InstallerViewArguments(),
|
||||||
);
|
);
|
||||||
return MaterialPageRoute<dynamic>(
|
return MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => _i4.InstallerView(key: args.key),
|
builder: (context) => InstallerView(key: args.key),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i5.SettingsView: (data) {
|
SettingsView: (data) {
|
||||||
return MaterialPageRoute<dynamic>(
|
return MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i5.SettingsView(),
|
builder: (context) => const SettingsView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
_i6.ContributorsView: (data) {
|
ContributorsView: (data) {
|
||||||
return MaterialPageRoute<dynamic>(
|
return MaterialPageRoute<dynamic>(
|
||||||
builder: (context) => const _i6.ContributorsView(),
|
builder: (context) => const ContributorsView(),
|
||||||
settings: data,
|
settings: data,
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@override
|
|
||||||
List<_i1.RouteDef> get routes => _routes;
|
|
||||||
@override
|
|
||||||
Map<Type, _i1.StackedRouteFactory> get pagesMap => _pagesMap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// ************************************************************************
|
||||||
|
/// Arguments holder classes
|
||||||
|
/// *************************************************************************
|
||||||
|
|
||||||
|
/// InstallerView arguments holder class
|
||||||
class InstallerViewArguments {
|
class InstallerViewArguments {
|
||||||
const InstallerViewArguments({this.key});
|
final Key? key;
|
||||||
|
InstallerViewArguments({this.key});
|
||||||
final _i7.Key? key;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension NavigatorStateExtension on _i8.NavigationService {
|
/// ************************************************************************
|
||||||
Future<dynamic> navigateToAppSelectorView(
|
/// Extension for strongly typed navigation
|
||||||
[int? routerId,
|
/// *************************************************************************
|
||||||
bool preventDuplicates = true,
|
|
||||||
Map<String, String>? parameters,
|
extension NavigatorStateExtension on NavigationService {
|
||||||
Widget Function(
|
Future<dynamic> navigateToAppSelectorView({
|
||||||
BuildContext, Animation<double>, Animation<double>, Widget)?
|
int? routerId,
|
||||||
transition]) async {
|
bool preventDuplicates = true,
|
||||||
navigateTo(Routes.appSelectorView,
|
Map<String, String>? parameters,
|
||||||
id: routerId,
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
preventDuplicates: preventDuplicates,
|
transition,
|
||||||
parameters: parameters,
|
}) async {
|
||||||
transition: transition);
|
return navigateTo(
|
||||||
|
Routes.appSelectorView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> navigateToPatchesSelectorView(
|
Future<dynamic> navigateToPatchesSelectorView({
|
||||||
[int? routerId,
|
int? routerId,
|
||||||
bool preventDuplicates = true,
|
bool preventDuplicates = true,
|
||||||
Map<String, String>? parameters,
|
Map<String, String>? parameters,
|
||||||
Widget Function(
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
BuildContext, Animation<double>, Animation<double>, Widget)?
|
transition,
|
||||||
transition]) async {
|
}) async {
|
||||||
navigateTo(Routes.patchesSelectorView,
|
return navigateTo(
|
||||||
id: routerId,
|
Routes.patchesSelectorView,
|
||||||
preventDuplicates: preventDuplicates,
|
id: routerId,
|
||||||
parameters: parameters,
|
preventDuplicates: preventDuplicates,
|
||||||
transition: transition);
|
parameters: parameters,
|
||||||
|
transition: transition,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> navigateToInstallerView(
|
Future<dynamic> navigateToInstallerView({
|
||||||
{_i7.Key? key,
|
Key? key,
|
||||||
int? routerId,
|
int? routerId,
|
||||||
bool preventDuplicates = true,
|
bool preventDuplicates = true,
|
||||||
Map<String, String>? parameters,
|
Map<String, String>? parameters,
|
||||||
Widget Function(
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
BuildContext, Animation<double>, Animation<double>, Widget)?
|
transition,
|
||||||
transition}) async {
|
}) async {
|
||||||
navigateTo(Routes.installerView,
|
return navigateTo(
|
||||||
arguments: InstallerViewArguments(key: key),
|
Routes.installerView,
|
||||||
id: routerId,
|
arguments: InstallerViewArguments(key: key),
|
||||||
preventDuplicates: preventDuplicates,
|
id: routerId,
|
||||||
parameters: parameters,
|
preventDuplicates: preventDuplicates,
|
||||||
transition: transition);
|
parameters: parameters,
|
||||||
|
transition: transition,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> navigateToSettingsView(
|
Future<dynamic> navigateToSettingsView({
|
||||||
[int? routerId,
|
int? routerId,
|
||||||
bool preventDuplicates = true,
|
bool preventDuplicates = true,
|
||||||
Map<String, String>? parameters,
|
Map<String, String>? parameters,
|
||||||
Widget Function(
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
BuildContext, Animation<double>, Animation<double>, Widget)?
|
transition,
|
||||||
transition]) async {
|
}) async {
|
||||||
navigateTo(Routes.settingsView,
|
return navigateTo(
|
||||||
id: routerId,
|
Routes.settingsView,
|
||||||
preventDuplicates: preventDuplicates,
|
id: routerId,
|
||||||
parameters: parameters,
|
preventDuplicates: preventDuplicates,
|
||||||
transition: transition);
|
parameters: parameters,
|
||||||
|
transition: transition,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<dynamic> navigateToContributorsView(
|
Future<dynamic> navigateToContributorsView({
|
||||||
[int? routerId,
|
int? routerId,
|
||||||
bool preventDuplicates = true,
|
bool preventDuplicates = true,
|
||||||
Map<String, String>? parameters,
|
Map<String, String>? parameters,
|
||||||
Widget Function(
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
BuildContext, Animation<double>, Animation<double>, Widget)?
|
transition,
|
||||||
transition]) async {
|
}) async {
|
||||||
navigateTo(Routes.contributorsView,
|
return navigateTo(
|
||||||
id: routerId,
|
Routes.contributorsView,
|
||||||
preventDuplicates: preventDuplicates,
|
id: routerId,
|
||||||
parameters: parameters,
|
preventDuplicates: preventDuplicates,
|
||||||
transition: transition);
|
parameters: parameters,
|
||||||
|
transition: transition,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,16 +44,16 @@ class PatcherAPI {
|
||||||
String? dexFileUrl =
|
String? dexFileUrl =
|
||||||
await githubAPI.latestRelease('revanced', 'revanced-patches');
|
await githubAPI.latestRelease('revanced', 'revanced-patches');
|
||||||
if (dexFileUrl != null && dexFileUrl.isNotEmpty) {
|
if (dexFileUrl != null && dexFileUrl.isNotEmpty) {
|
||||||
_patchBundleFile =
|
|
||||||
await DefaultCacheManager().getSingleFile(dexFileUrl);
|
|
||||||
try {
|
try {
|
||||||
|
_patchBundleFile =
|
||||||
|
await DefaultCacheManager().getSingleFile(dexFileUrl);
|
||||||
return await platform.invokeMethod<bool>(
|
return await platform.invokeMethod<bool>(
|
||||||
'loadPatches',
|
'loadPatches',
|
||||||
{
|
{
|
||||||
'pathBundlesPaths': <String>[_patchBundleFile!.absolute.path],
|
'pathBundlesPaths': <String>[_patchBundleFile!.absolute.path],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} on PlatformException {
|
} on Exception {
|
||||||
_patchBundleFile = null;
|
_patchBundleFile = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ class PatcherAPI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} on PlatformException {
|
} on Exception {
|
||||||
_filteredPackages.clear();
|
_filteredPackages.clear();
|
||||||
return List.empty();
|
return List.empty();
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ class PatcherAPI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} on PlatformException {
|
} on Exception {
|
||||||
_filteredPatches[selectedApp.packageName]!.clear();
|
_filteredPatches[selectedApp.packageName]!.clear();
|
||||||
return List.empty();
|
return List.empty();
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ class PatcherAPI {
|
||||||
'inputFilePath': _inputFile!.path,
|
'inputFilePath': _inputFile!.path,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} on PlatformException {
|
} on Exception {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ class PatcherAPI {
|
||||||
'cacheDirPath': _cacheDir!.path,
|
'cacheDirPath': _cacheDir!.path,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} on PlatformException {
|
} on Exception {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ class PatcherAPI {
|
||||||
'integrationsPath': _integrations!.path,
|
'integrationsPath': _integrations!.path,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} on PlatformException {
|
} on Exception {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ class PatcherAPI {
|
||||||
'selectedPatches': selectedPatches.map((e) => e.name).toList(),
|
'selectedPatches': selectedPatches.map((e) => e.name).toList(),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} on PlatformException {
|
} on Exception {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ class PatcherAPI {
|
||||||
'patchedFilePath': _patchedFile!.path,
|
'patchedFilePath': _patchedFile!.path,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} on PlatformException {
|
} on Exception {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ class PatcherAPI {
|
||||||
'outFilePath': _outFile!.path,
|
'outFilePath': _outFile!.path,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} on PlatformException {
|
} on Exception {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -277,9 +277,11 @@ class PatcherAPI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sharePatchedFile(String packageName) {
|
bool sharePatchedFile(String appName, String version) {
|
||||||
if (_outFile != null) {
|
if (_outFile != null) {
|
||||||
String sharePath = '${_outFile!.parent.path}/$packageName.revanced.apk';
|
String path = _outFile!.parent.path;
|
||||||
|
String prefix = appName.toLowerCase().replaceAll(' ', '-');
|
||||||
|
String sharePath = '$path/$prefix-revanced_v$version.apk';
|
||||||
File share = _outFile!.copySync(sharePath);
|
File share = _outFile!.copySync(sharePath);
|
||||||
ShareExtend.share(share.path, "file");
|
ShareExtend.share(share.path, "file");
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -9,6 +9,7 @@ import 'package:revanced_manager/app/app.locator.dart';
|
||||||
import 'package:revanced_manager/models/application_info.dart';
|
import 'package:revanced_manager/models/application_info.dart';
|
||||||
import 'package:revanced_manager/services/patcher_api.dart';
|
import 'package:revanced_manager/services/patcher_api.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:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
class AppSelectorViewModel extends BaseViewModel {
|
class AppSelectorViewModel extends BaseViewModel {
|
||||||
|
@ -34,6 +35,7 @@ class AppSelectorViewModel extends BaseViewModel {
|
||||||
apkFilePath: application.apkFilePath,
|
apkFilePath: application.apkFilePath,
|
||||||
);
|
);
|
||||||
locator<AppSelectorViewModel>().selectedApp = app;
|
locator<AppSelectorViewModel>().selectedApp = app;
|
||||||
|
locator<PatchesSelectorViewModel>().selectedPatches.clear();
|
||||||
locator<PatcherViewModel>().dimPatchCard = false;
|
locator<PatcherViewModel>().dimPatchCard = false;
|
||||||
locator<PatcherViewModel>().notifyListeners();
|
locator<PatcherViewModel>().notifyListeners();
|
||||||
}
|
}
|
||||||
|
@ -55,6 +57,7 @@ class AppSelectorViewModel extends BaseViewModel {
|
||||||
apkFilePath: result.files.single.path!,
|
apkFilePath: result.files.single.path!,
|
||||||
);
|
);
|
||||||
locator<AppSelectorViewModel>().selectedApp = app;
|
locator<AppSelectorViewModel>().selectedApp = app;
|
||||||
|
locator<PatchesSelectorViewModel>().selectedPatches.clear();
|
||||||
locator<PatcherViewModel>().dimPatchCard = false;
|
locator<PatcherViewModel>().dimPatchCard = false;
|
||||||
locator<PatcherViewModel>().notifyListeners();
|
locator<PatcherViewModel>().notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,15 +23,6 @@ class HomeView extends StatelessWidget {
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
|
||||||
alignment: Alignment.topRight,
|
|
||||||
child: IconButton(
|
|
||||||
onPressed: () => {},
|
|
||||||
icon: const Icon(
|
|
||||||
Icons.more_vert,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 60),
|
const SizedBox(height: 60),
|
||||||
I18nText(
|
I18nText(
|
||||||
'homeView.widgetTitle',
|
'homeView.widgetTitle',
|
||||||
|
|
|
@ -75,7 +75,10 @@ class InstallerView extends StatelessWidget {
|
||||||
child: SelectableText(
|
child: SelectableText(
|
||||||
model.logs,
|
model.logs,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontFamily: 'monospace', fontSize: 15),
|
fontFamily: 'monospace',
|
||||||
|
fontSize: 15,
|
||||||
|
height: 1.5,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
|
@ -133,6 +136,7 @@ class InstallerView extends StatelessWidget {
|
||||||
),
|
),
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
if (!model.isPatching) {
|
if (!model.isPatching) {
|
||||||
|
model.cleanWorkplace();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:revanced_manager/models/application_info.dart';
|
||||||
import 'package:revanced_manager/models/patch.dart';
|
import 'package:revanced_manager/models/patch.dart';
|
||||||
import 'package:revanced_manager/services/patcher_api.dart';
|
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/patches_selector/patches_selector_viewmodel.dart';
|
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
|
||||||
import 'package:stacked/stacked.dart';
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ class InstallerViewModel extends BaseViewModel {
|
||||||
List<Patch> selectedPatches =
|
List<Patch> selectedPatches =
|
||||||
locator<PatchesSelectorViewModel>().selectedPatches;
|
locator<PatchesSelectorViewModel>().selectedPatches;
|
||||||
if (selectedPatches.isNotEmpty) {
|
if (selectedPatches.isNotEmpty) {
|
||||||
addLog('Initializing patcher...');
|
addLog('Initializing installer...');
|
||||||
bool? isSuccess = await locator<PatcherAPI>().initPatcher();
|
bool? isSuccess = await locator<PatcherAPI>().initPatcher();
|
||||||
if (isSuccess != null && isSuccess) {
|
if (isSuccess != null && isSuccess) {
|
||||||
addLog('Done');
|
addLog('Done');
|
||||||
|
@ -108,7 +109,17 @@ class InstallerViewModel extends BaseViewModel {
|
||||||
void shareResult() {
|
void shareResult() {
|
||||||
ApplicationInfo? selectedApp = locator<AppSelectorViewModel>().selectedApp;
|
ApplicationInfo? selectedApp = locator<AppSelectorViewModel>().selectedApp;
|
||||||
if (selectedApp != null) {
|
if (selectedApp != null) {
|
||||||
locator<PatcherAPI>().sharePatchedFile(selectedApp.packageName);
|
locator<PatcherAPI>().sharePatchedFile(
|
||||||
|
selectedApp.name,
|
||||||
|
selectedApp.version,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cleanWorkplace() {
|
||||||
|
locator<PatcherAPI>().cleanPatcher();
|
||||||
|
locator<AppSelectorViewModel>().selectedApp = null;
|
||||||
|
locator<PatchesSelectorViewModel>().selectedPatches.clear();
|
||||||
|
locator<PatcherViewModel>().notifyListeners();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ class AppSelectorCard extends StatelessWidget {
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
locator<AppSelectorViewModel>().selectedApp != null
|
locator<AppSelectorViewModel>().selectedApp != null
|
||||||
? Text(
|
? Text(
|
||||||
locator<AppSelectorViewModel>().selectedApp!.packageName,
|
locator<AppSelectorViewModel>().selectedApp!.name,
|
||||||
style: robotoTextStyle,
|
style: robotoTextStyle,
|
||||||
)
|
)
|
||||||
: I18nText(
|
: I18nText(
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:github/github.dart';
|
import 'package:github/github.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:revanced_manager/constants.dart';
|
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
class ContributorsCard extends StatefulWidget {
|
class ContributorsCard extends StatefulWidget {
|
||||||
|
|
Loading…
Reference in a new issue