[core] Print version to logcat (#375)
* [core] Print version to logcat * [core] Check module id on init
This commit is contained in:
parent
441e82bde0
commit
39aa9952b5
|
|
@ -95,7 +95,8 @@ android {
|
||||||
cFlags("-std=c11 -ffixed-x18 -Qunused-arguments -fno-rtti -fno-exceptions -fomit-frame-pointer -fpie -fPIC")
|
cFlags("-std=c11 -ffixed-x18 -Qunused-arguments -fno-rtti -fno-exceptions -fomit-frame-pointer -fpie -fPIC")
|
||||||
arguments("-DRIRU_MODULE_API_VERSION=$moduleMaxRiruApiVersion",
|
arguments("-DRIRU_MODULE_API_VERSION=$moduleMaxRiruApiVersion",
|
||||||
"-DRIRU_MODULE_VERSION=$verCode",
|
"-DRIRU_MODULE_VERSION=$verCode",
|
||||||
"-DRIRU_MODULE_VERSION_NAME:STRING=\"$verName\"")
|
"-DRIRU_MODULE_VERSION_NAME:STRING=\"$verName\"",
|
||||||
|
"-DMODULE_NAME:STRING=riru_$riruModuleId")
|
||||||
targets("lspd")
|
targets("lspd")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ add_definitions(-DRIRU_MODULE)
|
||||||
add_definitions(-DRIRU_MODULE_API_VERSION=${RIRU_MODULE_API_VERSION})
|
add_definitions(-DRIRU_MODULE_API_VERSION=${RIRU_MODULE_API_VERSION})
|
||||||
add_definitions(-DRIRU_MODULE_VERSION=${RIRU_MODULE_VERSION})
|
add_definitions(-DRIRU_MODULE_VERSION=${RIRU_MODULE_VERSION})
|
||||||
add_definitions(-DRIRU_MODULE_VERSION_NAME=${RIRU_MODULE_VERSION_NAME})
|
add_definitions(-DRIRU_MODULE_VERSION_NAME=${RIRU_MODULE_VERSION_NAME})
|
||||||
|
add_definitions(-DMODULE_NAME=${MODULE_NAME})
|
||||||
|
|
||||||
add_subdirectory(main)
|
add_subdirectory(main)
|
||||||
add_subdirectory(external)
|
add_subdirectory(external)
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ namespace lspd {
|
||||||
|
|
||||||
void onModuleLoaded() {
|
void onModuleLoaded() {
|
||||||
LOGI("onModuleLoaded: welcome to LSPosed!");
|
LOGI("onModuleLoaded: welcome to LSPosed!");
|
||||||
|
LOGI("onModuleLoaded: version %s (%d)", RIRU_MODULE_VERSION_NAME, RIRU_MODULE_VERSION);
|
||||||
// rirud must be used in onModuleLoaded
|
// rirud must be used in onModuleLoaded
|
||||||
Context::GetInstance()->PreLoadDex(magiskPath + '/' + kDexPath);
|
Context::GetInstance()->PreLoadDex(magiskPath + '/' + kDexPath);
|
||||||
InitSymbolCache();
|
InitSymbolCache();
|
||||||
|
|
@ -112,9 +113,13 @@ namespace lspd {
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((noinline)) RIRU_EXPORT RiruVersionedModuleInfo *init(Riru *riru) {
|
__attribute__((noinline)) RIRU_EXPORT RiruVersionedModuleInfo *init(Riru *riru) {
|
||||||
LOGD("Using riru %d", riru->riruApiVersion);
|
LOGD("using riru %d", riru->riruApiVersion);
|
||||||
LOGD("module path: %s", riru->magiskModulePath);
|
LOGD("module path: %s", riru->magiskModulePath);
|
||||||
lspd::magiskPath = riru->magiskModulePath;
|
lspd::magiskPath = riru->magiskModulePath;
|
||||||
|
if (lspd::magiskPath.find(STRINGIFY(MODULE_NAME)) == std::string::npos) {
|
||||||
|
LOGE("who am i");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
lspd::allowUnload = riru->allowUnload;
|
lspd::allowUnload = riru->allowUnload;
|
||||||
return &lspd::module;
|
return &lspd::module;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,13 @@
|
||||||
package org.lsposed.lspd.service;
|
package org.lsposed.lspd.service;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import org.lsposed.lspd.BuildConfig;
|
||||||
|
|
||||||
public class ServiceManager {
|
public class ServiceManager {
|
||||||
private static LSPosedService mainService = null;
|
private static LSPosedService mainService = null;
|
||||||
private static LSPModuleService moduleService = null;
|
private static LSPModuleService moduleService = null;
|
||||||
|
|
@ -49,6 +52,7 @@ public class ServiceManager {
|
||||||
// call by ourselves
|
// call by ourselves
|
||||||
public static void start() {
|
public static void start() {
|
||||||
Log.i(TAG, "starting server...");
|
Log.i(TAG, "starting server...");
|
||||||
|
Log.i(TAG, String.format("version %s (%s)", BuildConfig.VERSION_NAME, BuildConfig.VERSION_NAME));
|
||||||
|
|
||||||
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
|
Thread.setDefaultUncaughtExceptionHandler((t, e) -> {
|
||||||
Log.e(TAG, Log.getStackTraceString(e));
|
Log.e(TAG, Log.getStackTraceString(e));
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,9 @@ abortC() {
|
||||||
POUNDS="*********************************************************"
|
POUNDS="*********************************************************"
|
||||||
|
|
||||||
VERSION=$(grep_prop version "${TMPDIR}/module.prop")
|
VERSION=$(grep_prop version "${TMPDIR}/module.prop")
|
||||||
|
VERSION_CODE=$(grep_prop versionCode "${TMPDIR}/module.prop")
|
||||||
|
|
||||||
ui_print "- LSPosed version ${VERSION}"
|
ui_print "- LSPosed version ${VERSION} (${VERSION_CODE})"
|
||||||
|
|
||||||
# Extract verify.sh
|
# Extract verify.sh
|
||||||
ui_print "- Extracting verify.sh"
|
ui_print "- Extracting verify.sh"
|
||||||
|
|
@ -137,4 +138,4 @@ if [ ! -e /data/adb/lspd/config/verbose_log ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_perm_recursive "${MODPATH}" 0 0 0755 0644
|
set_perm_recursive "${MODPATH}" 0 0 0755 0644
|
||||||
ui_print "- Welcome to LSPosed ${VERSION}!"
|
ui_print "- Welcome to LSPosed!"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue