diff --git a/Ifish.xcodeproj/project.pbxproj b/Ifish.xcodeproj/project.pbxproj
index 1c55af1..9f7c9bc 100644
--- a/Ifish.xcodeproj/project.pbxproj
+++ b/Ifish.xcodeproj/project.pbxproj
@@ -16101,7 +16101,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 9;
+ CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
@@ -16221,7 +16221,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 9;
+ CURRENT_PROJECT_VERSION = 10;
DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES;
diff --git a/Ifish/Ifish.entitlements b/Ifish/Ifish.entitlements
index a4896c8..bdbfb61 100644
--- a/Ifish/Ifish.entitlements
+++ b/Ifish/Ifish.entitlements
@@ -8,5 +8,7 @@
com.apple.external-accessory.wireless-configuration
+ com.apple.developer.networking.multicast
+
diff --git a/Ifish/airkiss/JMAirKissConnection.m b/Ifish/airkiss/JMAirKissConnection.m
index 73483d3..6e2e044 100644
--- a/Ifish/airkiss/JMAirKissConnection.m
+++ b/Ifish/airkiss/JMAirKissConnection.m
@@ -77,6 +77,11 @@
*/
- (void)connectAirKissWithSSID:(NSString *)ssidStr
password:(NSString *)password {
+ //处理中文的情况
+ if([self validateContainsChinese:ssidStr])
+ {
+ ssidStr = [ssidStr stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+ }
NSMutableArray *dataArray = [_airKissEncoder createAirKissEncorderWithSSID:ssidStr ? :@""
password:password ? :@""];
@@ -104,11 +109,11 @@
[mData appendBytes:&value length:1];
}
NSString*host = kAirKiss_Host;
- if (@available(iOS 16.0, *))
- {
- NSArray *arr = [_localIP componentsSeparatedByString:@"."];
- host=[NSString stringWithFormat:@"%@.%@.%@.255",arr[0], arr[1], arr[2]];
- }
+// if (@available(iOS 16.0, *))
+// {
+// NSArray *arr = [_localIP componentsSeparatedByString:@"."];
+// host=[NSString stringWithFormat:@"%@.%@.%@.255",arr[0], arr[1], arr[2]];
+// }
[_clientUdpSocket sendData:mData
toHost:host
@@ -135,6 +140,30 @@
_clientUdpSocket = nil;
_serverUdpSocket = nil;
}
+- (BOOL)validateContainsChinese:(NSString *)content
+
+{
+
+ // ^[\u4e00-\u9fa5] 以中文开头 的字符串
+
+ // [\u4e00-\u9fa5] 包含中文
+
+ NSRegularExpression *regularexpression = [[NSRegularExpression alloc]
+
+ initWithPattern:@"^[\u4e00-\u9fa5]"
+
+ options:NSRegularExpressionCaseInsensitive
+
+ error:nil];
+
+ return ([regularexpression numberOfMatchesInString:content
+
+ options:NSMatchingReportProgress
+
+ range:NSMakeRange(0, content.length)] > 0);
+
+}
+
#pragma mark - Set up udp socket
- (void)setupClientUdpSocket