mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-17 00:03:57 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18a3f8e80c | ||
|
|
ce32c6f3f7 |
@@ -1,3 +1,10 @@
|
||||
## [2.13.2](https://github.com/revanced/revanced-patches/compare/v2.13.1...v2.13.2) (2022-07-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `hrd-auto-brightness` ([#152](https://github.com/revanced/revanced-patches/issues/152)) ([5f2e9ba](https://github.com/revanced/revanced-patches/commit/5f2e9ba30b7432be04bdc9f9f7ec7ac75fdc4b34))
|
||||
|
||||
## [2.13.1](https://github.com/revanced/revanced-patches/compare/v2.13.0...v2.13.1) (2022-07-11)
|
||||
|
||||
|
||||
|
||||
48
README.md
48
README.md
@@ -6,31 +6,31 @@
|
||||
|
||||
| 💊 Patch | 📜 Description | 🎯 Target Package | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|:-----------------:|
|
||||
| `swipe-controls` | Adds volume and brightness swipe controls. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `seekbar-tapping` | Enables tapping on the seekbar of the YouTube player. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `general-ads` | Removes general ads in bytecode. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `video-ads` | Removes ads in the YouTube video player. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `hide-infocard-suggestions` | Hides infocards in videos. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `custom-branding` | Changes the branding of YouTube. | `com.google.android.youtube` | all |
|
||||
| `premium-heading` | Shows premium branding on the YouTube home screen. | `com.google.android.youtube` | all |
|
||||
| `minimized-playback` | Enables minimized and background playback. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `disable-fullscreen-panels` | Disables comments panel in fullscreen view. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `old-quality-layout` | Enables the original quality flyout menu. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `hide-autoplay-button` | Disables the autoplay button. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `disable-create-button` | Disables the create button. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `amoled` | Enables pure black theme. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `hide-shorts-button` | Hides the shorts button. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `hide-cast-button` | Hides the cast button. | `com.google.android.youtube` | all |
|
||||
| `hide-watermark` | Hides the creator's watermark on videos. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `autorepeat-by-default` | Enables auto repeating of videos by default. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `custom-playback-speed` | Allows to change the default playback speed options. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `hdr-max-brightness` | Sets brightness to max for HDR videos in fullscreen mode. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `enable-debugging` | Enables app debugging by patching the manifest file. | `com.google.android.youtube` | all |
|
||||
| `background-play` | Enables playing music in the background. | `com.google.android.apps.youtube.music` | 5.03.50 |
|
||||
| `exclusive-audio-playback` | Adds the option to play music without video. | `com.google.android.apps.youtube.music` | 5.03.50 |
|
||||
| `codecs-unlock` | Enables more audio codecs. Usually results in better audio quality but may depend on song and device. | `com.google.android.apps.youtube.music` | 5.03.50 |
|
||||
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar in YouTube music. | `com.google.android.apps.youtube.music` | 5.03.50 |
|
||||
| `background-play` | Enables playing music in the background. | `com.google.android.apps.youtube.music` | 5.03.50 |
|
||||
| `tasteBuilder-remover` | Removes the "Tell us which artists you like" card from the Home screen. The same functionality can be triggered from the settings anyway. | `com.google.android.apps.youtube.music` | 5.03.50 |
|
||||
| `upgrade-button-remover` | Removes the upgrade tab from the pivot bar in YouTube music. | `com.google.android.apps.youtube.music` | 5.03.50 |
|
||||
| `hide-infocard-suggestions` | Hides infocards in videos. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `video-ads` | Removes ads in the YouTube video player. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `general-ads` | Removes general ads in bytecode. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `seekbar-tapping` | Enables tapping on the seekbar of the YouTube player. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `swipe-controls` | Adds volume and brightness swipe controls. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `microg-support` | Allows YouTube ReVanced to run without root and under a different package name. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `hdr-auto-brightness` | Makes the brightness of HDR videos follow the system default. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `autorepeat-by-default` | Enables auto repeating of videos by default. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `custom-playback-speed` | Allows to change the default playback speed options. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `enable-debugging` | Enables app debugging by patching the manifest file. | `com.google.android.youtube` | all |
|
||||
| `old-quality-layout` | Enables the original quality flyout menu. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `hide-cast-button` | Hides the cast button. | `com.google.android.youtube` | all |
|
||||
| `amoled` | Enables pure black theme. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `hide-autoplay-button` | Disables the autoplay button. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `minimized-playback` | Enables minimized and background playback. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `premium-heading` | Shows premium branding on the YouTube home screen. | `com.google.android.youtube` | all |
|
||||
| `custom-branding` | Changes the branding of YouTube. | `com.google.android.youtube` | all |
|
||||
| `enable-wide-searchbar` | Replaces the search icon with a wide search bar. This will hide the YouTube logo when active. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `disable-fullscreen-panels` | Disables comments panel in fullscreen view. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `hide-shorts-button` | Hides the shorts button. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `disable-create-button` | Disables the create button. | `com.google.android.youtube` | 17.26.35 |
|
||||
| `hide-watermark` | Hides the creator's watermark on videos. | `com.google.android.youtube` | 17.26.35 |
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 2.13.1
|
||||
version = 2.13.2
|
||||
|
||||
@@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.youtube", arrayOf("17.24.34", "17.24.35", "17.25.34", "17.26.35")
|
||||
"com.google.android.youtube", arrayOf("17.25.34", "17.26.35")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
||||
@@ -11,25 +11,34 @@ import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
|
||||
|
||||
@Name("hdrbrightness-fingerprint")
|
||||
@Name("hdr-brightness-fingerprint-ghz")
|
||||
@MatchingMethod(
|
||||
"Lghz;", "mZ"
|
||||
"Lghz;", "g"
|
||||
)
|
||||
@FuzzyPatternScanMethod(3)
|
||||
@HDRBrightnessCompatibility
|
||||
@Version("0.0.1")
|
||||
object HDRBrightnessFingerprint : MethodFingerprint(
|
||||
object HDRBrightnessFingerprintGHZ : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, null,
|
||||
listOf(
|
||||
/* WindowManager.LayoutParams lp = br.getWindow().getAttributes();
|
||||
* lp.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_FULL;
|
||||
* br.getWindow().setAttributes(lp);
|
||||
*/
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_HIGH16,
|
||||
Opcode.IPUT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL
|
||||
),
|
||||
null,
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.implementation!!.instructions.count() == 16 && methodDef.implementation!!.instructions.any {((it as? NarrowLiteralInstruction)?.narrowLiteral == (-1.0f).toRawBits())}
|
||||
methodDef.implementation!!.instructions.count() == 16 && methodDef.implementation!!.instructions.any {
|
||||
((it as? NarrowLiteralInstruction)?.narrowLiteral == (/*BRIGHTNESS_OVERRIDE_FULL*/ 1.0f).toRawBits())
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,44 @@
|
||||
package app.revanced.patches.youtube.misc.hdrbrightness.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.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.misc.hdrbrightness.annotations.HDRBrightnessCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
|
||||
|
||||
@Name("hdr-brightness-fingerprint-gul")
|
||||
@MatchingMethod(
|
||||
"Lgul;", "g"
|
||||
)
|
||||
@FuzzyPatternScanMethod(3)
|
||||
@HDRBrightnessCompatibility
|
||||
@Version("0.0.1")
|
||||
object HDRBrightnessFingerprintGUL : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, null,
|
||||
listOf(
|
||||
/* WindowManager.LayoutParams lp = br.getWindow().getAttributes();
|
||||
* lp.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_FULL;
|
||||
* br.getWindow().setAttributes(lp);
|
||||
*/
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_HIGH16,
|
||||
Opcode.IPUT,
|
||||
//Opcode.INVOKE_VIRTUAL,
|
||||
//Opcode.MOVE_RESULT_OBJECT,
|
||||
//Opcode.INVOKE_VIRTUAL
|
||||
),
|
||||
null,
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.implementation!!.instructions.count() == 14 && methodDef.implementation!!.instructions.any {
|
||||
((it as? NarrowLiteralInstruction)?.narrowLiteral == (/*BRIGHTNESS_OVERRIDE_FULL*/ 1.0f).toRawBits())
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,44 @@
|
||||
package app.revanced.patches.youtube.misc.hdrbrightness.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.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.misc.hdrbrightness.annotations.HDRBrightnessCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
|
||||
|
||||
@Name("hdr-brightness-fingerprint-tio")
|
||||
@MatchingMethod(
|
||||
"Ltio;", "g"
|
||||
)
|
||||
@FuzzyPatternScanMethod(3)
|
||||
@HDRBrightnessCompatibility
|
||||
@Version("0.0.1")
|
||||
object HDRBrightnessFingerprintTIO : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL, null,
|
||||
listOf(
|
||||
/* WindowManager.LayoutParams lp = br.getWindow().getAttributes();
|
||||
* lp.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_FULL;
|
||||
* br.getWindow().setAttributes(lp);
|
||||
*/
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CONST_HIGH16,
|
||||
Opcode.IPUT,
|
||||
//Opcode.INVOKE_VIRTUAL,
|
||||
//Opcode.MOVE_RESULT_OBJECT,
|
||||
//Opcode.INVOKE_VIRTUAL
|
||||
),
|
||||
null,
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.implementation!!.instructions.count() == 22 && methodDef.implementation!!.instructions.any {
|
||||
((it as? NarrowLiteralInstruction)?.narrowLiteral == (/*BRIGHTNESS_OVERRIDE_FULL*/ 1.0f).toRawBits())
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -0,0 +1,44 @@
|
||||
package app.revanced.patches.youtube.misc.hdrbrightness.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.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.misc.hdrbrightness.annotations.HDRBrightnessCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.reference.FieldReference
|
||||
|
||||
@Name("hdr-brightness-fingerprint-xxz")
|
||||
@MatchingMethod(
|
||||
"Lxxz;", "G"
|
||||
)
|
||||
@FuzzyPatternScanMethod(3)
|
||||
@HDRBrightnessCompatibility
|
||||
@Version("0.0.1")
|
||||
object HDRBrightnessFingerprintXXZ : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
listOf("I", "I", "I", "I"),
|
||||
listOf(
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IGET,
|
||||
Opcode.IPUT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL
|
||||
),
|
||||
null,
|
||||
customFingerprint = { methodDef ->
|
||||
methodDef.implementation!!.instructions.any {
|
||||
((it as? ReferenceInstruction)?.reference as? FieldReference)?.let { field ->
|
||||
// iput vx, vy, Landroid/view/WindowManager$LayoutParams;->screenBrightness:F
|
||||
field.definingClass == "Landroid/view/WindowManager\$LayoutParams;" && field.name == "screenBrightness"
|
||||
} == true
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -8,41 +8,49 @@ import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.Dependencies
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.patch.impl.BytecodePatch
|
||||
import app.revanced.patches.youtube.misc.hdrbrightness.annotations.HDRBrightnessCompatibility
|
||||
import app.revanced.patches.youtube.misc.hdrbrightness.fingerprints.HDRBrightnessFingerprint
|
||||
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import app.revanced.patches.youtube.misc.hdrbrightness.fingerprints.HDRBrightnessFingerprintXXZ
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
import org.jf.dexlib2.iface.reference.FieldReference
|
||||
|
||||
@Patch
|
||||
@Name("hdr-max-brightness")
|
||||
@Description("Sets brightness to max for HDR videos in fullscreen mode.")
|
||||
@Patch(false)
|
||||
@Name("hdr-auto-brightness")
|
||||
@Description("Makes the brightness of HDR videos follow the system default.")
|
||||
@HDRBrightnessCompatibility
|
||||
@Version("0.0.1")
|
||||
@Version("0.0.2")
|
||||
@Dependencies([IntegrationsPatch::class])
|
||||
class HDRBrightnessPatch : BytecodePatch(
|
||||
listOf(
|
||||
HDRBrightnessFingerprint
|
||||
HDRBrightnessFingerprintXXZ
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
val result = HDRBrightnessFingerprint.result
|
||||
val method = HDRBrightnessFingerprintXXZ.result?.mutableMethod
|
||||
?: return PatchResultError("HDRBrightnessFingerprint could not resolve the method!")
|
||||
|
||||
method.implementation!!.instructions.filter {
|
||||
((it as? ReferenceInstruction)?.reference as? FieldReference)?.let { field ->
|
||||
// iput vx, vy, Landroid/view/WindowManager$LayoutParams;->screenBrightness:F
|
||||
field.definingClass == "Landroid/view/WindowManager\$LayoutParams;" && field.name == "screenBrightness"
|
||||
} == true
|
||||
}.forEach { instruction ->
|
||||
// inject right before the call that sets 'screenBrightness'
|
||||
val index = method.implementation!!.instructions.indexOf(instruction)
|
||||
val register = (instruction as TwoRegisterInstruction).registerA
|
||||
|
||||
val method = result.mutableMethod
|
||||
|
||||
//Get the index here, so we know where to inject our code to override -1.0f
|
||||
val index = method.implementation!!.instructions.indexOfFirst { ((it as? NarrowLiteralInstruction)?.narrowLiteral == (-1.0f).toRawBits()) }
|
||||
val register = (method.implementation!!.instructions.get(index) as OneRegisterInstruction).registerA
|
||||
|
||||
method.addInstructions(
|
||||
index + 1, """
|
||||
// inject the call to
|
||||
method.addInstructions(
|
||||
index, """
|
||||
invoke-static {v$register}, Lapp/revanced/integrations/patches/HDRMaxBrightnessPatch;->getHDRBrightness(F)F
|
||||
move-result v$register
|
||||
"""
|
||||
)
|
||||
|
||||
)
|
||||
}
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user