File tree 2 files changed +13
-0
lines changed
patches/src/main/kotlin/app/revanced/patches/youtube/misc/fix/backtoexitgesture
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package app.revanced.patches.youtube.misc.fix.backtoexitgesture
3
3
import com.android.tools.smali.dexlib2.Opcode
4
4
import com.android.tools.smali.dexlib2.AccessFlags
5
5
import app.revanced.patcher.fingerprint
6
+ import app.revanced.util.literal
6
7
7
8
internal val onBackPressedFingerprint = fingerprint {
8
9
returns(" V" )
@@ -66,3 +67,10 @@ internal val recyclerViewTopScrollingParentFingerprint = fingerprint {
66
67
Opcode .NEW_INSTANCE ,
67
68
)
68
69
}
70
+
71
+ internal val doubleBackToExitFeatureFlagFingerprint = fingerprint {
72
+ accessFlags(AccessFlags .PUBLIC , AccessFlags .FINAL )
73
+ returns(" Z" )
74
+ parameters()
75
+ literal { 45385099L }
76
+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
4
4
import app.revanced.patcher.patch.bytecodePatch
5
5
import app.revanced.util.getReference
6
6
import app.revanced.util.indexOfFirstInstructionOrThrow
7
+ import app.revanced.util.returnLate
7
8
import com.android.tools.smali.dexlib2.Opcode
8
9
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
9
10
@@ -45,5 +46,9 @@ internal val fixBackToExitGesturePatch = bytecodePatch(
45
46
" invoke-static { p0 }, $EXTENSION_CLASS_DESCRIPTOR ->onBackPressed(Landroid/app/Activity;)V"
46
47
)
47
48
}
49
+
50
+ // Disable the stock YouTube double back to exit. If this flag is on,
51
+ // then using the back button to exit a video can sometimes cause the app to close.
52
+ doubleBackToExitFeatureFlagFingerprint.method.returnLate(true )
48
53
}
49
54
}
You can’t perform that action at this time.
0 commit comments