mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-28 13:11:03 +00:00
Compare commits
5 Commits
v2.160.0-d
...
v2.160.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6699cf1a07 | ||
|
|
fc92fb20b2 | ||
|
|
085039ed9e | ||
|
|
3e08ce4275 | ||
|
|
707e61574f |
17
CHANGELOG.md
17
CHANGELOG.md
@@ -1,3 +1,20 @@
|
|||||||
|
# [2.160.0](https://github.com/revanced/revanced-patches/compare/v2.159.0...v2.160.0) (2023-02-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **instagram:** `hide-timeline-ads` patch ([61668e6](https://github.com/revanced/revanced-patches/commit/61668e67083b74a08f8015308f4afe548e16a9ad))
|
||||||
|
* **reddit:** `hide-subreddit-banner` patch ([13a1381](https://github.com/revanced/revanced-patches/commit/13a138122875b30e82df68a680e413f6ad7ba382))
|
||||||
|
* **reddit:** bump patches compatibility to `v2023.05.0` ([0a72fa1](https://github.com/revanced/revanced-patches/commit/0a72fa10bf009192157e04e0788daf5462324a0e))
|
||||||
|
|
||||||
|
# [2.160.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.160.0-dev.1...v2.160.0-dev.2) (2023-02-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **reddit:** `hide-subreddit-banner` patch ([13a1381](https://github.com/revanced/revanced-patches/commit/13a138122875b30e82df68a680e413f6ad7ba382))
|
||||||
|
* **reddit:** bump patches compatibility to `v2023.05.0` ([0a72fa1](https://github.com/revanced/revanced-patches/commit/0a72fa10bf009192157e04e0788daf5462324a0e))
|
||||||
|
|
||||||
# [2.160.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.159.0...v2.160.0-dev.1) (2023-02-10)
|
# [2.160.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.159.0...v2.160.0-dev.1) (2023-02-10)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,8 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|:--------:|:--------------:|:-----------------:|
|
||||||
| `general-reddit-ads` | Removes general ads from the Reddit frontpage and subreddits. | 2022.43.0 |
|
| `general-reddit-ads` | Removes general ads from the Reddit frontpage and subreddits. | 2023.05.0 |
|
||||||
|
| `hide-subreddit-banner` | Hides banner ads from comments on subreddits. | 2023.05.0 |
|
||||||
| `premium-icon-reddit` | Unlocks premium Reddit app icons. | all |
|
| `premium-icon-reddit` | Unlocks premium Reddit app icons. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.160.0-dev.1
|
version = 2.160.0
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.reddit.ad.banner.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility(
|
||||||
|
[Package(
|
||||||
|
"com.reddit.frontpage", arrayOf("2023.05.0")
|
||||||
|
)]
|
||||||
|
)
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class HideBannerCompatibility
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package app.revanced.patches.reddit.ad.banner.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.ResourceContext
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.reddit.ad.banner.annotations.HideBannerCompatibility
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("hide-subreddit-banner")
|
||||||
|
@Description("Hides banner ads from comments on subreddits.")
|
||||||
|
@HideBannerCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class HideBannerPatch : ResourcePatch {
|
||||||
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
|
|
||||||
|
context.xmlEditor[RESOURCE_FILE_PATH].use {
|
||||||
|
it.file.getElementsByTagName("merge").item(0).childNodes.apply {
|
||||||
|
val attributes = arrayOf("height", "width")
|
||||||
|
|
||||||
|
for (i in 1 until length) {
|
||||||
|
val view = item(i)
|
||||||
|
if (
|
||||||
|
view.hasAttributes() &&
|
||||||
|
view.attributes.getNamedItem("android:id").nodeValue.endsWith("ad_view_stub")
|
||||||
|
) {
|
||||||
|
attributes.forEach { attribute ->
|
||||||
|
view.attributes.getNamedItem("android:layout_$attribute").nodeValue = "0.0dip"
|
||||||
|
}
|
||||||
|
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
const val RESOURCE_FILE_PATH = "res/layout/merge_listheader_link_detail.xml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility(
|
@Compatibility(
|
||||||
[Package(
|
[Package(
|
||||||
"com.reddit.frontpage", arrayOf("2022.43.0")
|
"com.reddit.frontpage", arrayOf("2022.43.0", "2023.05.0")
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
|||||||
Reference in New Issue
Block a user