Compare commits

..

6 Commits

Author SHA1 Message Date
semantic-release-bot
4f686935c3 chore: Release v5.25.0-dev.2 [skip ci]
# [5.25.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.25.0-dev.1...v5.25.0-dev.2) (2025-05-22)

### Bug Fixes

* **Disable Pairip license check:** Change patch to default off ([798596f](798596fd83))
2025-05-22 10:18:30 +00:00
LisoUseInAIKyrios
798596fd83 fix(Disable Pairip license check): Change patch to default off 2025-05-22 12:14:33 +02:00
semantic-release-bot
38b37f182a chore: Release v5.25.0-dev.1 [skip ci]
# [5.25.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.24.0...v5.25.0-dev.1) (2025-05-22)

### Features

* Add `Disable pairip license check` patch ([#4927](https://github.com/ReVanced/revanced-patches/issues/4927)) ([dea7108](dea7108c45))
* **Messenger:** Add `Remove Meta AI` patch ([#4945](https://github.com/ReVanced/revanced-patches/issues/4945)) ([52b9dc5](52b9dc5c9f))
2025-05-22 08:39:21 +00:00
Dawid Krajcarz
52b9dc5c9f feat(Messenger): Add Remove Meta AI patch (#4945) 2025-05-22 10:35:31 +02:00
hoodles
dea7108c45 feat: Add Disable pairip license check patch (#4927)
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
2025-05-22 10:35:16 +02:00
github-actions[bot]
24b4579cb9 chore: Sync translations (#5009) 2025-05-22 10:33:36 +02:00
23 changed files with 441 additions and 82 deletions

View File

@@ -1,3 +1,18 @@
# [5.25.0-dev.2](https://github.com/ReVanced/revanced-patches/compare/v5.25.0-dev.1...v5.25.0-dev.2) (2025-05-22)
### Bug Fixes
* **Disable Pairip license check:** Change patch to default off ([74b6a94](https://github.com/ReVanced/revanced-patches/commit/74b6a94577ac3f73b04bd0cce98fb7011a6607fd))
# [5.25.0-dev.1](https://github.com/ReVanced/revanced-patches/compare/v5.24.0...v5.25.0-dev.1) (2025-05-22)
### Features
* Add `Disable pairip license check` patch ([#4927](https://github.com/ReVanced/revanced-patches/issues/4927)) ([42d2c27](https://github.com/ReVanced/revanced-patches/commit/42d2c277982ef63e6ad42d85e46f13c3ab50243c))
* **Messenger:** Add `Remove Meta AI` patch ([#4945](https://github.com/ReVanced/revanced-patches/issues/4945)) ([012dff7](https://github.com/ReVanced/revanced-patches/commit/012dff7b6511b9e519ccac96f6713cf1a1b327b4))
# [5.24.0](https://github.com/ReVanced/revanced-patches/compare/v5.23.0...v5.24.0) (2025-05-19)

View File

@@ -0,0 +1,3 @@
dependencies {
compileOnly(project(":extensions:shared:library"))
}

View File

@@ -0,0 +1 @@
<manifest/>

View File

@@ -0,0 +1,15 @@
package app.revanced.extension.messenger.metaai;
@SuppressWarnings("unused")
public class RemoveMetaAIPatch {
public static boolean overrideConfigBool(long id, boolean value) {
// It seems like all configs starting with 363219 are related to Meta AI.
// A list of specific ones that need disabling would probably be better,
// but these config numbers seem to change slightly with each update.
// These first 6 digits don't though.
if (Long.toString(id).startsWith("363219"))
return false;
return value;
}
}

View File

@@ -3,4 +3,4 @@ org.gradle.jvmargs = -Xms512M -Xmx2048M
org.gradle.parallel = true
android.useAndroidX = true
kotlin.code.style = official
version = 5.24.0
version = 5.25.0-dev.2

View File

@@ -284,6 +284,14 @@ public final class app/revanced/patches/messenger/inputfield/DisableTypingIndica
public static final fun getDisableTypingIndicatorPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/messenger/metaai/RemoveMetaAIPatchKt {
public static final fun getRemoveMetaAIPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/messenger/misc/extension/ExtensionPatchKt {
public static final fun getSharedExtensionPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/messenger/navbar/RemoveMetaAITabPatchKt {
public static final fun getRemoveMetaAITabPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
@@ -652,6 +660,10 @@ public final class app/revanced/patches/shared/misc/mapping/ResourceMappingPatch
public static final fun getResourceMappings ()Ljava/util/List;
}
public final class app/revanced/patches/shared/misc/pairip/license/DisableLicenseCheckPatchKt {
public static final fun getDisableLicenseCheckPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}
public final class app/revanced/patches/shared/misc/settings/SettingsPatchKt {
public static final fun settingsPatch (Ljava/util/List;Ljava/util/Set;)Lapp/revanced/patcher/patch/ResourcePatch;
public static final fun settingsPatch (Lkotlin/Pair;Ljava/util/Set;)Lapp/revanced/patcher/patch/ResourcePatch;
@@ -1615,8 +1627,24 @@ public final class app/revanced/util/BytecodeUtilsKt {
public static final fun indexOfFirstResourceIdOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/String;)I
public static final fun injectHideViewCall (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;IILjava/lang/String;Ljava/lang/String;)V
public static final fun literal (Lapp/revanced/patcher/FingerprintBuilder;Lkotlin/jvm/functions/Function0;)V
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;B)V
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;C)V
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;D)V
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;F)V
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;I)V
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;J)V
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;S)V
public static final fun returnEarly (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;Z)V
public static synthetic fun returnEarly$default (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ZILjava/lang/Object;)V
public static final fun returnLate (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;B)V
public static final fun returnLate (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;C)V
public static final fun returnLate (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;D)V
public static final fun returnLate (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;F)V
public static final fun returnLate (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;I)V
public static final fun returnLate (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;J)V
public static final fun returnLate (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;S)V
public static final fun returnLate (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;Z)V
public static synthetic fun returnLate$default (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;ZILjava/lang/Object;)V
public static final fun transformMethods (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableClass;Lkotlin/jvm/functions/Function1;)V
public static final fun traverseClassHierarchy (Lapp/revanced/patcher/patch/BytecodePatchContext;Lapp/revanced/patcher/util/proxy/mutableTypes/MutableClass;Lkotlin/jvm/functions/Function1;)V
}

View File

@@ -17,7 +17,8 @@ val removeShareTargetsPatch = resourcePatch(
try {
document("res/xml/shortcuts.xml")
} catch (_: FileNotFoundException) {
return@execute Logger.getLogger(this::class.java.name).warning("The app has no shortcuts")
return@execute Logger.getLogger(this::class.java.name).warning(
"The app has no shortcuts. No changes applied.")
}.use { document ->
val rootNode = document.getNode("shortcuts") as? Element ?: return@use

View File

@@ -1,14 +1,17 @@
package app.revanced.patches.angulus.ads
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.shared.misc.pairip.license.disableLicenseCheckPatch
import app.revanced.util.returnEarly
@Suppress("unused")
val angulusPatch = bytecodePatch(name = "Hide ads") {
compatibleWith("com.drinkplusplus.angulus")
dependsOn(disableLicenseCheckPatch)
execute {
// Always return 0 as the daily measurement count.
getDailyMeasurementCountFingerprint.method.returnEarly()
getDailyMeasurementCountFingerprint.method.returnEarly(0)
}
}

View File

@@ -0,0 +1,14 @@
package app.revanced.patches.messenger.metaai
import com.android.tools.smali.dexlib2.Opcode
import app.revanced.patcher.fingerprint
internal val getMobileConfigBoolFingerprint = fingerprint {
parameters("J")
returns("Z")
opcodes(Opcode.RETURN)
custom { method, classDef ->
method.implementation ?: return@custom false // unsure if this is necessary
classDef.interfaces.contains("Lcom/facebook/mobileconfig/factory/MobileConfigUnsafeContext;")
}
}

View File

@@ -0,0 +1,34 @@
package app.revanced.patches.messenger.metaai
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.messenger.misc.extension.sharedExtensionPatch
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/messenger/metaai/RemoveMetaAIPatch;"
@Suppress("unused")
val removeMetaAIPatch = bytecodePatch(
name = "Remove Meta AI",
description = "Removes UI elements related to Meta AI."
) {
compatibleWith("com.facebook.orca")
dependsOn(sharedExtensionPatch)
execute {
getMobileConfigBoolFingerprint.method.apply {
val returnIndex = getMobileConfigBoolFingerprint.patternMatch!!.startIndex
val returnRegister = getInstruction<OneRegisterInstruction>(returnIndex).registerA
addInstructions(
returnIndex,
"""
invoke-static { p1, p2, v$returnRegister }, $EXTENSION_CLASS_DESCRIPTOR->overrideConfigBool(JZ)Z
move-result v$returnRegister
"""
)
}
}
}

View File

@@ -0,0 +1,5 @@
package app.revanced.patches.messenger.misc.extension
import app.revanced.patches.shared.misc.extension.sharedExtensionPatch
val sharedExtensionPatch = sharedExtensionPatch("messenger", mainActivityOnCreateHook)

View File

@@ -0,0 +1,7 @@
package app.revanced.patches.messenger.misc.extension
import app.revanced.patches.shared.misc.extension.extensionHook
internal val mainActivityOnCreateHook = extensionHook {
strings("MainActivity_onCreate_begin")
}

View File

@@ -1,16 +0,0 @@
package app.revanced.patches.messenger.navbar
import app.revanced.patcher.fingerprint
import com.android.tools.smali.dexlib2.Opcode
internal val createTabConfigurationFingerprint = fingerprint {
strings("MessengerTabConfigurationCreator.createTabConfiguration")
opcodes(
Opcode.INVOKE_DIRECT,
Opcode.MOVE_RESULT,
Opcode.IF_EQZ,
Opcode.INVOKE_DIRECT,
Opcode.MOVE_RESULT,
Opcode.IF_EQZ,
)
}

View File

@@ -1,25 +1,12 @@
package app.revanced.patches.messenger.navbar
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import app.revanced.patches.messenger.metaai.removeMetaAIPatch
@Deprecated("Superseded by removeMetaAIPatch", ReplaceWith("removeMetaAIPatch"))
@Suppress("unused")
val removeMetaAITabPatch = bytecodePatch(
name = "Remove Meta AI tab",
description = "Removes the 'Meta AI' tab from the navbar.",
) {
compatibleWith("com.facebook.orca")
execute {
createTabConfigurationFingerprint.let {
val moveResultIndex = it.patternMatch!!.startIndex + 1
val enabledRegister = it.method.getInstruction<OneRegisterInstruction>(moveResultIndex).registerA
it.method.replaceInstruction(
moveResultIndex,
"const/4 v$enabledRegister, 0x0"
)
}
}
dependsOn(removeMetaAIPatch)
}

View File

@@ -0,0 +1,27 @@
package app.revanced.patches.shared.misc.pairip.license
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.util.returnEarly
import java.util.logging.Logger
@Suppress("unused")
val disableLicenseCheckPatch = bytecodePatch(
name = "Disable Pairip license check",
description = "Disable Play Integrity Protect (Pairip) client-side license check.",
use = false
) {
execute {
if (processLicenseResponseFingerprint.methodOrNull == null || validateLicenseResponseFingerprint.methodOrNull == null) {
return@execute Logger.getLogger(this::class.java.name)
.warning("Could not find Pairip licensing check. No changes applied.")
}
// Set first parameter (responseCode) to 0 (success status).
processLicenseResponseFingerprint.method.addInstruction(0, "const/4 p1, 0x0")
// Short-circuit the license response validation.
validateLicenseResponseFingerprint.method.returnEarly()
}
}

View File

@@ -0,0 +1,17 @@
package app.revanced.patches.shared.misc.pairip.license
import app.revanced.patcher.fingerprint
internal val processLicenseResponseFingerprint = fingerprint {
custom { method, classDef ->
classDef.type == "Lcom/pairip/licensecheck/LicenseClient;" &&
method.name == "processResponse"
}
}
internal val validateLicenseResponseFingerprint = fingerprint {
custom { method, classDef ->
classDef.type == "Lcom/pairip/licensecheck/ResponseValidator;" &&
method.name == "validateResponse"
}
}

View File

@@ -133,6 +133,7 @@ internal val Instruction.registersUsed: List<Int>
else -> listOf(registerC, registerD, registerE, registerF, registerG)
}
}
is ThreeRegisterInstruction -> listOf(registerA, registerB, registerC)
is TwoRegisterInstruction -> listOf(registerA, registerB)
is OneRegisterInstruction -> listOf(registerA)
@@ -170,7 +171,7 @@ internal val Instruction.isReturnInstruction: Boolean
/**
* Adds public [AccessFlags] and removes private and protected flags (if present).
*/
internal fun Int.toPublicAccessFlags() : Int {
internal fun Int.toPublicAccessFlags(): Int {
return this.or(AccessFlags.PUBLIC.value)
.and(AccessFlags.PROTECTED.value.inv())
.and(AccessFlags.PRIVATE.value.inv())
@@ -489,9 +490,10 @@ fun Method.indexOfFirstInstruction(targetOpcode: Opcode): Int = indexOfFirstInst
* @return The index of the first opcode specified, or -1 if not found.
* @see indexOfFirstInstructionOrThrow
*/
fun Method.indexOfFirstInstruction(startIndex: Int = 0, targetOpcode: Opcode): Int = indexOfFirstInstruction(startIndex) {
opcode == targetOpcode
}
fun Method.indexOfFirstInstruction(startIndex: Int = 0, targetOpcode: Opcode): Int =
indexOfFirstInstruction(startIndex) {
opcode == targetOpcode
}
/**
* Get the index of the first [Instruction] that matches the predicate, starting from [startIndex].
@@ -526,9 +528,10 @@ fun Method.indexOfFirstInstructionOrThrow(targetOpcode: Opcode): Int = indexOfFi
* @throws PatchException
* @see indexOfFirstInstruction
*/
fun Method.indexOfFirstInstructionOrThrow(startIndex: Int = 0, targetOpcode: Opcode): Int = indexOfFirstInstructionOrThrow(startIndex) {
opcode == targetOpcode
}
fun Method.indexOfFirstInstructionOrThrow(startIndex: Int = 0, targetOpcode: Opcode): Int =
indexOfFirstInstructionOrThrow(startIndex) {
opcode == targetOpcode
}
/**
* Get the index of the first [Instruction] that matches the predicate, starting from [startIndex].
@@ -554,9 +557,10 @@ fun Method.indexOfFirstInstructionOrThrow(startIndex: Int = 0, filter: Instructi
* @return -1 if the instruction is not found.
* @see indexOfFirstInstructionReversedOrThrow
*/
fun Method.indexOfFirstInstructionReversed(startIndex: Int? = null, targetOpcode: Opcode): Int = indexOfFirstInstructionReversed(startIndex) {
opcode == targetOpcode
}
fun Method.indexOfFirstInstructionReversed(startIndex: Int? = null, targetOpcode: Opcode): Int =
indexOfFirstInstructionReversed(startIndex) {
opcode == targetOpcode
}
/**
* Get the index of matching instruction,
@@ -593,9 +597,10 @@ fun Method.indexOfFirstInstructionReversed(targetOpcode: Opcode): Int = indexOfF
* @return The index of the instruction.
* @see indexOfFirstInstructionReversed
*/
fun Method.indexOfFirstInstructionReversedOrThrow(startIndex: Int? = null, targetOpcode: Opcode): Int = indexOfFirstInstructionReversedOrThrow(startIndex) {
opcode == targetOpcode
}
fun Method.indexOfFirstInstructionReversedOrThrow(startIndex: Int? = null, targetOpcode: Opcode): Int =
indexOfFirstInstructionReversedOrThrow(startIndex) {
opcode == targetOpcode
}
/**
* Get the index of matching instruction,
@@ -652,7 +657,8 @@ fun Method.findInstructionIndicesReversedOrThrow(filter: Instruction.() -> Boole
* _Returns an empty list if no indices are found_
* @see findInstructionIndicesReversedOrThrow
*/
fun Method.findInstructionIndicesReversed(opcode: Opcode): List<Int> = findInstructionIndicesReversed { this.opcode == opcode }
fun Method.findInstructionIndicesReversed(opcode: Opcode): List<Int> =
findInstructionIndicesReversed { this.opcode == opcode }
/**
* @return An immutable list of indices of the opcode in reverse order.
@@ -726,43 +732,222 @@ fun BytecodePatchContext.forEachLiteralValueInstruction(
}
}
/**
* Overrides the first instruction of a method with a constant return value.
* None of the method code will ever execute.
*/
fun MutableMethod.returnEarly(overrideValue: Boolean = false) = overrideReturnValue(overrideValue, false)
private const val RETURN_TYPE_MISMATCH = "Mismatch between override type and Method return type"
/**
* Overrides all return statements with a constant value.
* Overrides the first instruction of a method with a constant `Boolean` return value.
* None of the method code will ever execute.
*
* For methods that return an object or any array type, calling this method with `false`
* will force the method to return a `null` value.
*/
fun MutableMethod.returnEarly(value: Boolean = false) {
val returnType = returnType.first()
check(returnType == 'Z' || (!value && (returnType in setOf('V', 'L', '[')))) { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toHexString(), false)
}
/**
* Overrides the first instruction of a method with a constant `Byte` return value.
* None of the method code will ever execute.
*/
fun MutableMethod.returnEarly(value: Byte) {
check(returnType.first() == 'B') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), false)
}
/**
* Overrides the first instruction of a method with a constant `Short` return value.
* None of the method code will ever execute.
*/
fun MutableMethod.returnEarly(value: Short) {
check(returnType.first() == 'S') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), false)
}
/**
* Overrides the first instruction of a method with a constant `Char` return value.
* None of the method code will ever execute.
*/
fun MutableMethod.returnEarly(value: Char) {
check(returnType.first() == 'C') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.code.toString(), false)
}
/**
* Overrides the first instruction of a method with a constant `Int` return value.
* None of the method code will ever execute.
*/
fun MutableMethod.returnEarly(value: Int) {
check(returnType.first() == 'I') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), false)
}
/**
* Overrides the first instruction of a method with a constant `Long` return value.
* None of the method code will ever execute.
*/
fun MutableMethod.returnEarly(value: Long) {
check(returnType.first() == 'J') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), false)
}
/**
* Overrides the first instruction of a method with a constant `Float` return value.
* None of the method code will ever execute.
*/
fun MutableMethod.returnEarly(value: Float) {
check(returnType.first() == 'F') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), false)
}
/**
* Overrides the first instruction of a method with a constant `Double` return value.
* None of the method code will ever execute.
*/
fun MutableMethod.returnEarly(value: Double) {
check(returnType.first() == 'J') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), false)
}
/**
* Overrides all return statements with a constant `Boolean` value.
* All method code is executed the same as unpatched.
*
* For methods that return an object or any array type, calling this method with `false`
* will force the method to return a `null` value.
*
* @see returnEarly
*/
fun MutableMethod.returnLate(value: Boolean) {
val returnType = returnType.first()
if (returnType == 'V') {
error("Cannot return late for Method of void type")
}
check(returnType == 'Z' || (!value && returnType in setOf('L', '['))) { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toHexString(), true)
}
/**
* Overrides all return statements with a constant `Byte` value.
* All method code is executed the same as unpatched.
*
* @see returnEarly
*/
internal fun MutableMethod.returnLate(overrideValue: Boolean = false) = overrideReturnValue(overrideValue, true)
fun MutableMethod.returnLate(value: Byte) {
check(returnType.first() == 'B') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), true)
}
private fun MutableMethod.overrideReturnValue(bool: Boolean, returnLate: Boolean) {
val const = if (bool) "0x1" else "0x0"
/**
* Overrides all return statements with a constant `Short` value.
* All method code is executed the same as unpatched.
*
* @see returnEarly
*/
fun MutableMethod.returnLate(value: Short) {
check(returnType.first() == 'S') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), true)
}
/**
* Overrides all return statements with a constant `Char` value.
* All method code is executed the same as unpatched.
*
* @see returnEarly
*/
fun MutableMethod.returnLate(value: Char) {
check(returnType.first() == 'C') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.code.toString(), true)
}
/**
* Overrides all return statements with a constant `Int` value.
* All method code is executed the same as unpatched.
*
* @see returnEarly
*/
fun MutableMethod.returnLate(value: Int) {
check(returnType.first() == 'I') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), true)
}
/**
* Overrides all return statements with a constant `Long` value.
* All method code is executed the same as unpatched.
*
* @see returnEarly
*/
fun MutableMethod.returnLate(value: Long) {
check(returnType.first() == 'J') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), true)
}
/**
* Overrides all return statements with a constant `Float` value.
* All method code is executed the same as unpatched.
*
* @see returnEarly
*/
fun MutableMethod.returnLate(value: Float) {
check(returnType.first() == 'F') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), true)
}
/**
* Overrides all return statements with a constant `Double` value.
* All method code is executed the same as unpatched.
*
* @see returnEarly
*/
fun MutableMethod.returnLate(value: Double) {
check(returnType.first() == 'D') { RETURN_TYPE_MISMATCH }
overrideReturnValue(value.toString(), true)
}
private fun MutableMethod.overrideReturnValue(value: String, returnLate: Boolean) {
val instructions = when (returnType.first()) {
'L' -> {
// If return type is an object, always return null.
'L', '[' -> {
"""
const/4 v0, $const
const/4 v0, 0x0
return-object v0
"""
}
'V' -> {
if (returnLate) throw IllegalArgumentException("Cannot return late for method of void type")
"return-void"
}
'I', 'Z' -> {
'B', 'Z' -> {
"""
const/4 v0, $const
const/4 v0, $value
return v0
"""
}
'S', 'C' -> {
"""
const/16 v0, $value
return v0
"""
}
'I', 'F' -> {
"""
const v0, $value
return v0
"""
}
'J', 'D' -> {
"""
const-wide v0, $value
return-wide v0
"""
}
else -> throw Exception("Return type is not supported: $this")
}

View File

@@ -6,3 +6,5 @@ internal object Utils {
.joinToString("\n") { it.trimIndent() } // Remove the leading whitespace from each line.
.trimIndent() // Remove the leading newline.
}
internal fun Boolean.toHexString(): String = if (this) "0x1" else "0x0"

View File

@@ -42,7 +42,7 @@ Second \"item\" text"</string>
<string name="revanced_settings_import_reset">إعادة تعيين إعدادات ReVanced إلى الوضع الافتراضي</string>
<string name="revanced_settings_import_success">تم استيراد %d إعدادات</string>
<string name="revanced_settings_import_failure_parse">فشل الاستيراد: %s</string>
<string name="revanced_settings_search_hint">إعدادات البحث</string>
<string name="revanced_settings_search_hint">بحث الإعدادات</string>
<string name="revanced_settings_search_no_results_title">لم يتم العثور على نتائج لـ \".%s\"</string>
<string name="revanced_settings_search_no_results_summary">جرّب كلمة مفتاحية أخرى</string>
<string name="revanced_settings_search_remove_message">إزالة من سجل البحث؟</string>
@@ -97,9 +97,9 @@ Second \"item\" text"</string>
<string name="revanced_restore_old_settings_menus_title">استعادة قوائم الإعدادات القديمة</string>
<string name="revanced_restore_old_settings_menus_summary_on">يتم عرض قوائم الإعدادات القديمة</string>
<string name="revanced_restore_old_settings_menus_summary_off">لا يتم عرض قوائم الإعدادات القديمة</string>
<string name="revanced_settings_search_history_title">إظهار سجل البحث في الإعدادات</string>
<string name="revanced_settings_search_history_summary_on">سجل البحث في الإعدادات معروض</string>
<string name="revanced_settings_search_history_summary_off">لم يتم عرض سجل البحث في الإعدادات</string>
<string name="revanced_settings_search_history_title">عرض سجل بحث الإعدادات</string>
<string name="revanced_settings_search_history_summary_on">يتم عرض سجل البحث في الإعدادات</string>
<string name="revanced_settings_search_history_summary_off">لا يتم عرض سجل البحث في الإعدادات</string>
</patch>
<patch id="misc.backgroundplayback.backgroundPlaybackPatch">
<string name="revanced_shorts_disable_background_playback_title">تعطيل تشغيل فيديوهات Shorts في الخلفية</string>

View File

@@ -42,7 +42,7 @@ Second \"item\" text"</string>
<string name="revanced_settings_import_reset">ReVanced tənzimləmələr standarta təyin edildi</string>
<string name="revanced_settings_import_success">%d tənzimləmə idxal edildi</string>
<string name="revanced_settings_import_failure_parse">Uğursuz idxal prosesi: %s</string>
<string name="revanced_settings_search_hint">Axtarış tənzimləmələri</string>
<string name="revanced_settings_search_hint">Tənzimləmələri axtar</string>
<string name="revanced_settings_search_no_results_title">%s üçün nəticə tapılmadı</string>
<string name="revanced_settings_search_no_results_summary">Başqa açar sözü yoxla</string>
<string name="revanced_settings_search_remove_message">Axtarış tarixçəsindən silinsin?</string>

View File

@@ -42,21 +42,48 @@ Second \"item\" text"</string>
<string name="revanced_settings_import_reset">بازگرداندن تنظیمات ReVanced به پیش‌فرض</string>
<string name="revanced_settings_import_success">%d تنظیمات وارد شدند</string>
<string name="revanced_settings_import_failure_parse">واردکردن انجام نشد: %s</string>
<string name="revanced_settings_search_hint">تنظیمات جستجو</string>
<string name="revanced_settings_search_no_results_title">نتایجی برای %s یافت نشد</string>
<string name="revanced_settings_search_no_results_summary">کلیدواژه دیگری را امتحان کنید</string>
<string name="revanced_settings_search_remove_message">حذف از تاریخچه جستجو؟</string>
<string name="revanced_show_menu_icons_title">نمایش آیکون تنظیمات ReVanced</string>
<string name="revanced_show_menu_icons_summary_on">نمادهای تنظیمات نشان داده می‌شوند</string>
<string name="revanced_show_menu_icons_summary_off">نمادهای تنظیمات نمایش داده نمی شوند</string>
<string name="revanced_language_title">زبان ReVanced</string>
<string name="revanced_language_DEFAULT">زبان برنامه</string>
<string name="revanced_pref_import_export_title">وارد کردن/صادر کردن</string>
<string name="revanced_pref_import_export_summary">وارد کردن / صادر کردن تنظیمات ReVanced</string>
<!-- Settings about dialog. -->
<string name="revanced_settings_about_links_body">شما درحال استفاده از نسخه &lt;i&gt;%s&lt;/i&gt; از پچ Revanced هستید</string>
<string name="revanced_settings_about_links_dev_header">توجه</string>
<string name="revanced_settings_about_links_header">لینک‌های رسمی</string>
<!-- NOTE: the about strings above are duplicated in the TikTok about screen code,
and changes made here must also be made there. -->
</patch>
<patch id="misc.gms.gmsCoreSupportResourcePatch">
<!-- Translations of this should not be longer than the original English text, otherwise the text can be clipped and not entirely shown. -->
<string name="gms_core_toast_not_installed_message">MicroG GmsCore نصب نشده است. آنرا نصب کنید.</string>
<string name="gms_core_dialog_title">اقدام لازم است</string>
<string name="gms_core_dialog_open_website_text">باز کردن تارنما</string>
<string name="gms_core_dialog_continue_text">ادامه</string>
</patch>
</app>
<app id="youtube">
<patch id="misc.settings.settingsPatch">
<string name="revanced_settings_screen_00_about_title">درباره</string>
<string name="revanced_settings_screen_04_general_title">عمومی</string>
<string name="revanced_settings_screen_05_player_title">اجراکننده</string>
<string name="revanced_settings_screen_07_seekbar_title">نوار جریان پخش</string>
<string name="revanced_settings_screen_12_video_title">ويدئو</string>
</patch>
<patch id="misc.backgroundplayback.backgroundPlaybackPatch">
</patch>
<patch id="misc.debugging.enableDebuggingPatch">
<string name="revanced_debug_screen_title">عیب‌یابی</string>
<string name="revanced_debug_screen_summary">فعال یا غیرفعال کردن گزینه‌های عیب یابی</string>
<string name="revanced_debug_title">گزارش عیب</string>
<string name="revanced_debug_summary_on">لاگ عیب فعال است</string>
<string name="revanced_debug_summary_off">لاگ عیب غیرفعال است</string>
</patch>
<patch id="layout.hide.general.hideLayoutComponentsPatch">
<!-- 'Join' should be translated using the same localized wording YouTube displays.
@@ -67,6 +94,10 @@ Second \"item\" text"</string>
<!-- 'People also watched' and 'You might also like' should be translated using the same localized wording YouTube displays. -->
<!-- 'Show more' should be translated with the same localized wording that YouTube displays.
This button usually appears when searching for a YT creator. -->
<string name="revanced_hide_show_more_button_title">پنهان سازی دکمه \'نمایش بیشتر\'</string>
<string name="revanced_hide_show_more_button_summary_on">دکمه پنهان است</string>
<string name="revanced_hide_show_more_button_summary_off">دکمه نمایان است</string>
<string name="revanced_hide_ticket_shelf_title">پنهان سازی قفسه بلیط</string>
<!-- https://logos.fandom.com/wiki/YouTube/Yoodles -->
<!-- 'Component path builder strings' is the technical name for identifying the Litho UI layout items to hide. This is an advanced feature and most users will never use this. -->
<!-- For localization, it is preferred, but not required, if 'LeBlanc' is replaced with a localized name or a familiar word that has upper case letters in the middle of the word.

View File

@@ -162,8 +162,8 @@ Ní chuirfear ar an eolas thú faoi aon imeachtaí gan choinne."</string>
<string name="revanced_hide_notify_me_button_summary_off">Taispeántar an cnaipe</string>
<!-- 'People also watched' and 'You might also like' should be translated using the same localized wording YouTube displays. -->
<string name="revanced_hide_search_result_recommendation_labels_title">Folaigh lipéid moltaí físeáin</string>
<string name="revanced_hide_search_result_recommendation_labels_summary_on">Tá lipéid \",,Dfhéach daoine eile air freisin\",, agus \",,Bfhéidir gur mhaith leat é seo freisin\",, folaithe</string>
<string name="revanced_hide_search_result_recommendation_labels_summary_off">Tá lipéid \",,Dfhéach daoine eile air freisin\",, agus \",,Bfhéidir gur mhaith leat é seo freisin\",, ar taispeáint</string>
<string name="revanced_hide_search_result_recommendation_labels_summary_on"> na lipéid \'Daoine a d\'fhéach orthu freisin\' agus \'B\'fhéidir gur mhaith leat freisin\' i bhfolach</string>
<string name="revanced_hide_search_result_recommendation_labels_summary_off">Taispeántar lipéid Daoine a dfhéach freisin agus Bfhéidir gur mhaith leat freisin</string>
<!-- 'Show more' should be translated with the same localized wording that YouTube displays.
This button usually appears when searching for a YT creator. -->
<string name="revanced_hide_show_more_button_title">Folaigh cnaipe \'Taispeáin tuilleadh\'</string>
@@ -263,8 +263,8 @@ Ní chuirfear ar an eolas thú faoi aon imeachtaí gan choinne."</string>
<string name="revanced_hide_key_concepts_section_summary_on">Tá an chuid Príomhchoincheapa i bhfolach</string>
<string name="revanced_hide_key_concepts_section_summary_off">Taispeántar an chuid Príomhchoincheapa</string>
<string name="revanced_hide_transcript_section_title">Folaigh Tras-scríbhinn</string>
<string name="revanced_hide_transcript_section_summary_on">Tá an chuid trasscríbhinne i bhfolach</string>
<string name="revanced_hide_transcript_section_summary_off">Taispeántar alt an trasscríbhinne</string>
<string name="revanced_hide_transcript_section_summary_on">Tá alt an tras-scríbhinn i bhfolach</string>
<string name="revanced_hide_transcript_section_summary_off">Taispeántar alt an tras-scríbhinn</string>
<string name="revanced_hide_description_components_screen_title">Cur síos físeán</string>
<string name="revanced_hide_description_components_screen_summary">Folaigh nó taispeáint comhpháirteanna tuairisc</string>
<string name="revanced_hide_filter_bar_screen_title">Barra scagaire</string>
@@ -278,8 +278,8 @@ Ní chuirfear ar an eolas thú faoi aon imeachtaí gan choinne."</string>
<string name="revanced_hide_filter_bar_feed_in_related_videos_title">Folaigh i bhfíseáin gaolmhara</string>
<string name="revanced_hide_filter_bar_feed_in_related_videos_summary_on">I bhfolach i bhfíseáin ghaolmhara</string>
<string name="revanced_hide_filter_bar_feed_in_related_videos_summary_off">Taispeántar i bhfíseáin ghaolmhara</string>
<string name="revanced_comments_screen_title">Tuairimí</string>
<string name="revanced_comments_screen_summary">Folaigh nó taispeáin comhpháirteanna na rannóige tuairimí</string>
<string name="revanced_comments_screen_title">Tráchtanna</string>
<string name="revanced_comments_screen_summary">Folaigh nó taispeáin comhpháirteanna na rannóige tráchtanna</string>
<string name="revanced_hide_comments_ai_chat_summary_title">Folaigh achoimre Comhrá AI</string>
<string name="revanced_hide_comments_ai_chat_summary_summary_on">Tá achoimre comhrá i bhfolach</string>
<string name="revanced_hide_comments_ai_chat_summary_summary_off">Taispeántar achoimre comhrá</string>

View File

@@ -42,8 +42,8 @@ Second \"item\" text"</string>
<string name="revanced_settings_import_reset">ReVanced 設定をデフォルトにリセット</string>
<string name="revanced_settings_import_success">%d 個の設定をインポートしました</string>
<string name="revanced_settings_import_failure_parse">インポート失敗: %s</string>
<string name="revanced_settings_search_hint">設定を検索</string>
<string name="revanced_settings_search_no_results_title">\'%s\' に一致する設定は見つかりませんでした</string>
<string name="revanced_settings_search_hint">ReVanced の設定を検索</string>
<string name="revanced_settings_search_no_results_title">\'%s\' に一致する ReVanced の設定は見つかりませんでした</string>
<string name="revanced_settings_search_no_results_summary">別のキーワードを試してください</string>
<string name="revanced_settings_search_remove_message">検索履歴から削除しますか?</string>
<string name="revanced_show_menu_icons_title">ReVanced 設定にアイコンを表示する</string>
@@ -98,9 +98,9 @@ MicroG GmsCore に対する電池の最適化を無効にしても、バッテ
<string name="revanced_restore_old_settings_menus_title">設定メニューを旧バージョンに戻す</string>
<string name="revanced_restore_old_settings_menus_summary_on">旧バージョンの設定メニューが表示されます</string>
<string name="revanced_restore_old_settings_menus_summary_off">通常の設定メニューが表示されます</string>
<string name="revanced_settings_search_history_title">設定検索履歴を表示する</string>
<string name="revanced_settings_search_history_summary_on">設定検索履歴は表示されます</string>
<string name="revanced_settings_search_history_summary_off">設定検索履歴は表示されません</string>
<string name="revanced_settings_search_history_title">設定検索履歴を表示する</string>
<string name="revanced_settings_search_history_summary_on">設定検索履歴は表示されます</string>
<string name="revanced_settings_search_history_summary_off">設定検索履歴は表示されません</string>
</patch>
<patch id="misc.backgroundplayback.backgroundPlaybackPatch">
<string name="revanced_shorts_disable_background_playback_title">ショート動画のバックグラウンド再生を無効にする</string>
@@ -1167,7 +1167,7 @@ Automotive レイアウト
<string name="revanced_change_start_page_always_summary_on">"スタート画面の変更は常時適用されます
制限事項: ツールバーの [戻る] ボタンが機能しない可能性があります"</string>
<string name="revanced_change_start_page_always_summary_off">スタート画面の変更はアプリ起動時にのみ適用されます</string>
<string name="revanced_change_start_page_always_summary_off">スタート画面の変更はアプリ起動時にのみ適用されます</string>
</patch>
<patch id="layout.startupshortsreset.disableResumingShortsOnStartupPatch">
<string name="revanced_disable_resuming_shorts_player_title">ショート動画プレーヤーの再開を無効にする</string>
@@ -1296,8 +1296,8 @@ Automotive レイアウト
</patch>
<patch id="misc.announcements.announcementsPatch">
<string name="revanced_announcements_title">ReVanced のお知らせを表示する</string>
<string name="revanced_announcements_summary_on">アプリ起動時にお知らせが表示されます</string>
<string name="revanced_announcements_summary_off">アプリ起動時にお知らせは表示されません</string>
<string name="revanced_announcements_summary_on">お知らせは、アプリ起動時に表示されます</string>
<string name="revanced_announcements_summary_off">お知らせは、アプリ起動時に表示されません</string>
<string name="revanced_announcements_enabled_summary">アプリ起動時にお知らせを表示する</string>
<string name="revanced_announcements_connection_failed">お知らせの取得に失敗しました</string>
<string name="revanced_announcements_dialog_dismiss">閉じる</string>