forked from inotia00/revanced-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(YouTube/Navigation bar components): add
Hide navigation bar
se…
…tting
- Loading branch information
Showing
10 changed files
with
76 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
.../patches/youtube/utils/navigation/fingerprints/InitializeBottomBarContainerFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package app.revanced.patches.youtube.utils.navigation.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import app.revanced.patches.youtube.utils.navigation.fingerprints.InitializeBottomBarContainerFingerprint.indexOfLayoutChangeListenerInstruction | ||
import app.revanced.patches.youtube.utils.resourceid.SharedResourceIdPatch.BottomBarContainer | ||
import app.revanced.util.containsWideLiteralInstructionValue | ||
import app.revanced.util.getReference | ||
import app.revanced.util.indexOfFirstInstruction | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
import com.android.tools.smali.dexlib2.iface.Method | ||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference | ||
|
||
internal object InitializeBottomBarContainerFingerprint : MethodFingerprint( | ||
returnType = "V", | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
customFingerprint = { methodDef, classDef -> | ||
AccessFlags.SYNTHETIC.isSet(classDef.accessFlags) && | ||
methodDef.containsWideLiteralInstructionValue(BottomBarContainer) && | ||
indexOfLayoutChangeListenerInstruction(methodDef) >= 0 | ||
}, | ||
) { | ||
fun indexOfLayoutChangeListenerInstruction(methodDef: Method) = | ||
methodDef.indexOfFirstInstruction { | ||
opcode == Opcode.INVOKE_VIRTUAL && | ||
getReference<MethodReference>()?.toString() == "Landroid/view/View;->addOnLayoutChangeListener(Landroid/view/View${'$'}OnLayoutChangeListener;)V" | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...gerprints/InitializeButtonsFingerprint.kt → ...gerprints/InitializeButtonsFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.