mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-21 01:53:56 +00:00
Compare commits
19 Commits
v2.160.0-d
...
v2.162.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1aa056d53f | ||
|
|
95be457590 | ||
|
|
42bd205e30 | ||
|
|
daa7e5270c | ||
|
|
9d0e8c18f0 | ||
|
|
6fef48141c | ||
|
|
7b7a98679b | ||
|
|
36bfe60850 | ||
|
|
75861fd225 | ||
|
|
d743d4c3ba | ||
|
|
f975f2dbc5 | ||
|
|
aeff72d5af | ||
|
|
da39f81887 | ||
|
|
3abd5d46de | ||
|
|
6699cf1a07 | ||
|
|
fc92fb20b2 | ||
|
|
085039ed9e | ||
|
|
3e08ce4275 | ||
|
|
707e61574f |
71
CHANGELOG.md
71
CHANGELOG.md
@@ -1,3 +1,74 @@
|
|||||||
|
# [2.162.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.162.0-dev.1...v2.162.0-dev.2) (2023-02-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/general-ads:** use better description for switch ([d33f959](https://github.com/revanced/revanced-patches/commit/d33f9597529d63014dd42fc6fe1e84b76831e0f3))
|
||||||
|
|
||||||
|
# [2.162.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.161.1...v2.162.0-dev.1) (2023-02-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **yuka:** `unlock-premium` patch ([#1608](https://github.com/revanced/revanced-patches/issues/1608)) ([71e1594](https://github.com/revanced/revanced-patches/commit/71e15945c1b4019eaa2ff214b4efbfc6b1a67376))
|
||||||
|
|
||||||
|
## [2.161.1](https://github.com/revanced/revanced-patches/compare/v2.161.0...v2.161.1) (2023-02-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/minimized-playback:** disable when playing shorts ([cd48030](https://github.com/revanced/revanced-patches/commit/cd48030cada3666d0159ad25711c20045a8a70c7))
|
||||||
|
|
||||||
|
## [2.161.1-dev.1](https://github.com/revanced/revanced-patches/compare/v2.161.0...v2.161.1-dev.1) (2023-02-11)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/minimized-playback:** disable when playing shorts ([cd48030](https://github.com/revanced/revanced-patches/commit/cd48030cada3666d0159ad25711c20045a8a70c7))
|
||||||
|
|
||||||
|
# [2.161.0](https://github.com/revanced/revanced-patches/compare/v2.160.0...v2.161.0) (2023-02-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **instagram/hide-timeline-ads:** fix compatibility with newer versions ([3d4646a](https://github.com/revanced/revanced-patches/commit/3d4646ae7efe13f9f7e47cf5ba7613aac4d04d66))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube/general-ads:** hide pill to view products ([7b1bc1a](https://github.com/revanced/revanced-patches/commit/7b1bc1ad50f2b38277b0c19aad735ea65f8333d3))
|
||||||
|
|
||||||
|
# [2.161.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.161.0-dev.1...v2.161.0-dev.2) (2023-02-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **instagram/hide-timeline-ads:** fix compatibility with newer versions ([3d4646a](https://github.com/revanced/revanced-patches/commit/3d4646ae7efe13f9f7e47cf5ba7613aac4d04d66))
|
||||||
|
|
||||||
|
# [2.161.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.160.0...v2.161.0-dev.1) (2023-02-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube/general-ads:** hide pill to view products ([7b1bc1a](https://github.com/revanced/revanced-patches/commit/7b1bc1ad50f2b38277b0c19aad735ea65f8333d3))
|
||||||
|
|
||||||
|
# [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)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -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>
|
||||||
|
|
||||||
@@ -253,6 +254,14 @@ The official Patch bundle provided by ReVanced and the community.
|
|||||||
| `remove-broadcasts-restriction` | Enables starting/stopping NetGuard via broadcasts. | all |
|
| `remove-broadcasts-restriction` | Enables starting/stopping NetGuard via broadcasts. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### [📦 `io.yuka.android`](https://play.google.com/store/apps/details?id=io.yuka.android)
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `unlock-premium` | Unlocks premium features. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
### [📦 `com.teslacoilsw.launcher`](https://play.google.com/store/apps/details?id=com.teslacoilsw.launcher)
|
### [📦 `com.teslacoilsw.launcher`](https://play.google.com/store/apps/details?id=com.teslacoilsw.launcher)
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.160.0-dev.1
|
version = 2.162.0-dev.2
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -3,5 +3,5 @@ package app.revanced.patches.instagram.patches.ads.timeline.fingerprints
|
|||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
object MediaFingerprint : MethodFingerprint(
|
object MediaFingerprint : MethodFingerprint(
|
||||||
strings = listOf("is_paid_partnership", "story_ad_headline", "is_panorama")
|
strings = listOf("force_overlay", "Media#updateFields", "live_reels_metadata")
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -87,6 +87,13 @@ class GeneralAdsResourcePatch : ResourcePatch {
|
|||||||
StringResource("revanced_adremover_compact_banner_enabled_summary_on", "Compact banners are hidden"),
|
StringResource("revanced_adremover_compact_banner_enabled_summary_on", "Compact banners are hidden"),
|
||||||
StringResource("revanced_adremover_compact_banner_enabled_summary_off", "Compact banners are shown")
|
StringResource("revanced_adremover_compact_banner_enabled_summary_off", "Compact banners are shown")
|
||||||
),
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_adremover_view_products",
|
||||||
|
StringResource("revanced_adremover_view_products_title", "Hide banner to view products"),
|
||||||
|
true,
|
||||||
|
StringResource("revanced_adremover_view_products_summary_on", "Banner is hidden"),
|
||||||
|
StringResource("revanced_adremover_view_products_summary_off", "Banner is shown")
|
||||||
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_adremover_movie",
|
"revanced_adremover_movie",
|
||||||
StringResource("revanced_adremover_movie_enabled_title", "Hide movies section"),
|
StringResource("revanced_adremover_movie_enabled_title", "Hide movies section"),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|||||||
import org.jf.dexlib2.AccessFlags
|
import org.jf.dexlib2.AccessFlags
|
||||||
import org.jf.dexlib2.Opcode
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
object MinimizedPlaybackKidsFingerprint : MethodFingerprint(
|
object KidsMinimizedPlaybackPolicyControllerFingerprint : MethodFingerprint(
|
||||||
"V",
|
"V",
|
||||||
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
listOf("I", "L", "L"),
|
listOf("I", "L", "L"),
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package app.revanced.patches.youtube.misc.minimizedplayback.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
object PipControllerFingerprint : MethodFingerprint(
|
||||||
|
returnType = "L",
|
||||||
|
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
parameters = listOf("L"),
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.IGET_BOOLEAN
|
||||||
|
),
|
||||||
|
customFingerprint = { it.definingClass.endsWith("DefaultPipController;") }
|
||||||
|
)
|
||||||
@@ -1,38 +1,46 @@
|
|||||||
package app.revanced.patches.youtube.misc.minimizedplayback.patch
|
package app.revanced.patches.youtube.misc.minimizedplayback.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.toErrorResult
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
import app.revanced.patcher.data.toMethodWalker
|
import app.revanced.patcher.data.toMethodWalker
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.extensions.instruction
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
import app.revanced.patcher.patch.PatchResult
|
import app.revanced.patcher.patch.PatchResult
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
|
||||||
import app.revanced.patches.youtube.misc.minimizedplayback.annotations.MinimizedPlaybackCompatibility
|
|
||||||
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.MinimizedPlaybackKidsFingerprint
|
|
||||||
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
|
|
||||||
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.MinimizedPlaybackSettingsFingerprint
|
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
|
import app.revanced.patches.youtube.misc.minimizedplayback.annotations.MinimizedPlaybackCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.KidsMinimizedPlaybackPolicyControllerFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.MinimizedPlaybackSettingsFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.PipControllerFingerprint
|
||||||
|
import app.revanced.patches.youtube.misc.playertype.patch.PlayerTypeHookPatch
|
||||||
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||||
|
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||||
import org.jf.dexlib2.iface.reference.MethodReference
|
import org.jf.dexlib2.iface.reference.MethodReference
|
||||||
|
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("minimized-playback")
|
@Name("minimized-playback")
|
||||||
@Description("Enables minimized and background playback.")
|
@Description("Enables minimized and background playback.")
|
||||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
@DependsOn([IntegrationsPatch::class, PlayerTypeHookPatch::class, SettingsPatch::class])
|
||||||
@MinimizedPlaybackCompatibility
|
@MinimizedPlaybackCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class MinimizedPlaybackPatch : BytecodePatch(
|
class MinimizedPlaybackPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
MinimizedPlaybackKidsFingerprint, MinimizedPlaybackManagerFingerprint, MinimizedPlaybackSettingsFingerprint
|
KidsMinimizedPlaybackPolicyControllerFingerprint,
|
||||||
|
MinimizedPlaybackManagerFingerprint,
|
||||||
|
MinimizedPlaybackSettingsFingerprint,
|
||||||
|
PipControllerFingerprint
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
@@ -46,15 +54,15 @@ class MinimizedPlaybackPatch : BytecodePatch(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Instead of removing all instructions like Vanced,
|
MinimizedPlaybackManagerFingerprint.result?.apply {
|
||||||
// we return the method at the beginning instead
|
mutableMethod.addInstructions(
|
||||||
MinimizedPlaybackManagerFingerprint.result!!.mutableMethod.addInstructions(
|
0, """
|
||||||
0, """
|
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->isMinimizedPlaybackEnabled()Z
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/MinimizedPlaybackPatch;->isMinimizedPlaybackEnabled()Z
|
|
||||||
move-result v0
|
move-result v0
|
||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
} ?: return MinimizedPlaybackManagerFingerprint.toErrorResult()
|
||||||
|
|
||||||
val method = MinimizedPlaybackSettingsFingerprint.result!!.mutableMethod
|
val method = MinimizedPlaybackSettingsFingerprint.result!!.mutableMethod
|
||||||
val booleanCalls = method.implementation!!.instructions.withIndex()
|
val booleanCalls = method.implementation!!.instructions.withIndex()
|
||||||
@@ -66,23 +74,42 @@ class MinimizedPlaybackPatch : BytecodePatch(
|
|||||||
|
|
||||||
settingsBooleanMethod.addInstructions(
|
settingsBooleanMethod.addInstructions(
|
||||||
0, """
|
0, """
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/MinimizedPlaybackPatch;->isMinimizedPlaybackEnabled()Z
|
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->isMinimizedPlaybackEnabled()Z
|
||||||
move-result v0
|
move-result v0
|
||||||
return v0
|
return v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
MinimizedPlaybackKidsFingerprint.result!!.mutableMethod.addInstructions(
|
KidsMinimizedPlaybackPolicyControllerFingerprint.result?.apply {
|
||||||
0, """
|
mutableMethod.addInstructions(
|
||||||
invoke-static {}, Lapp/revanced/integrations/patches/MinimizedPlaybackPatch;->isMinimizedPlaybackEnabled()Z
|
0, """
|
||||||
|
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->isMinimizedPlaybackEnabled()Z
|
||||||
move-result v0
|
move-result v0
|
||||||
if-eqz v0, :enable
|
if-eqz v0, :enable
|
||||||
return-void
|
return-void
|
||||||
:enable
|
:enable
|
||||||
nop
|
nop
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
} ?: return KidsMinimizedPlaybackPolicyControllerFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
PipControllerFingerprint.result?.apply {
|
||||||
|
val insertIndex = scanResult.patternScanResult!!.endIndex + 1
|
||||||
|
val pipEnabledRegister = (mutableMethod.instruction(insertIndex - 1) as TwoRegisterInstruction).registerA
|
||||||
|
|
||||||
|
mutableMethod.addInstructions(
|
||||||
|
insertIndex,
|
||||||
|
"""
|
||||||
|
invoke-static {v$pipEnabledRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->isNotPlayingShorts(Z)Z
|
||||||
|
move-result v$pipEnabledRegister
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
} ?: return PipControllerFingerprint.toErrorResult()
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/MinimizedPlaybackPatch;"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package app.revanced.patches.yuka.misc.unlockpremium.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("io.yuka.android")])
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
@Retention(AnnotationRetention.RUNTIME)
|
||||||
|
internal annotation class UnlockPremiumCompatibility
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package app.revanced.patches.yuka.misc.unlockpremium.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
import org.jf.dexlib2.Opcode
|
||||||
|
|
||||||
|
object IsPremiumFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Z",
|
||||||
|
access = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||||
|
opcodes = listOf(
|
||||||
|
Opcode.IGET_BOOLEAN,
|
||||||
|
Opcode.RETURN,
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.revanced.patches.yuka.misc.unlockpremium.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object YukaUserConstructorFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
access = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||||
|
strings = listOf(
|
||||||
|
"premiumProvider"
|
||||||
|
)
|
||||||
|
)
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package app.revanced.patches.yuka.misc.unlockpremium.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.yuka.misc.unlockpremium.annotations.UnlockPremiumCompatibility
|
||||||
|
import app.revanced.patches.yuka.misc.unlockpremium.fingerprints.IsPremiumFingerprint
|
||||||
|
import app.revanced.patches.yuka.misc.unlockpremium.fingerprints.YukaUserConstructorFingerprint
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("unlock-premium")
|
||||||
|
@Description("Unlocks premium features.")
|
||||||
|
@UnlockPremiumCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class UnlockPremiunPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
YukaUserConstructorFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
IsPremiumFingerprint.resolve(context,YukaUserConstructorFingerprint.result!!.classDef)
|
||||||
|
val method = IsPremiumFingerprint.result!!.mutableMethod
|
||||||
|
method.addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user