mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-25 19:51:03 +00:00
Compare commits
10 Commits
v2.188.0-d
...
v2.188.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d20ed857c | ||
|
|
eb20cc477f | ||
|
|
d002eaaca6 | ||
|
|
aef68134b5 | ||
|
|
5deaa6476f | ||
|
|
78d831fc63 | ||
|
|
46809c3819 | ||
|
|
8f559ca170 | ||
|
|
48ea11f571 | ||
|
|
2ff3400ef1 |
35
CHANGELOG.md
35
CHANGELOG.md
@@ -1,3 +1,38 @@
|
|||||||
|
# [2.188.0-dev.14](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.13...v2.188.0-dev.14) (2023-08-13)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* allow using `PreferenceScreen` outside of current module ([fe94013](https://github.com/ReVanced/revanced-patches/commit/fe94013a2235953b32fed6e0710a252698a264b3))
|
||||||
|
|
||||||
|
# [2.188.0-dev.13](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.12...v2.188.0-dev.13) (2023-08-13)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **YouTube - External downloads:** Recommend Seal instead of PowerTube ([#2803](https://github.com/ReVanced/revanced-patches/issues/2803)) ([082e067](https://github.com/ReVanced/revanced-patches/commit/082e067338026d05046ed5f398a1261aa20d3cb3))
|
||||||
|
|
||||||
|
# [2.188.0-dev.12](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.11...v2.188.0-dev.12) (2023-08-10)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Add `Override certificate pinning` patch ([#2781](https://github.com/ReVanced/revanced-patches/issues/2781)) ([94ed738](https://github.com/ReVanced/revanced-patches/commit/94ed738515aa6e1a1d346b85b54805e68e36f94c))
|
||||||
|
|
||||||
|
# [2.188.0-dev.11](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.10...v2.188.0-dev.11) (2023-08-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **Client spoof:** Remove exception from option ([9c69f87](https://github.com/ReVanced/revanced-patches/commit/9c69f876902496c101eac295e581c15e02bfaf29))
|
||||||
|
|
||||||
|
# [2.188.0-dev.10](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.9...v2.188.0-dev.10) (2023-08-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **Tasker:** Remove `Unlock trial` patch ([8354a87](https://github.com/ReVanced/revanced-patches/commit/8354a879cfc6028820e2bb0e01d6f607e145c0f6))
|
||||||
|
|
||||||
# [2.188.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.8...v2.188.0-dev.9) (2023-08-07)
|
# [2.188.0-dev.9](https://github.com/ReVanced/revanced-patches/compare/v2.188.0-dev.8...v2.188.0-dev.9) (2023-08-07)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
version = 2.188.0-dev.9
|
version = 2.188.0-dev.14
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,79 @@
|
|||||||
|
package app.revanced.patches.all.misc.network.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.*
|
||||||
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.all.misc.debugging.patch.EnableAndroidDebuggingPatch
|
||||||
|
import org.w3c.dom.Element
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
@Patch(false)
|
||||||
|
@Name("Override certificate pinning")
|
||||||
|
@Description("Overrides certificate pinning, allowing to inspect traffic via a proxy.")
|
||||||
|
@DependsOn([EnableAndroidDebuggingPatch::class])
|
||||||
|
class OverrideCertificatePinningPatch : ResourcePatch {
|
||||||
|
|
||||||
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
|
val resXmlDirectory = context["res/xml"]
|
||||||
|
|
||||||
|
// Add android:networkSecurityConfig="@xml/network_security_config" and the "networkSecurityConfig" attribute if it does not exist.
|
||||||
|
context.xmlEditor["AndroidManifest.xml"].use { editor ->
|
||||||
|
val document = editor.file
|
||||||
|
val applicationNode = document.getElementsByTagName("application").item(0) as Element
|
||||||
|
|
||||||
|
if (!applicationNode.hasAttribute("networkSecurityConfig")) {
|
||||||
|
document.createAttribute("android:networkSecurityConfig")
|
||||||
|
.apply { value = "@xml/network_security_config" }.let(applicationNode.attributes::setNamedItem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// In case the file does not exist create the "network_security_config.xml" file.
|
||||||
|
File(resXmlDirectory, "network_security_config.xml").apply {
|
||||||
|
if (!exists()) {
|
||||||
|
createNewFile()
|
||||||
|
writeText(
|
||||||
|
"""
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<network-security-config>
|
||||||
|
<base-config cleartextTrafficPermitted="true">
|
||||||
|
<trust-anchors>
|
||||||
|
<certificates src="system" />
|
||||||
|
<certificates
|
||||||
|
src="user"
|
||||||
|
overridePins="true" />
|
||||||
|
</trust-anchors>
|
||||||
|
</base-config>
|
||||||
|
<debug-overrides>
|
||||||
|
<trust-anchors>
|
||||||
|
<certificates src="system" />
|
||||||
|
<certificates
|
||||||
|
src="user"
|
||||||
|
overridePins="true" />
|
||||||
|
</trust-anchors>
|
||||||
|
</debug-overrides>
|
||||||
|
</network-security-config>
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
// If the file already exists.
|
||||||
|
readText().let { text ->
|
||||||
|
if (!text.contains("<certificates src=\"user\" />")) {
|
||||||
|
writeText(
|
||||||
|
text.replace(
|
||||||
|
"<trust-anchors>",
|
||||||
|
"<trust-anchors>\n<certificates src=\"user\" overridePins=\"true\" />\n<certificates src=\"system\" />"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ import org.w3c.dom.Element
|
|||||||
* @param tag The tag of the preference.
|
* @param tag The tag of the preference.
|
||||||
* @param summary The summary of the preference.
|
* @param summary The summary of the preference.
|
||||||
*/
|
*/
|
||||||
internal abstract class BasePreference(
|
abstract class BasePreference(
|
||||||
val key: String?,
|
val key: String?,
|
||||||
val title: StringResource,
|
val title: StringResource,
|
||||||
val summary: StringResource? = null,
|
val summary: StringResource? = null,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import org.w3c.dom.Element
|
|||||||
* @param name The name of the resource.
|
* @param name The name of the resource.
|
||||||
* @param tag The tag of the resource.
|
* @param tag The tag of the resource.
|
||||||
*/
|
*/
|
||||||
internal abstract class BaseResource(
|
abstract class BaseResource(
|
||||||
val name: String,
|
val name: String,
|
||||||
val tag: String
|
val tag: String
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import org.w3c.dom.Document
|
|||||||
* @param summary The summary of the preference.
|
* @param summary The summary of the preference.
|
||||||
* @param default The default value of the preference.
|
* @param default The default value of the preference.
|
||||||
*/
|
*/
|
||||||
internal abstract class DefaultBasePreference<T>(
|
abstract class DefaultBasePreference<T>(
|
||||||
key: String?,
|
key: String?,
|
||||||
title: StringResource,
|
title: StringResource,
|
||||||
summary: StringResource? = null,
|
summary: StringResource? = null,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import org.w3c.dom.Document
|
|||||||
* @param name The name of the array resource.
|
* @param name The name of the array resource.
|
||||||
* @param items The items of the array resource.
|
* @param items The items of the array resource.
|
||||||
*/
|
*/
|
||||||
internal class ArrayResource(
|
class ArrayResource(
|
||||||
name: String,
|
name: String,
|
||||||
val items: List<StringResource>
|
val items: List<StringResource>
|
||||||
) : BaseResource(name, "string-array") {
|
) : BaseResource(name, "string-array") {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import org.w3c.dom.Document
|
|||||||
* @param summary The summary of the list preference.
|
* @param summary The summary of the list preference.
|
||||||
* @param default The default entry value of the list preference.
|
* @param default The default entry value of the list preference.
|
||||||
*/
|
*/
|
||||||
internal class ListPreference(
|
class ListPreference(
|
||||||
key: String,
|
key: String,
|
||||||
title: StringResource,
|
title: StringResource,
|
||||||
val entries: ArrayResource,
|
val entries: ArrayResource,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import org.w3c.dom.Element
|
|||||||
* @param title The title of the preference.
|
* @param title The title of the preference.
|
||||||
* @param summary The summary of the text preference.
|
* @param summary The summary of the text preference.
|
||||||
*/
|
*/
|
||||||
internal class NonInteractivePreference(
|
class NonInteractivePreference(
|
||||||
title: StringResource,
|
title: StringResource,
|
||||||
summary: StringResource,
|
summary: StringResource,
|
||||||
) : BasePreference(null, title, summary, "Preference") {
|
) : BasePreference(null, title, summary, "Preference") {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import org.w3c.dom.Document
|
|||||||
* @param summary The summary of the text preference.
|
* @param summary The summary of the text preference.
|
||||||
* @param intent The intent of the preference.
|
* @param intent The intent of the preference.
|
||||||
*/
|
*/
|
||||||
internal class Preference(
|
class Preference(
|
||||||
key: String,
|
key: String,
|
||||||
title: StringResource,
|
title: StringResource,
|
||||||
summary: StringResource,
|
summary: StringResource,
|
||||||
@@ -33,7 +33,7 @@ internal class Preference(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class Intent(
|
class Intent(
|
||||||
internal val targetPackage: String,
|
internal val targetPackage: String,
|
||||||
internal val data: String,
|
internal val data: String,
|
||||||
internal val targetClass: String
|
internal val targetClass: String
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.w3c.dom.Document
|
|||||||
* @param title The title of the preference.
|
* @param title The title of the preference.
|
||||||
* @param preferences Child preferences of this category.
|
* @param preferences Child preferences of this category.
|
||||||
*/
|
*/
|
||||||
internal open class PreferenceCategory(
|
open class PreferenceCategory(
|
||||||
key: String,
|
key: String,
|
||||||
title: StringResource,
|
title: StringResource,
|
||||||
var preferences: List<BasePreference>,
|
var preferences: List<BasePreference>,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.w3c.dom.Document
|
|||||||
* @param preferences Child preferences of this screen.
|
* @param preferences Child preferences of this screen.
|
||||||
* @param summary The summary of the text preference.
|
* @param summary The summary of the text preference.
|
||||||
*/
|
*/
|
||||||
internal open class PreferenceScreen(
|
open class PreferenceScreen(
|
||||||
key: String,
|
key: String,
|
||||||
title: StringResource,
|
title: StringResource,
|
||||||
var preferences: List<BasePreference>,
|
var preferences: List<BasePreference>,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import org.w3c.dom.Document
|
|||||||
* @param value The value of the string.
|
* @param value The value of the string.
|
||||||
* @param formatted If the string is formatted. If false, the attribute will be set.
|
* @param formatted If the string is formatted. If false, the attribute will be set.
|
||||||
*/
|
*/
|
||||||
internal class StringResource(
|
class StringResource(
|
||||||
name: String,
|
name: String,
|
||||||
val value: String,
|
val value: String,
|
||||||
val formatted: Boolean = true
|
val formatted: Boolean = true
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import org.w3c.dom.Element
|
|||||||
* @param userDialogMessage The message to show in a dialog when the user toggles the preference.
|
* @param userDialogMessage The message to show in a dialog when the user toggles the preference.
|
||||||
* @param default The default value of the switch.
|
* @param default The default value of the switch.
|
||||||
*/
|
*/
|
||||||
internal class SwitchPreference(
|
class SwitchPreference(
|
||||||
key: String, title: StringResource,
|
key: String, title: StringResource,
|
||||||
val summaryOn: StringResource,
|
val summaryOn: StringResource,
|
||||||
val summaryOff: StringResource,
|
val summaryOff: StringResource,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.w3c.dom.Document
|
|||||||
* @param summary The summary of the text preference.
|
* @param summary The summary of the text preference.
|
||||||
* @param default The default value of the text preference.
|
* @param default The default value of the text preference.
|
||||||
*/
|
*/
|
||||||
internal class TextPreference(
|
class TextPreference(
|
||||||
key: String?,
|
key: String?,
|
||||||
title: StringResource,
|
title: StringResource,
|
||||||
summary: StringResource?,
|
summary: StringResource?,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
|||||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
|
|
||||||
internal abstract class AbstractPreferenceScreen(
|
abstract class AbstractPreferenceScreen(
|
||||||
private val root: MutableList<Screen> = mutableListOf()
|
private val root: MutableList<Screen> = mutableListOf()
|
||||||
) : Closeable {
|
) : Closeable {
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
package app.revanced.patches.tasker.trial.unlock.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility([Package("net.dinglisch.android.taskerm")])
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
internal annotation class UnlockTrialCompatibility
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
package app.revanced.patches.tasker.trial.unlock.fingerprints
|
|
||||||
|
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
|
||||||
|
|
||||||
object CheckLicenseFingerprint : MethodFingerprint(
|
|
||||||
strings = listOf("Can't check license")
|
|
||||||
)
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
package app.revanced.patches.tasker.trial.unlock.patch
|
|
||||||
|
|
||||||
import app.revanced.extensions.toErrorResult
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
|
||||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.annotations.Patch
|
|
||||||
import app.revanced.patches.tasker.trial.unlock.annotations.UnlockTrialCompatibility
|
|
||||||
import app.revanced.patches.tasker.trial.unlock.fingerprints.CheckLicenseFingerprint
|
|
||||||
|
|
||||||
@Patch
|
|
||||||
@Name("Unlock trial")
|
|
||||||
@Description("Unlocks the trial version.")
|
|
||||||
@UnlockTrialCompatibility
|
|
||||||
class UnlockLicensePatch : BytecodePatch(
|
|
||||||
listOf(
|
|
||||||
CheckLicenseFingerprint
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
override fun execute(context: BytecodeContext) = CheckLicenseFingerprint
|
|
||||||
.result
|
|
||||||
?.mutableMethod
|
|
||||||
// Return the method early, which prompts the user with a non dismissible dialog, when the trial period is over.
|
|
||||||
?.addInstruction(0, "return-void")
|
|
||||||
?.let { PatchResultSuccess() }
|
|
||||||
?: CheckLicenseFingerprint.toErrorResult()
|
|
||||||
}
|
|
||||||
@@ -30,7 +30,7 @@ class ExternalDownloadsResourcePatch : ResourcePatch {
|
|||||||
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 your installed external downloader app, such as NewPipe or PowerTube"),
|
StringResource("revanced_external_downloader_name_summary", "Package name of your installed external downloader app, such as NewPipe or Seal"),
|
||||||
InputType.TEXT
|
InputType.TEXT
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@@ -50,4 +50,4 @@ class ExternalDownloadsResourcePatch : ResourcePatch {
|
|||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
|||||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||||
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.fix.playback.fingerprints.*
|
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
|
|
||||||
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
|
||||||
@@ -27,7 +26,7 @@ class SpoofSignatureVerificationResourcePatch : ResourcePatch {
|
|||||||
+ "• Seekbar thumbnails are always hidden"),
|
+ "• Seekbar thumbnails are always hidden"),
|
||||||
StringResource("revanced_spoof_signature_verification_summary_off", "App signature not spoofed\\n\\nVideo playback may not work"),
|
StringResource("revanced_spoof_signature_verification_summary_off", "App signature not spoofed\\n\\nVideo playback may not work"),
|
||||||
StringResource("revanced_spoof_signature_verification_user_dialog_message",
|
StringResource("revanced_spoof_signature_verification_user_dialog_message",
|
||||||
"If you do not have a YouTube Premium subscription,\\n\\nthen turning off this setting will cause video playback issues.")
|
"Turning off this setting will cause video playback issues.")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class SettingsPatch : BytecodePatch(
|
|||||||
/**
|
/**
|
||||||
* Preference screens patches should add their settings to.
|
* Preference screens patches should add their settings to.
|
||||||
*/
|
*/
|
||||||
internal object PreferenceScreen : AbstractPreferenceScreen() {
|
object PreferenceScreen : AbstractPreferenceScreen() {
|
||||||
val ADS = Screen("ads", "Ads", "Ad related settings")
|
val ADS = Screen("ads", "Ads", "Ad related settings")
|
||||||
val INTERACTIONS = Screen("interactions", "Interaction", "Settings related to interactions")
|
val INTERACTIONS = Screen("interactions", "Interaction", "Settings related to interactions")
|
||||||
val LAYOUT = Screen("layout", "Layout", "Settings related to the layout")
|
val LAYOUT = Screen("layout", "Layout", "Settings related to the layout")
|
||||||
|
|||||||
Reference in New Issue
Block a user