mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2024-11-10 01:01:56 +01:00
chore: Merge branch dev
to main
(#3319)
This commit is contained in:
commit
d6f0cdb50b
21 changed files with 6680 additions and 2024 deletions
5
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
5
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
|
@ -8,9 +8,8 @@ body:
|
|||
value: |
|
||||
# ReVanced Patches bug report
|
||||
|
||||
Please check for existing bug reports
|
||||
[here](https://github.com/ReVanced/revanced-patches/labels/Bug%20report)
|
||||
before creating a new one.
|
||||
Please check for existing bug reports [here](https://github.com/ReVanced/revanced-patches/labels/Bug%20report) before creating a new one.
|
||||
Review the [contribution guidelines](https://github.com/ReVanced/revanced-patches/blob/main/CONTRIBUTING.md) before submitting a bug report.
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
|
|
6
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
6
.github/ISSUE_TEMPLATE/feature-request.yml
vendored
|
@ -8,9 +8,9 @@ body:
|
|||
value: |
|
||||
# ReVanced Patches feature request
|
||||
|
||||
Please check for existing feature requests
|
||||
[here](https://github.com/ReVanced/revanced-patches/labels/Feature%20request)
|
||||
before creating a new one.
|
||||
Please check for existing feature requests [here](https://github.com/ReVanced/revanced-patches/labels/Feature%20request) before creating a new one.
|
||||
Review the [contribution guidelines](https://github.com/ReVanced/revanced-patches/blob/main/CONTRIBUTING.md) before submitting a feature request.
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Feature description
|
||||
|
|
2
.github/config.yml
vendored
2
.github/config.yml
vendored
|
@ -1,2 +1,2 @@
|
|||
firstPRMergeComment: >
|
||||
Thank you for contributing to ReVanced. Join us on [Discord](https://revanced.app/discord) if you want to receive a contributor role.
|
||||
Thank you for contributing to ReVanced. Join us on [Discord](https://revanced.app/discord) to receive a role for your contribution.
|
||||
|
|
1
.github/workflows/pull_request.yml
vendored
1
.github/workflows/pull_request.yml
vendored
|
@ -16,6 +16,7 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Open pull request
|
||||
uses: repo-sync/pull-request@v2
|
||||
with:
|
||||
|
|
14
.github/workflows/release.yml
vendored
14
.github/workflows/release.yml
vendored
|
@ -23,21 +23,25 @@ jobs:
|
|||
# https://github.com/cycjimmy/semantic-release-action#private-packages
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
- name: Cache
|
||||
|
||||
- name: Cache Node modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
${{ runner.home }}/.gradle/caches
|
||||
${{ runner.home }}/.gradle/wrapper
|
||||
.gradle
|
||||
node_modules
|
||||
key: ${{ runner.os }}-gradle-npm-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'package-lock.json') }}
|
||||
key: npm-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- name: Cache Gradle
|
||||
uses: burrunan/gradle-cache-action@v1
|
||||
|
||||
- name: Build with Gradle
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./gradlew generateMeta clean
|
||||
|
||||
- name: Setup semantic-release
|
||||
run: npm install
|
||||
|
||||
- name: Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
|
||||
|
|
22
CHANGELOG.md
22
CHANGELOG.md
|
@ -1,3 +1,25 @@
|
|||
# [2.200.0-dev.3](https://github.com/ReVanced/revanced-patches/compare/v2.200.0-dev.2...v2.200.0-dev.3) (2023-11-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **YouTube - Remove tracking query parameter:** Sanitize shared URLs in remaining places ([2442902](https://github.com/ReVanced/revanced-patches/commit/2442902dacc25f2c932a6689e9788e5a02fdff6b))
|
||||
|
||||
# [2.200.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v2.200.0-dev.1...v2.200.0-dev.2) (2023-11-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Spotify - Custom theme:** Add more background surfaces coloring options ([#3285](https://github.com/ReVanced/revanced-patches/issues/3285)) ([869ec26](https://github.com/ReVanced/revanced-patches/commit/869ec26966f7750c45355ac0acc18b81a2abce87))
|
||||
|
||||
# [2.200.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v2.199.0...v2.200.0-dev.1) (2023-11-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **Twitch:** Constrain patches to versions known to work ([65b55a5](https://github.com/ReVanced/revanced-patches/commit/65b55a5189df52dc7e99b7e9c68b908fbca92434))
|
||||
* **Twitch:** Support version `16.9.1` ([c70e4a6](https://github.com/ReVanced/revanced-patches/commit/c70e4a66bd65b42db88dcabd412ec985226bd1e7))
|
||||
|
||||
# [2.199.0](https://github.com/ReVanced/revanced-patches/compare/v2.198.0...v2.199.0) (2023-11-20)
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
org.gradle.parallel = true
|
||||
org.gradle.caching = true
|
||||
kotlin.code.style = official
|
||||
version = 2.199.0
|
||||
version = 2.200.0-dev.3
|
||||
|
|
7
gradle/wrapper/gradle-wrapper.properties
vendored
7
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,7 +1,6 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
zipStorePath=wrapper/dist
|
8499
package-lock.json
generated
8499
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"devDependencies": {
|
||||
"@saithodev/semantic-release-backmerge": "^3.1.0",
|
||||
"@semantic-release/changelog": "^6.0.2",
|
||||
"@saithodev/semantic-release-backmerge": "^3.2.1",
|
||||
"@semantic-release/changelog": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"gradle-semantic-release-plugin": "^1.7.6",
|
||||
"semantic-release": "^20.1.0"
|
||||
"gradle-semantic-release-plugin": "^1.8.0",
|
||||
"semantic-release": "^22.0.8"
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,9 @@
|
|||
include("dummy")
|
||||
|
||||
rootProject.name = "revanced-patches"
|
||||
|
||||
buildCache {
|
||||
local {
|
||||
isEnabled = !System.getenv().containsKey("CI")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,25 +17,42 @@ object CustomThemePatch : ResourcePatch() {
|
|||
private var backgroundColor by stringPatchOption(
|
||||
key = "backgroundColor",
|
||||
default = "@android:color/black",
|
||||
title = "Background color",
|
||||
title = "Primary background color",
|
||||
description = "The background color. Can be a hex color or a resource reference.",
|
||||
required = true
|
||||
)
|
||||
|
||||
private var backgroundColorSecondary by stringPatchOption(
|
||||
key = "backgroundColorSecondary",
|
||||
default = "#ff282828",
|
||||
title = "Secondary background color",
|
||||
description = "The secondary background color. Can be a hex color or a resource reference.",
|
||||
required = true
|
||||
)
|
||||
|
||||
private var accentColor by stringPatchOption(
|
||||
key = "accentColor",
|
||||
default = "#ff1ed760",
|
||||
title = "Accent color",
|
||||
description = "The accent color ('spotify green' by default). Can be a hex color or a resource reference.",
|
||||
description = "The accent color ('Spotify green' by default). Can be a hex color or a resource reference.",
|
||||
required = true
|
||||
)
|
||||
|
||||
private var accentPressedColor by stringPatchOption(
|
||||
key = "accentPressedColor",
|
||||
private var accentColorPressed by stringPatchOption(
|
||||
key = "accentColorPressed",
|
||||
default = "#ff169c46",
|
||||
title = "Pressed accent for the dark theme",
|
||||
description = "The color when accented buttons are pressed, by default slightly darker than accent. Can be a hex color or a resource reference."
|
||||
title = "Pressed dark theme accent color",
|
||||
description = "The color when accented buttons are pressed, by default slightly darker than accent. "
|
||||
+ "Can be a hex color or a resource reference.",
|
||||
required = true
|
||||
)
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
val backgroundColor = backgroundColor!!
|
||||
val backgroundColorSecondary = backgroundColorSecondary!!
|
||||
val accentColor = accentColor!!
|
||||
val accentColorPressed = accentColorPressed!!
|
||||
|
||||
context.xmlEditor["res/values/colors.xml"].use { editor ->
|
||||
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
|
||||
|
||||
|
@ -43,12 +60,18 @@ object CustomThemePatch : ResourcePatch() {
|
|||
val node = resourcesNode.childNodes.item(i) as? Element ?: continue
|
||||
|
||||
node.textContent = when (node.getAttribute("name")) {
|
||||
"gray_7" -> backgroundColor!!
|
||||
"dark_brightaccent_background_base", "dark_base_text_brightaccent", "green_light" -> accentColor!!
|
||||
"dark_brightaccent_background_press" -> accentPressedColor!!
|
||||
"dark_base_background_elevated_base", "design_dark_default_color_background",
|
||||
"design_dark_default_color_surface", "gray_7", "gray_background", "gray_layer",
|
||||
"sthlm_blk" -> backgroundColor
|
||||
|
||||
"gray_15" -> backgroundColorSecondary
|
||||
|
||||
"dark_brightaccent_background_base", "dark_base_text_brightaccent", "green_light" -> accentColor
|
||||
|
||||
"dark_brightaccent_background_press" -> accentColorPressed
|
||||
else -> continue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ import app.revanced.patches.twitch.misc.settings.SettingsPatch
|
|||
name = "Block audio ads",
|
||||
description = "Blocks audio ads in streams and VODs.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "17.0.0", "17.1.0"])],
|
||||
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "16.9.1"])],
|
||||
)
|
||||
@Suppress("unused")
|
||||
object AudioAdsPatch : BytecodePatch(
|
||||
|
|
|
@ -18,7 +18,7 @@ import app.revanced.patches.twitch.misc.settings.SettingsPatch
|
|||
name = "Block embedded ads",
|
||||
description = "Blocks embedded stream ads using services like Luminous or PurpleAdBlocker.",
|
||||
dependencies = [VideoAdsPatch::class, IntegrationsPatch::class, SettingsPatch::class],
|
||||
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "17.0.0", "17.1.0"])]
|
||||
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "16.9.1"])]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object EmbeddedAdsPatch : BytecodePatch(
|
||||
|
|
|
@ -21,7 +21,7 @@ import app.revanced.patches.twitch.misc.settings.SettingsPatch
|
|||
name = "Block video ads",
|
||||
description = "Blocks video ads in streams and VODs.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "17.0.0", "17.1.0"])]
|
||||
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "16.9.1"])]
|
||||
)
|
||||
object VideoAdsPatch : AbstractAdPatch(
|
||||
"Lapp/revanced/twitch/patches/VideoAdsPatch;->shouldBlockVideoAds()Z",
|
||||
|
|
|
@ -22,7 +22,7 @@ import app.revanced.patches.twitch.misc.settings.SettingsPatch
|
|||
name = "Show deleted messages",
|
||||
description = "Shows deleted chat messages behind a clickable spoiler.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "17.0.0", "17.1.0"])]
|
||||
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "16.9.1"])]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object ShowDeletedMessagesPatch : BytecodePatch(
|
||||
|
|
|
@ -17,7 +17,7 @@ import app.revanced.patches.twitch.misc.settings.SettingsPatch
|
|||
name = "Auto claim channel points",
|
||||
description = "Automatically claim Channel Points.",
|
||||
dependencies = [SettingsPatch::class],
|
||||
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "17.0.0", "17.1.0"])]
|
||||
compatiblePackages = [CompatiblePackage("tv.twitch.android.app", ["15.4.1", "16.1.0", "16.9.1"])]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object AutoClaimChannelPointPatch : BytecodePatch(
|
||||
|
|
|
@ -1,16 +1,23 @@
|
|||
package app.revanced.patches.youtube.misc.privacy
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprintResult.MethodFingerprintScanResult.PatternScanResult
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.privacy.fingerprints.CopyTextFingerprint
|
||||
import app.revanced.patches.youtube.misc.privacy.fingerprints.SystemShareSheetFingerprint
|
||||
import app.revanced.patches.youtube.misc.privacy.fingerprints.YouTubeShareSheetFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
|
@ -30,7 +37,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
|||
)
|
||||
@Suppress("unused")
|
||||
object RemoveTrackingQueryParameterPatch : BytecodePatch(
|
||||
setOf(CopyTextFingerprint)
|
||||
setOf(CopyTextFingerprint, SystemShareSheetFingerprint, YouTubeShareSheetFingerprint)
|
||||
) {
|
||||
const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/patches/RemoveTrackingQueryParameterPatch;"
|
||||
|
||||
|
@ -53,21 +60,31 @@ object RemoveTrackingQueryParameterPatch : BytecodePatch(
|
|||
)
|
||||
)
|
||||
|
||||
CopyTextFingerprint.result?.let {
|
||||
val insertIndex = it.scanResult.patternScanResult!!.startIndex + 2
|
||||
fun MethodFingerprint.hook(
|
||||
getInsertIndex: PatternScanResult.() -> Int,
|
||||
getUrlRegister: MutableMethod.(insertIndex: Int) -> Int
|
||||
) = result?.let {
|
||||
val insertIndex = it.scanResult.patternScanResult!!.getInsertIndex()
|
||||
val urlRegister = it.mutableMethod.getUrlRegister(insertIndex)
|
||||
|
||||
it.mutableMethod.apply {
|
||||
val urlRegister = getInstruction<TwoRegisterInstruction>(insertIndex - 2).registerA
|
||||
it.mutableMethod.addInstructions(
|
||||
insertIndex,
|
||||
"""
|
||||
invoke-static {v$urlRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->sanitize(Ljava/lang/String;)Ljava/lang/String;
|
||||
move-result-object v$urlRegister
|
||||
"""
|
||||
)
|
||||
} ?: throw exception
|
||||
|
||||
addInstructions(
|
||||
insertIndex,
|
||||
"""
|
||||
invoke-static {v$urlRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->sanitize(Ljava/lang/String;)Ljava/lang/String;
|
||||
move-result-object v$urlRegister
|
||||
"""
|
||||
)
|
||||
}
|
||||
// Native YouTube share sheet.
|
||||
YouTubeShareSheetFingerprint.hook(getInsertIndex = { startIndex + 1 })
|
||||
{ insertIndex -> getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA }
|
||||
|
||||
}
|
||||
// Native system share sheet.
|
||||
SystemShareSheetFingerprint.hook(getInsertIndex = { endIndex })
|
||||
{ insertIndex -> getInstruction<OneRegisterInstruction>(insertIndex - 1).registerA }
|
||||
|
||||
CopyTextFingerprint.hook(getInsertIndex = { startIndex + 2 })
|
||||
{ insertIndex -> getInstruction<TwoRegisterInstruction>(insertIndex - 2).registerA }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package app.revanced.patches.youtube.misc.privacy.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object SystemShareSheetFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
parameters = listOf("L", "Ljava/util/Map;"),
|
||||
opcodes = listOf(
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.GOTO
|
||||
),
|
||||
strings = listOf("YTShare_Logging_Share_Intent_Endpoint_Byte_Array")
|
||||
)
|
|
@ -0,0 +1,18 @@
|
|||
package app.revanced.patches.youtube.misc.privacy.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
object YouTubeShareSheetFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("L", "Ljava/util/Map;"),
|
||||
opcodes = listOf(
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.GOTO,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
)
|
||||
)
|
Loading…
Reference in a new issue