diff --git a/Ifish.xcodeproj/project.pbxproj b/Ifish.xcodeproj/project.pbxproj index 9f7c9bc..3512949 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 = 10; + CURRENT_PROJECT_VERSION = 11; 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 = 10; + CURRENT_PROJECT_VERSION = 11; DEVELOPMENT_TEAM = WFX8GD5HFX; ENABLE_BITCODE = NO; ENABLE_TESTABILITY = YES; diff --git a/Ifish/ESPTouch/task/ESPTouchTaskParameter.m b/Ifish/ESPTouch/task/ESPTouchTaskParameter.m index 2408d85..3172d74 100644 --- a/Ifish/ESPTouch/task/ESPTouchTaskParameter.m +++ b/Ifish/ESPTouch/task/ESPTouchTaskParameter.m @@ -150,7 +150,8 @@ static int _datagramCount = 0; if (self.broadcast) { NSString *localInetAddr4 = [ESP_NetUtil getLocalIPv4]; NSArray *arr = [localInetAddr4 componentsSeparatedByString:@"."]; - return [NSString stringWithFormat:@"%@.%@.%@.255",arr[0], arr[1], arr[2]]; + //[NSString stringWithFormat:@"%@.%@.%@.255",arr[0], arr[1], arr[2]]; + return @"255.255.255.255"; } else { int count = [self __getNextDatagramCount]; return [NSString stringWithFormat: @"234.%d.%d.%d", count, count, count]; diff --git a/Ifish/airkiss/JMAirKissConnection.m b/Ifish/airkiss/JMAirKissConnection.m index 6e2e044..36e9bbf 100644 --- a/Ifish/airkiss/JMAirKissConnection.m +++ b/Ifish/airkiss/JMAirKissConnection.m @@ -77,11 +77,7 @@ */ - (void)connectAirKissWithSSID:(NSString *)ssidStr password:(NSString *)password { - //处理中文的情况 - if([self validateContainsChinese:ssidStr]) - { - ssidStr = [ssidStr stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; - } + NSMutableArray *dataArray = [_airKissEncoder createAirKissEncorderWithSSID:ssidStr ? :@"" password:password ? :@""]; diff --git a/Ifish/airkiss/JMAirKissEncoder.m b/Ifish/airkiss/JMAirKissEncoder.m index 46cbdcd..9442c2e 100644 --- a/Ifish/airkiss/JMAirKissEncoder.m +++ b/Ifish/airkiss/JMAirKissEncoder.m @@ -91,7 +91,12 @@ */ - (void)getMagicCodeWithSSID:(NSString *)ssid password:(NSString *)password { - UInt8 length = ssid.length + password.length + 1; + + NSUInteger numberOfBytes = [ssid lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + Byte bytes[numberOfBytes]; + NSRange range = NSMakeRange(0, numberOfBytes); + [ssid getBytes:bytes maxLength:numberOfBytes usedLength:nil encoding:NSUTF8StringEncoding options:0 range:range remainingRange:NULL]; + UInt8 length = numberOfBytes + password.length + 1; UInt8 magicCode[4] = {0x00,0x00,0x00,0x00}; magicCode[0] = 0x00 | (length >> 4 & 0xF); @@ -101,8 +106,8 @@ magicCode[1] = 0x10 | (length & 0xF); - UInt8 *cipherBuffer = (UInt8*)[ssid UTF8String]; - UInt8 crc8 = CRC8(cipherBuffer, (int)ssid.length); + UInt8 *cipherBuffer = (UInt8*)bytes; + UInt8 crc8 = CRC8(cipherBuffer, (int)numberOfBytes); magicCode[2] = 0x20 | (crc8 >> 4 & 0xF); magicCode[3] = 0x30 | (crc8 & 0xF);