Skip to content

Commit

Permalink
fix: patching fails when updating RVX in root environment inotia00/Re…
Browse files Browse the repository at this point in the history
  • Loading branch information
inotia00 committed Jul 30, 2024
1 parent cd25072 commit d7dd4fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/services/patcher_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ class PatcherAPI {
}

if (integrationsFile != null) {
if (_managerAPI.isRooted) {
await _rootAPI.unmount(packageName, apkFilePath);
}
_dataDir.createSync();
_tmpDir.createSync();
final Directory workDir = await _tmpDir.createTemp('tmp-');
Expand Down
9 changes: 9 additions & 0 deletions lib/services/root_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ class RootAPI {
);
}

Future<void> unmount(
String packageName,
String apkFilePath
) async {
await Root.exec(
cmd: 'am force-stop $packageName && umount -l $apkFilePath',
);
}

Future<void> removeOrphanedFiles() async {
await Root.exec(
cmd: 'find $_revancedDirPath -type f -name original.apk -delete',
Expand Down

0 comments on commit d7dd4fa

Please sign in to comment.