From eef0ab71cc69a925ba40b5aac58b62dcad1cf6fe Mon Sep 17 00:00:00 2001 From: Yifei Kong Date: Wed, 25 Sep 2024 15:13:28 +0800 Subject: [PATCH] Update safari scripts --- chrome/curl_safari18_0 | 19 +++++++------ chrome/curl_safari18_0_ios | 25 ++++++++-------- chrome/patches/curl-impersonate.patch | 41 ++++++++++++++------------- 3 files changed, 44 insertions(+), 41 deletions(-) diff --git a/chrome/curl_safari18_0 b/chrome/curl_safari18_0 index 99bb9795..f9dfacff 100755 --- a/chrome/curl_safari18_0 +++ b/chrome/curl_safari18_0 @@ -9,19 +9,20 @@ dir=${0%/*} "$dir/curl-impersonate-chrome" \ --ciphers TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:TLS_RSA_WITH_AES_256_GCM_SHA384:TLS_RSA_WITH_AES_128_GCM_SHA256:TLS_RSA_WITH_AES_256_CBC_SHA:TLS_RSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA:TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:TLS_RSA_WITH_3DES_EDE_CBC_SHA \ --curves X25519:P-256:P-384:P-521 \ - --signature-hashes ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256,rsa_pkcs1_sha256,ecdsa_secp384r1_sha384,ecdsa_sha1,rsa_pss_rsae_sha384,rsa_pss_rsae_sha384,rsa_pkcs1_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha512,rsa_pkcs1_sha1 \ - -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \ - -H 'Sec-Fetch-Site: none' \ - -H 'Accept-Encoding: gzip, deflate, br' \ - -H 'Sec-Fetch-Mode: navigate' \ - -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15' \ - -H 'Accept-Language: en-US,en;q=0.9' \ - -H 'Sec-Fetch-Dest: document' \ + --signature-hashes ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256,rsa_pkcs1_sha256,ecdsa_secp384r1_sha384,rsa_pss_rsae_sha384,rsa_pss_rsae_sha384,rsa_pkcs1_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha512,rsa_pkcs1_sha1 \ + -H "sec-fetch-dest: document" \ + -H "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15" \ + -H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \ + -H "sec-fetch-site: none" \ + -H "sec-fetch-mode: navigate" \ + -H "accept-language: en-US,en;q=0.9" \ + -H "priority: u=0, i" \ + -H "accept-encoding: gzip, deflate, br" \ --http2 \ --http2-settings '2:0;3:100;4:2097152;8:1;9:1' \ --http2-pseudo-headers-order 'msap' \ --http2-window-update 10420225 \ - --http2-stream-weight 255 \ + --http2-stream-weight 256 \ --http2-stream-exclusive 0 \ --compressed \ --tlsv1.0 --no-tls-session-ticket \ diff --git a/chrome/curl_safari18_0_ios b/chrome/curl_safari18_0_ios index e9743e00..6af28287 100755 --- a/chrome/curl_safari18_0_ios +++ b/chrome/curl_safari18_0_ios @@ -9,19 +9,20 @@ dir=${0%/*} "$dir/curl-impersonate-chrome" \ --ciphers TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:TLS_RSA_WITH_AES_256_GCM_SHA384:TLS_RSA_WITH_AES_128_GCM_SHA256:TLS_RSA_WITH_AES_256_CBC_SHA:TLS_RSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA:TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:TLS_RSA_WITH_3DES_EDE_CBC_SHA \ --curves X25519:P-256:P-384:P-521 \ - --signature-hashes ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256,rsa_pkcs1_sha256,ecdsa_secp384r1_sha384,ecdsa_sha1,rsa_pss_rsae_sha384,rsa_pss_rsae_sha384,rsa_pkcs1_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha512,rsa_pkcs1_sha1 \ - -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \ - -H 'Sec-Fetch-Site: none' \ - -H 'Accept-Encoding: gzip, deflate, br' \ - -H 'Sec-Fetch-Mode: navigate' \ - -H 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Mobile/15E148 Safari/604.1' \ - -H 'Accept-Language: en-US,en;q=0.9' \ - -H 'Sec-Fetch-Dest: document' \ + --signature-hashes ecdsa_secp256r1_sha256,rsa_pss_rsae_sha256,rsa_pkcs1_sha256,ecdsa_secp384r1_sha384,rsa_pss_rsae_sha384,rsa_pss_rsae_sha384,rsa_pkcs1_sha384,rsa_pss_rsae_sha512,rsa_pkcs1_sha512,rsa_pkcs1_sha1 \ + -H "sec-fetch-dest: document" \ + -H "user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1" \ + -H "accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \ + -H "sec-fetch-site: none" \ + -H "sec-fetch-mode: navigate" \ + -H "accept-language: en-US,en;q=0.9" \ + -H "priority: u=0, i" \ + -H "accept-encoding: gzip, deflate, br" \ --http2 \ - --http2-settings '2:0;4:2097152;3:100' \ - --http2-pseudo-headers-order 'mspa' \ - --http2-window-update 10485760 \ - --http2-stream-weight 255 \ + --http2-settings '2:0;3:100;4:2097152;8:1;9:1' \ + --http2-pseudo-headers-order 'msap' \ + --http2-window-update 10420225 \ + --http2-stream-weight 256 \ --http2-stream-exclusive 0 \ --compressed \ --tlsv1.0 --no-tls-session-ticket \ diff --git a/chrome/patches/curl-impersonate.patch b/chrome/patches/curl-impersonate.patch index cdeaf92a..2c008cf3 100644 --- a/chrome/patches/curl-impersonate.patch +++ b/chrome/patches/curl-impersonate.patch @@ -1522,10 +1522,10 @@ index 80e183480..8ee390b7e 100644 * Store nghttp2 version info in this buffer. diff --git a/lib/impersonate.c b/lib/impersonate.c new file mode 100644 -index 000000000..eb4e48dc9 +index 000000000..36d6df836 --- /dev/null +++ b/lib/impersonate.c -@@ -0,0 +1,1128 @@ +@@ -0,0 +1,1129 @@ +#include "curl_setup.h" + +#include @@ -2412,18 +2412,19 @@ index 000000000..eb4e48dc9 + .tls_session_ticket = false, + .cert_compression = "zlib", + .http_headers = { -+ "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", -+ "Sec-Fetch-Site: none", -+ "Accept-Encoding: gzip, deflate, br", -+ "Sec-Fetch-Mode: navigate", -+ "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Mobile/15E148 Safari/604.1", -+ "Accept-Language: en-US,en;q=0.9", -+ "Sec-Fetch-Dest: document" ++ "sec-fetch-dest: document", ++ "user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1", ++ "accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", ++ "sec-fetch-site: none", ++ "sec-fetch-mode: navigate", ++ "accept-language: en-US,en;q=0.9", ++ "priority: u=0, i", ++ "accept-encoding: gzip, deflate, br" + }, -+ .http2_settings = "2:0;4:2097152;3:100", -+ .http2_window_update = 10485760, -+ .http2_pseudo_headers_order = "mspa", -+ .http2_stream_weight = 255, ++ .http2_settings = "2:0;3:100;4:2097152;8:1;9:1", ++ .http2_window_update = 10420225, ++ .http2_pseudo_headers_order = "msap", ++ .http2_stream_weight = 256, + .http2_stream_exclusive = 0, + .tls_extension_order = NULL, + .tls_grease = true @@ -2532,14 +2533,14 @@ index 000000000..eb4e48dc9 + .tls_session_ticket = false, + .cert_compression = "zlib", + .http_headers = { -+ "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", -+ "Sec-Fetch-Site: none", -+ "Accept-Encoding: gzip, deflate, br", -+ "Sec-Fetch-Mode: navigate", ++ "sec-fetch-dest: document", + "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15", -+ "Accept-Language: en-US,en;q=0.9", -+ "priority: u=0, i" -+ "Sec-Fetch-Dest: document" ++ "accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", ++ "sec-fetch-site: none", ++ "sec-fetch-mode: navigate", ++ "accept-language: en-US,en;q=0.9", ++ "priority: u=0, i", ++ "accept-encoding: gzip, deflate, br" + }, + .http2_settings = "2:0;3:100;4:2097152;8:1;9:1", + .http2_window_update = 10420225,