Skip to content

Commit

Permalink
customize notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
fkzhang committed Feb 10, 2016
1 parent 317fa72 commit 6ed2e59
Show file tree
Hide file tree
Showing 9 changed files with 275 additions and 249 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.fkzhang.wechatunrecalled"
minSdkVersion 14
targetSdkVersion 23
versionCode 17
versionName "1.4.5.4"
versionCode 18
versionName "1.4.6"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
public class WechatUnrecalledHook {
protected final SettingsHelper mSettings;
protected final NotificationHelper mNotificationHelper;
private final String TAG_DELETED = "[已删除]";
protected final String TAG_DELETED = "[已删除]";
protected WechatPackageNames w;
protected Object mObject;
protected Context mNotificationContext;
Expand All @@ -65,8 +65,8 @@ public class WechatUnrecalledHook {
protected Class<?> mConversationClass;
protected WechatMainDBHelper mDb;
protected WechatSnsDBHelper mSnsDb;
private Class<?> SnsLuckyMoneyWantSeePhotoUI;
private Class<?> snsLuckyMoneyDataClass;
protected Class<?> SnsLuckyMoneyWantSeePhotoUI;
protected Class<?> snsLuckyMoneyDataClass;

public WechatUnrecalledHook(WechatPackageNames packageNames) {
this.w = packageNames;
Expand Down Expand Up @@ -302,7 +302,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
mSettings.reload();
if (!mSettings.getBoolean("enable_new_comment_notification", false))
if (!mSettings.getBoolean("new_comment_notification_enable", true))
return;

String s = (String) param.args[0];
Expand All @@ -326,7 +326,8 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
intent.putExtra("INTENT_FROMSUI", true);
intent.putExtra("INTENT_FROMSUI_COMMENTID", v.getAsLong("commentSvrID"));

mNotificationHelper.displayNewCommentNotification(title, content, icon, intent);
mNotificationHelper.showCommentNotification(title, content, icon,
intent, "new_comment");
}
});

Expand Down Expand Up @@ -468,7 +469,7 @@ protected void preventMsgRecall(XC_MethodHook.MethodHookParam param) {
if (cursor == null || !cursor.moveToFirst())
return;

if (mSettings.getBoolean("enable_recall_notification", true)) {
if (mSettings.getBoolean("msg_recall_notification_enable", true)) {
final Bitmap icon = getAccountAvatar(talker);
int t = cursor.getInt(cursor.getColumnIndex("type"));
String content;
Expand Down Expand Up @@ -609,7 +610,7 @@ public void preventCommentRecall(XC_MethodHook.MethodHookParam param) {

setCommentDeleteFlag(v);

if (!mSettings.getBoolean("enable_comment_recall_notification", true))
if (!mSettings.getBoolean("comment_recall_notification_enable", true))
return;

String talker = v.getAsString("talker");
Expand All @@ -623,7 +624,8 @@ public void preventCommentRecall(XC_MethodHook.MethodHookParam param) {
Intent resultIntent = new Intent();
resultIntent.setClassName(mNotificationContext.getPackageName(), w.SnsMsgUI);

mNotificationHelper.displayNewCommentNotification(title, content, icon, resultIntent);
mNotificationHelper.showCommentNotification(title, content, icon, resultIntent,
"comment_recall");
}
}

Expand Down
Loading

0 comments on commit 6ed2e59

Please sign in to comment.