mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-26 04:01:02 +00:00
correct use of endsWith etc
This commit is contained in:
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -28,7 +28,7 @@ internal val startActivityInitHook = extensionHook(
|
||||
},
|
||||
) {
|
||||
name("onCreate")
|
||||
definingClass("/StartActivity;"::endsWith)
|
||||
definingClass { endsWith("/StartActivity;") }
|
||||
instructions(
|
||||
Opcode.INVOKE_STATIC(),
|
||||
Opcode.MOVE_RESULT(),
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ internal val homeActivityInitHook = extensionHook(
|
||||
},
|
||||
) {
|
||||
name("onCreate")
|
||||
definingClass("/HomeActivity;"::endsWith)
|
||||
definingClass { endsWith("/HomeActivity;") }
|
||||
instructions(
|
||||
Opcode.CONST_STRING(),
|
||||
Opcode.INVOKE_STATIC(),
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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"())
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
|
||||
|
||||
internal val BytecodePatchContext.primaryAdsMethod by gettingFirstMutableMethodDeclaratively {
|
||||
name("isAdsDisabled")
|
||||
definingClass("PreferencesHelper;"::endsWith)
|
||||
definingClass { endsWith("PreferencesHelper;") }
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
|
||||
|
||||
internal val BytecodePatchContext.getCanChangeAppIconMethod by gettingFirstMutableMethodDeclaratively {
|
||||
name("getCanChangeAppIcon")
|
||||
definingClass("SettingsAppIconFragment;"::endsWith)
|
||||
definingClass { endsWith("SettingsAppIconFragment;") }
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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;")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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") }
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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" }
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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" }
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
|
||||
|
||||
internal val BytecodePatchContext.getSubscribedMethod by gettingFirstMutableMethodDeclaratively {
|
||||
name("getSubscribed")
|
||||
definingClass("/SubscriptionDetailResponse;"::endsWith)
|
||||
definingClass { endsWith("/SubscriptionDetailResponse;") }
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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;",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
|
||||
|
||||
internal val BytecodePatchContext.audioAdsPresenterPlayMethod by gettingFirstMutableMethodDeclaratively {
|
||||
name("playAd")
|
||||
definingClass("AudioAdsPlayerPresenter;"::endsWith)
|
||||
definingClass { endsWith("AudioAdsPlayerPresenter;") }
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
|
||||
|
||||
internal val BytecodePatchContext.communityPointsButtonViewDelegateMethod by gettingFirstMutableMethodDeclaratively {
|
||||
name("showClaimAvailable")
|
||||
definingClass("CommunityPointsButtonViewDelegate;"::endsWith)
|
||||
definingClass { endsWith("CommunityPointsButtonViewDelegate;") }
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -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;") }
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ import app.revanced.patcher.patch.BytecodePatchContext
|
||||
|
||||
internal val BytecodePatchContext.promoCodeUnlockMethod by gettingFirstMutableMethodDeclaratively {
|
||||
name("isValid")
|
||||
definingClass("PromoTokenVerification;"::endsWith)
|
||||
}
|
||||
definingClass { endsWith("PromoTokenVerification;") }
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user