fix: Do not delete files from post-fs-data.d

This commit is contained in:
aAbed 2024-01-25 23:09:43 +05:45
parent c7d975e612
commit 70a1086edf
No known key found for this signature in database
GPG Key ID: F26611AB3F996827

View File

@ -2,9 +2,6 @@ import 'package:flutter/foundation.dart';
import 'package:root/root.dart';
class RootAPI {
// TODO(aAbed): remove in the future, keep it for now during migration.
final String _postFsDataDirPath = '/data/adb/post-fs-data.d';
final String _revancedDirPath = '/data/adb/revanced';
final String _serviceDDirPath = '/data/adb/service.d';
@ -99,18 +96,9 @@ class RootAPI {
);
}
// TODO(aAbed): remove in the future, keep it for now during migration.
Future<void> removeOrphanedFiles() async {
await Root.exec(
cmd: '''
find $_revancedDirPath -type f -name original.apk -delete
for file in "$_serviceDDirPath"/*; do
filename=\$(basename "\$file")
if [ -f "$_postFsDataDirPath/\$filename" ]; then
rm "$_postFsDataDirPath/\$filename"
fi
done
''',
cmd: 'find $_revancedDirPath -type f -name original.apk -delete',
);
}