From 3d49ae565d2265023b47c3278e878c096ab109c1 Mon Sep 17 00:00:00 2001 From: Yawata Date: Mon, 30 Dec 2024 09:13:26 +0800 Subject: [PATCH] feat: Add support for IP address:port access Update regex to support IP address format Improve URL handling logic for IP addresses Update error message to reflect supported formats fix: Allow cleartext HTTP traffic Add android:usesCleartextTraffic="true" to AndroidManifest.xml Fix err_cleartext_not_permitted error perf: Optimize regex performance Precompile regex patterns as constants Use precompiled URL_PATTERN and IP_PATTERN for matching Reduce CPU overhead on each button click --- .idea/compiler.xml | 2 +- .idea/gradle.xml | 1 + .idea/misc.xml | 2 +- app/src/main/AndroidManifest.xml | 3 +- .../java/com/example/lobchat/MainActivity.kt | 17 ++++----- .../com/example/lobchat/WebViewActivity.kt | 36 +++++++++++++++++-- 6 files changed, 48 insertions(+), 13 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index b589d56..b86273d 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 0897082..7b3006b 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,6 +4,7 @@