automatically infer type comparator

This commit is contained in:
oSumAtrIX 2026-02-23 17:37:55 +01:00
parent 93301e7f76
commit 2d568e0127
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4
68 changed files with 92 additions and 92 deletions

View file

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

View file

@ -9,7 +9,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal val BytecodePatchContext.launchCustomTabMethodMatch by composingFirstMethod {
definingClass { endsWith("CustomTabsArticleLauncher;") }
definingClass("CustomTabsArticleLauncher;")
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
opcodes(
Opcode.IPUT_OBJECT,

View file

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

View file

@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.magazinesActivityOnCreateMethod by gettingFirstMethodDeclaratively {
name("onCreate")
definingClass { endsWith("/StartActivity;") }
definingClass("/StartActivity;")
}

View file

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

View file

@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.homeActivityOnCreateMethod by gettingFirstMethodDeclaratively {
name("onCreate")
definingClass { endsWith("/HomeActivity;") }
definingClass("/HomeActivity;")
}

View file

@ -5,6 +5,6 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.onApplicationCreateMethodMatch by composingFirstMethod {
name("onCreate")
definingClass { endsWith("RecorderApplication;") }
definingClass("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 gettingFirstMethodDeclaratively {
name("isAdsDisabled")
definingClass { endsWith("PreferencesHelper;") }
definingClass("PreferencesHelper;")
}

View file

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

View file

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

View file

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

View file

@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.getLibertyInitMethod by gettingFirstMethodDeclaratively {
name("init")
definingClass { endsWith("/Liberty;") }
definingClass("/Liberty;")
}

View file

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

View file

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

View file

@ -46,7 +46,7 @@ internal val BytecodePatchContext.historyMenuItemOfflineTabMethodMatch by compos
}
internal val BytecodePatchContext.searchActionViewMethod by gettingFirstMethodDeclaratively {
definingClass { endsWith("/SearchActionProvider;") }
definingClass("/SearchActionProvider;")
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("Landroid/view/View;")
parameterTypes()

View file

@ -5,7 +5,7 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.musicActivityOnCreateMethod by gettingFirstMethodDeclaratively {
name("onCreate")
definingClass { endsWith("/MusicActivity;") }
definingClass("/MusicActivity;")
returnType("V")
parameterTypes("Landroid/os/Bundle;")
}

View file

@ -9,7 +9,7 @@ import app.revanced.patcher.returnType
internal val BytecodePatchContext.googleApiActivityMethod by gettingFirstMethodDeclaratively {
name("onCreate")
definingClass { endsWith("GoogleApiActivity;") }
definingClass("GoogleApiActivity;")
returnType("V")
parameterTypes("Landroid/os/Bundle;")
}

View file

@ -10,13 +10,13 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.isPremiumUseCaseImplMethod by gettingFirstMethodDeclaratively {
name("doWork")
definingClass { endsWith("IsPremiumUseCaseImpl;") }
definingClass("IsPremiumUseCaseImpl;")
accessFlags(AccessFlags.PUBLIC)
}
internal val BytecodePatchContext.mainActivityNavigateToNativePremiumUpsellMethod by gettingFirstMethodDeclaratively {
name("navigateToNativePremiumUpsell")
definingClass { endsWith("MainActivity;") }
definingClass("MainActivity;")
accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL)
returnType("V")
}

View file

@ -9,6 +9,6 @@ val sharedExtensionPatch = sharedExtensionPatch(
extensionName = "nothingx",
extensionHook {
name("onCreate")
definingClass { contains("BaseApplication") }
definingClass("BaseApplication")
},
)

View file

@ -13,7 +13,7 @@ import app.revanced.patcher.returnType
*/
internal val BytecodePatchContext.applicationOnCreateMethod by gettingFirstMethodDeclaratively {
name("onCreate")
definingClass { endsWith("BaseApplication;") }
definingClass("BaseApplication;")
returnType("V")
parameterTypes()
}

View file

@ -10,7 +10,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.isDeviceRootedMethod by gettingFirstMethodDeclaratively {
name("isDeviceRooted")
definingClass { endsWith("/RootChecker;") }
definingClass("/RootChecker;")
accessFlags(AccessFlags.PUBLIC)
returnType("Z")
}

View file

@ -12,5 +12,5 @@ internal val BytecodePatchContext.getIsAdSupportedMethod by gettingFirstMethodDe
internal val BytecodePatchContext.requestAudioAdMethod by gettingFirstMethodDeclaratively {
name("requestAudioAdFromAdSDK")
definingClass { endsWith("ContentServiceOpsImpl;") }
definingClass("ContentServiceOpsImpl;")
}

View file

@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.getSkipLimitBehaviorMethod by gettingFirstMethodDeclaratively {
name("getSkipLimitBehavior")
definingClass { endsWith("UserData;") }
definingClass("UserData;")
}

View file

@ -10,5 +10,5 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.isPlusUnlockedMethod by gettingFirstMethodDeclaratively("genius") {
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("Z")
definingClass { endsWith("/User;") }
definingClass("/User;")
}

View file

@ -9,7 +9,7 @@ import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.shouldShowAdsMethod by gettingFirstMethodDeclaratively {
definingClass { endsWith("AdUtils;") }
definingClass("AdUtils;")
name("shouldShowAds")
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("Z")

View file

@ -9,7 +9,7 @@ import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.showReminderMethod by gettingFirstMethodDeclaratively {
definingClass { endsWith("AdsNotify;") }
definingClass("AdsNotify;")
name("show")
accessFlags(AccessFlags.PUBLIC, AccessFlags.STATIC)
returnType("V")

View file

@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.hideCommentAdsMethod by gettingFirstMethodDeclaratively {
name("invokeSuspend")
definingClass { contains("LoadAdsCombinedCall") }
definingClass("LoadAdsCombinedCall")
}

View file

@ -9,7 +9,7 @@ import app.revanced.patcher.returnType
import com.android.tools.smali.dexlib2.Opcode
internal val BytecodePatchContext.adPostMethod by gettingFirstMethodDeclaratively("children") {
definingClass { endsWith("Listing;") }
definingClass("Listing;")
returnType("V")
}

View file

@ -11,5 +11,5 @@ internal val BytecodePatchContext.buildUserAgentMethod by gettingFirstMethodDecl
internal val BytecodePatchContext.getClientIdMethod by gettingFirstMethodDeclaratively {
name("getClientId")
definingClass { endsWith("Credentials;") }
definingClass("Credentials;")
}

View file

@ -22,5 +22,5 @@ internal val BytecodePatchContext.detectPiracyMethod by gettingFirstMethodDeclar
Opcode.INVOKE_VIRTUAL,
Opcode.RETURN_VOID,
)
definingClass { endsWith("ProcessLifeCyleListener;") }
definingClass("ProcessLifeCyleListener;")
}

View file

@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.getClientIdMethod by gettingFirstMethodDeclaratively {
name("getClientId")
definingClass { endsWith("Credentials;") }
definingClass("Credentials;")
}

View file

@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.mainActivityOnCreateMethod by gettingFirstMethodDeclaratively {
name("onCreate")
definingClass { endsWith("MainActivity;") }
definingClass("MainActivity;")
}

View file

@ -8,7 +8,7 @@ import app.revanced.patcher.patch.BytecodePatchContext
import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.customImageViewLoadMethod by gettingFirstMethodDeclaratively {
definingClass { endsWith("CustomImageView;") }
definingClass("CustomImageView;")
accessFlags(AccessFlags.PUBLIC)
parameterTypes("Ljava/lang/String;", "Z", "Z", "I", "I")
}

View file

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

View file

@ -8,6 +8,6 @@ import app.revanced.patcher.returnType
internal val BytecodePatchContext.hasPremiumIconAccessMethod by gettingFirstMethodDeclaratively {
name("isPremiumSubscriber")
definingClass { endsWith("MyAccount;") }
definingClass("MyAccount;")
returnType("Z")
}

View file

@ -7,6 +7,6 @@ import app.revanced.patcher.immutableClassDef
import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.shareLinkFormatterMethod by gettingFirstMethodDeclaratively {
definingClass { startsWith("Lcom/reddit/sharing/") }
definingClass("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 gettingFirstMethodDeclaratively {
definingClass { endsWith("/DeviceIntegrityCheck;") }
definingClass("/DeviceIntegrityCheck;")
accessFlags(AccessFlags.PUBLIC)
returnType("V")
}

View file

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

View file

@ -6,7 +6,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal val BytecodePatchContext.lithoFilterInitMethod by gettingFirstMethodDeclaratively {
definingClass { endsWith("/LithoFilterPatch;") }
definingClass("/LithoFilterPatch;")
accessFlags(AccessFlags.STATIC, AccessFlags.CONSTRUCTOR)
}

View file

@ -9,17 +9,17 @@ import com.android.tools.smali.dexlib2.iface.ClassDef
context(_: BytecodePatchContext)
internal fun ClassDef.getGetCompressionQualityMethod() = firstMethodDeclaratively {
name("getCompressionQuality")
definingClass { endsWith("/MediaUploadParameters;") }
definingClass("/MediaUploadParameters;")
}
context(_: BytecodePatchContext)
internal fun ClassDef.getGetMaxDurationMethod() = firstMethodDeclaratively {
name("getMaxDuration")
definingClass { endsWith("/MediaUploadParameters;") }
definingClass("/MediaUploadParameters;")
}
context(_: BytecodePatchContext)
internal fun ClassDef.getGetMaxSizeMethod() = firstMethodDeclaratively {
name("getMaxSize")
definingClass { endsWith("/MediaUploadParameters;") }
definingClass("/MediaUploadParameters;")
}

View file

@ -6,5 +6,5 @@ import app.revanced.patches.shared.misc.extension.extensionHook
internal val applicationOnCreateHook = extensionHook {
name("onCreate")
definingClass { endsWith("/StravaApplication;") }
definingClass("/StravaApplication;")
}

View file

@ -7,10 +7,10 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.logInGetUsePasswordMethod by gettingFirstMethodDeclaratively {
name("getUsePassword")
definingClass { endsWith("/RequestOtpLogInNetworkResponse;") }
definingClass("/RequestOtpLogInNetworkResponse;")
}
internal val BytecodePatchContext.emailChangeGetUsePasswordMethod by gettingFirstMethodDeclaratively {
name("getUsePassword")
definingClass { endsWith("/RequestEmailChangeWithOtpOrPasswordResponse;") }
definingClass("/RequestEmailChangeWithOtpOrPasswordResponse;")
}

View file

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

View file

@ -9,6 +9,6 @@ import com.android.tools.smali.dexlib2.Opcode
internal val BytecodePatchContext.getModulesMethodMatch by composingFirstMethod {
name("getModules")
definingClass { endsWith("/GenericLayoutEntry;") }
definingClass("/GenericLayoutEntry;")
opcodes(Opcode.IGET_OBJECT)
}

View file

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

View file

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

View file

@ -11,19 +11,19 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.aclCommonShareMethod by gettingFirstMethodDeclaratively {
name("getCode")
definingClass { endsWith("/ACLCommonShare;") }
definingClass("/ACLCommonShare;")
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("I")
}
internal val BytecodePatchContext.aclCommonShare2Method by gettingFirstMethodDeclaratively {
name("getShowType")
definingClass { endsWith("/ACLCommonShare;") }
definingClass("/ACLCommonShare;")
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("I")
}
internal val BytecodePatchContext.aclCommonShare3Method by gettingFirstMethodDeclaratively {
name("getTranscode")
definingClass { endsWith("/ACLCommonShare;") }
definingClass("/ACLCommonShare;")
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("I")
}

View file

@ -6,7 +6,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.getSpeedMethod by gettingFirstMethodDeclaratively {
name("onFeedSpeedSelectedEvent")
definingClass { endsWith("/BaseListFragmentPanel;") }
definingClass("/BaseListFragmentPanel;")
}
internal val BytecodePatchContext.setSpeedMethod by gettingFirstMethodDeclaratively("enterFrom") {

View file

@ -5,10 +5,10 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.mandatoryLoginServiceMethod by gettingFirstMethodDeclaratively {
name("enableForcedLogin")
definingClass { endsWith("/MandatoryLoginService;") }
definingClass("/MandatoryLoginService;")
}
internal val BytecodePatchContext.mandatoryLoginService2Method by gettingFirstMethodDeclaratively {
name("shouldShowForcedLogin")
definingClass { endsWith("/MandatoryLoginService;") }
definingClass("/MandatoryLoginService;")
}

View file

@ -5,12 +5,12 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.addSettingsEntryMethod by gettingFirstMethodDeclaratively {
name("initUnitManger")
definingClass { endsWith("/SettingNewVersionFragment;") }
definingClass("/SettingNewVersionFragment;")
}
internal val BytecodePatchContext.adPersonalizationActivityOnCreateMethod by gettingFirstMethodDeclaratively {
name("onCreate")
definingClass { endsWith("/AdPersonalizationActivity;") }
definingClass("/AdPersonalizationActivity;")
}
internal val BytecodePatchContext.settingsEntryMethod by gettingFirstImmutableMethodDeclaratively(

View file

@ -6,7 +6,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode
internal val BytecodePatchContext.getEnterFromMethod by gettingFirstImmutableMethodDeclaratively {
definingClass { endsWith("/BaseListFragmentPanel;") }
definingClass("/BaseListFragmentPanel;")
returnType("Ljava/lang/String;")
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
parameterTypes("Z")
@ -22,5 +22,5 @@ internal val BytecodePatchContext.getEnterFromMethod by gettingFirstImmutableMet
}
internal val BytecodePatchContext.onRenderFirstFrameMethod by gettingFirstMethodDeclaratively("method_enable_viewpager_preload_duration") {
definingClass { endsWith("/BaseListFragmentPanel;") }
definingClass("/BaseListFragmentPanel;")
}

View file

@ -7,10 +7,10 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.isVIPEPMethod by gettingFirstMethodDeclaratively {
name("isVIPEP")
definingClass { endsWith("RemoteUser;") }
definingClass("RemoteUser;")
}
internal val BytecodePatchContext.isVIPMethod by gettingFirstMethodDeclaratively {
name("isVIP")
definingClass { endsWith("RemoteUser;") }
definingClass("RemoteUser;")
}

View file

@ -6,7 +6,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.brightnessMethod by gettingFirstMethodDeclaratively {
name("run")
definingClass { contains("/ScreenPlugin$") }
definingClass("/ScreenPlugin$")
accessFlags(AccessFlags.PUBLIC)
returnType("V")
parameterTypes()

View file

@ -8,7 +8,7 @@ import com.android.tools.smali.dexlib2.Opcode
// This is the constructor of the PostsResponse class.
// The same applies here as with the TimelineConstructorMethod.
internal val BytecodePatchContext.postsResponseConstructorMethod by gettingFirstMethodDeclaratively {
definingClass { endsWith("/PostsResponse;") }
definingClass("/PostsResponse;")
accessFlags(AccessFlags.CONSTRUCTOR, AccessFlags.PUBLIC)
custom { parameters.size == 4 }
}
@ -17,7 +17,7 @@ internal val BytecodePatchContext.postsResponseConstructorMethod by gettingFirst
// It receives the List<TimelineObject> as an argument with a @Json annotation, so this should be the first time
// that the List<TimelineObject> is exposed in non-library code.
internal val BytecodePatchContext.timelineConstructorMethod by gettingFirstMethodDeclaratively("timelineObjectsList") {
definingClass { endsWith("/Timeline;") }
definingClass("/Timeline;")
custom { parameters[0].type == "Ljava/util/List;" }
}
@ -25,7 +25,7 @@ internal val BytecodePatchContext.timelineConstructorMethod by gettingFirstMetho
// Looking for
// if ("BLOCKED_OBJECT_DUMMY".equals(elementType)) iterator.remove();
internal val BytecodePatchContext.timelineFilterExtensionMethodMatch by composingFirstMethod("BLOCKED_OBJECT_DUMMY") {
definingClass { endsWith("/TimelineFilterPatch;") }
definingClass("/TimelineFilterPatch;")
opcodes(
Opcode.CONST_STRING, // "BLOCKED_OBJECT_DUMMY"
Opcode.INVOKE_VIRTUAL, // HashSet.add(^)

View file

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

View file

@ -5,21 +5,21 @@ import app.revanced.patcher.patch.BytecodePatchContext
internal val BytecodePatchContext.checkAdEligibilityLambdaMethod by gettingFirstMethodDeclaratively {
name("shouldRequestAd")
definingClass { endsWith("/AdEligibilityFetcher;") }
definingClass("/AdEligibilityFetcher;")
returnType("Lio/reactivex/Single;")
parameterTypes("L")
}
internal val BytecodePatchContext.contentConfigShowAdsMethod by gettingFirstMethodDeclaratively {
name("getShowAds")
definingClass { endsWith("/ContentConfigData;") }
definingClass("/ContentConfigData;")
returnType("Z")
parameterTypes()
}
internal val BytecodePatchContext.getReadyToShowAdMethod by gettingFirstMethodDeclaratively {
name("getReadyToShowAdOrAbort")
definingClass { endsWith("/StreamDisplayAdsPresenter;") }
definingClass("/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 gettingFirstMethodDeclaratively {
name("createDeletedSpanFromChatMessageSpan")
definingClass { endsWith("ChatUtil\$Companion;") }
definingClass("ChatUtil\$Companion;")
}
internal val BytecodePatchContext.deletedMessageClickableSpanCtorMethod by gettingFirstMethodDeclaratively {
definingClass { endsWith("DeletedMessageClickableSpan;") }
definingClass("DeletedMessageClickableSpan;")
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
}
internal val BytecodePatchContext.setHasModAccessMethod by gettingFirstMethodDeclaratively {
name("setHasModAccess")
definingClass { endsWith("DeletedMessageClickableSpan;") }
definingClass("DeletedMessageClickableSpan;")
}

View file

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

View file

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

View file

@ -6,7 +6,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.menuGroupsOnClickMethod by gettingFirstMethodDeclaratively {
name { contains("render") }
definingClass { endsWith("/SettingsMenuViewDelegate;") }
definingClass("/SettingsMenuViewDelegate;")
accessFlags(AccessFlags.PRIVATE, AccessFlags.STATIC, AccessFlags.FINAL)
returnType("V")
parameterTypes("L", "L", "L")
@ -19,10 +19,10 @@ internal val BytecodePatchContext.menuGroupsUpdatedMethod by gettingFirstMethodD
internal val BytecodePatchContext.settingsActivityOnCreateMethod by gettingFirstMethodDeclaratively {
name("onCreate")
definingClass { endsWith("/SettingsActivity;") }
definingClass("/SettingsActivity;")
}
internal val BytecodePatchContext.settingsMenuItemEnumMethod by gettingFirstMethodDeclaratively {
name("<clinit>")
definingClass { endsWith("/SettingsMenuItem;") }
definingClass("/SettingsMenuItem;")
}

View file

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

View file

@ -49,7 +49,7 @@ internal val BytecodePatchContext.disableFastForwardLegacyMethodMatch by composi
}
internal val BytecodePatchContext.disableFastForwardGestureMethodMatch by composingFirstMethod {
definingClass { endsWith("/NextGenWatchLayout;") }
definingClass("/NextGenWatchLayout;")
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("Z")
parameterTypes()

View file

@ -21,7 +21,7 @@ internal val BytecodePatchContext.storyboardRendererDecoderRecommendedLevelMetho
}
internal val BytecodePatchContext.subtitleTrackMethod by gettingFirstMethodDeclaratively("DISABLE_CAPTIONS_OPTION") {
definingClass { endsWith("/SubtitleTrack;") }
definingClass("/SubtitleTrack;")
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("Z")
parameterTypes()

View file

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

View file

@ -6,7 +6,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
internal val BytecodePatchContext.setFullScreenBackgroundColorMethod by gettingFirstMethodDeclaratively {
name("onLayout")
definingClass { endsWith("/YouTubePlayerViewNotForReflection;") }
definingClass("/YouTubePlayerViewNotForReflection;")
returnType("V")
accessFlags(AccessFlags.PROTECTED, AccessFlags.FINAL)
parameterTypes("Z", "I", "I", "I", "I")

View file

@ -21,7 +21,7 @@ val playerTypeHookPatch = bytecodePatch(
apply {
firstMethodDeclaratively {
definingClass { endsWith("/YouTubePlayerOverlaysLayout;") }
definingClass("/YouTubePlayerOverlaysLayout;")
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("V")
parameterTypes(playerTypeEnumMethod.immutableClassDef.type)

View file

@ -8,7 +8,7 @@ import com.android.tools.smali.dexlib2.Opcode
internal val BytecodePatchContext.licenseActivityOnCreateMethod by gettingFirstMethodDeclaratively {
name("onCreate")
definingClass { endsWith("/LicenseActivity;") }
definingClass("/LicenseActivity;")
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
returnType("V")
parameterTypes("Landroid/os/Bundle;")