mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-13 05:37:40 +02:00
revert(Hide ads): Disable advertising id
This commit is contained in:
@ -38,7 +38,7 @@ public class VideoQualityPatch {
|
|||||||
if (videoId.equals(newlyLoadedVideoId))
|
if (videoId.equals(newlyLoadedVideoId))
|
||||||
return;
|
return;
|
||||||
videoId = newlyLoadedVideoId;
|
videoId = newlyLoadedVideoId;
|
||||||
setVideoQuality(Settings.SKIP_PRELOADED_BUFFER.get() ? 250 : 500);
|
setVideoQuality(Settings.SKIP_PRELOADED_BUFFER.get() ? 250 : 750);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,7 +10,6 @@ import app.revanced.patcher.patch.bytecodePatch
|
|||||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||||
import app.revanced.patcher.util.smali.ExternalLabel
|
import app.revanced.patcher.util.smali.ExternalLabel
|
||||||
import app.revanced.patches.shared.extension.Constants.PATCHES_PATH
|
import app.revanced.patches.shared.extension.Constants.PATCHES_PATH
|
||||||
import app.revanced.util.fingerprint.matchOrThrow
|
|
||||||
import app.revanced.util.fingerprint.methodOrThrow
|
import app.revanced.util.fingerprint.methodOrThrow
|
||||||
import app.revanced.util.getReference
|
import app.revanced.util.getReference
|
||||||
import app.revanced.util.getWalkerMethod
|
import app.revanced.util.getWalkerMethod
|
||||||
@ -33,20 +32,15 @@ fun baseAdsPatch(
|
|||||||
) {
|
) {
|
||||||
execute {
|
execute {
|
||||||
|
|
||||||
setOf(
|
videoAdsFingerprint.methodOrThrow().apply {
|
||||||
sslGuardFingerprint,
|
addInstructionsWithLabels(
|
||||||
videoAdsFingerprint,
|
0, """
|
||||||
).forEach { fingerprint ->
|
invoke-static {}, $classDescriptor->$methodDescriptor()Z
|
||||||
fingerprint.methodOrThrow().apply {
|
move-result v0
|
||||||
addInstructionsWithLabels(
|
if-nez v0, :show_ads
|
||||||
0, """
|
return-void
|
||||||
invoke-static {}, $classDescriptor->$methodDescriptor()Z
|
""", ExternalLabel("show_ads", getInstruction(0))
|
||||||
move-result v0
|
)
|
||||||
if-nez v0, :show_ads
|
|
||||||
return-void
|
|
||||||
""", ExternalLabel("show_ads", getInstruction(0))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
musicAdsFingerprint.methodOrThrow().apply {
|
musicAdsFingerprint.methodOrThrow().apply {
|
||||||
@ -67,21 +61,6 @@ fun baseAdsPatch(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
advertisingIdFingerprint.matchOrThrow().let {
|
|
||||||
it.method.apply {
|
|
||||||
val insertIndex = it.stringMatches!!.first().index
|
|
||||||
val insertRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
|
|
||||||
addInstructionsWithLabels(
|
|
||||||
insertIndex, """
|
|
||||||
invoke-static {}, $classDescriptor->$methodDescriptor()Z
|
|
||||||
move-result v$insertRegister
|
|
||||||
if-nez v$insertRegister, :enable_id
|
|
||||||
return-void
|
|
||||||
""", ExternalLabel("enable_id", getInstruction(insertIndex))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,24 +4,6 @@ import app.revanced.util.fingerprint.legacyFingerprint
|
|||||||
import app.revanced.util.or
|
import app.revanced.util.or
|
||||||
import com.android.tools.smali.dexlib2.AccessFlags
|
import com.android.tools.smali.dexlib2.AccessFlags
|
||||||
import com.android.tools.smali.dexlib2.Opcode
|
import com.android.tools.smali.dexlib2.Opcode
|
||||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
|
||||||
|
|
||||||
internal val advertisingIdFingerprint = legacyFingerprint(
|
|
||||||
name = "advertisingIdFingerprint",
|
|
||||||
returnType = "V",
|
|
||||||
strings = listOf("a."),
|
|
||||||
customFingerprint = { method, classDef ->
|
|
||||||
MethodUtil.isConstructor(method) &&
|
|
||||||
classDef.fields.find { it.type == "Ljava/util/Random;" } != null
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
internal val sslGuardFingerprint = legacyFingerprint(
|
|
||||||
name = "sslGuardFingerprint",
|
|
||||||
returnType = "V",
|
|
||||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
|
||||||
strings = listOf("Cannot initialize SslGuardSocketFactory will null"),
|
|
||||||
)
|
|
||||||
|
|
||||||
internal val musicAdsFingerprint = legacyFingerprint(
|
internal val musicAdsFingerprint = legacyFingerprint(
|
||||||
name = "musicAdsFingerprint",
|
name = "musicAdsFingerprint",
|
||||||
|
Reference in New Issue
Block a user