Skip to content

Commit

Permalink
Merge branch 'dev' into revanced-extended
Browse files Browse the repository at this point in the history
  • Loading branch information
inotia00 committed Dec 9, 2024
2 parents 5088daa + 977b7f4 commit 2b0f12c
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public static String blockInitPlaybackRequest(String originalUrlString) {
String path = originalUri.getPath();

if (path != null && path.contains("initplayback")) {
Logger.printDebug(() -> "Blocking 'initplayback' by returning unreachable url");
Logger.printDebug(() -> "Blocking 'initplayback' by clearing query");

return UNREACHABLE_HOST_URI_STRING;
return originalUri.buildUpon().clearQuery().build().toString();
}
} catch (Exception ex) {
Logger.printException(() -> "blockInitPlaybackRequest failure", ex);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ org.gradle.parallel = true
android.useAndroidX = true
kotlin.code.style = official
kotlin.jvm.target.validation.mode = IGNORE
version = 5.0.2
version = 5.0.3

2 changes: 1 addition & 1 deletion patches.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,20 @@ fun baseAdsPatch(
) {
execute {

videoAdsFingerprint.methodOrThrow().apply {
addInstructionsWithLabels(
0, """
invoke-static {}, $classDescriptor->$methodDescriptor()Z
move-result v0
if-nez v0, :show_ads
return-void
""", ExternalLabel("show_ads", getInstruction(0))
)
setOf(
sslGuardFingerprint,
videoAdsFingerprint,
).forEach { fingerprint ->
fingerprint.methodOrThrow().apply {
addInstructionsWithLabels(
0, """
invoke-static {}, $classDescriptor->$methodDescriptor()Z
move-result v0
if-nez v0, :show_ads
return-void
""", ExternalLabel("show_ads", getInstruction(0))
)
}
}

musicAdsFingerprint.methodOrThrow().apply {
Expand All @@ -62,6 +67,21 @@ 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))
)
}
}

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ 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
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(
name = "musicAdsFingerprint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ internal val castContextFetchFingerprint = legacyFingerprint(
strings = listOf("Error fetching CastContext.")
)

internal val castDynamiteModuleFingerprint = legacyFingerprint(
name = "castDynamiteModuleFingerprint",
strings = listOf("com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl")
)
internal val castDynamiteModuleV2Fingerprint = legacyFingerprint(
name = "castDynamiteModuleV2Fingerprint",
strings = listOf("Failed to load module via V2: ")
)

internal val googlePlayUtilityFingerprint = legacyFingerprint(
name = "castContextFetchFingerprint",
returnType = "I",
Expand All @@ -44,12 +53,6 @@ internal val serviceCheckFingerprint = legacyFingerprint(
strings = listOf("Google Play Services not available")
)

internal val gmsServiceBrokerFingerprint = legacyFingerprint(
name = "gmsServiceBrokerFingerprint",
returnType = "V",
strings = listOf("mServiceBroker is null, client disconnected")
)

internal val primesApiFingerprint = legacyFingerprint(
name = "primesApiFingerprint",
returnType = "V",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,6 @@ fun gmsCoreSupportPatch(
required = true,
)

val disableGmsServiceBroker by booleanOption(
key = "disableGmsServiceBroker",
default = false,
title = "Disable GmsService Broker",
description = """
Disabling GmsServiceBroker will somewhat improve crashes caused by unimplemented GmsCore services.
For YouTube, the 'Spoof streaming data' setting is required.
""".trimIndentMultiline(),
required = true,
)

val packageNameYouTubeOption = stringOption(
key = "packageNameYouTube",
default = DEFAULT_PACKAGE_NAME_YOUTUBE,
Expand Down Expand Up @@ -305,12 +293,11 @@ fun gmsCoreSupportPatch(
// Return these methods early to prevent the app from crashing.
setOf(
castContextFetchFingerprint,
castDynamiteModuleFingerprint,
castDynamiteModuleV2Fingerprint,
googlePlayUtilityFingerprint,
serviceCheckFingerprint,
).forEach { it.methodOrThrow().returnEarly() }
if (disableGmsServiceBroker == true) {
gmsServiceBrokerFingerprint.methodOrThrow().returnEarly()
}

// Specific method that needs to be patched.
transformPrimeMethod()
Expand Down Expand Up @@ -365,18 +352,10 @@ fun gmsCoreSupportPatch(
/**
* A collection of permissions, intents and content provider authorities
* that are present in GmsCore which need to be transformed.
*
* NOTE: The following were present, but it seems like they are not needed to be transformed:
* - com.google.android.gms.chimera.GmsIntentOperationService
* - com.google.android.gms.phenotype.internal.IPhenotypeCallbacks
* - com.google.android.gms.phenotype.internal.IPhenotypeService
* - com.google.android.gms.phenotype.PACKAGE_NAME
* - com.google.android.gms.phenotype.UPDATE
* - com.google.android.gms.phenotype
*/
private object Constants {
/**
* A list of all permissions.
* All permissions.
*/
val PERMISSIONS = setOf(
// C2DM / GCM
Expand Down Expand Up @@ -460,11 +439,9 @@ private object Constants {
"com.google.android.gms.feedback.internal.IFeedbackService",

// cast
"com.google.android.gms.cast.firstparty.START",
"com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE",

// chimera
"com.google.android.gms.chimera",

// fonts
"com.google.android.gms.fonts",

Expand Down Expand Up @@ -504,9 +481,6 @@ private object Constants {
// auth
"com.google.android.gms.auth.accounts",

// chimera
"com.google.android.gms.chimera",

// fonts
"com.google.android.gms.fonts",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private fun gmsCoreSupportResourcePatch(
packageNameYouTubeMusicOption: Option<String>,
) = app.revanced.patches.shared.gms.gmsCoreSupportResourcePatch(
fromPackageName = YOUTUBE_PACKAGE_NAME,
spoofedPackageSignature = "afb0fed5eeaebdd86f56a97742f4b6b33ef59875",
spoofedPackageSignature = "24bb24c05e47e0aefa68a58a766179d9b613a600",
gmsCoreVendorGroupIdOption = gmsCoreVendorGroupIdOption,
packageNameYouTubeOption = packageNameYouTubeOption,
packageNameYouTubeMusicOption = packageNameYouTubeMusicOption,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,13 @@ Esto es necesario para que la aplicación funcione."</string>

Pulsa el botón de continuar y desactiva las optimizaciones de la batería."</string>
<string name="gms_core_dialog_continue_text">Continuar</string>
<string name="revanced_spoof_client_title">Falsificar cliente</string>
<string name="revanced_spoof_client_summary">\"falsifica al cliente para evitar problemas de reproducción.

Limitaciones:
• Código de audio OPUS puede no ser compatible.
• La miniatura de la barra de Seekbar puede no estar presente.
• El historial de la vista no funciona con una cuenta de marca.</string>
<string name="revanced_sanitize_sharing_links_title">Desinfectar enlaces compartidos</string>
<string name="revanced_sanitize_sharing_links_summary">Elimina los parámetros de consulta de seguimiento de las URL al compartir enlaces.</string>
<string name="revanced_default_app_settings_title">Abrir ajustes predeterminados de la app</string>
Expand Down
10 changes: 5 additions & 5 deletions patches/src/main/resources/music/translations/vi-rVN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ Nhấp vào đây để xem các bước phát hành khóa API."</string>
<string name="revanced_enable_debug_logging_summary">Bật ghi nhật ký gỡ lỗi.</string>
<string name="revanced_enable_debug_buffer_logging_title">Bật nhật ký bộ đệm gỡ lỗi</string>
<string name="revanced_enable_debug_buffer_logging_summary">Bao gồm bộ đệm trong nhật ký gỡ lỗi.</string>
<string name="revanced_enable_opus_codec_title">Kích hoạt Codec OPUS</string>
<string name="revanced_enable_opus_codec_title">Codec OPUS</string>
<string name="revanced_enable_opus_codec_summary">"Áp dụng codec OPUS nếu phản hồi của trình phát bao gồm nó.

Cụ thể:
Expand All @@ -398,10 +398,10 @@ Nhấn vào nút Tiếp tục và tắt tối ưu hóa pin."</string>
<string name="revanced_spoof_client_title">Giả mạo ứng dụng khách</string>
<string name="revanced_spoof_client_summary">Giả mạo ứng dụng khách để khắc phục sự cố phát.

Hạn chế:
• Codec âm thanh OPUS có thể không được hỗ trợ.
• Hình thu nhỏ trên thanh tiến trình có thể không hiện hữu.
• Nhật ký xem không hoạt động đối với tài khoản thương hiệu.</string>
\n\nHạn chế:
\n• Codec âm thanh OPUS có thể không được hỗ trợ.
\n• Hình thu nhỏ trên thanh tiến trình có thể không hiện hữu.
\n• Nhật ký xem không hoạt động đối với tài khoản thương hiệu.</string>
<string name="revanced_sanitize_sharing_links_title">Liên kết sạch khi chia sẻ</string>
<string name="revanced_sanitize_sharing_links_summary">Loại bỏ các tham số truy vấn theo dõi khỏi URL khi chia sẻ liên kết.</string>
<string name="revanced_default_app_settings_title">Mở theo mặc định</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ Playlists
Πληροφορίες:
• Ενδέχεται να μη λειτουργεί σε ζωντανές μεταδόσεις."</string>
<string name="revanced_overlay_button_play_all_type_title">Ταξινόμηση λίστας αναπαραγωγής</string>
<string name="revanced_overlay_button_play_all_type_entry_1">Όλο το περιεχόμενο (Ταξινόμηση κατά χρονο)</string>
<string name="revanced_overlay_button_play_all_type_entry_1">Όλο το περιεχόμενο (Ταξινόμηση κατά χρόνο)</string>
<string name="revanced_overlay_button_play_all_type_entry_2">Όλο το περιεχόμενο (Ταξινόμηση κατά δημοφιλία)</string>
<string name="revanced_overlay_button_play_all_type_entry_3">Βίντεο μόνο (Ταξινόμηση κατά χρόνο)</string>
<string name="revanced_overlay_button_play_all_type_entry_4">Βίντεο μόνο (Ταξινόμηση κατά δημοφιλία)</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ DeArrow の詳細については、ここをタップしてください。"</str
<string name="revanced_overlay_button_play_all_type_entry_10">「メンバーのみ」の動画</string>
<string name="revanced_overlay_button_play_all_type_entry_11">「メンバーのみ」のショート</string>
<string name="revanced_overlay_button_play_all_type_entry_12">「メンバーのみ」のライブ</string>
<string name="revanced_overlay_button_play_all_not_available_toast">チャンネル ID が一致しないため再生リストを生成できません。</string>
<string name="revanced_overlay_button_play_all_not_available_toast">チャンネル ID が一致しないため、再生リストを生成できません。</string>
<string name="revanced_whitelist_settings_title">チャンネルのホワイトリスト</string>
<string name="revanced_whitelist_settings_summary">ホワイトリストに登録したチャンネルのリストを確認/削除します。</string>
<string name="revanced_whitelist_added">チャンネル「%1$s」を %2$s ホワイトリストに登録しました。</string>
Expand Down Expand Up @@ -1705,7 +1705,7 @@ API キーの発行方法については、ここをタップしてください
<string name="revanced_spoof_streaming_data_side_effects_title">ストリーミングデータを偽装することによる副作用</string>
<string name="revanced_spoof_streaming_data_side_effects_ios">"・ライブは最初から再生されます。
・動画が 1 秒早く終了する可能性があります。"</string>
<string name="revanced_spoof_streaming_data_side_effects_ios_skip_livestream_playback">動画が 1 秒早く終了する可能性があります。</string>
<string name="revanced_spoof_streaming_data_side_effects_ios_skip_livestream_playback">動画が 1 秒早く終了する可能性があります。</string>
<string name="revanced_spoof_streaming_data_side_effects_android_unplugged">"・「音声トラック」メニューは表示されません。
・「一定音量」は使用できません。"</string>
<string name="revanced_spoof_streaming_data_side_effects_android_vr">"•「音声トラック」メニューは表示されません。
Expand All @@ -1717,8 +1717,8 @@ API キーの発行方法については、ここをタップしてください

注意: \n・AVC コーデック (H.264) の最大解像度は 1080p です。\n・動画の再生には VP9 や AV1 よりも多くの通信量を消費します。"</string>
<string name="revanced_spoof_streaming_data_ios_skip_livestream_playback_title">iOS でライブ再生をスキップ</string>
<string name="revanced_spoof_streaming_data_ios_skip_livestream_playback_summary_on">iOS クライアントでライブを再生するのを無効化します。</string>
<string name="revanced_spoof_streaming_data_ios_skip_livestream_playback_summary_off">iOS クライアントでライブを再生するのを無効化します。</string>
<string name="revanced_spoof_streaming_data_ios_skip_livestream_playback_summary_on">ライブ再生時には iOS クライアントを使用しません。</string>
<string name="revanced_spoof_streaming_data_ios_skip_livestream_playback_summary_off">ライブ再生時には iOS クライアントを使用しません。</string>
<string name="revanced_spoof_streaming_data_stats_for_nerds_title">統計情報に偽装したクライアントを表示</string>
<string name="revanced_spoof_streaming_data_stats_for_nerds_summary_on">統計情報に偽装したストリーミングデータを表示します。</string>
<string name="revanced_spoof_streaming_data_stats_for_nerds_summary_off">統計情報に偽装したストリーミングデータを表示します。</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ Nhấn và giữ để đặt lại tốc độ phát video (1.0x). Nhấn và g
<string name="revanced_overlay_button_whitelist_title">Nút Danh sách trắng</string>
<string name="revanced_overlay_button_whitelist_summary">Nhấn để mở hộp thoại Danh sách trắng.
Nhấn và giữ để mở hộp thoại cài đặt Danh sách trắng.</string>
<string name="revanced_overlay_button_play_all_title">Nút phát tất cả</string>
<string name="revanced_overlay_button_play_all_title">Nút Phát tất cả</string>
<string name="revanced_overlay_button_play_all_summary">"Nhấn để tạo danh sách phát bao gồm tất cả các video từ kênh.
Nhấn và giữ để hoàn tác.

Expand Down Expand Up @@ -1670,7 +1670,7 @@ Nhấn vào Tiếp tục và tắt tối ưu hóa pin."</string>
<string name="revanced_change_share_sheet_title">Thay đổi giao diện chia sẻ</string>
<string name="revanced_change_share_sheet_summary_on">Sử dụng giao diện chia sẻ của hệ thống.</string>
<string name="revanced_change_share_sheet_summary_off">Sử dụng giao diện chia sẻ của ứng dụng.</string>
<string name="revanced_enable_opus_codec_title">Kích hoạt Codec OPUS</string>
<string name="revanced_enable_opus_codec_title">Codec OPUS</string>
<string name="revanced_enable_opus_codec_summary">Kích hoạt codec OPUS nếu phản hồi của trình phát bao gồm codec OPUS.</string>
<!-- PreferenceScreen: Miscellaneous, PreferenceCategory: Miscellaneous, PreferenceScreen: Import / Export settings -->
<string name="revanced_preference_screen_import_export_title">Nhập/Xuất cài đặt</string>
Expand Down

0 comments on commit 2b0f12c

Please sign in to comment.