This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from mkx173/pull
Adapt to new version (12.53.1.0), new features and bug fixes
- Loading branch information
Showing
9 changed files
with
337 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
app/src/main/java/gm/tieba/tabswitch/hooker/eliminate/FoldTopCardView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package gm.tieba.tabswitch.hooker.eliminate; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import java.util.List; | ||
|
||
import de.robv.android.xposed.XC_MethodReplacement; | ||
import de.robv.android.xposed.XposedBridge; | ||
import de.robv.android.xposed.XposedHelpers; | ||
import gm.tieba.tabswitch.XposedContext; | ||
import gm.tieba.tabswitch.hooker.IHooker; | ||
|
||
public class FoldTopCardView extends XposedContext implements IHooker { | ||
@NonNull | ||
@Override | ||
public String key() { | ||
return "fold_top_card_view"; | ||
} | ||
|
||
@Override | ||
public void hook() throws Throwable { | ||
// 总是折叠置顶帖 | ||
for (final var method : XposedHelpers.findClass("com.baidu.tieba.forum.view.TopCardView", sClassLoader).getDeclaredMethods()) { | ||
if (method.getReturnType() == boolean.class) { | ||
final var currMethodParameterTypes = method.getParameterTypes(); | ||
if (currMethodParameterTypes.length == 2 && currMethodParameterTypes[0] == List.class && currMethodParameterTypes[1] == boolean.class) { | ||
XposedBridge.hookMethod(method, XC_MethodReplacement.returnConstant(false)); | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.