SysTest: add check whether ROM supports Bromite WebView installation

merge-requests/23/head
Christopher Roy Bratusek 5 years ago
parent 6430fe745e
commit abee5000c4

@ -36,6 +36,7 @@
* SysTest
* append date in +%Y%m%d-%H.%M.%S format to log file name
* example: 20190505-09.35.00, 20190505-21.35.00
* add check whether ROM supports Bromite WebView installation
* init.d Scripts
* move init.d scripts logs from `${MODDIR}/.logs` to `${MODDIR}/logs`

@ -103,24 +103,50 @@ error () {
}
##########################################################################################
# check if ROM has native fake signature spoofing support
# by @ale5000
##########################################################################################
search_fake_package_signature () {
check_fake_package_signature () {
PERMISSION=android.permission.FAKE_PACKAGE_SIGNATURE
PERMISSION_OD=$(echo -n "${PERMISSION}" | od -A n -t x1 | tr -d '\n' | sed -e 's/^ //g;s/ /00/g')
HAS_FAKESIGN=false
FW_RES_DIR="${TMPDIR}/framework-res"
mkdir -p "${FW_RES_DIR}"
unzip -oq /system/framework/framework-res.apk -d "${FW_RES_DIR}"
FW_RES_FILE="${FW_RES_DIR}/AndroidManifest.xml"
grep -qF "${PERMISSION}" "${FW_RES_DIR}/AndroidManifest.xml" && HAS_FAKESIGN=true
od -A n -t x1 "${FW_RES_DIR}/AndroidManifest.xml" | tr -d ' \n' | grep -qF "${PERMISSION_OD}" && HAS_FAKESIGN=true
if [ ! -f ${FW_RES_FILE} ]; then
mkdir -p "${FW_RES_DIR}"
unzip -oq /system/framework/framework-res.apk -d "${FW_RES_DIR}"
fi
grep -qF "${PERMISSION}" "${FW_RES_FILE}" && HAS_FAKESIGN=true
od -A n -t x1 "${FW_RES_FILE}" | tr -d ' \n' | grep -qF "${PERMISSION_OD}" && HAS_FAKESIGN=true
${HAS_FAKESIGN} && return 0 || return 1
}
##########################################################################################
# check if Bromite System WebView is supported
##########################################################################################
check_bromite_webview_support () {
WEBVIEW_PKG="com.android.webview"
HAS_WEBVIEW=false
FW_RES_DIR="${TMPDIR}/framework-res"
FW_RES_FILE="${FW_RES_DIR}/res/xml/config_webview_packages.xml"
if [ ! -f ${FW_RES_FILE} ]; then
mkdir -p "${FW_RES_DIR}"
unzip -oq /system/framework/framework-res.apk -d "${FW_RES_DIR}"
fi
grep -qF "${WEBVIEW_PKG}" "${FW_RES_FILE}" && HAS_WEBVIEW=true
${HAS_WEBVIEW} && return 0 || return 1
}
##########################################################################################
# Device Functions
##########################################################################################
@ -283,7 +309,13 @@ store_results () {
add_log "Native SigSpoof?"
add_log "================"
add_log ""
search_fake_package_signature && add_log "NATIVE_SIGSPOOF=TRUE" || add_log "NATIVE_SIGSPOOF=FALSE"
check_fake_package_signature && add_log "NATIVE_SIGSPOOF=TRUE" || add_log "NATIVE_SIGSPOOF=FALSE"
add_log ""
add_log "Bromite WebView supported?"
add_log "=========================="
add_log ""
check_bromite_webview_support && add_log "WEBVIEW_SUPPORT=TRUE" || add_log "WEBVIEW_SUPPORT=FALSE"
add_log ""
add_log "Magisk installed?"

Loading…
Cancel
Save