mirror of
https://gitlab.com/Nanolx/NanoDroid
synced 2024-10-31 09:20:23 +00:00
BromiteWebView: support installation in /system/product
This commit is contained in:
parent
8a83f5f18b
commit
0e0f0db17e
@ -1184,6 +1184,7 @@ install_bromite_webview () {
|
||||
esac
|
||||
|
||||
WEBVIEW_REPLACE=BromiteWebView
|
||||
WEBVIEW_DIR=""
|
||||
BACKUP_PATH="${STORAGE}/nanodroid_backups/$(grep_prop ro.build.flavor)_$(grep_prop ro.build.id)"
|
||||
|
||||
for app in webview webviewstub WebViewStub Webview; do
|
||||
@ -1198,6 +1199,19 @@ install_bromite_webview () {
|
||||
WEBVIEW_REPLACE=${app}
|
||||
break
|
||||
fi
|
||||
|
||||
if [ -d /system/product/app/${app} ]; then
|
||||
if [ "${MODE}" = "SYSTEM" ]; then
|
||||
echo " backing up ${app} to ${BACKUP_PATH}/product/app/${app}"
|
||||
mkdir -p "${BACKUP_PATH}/product/app"
|
||||
rm -rf "${BACKUP_PATH}/product/app/${app}"
|
||||
mv /system/product/app/${app} "${BACKUP_PATH}/product/app/"
|
||||
fi
|
||||
|
||||
WEBVIEW_REPLACE=${app}
|
||||
WEBVIEW_DIR="product/app"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${NANODROID_UPGRADE}" -eq 0 ]; then
|
||||
@ -1211,7 +1225,7 @@ install_bromite_webview () {
|
||||
done
|
||||
fi
|
||||
|
||||
nanodroid_install_apk BromiteWebView_${BROMITE_ARCH} multilib ${WEBVIEW_REPLACE}
|
||||
nanodroid_install_apk BromiteWebView_${BROMITE_ARCH} multilib ${WEBVIEW_REPLACE} ${WEBVIEW_DIR}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@ -1309,6 +1323,8 @@ nanodroid_install_apk () {
|
||||
fi
|
||||
done
|
||||
|
||||
[ -n "${4}" ] && dir="system/${4}"
|
||||
|
||||
[ -z "${source}" ] && error "app ${app} not found"
|
||||
|
||||
if [ "${UNFOLD_APP_DIR}" -eq 1 ]; then
|
||||
|
@ -37,8 +37,13 @@ install_bromitewebview () {
|
||||
until [ $(getprop sys.boot_completed). = 1. ]; do sleep 1; done
|
||||
|
||||
# Bromite WebView needs to be installed as user app to prevent crashes
|
||||
pm list packages -f | grep -q /data.*com.android.webview || \
|
||||
pm install -r "${MODDIR}"/system/app/*/*.apk &
|
||||
if [ -d "${MODDIR}/system/product/app" ]; then
|
||||
pm list packages -f | grep -q /data.*com.android.webview || \
|
||||
pm install -r "${MODDIR}"/system/product/app/*/*.apk &
|
||||
else
|
||||
pm list packages -f | grep -q /data.*com.android.webview || \
|
||||
pm install -r "${MODDIR}"/system/app/*/*.apk &
|
||||
fi
|
||||
}
|
||||
|
||||
case ${MODULE} in
|
||||
|
Loading…
Reference in New Issue
Block a user