mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-12 14:16:17 +00:00
Compare commits
6 Commits
v2.167.0-d
...
v2.167.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3b8fb5c11 | ||
|
|
65ace4b47a | ||
|
|
70d2d00b07 | ||
|
|
096d0d516f | ||
|
|
45904f4895 | ||
|
|
2e43d6fcc1 |
19
CHANGELOG.md
19
CHANGELOG.md
@@ -1,3 +1,22 @@
|
||||
# [2.167.0-dev.5](https://github.com/revanced/revanced-patches/compare/v2.167.0-dev.4...v2.167.0-dev.5) (2023-03-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **reddit:** bump compatibility to `2023.10.0` ([#1772](https://github.com/revanced/revanced-patches/issues/1772)) ([f95ab6e](https://github.com/revanced/revanced-patches/commit/f95ab6e13e70667fdffe479b7292112244e6bb9e))
|
||||
|
||||
# [2.167.0-dev.4](https://github.com/revanced/revanced-patches/compare/v2.167.0-dev.3...v2.167.0-dev.4) (2023-03-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/sponsorblock:** fix segments not skipping during background play ([#1765](https://github.com/revanced/revanced-patches/issues/1765)) ([7620ea1](https://github.com/revanced/revanced-patches/commit/7620ea1752406d703deb15aa0267d4572b1b171a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `export-all-activities` patch ([#1751](https://github.com/revanced/revanced-patches/issues/1751)) ([aad6e05](https://github.com/revanced/revanced-patches/commit/aad6e055380f91462d94fc96c4ec17a27e283c64))
|
||||
|
||||
# [2.167.0-dev.3](https://github.com/revanced/revanced-patches/compare/v2.167.0-dev.2...v2.167.0-dev.3) (2023-03-19)
|
||||
|
||||
|
||||
|
||||
@@ -154,8 +154,8 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `general-reddit-ads` | Removes general ads from the Reddit frontpage and subreddits. | 2023.09.1 |
|
||||
| `hide-subreddit-banner` | Hides banner ads from comments on subreddits. | 2023.09.1 |
|
||||
| `general-reddit-ads` | Removes general ads from the Reddit frontpage and subreddits. | 2023.10.0 |
|
||||
| `hide-subreddit-banner` | Hides banner ads from comments on subreddits. | 2023.10.0 |
|
||||
| `premium-icon-reddit` | Unlocks premium Reddit app icons. | all |
|
||||
</details>
|
||||
|
||||
@@ -335,7 +335,7 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-themes` | Unlocks all themes. | all |
|
||||
| `unlock-themes` | Unlocks all themes that are inaccessible until a certain level is reached. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `net.dinglisch.android.taskerm`](https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm)
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 2.167.0-dev.3
|
||||
version = 2.167.0-dev.5
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,45 @@
|
||||
package app.revanced.patches.all.activity.exportAll.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
|
||||
|
||||
@Patch(false)
|
||||
@Name("export-all-activities")
|
||||
@Description("Makes all app activities exportable.")
|
||||
@Version("0.0.1")
|
||||
class ExportAllActivitiesPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
context.xmlEditor["AndroidManifest.xml"].use { editor ->
|
||||
val document = editor.file
|
||||
val activities = document.getElementsByTagName("activity")
|
||||
|
||||
for(i in 0..activities.length) {
|
||||
activities.item(i)?.apply {
|
||||
val exportedAttribute = attributes.getNamedItem(EXPORTED_FLAG)
|
||||
|
||||
if (exportedAttribute != null) {
|
||||
if (exportedAttribute.nodeValue != "true")
|
||||
exportedAttribute.nodeValue = "true"
|
||||
}
|
||||
// Reason why the attribute is added in the case it does not exist:
|
||||
// https://github.com/revanced/revanced-patches/pull/1751/files#r1141481604
|
||||
else document.createAttribute(EXPORTED_FLAG)
|
||||
.apply { value = "true" }
|
||||
.let(attributes::setNamedItem)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val EXPORTED_FLAG = "android:exported"
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,8 @@ import app.revanced.patcher.annotation.Package
|
||||
"2023.07.1",
|
||||
"2023.08.0",
|
||||
"2023.09.0",
|
||||
"2023.09.1"
|
||||
"2023.09.1",
|
||||
"2023.10.0"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
||||
@@ -14,7 +14,8 @@ import app.revanced.patcher.annotation.Package
|
||||
"2023.07.1",
|
||||
"2023.08.0",
|
||||
"2023.09.0",
|
||||
"2023.09.1"
|
||||
"2023.09.1",
|
||||
"2023.10.0"
|
||||
)
|
||||
)]
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@ import app.revanced.patches.ticktick.misc.themeunlock.fingerprints.SetThemeFinge
|
||||
|
||||
@Patch
|
||||
@Name("unlock-themes")
|
||||
@Description("Unlocks all themes.")
|
||||
@Description("Unlocks all themes that are inaccessible until a certain level is reached.")
|
||||
@UnlockThemesCompatibility
|
||||
@Version("0.0.1")
|
||||
class UnlockProPatch : BytecodePatch(
|
||||
|
||||
@@ -81,7 +81,7 @@ class SponsorBlockBytecodePatch : BytecodePatch(
|
||||
/*
|
||||
Set current video id
|
||||
*/
|
||||
VideoIdPatch.injectCall("$INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR->setCurrentVideoId(Ljava/lang/String;)V")
|
||||
VideoIdPatch.injectCallBackgroundPlay("$INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR->setCurrentVideoId(Ljava/lang/String;)V")
|
||||
|
||||
/*
|
||||
Seekbar drawing
|
||||
|
||||
@@ -98,7 +98,9 @@ class VideoInformationPatch : BytecodePatch(
|
||||
/*
|
||||
Inject call for video id
|
||||
*/
|
||||
VideoIdPatch.injectCall("$INTEGRATIONS_CLASS_DESCRIPTOR->setVideoId(Ljava/lang/String;)V")
|
||||
val videoIdMethodDescriptor = "$INTEGRATIONS_CLASS_DESCRIPTOR->setVideoId(Ljava/lang/String;)V"
|
||||
VideoIdPatch.injectCall(videoIdMethodDescriptor)
|
||||
VideoIdPatch.injectCallBackgroundPlay(videoIdMethodDescriptor)
|
||||
|
||||
/*
|
||||
Set the video time method
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.revanced.patches.youtube.misc.video.videoid.fingerprint
|
||||
|
||||
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 VideoIdFingerprintBackgroundPlay : MethodFingerprint(
|
||||
returnType = "V",
|
||||
access = AccessFlags.DECLARED_SYNCHRONIZED or AccessFlags.FINAL or AccessFlags.PUBLIC,
|
||||
parameters = listOf("L"),
|
||||
opcodes = listOf(Opcode.INVOKE_INTERFACE),
|
||||
customFingerprint = {
|
||||
it.definingClass.endsWith("PlaybackLifecycleMonitor;")
|
||||
}
|
||||
)
|
||||
@@ -15,6 +15,7 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.video.videoid.annotation.VideoIdCompatibility
|
||||
import app.revanced.patches.youtube.misc.video.videoid.fingerprint.VideoIdFingerprint
|
||||
import app.revanced.patches.youtube.misc.video.videoid.fingerprint.VideoIdFingerprintBackgroundPlay
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Name("video-id-hook")
|
||||
@@ -23,30 +24,50 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@Version("0.0.1")
|
||||
@DependsOn([IntegrationsPatch::class])
|
||||
class VideoIdPatch : BytecodePatch(
|
||||
listOf(VideoIdFingerprint)
|
||||
listOf(VideoIdFingerprint, VideoIdFingerprintBackgroundPlay)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
VideoIdFingerprint.result?.let {
|
||||
val videoIdRegisterInstructionIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
VideoIdFingerprint.result?.let { result ->
|
||||
val videoIdRegisterInstructionIndex = result.scanResult.patternScanResult!!.endIndex
|
||||
|
||||
with(it.mutableMethod) {
|
||||
insertMethod = this
|
||||
result.mutableMethod.also {
|
||||
insertMethod = it
|
||||
}.apply {
|
||||
videoIdRegister = (instruction(videoIdRegisterInstructionIndex) as OneRegisterInstruction).registerA
|
||||
insertIndex = videoIdRegisterInstructionIndex + 1
|
||||
}
|
||||
} ?: return VideoIdFingerprint.toErrorResult()
|
||||
|
||||
VideoIdFingerprintBackgroundPlay.result?.let { result ->
|
||||
val endIndex = result.scanResult.patternScanResult!!.endIndex
|
||||
|
||||
result.mutableMethod.also {
|
||||
backgroundPlaybackMethod = it
|
||||
}.apply {
|
||||
backgroundPlaybackVideoIdRegister = (instruction(endIndex + 1) as OneRegisterInstruction).registerA
|
||||
backgroundPlaybackInsertIndex = endIndex + 2
|
||||
}
|
||||
} ?: return VideoIdFingerprintBackgroundPlay.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private var videoIdRegister = 0
|
||||
private var insertIndex = 0
|
||||
|
||||
private lateinit var insertMethod: MutableMethod
|
||||
|
||||
private var backgroundPlaybackVideoIdRegister = 0
|
||||
private var backgroundPlaybackInsertIndex = 0
|
||||
private lateinit var backgroundPlaybackMethod: MutableMethod
|
||||
|
||||
/**
|
||||
* Adds an invoke-static instruction, called with the new id when the video changes.
|
||||
*
|
||||
* Supports all videos (regular videos, Shorts and Stories).
|
||||
*
|
||||
* _Does not function if playing in the background with no video visible_.
|
||||
*
|
||||
* Be aware, this can be called multiple times for the same video id.
|
||||
*
|
||||
* @param methodDescriptor which method to call. Params have to be `Ljava/lang/String;`
|
||||
@@ -54,12 +75,28 @@ class VideoIdPatch : BytecodePatch(
|
||||
fun injectCall(
|
||||
methodDescriptor: String
|
||||
) = insertMethod.addInstructions(
|
||||
// Keep injection calls in the order they're added.
|
||||
// Order has been proven to be important for the same reason that order of patch execution is important
|
||||
// such as for the VideoInformation patch.
|
||||
// Keep injection calls in the order they're added:
|
||||
// Increment index. So if additional injection calls are added, those calls run after this injection call.
|
||||
insertIndex++,
|
||||
"invoke-static {v$videoIdRegister}, $methodDescriptor"
|
||||
)
|
||||
|
||||
/**
|
||||
* Alternate hook that supports only regular videos, but hook supports changing to new video
|
||||
* during background play when no video is visible.
|
||||
*
|
||||
* _Does not support Shorts or Stories_.
|
||||
*
|
||||
* Be aware, the hook can be called multiple times for the same video id.
|
||||
*
|
||||
* @param methodDescriptor which method to call. Params have to be `Ljava/lang/String;`
|
||||
*/
|
||||
fun injectCallBackgroundPlay(
|
||||
methodDescriptor: String
|
||||
) = backgroundPlaybackMethod.addInstructions(
|
||||
backgroundPlaybackInsertIndex++, // move-result-object offset
|
||||
"invoke-static {v$backgroundPlaybackVideoIdRegister}, $methodDescriptor"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user