Skip to content

Commit

Permalink
feat(YT Music): Bump new versions
Browse files Browse the repository at this point in the history
  • Loading branch information
anddea committed Mar 22, 2024
1 parent cc87b2d commit 1fbaeef
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
4 changes: 2 additions & 2 deletions api/revanced-patches.api
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,8 @@ public final class app/revanced/patches/music/utils/intenthook/IntentHookPatch :
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
}

public final class app/revanced/patches/music/utils/intenthook/fingerprints/FullStackTraceActivityFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
public static final field INSTANCE Lapp/revanced/patches/music/utils/intenthook/fingerprints/FullStackTraceActivityFingerprint;
public final class app/revanced/patches/music/utils/intenthook/fingerprints/GoogleApiActivityFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
public static final field INSTANCE Lapp/revanced/patches/music/utils/intenthook/fingerprints/GoogleApiActivityFingerprint;
}

public final class app/revanced/patches/music/utils/litho/LithoFilterPatch : app/revanced/patcher/patch/BytecodePatch, java/io/Closeable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.music.player.oldstyleminiplayer.fingerprints.MiniPlayerParentFingerprint
Expand All @@ -23,7 +24,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
SettingsPatch::class,
SharedResourceIdPatch::class
],
compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")]
compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")],
use = false
)
@Suppress("unused")
object OldStyleMiniPlayerPatch : BytecodePatch(
Expand Down Expand Up @@ -53,7 +55,7 @@ object OldStyleMiniPlayerPatch : BytecodePatch(
"""
)
}
} ?: throw NextButtonVisibilityFingerprint.exception
} ?: throw PatchException("This version is not supported. Please use YT Music 6.42 or earlier.")
} ?: throw MiniPlayerParentFingerprint.exception

SwipeToCloseFingerprint.result?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.music.utils.integrations.Constants.INTEGRATIONS_PATH
import app.revanced.patches.music.utils.intenthook.fingerprints.FullStackTraceActivityFingerprint
import app.revanced.patches.music.utils.intenthook.fingerprints.GoogleApiActivityFingerprint
import app.revanced.patches.music.utils.settings.SettingsPatch
import app.revanced.util.exception

@Patch(dependencies = [SettingsPatch::class])
object IntentHookPatch : BytecodePatch(
setOf(FullStackTraceActivityFingerprint)
setOf(GoogleApiActivityFingerprint)
) {
override fun execute(context: BytecodeContext) {

FullStackTraceActivityFingerprint.result?.let {
GoogleApiActivityFingerprint.result?.let {
it.mutableMethod.apply {
addInstructionsWithLabels(
1, """
Expand All @@ -28,7 +28,7 @@ object IntentHookPatch : BytecodePatch(
""", ExternalLabel("show", getInstruction(1))
)
}
} ?: throw FullStackTraceActivityFingerprint.exception
} ?: throw GoogleApiActivityFingerprint.exception

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package app.revanced.patches.music.utils.intenthook.fingerprints

import app.revanced.patcher.fingerprint.MethodFingerprint

object FullStackTraceActivityFingerprint : MethodFingerprint(
object GoogleApiActivityFingerprint : MethodFingerprint(
returnType = "V",
parameters = listOf("Landroid/os/Bundle;"),
customFingerprint = { methodDef, _ ->
methodDef.definingClass.endsWith("/FullStackTraceActivity;") && methodDef.name == "onCreate"
methodDef.definingClass.endsWith("/GoogleApiActivity;") && methodDef.name == "onCreate"
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object ResourceUtils {
"com.google.android.apps.youtube.music.ui.preference.SwitchCompatPreference"

const val YOUTUBE_MUSIC_PREFERENCE_TARGET_CLASS =
"com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity"
"com.google.android.gms.common.api.GoogleApiActivity"

var targetPackage = "com.google.android.apps.youtube.music"

Expand Down
18 changes: 9 additions & 9 deletions src/main/resources/music/sponsorblock/xml/sponsorblock_prefs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
<com.google.android.apps.youtube.music.ui.preference.SwitchCompatPreference android:title="@string/sb_toast_on_skip" android:key="sb_toast_on_skip" android:summary="@string/sb_toast_on_skip_sum" android:dependency="sb_enabled" android:defaultValue="true" />
<com.google.android.apps.youtube.music.ui.preference.SwitchCompatPreference android:title="@string/sb_toast_on_connection_error" android:key="sb_toast_on_connection_error" android:summary="@string/sb_toast_on_connection_error_sum" android:dependency="sb_enabled" android:defaultValue="false" />
<Preference android:title="@string/sb_api_url" android:key="sb_api_url" android:summary="@string/sb_api_url_sum" android:dependency="sb_enabled">
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_api_url" android:targetClass="com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity" />
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_api_url" android:targetClass="com.google.android.gms.common.api.GoogleApiActivity" />
</Preference>
<com.google.android.apps.youtube.music.ui.preference.PreferenceCategoryCompat android:title="@string/sb_diff_segments" android:key="segments">
<Preference android:title="@string/sb_segments_sponsor" android:key="sb_segments_sponsor" android:summary="@string/sb_segments_sponsor_sum">
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_sponsor" android:targetClass="com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity" />
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_sponsor" android:targetClass="com.google.android.gms.common.api.GoogleApiActivity" />
</Preference>
<Preference android:title="@string/sb_segments_selfpromo" android:key="sb_segments_selfpromo" android:summary="@string/sb_segments_selfpromo_sum">
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_selfpromo" android:targetClass="com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity" />
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_selfpromo" android:targetClass="com.google.android.gms.common.api.GoogleApiActivity" />
</Preference>
<Preference android:title="@string/sb_segments_interaction" android:key="sb_segments_interaction" android:summary="@string/sb_segments_interaction_sum">
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_interaction" android:targetClass="com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity" />
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_interaction" android:targetClass="com.google.android.gms.common.api.GoogleApiActivity" />
</Preference>
<Preference android:title="@string/sb_segments_intro" android:key="sb_segments_intro" android:summary="@string/sb_segments_intro_sum">
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_intro" android:targetClass="com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity" />
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_intro" android:targetClass="com.google.android.gms.common.api.GoogleApiActivity" />
</Preference>
<Preference android:title="@string/sb_segments_outro" android:key="sb_segments_outro" android:summary="@string/sb_segments_outro_sum">
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_outro" android:targetClass="com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity" />
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_outro" android:targetClass="com.google.android.gms.common.api.GoogleApiActivity" />
</Preference>
<Preference android:title="@string/sb_segments_preview" android:key="sb_segments_preview" android:summary="@string/sb_segments_preview_sum">
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_preview" android:targetClass="com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity" />
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_preview" android:targetClass="com.google.android.gms.common.api.GoogleApiActivity" />
</Preference>
<Preference android:title="@string/sb_segments_filler" android:key="sb_segments_filler" android:summary="@string/sb_segments_filler_sum">
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_filler" android:targetClass="com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity" />
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_filler" android:targetClass="com.google.android.gms.common.api.GoogleApiActivity" />
</Preference>
<Preference android:title="@string/sb_segments_nomusic" android:key="sb_segments_music_offtopic" android:summary="@string/sb_segments_nomusic_sum">
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_music_offtopic" android:targetClass="com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity" />
<intent android:targetPackage="com.google.android.apps.youtube.music" android:data="sb_segments_music_offtopic" android:targetClass="com.google.android.gms.common.api.GoogleApiActivity" />
</Preference>
</com.google.android.apps.youtube.music.ui.preference.PreferenceCategoryCompat>
<com.google.android.apps.youtube.music.ui.preference.PreferenceCategoryCompat android:title="@string/sb_about" android:key="about">
Expand Down

0 comments on commit 1fbaeef

Please sign in to comment.