correct use of endsWith etc

This commit is contained in:
oSumAtrIX
2026-01-24 15:23:03 +01:00
parent 2fac6ccb32
commit cab788d4ad
53 changed files with 110 additions and 114 deletions

View File

@@ -9,7 +9,7 @@ internal val BytecodePatchContext.userStateSwitchMethod by gettingFirstMutableMe
}
internal val BytecodePatchContext.cb11ConstructorMethod by gettingFirstMutableMethodDeclaratively {
definingClass("CB11Details;"::endsWith)
definingClass { endsWith("CB11Details;") }
parameterTypes(
"Ljava/lang/String;",
"Ljava/lang/String;",
@@ -26,5 +26,5 @@ internal val BytecodePatchContext.cb11ConstructorMethod by gettingFirstMutableMe
internal val BytecodePatchContext.getBottomBarMethod by gettingFirstMutableMethodDeclaratively {
name("getBottombar")
definingClass("HomeMenu;"::endsWith)
definingClass { endsWith("HomeMenu;") }
}

View File

@@ -8,7 +8,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal val launchCustomTabMethodMatch = firstMethodComposite {
definingClass("CustomTabsArticleLauncher;"::endsWith)
definingClass { endsWith("CustomTabsArticleLauncher;") }
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
opcodes(
Opcode.IPUT_OBJECT,

View File

@@ -28,7 +28,7 @@ internal val startActivityInitHook = extensionHook(
},
) {
name("onCreate")
definingClass("/StartActivity;"::endsWith)
definingClass { endsWith("/StartActivity;") }
instructions(
Opcode.INVOKE_STATIC(),
Opcode.MOVE_RESULT(),

View File

@@ -1,11 +1,11 @@
package app.revanced.patches.googlenews.misc.gms
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.magazinesActivityOnCreateMethod by gettingFirstMutableMethodDeclaratively {
name("onCreate")
definingClass("/StartActivity;"::endsWith)
definingClass { endsWith("/StartActivity;") }
}

View File

@@ -28,7 +28,7 @@ internal val homeActivityInitHook = extensionHook(
},
) {
name("onCreate")
definingClass("/HomeActivity;"::endsWith)
definingClass { endsWith("/HomeActivity;") }
instructions(
Opcode.CONST_STRING(),
Opcode.INVOKE_STATIC(),

View File

@@ -1,11 +1,11 @@
package app.revanced.patches.googlephotos.misc.gms
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.homeActivityOnCreateMethod by gettingFirstMutableMethodDeclaratively {
name("onCreate")
definingClass("/HomeActivity;"::endsWith)
definingClass { endsWith("/HomeActivity;") }
}

View File

@@ -4,6 +4,6 @@ import app.revanced.patcher.*
internal val onApplicationCreateMethodMatch = firstMethodComposite {
name("onCreate")
definingClass("RecorderApplication"::endsWith)
definingClass { endsWith("RecorderApplication") }
instructions("com.google.android.feature.PIXEL_2017_EXPERIENCE"())
}

View File

@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.primaryAdsMethod by gettingFirstMutableMethodDeclaratively {
name("isAdsDisabled")
definingClass("PreferencesHelper;"::endsWith)
definingClass { endsWith("PreferencesHelper;") }
}

View File

@@ -6,6 +6,6 @@ import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
internal val BytecodePatchContext.checkProMethod by gettingFirstMutableMethodDeclaratively {
definingClass("IPSPurchaseRepository;"::endsWith)
definingClass { endsWith("IPSPurchaseRepository;") }
returnType("Z")
}
}

View File

@@ -6,14 +6,14 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.isDeviceBootloaderOpenMethod by gettingFirstMutableMethodDeclaratively {
name("isDeviceBootloaderOpen")
definingClass("/DeviceIntegrityCheckProviderImpl;"::endsWith)
definingClass { endsWith("/DeviceIntegrityCheckProviderImpl;") }
accessFlags(AccessFlags.PUBLIC)
returnType("Ljava/lang/Object;")
}
internal val BytecodePatchContext.isDeviceRootedMethod by gettingFirstMutableMethodDeclaratively {
name("isDeviceRooted")
definingClass("/DeviceIntegrityCheckProviderImpl;"::endsWith)
definingClass { endsWith("/DeviceIntegrityCheckProviderImpl;") }
accessFlags(AccessFlags.PUBLIC)
returnType("Z")
}

View File

@@ -6,7 +6,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.spoofSignatureMethod by gettingFirstMutableMethodDeclaratively {
name("getPubKey")
definingClass("/SL2Step1Task;"::endsWith)
definingClass { endsWith("/SL2Step1Task;") }
accessFlags(AccessFlags.PRIVATE)
returnType("L")
parameterTypes("L")

View File

@@ -19,11 +19,10 @@ internal val BytecodePatchContext.admobHelperShouldShowAdsMethod by gettingFirst
internal val BytecodePatchContext.filmFragmentShowAdsMethod by gettingFirstMutableMethodDeclaratively {
name("showAds")
definingClass("/FilmFragment;"::endsWith)
definingClass { endsWith("/FilmFragment;") }
}
internal val BytecodePatchContext.memberExtensionShowAdsMethod by gettingFirstMutableMethodDeclaratively {
name("showAds")
definingClass("/AMemberExtensionKt;"::endsWith)
definingClass { endsWith("/AMemberExtensionKt;") }
}

View File

@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.getCanChangeAppIconMethod by gettingFirstMutableMethodDeclaratively {
name("getCanChangeAppIcon")
definingClass("SettingsAppIconFragment;"::endsWith)
definingClass { endsWith("SettingsAppIconFragment;") }
}

View File

@@ -59,7 +59,7 @@ internal val BytecodePatchContext.historyMenuItemOfflineTabMethod by gettingFirs
}
internal val BytecodePatchContext.searchActionViewMethod by gettingFirstMutableMethodDeclaratively {
definingClass("/SearchActionProvider;"::endsWith)
definingClass { endsWith("/SearchActionProvider;") }
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("Landroid/view/View;")
parameterTypes()

View File

@@ -1,13 +1,11 @@
package app.revanced.patches.music.misc.gms
import app.revanced.patcher.*
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.musicActivityOnCreateMethod by gettingFirstMutableMethodDeclaratively {
name("onCreate")
definingClass("/MusicActivity;"::endsWith)
definingClass { endsWith("/MusicActivity;") }
returnType("V")
parameterTypes("Landroid/os/Bundle;")
}
}

View File

@@ -1,7 +1,7 @@
package app.revanced.patches.music.misc.settings
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.parameterTypes
import app.revanced.patcher.patch.BytecodePatchContext
@@ -9,7 +9,7 @@ import app.revanced.patcher.returnType
internal val BytecodePatchContext.googleApiActivityMethod by gettingFirstMutableMethodDeclaratively {
name("onCreate")
definingClass("GoogleApiActivity;"::endsWith)
definingClass { endsWith("GoogleApiActivity;") }
returnType("V")
parameterTypes("Landroid/os/Bundle;")
}

View File

@@ -1,8 +1,8 @@
package app.revanced.patches.myfitnesspal.ads
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.accessFlags
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
@@ -10,13 +10,13 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.isPremiumUseCaseImplMethod by gettingFirstMutableMethodDeclaratively {
name("doWork")
definingClass("IsPremiumUseCaseImpl;"::endsWith)
definingClass { endsWith("IsPremiumUseCaseImpl;") }
accessFlags(AccessFlags.PUBLIC)
}
internal val BytecodePatchContext.mainActivityNavigateToNativePremiumUpsellMethod by gettingFirstMutableMethodDeclaratively {
name("navigateToNativePremiumUpsell")
definingClass("MainActivity;"::endsWith)
definingClass { endsWith("MainActivity;") }
accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL)
returnType("V")
}

View File

@@ -1,8 +1,8 @@
package app.revanced.patches.orfon.detection.root
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.accessFlags
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
@@ -10,7 +10,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.isDeviceRootedMethod by gettingFirstMutableMethodDeclaratively {
name("isDeviceRooted")
definingClass("/RootChecker;"::endsWith)
definingClass { endsWith("/RootChecker;") }
accessFlags(AccessFlags.PUBLIC)
returnType("Z")
}

View File

@@ -1,7 +1,7 @@
package app.revanced.patches.pandora.ads
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
@@ -12,5 +12,5 @@ internal val BytecodePatchContext.getIsAdSupportedMethod by gettingFirstMutableM
internal val BytecodePatchContext.requestAudioAdMethod by gettingFirstMutableMethodDeclaratively {
name("requestAudioAdFromAdSDK")
definingClass("ContentServiceOpsImpl;"::endsWith)
definingClass { endsWith("ContentServiceOpsImpl;") }
}

View File

@@ -1,11 +1,11 @@
package app.revanced.patches.pandora.misc
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.getSkipLimitBehaviorMethod by gettingFirstMutableMethodDeclaratively {
name("getSkipLimitBehavior")
definingClass("UserData;"::endsWith)
definingClass { endsWith("UserData;") }
}

View File

@@ -1,8 +1,8 @@
package app.revanced.patches.photomath.misc.unlock.plus
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.accessFlags
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.AccessFlags
@@ -10,5 +10,5 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.isPlusUnlockedMethod by gettingFirstMutableMethodDeclaratively("genius") {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("Z")
definingClass("/User;"::endsWith)
definingClass { endsWith("/User;") }
}

View File

@@ -1,15 +1,15 @@
package app.revanced.patches.pixiv.ads
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.accessFlags
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.shouldShowAdsMethod by gettingFirstMutableMethodDeclaratively {
definingClass("AdUtils;"::endsWith)
definingClass { endsWith("AdUtils;") }
name("shouldShowAds")
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("Z")

View File

@@ -1,15 +1,15 @@
package app.revanced.patches.rar.misc.annoyances.purchasereminder
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.accessFlags
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.showReminderMethod by gettingFirstMutableMethodDeclaratively {
definingClass("AdsNotify;"::endsWith)
definingClass { endsWith("AdsNotify;") }
name("show")
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
returnType("V")

View File

@@ -1,11 +1,11 @@
package app.revanced.patches.reddit.ad.comments
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.hideCommentAdsMethod by gettingFirstMutableMethodDeclaratively {
name("invokeSuspend")
definingClass("LoadAdsCombinedCall"::contains)
definingClass { contains("LoadAdsCombinedCall") }
}

View File

@@ -1,7 +1,7 @@
package app.revanced.patches.reddit.ad.general
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.instructions
import app.revanced.patcher.invoke
import app.revanced.patcher.patch.BytecodePatchContext
@@ -9,13 +9,13 @@ import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.Opcode
internal val BytecodePatchContext.adPostMethod by gettingFirstMutableMethodDeclaratively("children") {
definingClass("Listing;"::endsWith)
definingClass { endsWith("Listing;") }
returnType("V")
}
internal val BytecodePatchContext.newAdPostMethod by gettingFirstMutableMethodDeclaratively(
"feedElement",
"com.reddit.cookie"
"com.reddit.cookie",
) {
instructions(Opcode.INVOKE_VIRTUAL())
}

View File

@@ -1,15 +1,15 @@
package app.revanced.patches.reddit.customclients.boostforreddit.api
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.buildUserAgentMethod by gettingFirstMutableMethodDeclaratively(
"%s:%s:%s (by /u/%s)"
"%s:%s:%s (by /u/%s)",
)
internal val BytecodePatchContext.getClientIdMethod by gettingFirstMutableMethodDeclaratively {
name("getClientId")
definingClass("Credentials;"::endsWith)
definingClass { endsWith("Credentials;") }
}

View File

@@ -1,10 +1,10 @@
package app.revanced.patches.reddit.customclients.joeyforreddit.detection.piracy
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.invoke
import app.revanced.patcher.accessFlags
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.instructions
import app.revanced.patcher.invoke
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.AccessFlags
@@ -19,7 +19,7 @@ internal val BytecodePatchContext.detectPiracyMethod by gettingFirstMutableMetho
Opcode.CONST_WIDE_16(),
Opcode.INVOKE_DIRECT(),
Opcode.INVOKE_VIRTUAL(),
Opcode.RETURN_VOID()
Opcode.RETURN_VOID(),
)
definingClass("ProcessLifeCyleListener;"::endsWith)
definingClass { endsWith("ProcessLifeCyleListener;") }
}

View File

@@ -1,11 +1,11 @@
package app.revanced.patches.reddit.customclients.slide.api
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.getClientIdMethod by gettingFirstMutableMethodDeclaratively {
name("getClientId")
definingClass("Credentials;"::endsWith)
definingClass { endsWith("Credentials;") }
}

View File

@@ -1,11 +1,11 @@
package app.revanced.patches.reddit.customclients.sync.syncforreddit.annoyances.startup
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.mainActivityOnCreateMethod by gettingFirstMutableMethodDeclaratively {
name("onCreate")
definingClass("MainActivity;"::endsWith)
definingClass { endsWith("MainActivity;") }
}

View File

@@ -1,22 +1,22 @@
package app.revanced.patches.reddit.customclients.sync.syncforreddit.api
import app.revanced.patcher.gettingFirstMutableMethod
import app.revanced.patcher.invoke
import app.revanced.patcher.string
import app.revanced.patcher.firstMethodComposite
import app.revanced.patcher.gettingFirstMutableMethod
import app.revanced.patcher.instructions
import app.revanced.patcher.invoke
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.string
internal val getAuthorizationStringMethodMatch = firstMethodComposite {
instructions(string("authorize.compact?client_id"::startsWith))
instructions(string { startsWith("authorize.compact?client_id") })
}
internal val getBearerTokenMethodMatch = firstMethodComposite {
instructions(string("Basic"::startsWith))
instructions(string { startsWith("Basic") })
}
internal val BytecodePatchContext.getUserAgentMethod by gettingFirstMutableMethod(
"android:com.laurencedawson.reddit_sync"
"android:com.laurencedawson.reddit_sync",
)
internal val imgurImageAPIMethodMatch = firstMethodComposite {

View File

@@ -1,8 +1,8 @@
package app.revanced.patches.reddit.customclients.sync.syncforreddit.fix.redgifs
import app.revanced.patcher.*
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.extensions.instructions
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.util.indexOfFirstInstruction
import app.revanced.util.writeRegister
@@ -33,7 +33,7 @@ internal val BytecodePatchContext.getDefaultUserAgentMethod by gettingFirstMutab
internal val BytecodePatchContext.getOriginalUserAgentMethod by gettingFirstMutableMethodDeclaratively {
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
returnType("Ljava/lang/String;"::startsWith)
returnType { startsWith("Ljava/lang/String;") }
parameterTypes()
custom { immutableClassDef.sourceFile == "AccountSingleton.java" }
}

View File

@@ -1,17 +1,17 @@
package app.revanced.patches.reddit.customclients.sync.syncforreddit.fix.slink
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethod
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
internal val BytecodePatchContext.linkHelperOpenLinkMethod by gettingFirstMutableMethod("Link title: ")
internal val BytecodePatchContext.setAuthorizationHeaderMethod by gettingFirstMutableMethodDeclaratively(
"Authorization", "bearer "
"Authorization",
"bearer ",
) {
definingClass("Lcom/laurencedawson/reddit_sync/singleton/a;")
returnType("Ljava/util/HashMap;"::equals)
returnType { equals("Ljava/util/HashMap;") }
}

View File

@@ -1,14 +1,14 @@
package app.revanced.patches.reddit.customclients.sync.syncforreddit.fix.thumbnail
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.accessFlags
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.parameterTypes
import app.revanced.patcher.patch.BytecodePatchContext
import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.customImageViewLoadMethod by gettingFirstMutableMethodDeclaratively {
definingClass("CustomImageView;"::endsWith)
definingClass { endsWith("CustomImageView;") }
accessFlags(AccessFlags.PUBLIC)
parameterTypes("Ljava/lang/String;", "Z", "Z", "I", "I")
}

View File

@@ -1,7 +1,7 @@
package app.revanced.patches.reddit.layout.disablescreenshotpopup
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.parameterTypes
import app.revanced.patcher.patch.BytecodePatchContext
@@ -9,7 +9,7 @@ import app.revanced.patcher.returnType
internal val BytecodePatchContext.disableScreenshotPopupMethod by gettingFirstMutableMethodDeclaratively {
name("invoke")
definingClass($$"$ScreenshotTakenBannerKt$lambda-1$1;"::endsWith)
definingClass { endsWith($$"$ScreenshotTakenBannerKt$lambda-1$1;") }
returnType("V")
parameterTypes("Landroidx/compose/runtime/", "I")
}

View File

@@ -1,13 +1,13 @@
package app.revanced.patches.reddit.layout.premiumicon
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
import app.revanced.patcher.returnType
internal val BytecodePatchContext.hasPremiumIconAccessMethod by gettingFirstMutableMethodDeclaratively {
name("isPremiumSubscriber")
definingClass("MyAccount;"::endsWith)
definingClass { endsWith("MyAccount;") }
returnType("Z")
}

View File

@@ -1,12 +1,12 @@
package app.revanced.patches.reddit.misc.tracking.url
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.custom
import app.revanced.patcher.definingClass
import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.immutableClassDef
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.shareLinkFormatterMethod by gettingFirstMutableMethodDeclaratively {
definingClass("Lcom/reddit/sharing/"::startsWith)
definingClass { startsWith("Lcom/reddit/sharing/") }
custom { immutableClassDef.sourceFile == "UrlUtil.kt" }
}

View File

@@ -8,7 +8,7 @@ import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.rootDetectionMethod by gettingFirstMutableMethodDeclaratively {
definingClass("/DeviceIntegrityCheck;"::endsWith)
definingClass { endsWith("/DeviceIntegrityCheck;") }
accessFlags(AccessFlags.PUBLIC)
returnType("V")
}

View File

@@ -5,7 +5,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal val canScrollVerticallyMethodMatch = firstMethodComposite {
definingClass("SwipeRefreshLayout;"::endsWith)
definingClass { endsWith("SwipeRefreshLayout;") }
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("Z")
parameterTypes()

View File

@@ -5,13 +5,12 @@ import app.revanced.patcher.gettingFirstMutableMethodDeclaratively
import app.revanced.patcher.name
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.logInGetUsePasswordMethod by gettingFirstMutableMethodDeclaratively {
name("getUsePassword")
definingClass("/RequestOtpLogInNetworkResponse;"::endsWith)
definingClass { endsWith("/RequestOtpLogInNetworkResponse;") }
}
internal val BytecodePatchContext.emailChangeGetUsePasswordMethod by gettingFirstMutableMethodDeclaratively {
name("getUsePassword")
definingClass("/RequestEmailChangeWithOtpOrPasswordResponse;"::endsWith)
definingClass { endsWith("/RequestEmailChangeWithOtpOrPasswordResponse;") }
}

View File

@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.getSubscribedMethod by gettingFirstMutableMethodDeclaratively {
name("getSubscribed")
definingClass("/SubscriptionDetailResponse;"::endsWith)
definingClass { endsWith("/SubscriptionDetailResponse;") }
}

View File

@@ -8,6 +8,6 @@ import com.android.tools.smali.dexlib2.Opcode
internal val getModulesMethodMatch = firstMethodComposite {
name("getModules")
definingClass("/GenericLayoutEntry;"::endsWith)
definingClass { endsWith("/GenericLayoutEntry;") }
opcodes(Opcode.IGET_OBJECT)
}

View File

@@ -7,10 +7,10 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.checkLockedThemesFingerprint by gettingFirstMutableMethodDeclaratively {
name("isLockedTheme")
definingClass("Theme;"::endsWith)
definingClass { endsWith("Theme;") }
}
internal val BytecodePatchContext.setThemeMethod by gettingFirstMutableMethodDeclaratively {
name("lambda\$updateUserBtn\$1")
definingClass("ThemePreviewActivity;"::endsWith)
definingClass { endsWith("ThemePreviewActivity;") }
}

View File

@@ -8,5 +8,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.onClearDisplayEventMethod by gettingFirstMutableMethodDeclaratively {
// Internally the feature is called "Clear mode".
name("onClearModeEvent")
definingClass("/ClearModePanelComponent;"::endsWith)
definingClass { endsWith("/ClearModePanelComponent;") }
}

View File

@@ -11,19 +11,19 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.aclCommonShareMethod by gettingFirstMutableMethodDeclaratively {
name("getCode")
definingClass("/ACLCommonShare;"::endsWith)
definingClass { endsWith("/ACLCommonShare;") }
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("I")
}
internal val BytecodePatchContext.aclCommonShare2Method by gettingFirstMutableMethodDeclaratively {
name("getShowType")
definingClass("/ACLCommonShare;"::endsWith)
definingClass { endsWith("/ACLCommonShare;") }
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("I")
}
internal val BytecodePatchContext.aclCommonShare3Method by gettingFirstMutableMethodDeclaratively {
name("getTranscode")
definingClass("/ACLCommonShare;"::endsWith)
definingClass { endsWith("/ACLCommonShare;") }
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("I")
}
@@ -31,12 +31,12 @@ internal val BytecodePatchContext.downloadUriMethod by gettingFirstMutableMethod
"/",
"/Camera",
"/Camera/",
"video/mp4"
"video/mp4",
) {
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
returnType("Landroid/net/Uri;")
parameterTypes(
"Landroid/content/Context;",
"Ljava/lang/String;"
"Ljava/lang/String;",
)
}
}

View File

@@ -6,11 +6,11 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.getSpeedMethod by gettingFirstMutableMethodDeclaratively {
name("onFeedSpeedSelectedEvent")
definingClass("/BaseListFragmentPanel;"::endsWith)
definingClass { endsWith("/BaseListFragmentPanel;") }
}
internal val BytecodePatchContext.setSpeedMethod by gettingFirstMutableMethodDeclaratively("enterFrom") {
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
returnType("V")
parameterTypes("Ljava/lang/String;", "Lcom/ss/android/ugc/aweme/feed/model/Aweme;", "F")
}
}

View File

@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.audioAdsPresenterPlayMethod by gettingFirstMutableMethodDeclaratively {
name("playAd")
definingClass("AudioAdsPlayerPresenter;"::endsWith)
definingClass { endsWith("AudioAdsPlayerPresenter;") }
}

View File

@@ -5,21 +5,21 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.checkAdEligibilityLambdaMethod by gettingFirstMutableMethodDeclaratively {
name("shouldRequestAd")
definingClass("/AdEligibilityFetcher;"::endsWith)
definingClass { endsWith("/AdEligibilityFetcher;") }
returnType("Lio/reactivex/Single;")
parameterTypes("L")
}
internal val BytecodePatchContext.contentConfigShowAdsMethod by gettingFirstMutableMethodDeclaratively {
name("getShowAds")
definingClass("/ContentConfigData;"::endsWith)
definingClass { endsWith("/ContentConfigData;") }
returnType("Z")
parameterTypes()
}
internal val BytecodePatchContext.getReadyToShowAdMethod by gettingFirstMutableMethodDeclaratively {
name("getReadyToShowAdOrAbort")
definingClass("/StreamDisplayAdsPresenter;"::endsWith)
definingClass { endsWith("/StreamDisplayAdsPresenter;") }
returnType("Ltv/twitch/android/core/mvp/presenter/StateAndAction;")
parameterTypes("L", "L")
}

View File

@@ -9,15 +9,15 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.chatUtilCreateDeletedSpanMethod by gettingFirstMutableMethodDeclaratively {
name("createDeletedSpanFromChatMessageSpan")
definingClass("ChatUtil\$Companion;"::endsWith)
definingClass { endsWith("ChatUtil\$Companion;") }
}
internal val BytecodePatchContext.deletedMessageClickableSpanCtorMethod by gettingFirstMutableMethodDeclaratively {
definingClass("DeletedMessageClickableSpan;"::endsWith)
definingClass { endsWith("DeletedMessageClickableSpan;") }
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
}
internal val BytecodePatchContext.setHasModAccessMethod by gettingFirstMutableMethodDeclaratively {
name("setHasModAccess")
definingClass("DeletedMessageClickableSpan;"::endsWith)
definingClass { endsWith("DeletedMessageClickableSpan;") }
}

View File

@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.communityPointsButtonViewDelegateMethod by gettingFirstMutableMethodDeclaratively {
name("showClaimAvailable")
definingClass("CommunityPointsButtonViewDelegate;"::endsWith)
definingClass { endsWith("CommunityPointsButtonViewDelegate;") }
}

View File

@@ -7,15 +7,15 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.isDebugConfigEnabledMethod by gettingFirstMutableMethodDeclaratively {
name("isDebugConfigEnabled")
definingClass("/BuildConfigUtil;"::endsWith)
definingClass { endsWith("/BuildConfigUtil;") }
}
internal val BytecodePatchContext.isOmVerificationEnabledMethod by gettingFirstMutableMethodDeclaratively {
name("isOmVerificationEnabled")
definingClass("/BuildConfigUtil;"::endsWith)
definingClass { endsWith("/BuildConfigUtil;") }
}
internal val BytecodePatchContext.shouldShowDebugOptionsMethod by gettingFirstMutableMethodDeclaratively {
name("shouldShowDebugOptions")
definingClass("/BuildConfigUtil;"::endsWith)
definingClass { endsWith("/BuildConfigUtil;") }
}

View File

@@ -5,8 +5,8 @@ import app.revanced.patcher.patch.BytecodePatchContext
import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.menuGroupsOnClickMethod by gettingFirstMutableMethodDeclaratively {
name("render"::contains)
definingClass("/SettingsMenuViewDelegate;"::endsWith)
name { contains("render") }
definingClass { endsWith("/SettingsMenuViewDelegate;") }
accessFlags(AccessFlags.PRIVATE, AccessFlags.STATIC, AccessFlags.FINAL)
returnType("V")
parameterTypes("L", "L", "L")
@@ -19,10 +19,10 @@ internal val BytecodePatchContext.menuGroupsUpdatedMethod by gettingFirstMutable
internal val BytecodePatchContext.settingsActivityOnCreateMethod by gettingFirstMutableMethodDeclaratively {
name("onCreate")
definingClass("/SettingsActivity;"::endsWith)
definingClass { endsWith("/SettingsActivity;") }
}
internal val BytecodePatchContext.settingsMenuItemEnumMethod by gettingFirstMutableMethodDeclaratively {
name("<clinit>")
definingClass("/SettingsMenuItem;"::endsWith)
definingClass { endsWith("/SettingsMenuItem;") }
}

View File

@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.promoCodeUnlockMethod by gettingFirstMutableMethodDeclaratively {
name("isValid")
definingClass("PromoTokenVerification;"::endsWith)
}
definingClass { endsWith("PromoTokenVerification;") }
}

View File

@@ -7,7 +7,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.mediaRouteButtonMethod by gettingFirstMutableMethodDeclaratively {
name("setVisibility")
definingClass("/MediaRouteButton;"::endsWith)
definingClass { endsWith("/MediaRouteButton;") }
parameterTypes("I")
}