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

Commit

Permalink
Block danmaku feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
zjns committed Apr 10, 2023
1 parent d0a8e5f commit a2126bc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/main/java/me/iacn/biliroaming/MiscRemoveAdsDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,18 @@ class MiscRemoveAdsDialog(val activity: Activity, prefs: SharedPreferences) :
}
removeCommentCmSwitch.isChecked = prefs.getBoolean("remove_comment_cm", false)

val blockDmFeedbackSwitch = string(R.string.block_dm_feedback_title).let {
switchPrefsItem(it).let { p -> root.addView(p.first); p.second }
}
blockDmFeedbackSwitch.isChecked = prefs.getBoolean("block_dm_feedback", false)

setTitle(string(R.string.misc_remove_ads_title))

setPositiveButton(android.R.string.ok) { _, _ ->
prefs.edit().apply {
putBoolean("remove_search_ads", removeSearchAdsSwitch.isChecked)
putBoolean("remove_comment_cm", removeCommentCmSwitch.isChecked)
putBoolean("block_dm_feedback", blockDmFeedbackSwitch.isChecked)
}.apply()
Log.toast(string(R.string.prefs_save_success_and_reboot))
}
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/java/me/iacn/biliroaming/hook/JsonHook.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class JsonHook(classLoader: ClassLoader) : BaseHook(classLoader) {
val biliLiveRoomUserInfoClass =
"com.bilibili.bililive.videoliveplayer.net.beans.gateway.userinfo.BiliLiveRoomUserInfo"
.from(mClassLoader)
val dmQoeInfoClass = "tv.danmaku.bili.videopage.player.features.qoe.DmQoeInfo"
.from(mClassLoader)
val geminiDmQoeInfoClass = "tv.danmaku.bili.videopage.player.gemini.qoe.GeminiDmQoeInfo"
.from(mClassLoader)
val liveRoomRecommendCardClass =
"com.bilibili.bililive.videoliveplayer.net.beans.attentioncard.LiveRoomRecommendCard"
.from(mClassLoader)
Expand Down Expand Up @@ -327,6 +331,10 @@ class JsonHook(classLoader: ClassLoader) : BaseHook(classLoader) {
}
}

dmQoeInfoClass, geminiDmQoeInfoClass -> if (hidden &&
sPrefs.getBoolean("block_dm_feedback", false)
) result.callMethod("setShow", false)

dmAdvertClass -> if (sPrefs.getBoolean("hidden", false)
&& sPrefs.getBoolean("block_up_rcmd_ads", false)
) result.setObjectField("ads", null)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
<string name="default_playback_speed_title">默認播放速度</string>
<string name="default_playback_speed_summary">僅應用到影片播放</string>
<string name="default_playback_speed_hint">例如:1.5,空表示預設</string>
<string name="block_dm_feedback_title">屏蔽播放結束時彈幕氛圍回饋</string>
<string name="replace_story_video_title">取代豎版影片</string>
<string name="replace_story_video_summary">取代豎版影片為正常影片</string>
<string name="customize_drawer_title">自訂我的頁面</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
<string name="default_playback_speed_title">默认播放速度</string>
<string name="default_playback_speed_summary">仅应用到视频播放</string>
<string name="default_playback_speed_hint">例如:1.5,空表示默认</string>
<string name="block_dm_feedback_title">屏蔽播放结束时弹幕氛围反馈</string>
<string name="replace_story_video_title">替换竖版视频</string>
<string name="replace_story_video_summary">替换竖版视频为正常视频</string>
<string name="customize_drawer_title">自定义我的页面</string>
Expand Down

0 comments on commit a2126bc

Please sign in to comment.