Skip to content

Commit

Permalink
fix(Twitter): Bookmark in nav bar dix
Browse files Browse the repository at this point in the history
  • Loading branch information
Swakshan committed May 2, 2024
1 parent cdabbdd commit 03fb96c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.android.tools.smali.dexlib2.Opcode
import crimera.patches.twitter.misc.settings.SettingsPatch
import crimera.patches.twitter.misc.settings.fingerprints.SettingsStatusLoadFingerprint
import crimera.patches.twitter.premium.customAppIconAndNavBtns.fingerprints.CustomAppIconAndNavBtnsFingerprint
import crimera.patches.twitter.premium.customAppIconAndNavBtns.fingerprints.NavBarFixFingerprint

@Patch(
name = "Enable custom app icon and nav icon settings",
Expand All @@ -19,7 +20,7 @@ import crimera.patches.twitter.premium.customAppIconAndNavBtns.fingerprints.Cust
requiresIntegrations = true
)
object CustomAppIconAndNavBtnsPatch:BytecodePatch(
setOf(CustomAppIconAndNavBtnsFingerprint, SettingsStatusLoadFingerprint)
setOf(CustomAppIconAndNavBtnsFingerprint, SettingsStatusLoadFingerprint,NavBarFixFingerprint)
) {
override fun execute(context: BytecodeContext) {
val result = CustomAppIconAndNavBtnsFingerprint.result
Expand All @@ -33,6 +34,16 @@ object CustomAppIconAndNavBtnsPatch:BytecodePatch(
methods.removeInstruction(loc)
methods.removeInstruction(loc-1)

//credits aero
val result2 = NavBarFixFingerprint.result
?:throw PatchException("NavBarFixFingerprint not found")

val methods2 = result2.mutableMethod
val loc2 = methods2.getInstructions().first { it.opcode == Opcode.IF_NEZ }.location.index
methods2.removeInstruction(loc2)
methods2.removeInstruction(loc2)
methods2.removeInstruction(loc2)

SettingsStatusLoadFingerprint.enableSettings("enableAppIconNNavIcon")
//end
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package crimera.patches.twitter.premium.customAppIconAndNavBtns.fingerprints

import app.revanced.patcher.fingerprint.MethodFingerprint

object NavBarFixFingerprint: MethodFingerprint(
returnType = "Ljava/util/List;",
strings = listOf(
"subscriptions_feature_1008"
)
)

0 comments on commit 03fb96c

Please sign in to comment.