Skip to content

Commit

Permalink
Keep data uninstallation
Browse files Browse the repository at this point in the history
  • Loading branch information
MlgmXyysd committed Dec 29, 2020
1 parent 454de34 commit a1782ba
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
11 changes: 6 additions & 5 deletions edxp-core/template_override/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ RIRU_MODULES="${RIRU_PATH}/modules"
RIRU_TARGET="${RIRU_MODULES}/${RIRU_EDXP}"

IS_MAGISK_LITE=false
MODULES_PATH="modules"
[[ "${MAGISK_VER:0-5}" == "-lite" ]] && IS_MAGISK_LITE=true
[[ "${IS_MAGISK_LITE}" == "true" ]] && MODULES_PATH="lite_modules"


VERSION=$(grep_prop version "${TMPDIR}/module.prop")
RIRU_MIN_API_VERSION=$(grep_prop api "${TMPDIR}/module.prop")
Expand All @@ -59,10 +62,6 @@ LANG_CUST_INST_CONF_CREATE="Creating configuration directories"
LANG_CUST_INST_CONF_OLD="Use previous path"
LANG_CUST_INST_CONF_NEW="Use new path"
LANG_CUST_INST_COPY_LIB="Copying framework libraries"
LANG_CUST_INST_RAND_LIB_1="Resetting libraries path"
LANG_CUST_INST_RAND_LIB_2="It may take a long time, please be patient"
LANG_CUST_INST_RAND_LIB_3="Processing 32 bit libraries"
LANG_CUST_INST_RAND_LIB_4="Processing 64 bit libraries"
LANG_CUST_INST_REM_OLDCONF="Removing old configuration"
LANG_CUST_INST_COPT_EXTRA="Copying extra files"
LANG_CUST_INST_DONE="Welcome to"
Expand Down Expand Up @@ -212,7 +211,7 @@ touch /data/adb/edxp/new_install || abortC "! ${LANG_CUST_ERR_CONF_FIRST}"
set_perm_recursive /data/adb/edxp root root 0700 0600 "u:object_r:magisk_file:s0" || abortC "! ${LANG_CUST_ERR_PERM}"
mkdir -p /data/misc/$MISC_PATH || abortC "! ${LANG_CUST_ERR_CONF_CREATE}"
set_perm /data/misc/$MISC_PATH root root 0771 "u:object_r:magisk_file:s0" || abortC "! ${LANG_CUST_ERR_PERM}"
echo "rm -rf /data/misc/$MISC_PATH" >> "${MODPATH}/uninstall.sh" || abortC "! ${LANG_CUST_ERR_CONF_UNINST}"
echo "[[ -f /data/adb/edxp/keep_data ]] || rm -rf /data/misc/$MISC_PATH" >> "${MODPATH}/uninstall.sh" || abortC "! ${LANG_CUST_ERR_CONF_UNINST}"
echo "[[ -f /data/adb/edxp/new_install ]] || rm -rf /data/adb/edxp" >> "${MODPATH}/uninstall.sh" || abortC "! ${LANG_CUST_ERR_CONF_UNINST}"

ui_print "- ${LANG_CUST_INST_COPY_LIB}"
Expand Down Expand Up @@ -263,6 +262,8 @@ cp "${MODPATH}/module.prop" "${RIRU_TARGET}/module.prop" || abortC "! ${LANG_CUS

set_perm "$RIRU_TARGET/module.prop" 0 0 0600 $RIRU_SECONTEXT || abortC "! ${LANG_CUST_ERR_PERM}"

rm -f /data/adb/edxp/keep_data

set_perm_recursive "${MODPATH}" 0 0 0755 0644
ui_print "- ${LANG_CUST_INST_DONE} EdXposed ${VERSION}!"

1 change: 1 addition & 0 deletions edxp-core/template_override/post-fs-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,4 @@ if [[ ! -z "${MISC_PATH}" ]]; then
chmod 777 "${BASE_PATH}/cache"
fi
rm -f /data/adb/edxp/new_install
rm -f /data/adb/edxp/keep_data
11 changes: 4 additions & 7 deletions edxp-core/template_override/util_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ require_yahfa() {
}

duplicate_installation() {
touch /data/adb/edxp/keep_data
ui_print "${POUNDS}"
ui_print "! ${LANG_UTIL_ERR_DUPINST_1}"
ui_print "! ${LANG_UTIL_ERR_DUPINST_2} ${1} ${LANG_UTIL_ERR_DUPINST_3}"
ui_print "! ${LANG_UTIL_ERR_DUPINST_2} EdXposed (${1}) ${LANG_UTIL_ERR_DUPINST_3}"
abortC "${POUNDS}"
}

Expand All @@ -60,14 +61,10 @@ require_new_android() {
edxp_check_architecture() {
if [[ "${MODID}" == "riru_edxposed_sandhook" ]]; then
VARIANT="SandHook"
if [[ "${IS_MAGISK_LITE}" == "false" && -d "${MODPATH}/../../modules/riru_edxposed" || -d "${MODPATH}/../../modules_update/riru_edxposed" ]] || [[ "${IS_MAGISK_LITE}" == "true" && -d "${MODPATH}/../../lite_modules/riru_edxposed" || -d "${MODPATH}/../../lite_modules_update/riru_edxposed" ]]; then
duplicate_installation "EdXposed (YAHFA)"
fi
[[ -d "${MODPATH}/../../${MODULES_PATH}/riru_edxposed" ]] && duplicate_installation "YAHFA"
else
VARIANT="YAHFA"
if [[ "${IS_MAGISK_LITE}" == "false" && -d "${MODPATH}/../../modules/riru_edxposed_sandhook" || -d "${MODPATH}/../../modules_update/riru_edxposed_sandhook" ]] || [[ "${IS_MAGISK_LITE}" == "true" && -d "${MODPATH}/../../lite_modules/riru_edxposed_sandhook" || -d "${MODPATH}/../../lite_modules_update/riru_edxposed_sandhook" ]]; then
duplicate_installation "EdXposed (SandHook)"
fi
[[ -d "${MODPATH}/../../${MODULES_PATH}/riru_edxposed_sandhook" ]] && duplicate_installation "SandHook"
fi
if [[ "${ARCH}" != "arm" && "${ARCH}" != "arm64" && "${ARCH}" != "x86" && "${ARCH}" != "x64" ]]; then
abortC "! ${LANG_UTIL_ERR_PLATFORM_UNSUPPORT}: ${ARCH}"
Expand Down
4 changes: 0 additions & 4 deletions edxp-core/template_override/zh_CN.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ LANG_CUST_INST_CONF_CREATE="正在创建配置目录"
LANG_CUST_INST_CONF_OLD="使用旧目录"
LANG_CUST_INST_CONF_NEW="使用新目录"
LANG_CUST_INST_COPY_LIB="正在复制框架运行库"
LANG_CUST_INST_RAND_LIB_1="正在重设运行库路径"
LANG_CUST_INST_RAND_LIB_2="可能会耗费一些时间,请耐心等待"
LANG_CUST_INST_RAND_LIB_3="正在处理 32 位运行库"
LANG_CUST_INST_RAND_LIB_4="正在处理 64 位运行库"
LANG_CUST_INST_REM_OLDCONF="正在移除老旧配置"
LANG_CUST_INST_COPT_EXTRA="正在复制文件"
LANG_CUST_INST_DONE="欢迎使用"
Expand Down

0 comments on commit a1782ba

Please sign in to comment.