Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
bump ver
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenMushroomNew committed Nov 9, 2021
1 parent ead7995 commit 8155317
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ android {
minSdk 24
targetSdk sdk
versionCode gitCommitCount
versionName "2.7.1-beta"
versionName "2.7.1"

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
externalNativeBuild {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ public class AntiConfusion extends XposedContext implements IHooker {
private LinearLayout mContentView;

public void hook() throws Throwable {
// make isLaunchOpOn = false to avoid startActivity() to com.baidu.tieba.NewLogoActivity
XposedHelpers.findAndHookMethod("com.baidu.tbadk.switchs.AdToMainTabActivitySwitch", sClassLoader,
"getIsOn", XC_MethodReplacement.returnConstant(false));
try {
// make isLaunchOpOn = false to avoid startActivity() to com.baidu.tieba.NewLogoActivity
XposedHelpers.findAndHookMethod("com.baidu.tbadk.switchs.AdToMainTabActivitySwitch", sClassLoader,
"getIsOn", XC_MethodReplacement.returnConstant(false));
} catch (XposedHelpers.ClassNotFoundError ignored) {
}
for (var method : XposedHelpers.findClass("com.baidu.tieba.LogoActivity", sClassLoader).getDeclaredMethods()) {
if (!method.getName().startsWith("on") && Arrays.equals(method.getParameterTypes(), new Class[]{Bundle.class})) {
XposedBridge.hookMethod(method, new XC_MethodReplacement() {
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/gm/tieba/tabswitch/util/ReflectUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public interface Callback {
boolean onFieldFound(Object objField);
}

public static void findField(Object instance, Class<?> cls, Callback handle) {
public static void walkField(Object instance, Class<?> cls, Callback handle) {
try {
Field[] declaredFields = instance.getClass().getDeclaredFields();
for (Field field : declaredFields) {
Expand All @@ -140,11 +140,11 @@ public static void findField(Object instance, Class<?> cls, Callback handle) {
}

public static void walkObjectFields(Object instance, Class<?> cls, Callback handle) {
findField(instance, cls, handle);
walkField(instance, cls, handle);
}

public static void walkObjectFields(Object instance, String className, Callback handle) {
findField(instance, XposedHelpers.findClass(className, sClassLoader), handle);
walkField(instance, XposedHelpers.findClass(className, sClassLoader), handle);
}

public static Object callMethod(Method method, Object instance, Object... args) {
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ pluginManagement {
mavenCentral()
}
plugins {
id 'com.android.application' version '7.1.0-beta01'
id 'com.android.library' version '7.1.0-beta01'
id 'com.android.application' version '7.1.0-beta02'
id 'com.android.library' version '7.1.0-beta02'
id 'org.jetbrains.kotlin.android' version '1.5.31'
}
}
Expand Down

0 comments on commit 8155317

Please sign in to comment.