mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-25 03:51:02 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9242c1958 | ||
|
|
f9865166b0 | ||
|
|
f0f934f6a1 | ||
|
|
3d25655851 |
@@ -89,19 +89,25 @@ class PatcherAPI {
|
|||||||
|
|
||||||
Future<bool> needsIntegrations(List<Patch> selectedPatches) async {
|
Future<bool> needsIntegrations(List<Patch> selectedPatches) async {
|
||||||
return selectedPatches.any(
|
return selectedPatches.any(
|
||||||
(patch) => patch.dependencies.contains('integrations'),
|
(patch) => patch.dependencies.any(
|
||||||
|
(dep) => dep.contains('integrations'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> needsResourcePatching(List<Patch> selectedPatches) async {
|
Future<bool> needsResourcePatching(List<Patch> selectedPatches) async {
|
||||||
return selectedPatches.any(
|
return selectedPatches.any(
|
||||||
(patch) => patch.dependencies.any((dep) => dep.contains('resource-')),
|
(patch) => patch.dependencies.any(
|
||||||
|
(dep) => dep.contains('resource-'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> needsSettingsPatch(List<Patch> selectedPatches) async {
|
Future<bool> needsSettingsPatch(List<Patch> selectedPatches) async {
|
||||||
return selectedPatches.any(
|
return selectedPatches.any(
|
||||||
(patch) => patch.dependencies.contains('settings'),
|
(patch) => patch.dependencies.any(
|
||||||
|
(dep) => dep.contains('settings'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,12 @@ class RootAPI {
|
|||||||
|
|
||||||
Future<bool> hasRootPermissions() async {
|
Future<bool> hasRootPermissions() async {
|
||||||
try {
|
try {
|
||||||
bool? isRooted = await Root.isRooted();
|
bool? isRooted = await Root.isRootAvailable();
|
||||||
return isRooted != null && isRooted;
|
if (isRooted != null && isRooted) {
|
||||||
|
isRooted = await Root.isRooted();
|
||||||
|
return isRooted != null && isRooted;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
} on Exception {
|
} on Exception {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,52 +104,50 @@ class AppInfoView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (app.isRooted)
|
VerticalDivider(
|
||||||
VerticalDivider(
|
color: Theme.of(context).canvasColor,
|
||||||
color: Theme.of(context).canvasColor,
|
indent: 12.0,
|
||||||
indent: 12.0,
|
endIndent: 12.0,
|
||||||
endIndent: 12.0,
|
width: 1.0,
|
||||||
width: 1.0,
|
),
|
||||||
),
|
Expanded(
|
||||||
if (app.isRooted)
|
child: Material(
|
||||||
Expanded(
|
type: MaterialType.transparency,
|
||||||
child: Material(
|
child: InkWell(
|
||||||
type: MaterialType.transparency,
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
child: InkWell(
|
onTap: () => model.showUninstallDialog(
|
||||||
borderRadius: BorderRadius.circular(16.0),
|
context,
|
||||||
onTap: () => model.showUninstallDialog(
|
app,
|
||||||
context,
|
false,
|
||||||
app,
|
),
|
||||||
false,
|
child: Column(
|
||||||
),
|
mainAxisAlignment:
|
||||||
child: Column(
|
MainAxisAlignment.center,
|
||||||
mainAxisAlignment:
|
children: <Widget>[
|
||||||
MainAxisAlignment.center,
|
Icon(
|
||||||
children: <Widget>[
|
Icons.delete_outline,
|
||||||
Icon(
|
color: Theme.of(context)
|
||||||
Icons.delete_outline,
|
.colorScheme
|
||||||
color: Theme.of(context)
|
.primary,
|
||||||
.colorScheme
|
),
|
||||||
.primary,
|
const SizedBox(height: 10),
|
||||||
),
|
I18nText(
|
||||||
const SizedBox(height: 10),
|
'appInfoView.uninstallButton',
|
||||||
I18nText(
|
child: Text(
|
||||||
'appInfoView.uninstallButton',
|
'',
|
||||||
child: Text(
|
style: TextStyle(
|
||||||
'',
|
color: Theme.of(context)
|
||||||
style: TextStyle(
|
.colorScheme
|
||||||
color: Theme.of(context)
|
.primary,
|
||||||
.colorScheme
|
fontWeight: FontWeight.bold,
|
||||||
.primary,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
VerticalDivider(
|
VerticalDivider(
|
||||||
color: Theme.of(context).canvasColor,
|
color: Theme.of(context).canvasColor,
|
||||||
indent: 12.0,
|
indent: 12.0,
|
||||||
|
|||||||
@@ -20,20 +20,26 @@ 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, bool onlyUnpatch) async {
|
Future<void> uninstallApp(
|
||||||
|
BuildContext context,
|
||||||
|
PatchedApplication app,
|
||||||
|
bool onlyUnpatch,
|
||||||
|
) async {
|
||||||
|
bool isUninstalled = true;
|
||||||
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);
|
await _rootAPI.deleteApp(app.packageName, app.apkFilePath);
|
||||||
_managerAPI.deletePatchedApp(app);
|
|
||||||
if (!onlyUnpatch) {
|
if (!onlyUnpatch) {
|
||||||
DeviceApps.uninstallApp(app.packageName);
|
await DeviceApps.uninstallApp(app.packageName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DeviceApps.uninstallApp(app.packageName).then(
|
isUninstalled = await DeviceApps.uninstallApp(app.packageName);
|
||||||
(value) => _managerAPI.deletePatchedApp(app),
|
}
|
||||||
);
|
if (isUninstalled) {
|
||||||
|
await _managerAPI.deletePatchedApp(app);
|
||||||
|
locator<HomeViewModel>().initialize(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,8 +93,7 @@ class AppInfoViewModel extends BaseViewModel {
|
|||||||
CustomMaterialButton(
|
CustomMaterialButton(
|
||||||
label: I18nText('yesButton'),
|
label: I18nText('yesButton'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
uninstallApp(app, onlyUnpatch);
|
uninstallApp(context, app, onlyUnpatch);
|
||||||
locator<HomeViewModel>().initialize(context);
|
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
@@ -97,8 +102,7 @@ class AppInfoViewModel extends BaseViewModel {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
uninstallApp(app, onlyUnpatch);
|
uninstallApp(context, app, onlyUnpatch);
|
||||||
locator<HomeViewModel>().initialize(context);
|
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ homepage: https://github.com/revanced/revanced-manager
|
|||||||
|
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.0.17+17
|
version: 0.0.18+18
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.5 <3.0.0"
|
sdk: ">=2.17.5 <3.0.0"
|
||||||
@@ -54,7 +54,10 @@ dependencies:
|
|||||||
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:
|
||||||
|
git:
|
||||||
|
url: https://github.com/gokul1630/root
|
||||||
|
ref: main
|
||||||
share_extend: ^2.0.0
|
share_extend: ^2.0.0
|
||||||
shared_preferences: ^2.0.15
|
shared_preferences: ^2.0.15
|
||||||
skeletons: ^0.0.3
|
skeletons: ^0.0.3
|
||||||
|
|||||||
Reference in New Issue
Block a user