mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-22 18:53:57 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bd218277d | ||
|
|
83ad7605c4 | ||
|
|
5fbc8ff7a0 | ||
|
|
bb4b59eee6 | ||
|
|
4cfb620d63 | ||
|
|
55739a9c78 | ||
|
|
482599bb4e | ||
|
|
3aaf49fee0 | ||
|
|
0424ee235c | ||
|
|
a178afce99 | ||
|
|
ef3685c817 | ||
|
|
e74fce8574 | ||
|
|
73e4ae1416 | ||
|
|
bcf3b36b13 | ||
|
|
9c3626c8ed | ||
|
|
a3dca8c142 | ||
|
|
ef0c59f693 |
@@ -44,7 +44,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "app.revanced.manager.flutter"
|
applicationId "app.revanced.manager.flutter"
|
||||||
minSdkVersion 21
|
minSdkVersion 26
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
@@ -71,7 +71,7 @@ dependencies {
|
|||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
|
|
||||||
// ReVanced
|
// ReVanced
|
||||||
implementation "app.revanced:revanced-patcher:4.4.0"
|
implementation "app.revanced:revanced-patcher:4.4.1"
|
||||||
|
|
||||||
// Signing & aligning
|
// Signing & aligning
|
||||||
implementation("org.bouncycastle:bcpkix-jdk15on:1.70")
|
implementation("org.bouncycastle:bcpkix-jdk15on:1.70")
|
||||||
|
|||||||
@@ -121,8 +121,11 @@
|
|||||||
"openButton": "Open",
|
"openButton": "Open",
|
||||||
"uninstallButton": "Uninstall",
|
"uninstallButton": "Uninstall",
|
||||||
"patchButton": "Patch",
|
"patchButton": "Patch",
|
||||||
|
"unpatchButton": "Unpatch",
|
||||||
"uninstallDialogTitle": "Uninstall",
|
"uninstallDialogTitle": "Uninstall",
|
||||||
"uninstallDialogText": "Are you sure you want to uninstall this app?",
|
"uninstallDialogText": "Are you sure you want to uninstall this app?",
|
||||||
|
"unpatchDialogTitle": "Unpatch",
|
||||||
|
"unpatchDialogText": "Are you sure you want to unpatch this app?",
|
||||||
"rootDialogTitle": "Error",
|
"rootDialogTitle": "Error",
|
||||||
"rootDialogText": "App was installed with root mode enabled but currently root mode is disabled.\nPlease enable root mode first.",
|
"rootDialogText": "App was installed with root mode enabled but currently root mode is disabled.\nPlease enable root mode first.",
|
||||||
"packageNameLabel": "Package Name",
|
"packageNameLabel": "Package Name",
|
||||||
|
|||||||
@@ -165,33 +165,96 @@ class ManagerAPI {
|
|||||||
return packageInfo.version;
|
return packageInfo.version;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> reAssessSavedApps() async {
|
Future<List<PatchedApplication>> getAppsToRemove(
|
||||||
List<PatchedApplication> patchedApps = getPatchedApps();
|
List<PatchedApplication> patchedApps,
|
||||||
|
) async {
|
||||||
List<PatchedApplication> toRemove = [];
|
List<PatchedApplication> toRemove = [];
|
||||||
for (PatchedApplication app in patchedApps) {
|
for (PatchedApplication app in patchedApps) {
|
||||||
bool isRemove = await isAppUninstalled(app);
|
bool isRemove = await isAppUninstalled(app);
|
||||||
if (isRemove) {
|
if (isRemove) {
|
||||||
toRemove.add(app);
|
toRemove.add(app);
|
||||||
} else {
|
}
|
||||||
app.hasUpdates = await hasAppUpdates(app.packageName, app.patchDate);
|
}
|
||||||
app.changelog = await getAppChangelog(app.packageName, app.patchDate);
|
return toRemove;
|
||||||
if (!app.hasUpdates) {
|
}
|
||||||
String? currentInstalledVersion =
|
|
||||||
(await DeviceApps.getApp(app.packageName))?.versionName;
|
Future<List<PatchedApplication>> getUnsavedApps(
|
||||||
if (currentInstalledVersion != null) {
|
List<PatchedApplication> patchedApps,
|
||||||
String currentSavedVersion = app.version;
|
) async {
|
||||||
int currentInstalledVersionInt = int.parse(
|
List<PatchedApplication> unsavedApps = [];
|
||||||
currentInstalledVersion.replaceAll(RegExp('[^0-9]'), ''));
|
List<String> installedApps = await _rootAPI.getInstalledApps();
|
||||||
int currentSavedVersionInt =
|
for (String packageName in installedApps) {
|
||||||
int.parse(currentSavedVersion.replaceAll(RegExp('[^0-9]'), ''));
|
if (!patchedApps.any((app) => app.packageName == packageName)) {
|
||||||
if (currentInstalledVersionInt > currentSavedVersionInt) {
|
ApplicationWithIcon? application =
|
||||||
app.hasUpdates = true;
|
await DeviceApps.getApp(packageName, true) as ApplicationWithIcon?;
|
||||||
}
|
if (application != null) {
|
||||||
|
unsavedApps.add(
|
||||||
|
PatchedApplication(
|
||||||
|
name: application.appName,
|
||||||
|
packageName: application.packageName,
|
||||||
|
version: application.versionName!,
|
||||||
|
apkFilePath: application.apkFilePath,
|
||||||
|
icon: application.icon,
|
||||||
|
patchDate: DateTime.now(),
|
||||||
|
isRooted: true,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<Application> userApps = await DeviceApps.getInstalledApplications(
|
||||||
|
includeSystemApps: false,
|
||||||
|
includeAppIcons: false,
|
||||||
|
);
|
||||||
|
for (Application app in userApps) {
|
||||||
|
if (app.packageName.startsWith('app.revanced') &&
|
||||||
|
!app.packageName.startsWith('app.revanced.manager.')) {
|
||||||
|
ApplicationWithIcon? application =
|
||||||
|
await DeviceApps.getApp(app.packageName, true)
|
||||||
|
as ApplicationWithIcon?;
|
||||||
|
if (application != null) {
|
||||||
|
unsavedApps.add(
|
||||||
|
PatchedApplication(
|
||||||
|
name: application.appName,
|
||||||
|
packageName: application.packageName,
|
||||||
|
version: application.versionName!,
|
||||||
|
apkFilePath: application.apkFilePath,
|
||||||
|
icon: application.icon,
|
||||||
|
patchDate: DateTime.now(),
|
||||||
|
isRooted: false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return unsavedApps;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> reAssessSavedApps() async {
|
||||||
|
List<PatchedApplication> patchedApps = getPatchedApps();
|
||||||
|
List<PatchedApplication> unsavedApps = await getUnsavedApps(patchedApps);
|
||||||
|
patchedApps.addAll(unsavedApps);
|
||||||
|
List<PatchedApplication> toRemove = await getAppsToRemove(patchedApps);
|
||||||
|
patchedApps.removeWhere((a) => toRemove.contains(a));
|
||||||
|
for (PatchedApplication app in patchedApps) {
|
||||||
|
app.hasUpdates = await hasAppUpdates(app.packageName, app.patchDate);
|
||||||
|
app.changelog = await getAppChangelog(app.packageName, app.patchDate);
|
||||||
|
if (!app.hasUpdates) {
|
||||||
|
String? currentInstalledVersion =
|
||||||
|
(await DeviceApps.getApp(app.packageName))?.versionName;
|
||||||
|
if (currentInstalledVersion != null) {
|
||||||
|
String currentSavedVersion = app.version;
|
||||||
|
int currentInstalledVersionInt = int.parse(
|
||||||
|
currentInstalledVersion.replaceAll(RegExp('[^0-9]'), ''));
|
||||||
|
int currentSavedVersionInt =
|
||||||
|
int.parse(currentSavedVersion.replaceAll(RegExp('[^0-9]'), ''));
|
||||||
|
if (currentInstalledVersionInt > currentSavedVersionInt) {
|
||||||
|
app.hasUpdates = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
patchedApps.removeWhere((a) => toRemove.contains(a));
|
|
||||||
await setPatchedApps(patchedApps);
|
await setPatchedApps(patchedApps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,12 @@ class RootAPI {
|
|||||||
final String _serviceDDirPath = '/data/adb/service.d';
|
final String _serviceDDirPath = '/data/adb/service.d';
|
||||||
|
|
||||||
Future<bool> hasRootPermissions() async {
|
Future<bool> hasRootPermissions() async {
|
||||||
bool? isRooted = await Root.isRooted();
|
try {
|
||||||
return isRooted != null && isRooted;
|
bool? isRooted = await Root.isRooted();
|
||||||
|
return isRooted != null && isRooted;
|
||||||
|
} on Exception {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setPermissions(
|
Future<void> setPermissions(
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:google_fonts/google_fonts.dart';
|
|||||||
var lightCustomColorScheme = ColorScheme.fromSeed(
|
var lightCustomColorScheme = ColorScheme.fromSeed(
|
||||||
seedColor: Colors.blue,
|
seedColor: Colors.blue,
|
||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
|
primary: const Color(0xff1B73E8),
|
||||||
);
|
);
|
||||||
|
|
||||||
var lightCustomTheme = ThemeData(
|
var lightCustomTheme = ThemeData(
|
||||||
@@ -23,8 +24,8 @@ var lightCustomTheme = ThemeData(
|
|||||||
var darkCustomColorScheme = ColorScheme.fromSeed(
|
var darkCustomColorScheme = ColorScheme.fromSeed(
|
||||||
seedColor: Colors.blue,
|
seedColor: Colors.blue,
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
primary: const Color(0xff7792BA),
|
primary: const Color(0xffA5CAFF),
|
||||||
surface: const Color(0xff0A0D11),
|
surface: const Color(0xff1B1A1D),
|
||||||
);
|
);
|
||||||
|
|
||||||
var darkCustomTheme = ThemeData(
|
var darkCustomTheme = ThemeData(
|
||||||
@@ -38,8 +39,8 @@ var darkCustomTheme = ThemeData(
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
canvasColor: const Color(0xff0A0D11),
|
canvasColor: const Color(0xff1B1A1D),
|
||||||
scaffoldBackgroundColor: const Color(0xff0A0D11),
|
scaffoldBackgroundColor: const Color(0xff1B1A1D),
|
||||||
toggleableActiveColor: const Color(0xff7792BA),
|
toggleableActiveColor: const Color(0xffA5CAFF),
|
||||||
textTheme: GoogleFonts.robotoTextTheme(ThemeData.dark().textTheme),
|
textTheme: GoogleFonts.robotoTextTheme(ThemeData.dark().textTheme),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class InstallerView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: !model.isPatching && model.hasErrors,
|
visible: !model.isPatching && !model.hasErrors,
|
||||||
child: CustomPopupMenu(
|
child: CustomPopupMenu(
|
||||||
onSelected: (value) => model.onMenuSelection(value),
|
onSelected: (value) => model.onMenuSelection(value),
|
||||||
children: {
|
children: {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_background/flutter_background.dart';
|
import 'package:flutter_background/flutter_background.dart';
|
||||||
import 'package:flutter_i18n/flutter_i18n.dart';
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
||||||
|
//import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:revanced_manager/app/app.locator.dart';
|
import 'package:revanced_manager/app/app.locator.dart';
|
||||||
import 'package:revanced_manager/models/patch.dart';
|
import 'package:revanced_manager/models/patch.dart';
|
||||||
import 'package:revanced_manager/models/patched_application.dart';
|
import 'package:revanced_manager/models/patched_application.dart';
|
||||||
@@ -29,29 +30,31 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
bool hasErrors = false;
|
bool hasErrors = false;
|
||||||
|
|
||||||
Future<void> initialize(BuildContext context) async {
|
Future<void> initialize(BuildContext context) async {
|
||||||
try {
|
if (true /*await Permission.ignoreBatteryOptimizations.isGranted*/) {
|
||||||
await FlutterBackground.initialize(
|
try {
|
||||||
androidConfig: FlutterBackgroundAndroidConfig(
|
await FlutterBackground.initialize(
|
||||||
notificationTitle: FlutterI18n.translate(
|
androidConfig: FlutterBackgroundAndroidConfig(
|
||||||
context,
|
notificationTitle: FlutterI18n.translate(
|
||||||
'installerView.notificationTitle',
|
context,
|
||||||
|
'installerView.notificationTitle',
|
||||||
|
),
|
||||||
|
notificationText: FlutterI18n.translate(
|
||||||
|
context,
|
||||||
|
'installerView.notificationText',
|
||||||
|
),
|
||||||
|
notificationImportance: AndroidNotificationImportance.Default,
|
||||||
|
notificationIcon: const AndroidResource(
|
||||||
|
name: 'ic_notification',
|
||||||
|
defType: 'drawable',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
notificationText: FlutterI18n.translate(
|
);
|
||||||
context,
|
await FlutterBackground.enableBackgroundExecution();
|
||||||
'installerView.notificationText',
|
} on Exception {
|
||||||
),
|
// ignore
|
||||||
notificationImportance: AndroidNotificationImportance.Default,
|
}
|
||||||
notificationIcon: const AndroidResource(
|
|
||||||
name: 'ic_notification',
|
|
||||||
defType: 'drawable',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
await FlutterBackground.enableBackgroundExecution();
|
|
||||||
await Wakelock.enable();
|
|
||||||
} on Exception {
|
|
||||||
// ignore
|
|
||||||
}
|
}
|
||||||
|
await Wakelock.enable();
|
||||||
await handlePlatformChannelMethods();
|
await handlePlatformChannelMethods();
|
||||||
await runPatcher();
|
await runPatcher();
|
||||||
}
|
}
|
||||||
@@ -119,12 +122,14 @@ class InstallerViewModel extends BaseViewModel {
|
|||||||
hasErrors = true;
|
hasErrors = true;
|
||||||
update(-1.0, 'Aborting...', 'No app or patches selected! Aborting');
|
update(-1.0, 'Aborting...', 'No app or patches selected! Aborting');
|
||||||
}
|
}
|
||||||
try {
|
if (true /*await Permission.ignoreBatteryOptimizations.isGranted*/) {
|
||||||
await FlutterBackground.disableBackgroundExecution();
|
try {
|
||||||
await Wakelock.disable();
|
await FlutterBackground.disableBackgroundExecution();
|
||||||
} on Exception {
|
} on Exception {
|
||||||
// ignore
|
// ignore
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
await Wakelock.disable();
|
||||||
isPatching = false;
|
isPatching = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class NavigationView extends StatelessWidget {
|
|||||||
context,
|
context,
|
||||||
'navigationView.dashboardTab',
|
'navigationView.dashboardTab',
|
||||||
),
|
),
|
||||||
|
tooltip: '',
|
||||||
),
|
),
|
||||||
NavigationDestination(
|
NavigationDestination(
|
||||||
icon: model.isIndexSelected(1)
|
icon: model.isIndexSelected(1)
|
||||||
@@ -51,6 +52,7 @@ class NavigationView extends StatelessWidget {
|
|||||||
context,
|
context,
|
||||||
'navigationView.patcherTab',
|
'navigationView.patcherTab',
|
||||||
),
|
),
|
||||||
|
tooltip: '',
|
||||||
),
|
),
|
||||||
NavigationDestination(
|
NavigationDestination(
|
||||||
icon: model.isIndexSelected(2)
|
icon: model.isIndexSelected(2)
|
||||||
@@ -60,6 +62,7 @@ class NavigationView extends StatelessWidget {
|
|||||||
context,
|
context,
|
||||||
'navigationView.settingsTab',
|
'navigationView.settingsTab',
|
||||||
),
|
),
|
||||||
|
tooltip: '',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import 'package:dynamic_themes/dynamic_themes.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:injectable/injectable.dart';
|
import 'package:injectable/injectable.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
//import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:revanced_manager/services/root_api.dart';
|
import 'package:revanced_manager/services/root_api.dart';
|
||||||
import 'package:revanced_manager/ui/views/home/home_view.dart';
|
import 'package:revanced_manager/ui/views/home/home_view.dart';
|
||||||
import 'package:revanced_manager/ui/views/patcher/patcher_view.dart';
|
import 'package:revanced_manager/ui/views/patcher/patcher_view.dart';
|
||||||
@@ -31,9 +31,12 @@ class NavigationViewModel extends IndexTrackingViewModel {
|
|||||||
: Brightness.light,
|
: Brightness.light,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
//if (prefs.getBool('permissionsRequested') == null) {
|
||||||
|
//await prefs.setBool('permissionsRequested', true);
|
||||||
RootAPI().hasRootPermissions();
|
RootAPI().hasRootPermissions();
|
||||||
Permission.requestInstallPackages.request();
|
//Permission.requestInstallPackages.request();
|
||||||
Permission.ignoreBatteryOptimizations.request();
|
//Permission.ignoreBatteryOptimizations.request();
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget getViewForIndex(int index) {
|
Widget getViewForIndex(int index) {
|
||||||
|
|||||||
@@ -96,8 +96,11 @@ class AppInfoView extends StatelessWidget {
|
|||||||
color: Theme.of(context).canvasColor,
|
color: Theme.of(context).canvasColor,
|
||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () =>
|
onTap: () => model.showUninstallAlertDialog(
|
||||||
model.showUninstallAlertDialog(context, app),
|
context,
|
||||||
|
app,
|
||||||
|
false,
|
||||||
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
@@ -154,6 +157,45 @@ class AppInfoView extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Visibility(
|
||||||
|
visible: app.isRooted,
|
||||||
|
child: VerticalDivider(
|
||||||
|
color: Theme.of(context).canvasColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Visibility(
|
||||||
|
visible: app.isRooted,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => model.showUninstallAlertDialog(
|
||||||
|
context,
|
||||||
|
app,
|
||||||
|
true,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Icon(
|
||||||
|
Icons.settings_backup_restore_outlined,
|
||||||
|
color:
|
||||||
|
Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
I18nText(
|
||||||
|
'appInfoView.unpatchButton',
|
||||||
|
child: Text(
|
||||||
|
'',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.primary,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -19,12 +19,15 @@ class AppInfoViewModel extends BaseViewModel {
|
|||||||
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
||||||
final RootAPI _rootAPI = RootAPI();
|
final RootAPI _rootAPI = RootAPI();
|
||||||
|
|
||||||
Future<void> uninstallApp(PatchedApplication app) async {
|
Future<void> uninstallApp(PatchedApplication app, bool onlyUnpatch) async {
|
||||||
if (app.isRooted) {
|
if (app.isRooted) {
|
||||||
bool hasRootPermissions = await _rootAPI.hasRootPermissions();
|
bool hasRootPermissions = await _rootAPI.hasRootPermissions();
|
||||||
if (hasRootPermissions) {
|
if (hasRootPermissions) {
|
||||||
_rootAPI.deleteApp(app.packageName, app.apkFilePath);
|
_rootAPI.deleteApp(app.packageName, app.apkFilePath);
|
||||||
_managerAPI.deletePatchedApp(app);
|
_managerAPI.deletePatchedApp(app);
|
||||||
|
if (!onlyUnpatch) {
|
||||||
|
DeviceApps.uninstallApp(app.packageName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DeviceApps.uninstallApp(app.packageName);
|
DeviceApps.uninstallApp(app.packageName);
|
||||||
@@ -43,32 +46,39 @@ class AppInfoViewModel extends BaseViewModel {
|
|||||||
Future<void> showUninstallAlertDialog(
|
Future<void> showUninstallAlertDialog(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
PatchedApplication app,
|
PatchedApplication app,
|
||||||
|
bool onlyUnpatch,
|
||||||
) async {
|
) async {
|
||||||
if (app.isRooted) {
|
bool hasRootPermissions = await _rootAPI.hasRootPermissions();
|
||||||
bool hasRootPermissions = await _rootAPI.hasRootPermissions();
|
if (app.isRooted && !hasRootPermissions) {
|
||||||
if (!hasRootPermissions) {
|
return showDialog(
|
||||||
return showDialog(
|
context: context,
|
||||||
context: context,
|
builder: (context) => AlertDialog(
|
||||||
builder: (context) => AlertDialog(
|
title: I18nText('appInfoView.rootDialogTitle'),
|
||||||
title: I18nText('appInfoView.rootDialogTitle'),
|
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||||
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
content: I18nText('appInfoView.rootDialogText'),
|
||||||
content: I18nText('appInfoView.rootDialogText'),
|
actions: <Widget>[
|
||||||
actions: <Widget>[
|
CustomMaterialButton(
|
||||||
CustomMaterialButton(
|
label: I18nText('okButton'),
|
||||||
label: I18nText('okButton'),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
)
|
||||||
)
|
],
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return showDialog(
|
return showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
title: I18nText('appInfoView.uninstallDialogTitle'),
|
title: I18nText(
|
||||||
|
onlyUnpatch
|
||||||
|
? 'appInfoView.unpatchDialogTitle'
|
||||||
|
: 'appInfoView.uninstallDialogTitle',
|
||||||
|
),
|
||||||
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||||
content: I18nText('appInfoView.uninstallDialogText'),
|
content: I18nText(
|
||||||
|
onlyUnpatch
|
||||||
|
? 'appInfoView.unpatchDialogText'
|
||||||
|
: 'appInfoView.uninstallDialogText',
|
||||||
|
),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
CustomMaterialButton(
|
CustomMaterialButton(
|
||||||
isFilled: false,
|
isFilled: false,
|
||||||
@@ -78,7 +88,7 @@ class AppInfoViewModel extends BaseViewModel {
|
|||||||
CustomMaterialButton(
|
CustomMaterialButton(
|
||||||
label: I18nText('okButton'),
|
label: I18nText('okButton'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
uninstallApp(app);
|
uninstallApp(app, onlyUnpatch);
|
||||||
locator<HomeViewModel>().initialize(context);
|
locator<HomeViewModel>().initialize(context);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class _LatestCommitCardState extends State<LatestCommitCard> {
|
|||||||
future: locator<HomeViewModel>().hasManagerUpdates(),
|
future: locator<HomeViewModel>().hasManagerUpdates(),
|
||||||
initialData: false,
|
initialData: false,
|
||||||
builder: (context, snapshot) => Opacity(
|
builder: (context, snapshot) => Opacity(
|
||||||
opacity: snapshot.hasData && snapshot.data! ? 1.0 : 0.5,
|
opacity: snapshot.hasData && snapshot.data! ? 1.0 : 0.25,
|
||||||
child: CustomMaterialButton(
|
child: CustomMaterialButton(
|
||||||
isExpanded: false,
|
isExpanded: false,
|
||||||
label: I18nText('latestCommitCard.updateButton'),
|
label: I18nText('latestCommitCard.updateButton'),
|
||||||
|
|||||||
@@ -61,6 +61,13 @@ class _AboutWidgetState extends State<AboutWidget> {
|
|||||||
fontWeight: FontWeight.w300,
|
fontWeight: FontWeight.w300,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Text(
|
||||||
|
'Build: ${snapshot.data!['flavor']}',
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
fontWeight: FontWeight.w300,
|
||||||
|
),
|
||||||
|
),
|
||||||
Text(
|
Text(
|
||||||
'Model: ${snapshot.data!['model']}',
|
'Model: ${snapshot.data!['model']}',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
|
|||||||
@@ -64,34 +64,43 @@ class _ApplicationItemState extends State<ApplicationItem>
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 60,
|
width: 40,
|
||||||
child: Image.memory(widget.icon, height: 39, width: 39),
|
child: Image.memory(widget.icon, height: 40, width: 40),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
Column(
|
Padding(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
padding: const EdgeInsets.only(left: 15.0),
|
||||||
children: <Widget>[
|
child: Column(
|
||||||
Text(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
widget.name,
|
children: <Widget>[
|
||||||
style: const TextStyle(
|
Text(
|
||||||
fontSize: 16,
|
widget.name.length > 10
|
||||||
fontWeight: FontWeight.w500,
|
? '${widget.name.substring(0, 10)}...'
|
||||||
|
: widget.name,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Text(format(widget.patchDate)),
|
||||||
Text(format(widget.patchDate)),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
RotationTransition(
|
Padding(
|
||||||
turns: Tween(begin: 0.0, end: 0.50).animate(_animationController),
|
padding: const EdgeInsets.only(right: 5.0),
|
||||||
child: IconButton(
|
child: RotationTransition(
|
||||||
onPressed: () {
|
turns:
|
||||||
expController.toggle();
|
Tween(begin: 0.0, end: 0.50).animate(_animationController),
|
||||||
_animationController.isCompleted
|
child: IconButton(
|
||||||
? _animationController.reverse()
|
onPressed: () {
|
||||||
: _animationController.forward();
|
expController.toggle();
|
||||||
},
|
_animationController.isCompleted
|
||||||
icon: const Icon(Icons.arrow_drop_down),
|
? _animationController.reverse()
|
||||||
|
: _animationController.forward();
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.arrow_drop_down),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
@@ -111,7 +120,7 @@ class _ApplicationItemState extends State<ApplicationItem>
|
|||||||
),
|
),
|
||||||
collapsed: const Text(''),
|
collapsed: const Text(''),
|
||||||
expanded: Padding(
|
expanded: Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
|
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class CustomCard extends StatelessWidget {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(16),
|
borderRadius: BorderRadius.circular(16),
|
||||||
color: isFilled
|
color: isFilled
|
||||||
? Theme.of(context).colorScheme.secondaryContainer
|
? Theme.of(context).colorScheme.secondaryContainer.withOpacity(0.40)
|
||||||
: Colors.transparent,
|
: Colors.transparent,
|
||||||
border: isFilled
|
border: isFilled
|
||||||
? null
|
? null
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class DashboardChip extends StatelessWidget {
|
|||||||
color: isSelected
|
color: isSelected
|
||||||
? Theme.of(context).colorScheme.primary
|
? Theme.of(context).colorScheme.primary
|
||||||
: Theme.of(context).colorScheme.secondary,
|
: Theme.of(context).colorScheme.secondary,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
selectedColor: Theme.of(context).colorScheme.secondaryContainer,
|
selectedColor: Theme.of(context).colorScheme.secondaryContainer,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
|
|
||||||
@@ -7,6 +8,7 @@ class AboutInfo {
|
|||||||
final info = await DeviceInfoPlugin().androidInfo;
|
final info = await DeviceInfoPlugin().androidInfo;
|
||||||
return {
|
return {
|
||||||
'version': packageInfo.version,
|
'version': packageInfo.version,
|
||||||
|
'flavor': kReleaseMode ? 'release' : 'debug',
|
||||||
'model': info.model,
|
'model': info.model,
|
||||||
'androidVersion': info.version.release,
|
'androidVersion': info.version.release,
|
||||||
'arch': info.supportedAbis.first
|
'arch': info.supportedAbis.first
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
|
|||||||
|
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.0.7+7
|
version: 0.0.9+9
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.5 <3.0.0"
|
sdk: ">=2.17.5 <3.0.0"
|
||||||
@@ -52,7 +52,7 @@ dependencies:
|
|||||||
ref: feature/nullSafe
|
ref: feature/nullSafe
|
||||||
package_info_plus: ^1.4.3+1
|
package_info_plus: ^1.4.3+1
|
||||||
path_provider: ^2.0.11
|
path_provider: ^2.0.11
|
||||||
permission_handler: ^10.0.0
|
#permission_handler: ^10.0.0
|
||||||
pull_to_refresh: ^2.0.0
|
pull_to_refresh: ^2.0.0
|
||||||
root: ^2.0.2
|
root: ^2.0.2
|
||||||
share_extend: ^2.0.0
|
share_extend: ^2.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user