File tree Expand file tree Collapse file tree 2 files changed +3
-33
lines changed
app/src/main/java/io/github/chsbuffer/revancedxposed/youtube/misc Expand file tree Collapse file tree 2 files changed +3
-33
lines changed Original file line number Diff line number Diff line change @@ -103,31 +103,4 @@ fun YoutubeHook.NavigationBarHook() {
103103 initializeButtonsFingerprint.hookMethod(ScopedHook (pivotBarButtonsCreateResourceViewFingerprint.toMethod()) {
104104 after { NavigationBar .navigationImageResourceTabLoaded(param.result as View ) }
105105 })
106-
107- // Fix YT bug of notification tab missing the filled icon.
108- val tabActivityCairo =
109- navigationEnumClass.toClass().enumConstants?.firstOrNull { (it as ? Enum <* >)?.name == " TAB_ACTIVITY_CAIRO" } as ? Enum <* >
110- if (tabActivityCairo != null ) {
111- getDexMethod(" setEnumMapFingerprint" ) {
112- fingerprint {
113- accessFlags(AccessFlags .PUBLIC , AccessFlags .CONSTRUCTOR )
114- literal {
115- Utils .getResourceIdentifier(" yt_fill_bell_black_24" , " drawable" )
116- }
117- }
118- }.hookMethod(object : XC_MethodHook () {
119- override fun afterHookedMethod (param : MethodHookParam ) {
120- val obj = param.thisObject
121- param.thisObject.javaClass.declaredFields.forEach {
122- it.isAccessible = true
123- val enumMap = it.get(obj) as ? EnumMap <* , * >
124- if (enumMap !is EnumMap <* , * >) return @forEach
125- // check is valueType int (resource id)
126- val valueType = enumMap.values.first()::class .java
127- if (valueType != Int ::class .java) return @forEach
128- NavigationBar .setCairoNotificationFilledIcon(enumMap, tabActivityCairo)
129- }
130- }
131- })
132- }
133106}
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import io.github.chsbuffer.revancedxposed.opcodes
1111import io.github.chsbuffer.revancedxposed.youtube.YoutubeHook
1212import org.luckypray.dexkit.query.enums.StringMatchType
1313import org.luckypray.dexkit.result.FieldUsingType
14+ import java.lang.reflect.Modifier
1415
1516@SuppressLint(" NonUniqueDexKitData" )
1617fun YoutubeHook.PlayerTypeHook () {
@@ -22,16 +23,12 @@ fun YoutubeHook.PlayerTypeHook() {
2223 }
2324 }.findMethod {
2425 matcher {
26+ modifiers = Modifier .PUBLIC
2527 returnType = " void"
2628 paramCount = 1
27- opcodes(
28- Opcode .IF_NE ,
29- Opcode .RETURN_VOID ,
30- )
3129 }
3230 }.single {
33- // enum class
34- it.paramTypes[0 ].descriptor.length > 1
31+ it.paramTypes[0 ].superClass?.descriptor == " Ljava/lang/Enum;"
3532 }
3633 }.hookMethod(object : XC_MethodHook () {
3734 override fun beforeHookedMethod (param : MethodHookParam ) {
You can’t perform that action at this time.
0 commit comments