This repository has been archived by the owner on Jan 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
47 additions
and
0 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
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/UnimportantNotification.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,38 @@ | ||
package com.sevtinge.hyperceiler.module.hook.systemui; | ||
|
||
import com.sevtinge.hyperceiler.module.base.BaseHook; | ||
|
||
import java.util.ArrayList; | ||
|
||
import de.robv.android.xposed.XposedHelpers; | ||
|
||
public class UnimportantNotification extends BaseHook { | ||
@Override | ||
public void init() throws NoSuchMethodException { | ||
findAndHookMethod("com.android.systemui.statusbar.notification.collection.coordinator.FoldCoordinator$shadeExpansionListener$1", | ||
"onPanelExpansionChanged", "com.android.systemui.shade.ShadeExpansionChangeEvent", | ||
new MethodHook() { | ||
@Override | ||
protected void before(MethodHookParam param) { | ||
Object FoldCoordinator = XposedHelpers.getObjectField(param.thisObject, "this$0"); | ||
XposedHelpers.setObjectField(FoldCoordinator, "mPendingNotifications", new ArrayList<>()); | ||
} | ||
} | ||
); | ||
|
||
findAndHookMethod("com.android.systemui.statusbar.notification.collection.coordinator.FoldCoordinator", | ||
"access$shouldIgnoreEntry", | ||
"com.android.systemui.statusbar.notification.collection.coordinator.FoldCoordinator", | ||
"com.android.systemui.statusbar.notification.collection.NotificationEntry", | ||
new MethodHook() { | ||
@Override | ||
protected void after(MethodHookParam param) { | ||
// Object mSbn = XposedHelpers.getObjectField(param.args[1], "mSbn"); | ||
// String getPackageName = (String) XposedHelpers.callMethod(mSbn, "getPackageName"); | ||
// logE(TAG, "after: " + param.getResult() + " pkg: " + getPackageName); | ||
param.setResult(true); | ||
} | ||
} | ||
); | ||
} | ||
} |
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
f090908
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哇,这个太好了!