diff --git a/patches.json b/patches.json index 88198a2b..801e0f09 100644 --- a/patches.json +++ b/patches.json @@ -1 +1 @@ -[{"name":"Enable Reader Mode","description":"Enables \"Reader Mode\" on long threads","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Download patch","description":"Unlocks the ability to download videos and gifs from Twitter/X","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Enable app icon settings","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Enable PiP mode automatically","description":"Enables PiP mode when you close the app","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Enable Undo Posts","description":"Enables ability to undo posts before posting","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Hide immersive player","description":"Removes swipe up for more videos in video player","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Disable chirp font","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide FAB Menu Buttons","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hook feature flag","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove view count","description":"Removes the view count from the bottom of tweets","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide bookmark icon in timeline","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Clear tracking params","description":"Removes tracking parameters when sharing links","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Custom sharing domain","description":"Allows for using domains like fxtwitter when sharing tweets/posts.","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"No shortened URL","description":"Get rid of t.co short urls.","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Open browser chooser on opening links","description":"Instead of open the link directly in one of the installed browsers","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Add ability to copy media link","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Custom download folder","description":"Change the download directory for video downloads","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide Live Threads","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide nudge button","description":"Hides follow/subscribe/follow back buttons on posts","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Disable auto timeline scroll on launch","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Delete from database","description":"Delete entries from database(cache)","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Enable force HD videos","description":"Videos will be played in highest quality always","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Hide Banner","description":"Hide new post banner","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide followed by context","description":"Hides followed by context under profile","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide hidden replies","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Show poll results","description":"Adds an option to show poll results without voting","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Control video auto scroll","description":"Control video auto scroll in immersive view","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove premium upsell","description":"Removes premium upsell in home timeline","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Force enable translate","description":"Get translate option for all posts","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide promote button","description":"Hides promote button under self posts","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide Community Notes","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Bring back twitter","description":"Bring back old twitter logo and name","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":false,"requiresIntegrations":false,"options":[]},{"name":"Custom downloader","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Customize profile tabs","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Customize side bar items","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Customize Inline action Bar items","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Customize reply sort filter","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Customize timeline top bar","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Customize Navigation Bar items","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Round off numbers","description":"Enable or disable rounding off numbers","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Show sensitive media","description":"Shows sensitive media","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Selectable Text","description":"Makes bio and username selectable","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Enable debug menu for posts","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide FAB","description":"Adds an option to hide Floating action button","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide Recommended Users","description":"Hide recommended users that pops up when you follow someone","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide Promoted Trends","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove Ads","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove \"Who to follow\" Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove \"Communities to join\" Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove \"Pinned posts by followers\" Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove Detailed posts","description":"Removes detailed posts in replies","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove videos for you","description":"Removes \"videos for you\" from explore","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove \"Creators to subscribe\" Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove main event","description":"Removes main event (Paris) from Explore page","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove message prompts Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove \"Revisit Bookmark\" Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove Google Ads","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove superhero event","description":"Removes superhero event from Explore page","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Export all activities","description":"Makes all app activities exportable.","compatiblePackages":null,"use":false,"requiresIntegrations":false,"options":[]},{"name":"Enable app downgrading","description":"Sets app version to a default value making installation of different versions possible","compatiblePackages":null,"use":false,"requiresIntegrations":false,"options":[]},{"name":"Dynamic color","description":"Replaces the default Blue accent with the user\u0027s Material You palette and Dim, Light Theme with Full Material Design.","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]}] \ No newline at end of file +[{"name":"Dynamic color","description":"Replaces the default Blue accent with the user\u0027s Material You palette and Dim, Light Theme with Full Material Design.","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Export all activities","description":"Makes all app activities exportable.","compatiblePackages":null,"use":false,"requiresIntegrations":false,"options":[]},{"name":"Enable app downgrading","description":"Sets app version to a default value making installation of different versions possible","compatiblePackages":null,"use":false,"requiresIntegrations":false,"options":[]},{"name":"Remove Ads","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove \"Communities to join\" Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove \"Creators to subscribe\" Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove Detailed posts","description":"Removes detailed posts in replies","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove Google Ads","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove main event","description":"Removes main event (Paris) from Explore page","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove \"Pinned posts by followers\" Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove message prompts Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove \"Revisit Bookmark\" Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove superhero event","description":"Removes superhero event from Explore page","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove videos for you","description":"Removes \"videos for you\" from explore","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove \"Who to follow\" Banner","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide Promoted Trends","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Disable chirp font","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hook feature flag","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide bookmark icon in timeline","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide FAB Menu Buttons","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide immersive player","description":"Removes swipe up for more videos in video player","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove view count","description":"Removes the view count from the bottom of tweets","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Custom download folder","description":"Change the download directory for video downloads","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Add ability to copy media link","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Open browser chooser on opening links","description":"Instead of open the link directly in one of the installed browsers","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Clear tracking params","description":"Removes tracking parameters when sharing links","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Custom sharing domain","description":"Allows for using domains like fxtwitter when sharing tweets/posts.","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"No shortened URL","description":"Get rid of t.co short urls.","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Bring back twitter","description":"Bring back old twitter logo and name","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":false,"requiresIntegrations":false,"options":[]},{"name":"Customize Inline action Bar items","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Customize Navigation Bar items","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Customize profile tabs","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Customize reply sort filter","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Customize side bar items","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Customize timeline top bar","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Enable debug menu for posts","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide FAB","description":"Adds an option to hide Floating action button","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Custom downloader","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide Recommended Users","description":"Hide recommended users that pops up when you follow someone","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Round off numbers","description":"Enable or disable rounding off numbers","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Selectable Text","description":"Makes bio and username selectable","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Show sensitive media","description":"Shows sensitive media","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Enable app icon settings","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Enable PiP mode automatically","description":"Enables PiP mode when you close the app","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Enable Reader Mode","description":"Enables \"Reader Mode\" on long threads","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Enable Undo Posts","description":"Enables ability to undo posts before posting","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Download patch","description":"Unlocks the ability to download videos and gifs from Twitter/X","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide Banner","description":"Hide new post banner","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Delete from database","description":"Delete entries from database(cache)","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Disable auto timeline scroll on launch","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]},{"name":"Control video auto scroll","description":"Control video auto scroll in immersive view","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide hidden replies","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide nudge button","description":"Hides follow/subscribe/follow back buttons on posts","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide followed by context","description":"Hides followed by context under profile","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide Live Threads","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Remove premium upsell","description":"Removes premium upsell in home timeline","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Show poll results","description":"Adds an option to show poll results without voting","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Force enable translate","description":"Get translate option for all posts","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide Community Notes","description":null,"compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Hide promote button","description":"Hides promote button under self posts","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":false,"options":[]},{"name":"Enable force HD videos","description":"Videos will be played in highest quality always","compatiblePackages":[{"name":"com.twitter.android","versions":null}],"use":true,"requiresIntegrations":true,"options":[]}] \ No newline at end of file diff --git a/src/main/kotlin/crimera/patches/twitter/misc/nativeDownloader/NativeDownloaderHooksPatch.kt b/src/main/kotlin/crimera/patches/twitter/misc/nativeDownloader/NativeDownloaderHooksPatch.kt index 4bad82e6..78263d35 100644 --- a/src/main/kotlin/crimera/patches/twitter/misc/nativeDownloader/NativeDownloaderHooksPatch.kt +++ b/src/main/kotlin/crimera/patches/twitter/misc/nativeDownloader/NativeDownloaderHooksPatch.kt @@ -11,13 +11,13 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction21c -import crimera.patches.twitter.misc.nativeDownloader.fingerprints.GetIdFingerprint internal abstract class NativeDownloaderMethodFingerprint(private val methodName: String) : MethodFingerprint(customFingerprint = { methodDef, classDef -> methodDef.name == methodName && classDef.toString() == "Lapp/revanced/integrations/twitter/patches/NativeDownloader;" }) +internal object TweetObjectFingerprint : MethodFingerprint(strings = listOf("https://x.com/%1\$s/status/%2\$d")) internal object GetTweetClassFingerprint : NativeDownloaderMethodFingerprint("getTweetClass") internal object GetTweetIdFingerprint : NativeDownloaderMethodFingerprint("getTweetId") internal object GetTweetUsernameFingerprint : NativeDownloaderMethodFingerprint("getTweetUsername") @@ -28,11 +28,11 @@ internal object GetTweetMediaFingerprint : NativeDownloaderMethodFingerprint("ge ) class NativeDownloaderHooksPatch : BytecodePatch( setOf( - GetIdFingerprint, GetTweetClassFingerprint, GetTweetIdFingerprint, GetTweetUsernameFingerprint, - GetTweetMediaFingerprint + GetTweetMediaFingerprint, + TweetObjectFingerprint ) ) { private fun MutableMethod.changeFirstString(value: String) { @@ -43,25 +43,29 @@ class NativeDownloaderHooksPatch : BytecodePatch( } override fun execute(context: BytecodeContext) { - val getIdFingerprint = GetIdFingerprint.result ?: throw PatchException("GetIdFingerprint not found") + val getTweetObjectFingerprint = TweetObjectFingerprint.result ?: throw PatchException("bruh") - val tweetObjectClass = getIdFingerprint.classDef + val tweetObjectClass = getTweetObjectFingerprint.classDef val tweetObjectClassName = tweetObjectClass.toString().removePrefix("L").removeSuffix(";") + val getIdMethod = tweetObjectClass.methods.firstOrNull { mutableMethod -> + mutableMethod.name == "getId" + } ?: throw PatchException("getIdMethod not found") + val getUsernameMethod = tweetObjectClass.methods.filter { mutableMethod -> mutableMethod.returnType == "Ljava/lang/String;" && mutableMethod.implementation?.registerCount == 2 }.getOrNull(1) ?: throw PatchException("getUsernameMethod not found") - val getMediaObjectMethod = tweetObjectClass.methods.filter { methodDef -> + val getMediaObjectMethod = tweetObjectClass.methods.firstOrNull { methodDef -> methodDef.implementation?.instructions?.map { it.opcode }?.toList() == listOf( Opcode.IGET_OBJECT, Opcode.IGET_OBJECT, Opcode.IGET_OBJECT, Opcode.IGET_OBJECT, Opcode.RETURN_OBJECT ) - }.getOrNull(0) ?: throw PatchException("getMediaObject not found") + } ?: throw PatchException("getMediaObject not found") GetTweetClassFingerprint.result?.mutableMethod?.changeFirstString(tweetObjectClassName) ?: throw GetTweetClassFingerprint.exception - GetTweetIdFingerprint.result?.mutableMethod?.changeFirstString(getIdFingerprint.method.name) + GetTweetIdFingerprint.result?.mutableMethod?.changeFirstString(getIdMethod.name) ?: throw GetTweetIdFingerprint.exception GetTweetUsernameFingerprint.result?.mutableMethod?.changeFirstString(getUsernameMethod.name) diff --git a/src/main/kotlin/crimera/patches/twitter/misc/nativeDownloader/fingerprints/TweetObjectFingerprints.kt b/src/main/kotlin/crimera/patches/twitter/misc/nativeDownloader/fingerprints/TweetObjectFingerprints.kt deleted file mode 100644 index d7314086..00000000 --- a/src/main/kotlin/crimera/patches/twitter/misc/nativeDownloader/fingerprints/TweetObjectFingerprints.kt +++ /dev/null @@ -1,12 +0,0 @@ -package crimera.patches.twitter.misc.nativeDownloader.fingerprints - -import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.Opcode - -internal object GetIdFingerprint : MethodFingerprint( - opcodes = listOf( - Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_WIDE, Opcode.RETURN_WIDE - ), customFingerprint = { methodDef, _ -> - methodDef.name == "getId" - }, returnType = "J" -) \ No newline at end of file