I'm trying to migrate application data between devices. The application was installed to the work profile using Shelter The steps I did were:
- On source phone,
tar cvf appdata.tar.gz /data/user/10/com.appname
- Copy the tarball from the source phone to the target phone
- On the target phone, install the applications to the work profile. Note the username of the
/data/user/10/com.appname
on the target phone, which is of the formu10_aXXX
- On the target phone,
chown -R u10_aXXX:u10_aXXX /data/user/10/com.appname
When I'm trying to use the app, it receives a lot of SELinux AVC denials and ends up crashing because it's unable to open /data/user/10/com.appname/databases/database.db
:
10-18 16:23:28.485 4120 4120 W SharedPreferenc: type=1400 audit(0.0:889): avc: denied { search } for name="shared_prefs" dev="dm-0" ino=860652 scontext=u:r:untrusted_app:s0:c522,c768 tcontext=u:object_r:app_data_file:s0 tclass=dir permissive=0
What am I missing? Application works after setting SELinux to permissive.
restorecon -R /data/user/10/com.appname
.