CommonInstaller: change logic when to reset runtime-permission ; simplify

merge-requests/33/head
Christopher Roy Bratusek 4 years ago
parent 966de91df5
commit a3d91961bd

@ -507,6 +507,21 @@ unpack_zip () {
chmod 0755 ${INSTALLER}/*.*
}
reset_runtime_permissions () {
# required on Android 10, else all apps bundled with NanoDroid will not
# show a permission prompt for android.permission.WRITE_EXTERNAL_STORAGE
if [ "${SDK_VERSION}" -ge 29 -a "${NANODROID_UPGRADE}" -eq 0 ]; then
find /data/system/users -type f -name 'runtime-permissions.xml' 2>/dev/null | while read file; do
rm -f "${file}"
decho " ++ resetting permissions: ${file}"
done
if [ "${MODE}" = "SYSTEM" ]; then
touch /data/adb/.nanodroid_runtimeclean
fi
fi
}
nanodroid_finalize () {
case ${MODID} in
NanoDroid | NanoDroid_microG )
@ -519,17 +534,6 @@ nanodroid_finalize () {
;;
esac
# required on Android 10, else all apps bundled with NanoDroid will not
# show a permission prompt for android.permission.WRITE_EXTERNAL_STORAGE
if [ "${SDK_VERSION}" -ge 29 -a ! -f /data/adb/.nanodroid_runtimeclean ]; then
find /data/system/users -type f -name 'runtime-permissions.xml' 2>/dev/null | while read file; do
rm -f "${file}"
decho " ++ resetting permissions: ${file}"
done
touch /data/adb/.nanodroid_runtimeclean
fi
if [ "${MODE}" = "MAGISK" ]; then
magisk_install_finish
else

Loading…
Cancel
Save