Skip to content

Commit 5726353

Browse files
author
LisoUseInAIKyrios
committed
fix(YouTube - Check watch history domain name resolution): Fix false positive warning message if the internet connection fails halfway into the DNS check
1 parent 70f4955 commit 5726353

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

extensions/shared/library/src/main/java/app/revanced/extension/shared/patches/CheckWatchHistoryDomainNameResolutionPatch.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ public static void checkDnsResolver(Activity context) {
6161
// Prevent this false positive by verify youtube.com resolves.
6262
// If youtube.com does not resolve, then it's not a watch history domain resolving error
6363
// because the entire app will not work since no domains are resolving.
64-
if (!domainResolvesToValidIP("youtube.com")
64+
String domainYouTube = "youtube.com";
65+
if (!domainResolvesToValidIP(domainYouTube)
66+
|| domainResolvesToValidIP(HISTORY_TRACKING_ENDPOINT)
67+
// Check multiple times, so a false positive from a flaky connection is almost impossible.
68+
|| !domainResolvesToValidIP(domainYouTube)
6569
|| domainResolvesToValidIP(HISTORY_TRACKING_ENDPOINT)) {
6670
return;
6771
}

patches/src/main/resources/addresources/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Second \"item\" text"</string>
4545
<string name="revanced_check_environment_not_near_patch_time_invalid">APK build date is corrupted</string>
4646
</patch>
4747
<patch id="misc.dns.checkWatchHistoryDomainNameResolutionPatch">
48-
<string name="revanced_check_watch_history_domain_name_dialog_title">Warning</string>
48+
<string name="revanced_check_watch_history_domain_name_dialog_title">ReVanced Notice</string>
4949
<string name="revanced_check_watch_history_domain_name_dialog_message">Your watch history is not being saved.&lt;br>&lt;br>This most likely is caused by a DNS ad blocker or network proxy.&lt;br>&lt;br>To fix this, whitelist &lt;b>s.youtube.com&lt;/b> or turn off all DNS blockers and proxies.</string>
5050
<string name="revanced_check_watch_history_domain_name_dialog_ignore">Do not show again</string>
5151
</patch>

0 commit comments

Comments
 (0)