This commit is contained in:
2025-12-11 19:43:55 +08:00
parent cccced6afa
commit 577b749198
12 changed files with 244 additions and 80 deletions

View File

@@ -24,6 +24,15 @@ typedef NS_ENUM(NSUInteger, KBSkinBridgeErrorCode) {
typedef void (^KBSkinInstallConsumeCompletion)(BOOL success, NSError * _Nullable error);
/// 已安装的皮肤记录,用于“我的皮肤”列表展示。
@interface KBSkinDownloadRecord : NSObject
@property (nonatomic, copy) NSString *skinId;
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy, nullable) NSString *previewImage;
@property (nonatomic, copy, nullable) NSString *zipURL;
@property (nonatomic, assign) NSTimeInterval installedAt;
@end
@interface KBSkinInstallBridge : NSObject
/// 默认图标短文件名映射(从 KBSkinIconMap.strings 读取)。
@@ -56,6 +65,19 @@ typedef void (^KBSkinInstallConsumeCompletion)(BOOL success, NSError * _Nullable
+ (void)consumePendingRequestFromBundle:(NSBundle *)bundle
completion:(nullable KBSkinInstallConsumeCompletion)completion;
/// 枚举当前 App Group 中所有已解压的皮肤信息。
+ (NSArray<KBSkinDownloadRecord *> *)installedSkinRecords;
/// 删除指定皮肤的本地资源目录(用于“我的皮肤 - 删除”)。
+ (BOOL)removeInstalledSkinWithId:(NSString *)skinId
error:(NSError * _Nullable __autoreleasing *)error;
/// 记录皮肤元数据(下载完成后调用,方便“我的皮肤”读取)。
+ (void)recordInstalledSkinWithId:(NSString *)skinId
name:(NSString *)name
preview:(nullable NSString *)preview
zipURL:(nullable NSString *)zipURL;
@end
NS_ASSUME_NONNULL_END