mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-22 10:23:55 +00:00
Compare commits
10 Commits
v2.175.0-d
...
v2.175.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63cb98912f | ||
|
|
c75a20e50b | ||
|
|
766bf46cdf | ||
|
|
148102f973 | ||
|
|
bacd6bfeb4 | ||
|
|
5f495c87c7 | ||
|
|
2a5c092b93 | ||
|
|
c6f03f2699 | ||
|
|
11159278ee | ||
|
|
d4c4552277 |
35
CHANGELOG.md
35
CHANGELOG.md
@@ -1,3 +1,38 @@
|
|||||||
|
# [2.175.0-dev.8](https://github.com/revanced/revanced-patches/compare/v2.175.0-dev.7...v2.175.0-dev.8) (2023-05-27)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **youtube/hide-shorts-components:** hide shorts info panel ([#2278](https://github.com/revanced/revanced-patches/issues/2278)) ([a5b323d](https://github.com/revanced/revanced-patches/commit/a5b323d1d9e5b175c93f0b29732eb1123b83bab7))
|
||||||
|
|
||||||
|
# [2.175.0-dev.7](https://github.com/revanced/revanced-patches/compare/v2.175.0-dev.6...v2.175.0-dev.7) (2023-05-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **remove-screen-capture-restriction:** remove app constraint ([#2260](https://github.com/revanced/revanced-patches/issues/2260)) ([49ce47c](https://github.com/revanced/revanced-patches/commit/49ce47c3eed6a1626674d0f60ae0fdbe349e804b))
|
||||||
|
|
||||||
|
# [2.175.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.175.0-dev.5...v2.175.0-dev.6) (2023-05-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/hide-shorts-components:** clarify settings switch ([#2276](https://github.com/revanced/revanced-patches/issues/2276)) ([3e6d052](https://github.com/revanced/revanced-patches/commit/3e6d0528b287ded401dacdcea698d4ec97b926ee))
|
||||||
|
|
||||||
|
# [2.175.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.175.0-dev.4...v2.175.0-dev.5) (2023-05-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **nfctoolsse:** add `unlock-pro` patch ([#2272](https://github.com/revanced/revanced-patches/issues/2272)) ([9789ad3](https://github.com/revanced/revanced-patches/commit/9789ad30ff82d9bb99e870dc8053775dc222a010))
|
||||||
|
|
||||||
|
# [2.175.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.175.0-dev.3...v2.175.0-dev.4) (2023-05-26)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **youtube/downloads:** rename patch to `external-downloads` ([#2274](https://github.com/revanced/revanced-patches/issues/2274)) ([4480911](https://github.com/revanced/revanced-patches/commit/4480911e0b056f2148616a0c2af6b4ab7c482c3b))
|
||||||
|
|
||||||
# [2.175.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.175.0-dev.2...v2.175.0-dev.3) (2023-05-25)
|
# [2.175.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.175.0-dev.2...v2.175.0-dev.3) (2023-05-25)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
29
README.md
29
README.md
@@ -20,8 +20,8 @@ The official ReVanced Patches.
|
|||||||
| `disable-player-popup-panels` | Disables panels from appearing automatically when going into fullscreen (playlist or live chat). | 18.19.35 |
|
| `disable-player-popup-panels` | Disables panels from appearing automatically when going into fullscreen (playlist or live chat). | 18.19.35 |
|
||||||
| `disable-shorts-on-startup` | Disables playing YouTube Shorts when launching YouTube. | 18.19.35 |
|
| `disable-shorts-on-startup` | Disables playing YouTube Shorts when launching YouTube. | 18.19.35 |
|
||||||
| `disable-zoom-haptics` | Disables haptics when zooming. | all |
|
| `disable-zoom-haptics` | Disables haptics when zooming. | all |
|
||||||
| `downloads` | Adds a download button to the YouTube video player. | 18.19.35 |
|
|
||||||
| `enable-debugging` | Adds debugging options. | all |
|
| `enable-debugging` | Adds debugging options. | all |
|
||||||
|
| `external-downloads` | Adds support to download and save YouTube videos using an external app. | 18.19.35 |
|
||||||
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 18.19.35 |
|
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | 18.19.35 |
|
||||||
| `hide-ads` | Removes general ads. | 18.19.35 |
|
| `hide-ads` | Removes general ads. | 18.19.35 |
|
||||||
| `hide-album-cards` | Hides the album cards below the artist description. | 18.19.35 |
|
| `hide-album-cards` | Hides the album cards below the artist description. | 18.19.35 |
|
||||||
@@ -151,16 +151,6 @@ The official ReVanced Patches.
|
|||||||
| `sanitize-sharing-links` | Removes (tracking) query parameters from the URLs when sharing links. | all |
|
| `sanitize-sharing-links` | Removes (tracking) query parameters from the URLs when sharing links. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### [📦 `com.spotify.music`](https://play.google.com/store/apps/details?id=com.spotify.music)
|
|
||||||
<details>
|
|
||||||
|
|
||||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
|
||||||
|:--------:|:--------------:|:-----------------:|
|
|
||||||
| `disable-capture-restriction` | Allows capturing Spotify's audio output while screen sharing or screen recording. | all |
|
|
||||||
| `hide-premium-navbar` | Removes the premium tab from the navbar. | all |
|
|
||||||
| `spotify-theme` | Applies a custom theme. | all |
|
|
||||||
</details>
|
|
||||||
|
|
||||||
### [📦 `com.facebook.orca`](https://play.google.com/store/apps/details?id=com.facebook.orca)
|
### [📦 `com.facebook.orca`](https://play.google.com/store/apps/details?id=com.facebook.orca)
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
@@ -171,6 +161,15 @@ The official ReVanced Patches.
|
|||||||
| `hide-inbox-ads` | Hides ads in inbox. | all |
|
| `hide-inbox-ads` | Hides ads in inbox. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### [📦 `com.spotify.music`](https://play.google.com/store/apps/details?id=com.spotify.music)
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `hide-premium-navbar` | Removes the premium tab from the navbar. | all |
|
||||||
|
| `spotify-theme` | Applies a custom theme. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
### [📦 `at.gv.bmf.bmf2go`](https://play.google.com/store/apps/details?id=at.gv.bmf.bmf2go)
|
### [📦 `at.gv.bmf.bmf2go`](https://play.google.com/store/apps/details?id=at.gv.bmf.bmf2go)
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
@@ -333,6 +332,14 @@ The official ReVanced Patches.
|
|||||||
| `unlock-pro` | Unlocks all pro features. | all |
|
| `unlock-pro` | Unlocks all pro features. | all |
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### [📦 `com.wakdev.apps.nfctools.se`](https://play.google.com/store/apps/details?id=com.wakdev.apps.nfctools.se)
|
||||||
|
<details>
|
||||||
|
|
||||||
|
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||||
|
|:--------:|:--------------:|:-----------------:|
|
||||||
|
| `unlock-pro` | Unlocks all pro features. | all |
|
||||||
|
</details>
|
||||||
|
|
||||||
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
|
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.175.0-dev.3
|
version = 2.175.0-dev.8
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,66 @@
|
|||||||
|
package app.revanced.patches.all.screencapture.removerestriction.bytecode.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patcher.patch.annotations.RequiresIntegrations
|
||||||
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
|
import app.revanced.patches.all.screencapture.removerestriction.resource.patch.RemoveCaptureRestrictionResourcePatch
|
||||||
|
import app.revanced.util.patch.*
|
||||||
|
import org.jf.dexlib2.iface.ClassDef
|
||||||
|
import org.jf.dexlib2.iface.Method
|
||||||
|
import org.jf.dexlib2.iface.instruction.Instruction
|
||||||
|
|
||||||
|
@Patch(false)
|
||||||
|
@Name("remove-screen-capture-restriction")
|
||||||
|
@Description("Removes the restriction of capturing audio from apps that normally wouldn't allow it.")
|
||||||
|
@Version("0.0.1")
|
||||||
|
@DependsOn([RemoveCaptureRestrictionResourcePatch::class])
|
||||||
|
@RequiresIntegrations
|
||||||
|
internal class RemoveCaptureRestrictionPatch : AbstractTransformInstructionsPatch<Instruction35cInfo>() {
|
||||||
|
// Information about method calls we want to replace
|
||||||
|
enum class MethodCall(
|
||||||
|
override val definedClassName: String,
|
||||||
|
override val methodName: String,
|
||||||
|
override val methodParams: Array<String>,
|
||||||
|
override val returnType: String
|
||||||
|
): IMethodCall {
|
||||||
|
SetAllowedCapturePolicySingle(
|
||||||
|
"Landroid/media/AudioAttributes\$Builder;",
|
||||||
|
"setAllowedCapturePolicy",
|
||||||
|
arrayOf("I"),
|
||||||
|
"Landroid/media/AudioAttributes\$Builder;",
|
||||||
|
),
|
||||||
|
SetAllowedCapturePolicyGlobal(
|
||||||
|
"Landroid/media/AudioManager;",
|
||||||
|
"setAllowedCapturePolicy",
|
||||||
|
arrayOf("I"),
|
||||||
|
"V",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun filterMap(
|
||||||
|
classDef: ClassDef,
|
||||||
|
method: Method,
|
||||||
|
instruction: Instruction,
|
||||||
|
instructionIndex: Int
|
||||||
|
) = filterMapInstruction35c<MethodCall>(
|
||||||
|
INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX,
|
||||||
|
classDef,
|
||||||
|
instruction,
|
||||||
|
instructionIndex
|
||||||
|
)
|
||||||
|
|
||||||
|
override fun transform(mutableMethod: MutableMethod, entry: Instruction35cInfo) {
|
||||||
|
val (methodType, instruction, instructionIndex) = entry
|
||||||
|
methodType.replaceInvokeVirtualWithIntegrations(INTEGRATIONS_CLASS_DESCRIPTOR, mutableMethod, instruction, instructionIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
const val INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX =
|
||||||
|
"Lapp/revanced/all/screencapture/removerestriction/RemoveScreencaptureRestrictionPatch"
|
||||||
|
const val INTEGRATIONS_CLASS_DESCRIPTOR = "$INTEGRATIONS_CLASS_DESCRIPTOR_PREFIX;"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package app.revanced.patches.spotify.audio.resource.patch
|
package app.revanced.patches.all.screencapture.removerestriction.resource.patch
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
import app.revanced.patcher.annotation.Description
|
||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
@@ -7,14 +7,12 @@ import app.revanced.patcher.data.ResourceContext
|
|||||||
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.ResourcePatch
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
import app.revanced.patches.spotify.audio.annotation.DisableCaptureRestrictionCompatibility
|
|
||||||
import org.w3c.dom.Element
|
import org.w3c.dom.Element
|
||||||
|
|
||||||
@Name("disable-capture-restriction-resource-patch")
|
@Name("remove-screen-capture-restriction-resource-patch")
|
||||||
@Description("Sets allowAudioPlaybackCapture in manifest to true.")
|
@Description("Sets allowAudioPlaybackCapture in manifest to true.")
|
||||||
@DisableCaptureRestrictionCompatibility
|
@Version("0.0.1")
|
||||||
@Version("0.0.2")
|
internal class RemoveCaptureRestrictionResourcePatch : ResourcePatch {
|
||||||
class DisableCaptureRestrictionResourcePatch : ResourcePatch {
|
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
// create an xml editor instance
|
// create an xml editor instance
|
||||||
context.xmlEditor["AndroidManifest.xml"].use { dom ->
|
context.xmlEditor["AndroidManifest.xml"].use { dom ->
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package app.revanced.patches.nfctoolsse.misc.pro.annotations
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Compatibility
|
||||||
|
import app.revanced.patcher.annotation.Package
|
||||||
|
|
||||||
|
@Compatibility([Package("com.wakdev.apps.nfctools.se")])
|
||||||
|
@Target(AnnotationTarget.CLASS)
|
||||||
|
internal annotation class UnlockProCompatibility
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package app.revanced.patches.nfctoolsse.misc.pro.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object IsLicenseRegisteredFingerprint : MethodFingerprint(
|
||||||
|
returnType = "Z",
|
||||||
|
accessFlags = AccessFlags.PUBLIC.value,
|
||||||
|
strings = listOf("kLicenseCheck")
|
||||||
|
)
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package app.revanced.patches.nfctoolsse.misc.pro.patch
|
||||||
|
|
||||||
|
import app.revanced.extensions.toErrorResult
|
||||||
|
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.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.nfctoolsse.misc.pro.annotations.UnlockProCompatibility
|
||||||
|
import app.revanced.patches.nfctoolsse.misc.pro.fingerprints.IsLicenseRegisteredFingerprint
|
||||||
|
|
||||||
|
|
||||||
|
@Patch
|
||||||
|
@Name("unlock-pro")
|
||||||
|
@Description("Unlocks all pro features.")
|
||||||
|
@Version("0.0.1")
|
||||||
|
@UnlockProCompatibility
|
||||||
|
class UnlockProPatch : BytecodePatch(
|
||||||
|
listOf(
|
||||||
|
IsLicenseRegisteredFingerprint
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
|
IsLicenseRegisteredFingerprint.result?.mutableMethod?.apply {
|
||||||
|
addInstructions(
|
||||||
|
0,
|
||||||
|
"""
|
||||||
|
const/4 v0, 0x1
|
||||||
|
return v0
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
} ?: return IsLicenseRegisteredFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package app.revanced.patches.spotify.audio.annotation
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility(
|
|
||||||
[Package("com.spotify.music")]
|
|
||||||
)
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
internal annotation class DisableCaptureRestrictionCompatibility
|
|
||||||
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
package app.revanced.patches.spotify.audio.bytecode.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.instruction
|
|
||||||
import app.revanced.patcher.extensions.replaceInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.spotify.audio.annotation.DisableCaptureRestrictionCompatibility
|
|
||||||
import app.revanced.patches.spotify.audio.fingerprints.DisableCaptureRestrictionAudioDriverFingerprint
|
|
||||||
import app.revanced.patches.spotify.audio.resource.patch.DisableCaptureRestrictionResourcePatch
|
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("disable-capture-restriction")
|
|
||||||
@DependsOn([DisableCaptureRestrictionResourcePatch::class])
|
|
||||||
@Description("Allows capturing Spotify's audio output while screen sharing or screen recording.")
|
|
||||||
@DisableCaptureRestrictionCompatibility
|
|
||||||
@Version("0.0.2")
|
|
||||||
class DisableCaptureRestrictionBytecodePatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
DisableCaptureRestrictionAudioDriverFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
|
||||||
val method = DisableCaptureRestrictionAudioDriverFingerprint.result!!.mutableMethod
|
|
||||||
|
|
||||||
method.apply {
|
|
||||||
// Replace constant
|
|
||||||
val original = instruction(0) as OneRegisterInstruction
|
|
||||||
replaceInstruction(
|
|
||||||
0,
|
|
||||||
"const/4 v${original.registerA}, $ALLOW_CAPTURE_BY_ALL"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
|
|
||||||
private companion object {
|
|
||||||
const val ALLOW_CAPTURE_BY_ALL = 0x01
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package app.revanced.patches.spotify.audio.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
|
|
||||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
|
||||||
import org.jf.dexlib2.iface.reference.MethodReference
|
|
||||||
|
|
||||||
object DisableCaptureRestrictionAudioDriverFingerprint : MethodFingerprint(
|
|
||||||
"L",
|
|
||||||
AccessFlags.PUBLIC or AccessFlags.STATIC or AccessFlags.SYNTHETIC or AccessFlags.BRIDGE,
|
|
||||||
listOf("L"),
|
|
||||||
listOf(
|
|
||||||
Opcode.CONST_4,
|
|
||||||
Opcode.INVOKE_VIRTUAL,
|
|
||||||
Opcode.MOVE_RESULT_OBJECT,
|
|
||||||
Opcode.RETURN_OBJECT
|
|
||||||
),
|
|
||||||
customFingerprint = { methodDef, _ ->
|
|
||||||
// Check for method call to AudioAttributes$Builder.setAllowedCapturePolicy Android API
|
|
||||||
methodDef.implementation?.instructions?.any {
|
|
||||||
((it as? ReferenceInstruction)?.reference as? MethodReference)?.name == "setAllowedCapturePolicy"
|
|
||||||
} == true
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -5,5 +5,5 @@ import app.revanced.patcher.annotation.Package
|
|||||||
|
|
||||||
@Compatibility([Package("com.google.android.youtube", arrayOf("18.16.37", "18.19.35"))])
|
@Compatibility([Package("com.google.android.youtube", arrayOf("18.16.37", "18.19.35"))])
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
internal annotation class DownloadsCompatibility
|
internal annotation class ExternalDownloadsCompatibility
|
||||||
|
|
||||||
@@ -9,20 +9,20 @@ 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.patches.youtube.interaction.downloads.annotation.DownloadsCompatibility
|
import app.revanced.patches.youtube.interaction.downloads.annotation.ExternalDownloadsCompatibility
|
||||||
import app.revanced.patches.youtube.interaction.downloads.resource.patch.DownloadsResourcePatch
|
import app.revanced.patches.youtube.interaction.downloads.resource.patch.ExternalDownloadsResourcePatch
|
||||||
import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch
|
import app.revanced.patches.youtube.misc.playercontrols.bytecode.patch.PlayerControlsBytecodePatch
|
||||||
import app.revanced.patches.youtube.video.information.patch.VideoInformationPatch
|
import app.revanced.patches.youtube.video.information.patch.VideoInformationPatch
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@Name("downloads")
|
@Name("external-downloads")
|
||||||
@DependsOn([DownloadsResourcePatch::class, PlayerControlsBytecodePatch::class, VideoInformationPatch::class])
|
@DependsOn([ExternalDownloadsResourcePatch::class, PlayerControlsBytecodePatch::class, VideoInformationPatch::class])
|
||||||
@Description("Adds a download button to the YouTube video player.")
|
@Description("Adds support to download and save YouTube videos using an external app.")
|
||||||
@DownloadsCompatibility
|
@ExternalDownloadsCompatibility
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class DownloadsBytecodePatch : BytecodePatch() {
|
class ExternalDownloadsBytecodePatch : BytecodePatch() {
|
||||||
private companion object {
|
private companion object {
|
||||||
const val BUTTON_DESCRIPTOR = "Lapp/revanced/integrations/videoplayer/DownloadButton;"
|
const val BUTTON_DESCRIPTOR = "Lapp/revanced/integrations/videoplayer/ExternalDownloadButton;"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun execute(context: BytecodeContext): PatchResult {
|
override fun execute(context: BytecodeContext): PatchResult {
|
||||||
@@ -14,50 +14,42 @@ import app.revanced.util.resources.ResourceUtils
|
|||||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||||
import app.revanced.util.resources.ResourceUtils.mergeStrings
|
import app.revanced.util.resources.ResourceUtils.mergeStrings
|
||||||
|
|
||||||
@Name("downloads-resource-patch")
|
@Name("external-downloads-resource-patch")
|
||||||
@DependsOn([BottomControlsResourcePatch::class, SettingsPatch::class])
|
@DependsOn([BottomControlsResourcePatch::class, SettingsPatch::class])
|
||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class DownloadsResourcePatch : ResourcePatch {
|
class ExternalDownloadsResourcePatch : ResourcePatch {
|
||||||
|
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||||
PreferenceScreen(
|
PreferenceScreen(
|
||||||
"revanced_external_downloader_preference_screen",
|
"revanced_external_downloader_preference_screen",
|
||||||
StringResource("revanced_external_downloader_preference_screen_title", "Download settings"),
|
StringResource("revanced_external_downloader_preference_screen_title", "External download settings"),
|
||||||
listOf(
|
listOf(
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_external_downloader",
|
"revanced_external_downloader",
|
||||||
StringResource("revanced_external_downloader_title", "Show download button"),
|
StringResource("revanced_external_downloader_title", "Show external download button"),
|
||||||
StringResource("revanced_external_downloader_summary_on", "Download button is shown"),
|
StringResource("revanced_external_downloader_summary_on", "Download button shown in player"),
|
||||||
StringResource("revanced_external_downloader_summary_off", "Download button is not shown")
|
StringResource("revanced_external_downloader_summary_off", "Download button not shown in player")
|
||||||
),
|
),
|
||||||
TextPreference(
|
TextPreference(
|
||||||
"revanced_external_downloader_name",
|
"revanced_external_downloader_name",
|
||||||
StringResource("revanced_external_downloader_name_title", "Downloader package name"),
|
StringResource("revanced_external_downloader_name_title", "Downloader package name"),
|
||||||
StringResource("revanced_external_downloader_name_summary", "Package name of the downloader app such as NewPipe\\'s or PowerTube\\'s"),
|
StringResource("revanced_external_downloader_name_summary", "Package name of your installed external downloader app, such as NewPipe or PowerTube"),
|
||||||
InputType.TEXT
|
InputType.TEXT
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
StringResource("revanced_external_downloader_preference_screen_summary", "Settings related to downloads")
|
StringResource("revanced_external_downloader_preference_screen_summary", "Settings for using an external downloader")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
/*
|
// Copy strings
|
||||||
* Copy strings
|
|
||||||
*/
|
|
||||||
|
|
||||||
context.mergeStrings("downloads/host/values/strings.xml")
|
context.mergeStrings("downloads/host/values/strings.xml")
|
||||||
|
|
||||||
/*
|
// Copy resources
|
||||||
* Copy resources
|
|
||||||
*/
|
|
||||||
|
|
||||||
context.copyResources("downloads", ResourceUtils.ResourceGroup("drawable", "revanced_yt_download_button.xml"))
|
context.copyResources("downloads", ResourceUtils.ResourceGroup("drawable", "revanced_yt_download_button.xml"))
|
||||||
|
|
||||||
/*
|
// Add download button node
|
||||||
* Add download button node
|
|
||||||
*/
|
|
||||||
|
|
||||||
BottomControlsResourcePatch.addControls("downloads/host/layout/${BottomControlsResourcePatch.TARGET_RESOURCE_NAME}")
|
BottomControlsResourcePatch.addControls("downloads/host/layout/${BottomControlsResourcePatch.TARGET_RESOURCE_NAME}")
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
@@ -18,12 +18,12 @@ class HideShortsComponentsResourcePatch : ResourcePatch {
|
|||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||||
PreferenceScreen(
|
PreferenceScreen(
|
||||||
"revanced_shorts",
|
"revanced_shorts_preference_screen",
|
||||||
StringResource("revanced_shorts_title", "Shorts components"),
|
StringResource("revanced_shorts_preference_screen_title", "Shorts components"),
|
||||||
listOf(
|
listOf(
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_hide_shorts",
|
"revanced_hide_shorts",
|
||||||
StringResource("revanced_hide_shorts_enabled_title", "Hide shorts"),
|
StringResource("revanced_hide_shorts_title", "Hide shorts in feed"),
|
||||||
StringResource("revanced_hide_shorts_on", "Shorts are hidden"),
|
StringResource("revanced_hide_shorts_on", "Shorts are hidden"),
|
||||||
StringResource("revanced_hide_shorts_off", "Shorts are shown")
|
StringResource("revanced_hide_shorts_off", "Shorts are shown")
|
||||||
),
|
),
|
||||||
@@ -63,6 +63,12 @@ class HideShortsComponentsResourcePatch : ResourcePatch {
|
|||||||
StringResource("revanced_hide_shorts_share_button_on", "Share button is hidden"),
|
StringResource("revanced_hide_shorts_share_button_on", "Share button is hidden"),
|
||||||
StringResource("revanced_hide_shorts_share_button_off", "Share button is shown")
|
StringResource("revanced_hide_shorts_share_button_off", "Share button is shown")
|
||||||
),
|
),
|
||||||
|
SwitchPreference(
|
||||||
|
"revanced_hide_shorts_info_panel",
|
||||||
|
StringResource("revanced_hide_shorts_info_panel_title", "Hide info panel"),
|
||||||
|
StringResource("revanced_hide_shorts_info_panel_on", "Info panel is hidden"),
|
||||||
|
StringResource("revanced_hide_shorts_info_panel_off", "Info panel is shown")
|
||||||
|
),
|
||||||
SwitchPreference(
|
SwitchPreference(
|
||||||
"revanced_hide_shorts_navigation_bar",
|
"revanced_hide_shorts_navigation_bar",
|
||||||
StringResource("revanced_hide_shorts_navigation_bar_title", "Hide navigation bar"),
|
StringResource("revanced_hide_shorts_navigation_bar_title", "Hide navigation bar"),
|
||||||
@@ -70,7 +76,7 @@ class HideShortsComponentsResourcePatch : ResourcePatch {
|
|||||||
StringResource("revanced_hide_shorts_navigation_bar_off", "Navigation bar is shown")
|
StringResource("revanced_hide_shorts_navigation_bar_off", "Navigation bar is shown")
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
StringResource("revanced_shorts_summary", "Manage the visibility of Shorts components")
|
StringResource("revanced_shorts_preference_screen_summary", "Manage the visibility of Shorts components")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:yt="http://schemas.android.com/apk/res-auto" android:id="@+id/youtube_controls_bottom_ui_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:layoutDirection="ltr">
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:yt="http://schemas.android.com/apk/res-auto" android:id="@+id/youtube_controls_bottom_ui_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:layoutDirection="ltr">
|
||||||
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/download_button" android:paddingLeft="12dp" android:paddingTop="22dp" android:paddingRight="12dp" android:paddingBottom="16dp" android:longClickable="false" android:layout_width="60dp" android:layout_height="60dp" android:src="@drawable/revanced_yt_download_button" android:scaleType="center" yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" yt:layout_constraintRight_toLeftOf="@+id/fullscreen_button" style="@style/YouTubePlayerButton"/>
|
<com.google.android.libraries.youtube.common.ui.TouchImageView android:id="@+id/external_download_button" android:paddingLeft="12dp" android:paddingTop="22dp" android:paddingRight="12dp" android:paddingBottom="16dp" android:longClickable="false" android:layout_width="60dp" android:layout_height="60dp" android:src="@drawable/revanced_yt_download_button" android:scaleType="center" yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" yt:layout_constraintRight_toLeftOf="@+id/fullscreen_button" style="@style/YouTubePlayerButton"/>
|
||||||
</android.support.constraint.ConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="downloader_not_installed_warning">is not installed. Please install it.</string>
|
<string name="external_downloader_not_installed_warning">is not installed. Please install it.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user