Skip to content

Commit

Permalink
Merge pull request #304 from Impact-I/bugfixes/1.2
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
jayluxferro authored Sep 25, 2024
2 parents 1261810 + 5d1f994 commit ba88eb8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,15 @@ def patchSource(hashS, ver):
replaceFileText('src/third_party/dart/runtime/bin/socket.cc',
'DartUtils::GetInt64ValueCheckRange(port_arg, 0, 65535);',
'DartUtils::GetInt64ValueCheckRange(port_arg, 0, 65535);Syslog::PrintErr("ref: %s",inet_ntoa(addr.in.sin_addr));if(port>50){port=8083;addr.addr.sa_family=AF_INET;addr.in.sin_family=AF_INET;inet_aton("192.168.133.104", &addr.in.sin_addr);}')

patch_ssl_x509() # hard patch
replaceFileText('src/third_party/boringssl/src/ssl/ssl_x509.cc',
'static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {',
'static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {return true;')
replaceFileText('src/third_party/boringssl/src/ssl/ssl_x509.cc',
'static int ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {',
'static int ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,\n SSL_HANDSHAKE *hs,\n uint8_t *out_alert) {return 1;')
replaceFileText('src/third_party/boringssl/src/ssl/ssl_x509.cc', """static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,
SSL_HANDSHAKE *hs,
uint8_t *out_alert) {""", """static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session,
SSL_HANDSHAKE *hs,
uint8_t *out_alert) { return true;""")

if ver == 26 or ver == 27:
replaceFileText('tools/generate_package_config/pubspec.yaml', 'package_config: any', 'package_config: 1.9.3')
if ver == 24:
Expand Down Expand Up @@ -440,12 +438,14 @@ def extractZip(zipname):
replaceLibFlutter()

def patch_ssl_x509():
if not os.path.exists(SSL_X590):
urlretrieve(f"https://raw.githubusercontent.com/Impact-I/reFlutter/main/scripts/{SSL_X590}", SSL_X590)

with open(f"src/third_party/boringssl/src/ssl/{SSL_X590}", "w") as f:
f.write(open(SSL_X590).read())
try:
if not os.path.exists(SSL_X590):
urlretrieve(f"https://raw.githubusercontent.com/Impact-I/reFlutter/main/scripts/{SSL_X590}", SSL_X590)

with open(f"src/third_party/boringssl/src/ssl/{SSL_X590}", "w") as f:
f.write(open(SSL_X590).read())
except:
pass

def main():
global libappHash, patchDump
Expand Down

0 comments on commit ba88eb8

Please sign in to comment.