Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADB Shell - runtime-perms.txt - no such file or dir #3

Open
everonline opened this issue Dec 13, 2020 · 3 comments
Open

ADB Shell - runtime-perms.txt - no such file or dir #3

everonline opened this issue Dec 13, 2020 · 3 comments

Comments

@everonline
Copy link

everonline commented Dec 13, 2020

Hi VR-25,

First great tool you have here.

Now I copy the script and did my backup through adb shell (migrator.sh -b app), no errors, I check the tar file, apparently all good.

Went to another phone and still with adb shell (migrator.sh -rad app) and this happens:

Restoring
com.myapp.ex
App
avc: denied { read } for scontext=u:r:system_server:s0 tcontext=u:object_r:system_data_root_file:s0 tclass=file permissive=1
Data
cat: can't open 'com.myapp.ex/runtime-perms.txt': No such file or directory
Reboot & run "migrator.sh -s" to enable apps with Settings.Secure.ANDROID_ID (SSAID)

So the app is restored but the data fails with the runtime perms because when this is executed:

$bkp_runtime_perms && {
sed -n "/$pkg/,/<//p" /data/system/users/0/runtime-permissions.xml
| grep 'granted="true"'
| grep -o 'android.permission.*[A-Z]' > $bkp_dir/$pkg/runtime-perms.txt
}

There is no runtime-permissions.xml (android 11 in a pixel 4) so when you restore:

    for perm in $(cat $pkg/runtime-perms.txt); do
      pm grant $pkg $perm 2>/dev/null
    done
  done < $tmp

The error message is consistent but it affects the restore of the data, by that I mean:

1 - In one of the apps I restored the app opens but no preferences (user data) is restored, is by default - App with no SSAID
2 - On another one (email app) the app dont even open (is killed immediately after being enabled with -s) - APP with SSAID

Hope the above helps.

@Y-T-G
Copy link

Y-T-G commented Dec 16, 2020

Same issue for me too in Android 11.

@elchavo87
Copy link

I've experienced the same issue

@VR-25
Copy link
Owner

VR-25 commented Jul 16, 2021

If the new release still has this issue, try after pasting and running the following as root:
cp /data/adb/modules/migrator/migrator.sh /dev/ && sed '\|runtime-perms.txt)|s|)| 2>/dev/null)|' /dev/migrator.sh > /data/adb/modules/migrator/migrator.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants