generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Twitter - Change link sharing domain): Support latest app version (…
- Loading branch information
1 parent
e5f3849
commit b54592c
Showing
3 changed files
with
29 additions
and
11 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
17 changes: 17 additions & 0 deletions
17
...in/kotlin/app/revanced/patches/twitter/misc/links/ChangeLinkSharingDomainResourcePatch.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,17 @@ | ||
package app.revanced.patches.twitter.misc.links | ||
|
||
import app.revanced.patcher.data.ResourceContext | ||
import app.revanced.patcher.patch.ResourcePatch | ||
import app.revanced.patcher.patch.annotation.Patch | ||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch | ||
|
||
@Patch( | ||
dependencies = [ResourceMappingPatch::class], | ||
) | ||
internal object ChangeLinkSharingDomainResourcePatch : ResourcePatch() { | ||
internal var tweetShareLinkTemplateId: Long = -1 | ||
|
||
override fun execute(context: ResourceContext) { | ||
tweetShareLinkTemplateId = ResourceMappingPatch["string", "tweet_share_link"] | ||
} | ||
} |
7 changes: 4 additions & 3 deletions
7
...lin/app/revanced/patches/twitter/misc/links/fingerprints/LinkResourceGetterFingerprint.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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
package app.revanced.patches.twitter.misc.links.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import app.revanced.patches.twitter.misc.links.ChangeLinkSharingDomainResourcePatch | ||
import app.revanced.util.patch.LiteralValueFingerprint | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
|
||
// Gets Resource string for share link view available by pressing "Share via" button. | ||
internal object LinkResourceGetterFingerprint : MethodFingerprint( | ||
internal object LinkResourceGetterFingerprint : LiteralValueFingerprint( | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
parameters = listOf("Landroid/content/res/Resources;"), | ||
strings = listOf("res.getString(R.string.t…lUsername, id.toString())"), | ||
literalSupplier = { ChangeLinkSharingDomainResourcePatch.tweetShareLinkTemplateId } | ||
) |