diff --git a/CustomKeyboard/Resource/KBSkinIconMap.strings b/CustomKeyboard/Resource/KBSkinIconMap.strings index 2ae0dba..e8ee353 100644 --- a/CustomKeyboard/Resource/KBSkinIconMap.strings +++ b/CustomKeyboard/Resource/KBSkinIconMap.strings @@ -214,6 +214,8 @@ "sym_lt" = "key_lt"; /* '>' */ "sym_gt" = "key_gt"; +/* '¥' */ +"sym_money" = "key_money"; /* '€' */ "sym_euro" = "key_euro"; /* '£' */ diff --git a/CustomKeyboard/Resource/fense.zip b/CustomKeyboard/Resource/fense.zip index d6800c0..6613bf0 100644 Binary files a/CustomKeyboard/Resource/fense.zip and b/CustomKeyboard/Resource/fense.zip differ diff --git a/CustomKeyboard/View/KBKeyboardView.m b/CustomKeyboard/View/KBKeyboardView.m index 2feb255..f1dc854 100644 --- a/CustomKeyboard/View/KBKeyboardView.m +++ b/CustomKeyboard/View/KBKeyboardView.m @@ -197,7 +197,7 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5; [KBKey keyWithIdentifier:@"sym_semicolon" title:@";" output:@";" type:KBKeyTypeCharacter], [KBKey keyWithIdentifier:@"sym_paren_l" title:@"(" output:@"(" type:KBKeyTypeCharacter], [KBKey keyWithIdentifier:@"sym_paren_r" title:@")" output:@")" type:KBKeyTypeCharacter], - [KBKey keyWithIdentifier:@"sym_dollar" title:@"$" output:@"$" type:KBKeyTypeCharacter], + [KBKey keyWithIdentifier:@"sym_money" title:@"¥" output:@"¥" type:KBKeyTypeCharacter], [KBKey keyWithIdentifier:@"sym_amp" title:@"&" output:@"&" type:KBKeyTypeCharacter], [KBKey keyWithIdentifier:@"sym_at" title:@"@" output:@"@" type:KBKeyTypeCharacter], [KBKey keyWithIdentifier:@"sym_quote_double" title:@"\"" output:@"\"" type:KBKeyTypeCharacter] ]; diff --git a/Shared/KBSkinInstallBridge.m b/Shared/KBSkinInstallBridge.m index c72a55a..e9b8de6 100644 --- a/Shared/KBSkinInstallBridge.m +++ b/Shared/KBSkinInstallBridge.m @@ -203,8 +203,10 @@ static NSString * const kKBSkinPendingIconShortKey = @"iconShortNames"; #if __has_include("KBNetworkManager.h") // 远程下载(http/https) + NSLog(@"[SkinBridge] will GET zip: %@", zipURL); [KBHUD show]; [[KBNetworkManager shared] GET:zipURL parameters:nil headers:nil completion:^(id jsonOrData, NSURLResponse *response, NSError *error) { + NSLog(@"[SkinBridge] GET finished, error = %@", error); [KBHUD dismiss]; NSData *data = ([jsonOrData isKindOfClass:NSData.class] ? (NSData *)jsonOrData : nil); if (error || data.length == 0) { diff --git a/keyBoard.xcodeproj/project.pbxproj b/keyBoard.xcodeproj/project.pbxproj index e039137..d9a5dce 100644 --- a/keyBoard.xcodeproj/project.pbxproj +++ b/keyBoard.xcodeproj/project.pbxproj @@ -36,7 +36,6 @@ 0459D1B42EBA284C00F2D189 /* KBSkinCenterVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B32EBA284C00F2D189 /* KBSkinCenterVC.m */; }; 0459D1B72EBA287900F2D189 /* KBSkinManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B62EBA287900F2D189 /* KBSkinManager.m */; }; 0459D1B82EBA287900F2D189 /* KBSkinManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B62EBA287900F2D189 /* KBSkinManager.m */; }; - 046131112ECF3A6E00A6FADF /* fense.zip in Resources */ = {isa = PBXBuildFile; fileRef = 046131102ECF3A6E00A6FADF /* fense.zip */; }; 046131142ECF454500A6FADF /* KBKeyPreviewView.m in Sources */ = {isa = PBXBuildFile; fileRef = 046131132ECF454500A6FADF /* KBKeyPreviewView.m */; }; 0477BDF02EBB76E30055D639 /* HomeSheetVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0477BDEF2EBB76E30055D639 /* HomeSheetVC.m */; }; 0477BDF32EBB7B850055D639 /* KBDirectionIndicatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0477BDF22EBB7B850055D639 /* KBDirectionIndicatorView.m */; }; @@ -53,6 +52,7 @@ 04791F982ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; }; 04791F992ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; }; 04791FF72ED5B985004E8522 /* Christmas.zip in Resources */ = {isa = PBXBuildFile; fileRef = 04791FF62ED5B985004E8522 /* Christmas.zip */; }; + 04791FFB2ED5EAB8004E8522 /* fense.zip in Resources */ = {isa = PBXBuildFile; fileRef = 04791FFA2ED5EAB8004E8522 /* fense.zip */; }; 047C650D2EBC8A840035E841 /* KBPanModalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650C2EBC8A840035E841 /* KBPanModalView.m */; }; 047C65102EBCA8DD0035E841 /* HomeRankContentVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650F2EBCA8DD0035E841 /* HomeRankContentVC.m */; }; 047C65502EBCBA9E0035E841 /* KBShopVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C654F2EBCBA9E0035E841 /* KBShopVC.m */; }; @@ -236,7 +236,6 @@ 0459D1B32EBA284C00F2D189 /* KBSkinCenterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSkinCenterVC.m; sourceTree = ""; }; 0459D1B52EBA287900F2D189 /* KBSkinManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSkinManager.h; sourceTree = ""; }; 0459D1B62EBA287900F2D189 /* KBSkinManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSkinManager.m; sourceTree = ""; }; - 046131102ECF3A6E00A6FADF /* fense.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = fense.zip; sourceTree = ""; }; 046131122ECF454500A6FADF /* KBKeyPreviewView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyPreviewView.h; sourceTree = ""; }; 046131132ECF454500A6FADF /* KBKeyPreviewView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyPreviewView.m; sourceTree = ""; }; 0477BDEE2EBB76E30055D639 /* HomeSheetVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeSheetVC.h; sourceTree = ""; }; @@ -264,6 +263,7 @@ 04791F962ED49CE7004E8522 /* KBFont.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFont.h; sourceTree = ""; }; 04791F972ED49CE7004E8522 /* KBFont.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFont.m; sourceTree = ""; }; 04791FF62ED5B985004E8522 /* Christmas.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Christmas.zip; sourceTree = ""; }; + 04791FFA2ED5EAB8004E8522 /* fense.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = fense.zip; sourceTree = ""; }; 047C650B2EBC8A840035E841 /* KBPanModalView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBPanModalView.h; sourceTree = ""; }; 047C650C2EBC8A840035E841 /* KBPanModalView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBPanModalView.m; sourceTree = ""; }; 047C650E2EBCA8DD0035E841 /* HomeRankContentVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeRankContentVC.h; sourceTree = ""; }; @@ -500,7 +500,7 @@ children = ( 041007D12ECE012000D203BB /* KBSkinIconMap.strings */, 041007D32ECE012500D203BB /* 002.zip */, - 046131102ECF3A6E00A6FADF /* fense.zip */, + 04791FFA2ED5EAB8004E8522 /* fense.zip */, 04791FF62ED5B985004E8522 /* Christmas.zip */, ); path = Resource; @@ -1450,9 +1450,9 @@ buildActionMask = 2147483647; files = ( 04A9FE202EB893F10020DB6D /* Localizable.strings in Resources */, - 046131112ECF3A6E00A6FADF /* fense.zip in Resources */, 041007D42ECE012500D203BB /* 002.zip in Resources */, 041007D22ECE012000D203BB /* KBSkinIconMap.strings in Resources */, + 04791FFB2ED5EAB8004E8522 /* fense.zip in Resources */, 04791FF72ED5B985004E8522 /* Christmas.zip in Resources */, 04286A0B2ECD88B400CE730C /* KeyboardAssets.xcassets in Resources */, ); diff --git a/keyBoard.xcodeproj/xcshareddata/xcschemes/keyBoard.xcscheme b/keyBoard.xcodeproj/xcshareddata/xcschemes/keyBoard.xcscheme index c1f01a8..a49a625 100644 --- a/keyBoard.xcodeproj/xcshareddata/xcschemes/keyBoard.xcscheme +++ b/keyBoard.xcodeproj/xcshareddata/xcschemes/keyBoard.xcscheme @@ -65,7 +65,7 @@ + isEnabled = "NO"> diff --git a/keyBoard/Class/Home/VC/FunctionTest/KBSkinCenterVC.m b/keyBoard/Class/Home/VC/FunctionTest/KBSkinCenterVC.m index 47eca11..7fa1fcf 100644 --- a/keyBoard/Class/Home/VC/FunctionTest/KBSkinCenterVC.m +++ b/keyBoard/Class/Home/VC/FunctionTest/KBSkinCenterVC.m @@ -49,10 +49,10 @@ self.view.backgroundColor = [UIColor whiteColor]; self.skins = @[ @{ - @"id": @"local002", - @"name": KBLocalized(@"本地002皮肤"), + @"id": @"local本地", + @"name": KBLocalized(@"粉色皮肤"), // 关键:zip_url 写成 bundle:// 前缀 + 文件名 - @"zip_url": @"bundle://002.zip", + @"zip_url": @"bundle://fense.zip", // 颜色你可以先随便写一套,或者继承默认 @"background": @"#F5FFE8", @@ -66,7 +66,7 @@ @"id": @"remote002", @"name": KBLocalized(@"远程皮肤"), // 关键:zip_url 写成 bundle:// 前缀 + 文件名 - @"zip_url": @"https://raw.githubusercontent.com/CoderST/XDCouponAlertView/master/Christmas.zip", + @"zip_url": @"http://gx.zhukeping.com/download/Christmas.zip", // // 颜色你可以先随便写一套,或者继承默认 // @"background": @"#F5FFE8", @@ -75,21 +75,7 @@ // @"key_highlight": @"#D9F4C4", // @"accent": @"#A4D68A" // 不写 key_icons,代码会自动用本地那份映射表 - }, - @{ - @"id": @"圣诞001", - @"name": KBLocalized(@"本地圣诞皮肤"), - // 关键:zip_url 写成 bundle:// 前缀 + 文件名 - @"zip_url": @"bundle://Christmas.zip", - - // 颜色你可以先随便写一套,或者继承默认 - @"background": @"#F5FFE8", - @"key_bg": @"#FFFFFF", - @"key_text": @"#4A4A4A", - @"key_highlight": @"#D9F4C4", - @"accent": @"#A4D68A" - // 不写 key_icons,代码会自动用本地那份映射表 - }, + } ]; self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, KB_NAV_TOTAL_HEIGHT, KB_SCREEN_WIDTH, KB_SCREEN_HEIGHT - KB_NAV_TOTAL_HEIGHT) style:UITableViewStyleInsetGrouped]; @@ -120,6 +106,13 @@ inset.bottom += 44 + 24; // 按钮高度 + 上下间距 self.tableView.contentInset = inset; self.tableView.scrollIndicatorInsets = inset; + + [[KBNetworkManager shared] GET:@"https://www.apple.com" + parameters:nil + headers:nil + completion:^(id jsonOrData, NSURLResponse *response, NSError *error) { + NSLog(@"[Test] apple.com finished, error = %@", error); + }]; } #pragma mark - UITableView @@ -145,10 +138,14 @@ NSDictionary *skin = self.skins[idx]; if (!skin) return; if (idx == 0) { - [[KBSkinService shared] applySkinWithJSON:skin - fromViewController:self - mode:KBSkinSourceModeLocalBundleZip - completion:nil]; +// NSString *title = (indexPath.item < self.dataSource.count) ? self.dataSource[indexPath.item] : KBLocalized(@"专属皮肤002"); + // 将需求固定到 002.zip,本地写死皮肤 id,便于键盘扩展识别并解压。 + static NSString * const kKBBundleSkinId002 = @"bundle_skin_fense"; + [KBSkinInstallBridge publishBundleSkinRequestWithId:kKBBundleSkinId002 + name:@"" ?: kKBBundleSkinId002 + zipName:@"fense.zip" + iconShortNames:nil]; + [KBHUD showInfo:KBLocalized(@"已通知键盘解压,切换到自定义键盘即可生效")]; }else if (idx == 1){ [[KBSkinService shared] applySkinWithJSON:skin fromViewController:self diff --git a/keyBoard/Class/Network/KBNetworkManager.m b/keyBoard/Class/Network/KBNetworkManager.m index e814bcb..d15f189 100644 --- a/keyBoard/Class/Network/KBNetworkManager.m +++ b/keyBoard/Class/Network/KBNetworkManager.m @@ -50,6 +50,7 @@ NSErrorDomain const KBNetworkErrorDomain = @"com.company.keyboard.network"; parameters:(NSDictionary *)parameters headers:(NSDictionary *)headers completion:(KBNetworkCompletion)completion { + NSLog(@"[KBNetworkManager] GET called, enabled=%d, path=%@", self.isEnabled, path); if (![self ensureEnabled:completion]) return nil; NSString *urlString = [self buildURLStringWithPath:path]; if (!urlString) { [self fail:KBNetworkErrorInvalidURL completion:completion]; return nil; } @@ -144,9 +145,11 @@ NSErrorDomain const KBNetworkErrorDomain = @"com.company.keyboard.network"; } - (NSURLSessionDataTask *)startAFTaskWithRequest:(NSURLRequest *)req completion:(KBNetworkCompletion)completion { + NSLog(@"[KBNetworkManager] startAFTaskWithRequest: %@", req.URL.absoluteString); // 响应先用原始数据返回,再按 Content-Type 解析 JSON(与原实现一致) self.manager.responseSerializer = [AFHTTPResponseSerializer serializer]; NSURLSessionDataTask *task = [self.manager dataTaskWithRequest:req uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { + NSLog(@"[KBNetworkManager] task finished, error = %@", error); // AFN 默认对非 2xx 的状态码返回 error;这里先日志,再直接回调上层 if (error) { #if DEBUG diff --git a/keyBoard/Class/Resource/KBSkinIconMap.strings b/keyBoard/Class/Resource/KBSkinIconMap.strings index b750723..8ea5b6e 100644 --- a/keyBoard/Class/Resource/KBSkinIconMap.strings +++ b/keyBoard/Class/Resource/KBSkinIconMap.strings @@ -214,6 +214,8 @@ "sym_lt" = "key_lt"; /* '>' */ "sym_gt" = "key_gt"; +/* '¥' */ +"sym_money" = "key_money"; /* '€' */ "sym_euro" = "key_euro"; /* '£' */