Skip to content

Commit c205f08

Browse files
committed
Add rich logging api
1 parent b896dbc commit c205f08

5 files changed

Lines changed: 27 additions & 8 deletions

File tree

api/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ plugins {
66

77
android {
88
namespace = "io.github.libxposed.api"
9-
compileSdk = 35
9+
compileSdk = 36
1010
buildToolsVersion = "35.0.0"
11+
androidResources.enable = false
1112

1213
defaultConfig {
1314
minSdk = 24
1415
consumerProguardFiles("proguard-rules.pro")
1516
}
1617

1718
buildFeatures {
18-
androidResources = false
1919
buildConfig = false
2020
}
2121

api/src/main/java/io/github/libxposed/api/XposedInterface.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,16 +464,31 @@ interface MethodUnhooker<T> {
464464
/**
465465
* Writes a message to the Xposed log.
466466
*
467+
* @param priority The log priority, see {@link android.util.Log}
468+
* @param tag The log tag
469+
* @param msg The log message
470+
* @param tr An exception to log
471+
*/
472+
void log(int priority, @Nullable String tag, @NonNull String msg, @Nullable Throwable tr);
473+
474+
/**
475+
* Writes a message to the Xposed log.
476+
* @deprecated Use {@link #log(int, String, String, Throwable)} instead.
477+
* This method is kept for compatibility with old hooker classes and will be removed in first release version.
478+
*
467479
* @param message The log message
468480
*/
481+
@Deprecated
469482
void log(@NonNull String message);
470483

471484
/**
472485
* Writes a message with a stack trace to the Xposed log.
486+
* @deprecated Use {@link #log(int, String, String, Throwable)} instead.
473487
*
474488
* @param message The log message
475489
* @param throwable The Throwable object for the stack trace
476490
*/
491+
@Deprecated
477492
void log(@NonNull String message, @NonNull Throwable throwable);
478493

479494
/**

api/src/main/java/io/github/libxposed/api/XposedInterfaceWrapper.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ public final <T, U> U newInstanceSpecial(@NonNull Constructor<T> constructor, @N
129129
return mBase.newInstanceSpecial(constructor, subClass, args);
130130
}
131131

132+
@Override
133+
public final void log(int priority, @Nullable String tag, @NonNull String msg, @Nullable Throwable tr) {
134+
mBase.log(priority, tag, msg, tr);
135+
}
136+
132137
@Override
133138
public final void log(@NonNull String message) {
134139
mBase.log(message);

gradle/libs.versions.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[versions]
2-
annotation = "1.8.0"
3-
kotlin = "2.0.0"
4-
lint = "31.5.1"
5-
agp = "8.5.1"
2+
annotation = "1.9.1"
3+
kotlin = "2.3.10"
4+
lint = "32.0.1"
5+
agp = "9.0.1"
66

77
[plugins]
88
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
@@ -13,4 +13,3 @@ annotation = { module = "androidx.annotation:annotation", version.ref = "annotat
1313
lint-api = { module = "com.android.tools.lint:lint-api", version.ref = "lint" }
1414
lint-checks = { module = "com.android.tools.lint:lint-checks", version.ref = "lint" }
1515
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
16-

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)