mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-26 02:44:08 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e5c963e36 | ||
|
|
05ea840b8f | ||
|
|
da4b80c5dd | ||
|
|
4ca19b7fd2 | ||
|
|
260b395426 | ||
|
|
b4d8dbcc3d | ||
|
|
7180914df1 |
22
CHANGELOG.md
22
CHANGELOG.md
@@ -1,3 +1,25 @@
|
||||
# [2.132.0](https://github.com/revanced/revanced-patches/compare/v2.131.0...v2.132.0) (2022-12-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **sleepasandroid:** `unlock-premium` patch ([#1172](https://github.com/revanced/revanced-patches/issues/1172)) ([580ddcd](https://github.com/revanced/revanced-patches/commit/580ddcdf1f8ef4a525f772630b3c085b706e4dc7))
|
||||
* **twitch:** remove `block-embedded-ads` patch ([#1164](https://github.com/revanced/revanced-patches/issues/1164)) ([ecc1eae](https://github.com/revanced/revanced-patches/commit/ecc1eaef4daa7dfecb7913c378188b2b4685e610))
|
||||
|
||||
# [2.131.0](https://github.com/revanced/revanced-patches/compare/v2.130.0...v2.131.0) (2022-11-30)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **twitch/block-embedded-ads:** `block-embedded-ads` patch support ([#1160](https://github.com/revanced/revanced-patches/issues/1160)) ([641d33f](https://github.com/revanced/revanced-patches/commit/641d33fc7e213031124491bb468fb382267769aa))
|
||||
|
||||
# [2.130.0](https://github.com/revanced/revanced-patches/compare/v2.129.0...v2.130.0) (2022-11-29)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/enable-wide-searchbar:** bump compatibility to v17.45.36 ([66ce54c](https://github.com/revanced/revanced-patches/commit/66ce54c9921e6fbf5bbe52d73b0182352181f2b8))
|
||||
|
||||
# [2.129.0](https://github.com/revanced/revanced-patches/compare/v2.128.0...v2.129.0) (2022-11-28)
|
||||
|
||||
|
||||
|
||||
10
README.md
10
README.md
@@ -96,7 +96,7 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
| `hide-crowdfunding-box` | Hides the crowdfunding box between the player and video description. | 17.45.36 |
|
||||
| `hide-time-and-seekbar` | Hides progress bar and time counter on videos. | 17.45.36 |
|
||||
| `hide-video-buttons` | Adds options to hide action buttons under a video. | 17.45.36 |
|
||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.43.36 |
|
||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | 17.45.36 |
|
||||
| `hide-captions-button` | Hides the captions button on video player. | 17.45.36 |
|
||||
| `hide-shorts-button` | Hides the shorts button on the navigation bar. | 17.45.36 |
|
||||
| `hide-create-button` | Hides the create button in the navigation bar. | 17.45.36 |
|
||||
@@ -150,6 +150,14 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
| `client-spoof` | Spoofs the YouTube or Vanced client to prevent playback issues. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `com.urbandroid.sleep`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `unlock-premium` | Unlocks all premium features. | all |
|
||||
</details>
|
||||
|
||||
### 📦 `com.ticktick.task`
|
||||
<details>
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 2.129.0
|
||||
version = 2.132.0
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,12 +1,23 @@
|
||||
package app.revanced.extensions
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import org.jf.dexlib2.iface.Method
|
||||
import org.jf.dexlib2.util.MethodUtil
|
||||
import org.w3c.dom.Node
|
||||
|
||||
// TODO: populate this to all patches
|
||||
/**
|
||||
* Convert a [MethodFingerprint] to a [PatchResultError].
|
||||
*
|
||||
* @return A [PatchResultError] for the [MethodFingerprint].
|
||||
*/
|
||||
fun MethodFingerprint.toErrorResult() = PatchResultError("Failed to resolve $name")
|
||||
|
||||
/**
|
||||
* Find the [MutableMethod] from a given [Method] in a [MutableClass].
|
||||
*
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.revanced.patches.sleepasandroid.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility([Package("com.urbandroid.sleep")])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class UnlockPremiumCompatibility
|
||||
@@ -0,0 +1,8 @@
|
||||
package app.revanced.patches.sleepasandroid.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object IsTrialFingerprint : MethodFingerprint(
|
||||
"Z",
|
||||
customFingerprint = { it.name == "isTrial" }
|
||||
)
|
||||
@@ -0,0 +1,36 @@
|
||||
package app.revanced.patches.sleepasandroid.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
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.sleepasandroid.annotations.UnlockPremiumCompatibility
|
||||
import app.revanced.patches.sleepasandroid.fingerprints.IsTrialFingerprint
|
||||
|
||||
@Patch
|
||||
@Name("unlock-premium")
|
||||
@Description("Unlocks all premium features.")
|
||||
@UnlockPremiumCompatibility
|
||||
class UnlockPremiumPatch : BytecodePatch(
|
||||
listOf(
|
||||
IsTrialFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
val method = IsTrialFingerprint.result!!.mutableMethod
|
||||
|
||||
method.addInstructions(
|
||||
0,
|
||||
"""
|
||||
const/4 v0, 0x0
|
||||
return v0
|
||||
"""
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.revanced.patches.youtube.layout.pivotbar.createbutton.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
@@ -19,7 +20,6 @@ import app.revanced.patches.youtube.layout.pivotbar.fingerprints.InitializeButto
|
||||
import app.revanced.patches.youtube.layout.pivotbar.resource.patch.ResolvePivotBarFingerprintsPatch
|
||||
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.REGISTER_TEMPLATE_REPLACEMENT
|
||||
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.injectHook
|
||||
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.toErrorResult
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.revanced.patches.youtube.layout.pivotbar.resource.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
@@ -13,7 +14,6 @@ import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
import app.revanced.patches.youtube.layout.pivotbar.annotations.PivotBarCompatibility
|
||||
import app.revanced.patches.youtube.layout.pivotbar.fingerprints.InitializeButtonsFingerprint
|
||||
import app.revanced.patches.youtube.layout.pivotbar.fingerprints.PivotBarConstructorFingerprint
|
||||
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.toErrorResult
|
||||
|
||||
@DependsOn([ResourceMappingPatch::class])
|
||||
@PivotBarCompatibility
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package app.revanced.patches.youtube.layout.pivotbar.shortsbutton.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
@@ -19,7 +20,6 @@ import app.revanced.patches.youtube.layout.pivotbar.shortsbutton.fingerprints.Pi
|
||||
import app.revanced.patches.youtube.layout.pivotbar.shortsbutton.fingerprints.PivotBarShortsButtonViewFingerprint
|
||||
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.REGISTER_TEMPLATE_REPLACEMENT
|
||||
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.injectHook
|
||||
import app.revanced.patches.youtube.layout.pivotbar.utils.InjectionUtils.toErrorResult
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package app.revanced.patches.youtube.layout.pivotbar.utils
|
||||
|
||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import org.jf.dexlib2.Opcode.MOVE_RESULT_OBJECT
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@@ -30,7 +27,4 @@ internal object InjectionUtils {
|
||||
hook.replace("REGISTER_INDEX", register.toString()),
|
||||
)
|
||||
}
|
||||
|
||||
// TODO: move this to a global extension class and use it in all patches
|
||||
fun MethodFingerprint.toErrorResult() = PatchResultError("Failed to resolve $name")
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36")
|
||||
"com.google.android.youtube", arrayOf("17.36.37", "17.41.37", "17.42.35", "17.43.36", "17.45.36")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object IsInOfflineModeCheckFingerprint : MethodFingerprint(
|
||||
"L",
|
||||
strings = listOf("bundle_is_in_offline_mode")
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object IsInOfflineModeCheckResultFingerprint : MethodFingerprint(
|
||||
"L",
|
||||
parameters = listOf("L", "L", "L", "L", "L"),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.MOVE_OBJECT,
|
||||
Opcode.MOVE_OBJECT,
|
||||
),
|
||||
)
|
||||
@@ -0,0 +1,22 @@
|
||||
package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
|
||||
|
||||
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 SetWordmarkHeaderFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L"),
|
||||
opcodes = listOf(
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.IGET_BOOLEAN,
|
||||
Opcode.IF_EQZ,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_STATIC,
|
||||
),
|
||||
customFingerprint = { methodDef -> methodDef.parameterTypes.first() == "Landroid/widget/ImageView;" }
|
||||
)
|
||||
@@ -1,11 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
|
||||
|
||||
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 WideSearchbarOneFingerprint : MethodFingerprint(
|
||||
"L", AccessFlags.PUBLIC or AccessFlags.FINAL, listOf("L", "L"),
|
||||
listOf(Opcode.IF_NEZ, Opcode.SGET_OBJECT, Opcode.IGET_OBJECT, Opcode.INVOKE_STATIC)
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object WideSearchbarOneParentFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PRIVATE or AccessFlags.FINAL, listOf("L"),
|
||||
strings = listOf("FEhistory", "FEmy_videos", "FEpurchases")
|
||||
)
|
||||
@@ -1,12 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
|
||||
|
||||
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 WideSearchbarTwoFingerprint : MethodFingerprint(
|
||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, opcodes = listOf(
|
||||
Opcode.INVOKE_STATIC, Opcode.MOVE_RESULT, Opcode.IF_EQZ, Opcode.NEW_INSTANCE
|
||||
)
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.widesearchbar.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object WideSearchbarTwoParentFingerprint : MethodFingerprint(
|
||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L"),
|
||||
strings = listOf("VIDEO_QUALITIES_QUICK_MENU_BOTTOM_SHEET_FRAGMENT")
|
||||
)
|
||||
@@ -1,11 +1,13 @@
|
||||
package app.revanced.patches.youtube.layout.widesearchbar.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.data.toMethodWalker
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
@@ -13,15 +15,14 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility
|
||||
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarOneFingerprint
|
||||
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarOneParentFingerprint
|
||||
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarTwoFingerprint
|
||||
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarTwoParentFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
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 app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility
|
||||
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.IsInOfflineModeCheckFingerprint
|
||||
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.IsInOfflineModeCheckResultFingerprint
|
||||
import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.SetWordmarkHeaderFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||
@@ -31,9 +32,38 @@ import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
@Version("0.0.1")
|
||||
class WideSearchbarPatch : BytecodePatch(
|
||||
listOf(
|
||||
WideSearchbarOneParentFingerprint, WideSearchbarTwoParentFingerprint
|
||||
SetWordmarkHeaderFingerprint, IsInOfflineModeCheckFingerprint
|
||||
)
|
||||
) {
|
||||
private companion object {
|
||||
/**
|
||||
* Walk a fingerprints method at a given index mutably.
|
||||
*
|
||||
* @param index The index to walk at.
|
||||
* @param fromFingerprint The fingerprint to walk the method on.
|
||||
* @return The [MutableMethod] which was walked on.
|
||||
*/
|
||||
fun BytecodeContext.walkMutable(index: Int, fromFingerprint: MethodFingerprint) =
|
||||
fromFingerprint.result?.let {
|
||||
toMethodWalker(it.method).nextMethod(index, true).getMethod() as MutableMethod
|
||||
} ?: throw SetWordmarkHeaderFingerprint.toErrorResult()
|
||||
|
||||
|
||||
/**
|
||||
* Injects instructions required for certain methods.
|
||||
*
|
||||
*/
|
||||
fun MutableMethod.injectSearchBarHook() {
|
||||
addInstructions(
|
||||
implementation!!.instructions.size - 1,
|
||||
"""
|
||||
invoke-static {}, Lapp/revanced/integrations/patches/NewActionbarPatch;->getNewActionBar()Z
|
||||
move-result p0
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
@@ -45,76 +75,20 @@ class WideSearchbarPatch : BytecodePatch(
|
||||
)
|
||||
)
|
||||
|
||||
WideSearchbarOneFingerprint.resolve(context, WideSearchbarOneParentFingerprint.result!!.classDef)
|
||||
WideSearchbarTwoFingerprint.resolve(context, WideSearchbarTwoParentFingerprint.result!!.classDef)
|
||||
// resolve fingerprints
|
||||
IsInOfflineModeCheckFingerprint.result?.let {
|
||||
if (!IsInOfflineModeCheckResultFingerprint.resolve(context, it.classDef))
|
||||
return IsInOfflineModeCheckResultFingerprint.toErrorResult()
|
||||
} ?: return IsInOfflineModeCheckFingerprint.toErrorResult()
|
||||
|
||||
val resultOne = WideSearchbarOneFingerprint.result
|
||||
|
||||
//This should be the method aF in class fbn
|
||||
val targetMethodOne =
|
||||
context.toMethodWalker(resultOne!!.method)
|
||||
.nextMethod(resultOne.scanResult.patternScanResult!!.endIndex, true).getMethod() as MutableMethod
|
||||
|
||||
//Since both methods have the same smali code, inject instructions using a method.
|
||||
addInstructions(targetMethodOne)
|
||||
|
||||
val resultTwo = WideSearchbarTwoFingerprint.result
|
||||
|
||||
//This should be the method aB in class fbn
|
||||
val targetMethodTwo =
|
||||
context.toMethodWalker(resultTwo!!.method)
|
||||
.nextMethod(resultTwo.scanResult.patternScanResult!!.startIndex, true).getMethod() as MutableMethod
|
||||
|
||||
//Since both methods have the same smali code, inject instructions using a method.
|
||||
addInstructions(targetMethodTwo)
|
||||
// patch methods
|
||||
mapOf(
|
||||
SetWordmarkHeaderFingerprint to 1,
|
||||
IsInOfflineModeCheckResultFingerprint to 0
|
||||
).forEach { (fingerprint, callIndex) ->
|
||||
context.walkMutable(callIndex, fingerprint).injectSearchBarHook()
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun addInstructions(method: MutableMethod) {
|
||||
val index = method.implementation!!.instructions.size - 1
|
||||
method.addInstructions(
|
||||
index, """
|
||||
invoke-static {}, Lapp/revanced/integrations/patches/NewActionbarPatch;->getNewActionBar()Z
|
||||
move-result p0
|
||||
"""
|
||||
)
|
||||
}
|
||||
|
||||
//targetMethodOne: in class fbn
|
||||
/*
|
||||
.method public static aF(Ltxm;)Z
|
||||
invoke-virtual {p0}, Ltxm;->b()Lahah;
|
||||
move-result-object p0
|
||||
iget-object p0, p0, Lahah;->e:Lakfd;
|
||||
if-nez p0, :cond_a
|
||||
sget-object p0, Lakfd;->a:Lakfd;
|
||||
:cond_a
|
||||
iget-boolean p0, p0, Lakfd;->V:Z
|
||||
//added code here:
|
||||
invoke-static {}, app/revanced/integrations/patches/NewActionbarPatch;->getNewActionBar()Z
|
||||
move-result p0
|
||||
//original code here:
|
||||
return p0
|
||||
.end method
|
||||
*/
|
||||
|
||||
//targetMethodTwo: in class fbn
|
||||
/*
|
||||
.method public static aB(Ltxm;)Z
|
||||
invoke-virtual {p0}, Ltxm;->b()Lahah;
|
||||
move-result-object p0
|
||||
iget-object p0, p0, Lahah;->e:Lakfd;
|
||||
if-nez p0, :cond_a
|
||||
sget-object p0, Lakfd;->a:Lakfd;
|
||||
:cond_a
|
||||
iget-boolean p0, p0, Lakfd;->y:Z
|
||||
//added code here:
|
||||
invoke-static {}, app/revanced/integrations/patches/NewActionbarPatch;->getNewActionBar()Z
|
||||
move-result p0
|
||||
//original code here:
|
||||
return p0
|
||||
.end method
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user