-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(YouTube Music): Add
Watch history
patch
- Loading branch information
Showing
13 changed files
with
114 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
patches/src/main/kotlin/app/revanced/patches/music/misc/watchhistory/WatchHistoryPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package app.revanced.patches.music.misc.watchhistory | ||
|
||
import app.revanced.patcher.patch.bytecodePatch | ||
import app.revanced.patches.shared.trackingurlhook.hookWatchHistory | ||
import app.revanced.patches.shared.trackingurlhook.trackingUrlHookPatch | ||
import app.revanced.patches.music.utils.compatibility.Constants.COMPATIBLE_PACKAGE | ||
import app.revanced.patches.music.utils.patch.PatchList.WATCH_HISTORY | ||
import app.revanced.patches.music.utils.settings.CategoryType | ||
import app.revanced.patches.music.utils.settings.addPreferenceWithIntent | ||
import app.revanced.patches.music.utils.settings.settingsPatch | ||
|
||
@Suppress("unused") | ||
val watchHistoryPatch = bytecodePatch( | ||
WATCH_HISTORY.title, | ||
WATCH_HISTORY.summary, | ||
) { | ||
compatibleWith(COMPATIBLE_PACKAGE) | ||
|
||
dependsOn( | ||
settingsPatch, | ||
trackingUrlHookPatch, | ||
) | ||
|
||
execute { | ||
hookWatchHistory() | ||
|
||
addPreferenceWithIntent( | ||
CategoryType.MISC, | ||
"revanced_watch_history_type" | ||
) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
patches/src/main/kotlin/app/revanced/patches/shared/trackingurlhook/Fingerprints.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package app.revanced.patches.shared.trackingurlhook | ||
|
||
import app.revanced.util.fingerprint.legacyFingerprint | ||
import app.revanced.util.or | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
internal val trackingUrlModelFingerprint = legacyFingerprint( | ||
name = "trackingUrlModelFingerprint", | ||
returnType = "Landroid/net/Uri;", | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
parameters = emptyList(), | ||
opcodes = listOf( | ||
Opcode.IGET_OBJECT, | ||
Opcode.INVOKE_STATIC, | ||
Opcode.MOVE_RESULT_OBJECT, | ||
), | ||
) | ||
|
||
/** | ||
* On YouTube, this class is 'Lcom/google/android/libraries/youtube/innertube/model/player/TrackingUrlModel;' | ||
* On YouTube Music, class names are obfuscated. | ||
*/ | ||
internal val trackingUrlModelToStringFingerprint = legacyFingerprint( | ||
name = "trackingUrlModelToStringFingerprint", | ||
returnType = "Ljava/lang/String;", | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
parameters = emptyList(), | ||
strings = listOf( | ||
"@", | ||
"baseUrl->", | ||
"params->", | ||
"headers->", | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
patches/src/main/kotlin/app/revanced/patches/youtube/utils/trackingurlhook/Fingerprints.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters