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 8, 2024
2 parents b5fe136 + 28aa2cd commit 5088daa
Show file tree
Hide file tree
Showing 17 changed files with 149 additions and 77 deletions.
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.1
version = 5.0.2

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 @@ -32,20 +32,16 @@ fun baseAdsPatch(
description = "baseAdsPatch"
) {
execute {
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))
)
}

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))
)
}

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

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,6 @@ 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,16 +25,6 @@ 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 @@ -54,6 +44,12 @@ 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,6 +104,18 @@ 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 @@ -293,11 +305,12 @@ 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 @@ -352,10 +365,18 @@ 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 {
/**
* All permissions.
* A list of all permissions.
*/
val PERMISSIONS = setOf(
// C2DM / GCM
Expand Down Expand Up @@ -439,9 +460,11 @@ 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 @@ -481,6 +504,9 @@ 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 @@ -10,6 +10,7 @@ import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.litho.addLithoFilter
import app.revanced.patches.shared.litho.lithoFilterPatch
import app.revanced.patches.shared.settingmenu.settingsMenuPatch
import app.revanced.patches.shared.viewgroup.viewGroupMarginLayoutParamsHookPatch
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.patches.youtube.utils.extension.Constants.COMPONENTS_PATH
Expand Down Expand Up @@ -52,6 +53,7 @@ val layoutComponentsPatch = bytecodePatch(
lithoFilterPatch,
sharedResourceIdPatch,
settingsPatch,
settingsMenuPatch,
viewGroupMarginLayoutParamsHookPatch,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import app.revanced.patches.youtube.utils.extension.Constants.PATCH_STATUS_CLASS
import app.revanced.patches.youtube.utils.extension.Constants.PLAYER_CLASS_DESCRIPTOR
import app.revanced.patches.youtube.utils.flyoutmenu.flyoutMenuHookPatch
import app.revanced.patches.youtube.utils.patch.PatchList.SEEKBAR_COMPONENTS
import app.revanced.patches.youtube.utils.playerButtonsResourcesFingerprint
import app.revanced.patches.youtube.utils.playerButtonsVisibilityFingerprint
import app.revanced.patches.youtube.utils.playerSeekbarColorFingerprint
import app.revanced.patches.youtube.utils.playservice.is_19_23_or_greater
Expand Down Expand Up @@ -238,7 +239,7 @@ val seekbarComponentsPatch = bytecodePatch(
)
}

playerButtonsVisibilityFingerprint.methodOrThrow(playerButtonsVisibilityFingerprint).apply {
playerButtonsVisibilityFingerprint.methodOrThrow(playerButtonsResourcesFingerprint).apply {
val freeRegister = implementation!!.registerCount - parameters.size - 2
val viewIndex = indexOfFirstInstructionOrThrow(Opcode.INVOKE_INTERFACE)
val viewRegister = getInstruction<FiveRegisterInstruction>(viewIndex).registerD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
<!-- PreferenceScreen: Ads -->
<string name="revanced_preference_screen_ads_title">Διαφημίσεις</string>
<string name="revanced_hide_fullscreen_ads_title">Απόκρυψη διαφημίσεων πλήρους οθόνης</string>
<string name="revanced_hide_fullscreen_ads_summary">"Απόκρυψη των ενδιάμεσων διαφημίσεων πλήρους οθόνης."</string>
<string name="revanced_hide_fullscreen_ads_summary">"Απόκρυψη των ενδιάμεσων διαφημίσεων πλήρους οθόνης.

Περιορισμοί:
• Ενδέχεται μερικές φορές να φαίνεται μια κενή μαύρη οθόνη αντί για την αρχική ροή."</string>
<string name="revanced_hide_general_ads_title">Απόκρυψη γενικών διαφημίσεων</string>
<string name="revanced_hide_general_ads_summary">Απόκρυψη των γενικών διαφημίσεων.</string>
<string name="revanced_hide_music_ads_title">Απόκρυψη διαφημίσεων μουσικής</string>
Expand Down Expand Up @@ -394,6 +397,7 @@
<string name="revanced_spoof_client_summary">Παραποίηση του προγράμματος πελάτη για την αποφυγή προβλημάτων αναπαραγωγής.

Περιορισμοί:
• Ο κωδικοποιητής ήχου OPUS ενδέχεται να μην υποστηρίζεται.
• Οι μικρογραφίες προεπισκόπησης στη γραμμή προόδου ενδέχεται να μην υπάρχουν.
• Το ιστορικό παρακολούθησης δεν λειτουργεί σε λογαριασμούς επωνυμίας (brand).</string>
<string name="revanced_sanitize_sharing_links_title">Καθαρισμός συνδέσμων κοινοποίησης</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ Por favor, baixe %2$s do site."</string>
<!-- PreferenceScreen: Ads -->
<string name="revanced_preference_screen_ads_title">Anúncios</string>
<string name="revanced_hide_fullscreen_ads_title">Ocultar anúncios em tela cheia</string>
<string name="revanced_hide_fullscreen_ads_summary">"Oculta anúncios em tela cheia."</string>
<string name="revanced_hide_fullscreen_ads_summary">"Oculta anúncios de tela cheia.

Limitações:
• Às vezes você pode ver uma tela preta em branco ao invés da fonte inicial."</string>
<string name="revanced_hide_general_ads_title">Ocultar anúncios gerais</string>
<string name="revanced_hide_general_ads_summary">Oculta anúncios gerais.</string>
<string name="revanced_hide_music_ads_title">Ocultar anúncios de mídia</string>
Expand Down Expand Up @@ -393,9 +396,10 @@ Isto é necessário para o aplicativo funcionar."</string>
Toque no botão continuar e desative as otimizações da bateria."</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">Falsificar o cliente para evitar problemas de reprodução.
<string name="revanced_spoof_client_summary">\"Falsificar o cliente para evitar problemas de reprodução.

Limitações:
• O codec de áudio OPUS pode não ser suportado.
• Miniatura na barra de busca pode não estar presente.
• Histórico de exibição não funciona com uma conta de marca.</string>
<string name="revanced_sanitize_sharing_links_title">Limpar links compartilhados</string>
Expand Down
12 changes: 11 additions & 1 deletion patches/src/main/resources/music/translations/uk-rUA/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
<!-- PreferenceScreen: Ads -->
<string name="revanced_preference_screen_ads_title">Реклама</string>
<string name="revanced_hide_fullscreen_ads_title">Приховати повноекранну рекламу</string>
<string name="revanced_hide_fullscreen_ads_summary">"Приховує повноекранну рекламу."</string>
<string name="revanced_hide_fullscreen_ads_summary">"Приховує повноекранну рекламу.

Обмеження:
• Іноді замість головної стрічки ви можете побачити порожній чорний екран."</string>
<string name="revanced_hide_general_ads_title">Приховати загальну рекламу</string>
<string name="revanced_hide_general_ads_summary">Приховує загальну рекламу.</string>
<string name="revanced_hide_music_ads_title">Приховати медіарекламу</string>
Expand Down Expand Up @@ -392,6 +395,13 @@

Натисніть кнопку продовжити й вимкніть оптимізацію акумулятора."</string>
<string name="gms_core_dialog_continue_text">Продовжити</string>
<string name="revanced_spoof_client_title">Підміна клієнта</string>
<string name="revanced_spoof_client_summary">Підробити клієнт, щоб запобігти проблемам із відтворенням.

Обмеження:
• Аудіокодек OPUS може не підтримуватися.
• Мініатюри перемотки можуть бути відсутніми.
• Історія переглядів не працює з обліковим записом бренду.</string>
<string name="revanced_sanitize_sharing_links_title">Обробляти поширення посилань</string>
<string name="revanced_sanitize_sharing_links_summary">Видаляє параметри запиту відстеження з URL-адрес під час обміну посиланнями.</string>
<string name="revanced_default_app_settings_title">Відкрити налаштування за замовчуванням</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
<!-- PreferenceScreen: Ads -->
<string name="revanced_preference_screen_ads_title">Quảng cáo</string>
<string name="revanced_hide_fullscreen_ads_title">Ẩn quảng cáo toàn màn hình</string>
<string name="revanced_hide_fullscreen_ads_summary">"Ẩn quảng cáo toàn màn hình."</string>
<string name="revanced_hide_fullscreen_ads_summary">"Ẩn quảng cáo toàn màn hình.

Hạn chế:
• Đôi khi mở thẻ Trang chủ, bạn chỉ thấy một màn hình màu đen."</string>
<string name="revanced_hide_general_ads_title">Ẩn quảng cáo chung</string>
<string name="revanced_hide_general_ads_summary">Ẩn quảng cáo xuất hiện trước khi phát.</string>
<string name="revanced_hide_music_ads_title">Ẩn quảng cáo</string>
Expand Down Expand Up @@ -396,6 +399,7 @@ 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_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>
<string name="revanced_sanitize_sharing_links_title">Liên kết sạch khi chia sẻ</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1729,8 +1729,7 @@ Playlists
<string name="revanced_spoof_streaming_data_type_entry_android_unplugged">Android TV</string>
<string name="revanced_spoof_streaming_data_type_entry_android_vr">Android VR</string>
<string name="revanced_spoof_streaming_data_side_effects_title">Παρενέργειες παραποίησης</string>
<string name="revanced_spoof_streaming_data_side_effects_ios">"• Οι ταινίες ή τα επί πληρωμή βίντεο ενδέχεται να μην αναπαράγονται.
• Οι ζωντανές μεταδόσεις ξεκινούν από την αρχή κατά την αναπαραγωγή.
<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_android_unplugged">"• Το μενού «Κομμάτι ήχου» λείπει.
Expand Down
Loading

0 comments on commit 5088daa

Please sign in to comment.