From a610a358659991f0a8e21e50b7ec84de36ef9230 Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Mon, 25 Nov 2024 09:40:32 +0100 Subject: [PATCH 1/3] Be silent when injecting into process In the release version, we remove some logs (except error level) added into the injected process. This helps to leave fewer unnecessary logs which are impossible for modules to hide. This function can be toggled using the static field `beSilent`. Developers are encouraged to use the debug version of LSPosed to develop modules. --- .../android/xposed/XSharedPreferences.java | 2 +- .../de/robv/android/xposed/XposedInit.java | 2 +- .../lsposed/lspd/hooker/CrashDumpHooker.java | 3 +- .../lspd/hooker/LoadedApkCtorHooker.java | 2 +- .../org/lsposed/lspd/impl/LSPosedBridge.java | 3 +- .../org/lsposed/lspd/impl/LSPosedContext.java | 2 +- .../lspd/util/LspModuleClassLoader.java | 3 +- magisk-loader/proguard-rules.pro | 2 +- .../main/java/org/lsposed/lspd/core/Main.java | 3 +- .../lsposed/lspd/service/BridgeService.java | 2 +- .../util/ParasiticManagerSystemHooker.java | 7 ++- .../src/main/jni/src/magisk_loader.cpp | 12 ++-- .../java/org/lsposed/lspd/util/Utils.java | 56 ++++++++++++++++++- 13 files changed, 79 insertions(+), 20 deletions(-) diff --git a/core/src/main/java/de/robv/android/xposed/XSharedPreferences.java b/core/src/main/java/de/robv/android/xposed/XSharedPreferences.java index c88b63894ac..3f645932c70 100644 --- a/core/src/main/java/de/robv/android/xposed/XSharedPreferences.java +++ b/core/src/main/java/de/robv/android/xposed/XSharedPreferences.java @@ -27,12 +27,12 @@ import android.content.SharedPreferences; import android.os.Environment; import android.preference.PreferenceManager; -import android.util.Log; import com.android.internal.util.XmlUtils; import org.lsposed.lspd.core.BuildConfig; import org.lsposed.lspd.util.MetaDataReader; +import org.lsposed.lspd.util.Utils.Log; import org.xmlpull.v1.XmlPullParserException; import java.io.File; diff --git a/core/src/main/java/de/robv/android/xposed/XposedInit.java b/core/src/main/java/de/robv/android/xposed/XposedInit.java index 6cd49140e91..97436936c55 100644 --- a/core/src/main/java/de/robv/android/xposed/XposedInit.java +++ b/core/src/main/java/de/robv/android/xposed/XposedInit.java @@ -39,13 +39,13 @@ import android.os.IBinder; import android.os.Process; import android.util.ArrayMap; -import android.util.Log; import org.lsposed.lspd.impl.LSPosedContext; import org.lsposed.lspd.models.PreLoadedApk; import org.lsposed.lspd.nativebridge.NativeAPI; import org.lsposed.lspd.nativebridge.ResourcesHook; import org.lsposed.lspd.util.LspModuleClassLoader; +import org.lsposed.lspd.util.Utils.Log; import java.io.File; import java.lang.ref.WeakReference; diff --git a/core/src/main/java/org/lsposed/lspd/hooker/CrashDumpHooker.java b/core/src/main/java/org/lsposed/lspd/hooker/CrashDumpHooker.java index bb01539fa7b..ea94b132caa 100644 --- a/core/src/main/java/org/lsposed/lspd/hooker/CrashDumpHooker.java +++ b/core/src/main/java/org/lsposed/lspd/hooker/CrashDumpHooker.java @@ -1,8 +1,7 @@ package org.lsposed.lspd.hooker; -import android.util.Log; - import org.lsposed.lspd.impl.LSPosedBridge; +import org.lsposed.lspd.util.Utils.Log; import io.github.libxposed.api.XposedInterface; import io.github.libxposed.api.annotations.BeforeInvocation; diff --git a/core/src/main/java/org/lsposed/lspd/hooker/LoadedApkCtorHooker.java b/core/src/main/java/org/lsposed/lspd/hooker/LoadedApkCtorHooker.java index 2ddbff32a87..e84e3d1d659 100644 --- a/core/src/main/java/org/lsposed/lspd/hooker/LoadedApkCtorHooker.java +++ b/core/src/main/java/org/lsposed/lspd/hooker/LoadedApkCtorHooker.java @@ -22,9 +22,9 @@ import android.app.LoadedApk; import android.content.res.XResources; -import android.util.Log; import org.lsposed.lspd.util.Hookers; +import org.lsposed.lspd.util.Utils.Log; import de.robv.android.xposed.XposedHelpers; import de.robv.android.xposed.XposedInit; diff --git a/core/src/main/java/org/lsposed/lspd/impl/LSPosedBridge.java b/core/src/main/java/org/lsposed/lspd/impl/LSPosedBridge.java index b47d274d749..27c7ce8cea2 100644 --- a/core/src/main/java/org/lsposed/lspd/impl/LSPosedBridge.java +++ b/core/src/main/java/org/lsposed/lspd/impl/LSPosedBridge.java @@ -1,10 +1,9 @@ package org.lsposed.lspd.impl; -import android.util.Log; - import androidx.annotation.NonNull; import org.lsposed.lspd.nativebridge.HookBridge; +import org.lsposed.lspd.util.Utils.Log; import java.lang.reflect.Executable; import java.lang.reflect.InvocationTargetException; diff --git a/core/src/main/java/org/lsposed/lspd/impl/LSPosedContext.java b/core/src/main/java/org/lsposed/lspd/impl/LSPosedContext.java index fdf8d5619c8..9c6b196342b 100644 --- a/core/src/main/java/org/lsposed/lspd/impl/LSPosedContext.java +++ b/core/src/main/java/org/lsposed/lspd/impl/LSPosedContext.java @@ -8,7 +8,6 @@ import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; -import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -20,6 +19,7 @@ import org.lsposed.lspd.nativebridge.NativeAPI; import org.lsposed.lspd.service.ILSPInjectedModuleService; import org.lsposed.lspd.util.LspModuleClassLoader; +import org.lsposed.lspd.util.Utils.Log; import java.io.File; import java.io.FileNotFoundException; diff --git a/core/src/main/java/org/lsposed/lspd/util/LspModuleClassLoader.java b/core/src/main/java/org/lsposed/lspd/util/LspModuleClassLoader.java index 49def72b85c..56f60b7e623 100644 --- a/core/src/main/java/org/lsposed/lspd/util/LspModuleClassLoader.java +++ b/core/src/main/java/org/lsposed/lspd/util/LspModuleClassLoader.java @@ -7,7 +7,6 @@ import android.system.ErrnoException; import android.system.Os; import android.system.OsConstants; -import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; @@ -25,6 +24,8 @@ import java.util.jar.JarFile; import java.util.zip.ZipEntry; +import org.lsposed.lspd.util.Utils.Log; + import hidden.ByteBufferDexClassLoader; import sun.misc.CompoundEnumeration; diff --git a/magisk-loader/proguard-rules.pro b/magisk-loader/proguard-rules.pro index 36e55739fa5..b8358f5f073 100644 --- a/magisk-loader/proguard-rules.pro +++ b/magisk-loader/proguard-rules.pro @@ -1,5 +1,5 @@ -keepclasseswithmembers class org.lsposed.lspd.core.Main { - public static void forkCommon(boolean, java.lang.String, java.lang.String, android.os.IBinder); + public static void forkCommon(boolean, boolean, java.lang.String, java.lang.String, android.os.IBinder); } -keepclasseswithmembers,includedescriptorclasses class * { native ; diff --git a/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java b/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java index 0da9f9dc0c7..ff8a57272cc 100644 --- a/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java +++ b/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java @@ -30,10 +30,11 @@ public class Main { - public static void forkCommon(boolean isSystem, String niceName, String appDir, IBinder binder) { + public static void forkCommon(boolean isSystem, boolean isDebug, String niceName, String appDir, IBinder binder) { if (isSystem) { ParasiticManagerSystemHooker.start(); } + Utils.beSilent = !isDebug; Startup.initXposed(isSystem, niceName, appDir, ILSPApplicationService.Stub.asInterface(binder)); if (niceName.equals(BuildConfig.DEFAULT_MANAGER_PACKAGE_NAME) && ParasiticManagerHooker.start()) { Utils.logI("Loaded manager, skipping next steps"); diff --git a/magisk-loader/src/main/java/org/lsposed/lspd/service/BridgeService.java b/magisk-loader/src/main/java/org/lsposed/lspd/service/BridgeService.java index 9391d886534..873196a5360 100644 --- a/magisk-loader/src/main/java/org/lsposed/lspd/service/BridgeService.java +++ b/magisk-loader/src/main/java/org/lsposed/lspd/service/BridgeService.java @@ -29,12 +29,12 @@ import android.os.IBinder; import android.os.Parcel; import android.os.RemoteException; -import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import org.lsposed.lspd.BuildConfig; +import org.lsposed.lspd.util.Utils.Log; public class BridgeService { private static final int TRANSACTION_CODE = ('_' << 24) | ('L' << 16) | ('S' << 8) | 'P'; diff --git a/magisk-loader/src/main/java/org/lsposed/lspd/util/ParasiticManagerSystemHooker.java b/magisk-loader/src/main/java/org/lsposed/lspd/util/ParasiticManagerSystemHooker.java index 1b2df4ae321..578627a8599 100644 --- a/magisk-loader/src/main/java/org/lsposed/lspd/util/ParasiticManagerSystemHooker.java +++ b/magisk-loader/src/main/java/org/lsposed/lspd/util/ParasiticManagerSystemHooker.java @@ -5,16 +5,17 @@ import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ResolveInfo; -import android.util.Log; import org.lsposed.lspd.hooker.HandleSystemServerProcessHooker; import org.lsposed.lspd.impl.LSPosedHelper; import org.lsposed.lspd.service.BridgeService; +import org.lsposed.lspd.util.Utils; import io.github.libxposed.api.XposedInterface; import io.github.libxposed.api.annotations.AfterInvocation; import io.github.libxposed.api.annotations.XposedHooker; + public class ParasiticManagerSystemHooker implements HandleSystemServerProcessHooker.Callback { public static void start() { HandleSystemServerProcessHooker.callback = new ParasiticManagerSystemHooker(); @@ -78,9 +79,9 @@ public void onSystemServerLoaded(ClassLoader classLoader) { HookBridge.deoptimizeMethod(method); } LSPosedHelper.hookAllMethods(Hooker2.class, Class.forName("com.android.server.wm.ActivityStarter", false, classLoader), "execute");*/ - Log.d("LSPosed", "hooked activity starter"); + Utils.logD("hooked activity starter"); } catch (Throwable e) { - Log.e("LSPosed", "onSystemServerLoaded: ", e); + Utils.logE("onSystemServerLoaded: ", e); } } } diff --git a/magisk-loader/src/main/jni/src/magisk_loader.cpp b/magisk-loader/src/main/jni/src/magisk_loader.cpp index 6f309e0272a..1cd15cb45b5 100644 --- a/magisk-loader/src/main/jni/src/magisk_loader.cpp +++ b/magisk-loader/src/main/jni/src/magisk_loader.cpp @@ -36,6 +36,10 @@ #include "symbol_cache.h" #include "utils/jni_helper.hpp" +#ifndef NDEBUG +#define NDEBUG 0 +#endif + using namespace lsplant; static_assert(FS_IOC_SETFLAGS == LP_SELECT(0x40046602, 0x40086602)); @@ -222,8 +226,8 @@ void MagiskLoader::OnNativeForkSystemServerPost(JNIEnv *env) { InitHooks(env); SetupEntryClass(env); FindAndCall(env, "forkCommon", - "(ZLjava/lang/String;Ljava/lang/String;Landroid/os/IBinder;)V", JNI_TRUE, - JNI_NewStringUTF(env, "system"), nullptr, application_binder, + "(ZZLjava/lang/String;Ljava/lang/String;Landroid/os/IBinder;)V", JNI_TRUE, + !NDEBUG, JNI_NewStringUTF(env, "system"), nullptr, application_binder, is_parasitic_manager); GetArt(true); } @@ -289,8 +293,8 @@ void MagiskLoader::OnNativeForkAndSpecializePost(JNIEnv *env, jstring nice_name, SetupEntryClass(env); LOGD("Done prepare"); FindAndCall(env, "forkCommon", - "(ZLjava/lang/String;Ljava/lang/String;Landroid/os/IBinder;)V", JNI_FALSE, - nice_name, app_dir, binder); + "(ZZLjava/lang/String;Ljava/lang/String;Landroid/os/IBinder;)V", JNI_FALSE, + !NDEBUG, nice_name, app_dir, binder); LOGD("injected xposed into {}", process_name.get()); setAllowUnload(false); GetArt(true); diff --git a/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java b/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java index 2be5970dda5..1346d9ac081 100644 --- a/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java +++ b/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java @@ -22,7 +22,6 @@ import android.os.SystemProperties; import android.text.TextUtils; -import android.util.Log; import java.time.ZoneId; import java.time.ZoneOffset; @@ -34,6 +33,61 @@ public class Utils { public static final boolean isMIUI = !TextUtils.isEmpty(SystemProperties.get("ro.miui.ui.version.name")); public static final boolean isLENOVO = !TextUtils.isEmpty(SystemProperties.get("ro.lenovo.region")); + public static boolean beSilent = false; + + public class Log { + public static String getStackTraceString(Throwable tr) { + return android.util.Log.getStackTraceString(tr); + } + + public static void d(String tag, String msg) { + if (beSilent) return; + android.util.Log.d(tag, msg); + } + + public static void d(String tag, String msg, Throwable tr) { + android.util.Log.d(tag, msg, tr); + } + + public static void v(String tag, String msg) { + if (beSilent) return; + android.util.Log.v(tag, msg); + } + + public static void v(String tag, String msg, Throwable tr) { + android.util.Log.v(tag, msg, tr); + } + + public static void i(String tag, String msg) { + if (beSilent) return; + android.util.Log.i(tag, msg); + } + + public static void i(String tag, String msg, Throwable tr) { + android.util.Log.i(tag, msg, tr); + } + + public static void w(String tag, String msg) { + if (beSilent) return; + android.util.Log.w(tag, msg); + } + + public static void w(String tag, String msg, Throwable tr) { + if (beSilent) return; + android.util.Log.w(tag, msg, tr); + } + + public static void e(String tag, String msg) { + android.util.Log.e(tag, msg); + } + + public static void e(String tag, String msg, Throwable tr) { + android.util.Log.e(tag, msg, tr); + } + + + } + public static void logD(Object msg) { Log.d(LOG_TAG, msg.toString()); } From 454dca07225cca024e506824344468fa5160bf84 Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Mon, 25 Nov 2024 12:31:15 +0100 Subject: [PATCH 2/3] beSlient should be a field of Log --- magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java | 2 +- .../src/main/java/org/lsposed/lspd/util/Utils.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java b/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java index ff8a57272cc..9c363b03135 100644 --- a/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java +++ b/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java @@ -34,7 +34,7 @@ public static void forkCommon(boolean isSystem, boolean isDebug, String niceName if (isSystem) { ParasiticManagerSystemHooker.start(); } - Utils.beSilent = !isDebug; + Utils.Log.beSilent = !isDebug; Startup.initXposed(isSystem, niceName, appDir, ILSPApplicationService.Stub.asInterface(binder)); if (niceName.equals(BuildConfig.DEFAULT_MANAGER_PACKAGE_NAME) && ParasiticManagerHooker.start()) { Utils.logI("Loaded manager, skipping next steps"); diff --git a/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java b/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java index 1346d9ac081..866d5a2d1b9 100644 --- a/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java +++ b/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java @@ -33,9 +33,9 @@ public class Utils { public static final boolean isMIUI = !TextUtils.isEmpty(SystemProperties.get("ro.miui.ui.version.name")); public static final boolean isLENOVO = !TextUtils.isEmpty(SystemProperties.get("ro.lenovo.region")); - public static boolean beSilent = false; - public class Log { + public static boolean beSilent = false; + public static String getStackTraceString(Throwable tr) { return android.util.Log.getStackTraceString(tr); } From 3554c5f14d0673e7ac3375c0a542a1de33aa3b4c Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Mon, 25 Nov 2024 21:25:15 +0100 Subject: [PATCH 3/3] Manager logs through LSPose manager We use the verbose log toggle to control if logs are stripped --- .../lspd/core/ApplicationServiceClient.java | 9 +++++++++ .../lspd/service/LSPApplicationService.java | 5 +++++ magisk-loader/proguard-rules.pro | 2 +- .../src/main/java/org/lsposed/lspd/core/Main.java | 14 ++++++++++++-- magisk-loader/src/main/jni/src/magisk_loader.cpp | 12 ++++-------- .../lspd/service/ILSPApplicationService.aidl | 2 ++ .../src/main/java/org/lsposed/lspd/util/Utils.java | 12 ++++++------ 7 files changed, 39 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/org/lsposed/lspd/core/ApplicationServiceClient.java b/core/src/main/java/org/lsposed/lspd/core/ApplicationServiceClient.java index 6cb0286875e..6eb01d0b3dc 100644 --- a/core/src/main/java/org/lsposed/lspd/core/ApplicationServiceClient.java +++ b/core/src/main/java/org/lsposed/lspd/core/ApplicationServiceClient.java @@ -57,6 +57,15 @@ synchronized static void Init(ILSPApplicationService service, String niceName) { } } + @Override + public boolean isLogMuted() { + try { + return service.isLogMuted(); + } catch (RemoteException | NullPointerException ignored) { + } + return false; + } + @Override public List getLegacyModulesList() { try { diff --git a/daemon/src/main/java/org/lsposed/lspd/service/LSPApplicationService.java b/daemon/src/main/java/org/lsposed/lspd/service/LSPApplicationService.java index 40cf3316f30..259980267b1 100644 --- a/daemon/src/main/java/org/lsposed/lspd/service/LSPApplicationService.java +++ b/daemon/src/main/java/org/lsposed/lspd/service/LSPApplicationService.java @@ -126,6 +126,11 @@ private List getAllModulesList() throws RemoteException { return ConfigManager.getInstance().getModulesForProcess(processInfo.processName, processInfo.uid); } + @Override + public boolean isLogMuted() throws RemoteException { + return !ServiceManager.getManagerService().isVerboseLog(); + } + @Override public List getLegacyModulesList() throws RemoteException { return getAllModulesList().stream().filter(m -> m.file.legacy).collect(Collectors.toList()); diff --git a/magisk-loader/proguard-rules.pro b/magisk-loader/proguard-rules.pro index b8358f5f073..36e55739fa5 100644 --- a/magisk-loader/proguard-rules.pro +++ b/magisk-loader/proguard-rules.pro @@ -1,5 +1,5 @@ -keepclasseswithmembers class org.lsposed.lspd.core.Main { - public static void forkCommon(boolean, boolean, java.lang.String, java.lang.String, android.os.IBinder); + public static void forkCommon(boolean, java.lang.String, java.lang.String, android.os.IBinder); } -keepclasseswithmembers,includedescriptorclasses class * { native ; diff --git a/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java b/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java index 9c363b03135..d908f12c99a 100644 --- a/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java +++ b/magisk-loader/src/main/java/org/lsposed/lspd/core/Main.java @@ -19,6 +19,8 @@ package org.lsposed.lspd.core; +import static org.lsposed.lspd.core.ApplicationServiceClient.serviceClient; + import android.os.IBinder; import android.os.Process; @@ -30,16 +32,24 @@ public class Main { - public static void forkCommon(boolean isSystem, boolean isDebug, String niceName, String appDir, IBinder binder) { + public static void forkCommon(boolean isSystem, String niceName, String appDir, IBinder binder) { if (isSystem) { ParasiticManagerSystemHooker.start(); } - Utils.Log.beSilent = !isDebug; + Startup.initXposed(isSystem, niceName, appDir, ILSPApplicationService.Stub.asInterface(binder)); + + try { + Utils.Log.muted = serviceClient.isLogMuted(); + } catch (Throwable t) { + Utils.logE("failed to configure logs", t); + } + if (niceName.equals(BuildConfig.DEFAULT_MANAGER_PACKAGE_NAME) && ParasiticManagerHooker.start()) { Utils.logI("Loaded manager, skipping next steps"); return; } + Utils.logI("Loading xposed for " + niceName + "/" + Process.myUid()); Startup.bootstrapXposed(); } diff --git a/magisk-loader/src/main/jni/src/magisk_loader.cpp b/magisk-loader/src/main/jni/src/magisk_loader.cpp index 1cd15cb45b5..6f309e0272a 100644 --- a/magisk-loader/src/main/jni/src/magisk_loader.cpp +++ b/magisk-loader/src/main/jni/src/magisk_loader.cpp @@ -36,10 +36,6 @@ #include "symbol_cache.h" #include "utils/jni_helper.hpp" -#ifndef NDEBUG -#define NDEBUG 0 -#endif - using namespace lsplant; static_assert(FS_IOC_SETFLAGS == LP_SELECT(0x40046602, 0x40086602)); @@ -226,8 +222,8 @@ void MagiskLoader::OnNativeForkSystemServerPost(JNIEnv *env) { InitHooks(env); SetupEntryClass(env); FindAndCall(env, "forkCommon", - "(ZZLjava/lang/String;Ljava/lang/String;Landroid/os/IBinder;)V", JNI_TRUE, - !NDEBUG, JNI_NewStringUTF(env, "system"), nullptr, application_binder, + "(ZLjava/lang/String;Ljava/lang/String;Landroid/os/IBinder;)V", JNI_TRUE, + JNI_NewStringUTF(env, "system"), nullptr, application_binder, is_parasitic_manager); GetArt(true); } @@ -293,8 +289,8 @@ void MagiskLoader::OnNativeForkAndSpecializePost(JNIEnv *env, jstring nice_name, SetupEntryClass(env); LOGD("Done prepare"); FindAndCall(env, "forkCommon", - "(ZZLjava/lang/String;Ljava/lang/String;Landroid/os/IBinder;)V", JNI_FALSE, - !NDEBUG, nice_name, app_dir, binder); + "(ZLjava/lang/String;Ljava/lang/String;Landroid/os/IBinder;)V", JNI_FALSE, + nice_name, app_dir, binder); LOGD("injected xposed into {}", process_name.get()); setAllowUnload(false); GetArt(true); diff --git a/services/daemon-service/src/main/aidl/org/lsposed/lspd/service/ILSPApplicationService.aidl b/services/daemon-service/src/main/aidl/org/lsposed/lspd/service/ILSPApplicationService.aidl index 4f01ab0eb94..b85b6ed2130 100644 --- a/services/daemon-service/src/main/aidl/org/lsposed/lspd/service/ILSPApplicationService.aidl +++ b/services/daemon-service/src/main/aidl/org/lsposed/lspd/service/ILSPApplicationService.aidl @@ -3,6 +3,8 @@ package org.lsposed.lspd.service; import org.lsposed.lspd.models.Module; interface ILSPApplicationService { + boolean isLogMuted(); + List getLegacyModulesList(); List getModulesList(); diff --git a/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java b/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java index 866d5a2d1b9..d978d17144b 100644 --- a/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java +++ b/services/daemon-service/src/main/java/org/lsposed/lspd/util/Utils.java @@ -34,14 +34,14 @@ public class Utils { public static final boolean isLENOVO = !TextUtils.isEmpty(SystemProperties.get("ro.lenovo.region")); public class Log { - public static boolean beSilent = false; + public static boolean muted = false; public static String getStackTraceString(Throwable tr) { return android.util.Log.getStackTraceString(tr); } public static void d(String tag, String msg) { - if (beSilent) return; + if (muted) return; android.util.Log.d(tag, msg); } @@ -50,7 +50,7 @@ public static void d(String tag, String msg, Throwable tr) { } public static void v(String tag, String msg) { - if (beSilent) return; + if (muted) return; android.util.Log.v(tag, msg); } @@ -59,7 +59,7 @@ public static void v(String tag, String msg, Throwable tr) { } public static void i(String tag, String msg) { - if (beSilent) return; + if (muted) return; android.util.Log.i(tag, msg); } @@ -68,12 +68,12 @@ public static void i(String tag, String msg, Throwable tr) { } public static void w(String tag, String msg) { - if (beSilent) return; + if (muted) return; android.util.Log.w(tag, msg); } public static void w(String tag, String msg, Throwable tr) { - if (beSilent) return; + if (muted) return; android.util.Log.w(tag, msg, tr); }