Skip to content

Commit

Permalink
Merge pull request #41 from AioiLight/notification-mute
Browse files Browse the repository at this point in the history
返信に表示される "通知をオフ" を削除する機能の追加
  • Loading branch information
Chipppppppppp authored Jan 27, 2024
2 parents 37e38f1 + df84039 commit c1cfd76
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/src/main/java/io/github/chipppppppppp/lime/Main.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package io.github.chipppppppppp.lime;

import android.app.Activity;
import android.app.AndroidAppHelper;
import android.app.Application;
import android.app.Notification;
import android.app.AlertDialog;
import android.app.Application;
import android.app.Notification;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.XModuleResources;
import android.graphics.Canvas;
import android.net.Uri;
import android.support.customtabs.CustomTabsIntent;
Expand Down Expand Up @@ -403,6 +407,20 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
activity.finish();
}
});

XposedHelpers.findAndHookMethod(Notification.Builder.class, "addAction", Notification.Action.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
if (limeOptions.deleteReplyMute.checked) {
Application app = AndroidAppHelper.currentApplication();
Notification.Action a = (Notification.Action) param.args[0];
String muteChatString = app.getString(app.getResources().getIdentifier("notification_button_mute", "string", app.getPackageName()));
if (muteChatString.equals(a.title)) {
param.setResult(param.thisObject);
}
}
}
});
}

@Override
Expand Down

0 comments on commit c1cfd76

Please sign in to comment.