mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 01:51:27 +01:00
Compare commits
10 Commits
c400188c38
...
v2.162.0-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6be8ac586 | ||
|
|
0f56818e25 | ||
|
|
c73448edf2 | ||
|
|
26fd723352 | ||
|
|
3160cc77b3 | ||
|
|
eece2965a1 | ||
|
|
57cd05af68 | ||
|
|
f159e0eeb5 | ||
|
|
b18783636b | ||
|
|
32b48fe3b6 |
28
CHANGELOG.md
28
CHANGELOG.md
@@ -1,3 +1,31 @@
|
||||
# [2.162.0-dev.7](https://github.com/revanced/revanced-patches/compare/v2.162.0-dev.6...v2.162.0-dev.7) (2023-02-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/open-links-directly:** skip every redirect url ([652c762](https://github.com/revanced/revanced-patches/commit/652c76230049cfeeacb3c3512c1af4b400ffd3a7))
|
||||
|
||||
# [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)) ([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
|
||||
|
||||
* **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))
|
||||
|
||||
# [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)
|
||||
|
||||
|
||||
|
||||
30
README.md
30
README.md
@@ -68,16 +68,16 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `background-play` | Enables playing music in the background. | 5.39.52 |
|
||||
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | 5.39.52 |
|
||||
| `compact-header` | Hides the music category bar at the top of the homepage. | 5.39.52 |
|
||||
| `exclusive-audio-playback` | Enables the option to play music without video. | 5.39.52 |
|
||||
| `background-play` | Enables playing music in the background. | all |
|
||||
| `codecs-unlock` | Adds more audio codec options. The new audio codecs usually result in better audio quality. | all |
|
||||
| `compact-header` | Hides the music category bar at the top of the homepage. | all |
|
||||
| `exclusive-audio-playback` | Enables the option to play music without video. | all |
|
||||
| `hide-get-premium` | Removes all "Get Premium" evidences from the avatar menu. | 5.39.52 |
|
||||
| `minimized-playback-music` | Enables minimized playback on Kids music. | 5.39.52 |
|
||||
| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | 5.39.52 |
|
||||
| `music-video-ads` | Removes ads in the music player. | 5.39.52 |
|
||||
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | 5.39.52 |
|
||||
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | 5.39.52 |
|
||||
| `minimized-playback-music` | Enables minimized playback on Kids music. | all |
|
||||
| `music-microg-support` | Allows YouTube Music ReVanced to run without root and under a different package name. | all |
|
||||
| `music-video-ads` | Removes ads in the music player. | all |
|
||||
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the home screen. | all |
|
||||
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.ss.android.ugc.trill`](https://play.google.com/store/apps/details?id=com.ss.android.ugc.trill)
|
||||
@@ -254,6 +254,14 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
| `remove-broadcasts-restriction` | Enables starting/stopping NetGuard via broadcasts. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.dci.dev.androidtwelvewidgets`](https://play.google.com/store/apps/details?id=com.dci.dev.androidtwelvewidgets)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-paid-widgets` | Unlocks paid widgets of the app | all |
|
||||
</details>
|
||||
|
||||
### [📦 `io.yuka.android`](https://play.google.com/store/apps/details?id=io.yuka.android)
|
||||
<details>
|
||||
|
||||
@@ -278,7 +286,7 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `com.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx)
|
||||
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
@@ -286,7 +294,7 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
| `unlock-pro` | Unlocks all pro features. | all |
|
||||
</details>
|
||||
|
||||
### [📦 `ginlemon.iconpackstudio`](https://play.google.com/store/apps/details?id=ginlemon.iconpackstudio)
|
||||
### [📦 `com.awedea.nyx`](https://play.google.com/store/apps/details?id=com.awedea.nyx)
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 2.162.0-dev.3
|
||||
version = 2.162.0-dev.7
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -28,6 +28,7 @@ abstract class AbstractSettingsResourcePatch(
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
/*
|
||||
* used for self-restart
|
||||
* TODO: do this only, when necessary
|
||||
*/
|
||||
context.xmlEditor["AndroidManifest.xml"].use { editor ->
|
||||
editor.file.getElementsByTagName("manifest").item(0).also {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.revanced.patches.tiktok.interaction.seekbar.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
@@ -14,6 +15,7 @@ import app.revanced.patches.tiktok.interaction.seekbar.annotations.ShowSeekbarCo
|
||||
import app.revanced.patches.tiktok.interaction.seekbar.fingerprints.AwemeGetVideoControlFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction11n
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction21t
|
||||
import org.jf.dexlib2.builder.instruction.BuilderInstruction22c
|
||||
|
||||
@Patch
|
||||
@@ -32,15 +34,18 @@ class ShowSeekbarPatch : BytecodePatch(
|
||||
?: return PatchResultError("Can not find target class")
|
||||
val fieldList = videoControl.immutableClass.fields.associateBy { field -> field.name }
|
||||
|
||||
val method = AwemeGetVideoControlFingerprint.result!!.mutableMethod
|
||||
val implementation = method.implementation!!
|
||||
implementation.addInstructions(
|
||||
1, listOf(
|
||||
BuilderInstruction11n(Opcode.CONST_4, 1, 1),
|
||||
BuilderInstruction22c(Opcode.IPUT, 1, 0, fieldList["showProgressBar"]!!),
|
||||
BuilderInstruction22c(Opcode.IPUT, 1, 0, fieldList["draftProgressBar"]!!)
|
||||
AwemeGetVideoControlFingerprint.result?.mutableMethod?.implementation?.apply {
|
||||
val ifNullLabel = newLabelForIndex(1)
|
||||
addInstructions(
|
||||
1,
|
||||
listOf(
|
||||
BuilderInstruction11n(Opcode.CONST_4, 1, 1),
|
||||
BuilderInstruction21t(Opcode.IF_EQZ, 0, ifNullLabel),
|
||||
BuilderInstruction22c(Opcode.IPUT, 1, 0, fieldList["showProgressBar"]!!),
|
||||
BuilderInstruction22c(Opcode.IPUT, 1, 0, fieldList["draftProgressBar"]!!)
|
||||
)
|
||||
)
|
||||
)
|
||||
} ?: return AwemeGetVideoControlFingerprint.toErrorResult()
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package app.revanced.patches.twelvewidgets.unlock.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object AgendaDaysWidgetUnlockFingerprint : MethodUnlockFingerprint("AgendaDaysWidgetConfigureActivity")
|
||||
@@ -0,0 +1,5 @@
|
||||
package app.revanced.patches.twelvewidgets.unlock.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object CalendarBigWidgetUnlockFingerprint : MethodUnlockFingerprint("CalendarBigWidgetConfigureActivity")
|
||||
@@ -0,0 +1,4 @@
|
||||
package app.revanced.patches.twelvewidgets.unlock.fingerprints
|
||||
|
||||
object CalendarWideDayEventsWidgetUnlockFingerprint :
|
||||
MethodUnlockFingerprint("CalendarWideDayEventsWidgetConfigureActivity")
|
||||
@@ -0,0 +1,6 @@
|
||||
package app.revanced.patches.twelvewidgets.unlock.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object CalendarWideTimelineWidgetUnlockFingerprint :
|
||||
MethodUnlockFingerprint("CalendarWideTimelineWidgetConfigureActivity")
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.revanced.patches.twelvewidgets.unlock.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
abstract class MethodUnlockFingerprint(private val className: String) : MethodFingerprint(
|
||||
"L",
|
||||
strings = listOf("binding.addButton"),
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.definingClass.endsWith("/$className;")
|
||||
}
|
||||
)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package app.revanced.patches.twelvewidgets.unlock.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object ScreentimeSmallWidgetUnlockFingerprint : MethodUnlockFingerprint("ScreentimeSmallWidgetConfigureActivity")
|
||||
@@ -0,0 +1,3 @@
|
||||
package app.revanced.patches.twelvewidgets.unlock.fingerprints
|
||||
|
||||
object WeatherWidgetUnlockFingerprint : MethodUnlockFingerprint("WeatherWidgetConfigureActivity")
|
||||
@@ -0,0 +1,54 @@
|
||||
package app.revanced.patches.twelvewidgets.unlock.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.*
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.removeInstructions
|
||||
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.twelvewidgets.unlock.fingerprints.*
|
||||
|
||||
@Patch
|
||||
@Name("unlock-paid-widgets")
|
||||
@Description("Unlocks paid widgets of the app")
|
||||
@Compatibility([Package("com.dci.dev.androidtwelvewidgets")])
|
||||
@Version("0.0.1")
|
||||
class UnlockPaidWidgetsPatch : BytecodePatch(
|
||||
listOf(
|
||||
AgendaDaysWidgetUnlockFingerprint,
|
||||
CalendarBigWidgetUnlockFingerprint,
|
||||
CalendarWideDayEventsWidgetUnlockFingerprint,
|
||||
CalendarWideTimelineWidgetUnlockFingerprint,
|
||||
ScreentimeSmallWidgetUnlockFingerprint,
|
||||
WeatherWidgetUnlockFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
listOf(
|
||||
AgendaDaysWidgetUnlockFingerprint,
|
||||
CalendarBigWidgetUnlockFingerprint,
|
||||
CalendarWideDayEventsWidgetUnlockFingerprint,
|
||||
CalendarWideTimelineWidgetUnlockFingerprint,
|
||||
ScreentimeSmallWidgetUnlockFingerprint,
|
||||
WeatherWidgetUnlockFingerprint
|
||||
).map { fingerprint ->
|
||||
fingerprint.result?.mutableMethod ?: return fingerprint.toErrorResult()
|
||||
}.forEach { method ->
|
||||
method.apply {
|
||||
removeInstructions(4, 2)
|
||||
addInstructions(
|
||||
implementation?.instructions?.size!!, """
|
||||
const/4 v1, 0x0
|
||||
invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V
|
||||
return-object v0
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
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")
|
||||
)
|
||||
@@ -1,23 +1,19 @@
|
||||
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-primary-fingerprint")
|
||||
@OpenLinksDirectlyCompatibility
|
||||
@Version("0.0.1")
|
||||
object OpenLinksDirectlyFingerprintPrimary : MethodFingerprint(
|
||||
object OpenLinksDirectlyPrimaryFingerprint : MethodFingerprint(
|
||||
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"), listOf(
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.RETURN_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.SGET
|
||||
Opcode.SGET,
|
||||
Opcode.SGET_OBJECT
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
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("://")
|
||||
)
|
||||
@@ -1,25 +1,24 @@
|
||||
package app.revanced.patches.youtube.misc.openlinksdirectly.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.fingerprint.method.impl.MethodFingerprint
|
||||
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.patcher.patch.BytecodePatch
|
||||
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.fingerprints.OpenLinksDirectlyFingerprintPrimary
|
||||
import app.revanced.patches.youtube.misc.openlinksdirectly.fingerprints.OpenLinksDirectlyFingerprintSecondary
|
||||
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 app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
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.OpenLinksDirectlySecondaryFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
|
||||
@Patch
|
||||
@@ -29,9 +28,7 @@ import org.jf.dexlib2.iface.instruction.formats.Instruction35c
|
||||
@OpenLinksDirectlyCompatibility
|
||||
@Version("0.0.1")
|
||||
class OpenLinksDirectlyPatch : BytecodePatch(
|
||||
listOf(
|
||||
OpenLinksDirectlyFingerprintPrimary, OpenLinksDirectlyFingerprintSecondary
|
||||
)
|
||||
listOf(OpenLinksDirectlyPrimaryFingerprint, OpenLinksDirectlySecondaryFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
@@ -44,29 +41,21 @@ class OpenLinksDirectlyPatch : BytecodePatch(
|
||||
)
|
||||
)
|
||||
|
||||
OpenLinksDirectlyFingerprintPrimary.hookUriParser(true)
|
||||
OpenLinksDirectlyFingerprintSecondary.hookUriParser(false)
|
||||
|
||||
arrayOf(OpenLinksDirectlyPrimaryFingerprint, OpenLinksDirectlySecondaryFingerprint)
|
||||
.map { it.result ?: return it.toErrorResult() }
|
||||
.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()
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user