[core] Debug so should place under /system (#460)

Otherwise, unwind will fail
This commit is contained in:
LoveSy 2021-04-06 00:29:40 +08:00 committed by GitHub
parent fac2399b84
commit 69a3e04ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 5 deletions

View File

@ -279,6 +279,10 @@ afterEvaluate {
"%%%RIRU_MODULE_MIN_RIRU_VERSION_NAME%%%",
moduleMinRiruVersionName
)
.replace(
"%%RIRU_MODULE_DEBUG%%",
if (variantLowered == "debug") "true" else "false"
)
}
filter(
mapOf("eol" to FixCrLfFilter.CrLf.newInstance("lf")),

View File

@ -37,8 +37,11 @@ namespace lspd {
void onModuleLoaded() {
LOGI("onModuleLoaded: welcome to LSPosed!");
LOGI("onModuleLoaded: version %s (%d)", versionName, versionCode);
// rirud must be used in onModuleLoaded
Context::GetInstance()->PreLoadDex(magiskPath + '/' + kDexPath);
if constexpr (isDebug) {
Context::GetInstance()->PreLoadDex("/system/" + kDexPath);
} else {
Context::GetInstance()->PreLoadDex(magiskPath + '/' + kDexPath);
}
InitSymbolCache();
}
@ -116,7 +119,7 @@ RIRU_EXPORT RiruVersionedModuleInfo *init(Riru *riru) {
LOGD("using riru %d", riru->riruApiVersion);
LOGD("module path: %s", riru->magiskModulePath);
lspd::magiskPath = riru->magiskModulePath;
if (lspd::magiskPath.find(MODULE_NAME) == std::string::npos) {
if (!lspd::isDebug && lspd::magiskPath.find(MODULE_NAME) == std::string::npos) {
LOGE("who am i");
return nullptr;
}

View File

@ -91,7 +91,7 @@ namespace lspd {
#ifdef __LP64__
inline static size_t solist_next_offset = 0x30;
constexpr static size_t solist_realpath_offset = 0x1a8;
constexpr static size_t solist_realpath_offset = 0x1a8;
#else
inline static size_t solist_next_offset = 0xa4;
constexpr static size_t solist_realpath_offset = 0x174;

View File

@ -137,5 +137,13 @@ if [ ! -e /data/adb/lspd/config/verbose_log ]; then
echo "0" >/data/adb/lspd/config/verbose_log
fi
if [ "$RIRU_MODULE_DEBUG" = true ]; then
mv ${MODPATH}/riru ${MODPATH}/system
mv ${MODPATH}/system/lib/liblspd.so ${MODPATH}/system/lib/libriru_lspd.so
mv ${MODPATH}/system/lib64/liblspd.so ${MODPATH}/system/lib64/libriru_lspd.so
cp -r ${MODPATH}/framework ${MODPATH}/system/framework
mkdir -p /data/adb/riru/modules/lspd
fi
set_perm_recursive "${MODPATH}" 0 0 0755 0644
ui_print "- Welcome to LSPosed!"

View File

@ -11,6 +11,7 @@ RIRU_VERSION_NAME=""
RIRU_MODULE_API_VERSION=%%%RIRU_MODULE_API_VERSION%%%
RIRU_MODULE_MIN_API_VERSION=%%%RIRU_MODULE_MIN_API_VERSION%%%
RIRU_MODULE_MIN_RIRU_VERSION_NAME="%%%RIRU_MODULE_MIN_RIRU_VERSION_NAME%%%"
RIRU_MODULE_DEBUG=%%RIRU_MODULE_DEBUG%%
if [ "$MAGISK_VER_CODE" -ge 21000 ]; then
MAGISK_CURRENT_RIRU_MODULE_PATH=$(magisk --path)/.magisk/modules/riru-core
@ -61,4 +62,4 @@ else
else
ui_print "- Can't find /data/adb/riru/util_functions.sh"
fi
fi
fi