Skip to content

Commit

Permalink
Merge pull request #604 from Tencent/hotfix/1.0.0
Browse files Browse the repository at this point in the history
Hotfix/1.0.0
  • Loading branch information
Yves0 authored Jun 10, 2021
2 parents 3f0551e + 5b8dadb commit b7b4864
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 30 deletions.
1 change: 1 addition & 0 deletions matrix/matrix-android/gradle/WeChatPublish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -583,3 +583,4 @@ class WeChatAndroidLibraryPublishExtension extends WeChatPublishExtension {
}
}
}
apply from: rootProject.file('gradle/check.gradle')
13 changes: 9 additions & 4 deletions matrix/matrix-android/gradle/check.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ checkstyle {
task('checkstyle', type: Checkstyle) {
source 'src/main/java'
include '**/*.java'
include '**/*.kt'
classpath = files()
}

if ("External" != rootProject.ext.PUBLISH_CHANNEL) {
//if ("External" != rootProject.ext.PUBLISH_CHANNEL) {
project.afterEvaluate {
project.publish.dependsOn("checkstyle")
project.publishToMavenLocal.dependsOn("checkstyle")
// project.publish.dependsOn("checkstyle")
// project.publishToMavenLocal.dependsOn("checkstyle")
project.build.dependsOn("checkstyle")
if (project.plugins.hasPlugin("com.android.application") || project.plugins.hasPlugin("com.android.library")) {
project.preBuild.dependsOn("checkstyle")
}
}
}
//}
check.dependsOn('checkstyle')


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,15 @@ final static class ThreadTaskExecutor implements Runnable, Handler.Callback {

private boolean mThreadBlocked = false;

public ThreadTaskExecutor(String threadName) {
ThreadTaskExecutor(String threadName) {
mThreadName = threadName;
}

public boolean isThreadBlocked() {
boolean isThreadBlocked() {
return mThreadBlocked;
}

public void arrangeTask(Runnable runnable, String tag) {
void arrangeTask(Runnable runnable, String tag) {
synchronized (mTaskQueue) {
if (mTaskQueue.contains(tag)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import android.bluetooth.le.ScanSettings;
import android.os.Build;
import android.text.TextUtils;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.text.TextUtils;

import com.tencent.matrix.batterycanary.monitor.BatteryMonitorConfig;
import com.tencent.matrix.batterycanary.utils.BatteryCanaryUtil;
import com.tencent.matrix.batterycanary.utils.BluetoothManagerServiceHooker;
import com.tencent.matrix.util.MatrixLog;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ public class HookManager {

public static final HookManager INSTANCE = new HookManager();

private volatile boolean hasHooked;
private Set<AbsHook> mHooks = new HashSet<>();
private volatile boolean hasHooked;
private Set<AbsHook> mHooks = new HashSet<>();

private HookManager(){
private HookManager() {
}

private void exclusiveHook() {
Expand Down Expand Up @@ -114,8 +114,11 @@ public boolean hasHooked() {
}

private native int xhookRefreshNative(boolean async);

private native void xhookEnableDebugNative(boolean flag);

private native void xhookEnableSigSegvProtectionNative(boolean flag);

private native void xhookClearNative();

public static class HookFailedException extends Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package com.tencent.matrix.iocanary.detect;


import android.annotation.SuppressLint;

import com.tencent.matrix.report.IssuePublisher;
import com.tencent.matrix.util.MatrixLog;

Expand Down Expand Up @@ -75,6 +77,7 @@ private boolean tryHook() {
try {
Class<?> closeGuardCls = Class.forName("dalvik.system.CloseGuard");
Class<?> closeGuardReporterCls = Class.forName("dalvik.system.CloseGuard$Reporter");
@SuppressLint("SoonBlockedPrivateApi") // FIXME
Method methodGetReporter = closeGuardCls.getDeclaredMethod("getReporter");
Method methodSetReporter = closeGuardCls.getDeclaredMethod("setReporter", closeGuardReporterCls);
Method methodSetEnabled = closeGuardCls.getDeclaredMethod("setEnabled", boolean.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public interface IDefaultConfig {

boolean isAppMethodBeatEnable();

boolean isFPSEnable();

boolean isEvilMethodTraceEnable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:text="@string/usage"
app:layout_constraintTop_toTopOf="parent"
/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Button
android:id="@+id/btn_wechat_backtrace_try"
Expand All @@ -26,8 +26,8 @@
android:onClick="backtraceTry"
android:text="Backtrace Have A Try"
android:textAllCaps="false"
app:layout_constraintTop_toBottomOf="@+id/textview_bactrace_usage"
/>
app:layout_constraintStart_toStartOf="@+id/textview_bactrace_usage"
app:layout_constraintTop_toBottomOf="@+id/textview_bactrace_usage" />

<Button
android:id="@+id/btn_wechat_backtrace_benchmark"
Expand All @@ -37,8 +37,8 @@
android:onClick="backtraceBenchmark"
android:text="Backtrace Benchmark"
android:textAllCaps="false"
app:layout_constraintTop_toBottomOf="@+id/btn_wechat_backtrace_try"
/>
app:layout_constraintStart_toStartOf="@+id/btn_wechat_backtrace_try"
app:layout_constraintTop_toBottomOf="@+id/btn_wechat_backtrace_try" />

<Button
android:id="@+id/btn_wechat_backtrace_benchmark_with_jit"
Expand All @@ -48,8 +48,8 @@
android:onClick="backtraceBenchmarkWithJit"
android:text="Backtrace Benchmark(With Jit)"
android:textAllCaps="false"
app:layout_constraintTop_toBottomOf="@+id/btn_wechat_backtrace_benchmark"
/>
app:layout_constraintStart_toStartOf="@+id/btn_wechat_backtrace_benchmark"
app:layout_constraintTop_toBottomOf="@+id/btn_wechat_backtrace_benchmark" />

<Button
android:id="@+id/btn_wechat_backtrace_benchmark_for_java"
Expand All @@ -59,16 +59,17 @@
android:onClick="backtraceBenchmarkForJava"
android:text="Java Backtrace Benchmark"
android:textAllCaps="false"
app:layout_constraintTop_toBottomOf="@+id/btn_wechat_backtrace_benchmark_with_jit"
/>
app:layout_constraintStart_toStartOf="@+id/btn_wechat_backtrace_benchmark_with_jit"
app:layout_constraintTop_toBottomOf="@+id/btn_wechat_backtrace_benchmark_with_jit" />

<View
android:id="@+id/horizontal_line_1"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="32dp"
app:layout_constraintTop_toBottomOf="@+id/btn_wechat_backtrace_benchmark_for_java"
android:background="#c0c0c0"/>
android:background="#c0c0c0"
app:layout_constraintStart_toStartOf="@+id/btn_wechat_backtrace_benchmark_for_java"
app:layout_constraintTop_toBottomOf="@+id/btn_wechat_backtrace_benchmark_for_java" />

<TextView
android:id="@+id/textview_statistic_usage"
Expand All @@ -78,19 +79,18 @@
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:text="@string/stat_usage"
app:layout_constraintTop_toBottomOf="@+id/horizontal_line_1"
/>
app:layout_constraintStart_toStartOf="@+id/btn_wechat_backtrace_benchmark_for_java"
app:layout_constraintTop_toBottomOf="@+id/horizontal_line_1" />

<Button
android:id="@+id/btn_wechat_backtrace_statistics"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="doStatistics"
android:layout_marginBottom="8dp"
android:text="Statistics"
android:textAllCaps="false"
app:layout_constraintTop_toBottomOf="@+id/textview_statistic_usage"
/>
app:layout_constraintStart_toStartOf="@+id/textview_statistic_usage"
app:layout_constraintTop_toBottomOf="@+id/textview_statistic_usage" />
<!-- <Button-->
<!-- android:id="@+id/btn_wechat_backtrace"-->
<!-- android:layout_width="wrap_content"-->
Expand Down

0 comments on commit b7b4864

Please sign in to comment.