Skip to content

Fix for Reddit and add features for Meta#143

Open
gnadgnaoh wants to merge 4 commits intochsbuffer:mainfrom
gnadgnaoh:main
Open

Fix for Reddit and add features for Meta#143
gnadgnaoh wants to merge 4 commits intochsbuffer:mainfrom
gnadgnaoh:main

Conversation

@gnadgnaoh
Copy link

Reddit: add hook to view renderer to hide ads placeholders in comments
Meta: hide ads in Reels and Story for Instagram

Copy link
Owner

@chsbuffer chsbuffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request does not meet the consensus requirement of consistency with existing code style. Furthermore, this project primarily ports patches from ReVanced patches; for external contributors, I would appreciate it if you could clarify whether your code is updated upstream code, or original content.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English

Comment on lines +14 to +16
methodMatcher {
usingStrings(listOf("blank_ad_container"))
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings()

Logger.printDebug { "Hide Comment" }
it.result = it.args[0]
Logger.printDebug { "Hide Comment Ad - invokeSuspend skipped" }
it.result = kotlin.Unit
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just Unit

}
} No newline at end of file

// Hook tất cả method trong class chứa "blank_ad_container"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English

Comment on lines +20 to +25
XposedBridge.hookMethod(method, object : de.robv.android.xposed.XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
Logger.printDebug { "Hide Comment Ad - renderer blocked: ${method.name}" }
param.result = null
}
})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom Xposed DSL is preferred in this project, Please ensure consistency in coding style across the entire repository.

description = "Removes ads in the comments.",) {
description = "Removes ads in the comments.",
) {
::hideCommentAdsFingerprint.hookMethod {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you've hooked to nop all methods in the class containing this method, this seems redundant.

Comment on lines +17 to +24
val adSponsoredContentFingerprint = findMethodDirect {
findMethod {
matcher {
returnType = "boolean"
strings("SponsoredContentController.insertItem")
}
}.single()
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent coding style

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants