Compare commits

..

5 Commits

Author SHA1 Message Date
semantic-release-bot
eece2965a1 chore(release): 2.162.0-dev.6 [skip ci]
# [2.162.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.162.0-dev.5...v2.162.0-dev.6) (2023-02-18)

### Bug Fixes

* **tiktok/show-seekbar:** fix crash when showing seekbar ([#1643](https://github.com/revanced/revanced-patches/issues/1643)) ([57cd05a](57cd05af68))
2023-02-18 08:28:32 +00:00
d4rkk3y
57cd05af68 fix(tiktok/show-seekbar): fix crash when showing seekbar (#1643) 2023-02-18 09:26:51 +01:00
semantic-release-bot
f159e0eeb5 chore(release): 2.162.0-dev.5 [skip ci]
# [2.162.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.162.0-dev.4...v2.162.0-dev.5) (2023-02-18)

### Features

* **androidtwelvewidgets:** `unlock-paid-widgets` patch ([#1641](https://github.com/revanced/revanced-patches/issues/1641)) ([b187836](b18783636b))
2023-02-18 00:36:00 +00:00
fe
b18783636b feat(androidtwelvewidgets): unlock-paid-widgets patch (#1641) 2023-02-18 01:32:49 +01:00
semantic-release-bot
32b48fe3b6 chore(release): 2.162.0-dev.4 [skip ci]
# [2.162.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.162.0-dev.3...v2.162.0-dev.4) (2023-02-17)

### Features

* **music:** remove patches constraint on app version ([#1638](https://github.com/revanced/revanced-patches/issues/1638)) ([3c37ccc](3c37ccce87))
2023-02-17 15:08:05 +00:00
12 changed files with 89 additions and 78 deletions

View File

@@ -39,7 +39,7 @@
[ [
"@saithodev/semantic-release-backmerge", "@saithodev/semantic-release-backmerge",
{ {
backmergeBranches: ["dev"], branches: [{from: "main", to: "dev"}],
clearWorkspace: true clearWorkspace: true
} }
] ]

View File

@@ -1,36 +1,23 @@
# [2.163.0-dev.2](https://github.com/revanced/revanced-patches/compare/v2.163.0-dev.1...v2.163.0-dev.2) (2023-02-19) # [2.162.0-dev.6](https://github.com/revanced/revanced-patches/compare/v2.162.0-dev.5...v2.162.0-dev.6) (2023-02-18)
### Features
* **twitter:** constrain patches compatibility to working versions ([#1646](https://github.com/revanced/revanced-patches/issues/1646)) ([d984bdc](https://github.com/revanced/revanced-patches/commit/d984bdc8b17dea127880b696ee1bed1503762707))
# [2.163.0-dev.1](https://github.com/revanced/revanced-patches/compare/v2.162.0...v2.163.0-dev.1) (2023-02-18)
### Bug Fixes ### Bug Fixes
* **tiktok/show-seekbar:** fix crash when showing seekbar ([#1643](https://github.com/revanced/revanced-patches/issues/1643)) ([160b716](https://github.com/revanced/revanced-patches/commit/160b71644dfdf8efd1f19cdf8e9f572fe1b86d9d)) * **tiktok/show-seekbar:** fix crash when showing seekbar ([#1643](https://github.com/revanced/revanced-patches/issues/1643)) ([c00042f](https://github.com/revanced/revanced-patches/commit/c00042f158b7bac2b21fd3867c526b595d6dfa56))
# [2.162.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.162.0-dev.4...v2.162.0-dev.5) (2023-02-18)
### Features
* **androidtwelvewidgets:** `unlock-paid-widgets` patch ([#1641](https://github.com/revanced/revanced-patches/issues/1641)) ([28642d1](https://github.com/revanced/revanced-patches/commit/28642d1f93832c733a34ad77890f70f5a6fe5d51))
# [2.162.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.162.0-dev.3...v2.162.0-dev.4) (2023-02-17)
### Features ### Features
* **androidtwelvewidgets:** `unlock-paid-widgets` patch ([#1641](https://github.com/revanced/revanced-patches/issues/1641)) ([44b74ae](https://github.com/revanced/revanced-patches/commit/44b74ae268c3f534dbaecc0adc00767e9b9c0e51))
* **music:** remove patches constraint on app version ([#1638](https://github.com/revanced/revanced-patches/issues/1638)) ([fe64881](https://github.com/revanced/revanced-patches/commit/fe64881c83a7dd42761dbd67689fbc0ddcb73d78)) * **music:** remove patches constraint on app version ([#1638](https://github.com/revanced/revanced-patches/issues/1638)) ([fe64881](https://github.com/revanced/revanced-patches/commit/fe64881c83a7dd42761dbd67689fbc0ddcb73d78))
* **youtube/open-links-directly:** skip every redirect url ([f155e26](https://github.com/revanced/revanced-patches/commit/f155e261d4973d304c57e0144ddd8e115e6103ee))
# [2.162.0](https://github.com/revanced/revanced-patches/compare/v2.161.1...v2.162.0) (2023-02-14)
### Bug Fixes
* **youtube/general-ads:** use better description for switch ([d33f959](https://github.com/revanced/revanced-patches/commit/d33f9597529d63014dd42fc6fe1e84b76831e0f3))
### Features
* **youtube/general-ads:** hide web search results ([9975981](https://github.com/revanced/revanced-patches/commit/997598109409ec6a096c652dd8b4b4d27daeb8ec))
* **yuka:** `unlock-premium` patch ([#1608](https://github.com/revanced/revanced-patches/issues/1608)) ([71e1594](https://github.com/revanced/revanced-patches/commit/71e15945c1b4019eaa2ff214b4efbfc6b1a67376))
# [2.162.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.162.0-dev.2...v2.162.0-dev.3) (2023-02-14) # [2.162.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.162.0-dev.2...v2.162.0-dev.3) (2023-02-14)

View File

@@ -131,9 +131,9 @@ The official Patch bundle provided by ReVanced and the community.
| 💊 Patch | 📜 Description | 🏹 Target Version | | 💊 Patch | 📜 Description | 🏹 Target Version |
|:--------:|:--------------:|:-----------------:| |:--------:|:--------------:|:-----------------:|
| `dynamic-color` | Replaces the default Twitter Blue with the users Material You palette. | all | | `dynamic-color` | Replaces the default Twitter Blue with the users Material You palette. | all |
| `hide-views-stats` | Hides the view stats under tweets. | 9.71.0-release.0 | | `hide-views-stats` | Hides the view stats under tweets. | 9.69.1-release.0 |
| `monochrome-icon` | Adds a monochrome icon. | all | | `monochrome-icon` | Adds a monochrome icon. | all |
| `timeline-ads` | Removes ads from the Twitter timeline. Might require clearing app data to remove already cached ads. | 9.71.0-release.0 | | `timeline-ads` | Removes ads from the Twitter timeline. Might require clearing app data to remove already cached ads. | all |
</details> </details>
### [📦 `com.spotify.music`](https://play.google.com/store/apps/details?id=com.spotify.music) ### [📦 `com.spotify.music`](https://play.google.com/store/apps/details?id=com.spotify.music)

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official kotlin.code.style = official
version = 2.163.0-dev.2 version = 2.162.0-dev.6

File diff suppressed because one or more lines are too long

View File

@@ -28,7 +28,6 @@ abstract class AbstractSettingsResourcePatch(
override fun execute(context: ResourceContext): PatchResult { override fun execute(context: ResourceContext): PatchResult {
/* /*
* used for self-restart * used for self-restart
* TODO: do this only, when necessary
*/ */
context.xmlEditor["AndroidManifest.xml"].use { editor -> context.xmlEditor["AndroidManifest.xml"].use { editor ->
editor.file.getElementsByTagName("manifest").item(0).also { editor.file.getElementsByTagName("manifest").item(0).also {

View File

@@ -3,11 +3,7 @@ package app.revanced.patches.twitter.ad.timeline.annotations
import app.revanced.patcher.annotation.Compatibility import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility([Package("com.twitter.android")])
[Package(
"com.twitter.android", arrayOf("9.65.3-release.0")
)]
)
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
internal annotation class TimelineAdsCompatibility internal annotation class TimelineAdsCompatibility

View File

@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
@Compatibility( @Compatibility(
[Package( [Package(
"com.twitter.android", arrayOf("9.69.1-release.0", "9.71.0-release.0") "com.twitter.android", arrayOf("9.69.1-release.0")
)] )]
) )
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)

View File

@@ -1,19 +1,23 @@
package app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints package app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility
import org.jf.dexlib2.AccessFlags import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode import org.jf.dexlib2.Opcode
@Name("open-links-directly-primary-fingerprint")
@OpenLinksDirectlyCompatibility @OpenLinksDirectlyCompatibility
object OpenLinksDirectlyPrimaryFingerprint : MethodFingerprint( @Version("0.0.1")
object OpenLinksDirectlyFingerprintPrimary : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf( "L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
Opcode.CHECK_CAST,
Opcode.INVOKE_STATIC, Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT, Opcode.MOVE_RESULT_OBJECT,
Opcode.RETURN_OBJECT, Opcode.RETURN_OBJECT,
Opcode.CHECK_CAST, Opcode.CHECK_CAST,
Opcode.SGET, Opcode.SGET
Opcode.SGET_OBJECT
) )
) )

View File

@@ -0,0 +1,28 @@
package app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@Name("open-links-directly-secondary-fingerprint")
@OpenLinksDirectlyCompatibility
@Version("0.0.1")
object OpenLinksDirectlyFingerprintSecondary : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_STATIC,
Opcode.MOVE_RESULT_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IF_EQZ,
Opcode.RETURN_OBJECT,
Opcode.NEW_INSTANCE,
Opcode.CONST_STRING
),
strings = listOf("Uri must have an absolute scheme")
)

View File

@@ -1,14 +0,0 @@
package app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility
import org.jf.dexlib2.AccessFlags
import org.jf.dexlib2.Opcode
@OpenLinksDirectlyCompatibility
object OpenLinksDirectlySecondaryFingerprint : MethodFingerprint(
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"), listOf(
Opcode.INVOKE_STATIC, Opcode.MOVE_RESULT_OBJECT
), listOf("://")
)

View File

@@ -1,24 +1,25 @@
package app.revanced.patches.youtube.misc.openlinksdirectly.patch package app.revanced.patches.youtube.misc.openlinksdirectly.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.extensions.instruction import app.revanced.patcher.extensions.addInstructions
import app.revanced.patcher.extensions.replaceInstruction import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
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.patches.shared.settings.preference.impl.StringResource import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility import app.revanced.patches.youtube.misc.openlinksdirectly.annotations.OpenLinksDirectlyCompatibility
import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlyPrimaryFingerprint import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlyFingerprintPrimary
import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlySecondaryFingerprint import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlyFingerprintSecondary
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch 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.SwitchPreference
import org.jf.dexlib2.iface.instruction.Instruction
import org.jf.dexlib2.iface.instruction.formats.Instruction11x
import org.jf.dexlib2.iface.instruction.formats.Instruction35c import org.jf.dexlib2.iface.instruction.formats.Instruction35c
@Patch @Patch
@@ -28,7 +29,9 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction35c
@OpenLinksDirectlyCompatibility @OpenLinksDirectlyCompatibility
@Version("0.0.1") @Version("0.0.1")
class OpenLinksDirectlyPatch : BytecodePatch( class OpenLinksDirectlyPatch : BytecodePatch(
listOf(OpenLinksDirectlyPrimaryFingerprint, OpenLinksDirectlySecondaryFingerprint) listOf(
OpenLinksDirectlyFingerprintPrimary, OpenLinksDirectlyFingerprintSecondary
)
) { ) {
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.MISC.addPreferences( SettingsPatch.PreferenceScreen.MISC.addPreferences(
@@ -41,21 +44,29 @@ class OpenLinksDirectlyPatch : BytecodePatch(
) )
) )
arrayOf(OpenLinksDirectlyPrimaryFingerprint, OpenLinksDirectlySecondaryFingerprint) OpenLinksDirectlyFingerprintPrimary.hookUriParser(true)
.map { it.result ?: return it.toErrorResult() } OpenLinksDirectlyFingerprintSecondary.hookUriParser(false)
.forEach { result ->
result.mutableMethod.apply {
val insertIndex = result.scanResult.patternScanResult!!.startIndex
val uriRegister = (instruction(insertIndex) as Instruction35c).registerC
replaceInstruction(
insertIndex,
"invoke-static {v$uriRegister}," +
"Lapp/revanced/integrations/patches/OpenLinksDirectlyPatch;" +
"->" +
"transformRedirectUri(Ljava/lang/String;)Landroid/net/Uri;"
)
}
}
return PatchResultSuccess() return PatchResultSuccess()
} }
} }
fun MethodFingerprint.hookUriParser(isPrimaryFingerprint: Boolean) {
fun getTargetRegister(instruction: Instruction): Int {
if (isPrimaryFingerprint) return (instruction as Instruction35c).registerC
return (instruction as Instruction11x).registerA
}
with(this.result!!) {
val startIndex = scanResult.patternScanResult!!.startIndex
val instruction = method.implementation!!.instructions.elementAt(startIndex + 1)
val insertIndex = if (isPrimaryFingerprint) 1 else 2
val targetRegister = getTargetRegister(instruction)
mutableMethod.addInstructions(
startIndex + insertIndex, """
invoke-static {v$targetRegister}, Lapp/revanced/integrations/patches/OpenLinksDirectlyPatch;->parseRedirectUri(Ljava/lang/String;)Ljava/lang/String;
move-result-object v$targetRegister
"""
)
}
}