fix(root-install): create service and postfs directories if they dont exist (#1116)

Fixes #860
This commit is contained in:
Ushie 2023-08-09 23:57:09 +03:00
parent acec064cb7
commit 9a66b6e50d
No known key found for this signature in database
GPG key ID: B3AAD18842E34632

View file

@ -153,6 +153,9 @@ class RootAPI {
}
Future<void> installServiceDScript(String packageName) async {
await Root.exec(
cmd: 'mkdir -p "$_serviceDDirPath"',
);
final String content = '#!/system/bin/sh\n'
'while [ "\$(getprop sys.boot_completed | tr -d \'"\'"\'\\\\r\'"\'"\')" != "1" ]; do sleep 3; done\n'
'base_path=$_revancedDirPath/$packageName/base.apk\n'
@ -166,6 +169,9 @@ class RootAPI {
}
Future<void> installPostFsDataScript(String packageName) async {
await Root.exec(
cmd: 'mkdir -p "$_postFsDataDirPath"',
);
final String content = '#!/system/bin/sh\n'
'stock_path=\$(pm path $packageName | grep base | sed \'"\'"\'s/package://g\'"\'"\')\n'
r'[ ! -z $stock_path ] && umount -l $stock_path';