浏览代码

桌面卡片

chendeben 1 年之前
父节点
当前提交
43a661e4bd
共有 100 个文件被更改,包括 2086 次插入 和 2435 次删除
  1. 314 0
      .kiro/specs/desktop-player-widget/design.md
  2. 79 0
      .kiro/specs/desktop-player-widget/requirements.md
  3. 130 0
      .kiro/specs/desktop-player-widget/tasks.md
  4. 21 0
      .kiro/steering/product.md
  5. 77 0
      .kiro/steering/structure.md
  6. 46 0
      .kiro/steering/tech.md
  7. 1 2
      entry/oh-package-lock.json5
  8. 0 6
      entry/oh_modules/@tencent/wechat_open_sdk/.idea/vcs.xml
  9. 0 38
      entry/oh_modules/@tencent/wechat_open_sdk/.idea/workspace.xml
  10. 0 17
      entry/oh_modules/@tencent/wechat_open_sdk/BuildProfile.ets
  11. 0 3
      entry/oh_modules/@tencent/wechat_open_sdk/CHANGELOG.md
  12. 0 11
      entry/oh_modules/@tencent/wechat_open_sdk/Index.ets
  13. 0 373
      entry/oh_modules/@tencent/wechat_open_sdk/LICENSE
  14. 0 5
      entry/oh_modules/@tencent/wechat_open_sdk/README.md
  15. 0 28
      entry/oh_modules/@tencent/wechat_open_sdk/build-profile.json5
  16. 0 0
      entry/oh_modules/@tencent/wechat_open_sdk/consumer-rules.txt
  17. 0 6
      entry/oh_modules/@tencent/wechat_open_sdk/hvigorfile.ts
  18. 0 18
      entry/oh_modules/@tencent/wechat_open_sdk/obfuscation-rules.txt
  19. 0 1
      entry/oh_modules/@tencent/wechat_open_sdk/oh-package.json5
  20. 0 195
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/diff_dev_oauth/DiffDevOAuth.ets
  21. 0 48
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/log/Log.ets
  22. 0 63
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/Base.ets
  23. 0 13
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/Constants.ets
  24. 0 135
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/Pay.ets
  25. 0 74
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/SendAuth.ets
  26. 0 27
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/SendTdiAuth.ets
  27. 0 137
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/message/SendMessageToWX.ets
  28. 0 34
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/message/WXImageObject.ets
  29. 0 16
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/message/WXMediaObjectFactory.ets
  30. 0 21
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/message/WXTextObject.ets
  31. 0 226
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/open_api/WXAPIFactory.ets
  32. 0 34
      entry/oh_modules/@tencent/wechat_open_sdk/src/main/module.json
  33. 0 1
      entry/oh_modules/libentry.so/Index.d.ts
  34. 0 6
      entry/oh_modules/libentry.so/oh-package.json5
  35. 259 0
      entry/src/main/ets/common/widget/PlayerControlService.ets
  36. 229 0
      entry/src/main/ets/common/widget/WidgetDataManager.ets
  37. 178 0
      entry/src/main/ets/common/widget/WidgetTypes.ets
  38. 179 0
      entry/src/main/ets/entryformability/PlayerWidgetFormExtensionAbility.ets
  39. 209 0
      entry/src/main/ets/widget/pages/PlayerWidgetLarge.ets
  40. 176 0
      entry/src/main/ets/widget/pages/PlayerWidgetMedium.ets
  41. 103 0
      entry/src/main/ets/widget/pages/PlayerWidgetSmall.ets
  42. 15 0
      entry/src/main/module.json5
  43. 8 0
      entry/src/main/resources/base/element/string.json
  44. 61 0
      entry/src/main/resources/base/profile/form_config.json
  45. 0 48
      ijkplayer/oh_modules/@types/libijkplayer_audio_napi.so/index.d.ts
  46. 0 6
      ijkplayer/oh_modules/@types/libijkplayer_audio_napi.so/oh-package.json5
  47. 1 2
      oh-package-lock.json5
  48. 0 14
      oh_modules/.ohpm/@alipay+blueshieldsdk@cow+0gass5tzqhymzjby2f6sd+g2xtoatqsiyvi9qsy=/oh_modules/libblueshield.so/index.d.ts
  49. 0 6
      oh_modules/.ohpm/@alipay+blueshieldsdk@cow+0gass5tzqhymzjby2f6sd+g2xtoatqsiyvi9qsy=/oh_modules/libblueshield.so/oh-package.json5
  50. 0 24
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/BuildProfile.d.ets
  51. 0 22
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/Index.d.ets
  52. 0 75
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/ResourceTable.txt
  53. 二进制
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/ets/modules.abc
  54. 0 13
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/include/BlueShield/BlueShieldExports.h
  55. 0 70
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/include/BlueShield/BlueShieldManager.h
  56. 0 152
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/include/BlueShield/TrustedTerminalInterface.h
  57. 二进制
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/libs/arm64-v8a/libblueshield.so
  58. 0 0
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/obfuscation.txt
  59. 0 1
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/oh-package.json5
  60. 0 14
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/cpp/types/libblueshield/index.d.ts
  61. 0 6
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/cpp/types/libblueshield/oh-package.json5
  62. 0 27
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/BlueShieldManager.d.ets
  63. 0 13
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/apdid/APDIDModule.d.ets
  64. 0 78
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/apdid/IAPDIDModule.d.ets
  65. 0 7
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/apdid/network/APDIDNetworkUtil.d.ets
  66. 0 10
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/CollectArgs.d.ets
  67. 0 15
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/CollectBase.d.ets
  68. 0 6
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/Index.d.ets
  69. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/application/HA1_AppName.d.ets
  70. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/application/HA2_AppVersion.d.ets
  71. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/application/HA3_SdkName.d.ets
  72. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/application/HA4_SdkVersion.d.ets
  73. 0 5
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/application/Index.d.ets
  74. 0 10
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/customize/HC1_Tid.d.ets
  75. 0 10
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/customize/HC2_Utdid.d.ets
  76. 0 13
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/customize/HC4_RandomStr.d.ets
  77. 0 10
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/customize/HC5_UserId.d.ets
  78. 0 6
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/customize/Index.d.ets
  79. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD10_Udid.d.ets
  80. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD12_CpuCount.d.ets
  81. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD13_CpuFrequency.d.ets
  82. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD14_Memory.d.ets
  83. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD15_DataPathSize.d.ets
  84. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD16_StoragePathSize.d.ets
  85. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD17_LocalDeviceId.d.ets
  86. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD19_NetworkType.d.ets
  87. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD301_SG.d.ets
  88. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD302_DeviceAuth.d.ets
  89. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD303_SysIntegrity.d.ets
  90. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD304_SecureLocation.d.ets
  91. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD305_MicScreenStatus.d.ets
  92. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD37_Timezone.d.ets
  93. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD38_Language.d.ets
  94. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD3_SensorListDigest.d.ets
  95. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD4_Oaid.d.ets
  96. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD5_Aaid.d.ets
  97. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD6_ScreenWidth.d.ets
  98. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD7_ScreenHeight.d.ets
  99. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD8_MacAddress.d.ets
  100. 0 9
      oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD9_SimIccid.d.ets

+ 314 - 0
.kiro/specs/desktop-player-widget/design.md

@@ -0,0 +1,314 @@
+# 桌面播放器卡片设计文档
+
+## 概述
+
+桌面播放器卡片是一个基于HarmonyOS Form Kit的系统级小组件,为TTMusic应用提供桌面快速控制功能。该卡片将利用现有的AvSessionController和ijkplayer播放器架构,通过FormExtensionAbility实现与主应用的数据同步和控制交互。当前应用使用ijkplayer作为播放内核,通过AvSessionController管理媒体会话,卡片将通过这个架构实现播放控制。
+
+## 架构设计
+
+### 整体架构
+
+```mermaid
+graph TB
+    A[桌面卡片UI] --> B[FormExtensionAbility]
+    B --> C[FormProvider]
+    C --> D[CommonEvent通信]
+    D --> E[LocalMusic组件]
+    E --> F[ijkplayer播放内核]
+    E --> G[AvSessionController]
+    
+    H[数据存储] --> C
+    I[卡片配置] --> C
+    
+    J[系统通知栏] --> G
+    K[媒体控制中心] --> G
+    L[投播控制] --> G
+```
+
+### 核心组件
+
+1. **FormExtensionAbility**: 卡片生命周期管理
+2. **FormProvider**: 卡片数据提供者和业务逻辑处理
+3. **WidgetDataManager**: 卡片数据管理和持久化
+4. **PlayerControlService**: 播放控制服务接口
+5. **FormLayoutManager**: 多尺寸布局管理器
+
+## 组件设计
+
+### 1. FormExtensionAbility
+
+负责卡片的生命周期管理和系统交互。
+
+**主要职责:**
+- 处理卡片创建、更新、销毁事件
+- 管理卡片实例和配置
+- 处理用户交互事件路由
+- 与主应用建立通信连接
+
+**关键接口:**
+```typescript
+interface FormExtensionAbility {
+  onAddForm(want: Want): formBindingData.FormBindingData
+  onUpdateForm(formId: string): void
+  onRemoveForm(formId: string): void
+  onFormEvent(formId: string, message: string): void
+}
+```
+
+### 2. FormProvider
+
+卡片的核心业务逻辑处理器。
+
+**主要职责:**
+- 管理播放状态数据
+- 处理播放控制命令
+- 同步主应用状态
+- 格式化卡片显示数据
+
+**数据模型:**
+```typescript
+interface WidgetPlayState {
+  isPlaying: boolean
+  currentSong: SongInfo
+  progress: PlayProgress
+  playMode: PlayMode
+  hasPlaylist: boolean
+}
+
+interface SongInfo {
+  title: string
+  artist: string
+  album: string
+  coverUrl: string
+  duration: number
+}
+
+interface PlayProgress {
+  currentTime: number
+  totalTime: number
+  percentage: number
+}
+```
+
+### 3. PlayerControlService
+
+与主应用播放器的通信接口。
+
+**主要功能:**
+- 发送播放控制命令
+- 接收播放状态更新
+- 处理歌曲切换事件
+- 管理播放列表状态
+
+**通信机制:**
+- 使用CommonEvent进行应用间通信(发送控制命令到LocalMusic组件)
+- 监听AvSessionController的媒体会话状态变化
+- 通过Preferences持久化卡片状态和播放信息
+- 利用现有的emitter事件机制(eventId: 2, 101, 333, 888等)
+
+### 4. FormLayoutManager
+
+多尺寸卡片布局管理。
+
+**支持的卡片尺寸:**
+- **小卡片 (2x1)**: 基本播放控制 + 歌曲名
+- **中卡片 (4x2)**: 完整信息 + 播放控制 + 进度条
+- **大卡片 (4x3)**: 专辑封面 + 完整信息 + 扩展控制
+
+## 数据模型
+
+### 卡片状态数据
+
+```typescript
+interface WidgetData {
+  // 播放状态
+  playState: {
+    isPlaying: boolean
+    isPaused: boolean
+    isLoading: boolean
+  }
+  
+  // 当前歌曲信息
+  currentSong: {
+    id: string
+    title: string
+    artist: string
+    album: string
+    coverImagePath: string
+    duration: number
+  }
+  
+  // 播放进度
+  progress: {
+    currentPosition: number
+    duration: number
+    percentage: number
+    currentTimeText: string
+    totalTimeText: string
+  }
+  
+  // 播放列表状态
+  playlist: {
+    hasNext: boolean
+    hasPrevious: boolean
+    currentIndex: number
+    totalCount: number
+  }
+  
+  // 卡片配置
+  config: {
+    size: WidgetSize
+    theme: WidgetTheme
+    showProgress: boolean
+    showCover: boolean
+  }
+}
+```
+
+### 控制命令
+
+```typescript
+enum WidgetCommand {
+  PLAY_PAUSE = 'play_pause',
+  NEXT_SONG = 'next_song',
+  PREV_SONG = 'prev_song',
+  SEEK_TO = 'seek_to',
+  OPEN_APP = 'open_app',
+  OPEN_PLAYER = 'open_player'
+}
+
+interface WidgetControlMessage {
+  command: WidgetCommand
+  params?: {
+    position?: number
+    songId?: string
+  }
+}
+```
+
+## 接口设计
+
+### 与主应用通信接口
+
+```typescript
+interface AppCommunicationService {
+  // 发送控制命令到主应用
+  sendControlCommand(command: WidgetCommand, params?: any): Promise<boolean>
+  
+  // 获取当前播放状态
+  getCurrentPlayState(): Promise<WidgetData>
+  
+  // 注册状态变化监听
+  registerStateListener(callback: (data: WidgetData) => void): void
+  
+  // 启动主应用
+  launchMainApp(page?: string): Promise<boolean>
+}
+```
+
+### 卡片数据管理接口
+
+```typescript
+interface WidgetDataManager {
+  // 保存卡片数据
+  saveWidgetData(formId: string, data: WidgetData): Promise<void>
+  
+  // 获取卡片数据
+  getWidgetData(formId: string): Promise<WidgetData>
+  
+  // 更新卡片显示
+  updateWidget(formId: string, data: WidgetData): Promise<void>
+  
+  // 批量更新所有卡片
+  updateAllWidgets(data: WidgetData): Promise<void>
+}
+```
+
+## 错误处理
+
+### 错误类型定义
+
+```typescript
+enum WidgetErrorType {
+  COMMUNICATION_ERROR = 'communication_error',
+  DATA_SYNC_ERROR = 'data_sync_error',
+  CONTROL_COMMAND_ERROR = 'control_command_error',
+  LAYOUT_ERROR = 'layout_error'
+}
+
+interface WidgetError {
+  type: WidgetErrorType
+  message: string
+  code: number
+  timestamp: number
+}
+```
+
+### 错误处理策略
+
+1. **通信错误**: 显示离线状态,提供重连机制
+2. **数据同步错误**: 使用缓存数据,后台重试同步
+3. **控制命令错误**: 显示操作失败提示,记录错误日志
+4. **布局错误**: 降级到基础布局,确保基本功能可用
+
+## 测试策略
+
+### 单元测试
+
+- FormProvider业务逻辑测试
+- 数据模型转换测试
+- 通信接口模拟测试
+- 错误处理逻辑测试
+
+### 集成测试
+
+- 卡片与主应用通信测试
+- 多卡片实例同步测试
+- 系统媒体会话集成测试
+- 不同尺寸布局适配测试
+
+### 用户体验测试
+
+- 卡片响应速度测试
+- 状态同步准确性测试
+- 多场景交互测试
+- 异常情况恢复测试
+
+## 性能优化
+
+### 数据更新优化
+
+- 使用增量更新减少数据传输
+- 实现智能缓存机制
+- 优化图片加载和缓存
+- 控制更新频率避免过度刷新
+
+### 内存管理
+
+- 及时释放不用的资源
+- 优化图片内存占用
+- 控制卡片实例数量
+- 实现内存泄漏监控
+
+### 电量优化
+
+- 减少不必要的后台活动
+- 优化定时器使用
+- 智能调整更新频率
+- 配合系统省电模式
+
+## 安全考虑
+
+### 数据安全
+
+- 敏感信息加密存储
+- 验证通信数据完整性
+- 防止恶意命令注入
+- 限制卡片权限范围
+
+### 隐私保护
+
+- 最小化数据收集
+- 用户授权机制
+- 数据本地化处理
+- 遵循隐私保护规范

+ 79 - 0
.kiro/specs/desktop-player-widget/requirements.md

@@ -0,0 +1,79 @@
+# 桌面播放器卡片需求文档
+
+## 介绍
+
+桌面播放器卡片是一个系统级的小组件,允许用户在不打开主应用的情况下直接在桌面上控制音乐播放。该卡片将提供基本的播放控制功能和当前播放信息的显示,为用户提供便捷的音乐控制体验。
+
+## 需求
+
+### 需求 1:基本播放控制
+
+**用户故事:** 作为音乐爱好者,我希望能在桌面卡片上直接控制音乐播放,这样我就不需要每次都打开应用来操作播放器。
+
+#### 验收标准
+
+1. 当用户点击播放/暂停按钮时,系统应该切换当前音乐的播放状态
+2. 当用户点击上一首按钮时,系统应该切换到播放列表中的上一首歌曲
+3. 当用户点击下一首按钮时,系统应该切换到播放列表中的下一首歌曲
+4. 当没有音乐正在播放时,播放控制按钮应该显示为禁用状态
+5. 当播放列表为空时,上一首和下一首按钮应该显示为禁用状态
+
+### 需求 2:音乐信息显示
+
+**用户故事:** 作为用户,我希望在桌面卡片上看到当前播放音乐的详细信息,这样我就能快速了解正在播放的内容。
+
+#### 验收标准
+
+1. 当有音乐正在播放时,卡片应该显示歌曲名称
+2. 当有音乐正在播放时,卡片应该显示艺术家名称
+3. 当有音乐正在播放时,卡片应该显示专辑封面(如果可用)
+4. 当没有音乐播放时,卡片应该显示默认的占位信息
+5. 当音乐信息过长时,文本应该支持滚动或省略显示
+
+### 需求 3:播放进度显示
+
+**用户故事:** 作为用户,我希望在桌面卡片上看到当前音乐的播放进度,这样我就能了解歌曲播放的进度情况。
+
+#### 验收标准
+
+1. 当音乐正在播放时,卡片应该显示播放进度条
+2. 进度条应该实时更新以反映当前播放位置
+3. 卡片应该显示当前播放时间和总时长
+4. 当用户点击进度条时,系统应该跳转到对应的播放位置
+5. 当没有音乐播放时,进度条应该显示为空状态
+
+### 需求 4:卡片状态同步
+
+**用户故事:** 作为用户,我希望桌面卡片能与主应用保持同步,这样无论我在哪里控制播放器,状态都能保持一致。
+
+#### 验收标准
+
+1. 当主应用中的播放状态改变时,桌面卡片应该立即更新
+2. 当主应用切换歌曲时,桌面卡片应该显示新的歌曲信息
+3. 当主应用调整播放进度时,桌面卡片的进度条应该同步更新
+4. 当主应用关闭时,桌面卡片应该保持最后的状态信息
+5. 当系统重启后,桌面卡片应该能恢复到关闭前的状态
+
+### 需求 5:卡片尺寸适配
+
+**用户故事:** 作为用户,我希望能选择不同尺寸的桌面卡片,这样我就能根据桌面空间和个人喜好来调整卡片大小。
+
+#### 验收标准
+
+1. 系统应该支持小尺寸卡片(2x1),显示基本播放控制和歌曲名称
+2. 系统应该支持中等尺寸卡片(4x2),显示完整的播放信息和控制按钮
+3. 系统应该支持大尺寸卡片(4x3),显示专辑封面、完整信息和扩展控制
+4. 当用户调整卡片尺寸时,界面布局应该自动适配
+5. 不同尺寸的卡片都应该保持良好的视觉效果和可用性
+
+### 需求 6:快速启动功能
+
+**用户故事:** 作为用户,我希望能通过点击桌面卡片快速打开主应用,这样我就能进行更详细的音乐管理操作。
+
+#### 验收标准
+
+1. 当用户点击卡片的非控制区域时,系统应该打开主应用
+2. 当用户点击歌曲信息区域时,系统应该打开主应用并跳转到当前播放页面
+3. 当用户长按卡片时,系统应该显示卡片配置选项
+4. 当主应用未运行时,点击卡片应该启动应用并恢复播放状态
+5. 卡片启动应用的响应时间应该在1秒以内

+ 130 - 0
.kiro/specs/desktop-player-widget/tasks.md

@@ -0,0 +1,130 @@
+# 桌面播放器卡片实现计划
+
+- [x] 1. 创建卡片基础架构
+  - 创建FormExtensionAbility类,处理卡片生命周期管理
+  - 配置module.json5添加卡片能力声明
+  - 创建卡片资源配置文件和布局模板
+  - _需求: 1.1, 6.1_
+
+- [ ] 2. 实现卡片数据管理
+- [ ] 2.1 创建卡片数据模型和管理器
+  - 定义WidgetData接口和相关数据结构
+  - 实现WidgetDataManager类处理数据持久化
+  - 创建卡片状态缓存机制
+  - _需求: 2.1, 2.2, 4.1_
+
+- [ ] 2.2 实现播放状态同步机制
+  - 创建与LocalMusic组件的通信接口
+  - 监听AvSessionController状态变化
+  - 实现播放信息的实时同步更新
+  - _需求: 4.1, 4.2, 4.3_
+
+- [ ] 3. 开发播放控制功能
+- [ ] 3.1 实现基本播放控制命令
+  - 创建播放/暂停控制逻辑
+  - 实现上一首/下一首切换功能
+  - 添加播放状态验证和错误处理
+  - _需求: 1.1, 1.2, 1.3_
+
+- [ ] 3.2 实现进度控制功能
+  - 添加播放进度显示和更新逻辑
+  - 实现进度条点击跳转功能
+  - 创建时间格式化和显示组件
+  - _需求: 3.1, 3.2, 3.4_
+
+- [ ] 4. 创建卡片UI布局
+- [ ] 4.1 实现小尺寸卡片布局(2x1)
+  - 设计基本播放控制按钮布局
+  - 添加歌曲名称显示组件
+  - 实现按钮状态管理和样式
+  - _需求: 5.1, 1.4, 1.5_
+
+- [ ] 4.2 实现中等尺寸卡片布局(4x2)
+  - 创建完整信息显示区域
+  - 添加播放进度条组件
+  - 实现艺术家和专辑信息显示
+  - _需求: 5.2, 2.1, 2.2, 3.1_
+
+- [ ] 4.3 实现大尺寸卡片布局(4x3)
+  - 添加专辑封面显示功能
+  - 创建扩展控制按钮区域
+  - 实现完整播放信息展示
+  - _需求: 5.3, 2.3, 2.4_
+
+- [ ] 5. 集成应用通信机制
+- [ ] 5.1 实现CommonEvent通信
+  - 创建卡片控制命令发送机制
+  - 监听LocalMusic组件的状态广播
+  - 实现双向通信和错误重试
+  - _需求: 4.1, 4.2, 6.1_
+
+- [ ] 5.2 集成AvSessionController监听
+  - 注册媒体会话状态变化监听
+  - 同步播放状态和歌曲信息
+  - 处理投播和外部控制事件
+  - _需求: 4.3, 4.4, 4.5_
+
+- [ ] 6. 实现卡片配置和适配
+- [ ] 6.1 创建多尺寸适配逻辑
+  - 实现FormLayoutManager布局管理器
+  - 添加尺寸变化时的UI重构
+  - 创建响应式布局组件
+  - _需求: 5.4, 5.5_
+
+- [ ] 6.2 实现卡片配置管理
+  - 添加卡片个性化设置选项
+  - 实现主题色彩同步功能
+  - 创建用户偏好设置存储
+  - _需求: 5.4, 6.3_
+
+- [ ] 7. 添加快速启动功能
+- [ ] 7.1 实现应用启动逻辑
+  - 创建点击卡片打开主应用功能
+  - 实现深度链接到播放页面
+  - 添加应用状态检测和恢复
+  - _需求: 6.1, 6.2, 6.4_
+
+- [ ] 7.2 实现长按配置功能
+  - 添加卡片长按菜单
+  - 创建卡片设置和删除选项
+  - 实现卡片配置界面跳转
+  - _需求: 6.3, 6.5_
+
+- [ ] 8. 完善错误处理和优化
+- [ ] 8.1 实现错误处理机制
+  - 添加通信失败的降级处理
+  - 创建离线状态显示和恢复
+  - 实现错误日志记录和上报
+  - _需求: 1.4, 4.4_
+
+- [ ] 8.2 性能优化和内存管理
+  - 优化卡片更新频率和策略
+  - 实现图片缓存和内存管理
+  - 添加电量优化和后台限制
+  - _需求: 4.5, 5.5_
+
+- [ ] 9. 编写单元测试
+- [ ] 9.1 测试卡片核心功能
+  - 编写FormExtensionAbility生命周期测试
+  - 测试播放控制命令的正确性
+  - 验证数据同步和状态管理
+  - _需求: 1.1, 1.2, 1.3, 4.1_
+
+- [ ] 9.2 测试UI布局和交互
+  - 测试多尺寸布局的适配性
+  - 验证用户交互的响应性
+  - 测试异常情况的处理
+  - _需求: 5.1, 5.2, 5.3, 6.1_
+
+- [ ] 10. 集成测试和调试
+- [ ] 10.1 端到端功能测试
+  - 测试卡片与主应用的完整交互流程
+  - 验证多卡片实例的同步性
+  - 测试系统级媒体控制集成
+  - _需求: 4.1, 4.2, 4.3, 6.1_
+
+- [ ] 10.2 用户体验优化
+  - 优化卡片响应速度和流畅性
+  - 完善视觉效果和动画
+  - 进行可用性测试和改进
+  - _需求: 6.4, 6.5_

+ 21 - 0
.kiro/steering/product.md

@@ -0,0 +1,21 @@
+# TTMusic - 天天静听音乐播放器
+
+TTMusic is a high-performance music player built for OpenHarmony (HarmonyOS) platform. It supports both local and network audio/video playback with advanced media processing capabilities and VIP service integration.
+
+## Core Features
+- **Audio/Video Playback**: Supports MP3, AAC, FLAC, APE, WAV, H.264, MPEG4, VP8/VP9
+- **Streaming**: HLS, RTMP, HTTP/HTTPS protocols
+- **Advanced Features**: Variable speed playback, high-quality audio, multi-track switching
+- **Media Management**: Smart playlist management, batch operations, artist/album browsing
+- **Lyrics**: Synchronized lyrics display with custom import
+- **VIP Services**: Premium membership system with ad-free experience
+
+## Target Platforms
+- HarmonyOS phones, tablets, and 2-in-1 devices
+- Supports folding screens and multi-form factor devices
+- Minimum API level: 12 (compatible with API 9+)
+
+## Business Model
+- Freemium model with VIP subscription
+- Integrated payment systems (Alipay, WeChat Pay)
+- Advertisement integration for free tier users

+ 77 - 0
.kiro/steering/structure.md

@@ -0,0 +1,77 @@
+# Project Structure
+
+## Root Level Organization
+```
+├── entry/                  # Main application module
+├── ijkplayer/             # Media player native module
+├── lib/                   # Shared library (lyrics component)
+├── AppScope/              # Application-level resources
+├── doc/                   # Documentation and build scripts
+├── oh_modules/            # Dependencies (like node_modules)
+└── build-profile.json5    # Multi-module build configuration
+```
+
+## Entry Module (`entry/`)
+Main application code following HarmonyOS Stage Model:
+
+```
+entry/src/main/
+├── ets/                   # ArkTS source code
+│   ├── pages/            # Page components (routing destinations)
+│   ├── view/             # Reusable UI components
+│   ├── viewmodel/        # Data models and business logic
+│   ├── common/           # Shared utilities and constants
+│   ├── controller/       # System controllers (media session, etc.)
+│   ├── dialog/           # Dialog components
+│   ├── entryability/     # Application abilities
+│   └── workers/          # Background workers
+├── cpp/                  # Native C++ code
+├── resources/            # Resources (strings, images, etc.)
+└── module.json5          # Module configuration
+```
+
+## Key Directories
+
+### Pages (`entry/src/main/ets/pages/`)
+- Route-level components that represent full screens
+- Each page should be self-contained with its own state management
+- Examples: `NewIndex.ets`, `UserCenter.ets`, `SettingPage.ets`
+
+### Views (`entry/src/main/ets/view/`)
+- Reusable UI components
+- Should be stateless or manage only local UI state
+- Examples: `TitleBar.ets`, `LocalMusic.ets`, `StreamContent.ets`
+
+### ViewModels (`entry/src/main/ets/viewmodel/`)
+- Data models and business logic
+- Handle API calls, data transformation, and state management
+- Examples: `MainViewModel.ets`, `VideoItem.ets`, `UserAuthModel.ets`
+
+### Common (`entry/src/main/ets/common/`)
+- Shared utilities, constants, and helper classes
+- Organized by type: `constants/`, `util/`, `model/`
+
+## Native Modules
+
+### ijkplayer Module (`ijkplayer/`)
+- FFmpeg-based media player implementation
+- Contains C++ native code and ArkTS bindings
+- Provides media playback capabilities to the main app
+
+### Lib Module (`lib/`)
+- Shared library for lyrics functionality
+- Can be imported by other modules
+- Contains lyrics parsing and display components
+
+## Configuration Files
+- `build-profile.json5`: Multi-module build configuration
+- `oh-package.json5`: Root package dependencies
+- `module.json5`: Module-specific configuration (abilities, permissions)
+- `hvigorfile.ts`: Build script configuration
+
+## Naming Conventions
+- **Files**: PascalCase for components (`NewIndex.ets`), camelCase for utilities
+- **Directories**: camelCase for most, lowercase for standard dirs (`pages`, `view`)
+- **Components**: PascalCase struct names
+- **Variables**: camelCase
+- **Constants**: UPPER_SNAKE_CASE

+ 46 - 0
.kiro/steering/tech.md

@@ -0,0 +1,46 @@
+# Technology Stack
+
+## Platform & Framework
+- **Platform**: OpenHarmony (HarmonyOS) 5.0.5
+- **Language**: ArkTS (TypeScript-based)
+- **Architecture**: Stage Model
+- **Min SDK**: API 12 (compatible with API 9+)
+- **Target SDK**: API 17
+
+## Build System
+- **Build Tool**: Hvigor (HarmonyOS build system)
+- **Package Manager**: OHPM (OpenHarmony Package Manager)
+- **Native Build**: CMake for C/C++ components
+
+## Core Libraries & Dependencies
+
+### Media Processing
+- **ijkplayer**: FFmpeg-based video/audio player (v2.0.6)
+- **FFmpeg**: Media codec and processing
+- **SoundTouch**: Audio processing and pitch shifting
+- **libyuv**: Video processing library
+
+### UI & Utilities
+- `@pura/harmony-utils`: Common utilities and helpers
+- `@pura/harmony-dialog`: Dialog components
+- `@ohos/lottie`: Animation support
+- `@ohos/pulltorefresh`: Pull-to-refresh component
+- `@chinalike/popup`: Popup components
+- `@keke/color-picker`: Color picker component
+
+### Payment & Services
+- `@cashier_alipay/cashiersdk`: Alipay payment integration
+- `@tencent/wechat_open_sdk`: WeChat integration
+
+### Text Processing
+- `@changwei/chardet`: Character encoding detection
+- `@sgaolei/lrc_parser`: Lyrics parsing
+- `@ohos/pinyin4js`: Chinese pinyin conversion
+
+## Code Style & Conventions
+- Use ArkTS/TypeScript syntax
+- Follow HarmonyOS component lifecycle patterns
+- Use `@Component`, `@Entry`, `@Preview` decorators appropriately
+- Implement proper state management with `@State`, `@Prop`, `@Link`
+- Use structured logging with consistent TAG naming
+- Follow camelCase for variables and PascalCase for components

+ 1 - 2
entry/oh-package-lock.json5

@@ -1,7 +1,6 @@
 {
   "meta": {
-    "stableOrder": true,
-    "enableUnifiedLockfile": false
+    "stableOrder": true
   },
   "lockfileVersion": 3,
   "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",

+ 0 - 6
entry/oh_modules/@tencent/wechat_open_sdk/.idea/vcs.xml

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="VcsDirectoryMappings">
-    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
-  </component>
-</project>

+ 0 - 38
entry/oh_modules/@tencent/wechat_open_sdk/.idea/workspace.xml

@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="ChangeListManager">
-    <list default="true" id="66199fb3-49b9-4e28-a7d7-1d3209894eff" name="Changes" comment="">
-      <change afterPath="$PROJECT_DIR$/../demo/src/main/ets/pages/SendMessage.ets" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/../build-profile.json5" beforeDir="false" afterPath="$PROJECT_DIR$/../build-profile.json5" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/../demo/oh-package-lock.json5" beforeDir="false" afterPath="$PROJECT_DIR$/../demo/oh-package-lock.json5" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/../demo/oh-package.json5" beforeDir="false" afterPath="$PROJECT_DIR$/../demo/oh-package.json5" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/../demo/src/main/ets/pages/Index.ets" beforeDir="false" afterPath="$PROJECT_DIR$/../demo/src/main/ets/pages/Index.ets" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/../demo/src/main/ets/pages/Pay.ets" beforeDir="false" afterPath="$PROJECT_DIR$/../demo/src/main/ets/pages/Pay.ets" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Index.ets" beforeDir="false" afterPath="$PROJECT_DIR$/Index.ets" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/ets/model/message/SendMessageToWX.ets" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/ets/model/message/SendMessageToWX.ets" afterDir="false" />
-    </list>
-    <option name="SHOW_DIALOG" value="false" />
-    <option name="HIGHLIGHT_CONFLICTS" value="true" />
-    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
-    <option name="LAST_RESOLUTION" value="IGNORE" />
-  </component>
-  <component name="Git.Settings">
-    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
-  </component>
-  <component name="ProjectColorInfo"><![CDATA[{
-  "associatedIndex": 2
-}]]></component>
-  <component name="ProjectId" id="2mYlAcsQbZsQtscC4TTsT8YLvyC" />
-  <component name="ProjectViewState">
-    <option name="hideEmptyMiddlePackages" value="true" />
-    <option name="showLibraryContents" value="true" />
-  </component>
-  <component name="PropertiesComponent"><![CDATA[{
-  "keyToString": {
-    "RunOnceActivity.OpenProjectViewOnStart": "true",
-    "RunOnceActivity.ShowReadmeOnStart": "true",
-    "last_opened_file_path": "/Users/kingyuluk/Developer/wechat_openapi_ohos_sdk/sdk"
-  }
-}]]></component>
-  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
-</project>

+ 0 - 17
entry/oh_modules/@tencent/wechat_open_sdk/BuildProfile.ets

@@ -1,17 +0,0 @@
-/**
- * Use these variables when you tailor your ArkTS code. They must be of the const type.
- */
-export const HAR_VERSION = '1.0.0';
-export const BUILD_MODE_NAME = 'debug';
-export const DEBUG = true;
-export const TARGET_NAME = 'default';
-
-/**
- * BuildProfile Class is used only for compatibility purposes.
- */
-export default class BuildProfile { 
-	static readonly HAR_VERSION = HAR_VERSION;
-	static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
-	static readonly DEBUG = DEBUG;
-	static readonly TARGET_NAME = TARGET_NAME;
-}

+ 0 - 3
entry/oh_modules/@tencent/wechat_open_sdk/CHANGELOG.md

@@ -1,3 +0,0 @@
-# 1.0.0
-
-init WeChat OpenSDK

+ 0 - 11
entry/oh_modules/@tencent/wechat_open_sdk/Index.ets

@@ -1,11 +0,0 @@
-export * from './src/main/ets/open_api/WXAPIFactory'
-export * from './src/main/ets/model/Base'
-export * from './src/main/ets/model/SendAuth'
-export * from './src/main/ets/model/SendTdiAuth'
-export * from './src/main/ets/model/Pay'
-export * from './src/main/ets/model/message/SendMessageToWX'
-export * from './src/main/ets/model/message/WXImageObject'
-export * from './src/main/ets/model/message/WXTextObject'
-export * from './src/main/ets/diff_dev_oauth/DiffDevOAuth'
-export * from './src/main/ets/log/Log'
-export { Command } from './src/main/ets/model/Constants'

+ 0 - 373
entry/oh_modules/@tencent/wechat_open_sdk/LICENSE

@@ -1,373 +0,0 @@
-Mozilla Public License Version 2.0
-==================================
-
-1. Definitions
---------------
-
-1.1. "Contributor"
-    means each individual or legal entity that creates, contributes to
-    the creation of, or owns Covered Software.
-
-1.2. "Contributor Version"
-    means the combination of the Contributions of others (if any) used
-    by a Contributor and that particular Contributor's Contribution.
-
-1.3. "Contribution"
-    means Covered Software of a particular Contributor.
-
-1.4. "Covered Software"
-    means Source Code Form to which the initial Contributor has attached
-    the notice in Exhibit A, the Executable Form of such Source Code
-    Form, and Modifications of such Source Code Form, in each case
-    including portions thereof.
-
-1.5. "Incompatible With Secondary Licenses"
-    means
-
-    (a) that the initial Contributor has attached the notice described
-        in Exhibit B to the Covered Software; or
-
-    (b) that the Covered Software was made available under the terms of
-        version 1.1 or earlier of the License, but not also under the
-        terms of a Secondary License.
-
-1.6. "Executable Form"
-    means any form of the work other than Source Code Form.
-
-1.7. "Larger Work"
-    means a work that combines Covered Software with other material, in
-    a separate file or files, that is not Covered Software.
-
-1.8. "License"
-    means this document.
-
-1.9. "Licensable"
-    means having the right to grant, to the maximum extent possible,
-    whether at the time of the initial grant or subsequently, any and
-    all of the rights conveyed by this License.
-
-1.10. "Modifications"
-    means any of the following:
-
-    (a) any file in Source Code Form that results from an addition to,
-        deletion from, or modification of the contents of Covered
-        Software; or
-
-    (b) any new file in Source Code Form that contains any Covered
-        Software.
-
-1.11. "Patent Claims" of a Contributor
-    means any patent claim(s), including without limitation, method,
-    process, and apparatus claims, in any patent Licensable by such
-    Contributor that would be infringed, but for the grant of the
-    License, by the making, using, selling, offering for sale, having
-    made, import, or transfer of either its Contributions or its
-    Contributor Version.
-
-1.12. "Secondary License"
-    means either the GNU General Public License, Version 2.0, the GNU
-    Lesser General Public License, Version 2.1, the GNU Affero General
-    Public License, Version 3.0, or any later versions of those
-    licenses.
-
-1.13. "Source Code Form"
-    means the form of the work preferred for making modifications.
-
-1.14. "You" (or "Your")
-    means an individual or a legal entity exercising rights under this
-    License. For legal entities, "You" includes any entity that
-    controls, is controlled by, or is under common control with You. For
-    purposes of this definition, "control" means (a) the power, direct
-    or indirect, to cause the direction or management of such entity,
-    whether by contract or otherwise, or (b) ownership of more than
-    fifty percent (50%) of the outstanding shares or beneficial
-    ownership of such entity.
-
-2. License Grants and Conditions
---------------------------------
-
-2.1. Grants
-
-Each Contributor hereby grants You a world-wide, royalty-free,
-non-exclusive license:
-
-(a) under intellectual property rights (other than patent or trademark)
-    Licensable by such Contributor to use, reproduce, make available,
-    modify, display, perform, distribute, and otherwise exploit its
-    Contributions, either on an unmodified basis, with Modifications, or
-    as part of a Larger Work; and
-
-(b) under Patent Claims of such Contributor to make, use, sell, offer
-    for sale, have made, import, and otherwise transfer either its
-    Contributions or its Contributor Version.
-
-2.2. Effective Date
-
-The licenses granted in Section 2.1 with respect to any Contribution
-become effective for each Contribution on the date the Contributor first
-distributes such Contribution.
-
-2.3. Limitations on Grant Scope
-
-The licenses granted in this Section 2 are the only rights granted under
-this License. No additional rights or licenses will be implied from the
-distribution or licensing of Covered Software under this License.
-Notwithstanding Section 2.1(b) above, no patent license is granted by a
-Contributor:
-
-(a) for any code that a Contributor has removed from Covered Software;
-    or
-
-(b) for infringements caused by: (i) Your and any other third party's
-    modifications of Covered Software, or (ii) the combination of its
-    Contributions with other software (except as part of its Contributor
-    Version); or
-
-(c) under Patent Claims infringed by Covered Software in the absence of
-    its Contributions.
-
-This License does not grant any rights in the trademarks, service marks,
-or logos of any Contributor (except as may be necessary to comply with
-the notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
-No Contributor makes additional grants as a result of Your choice to
-distribute the Covered Software under a subsequent version of this
-License (see Section 10.2) or under the terms of a Secondary License (if
-permitted under the terms of Section 3.3).
-
-2.5. Representation
-
-Each Contributor represents that the Contributor believes its
-Contributions are its original creation(s) or it has sufficient rights
-to grant the rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
-This License is not intended to limit any rights You have under
-applicable copyright doctrines of fair use, fair dealing, or other
-equivalents.
-
-2.7. Conditions
-
-Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
-in Section 2.1.
-
-3. Responsibilities
--------------------
-
-3.1. Distribution of Source Form
-
-All distribution of Covered Software in Source Code Form, including any
-Modifications that You create or to which You contribute, must be under
-the terms of this License. You must inform recipients that the Source
-Code Form of the Covered Software is governed by the terms of this
-License, and how they can obtain a copy of this License. You may not
-attempt to alter or restrict the recipients' rights in the Source Code
-Form.
-
-3.2. Distribution of Executable Form
-
-If You distribute Covered Software in Executable Form then:
-
-(a) such Covered Software must also be made available in Source Code
-    Form, as described in Section 3.1, and You must inform recipients of
-    the Executable Form how they can obtain a copy of such Source Code
-    Form by reasonable means in a timely manner, at a charge no more
-    than the cost of distribution to the recipient; and
-
-(b) You may distribute such Executable Form under the terms of this
-    License, or sublicense it under different terms, provided that the
-    license for the Executable Form does not attempt to limit or alter
-    the recipients' rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
-You may create and distribute a Larger Work under terms of Your choice,
-provided that You also comply with the requirements of this License for
-the Covered Software. If the Larger Work is a combination of Covered
-Software with a work governed by one or more Secondary Licenses, and the
-Covered Software is not Incompatible With Secondary Licenses, this
-License permits You to additionally distribute such Covered Software
-under the terms of such Secondary License(s), so that the recipient of
-the Larger Work may, at their option, further distribute the Covered
-Software under the terms of either this License or such Secondary
-License(s).
-
-3.4. Notices
-
-You may not remove or alter the substance of any license notices
-(including copyright notices, patent notices, disclaimers of warranty,
-or limitations of liability) contained within the Source Code Form of
-the Covered Software, except that You may alter any license notices to
-the extent required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
-You may choose to offer, and to charge a fee for, warranty, support,
-indemnity or liability obligations to one or more recipients of Covered
-Software. However, You may do so only on Your own behalf, and not on
-behalf of any Contributor. You must make it absolutely clear that any
-such warranty, support, indemnity, or liability obligation is offered by
-You alone, and You hereby agree to indemnify every Contributor for any
-liability incurred by such Contributor as a result of warranty, support,
-indemnity or liability terms You offer. You may include additional
-disclaimers of warranty and limitations of liability specific to any
-jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
----------------------------------------------------
-
-If it is impossible for You to comply with any of the terms of this
-License with respect to some or all of the Covered Software due to
-statute, judicial order, or regulation then You must: (a) comply with
-the terms of this License to the maximum extent possible; and (b)
-describe the limitations and the code they affect. Such description must
-be placed in a text file included with all distributions of the Covered
-Software under this License. Except to the extent prohibited by statute
-or regulation, such description must be sufficiently detailed for a
-recipient of ordinary skill to be able to understand it.
-
-5. Termination
---------------
-
-5.1. The rights granted under this License will terminate automatically
-if You fail to comply with any of its terms. However, if You become
-compliant, then the rights granted under this License from a particular
-Contributor are reinstated (a) provisionally, unless and until such
-Contributor explicitly and finally terminates Your grants, and (b) on an
-ongoing basis, if such Contributor fails to notify You of the
-non-compliance by some reasonable means prior to 60 days after You have
-come back into compliance. Moreover, Your grants from a particular
-Contributor are reinstated on an ongoing basis if such Contributor
-notifies You of the non-compliance by some reasonable means, this is the
-first time You have received notice of non-compliance with this License
-from such Contributor, and You become compliant prior to 30 days after
-Your receipt of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
-infringement claim (excluding declaratory judgment actions,
-counter-claims, and cross-claims) alleging that a Contributor Version
-directly or indirectly infringes any patent, then the rights granted to
-You by any and all Contributors for the Covered Software under Section
-2.1 of this License shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all
-end user license agreements (excluding distributors and resellers) which
-have been validly granted by You or Your distributors under this License
-prior to termination shall survive termination.
-
-************************************************************************
-*                                                                      *
-*  6. Disclaimer of Warranty                                           *
-*  -------------------------                                           *
-*                                                                      *
-*  Covered Software is provided under this License on an "as is"       *
-*  basis, without warranty of any kind, either expressed, implied, or  *
-*  statutory, including, without limitation, warranties that the       *
-*  Covered Software is free of defects, merchantable, fit for a        *
-*  particular purpose or non-infringing. The entire risk as to the     *
-*  quality and performance of the Covered Software is with You.        *
-*  Should any Covered Software prove defective in any respect, You     *
-*  (not any Contributor) assume the cost of any necessary servicing,   *
-*  repair, or correction. This disclaimer of warranty constitutes an   *
-*  essential part of this License. No use of any Covered Software is   *
-*  authorized under this License except under this disclaimer.         *
-*                                                                      *
-************************************************************************
-
-************************************************************************
-*                                                                      *
-*  7. Limitation of Liability                                          *
-*  --------------------------                                          *
-*                                                                      *
-*  Under no circumstances and under no legal theory, whether tort      *
-*  (including negligence), contract, or otherwise, shall any           *
-*  Contributor, or anyone who distributes Covered Software as          *
-*  permitted above, be liable to You for any direct, indirect,         *
-*  special, incidental, or consequential damages of any character      *
-*  including, without limitation, damages for lost profits, loss of    *
-*  goodwill, work stoppage, computer failure or malfunction, or any    *
-*  and all other commercial damages or losses, even if such party      *
-*  shall have been informed of the possibility of such damages. This   *
-*  limitation of liability shall not apply to liability for death or   *
-*  personal injury resulting from such party's negligence to the       *
-*  extent applicable law prohibits such limitation. Some               *
-*  jurisdictions do not allow the exclusion or limitation of           *
-*  incidental or consequential damages, so this exclusion and          *
-*  limitation may not apply to You.                                    *
-*                                                                      *
-************************************************************************
-
-8. Litigation
--------------
-
-Any litigation relating to this License may be brought only in the
-courts of a jurisdiction where the defendant maintains its principal
-place of business and such litigation shall be governed by laws of that
-jurisdiction, without reference to its conflict-of-law provisions.
-Nothing in this Section shall prevent a party's ability to bring
-cross-claims or counter-claims.
-
-9. Miscellaneous
-----------------
-
-This License represents the complete agreement concerning the subject
-matter hereof. If any provision of this License is held to be
-unenforceable, such provision shall be reformed only to the extent
-necessary to make it enforceable. Any law or regulation which provides
-that the language of a contract shall be construed against the drafter
-shall not be used to construe this License against a Contributor.
-
-10. Versions of the License
----------------------------
-
-10.1. New Versions
-
-Mozilla Foundation is the license steward. Except as provided in Section
-10.3, no one other than the license steward has the right to modify or
-publish new versions of this License. Each version will be given a
-distinguishing version number.
-
-10.2. Effect of New Versions
-
-You may distribute the Covered Software under the terms of the version
-of the License under which You originally received the Covered Software,
-or under the terms of any subsequent version published by the license
-steward.
-
-10.3. Modified Versions
-
-If you create software not governed by this License, and you want to
-create a new license for such software, you may create and use a
-modified version of this License if you rename the license and remove
-any references to the name of the license steward (except to note that
-such modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary
-Licenses
-
-If You choose to distribute Source Code Form that is Incompatible With
-Secondary Licenses under the terms of this version of the License, the
-notice described in Exhibit B of this License must be attached.
-
-Exhibit A - Source Code Form License Notice
--------------------------------------------
-
-  This Source Code Form is subject to the terms of the Mozilla Public
-  License, v. 2.0. If a copy of the MPL was not distributed with this
-  file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular
-file, then You may include the notice in a location (such as a LICENSE
-file in a relevant directory) where a recipient would be likely to look
-for such a notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - "Incompatible With Secondary Licenses" Notice
----------------------------------------------------------
-
-  This Source Code Form is "Incompatible With Secondary Licenses", as
-  defined by the Mozilla Public License, v. 2.0.

+ 0 - 5
entry/oh_modules/@tencent/wechat_open_sdk/README.md

@@ -1,5 +0,0 @@
-# 微信 OpenSDK
-
-接入微信开放平台,让你的移动应用支持微信分享、微信收藏和微信支付
-
-接入流程请参考[微信开放平台](https://open.weixin.qq.com)。

+ 0 - 28
entry/oh_modules/@tencent/wechat_open_sdk/build-profile.json5

@@ -1,28 +0,0 @@
-{
-  "apiType": "stageMode",
-  "buildOption": {
-  },
-  "buildOptionSet": [
-    {
-      "name": "release",
-      "arkOptions": {
-        "obfuscation": {
-          "ruleOptions": {
-            "enable": true,
-            "files": [
-              "./obfuscation-rules.txt"
-            ]
-          },
-          "consumerFiles": [
-            "./consumer-rules.txt"
-          ]
-        }
-      },
-    },
-  ],
-  "targets": [
-    {
-      "name": "default"
-    }
-  ]
-}

+ 0 - 0
entry/oh_modules/@tencent/wechat_open_sdk/consumer-rules.txt


+ 0 - 6
entry/oh_modules/@tencent/wechat_open_sdk/hvigorfile.ts

@@ -1,6 +0,0 @@
-import { harTasks } from '@ohos/hvigor-ohos-plugin';
-
-export default {
-    system: harTasks,  /* Built-in plugin of Hvigor. It cannot be modified. */
-    plugins:[]         /* Custom plugin to extend the functionality of Hvigor. */
-}

+ 0 - 18
entry/oh_modules/@tencent/wechat_open_sdk/obfuscation-rules.txt

@@ -1,18 +0,0 @@
-# Define project specific obfuscation rules here.
-# You can include the obfuscation configuration files in the current module's build-profile.json5.
-#
-# For more details, see
-#   https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
-
-# Obfuscation options:
-# -disable-obfuscation: disable all obfuscations
-# -enable-property-obfuscation: obfuscate the property names
-# -enable-toplevel-obfuscation: obfuscate the names in the global scope
-# -compact: remove unnecessary blank spaces and all line feeds
-# -remove-log: remove all console.* statements
-# -print-namecache: print the name cache that contains the mapping from the old names to new names
-# -apply-namecache: reuse the given cache file
-
-# Keep options:
-# -keep-property-name: specifies property names that you want to keep
-# -keep-global-name: specifies names that you want to keep in the global scope

+ 0 - 1
entry/oh_modules/@tencent/wechat_open_sdk/oh-package.json5

@@ -1 +0,0 @@
-{"name":"@tencent/wechat_open_sdk","version":"1.0.0","description":"Tencent WeChat OpenSDK","main":"Index.ets","author":"wechatohos","license":"MPL-2.0","dependencies":{},"metadata":{"sourceRoots":["./src/main"]},"compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","obfuscated":false}

+ 0 - 195
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/diff_dev_oauth/DiffDevOAuth.ets

@@ -1,195 +0,0 @@
-import { http } from '@kit.NetworkKit'
-import { Log } from '../log/Log'
-
-const kTag = 'wxopensdk::DiffDevOAuth'
-
-export enum OAuthErrCode {
-  WechatAuth_Err_OK = 0,
-  WechatAuth_Err_NormalErr = -1,
-  WechatAuth_Err_NetworkErr = -2,
-  WechatAuth_Err_JsonDecodeErr = -3,
-  WechatAuth_Err_Cancel = -4,
-  WechatAuth_Err_Timeout = -5,
-  WechatAuth_Err_Auth_Stopped = -6,
-  WechatAuth_Err_Param_Err = -7
-}
-
-export interface OAuthCallback {
-  onGotQRCode: (base64JpegImageBuffer: string) => void
-  onQRCodeScanned: () => void
-  onAuthFinish: (authCode: string) => void
-  onAuthError: (errCode: OAuthErrCode, errMsg: string) => void
-}
-
-export interface IDiffDevOAuth {
-  /**
-   * 发起OAuth
-   *
-   * @param appId 待授权appid
-   * @param scope 权限
-   * @param noncestr
-   * @param timestamp
-   * @param signature
-   * @return 是否成功发起OAuth
-   */
-  startOAuth(appId: string, scope: string, noncestr: string, timestamp: string, signature: string, callback: OAuthCallback): void
-
-  stopOAuth(): void
-}
-
-export class DiffDevOAuthFactory {
-  public static readonly VERSION_1 = 1
-  /**
-   * 最大支持的IDiffDevOAuth实现版本
-   */
-  public static readonly MAX_SUPPORTED_VERSION = DiffDevOAuthFactory.VERSION_1
-
-  private constructor() {
-  }
-
-  /**
-   * 获取IDiffDevOAuth指定版本的实现
-   *
-   * @param version
-   */
-  public static getDiffDevOAuth(version: number = DiffDevOAuthFactory.MAX_SUPPORTED_VERSION): IDiffDevOAuth | null {
-    if (version > DiffDevOAuthFactory.MAX_SUPPORTED_VERSION) {
-      return null
-    }
-
-    switch (version) {
-      case DiffDevOAuthFactory.VERSION_1:
-        return new DiffDevOAuthImplV1()
-
-      default:
-        return null
-    }
-  }
-}
-
-enum UUIDStatusCodeEnum {
-  UUID_EXPIRED = 402,
-  UUID_CANCELED = 403,
-  UUID_SCANNED = 404,
-  UUID_CONFIRM = 405,
-  UUID_KEEP_CONNECT = 408,
-  UUID_SERVER_ERROR = 500
-}
-
-class DiffDevOAuthImplV1 implements IDiffDevOAuth {
-  private started: boolean = false
-  private callback: OAuthCallback | null = null
-  private isCanceled: boolean = false
-  private lastUUIDStatusCode: number = 0
-
-  startOAuth(appId: string, scope: string, noncestr: string, timestamp: string, signature: string, callback: OAuthCallback) {
-    this.callback = callback
-    this.startOAuthInner(appId, scope, noncestr, timestamp, signature)
-  }
-
-  private async startOAuthInner(appId: string, scope: string, noncestr: string, timestamp: string, signature: string) {
-    if (this.started) {
-      this.callback?.onAuthError(OAuthErrCode.WechatAuth_Err_Auth_Stopped, 'OAuth is already started')
-      return
-    }
-    this.started = true
-    if (appId.length === 0 || scope.length === 0) {
-      this.callback?.onAuthError(OAuthErrCode.WechatAuth_Err_Param_Err, 'appId or scope is empty')
-      return
-    }
-    const url = `https://open.weixin.qq.com/connect/sdk/qrconnect?appid=${appId}&noncestr=${noncestr}&timestamp=${timestamp}&scope=${scope}&signature=${signature}`
-    const httpRequest = http.createHttp()
-    try {
-      const response = await httpRequest.request(url)
-      const data = response.result as string
-      if (data.length === 0) {
-        this.callback?.onAuthError(OAuthErrCode.WechatAuth_Err_NetworkErr, 'response data is empty')
-        return
-      }
-      const qrResponse: Record<string, Object> = JSON.parse(data)
-      if (qrResponse['errcode'] !== 0) {
-        this.callback?.onAuthError(OAuthErrCode.WechatAuth_Err_NormalErr, `response errcode: ${qrResponse["errcode"]} errmsg: ${qrResponse["errmsg"]}`)
-        return
-      }
-      const uuid = qrResponse['uuid'] as string
-      if (uuid.length === 0) {
-        this.callback?.onAuthError(OAuthErrCode.WechatAuth_Err_JsonDecodeErr, 'uuid is empty')
-        return
-      }
-      const qrCodeBase64Record = qrResponse.qrcode as Record<string, Object>
-      const qrCodeBase64 = qrCodeBase64Record['qrcodebase64'] as string
-      const qrCodeLength = qrCodeBase64Record['qrcodelength'] as number
-      if (qrCodeBase64.length === 0 || qrCodeLength === 0) {
-        this.callback?.onAuthError(OAuthErrCode.WechatAuth_Err_JsonDecodeErr, 'qrcodebase64 or qrcodelength is empty')
-        return
-      }
-      this.callback?.onGotQRCode(qrCodeBase64)
-      this.startLongPolling(uuid)
-    } catch (e) {
-      this.callback?.onAuthError(OAuthErrCode.WechatAuth_Err_NetworkErr, e.message)
-    }
-  }
-
-  private async startLongPolling(uuid: string) {
-    if (uuid.length === 0) {
-      this.callback?.onAuthError(OAuthErrCode.WechatAuth_Err_NormalErr, 'uuid is empty')
-      return
-    }
-    while (!this.isCanceled) {
-      let url = `https://long.open.weixin.qq.com/connect/l/qrconnect?f=json&uuid=${uuid}`
-      if (this.lastUUIDStatusCode !== 0) {
-        url += `&last=${this.lastUUIDStatusCode}`
-      }
-      const httpRequest = http.createHttp()
-      const response = await httpRequest.request(url)
-      const data = response.result as string
-      if (data.length === 0) {
-        this.callback?.onAuthError(OAuthErrCode.WechatAuth_Err_NetworkErr, 'response data is empty')
-        return
-      }
-      const pollingResponse: Record<string, Object> = JSON.parse(data)
-      let uuidStatusCode = pollingResponse['wx_errcode'] as number
-      Log.d(kTag, `lastUUIDStatusCode: ${this.lastUUIDStatusCode}`)
-      let errCode = OAuthErrCode.WechatAuth_Err_OK
-      let wxCode = 0
-      switch (uuidStatusCode) {
-        case UUIDStatusCodeEnum.UUID_CONFIRM:
-          wxCode = pollingResponse['wx_code'] as number
-          break
-        case UUIDStatusCodeEnum.UUID_SCANNED:
-          break
-        case UUIDStatusCodeEnum.UUID_KEEP_CONNECT:
-          break
-        case UUIDStatusCodeEnum.UUID_EXPIRED:
-          errCode = OAuthErrCode.WechatAuth_Err_Timeout
-          break
-        case UUIDStatusCodeEnum.UUID_CANCELED:
-          errCode = OAuthErrCode.WechatAuth_Err_Cancel
-          break
-        case UUIDStatusCodeEnum.UUID_SERVER_ERROR:
-          errCode = OAuthErrCode.WechatAuth_Err_NormalErr
-          break
-        default:
-          errCode = OAuthErrCode.WechatAuth_Err_NormalErr
-          break
-      }
-      if (errCode === OAuthErrCode.WechatAuth_Err_OK) {
-        this.lastUUIDStatusCode = uuidStatusCode
-        if (uuidStatusCode === UUIDStatusCodeEnum.UUID_SCANNED) {
-          this.callback?.onQRCodeScanned()
-        } else if (uuidStatusCode === UUIDStatusCodeEnum.UUID_CONFIRM) {
-          this.callback?.onAuthFinish(wxCode.toString())
-          break
-        }
-      } else {
-        this.callback?.onAuthError(errCode, 'polling error')
-        break
-      }
-    }
-  }
-
-  stopOAuth() {
-    this.callback = null
-    this.isCanceled = true
-  }
-}

+ 0 - 48
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/log/Log.ets

@@ -1,48 +0,0 @@
-import util from '@ohos.util';
-
-export enum LogLevel {
-  verbose,  // More detailed information.
-  debug,    // Detailed information on the flow through the system.
-  info,     // Interesting runtime events (startup/shutdown), should be conservative and keep to a minimum.
-  warn,     // Other runtime situations that are undesirable or unexpected, but not necessarily "wrong".
-  error,    // Other runtime errors or unexpected conditions.
-  fatal,    // Severe errors that cause premature termination.
-}
-
-export interface LogInterface {
-  print(level: LogLevel, tag: string, message: string): void
-}
-
-class LogDefaultImpl implements LogInterface {
-  print(level: LogLevel, tag: string, message: string): void {
-    let logFunc: (message: string) => void =
-      (() => {
-        switch (level) {
-          case LogLevel.verbose: return console.log
-          case LogLevel.debug:   return console.debug
-          case LogLevel.info:    return console.info
-          case LogLevel.warn:    return console.warn
-          case LogLevel.error:   return console.error
-          case LogLevel.fatal:   return console.assert
-        }
-      })()
-    logFunc('[' + tag + '] ' + message)
-  }
-}
-
-export class Log {
-  private static log: LogInterface = new LogDefaultImpl
-
-  public static setLogImpl(impl: LogInterface) {
-    Log.log = impl
-  }
-
-  public static d(tag: string, format: string, ...args: Object[]) { Log.printf(LogLevel.debug, tag, format, ...args); }
-  public static i(tag: string, format: string, ...args: Object[]) { Log.printf(LogLevel.info, tag, format, ...args); }
-  public static w(tag: string, format: string, ...args: Object[]) { Log.printf(LogLevel.warn, tag, format, ...args); }
-  public static e(tag: string, format: string, ...args: Object[]) { Log.printf(LogLevel.error, tag, format, ...args); }
-
-  private static printf(level: LogLevel, tag: string, format: string, ...args: Object[]) {
-    Log.log.print(level, tag, util.format(format, ...args))
-  }
-}

+ 0 - 63
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/Base.ets

@@ -1,63 +0,0 @@
-
-export abstract class BaseReq {
-  id: number = 0;
-  readonly name: string = this.constructor.name
-
-  transaction?: string
-  openId?: string
-
-  abstract checkArgs(): boolean
-  abstract get type(): number
-
-  serializeTo(to: object): void {
-    to['__type__'] = this.type
-    to['transaction'] = this.transaction
-    to['openId'] = this.openId
-  }
-  deserializeFrom(from: object): void {
-    this.transaction = from['transaction']
-    this.openId = from['openId']
-  }
-}
-
-export enum ErrCode {
-  ERR_OK = 0,
-  ERR_COMM = -1,
-  ERR_USER_CANCEL = -2,
-  ERR_SENT_FAILED = -3,
-  ERR_AUTH_DENIED = -4,
-  ERR_UNSUPPORTED = -5,
-  ERR_BAN = -6,
-
-  ERR_SCOPE_SNSAPI_WXAAPP_INFO_CAN_ONLY_AUTHORIZED_SEPARATELY = -1000,
-}
-
-export abstract class BaseResp {
-  id: number = 0;
-  readonly name: string = this.constructor.name
-
-  errCode: number = ErrCode.ERR_OK
-  errStr?: string
-  transaction?: string
-  openId?: string
-
-  abstract get type(): number
-
-  serializeTo(to: object): void {
-    to['__type__'] = this.type
-    to['errCode'] = this.errCode
-    to['errStr'] = this.errStr
-    to['transaction'] = this.transaction
-    to['openId'] = this.openId
-  }
-  deserializeFrom(from: object): void {
-    this.errCode = from['errCode'] ?? ErrCode.ERR_COMM
-    this.errStr = from['errStr']
-    this.transaction = from['transaction']
-    this.openId = from['openId']
-  }
-}
-
-export type SendReqResult = boolean
-export type SendReqResultWrap = SendReqResult | Promise<SendReqResult>
-

+ 0 - 13
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/Constants.ets

@@ -1,13 +0,0 @@
-
-export const kWechatBundleName = 'com.tencent.wechat'
-export const kWechatEntryAbility = 'EntryAbility'
-
-export enum Command {
-  kCommandSendAuth = 1,
-  kCommandSendMessageToWX = 2,
-
-  kCommandPay = 5,
-  kCommandJointPay = 27,
-
-  kCommandSendTdiAuth = 31,
-}

+ 0 - 135
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/Pay.ets

@@ -1,135 +0,0 @@
-import { BaseReq, BaseResp, Log } from '../../../../Index'
-import { Command } from './Constants'
-
-const EXTDATA_MAX_LENGTH = 1024
-
-export class PayReq extends BaseReq {
-  protected get TAG() {
-    return "PaySdk.PayReq"
-  }
-
-  appId?: string
-  partnerId?: string
-  prepayId?: string
-  nonceStr?: string
-  timeStamp?: string
-  packageValue?: string
-  sign?: string
-  extData?: string
-  signType?: string
-
-  checkArgs(): boolean {
-    if (this.appId?.length === 0) {
-      Log.e(this.TAG, "checkArgs fail, invalid appId")
-      return false
-    }
-
-    if (this.partnerId?.length === 0) {
-      Log.e(this.TAG, "checkArgs fail, invalid partnerId")
-      return false
-    }
-
-    if (this.prepayId?.length === 0) {
-      Log.e(this.TAG, "checkArgs fail, invalid prepayId")
-      return false
-    }
-
-    if (this.nonceStr?.length === 0) {
-      Log.e(this.TAG, "checkArgs fail, invalid nonceStr")
-      return false
-    }
-
-    if (this.timeStamp?.length === 0) {
-      Log.e(this.TAG, "checkArgs fail, invalid timeStamp")
-      return false
-    }
-
-    if (this.packageValue?.length === 0) {
-      Log.e(this.TAG, "checkArgs fail, invalid packageValue")
-      return false
-    }
-
-    if (this.sign?.length === 0) {
-      Log.e(this.TAG, "checkArgs fail, invalid sign")
-      return false
-    }
-
-    if (this.extData && this.extData.length > EXTDATA_MAX_LENGTH) {
-      Log.e(this.TAG, "checkArgs fail, extData length too long")
-      return false
-    }
-
-    return true
-  }
-
-  serializeTo(to: object): void {
-    super.serializeTo(to)
-    to['appId'] = this.appId
-    to['partnerId'] = this.partnerId
-    to['prepayId'] = this.prepayId
-    to['nonceStr'] = this.nonceStr
-    to['timeStamp'] = this.timeStamp
-    to['packageValue'] = this.packageValue
-    to['sign'] = this.sign
-    to['extData'] = this.extData
-    to['signType'] = this.signType
-  }
-
-  deserializeFrom(from: object): void {
-    super.deserializeFrom(from)
-    this.appId = from['appId']
-    this.partnerId = from['partnerId']
-    this.prepayId = from['prepayId']
-    this.nonceStr = from['nonceStr']
-    this.timeStamp = from['timeStamp']
-    this.packageValue = from['packageValue']
-    this.sign = from['sign']
-    this.extData = from['extData']
-    this.signType = from['signType']
-  }
-
-  get type(): number {
-    return Command.kCommandPay
-  }
-}
-
-export class PayResp extends BaseResp {
-  prepayId?: string
-  returnKey?: string
-  extData?: string
-
-  serializeTo(to: object): void {
-    super.serializeTo(to)
-    to['prepayId'] = this.prepayId
-    to['returnKey'] = this.returnKey
-    to['extData'] = this.extData
-  }
-
-  deserializeFrom(from: object): void {
-    super.deserializeFrom(from)
-    this.prepayId = from['prepayId']
-    this.returnKey = from['returnKey']
-    this.extData = from['extData']
-  }
-
-  get type(): number {
-    return Command.kCommandPay
-  }
-}
-
-export class JointPayReq extends PayReq {
-  protected get TAG() {
-    return "PaySdk.JointPayReq"
-  }
-
-  get type(): number {
-    return Command.kCommandJointPay
-  }
-}
-
-export class JointPayResp extends PayResp {
-
-  get type(): number {
-    return Command.kCommandJointPay
-  }
-}

+ 0 - 74
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/SendAuth.ets

@@ -1,74 +0,0 @@
-import { BaseReq, BaseResp } from './Base'
-import { Command } from './Constants'
-
-export class SendAuthReq extends BaseReq {
-  scope?: string
-  state?: string
-  extData?: string
-  isOption1: boolean = false
-  nonAutomatic: boolean = false
-
-  checkArgs(): boolean {
-    this.scope = this.scope?.trim()
-    if ((this.scope?.length ?? 0) === 0) {
-      return false
-    }
-    return true
-  }
-
-  serializeTo(to: object): void {
-    super.serializeTo(to)
-    to['scope'] = this.scope
-    to['state'] = this.state
-    to['extData'] = this.extData
-    to['isOption1'] = this.isOption1
-    to['nonAutomatic'] = this.nonAutomatic
-  }
-
-  deserializeFrom(from: object): void {
-    super.deserializeFrom(from)
-    this.scope = from['scope']
-    this.state = from['state']
-    this.extData = from['extData']
-    this.isOption1 = from['isOption1'] ?? false
-    this.nonAutomatic = from['nonAutomatic'] ?? false
-  }
-
-  get type(): number {
-    return Command.kCommandSendAuth
-  }
-}
-
-export class SendAuthResp extends BaseResp {
-  code?: string
-  state?: string
-  authResult: boolean = false
-  url?: string
-  lang?: string
-  country?: string
-
-  serializeTo(to: object): void {
-    super.serializeTo(to)
-    to['code'] = this.code
-    to['state'] = this.state
-    to['authResult'] = this.authResult
-    to['url'] = this.url
-    to['lang'] = this.lang
-    to['country'] = this.country
-  }
-
-  deserializeFrom(from: object): void {
-    super.deserializeFrom(from)
-    this.code = from['code']
-    this.state = from['state']
-    this.authResult = from['authResult']
-    this.url = from['url']
-    this.lang = from['lang']
-    this.country = from['country']
-  }
-
-  get type(): number {
-    return Command.kCommandSendAuth
-  }
-}
-

+ 0 - 27
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/SendTdiAuth.ets

@@ -1,27 +0,0 @@
-import { SendAuthReq, SendAuthResp } from './SendAuth'
-import { Command } from './Constants'
-
-export class SendTdiAuthReq extends SendAuthReq {
-
-  get type() {
-    return Command.kCommandSendTdiAuth
-  }
-}
-
-export class SendTdiAuthResp extends SendAuthResp {
-  tdiAuthBuffer?: Uint8Array
-
-  serializeTo(to: object): void {
-    super.serializeTo(to)
-    to['tdiAuthBuffer'] = this.tdiAuthBuffer
-  }
-
-  deserializeFrom(from: object): void {
-    super.deserializeFrom(from)
-    this.tdiAuthBuffer = from['tdiAuthBuffer']
-  }
-
-  get type() {
-    return Command.kCommandSendTdiAuth
-  }
-}

+ 0 - 137
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/message/SendMessageToWX.ets

@@ -1,137 +0,0 @@
-import { BaseResp } from '../../../../../Index';
-import { BaseReq } from '../../../../../Index';
-import { Command } from '../Constants';
-import { WXMediaObjectFactory } from './WXMediaObjectFactory';
-
-export class SendMessageToWXReq extends BaseReq {
-  /**
-   * 表示发送到会话
-   */
-  static readonly WXSceneSession: number = 0
-
-  /** 发送消息的多媒体内容
-   * @see WXMediaMessage
-   */
-  message?: WXMediaMessage
-
-  /** 发送的目标场景。 默认发送到会话。
-   * @see WXScene
-   */
-  scene: number = SendMessageToWXReq.WXSceneSession
-
-  serializeTo(to: object): void {
-    super.serializeTo(to)
-    if (this.message !== undefined) {
-      let messageDict: ESObject = {}
-      this.message.serializeTo(messageDict)
-      to['message'] = messageDict
-    }
-    to['scene'] = this.scene
-  }
-
-  deserializeFrom(from: object): void {
-    super.deserializeFrom(from)
-    if (typeof from['message'] !== 'undefined') {
-      this.message = new WXMediaMessage
-      this.message.deserializeFrom(from['message'])
-    }
-    this.scene = from['scene']
-  }
-
-  checkArgs(): boolean {
-    if (this.message === undefined) {
-      return false
-    }
-    return this.message.checkArgs()
-  }
-
-  get type() {
-    return Command.kCommandSendMessageToWX
-  }
-}
-
-export class SendMessageToWXResp extends BaseResp {
-
-  serializeTo(to: object): void {
-    super.serializeTo(to)
-  }
-
-  deserializeFrom(from: object): void {
-    super.deserializeFrom(from)
-  }
-
-  get type() {
-    return Command.kCommandSendMessageToWX
-  }
-}
-
-export enum MediaObjectType {
-  TYPE_TEXT = 1,
-  TYPE_IMAGE = 2,
-}
-
-export interface IMediaObject {
-  serializeTo: (to: object) => void
-  deserializeFrom: (from: object) => void
-
-  type: number
-
-  checkArgs: () => boolean
-}
-
-export class WXMediaMessage {
-  /** 标题
-   * @note 长度不能超过512字节
-   */
-  title?: string = ''
-
-  mediaObject?: IMediaObject
-
-  /** 缩略图数据
-   * @note 大小不能超过64K
-   */
-  thumbData?: Uint8Array
-
-  // 统计使用,客户端不做解析
-  mediaTagName?: string
-
-  // 第三方和微信开放平台约定
-  messageAction?: string
-  // 第三方自定义,微信不做解析
-  messageExt?: string
-
-  serializeTo(to: object) {
-    to['wx_media_message_title'] = this.title
-    if (this.mediaObject !== undefined) {
-      to['wx_media_message_media_object_type'] = this.mediaObject.type
-      let mediaObjectDict: ESObject = {}
-      this.mediaObject.serializeTo(mediaObjectDict)
-      to['wx_media_message_media_object'] = mediaObjectDict
-    }
-    to['wx_media_message_media_tag_name'] = this.mediaTagName
-    to['wx_media_message_message_action'] = this.messageAction
-    to['wx_media_message_message_ext'] = this.messageExt
-  }
-
-  deserializeFrom(from: object) {
-    this.title = from['wx_media_message_title']
-    if (typeof from['wx_media_message_media_object_type'] === 'number' &&
-        typeof from['wx_media_message_media_object'] === 'object') {
-      let mediaObject: IMediaObject | undefined = WXMediaObjectFactory.createMediaObject(from['wx_media_message_media_object_type'])
-      if (mediaObject !== undefined) {
-        mediaObject.deserializeFrom(from['wx_media_message_media_object'])
-      }
-      this.mediaObject = mediaObject
-    }
-    this.mediaTagName = from['wx_media_message_media_tag_name']
-    this.messageAction = from['wx_media_message_message_action']
-    this.messageExt = from['wx_media_message_message_ext']
-  }
-
-  checkArgs(): boolean {
-    if (this.mediaObject === undefined) {
-      return false
-    }
-    return this.mediaObject.checkArgs()
-  }
-}

+ 0 - 34
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/message/WXImageObject.ets

@@ -1,34 +0,0 @@
-import { IMediaObject, MediaObjectType } from './SendMessageToWX';
-import { buffer, util } from '@kit.ArkTS';
-import { image } from '@kit.ImageKit';
-
-export class WXImageObject implements IMediaObject {
-  /** 图片的uri
-   * @note 支持jpeg/png类型的图片
-   */
-  uri?: string
-
-  /** 图片的数据内容
-   * @note 大小不能超过100KB,uri和imageData同时存在时忽略该字段
-   */
-  imageData?: string
-
-  type = MediaObjectType.TYPE_IMAGE
-
-  serializeTo(to: object) {
-    to['imageBase64'] = this.imageData
-    to['uri'] = this.uri
-  }
-
-  deserializeFrom(from: object) {
-    this.imageData = from['imageBase64']
-    this.uri = from['uri']
-  }
-
-  checkArgs(): boolean {
-    if (this.uri === undefined) {
-      return false
-    }
-    return true
-  }
-}

+ 0 - 16
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/message/WXMediaObjectFactory.ets

@@ -1,16 +0,0 @@
-import { MediaObjectType } from './SendMessageToWX';
-import { IMediaObject } from './SendMessageToWX';
-import { WXImageObject } from './WXImageObject';
-import { WXTextObject } from './WXTextObject';
-
-export class WXMediaObjectFactory {
-  static createMediaObject(type: number): IMediaObject | undefined {
-    if (type === MediaObjectType.TYPE_TEXT) {
-      return new WXTextObject
-    } else if (type === MediaObjectType.TYPE_IMAGE) {
-      return new WXImageObject
-    }
-    // add more object convert
-    return undefined
-  }
-}

+ 0 - 21
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/model/message/WXTextObject.ets

@@ -1,21 +0,0 @@
-import { IMediaObject, MediaObjectType } from './SendMessageToWX';
-
-export class WXTextObject implements IMediaObject {
-  type = MediaObjectType.TYPE_TEXT
-  text?: string
-
-  serializeTo(to: object) {
-    to['wx_text_object_text'] = this.text
-  }
-
-  deserializeFrom(from: object) {
-    this.text = from['wx_text_object_text']
-  }
-
-  checkArgs(): boolean {
-    if (this.text === undefined || this.text.length === 0) {
-      return false
-    }
-    return true
-  }
-}

+ 0 - 226
entry/oh_modules/@tencent/wechat_open_sdk/src/main/ets/open_api/WXAPIFactory.ets

@@ -1,226 +0,0 @@
-import common from '@ohos.app.ability.common';
-import { Command, kWechatBundleName, kWechatEntryAbility } from '../model/Constants';
-import { Want, wantConstant } from '@kit.AbilityKit';
-import { BaseReq, BaseResp, SendReqResult, SendReqResultWrap } from '../model/Base';
-import { SendAuthReq, SendAuthResp } from '../model/SendAuth';
-import { PayReq, PayResp, JointPayReq, JointPayResp } from '../model/Pay';
-import { Log } from '../log/Log';
-import { SendTdiAuthReq, SendTdiAuthResp } from '../model/SendTdiAuth';
-import { SendMessageToWXReq, MediaObjectType } from '../model/message/SendMessageToWX';
-import { SendMessageToWXResp } from '../model/message/SendMessageToWX';
-import { WXImageObject } from '../model/message/WXImageObject';
-
-type RespWrap = BaseResp | PromiseLike<BaseResp>
-type RespCallback = (resp: RespWrap) => void
-
-const kTag = 'wxopensdk::WXApi'
-
-const kWantCallerBundleNameKey = "ohos.aafwk.param.callerBundleName"
-const kWantRequestKey = "wxopensdk_request"
-const kWantResponseKey = "wxopensdk_response"
-const kWantAppidKey = "wxopensdk_appid"
-
-const kWechatBundleNameCandidates = [
-  "com.tencent.wechat.debug",
-  "com.tencent.wechat.red",
-  "com.tencent.wechat.purple",
-  "com.tencent.wechat.blue",
-  "com.tencent.wechat.yellow"
-]
-
-export interface WXApi {
-  sendReq(context: common.UIAbilityContext, req: BaseReq): SendReqResultWrap
-
-  openWechat(context: common.UIAbilityContext): SendReqResultWrap
-
-  handleWant(want: Want, eventHandler: WXApiEventHandler): boolean
-  /*
-  sendReqHelper(context: common.UIAbilityContext, req: Base.BaseReq): Base.BaseResp | Promise<Base.BaseResp>
-
-  onResult(response: Base.BaseResp): void
-  */
-}
-
-export interface WXApiEventHandler {
-  onReq(req: BaseReq): void
-
-  onResp(req: BaseResp): void
-}
-
-export class WXAPIFactory {
-  static createWXAPI(appId: string): WXApi {
-    return new WXApiImpl(appId)
-  }
-
-  static createReq(wantParameters: object): BaseReq | undefined {
-    let type: number = wantParameters['__type__'] ?? -1
-    let req =
-      ((): BaseReq | undefined => {
-        switch (type) {
-          case Command.kCommandSendAuth: return new SendAuthReq
-          case Command.kCommandSendTdiAuth: return new SendTdiAuthReq
-          case Command.kCommandSendMessageToWX: return new SendMessageToWXReq
-          case Command.kCommandPay: return new PayReq()
-          case Command.kCommandJointPay: return new JointPayReq()
-          default: return
-        }
-      })()
-    req?.deserializeFrom(wantParameters)
-    return req
-  }
-
-  static createResp(wantParameters: object): BaseResp | undefined {
-    let type: number = wantParameters['__type__'] ?? -1
-    let resp =
-      ((): BaseResp | undefined => {
-        switch (type) {
-          case Command.kCommandSendAuth: return new SendAuthResp
-          case Command.kCommandSendTdiAuth: return new SendTdiAuthResp
-          case Command.kCommandPay: return new PayResp
-          case Command.kCommandJointPay: return new JointPayResp
-          case Command.kCommandSendMessageToWX: return new SendMessageToWXResp
-          default: return
-        }
-      })()
-    resp?.deserializeFrom(wantParameters)
-    return resp
-  }
-}
-
-class WXApiImpl implements WXApi {
-  private readonly appId: string
-  constructor(appId: string) {
-    this.appId = appId;
-  }
-
-  private static NextId = 0;
-  private resolves = new Map<number, RespCallback>();
-
-  static reqToWantObject(req?: BaseReq): object | undefined {
-    if (req) {
-      let obj = new Object
-      req.serializeTo(obj)
-      return obj
-    } else {
-      return undefined
-    }
-  }
-
-  private makeWant(request?: BaseReq, wechatBundleName?: string): Want {
-    let parameters: Record<string, Object> = {}
-    parameters[kWantRequestKey] = WXApiImpl.reqToWantObject(request) ?? ""
-    parameters[kWantAppidKey] = this.appId
-    parameters["from"] = "_wechat_open_sdk"
-    
-    let uri: string | undefined = undefined
-    let action: string | undefined = undefined
-    let flags: number | undefined = undefined
-
-    if (request && request.type === Command.kCommandSendMessageToWX) {
-      let sendMessageReq = request as SendMessageToWXReq
-      if (sendMessageReq.checkArgs() && sendMessageReq.message?.mediaObject?.type === MediaObjectType.TYPE_IMAGE) {
-        let imageObject = sendMessageReq.message?.mediaObject as WXImageObject
-        if (imageObject!.uri && imageObject!.uri!.length > 0) {
-          uri = imageObject.uri
-          action = 'ohos.want.action.sendData'
-          flags = wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION | wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION
-        }
-      }
-    }
-    
-    return {
-      bundleName: wechatBundleName ?? kWechatBundleName,
-      abilityName:kWechatEntryAbility,
-      parameters: parameters,
-      action: action,
-      uri: uri,
-      flags: flags,
-    }
-  }
-
-  private openWechatWithWant(context: common.UIAbilityContext, req?: BaseReq): SendReqResultWrap {
-    return new Promise<SendReqResult>((resolve) => {
-      let bundleNames: Array<string> = []
-      bundleNames.push(kWechatBundleName)
-      bundleNames.push(...kWechatBundleNameCandidates)
-
-      ;(async () => {
-        let openSucceed = false
-        for (let name of bundleNames) {
-          let want = this.makeWant(req, name)
-          try {
-            await context.startAbility(want)
-            openSucceed = true
-            return
-          } catch (e) {
-            Log.e(kTag, 'openWechat fail by err:%s', JSON.stringify(e))
-          }
-        }
-        resolve(openSucceed)
-      })()
-    })
-  }
-
-  sendReq(context: common.UIAbilityContext, req: BaseReq): SendReqResultWrap {
-    return this.openWechatWithWant(context, req)
-  }
-
-  openWechat(context: common.UIAbilityContext): SendReqResultWrap {
-    return this.openWechatWithWant(context, undefined)
-  }
-
-  handleWant(want: Want, eventHandler: WXApiEventHandler): boolean {
-    if (want.parameters && typeof want.parameters[kWantCallerBundleNameKey] === 'string') {
-      let callerBundleName = want.parameters[kWantCallerBundleNameKey]
-      if (callerBundleName !== kWechatBundleName && !kWechatBundleNameCandidates.includes(callerBundleName)) {
-        return false
-      }
-      let reqWrap = want.parameters[kWantRequestKey]
-      if (reqWrap) {
-        let req = WXAPIFactory.createReq(reqWrap)
-        if (req) {
-          eventHandler.onReq(req)
-        }
-      }
-
-      let respWrap = want.parameters[kWantResponseKey]
-      if (respWrap) {
-        let resp = WXAPIFactory.createResp(respWrap)
-        if (resp) {
-          eventHandler.onResp(resp)
-        }
-      }
-      return true
-    } else {
-      return false
-    }
-  }
-
-  /*
-  sendReqHelper(context: common.UIAbilityContext, request: Base.BaseReq): Promise<Base.BaseResp> {
-    let id = this.id++;
-    request.id = id;
-    return new Promise<Base.BaseResp>((resolve) => {
-      context.startAbility(this.makeWant(request)).then(() => {
-        this.resolves.set(this.id, resolve);
-        setTimeout(() => {
-          let response = new Base.BaseResp()
-          response.errCode = ErrorCode.TIMEOUT
-          response.errMsg = 'timeout'
-          resolve(response)
-          this.resolves.delete(id)
-        }, 5000)
-      }).catch((err: BusinessError) => {
-        Log.Logw.e(kTag, 'sendReq fail by err:%s', JSON.stringify(err))
-        let response = new BaseResponse()
-        response.errCode = ErrorCode.REQUEST_FAILED
-        response.errMsg = err.message
-        resolve(response)
-        this.resolves.delete(id)
-      });
-    });
-  }
-  */
-
-}
-

+ 0 - 34
entry/oh_modules/@tencent/wechat_open_sdk/src/main/module.json

@@ -1,34 +0,0 @@
-{
-	"app": {
-		"bundleName": "com.tencent.wechat_openapi_ohos_sdk_demo",
-		"debug": true,
-		"versionCode": 1000000,
-		"versionName": "1.0.0",
-		"minAPIVersion": 50000012,
-		"targetAPIVersion": 50001013,
-		"apiReleaseType": "Canary1",
-		"compileSdkVersion": "5.0.1.68",
-		"compileSdkType": "HarmonyOS",
-		"appEnvironments": [],
-		"bundleType": "app"
-	},
-	"module": {
-		"name": "sdk",
-		"type": "har",
-		"deviceTypes": [
-			"default",
-			"tablet",
-			"2in1"
-		],
-		"requestPermissions": [
-			{
-				"name": "ohos.permission.INTERNET"
-			}
-		],
-		"packageName": "@tencent/wechat_open_sdk",
-		"installationFree": false,
-		"virtualMachine": "ark12.0.2.0",
-		"compileMode": "esmodule",
-		"dependencies": []
-	}
-}

+ 0 - 1
entry/oh_modules/libentry.so/Index.d.ts

@@ -1 +0,0 @@
-export const add: (a: number, b: number) => number;

+ 0 - 6
entry/oh_modules/libentry.so/oh-package.json5

@@ -1,6 +0,0 @@
-{
-  "name": "libentry.so",
-  "types": "./Index.d.ts",
-  "version": "1.0.0",
-  "description": "Please describe the basic information."
-}

+ 259 - 0
entry/src/main/ets/common/widget/PlayerControlService.ets

@@ -0,0 +1,259 @@
+import commonEventManager from '@ohos.commonEventManager';
+import Want from '@ohos.app.ability.Want';
+import common from '@ohos.app.ability.common';
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { WidgetData, WidgetCommand, EventData, RequestData, WidgetControlParams } from './WidgetTypes';
+
+const TAG = 'PlayerControlService';
+
+/**
+ * 播放器控制服务
+ * 负责与主应用的播放器进行通信和状态同步
+ */
+export class PlayerControlService {
+  private stateListeners: Array<(data: WidgetData) => void> = [];
+  private isListenerRegistered: boolean = false;
+
+  constructor() {
+    this.initializeEventListener();
+  }
+
+  /**
+   * 初始化事件监听器
+   */
+  private async initializeEventListener(): Promise<void> {
+    if (this.isListenerRegistered) {
+      return;
+    }
+
+    try {
+      // 监听播放状态变化事件
+      const subscribeInfo: commonEventManager.CommonEventSubscribeInfo = {
+        events: [
+          'com.ttmusic.player.state.changed',
+          'com.ttmusic.player.song.changed',
+          'com.ttmusic.player.progress.changed'
+        ]
+      };
+
+      const subscriber = await commonEventManager.createSubscriber(subscribeInfo);
+      
+      await commonEventManager.subscribe(subscriber, (err, data: commonEventManager.CommonEventData) => {
+        if (!err) {
+          this.handlePlayerStateChange(data);
+        }
+      });
+
+      this.isListenerRegistered = true;
+      hilog.info(0x0000, TAG, 'Event listener initialized successfully');
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to initialize event listener: ${error}`);
+    }
+  }
+
+  /**
+   * 发送控制命令到主应用
+   */
+  async sendControlCommand(command: WidgetCommand, params?: Object): Promise<boolean> {
+    try {
+      const eventData: EventData = {
+        command: command,
+        params: (params as WidgetControlParams) || ({} as WidgetControlParams),
+        timestamp: Date.now(),
+        source: 'widget'
+      };
+
+      // 发送CommonEvent到主应用
+      const publishInfo: commonEventManager.CommonEventPublishData = {
+        data: JSON.stringify(eventData)
+      };
+      await commonEventManager.publish('com.ttmusic.widget.control', publishInfo, (err) => {
+        if (err) {
+          hilog.error(0x0000, TAG, `Failed to publish event: ${err}`);
+        }
+      });
+
+      hilog.info(0x0000, TAG, `Control command sent: ${command}`);
+      return true;
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to send control command: ${error}`);
+      return false;
+    }
+  }
+
+  /**
+   * 获取当前播放状态
+   */
+  async getCurrentPlayState(): Promise<WidgetData> {
+    try {
+      // 请求当前状态
+      const requestData: RequestData = { timestamp: Date.now() };
+      const requestInfo: commonEventManager.CommonEventPublishData = {
+        data: JSON.stringify(requestData)
+      };
+      await commonEventManager.publish('com.ttmusic.widget.request.state', requestInfo, (err) => {
+        if (err) {
+          hilog.error(0x0000, TAG, `Failed to publish request state event: ${err}`);
+        }
+      });
+
+      // 返回默认状态,实际状态会通过事件监听器更新
+      return this.getDefaultWidgetData();
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to get current play state: ${error}`);
+      return this.getDefaultWidgetData();
+    }
+  }
+
+  /**
+   * 注册状态变化监听器
+   */
+  registerStateListener(callback: (data: WidgetData) => void): void {
+    this.stateListeners.push(callback);
+    hilog.info(0x0000, TAG, 'State listener registered');
+  }
+
+  /**
+   * 启动主应用
+   */
+  async launchMainApp(page?: string): Promise<boolean> {
+    try {
+      const want: Want = {
+        bundleName: 'com.ttmusic.app',
+        abilityName: 'EntryAbility',
+        parameters: {
+          page: page || 'main'
+        }
+      };
+
+      const context = getContext() as common.UIAbilityContext;
+      await context.startAbility(want);
+      
+      hilog.info(0x0000, TAG, `Main app launched with page: ${page}`);
+      return true;
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to launch main app: ${error}`);
+      return false;
+    }
+  }
+
+  /**
+   * 处理播放器状态变化
+   */
+  private handlePlayerStateChange(eventData: commonEventManager.CommonEventData): void {
+    try {
+      const data = JSON.parse(eventData.data || '{}') as Record<string, Object>;
+      const widgetData = this.convertToWidgetData(data);
+      
+      // 通知所有监听器
+      this.stateListeners.forEach(listener => {
+        try {
+          listener(widgetData);
+        } catch (error) {
+          hilog.error(0x0000, TAG, `Error in state listener: ${error}`);
+        }
+      });
+      
+      hilog.info(0x0000, TAG, 'Player state change handled');
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to handle player state change: ${error}`);
+    }
+  }
+
+  /**
+   * 转换播放器数据为卡片数据格式
+   */
+  private convertToWidgetData(playerData: Record<string, Object>): WidgetData {
+    return {
+      playState: {
+        isPlaying: (playerData['isPlaying'] as boolean) || false,
+        isPaused: (playerData['isPaused'] as boolean) || true,
+        isLoading: (playerData['isLoading'] as boolean) || false
+      },
+      currentSong: {
+        id: (playerData['songId'] as string) || '',
+        title: (playerData['title'] as string) || '暂无播放',
+        artist: (playerData['artist'] as string) || '未知艺术家',
+        album: (playerData['album'] as string) || '未知专辑',
+        coverImagePath: (playerData['coverPath'] as string) || '',
+        duration: (playerData['duration'] as number) || 0
+      },
+      progress: {
+        currentPosition: (playerData['currentPosition'] as number) || 0,
+        duration: (playerData['duration'] as number) || 0,
+        percentage: this.calculatePercentage((playerData['currentPosition'] as number) || 0, (playerData['duration'] as number) || 0),
+        currentTimeText: this.formatTime((playerData['currentPosition'] as number) || 0),
+        totalTimeText: this.formatTime((playerData['duration'] as number) || 0)
+      },
+      playlist: {
+        hasNext: (playerData['hasNext'] as boolean) || false,
+        hasPrevious: (playerData['hasPrevious'] as boolean) || false,
+        currentIndex: (playerData['currentIndex'] as number) || 0,
+        totalCount: (playerData['totalCount'] as number) || 0
+      },
+      config: {
+        size: (playerData['widgetSize'] as string) || 'medium',
+        theme: (playerData['theme'] as string) || 'auto',
+        showProgress: (playerData['showProgress'] as boolean) !== false,
+        showCover: (playerData['showCover'] as boolean) !== false
+      }
+    };
+  }
+
+  /**
+   * 获取默认卡片数据
+   */
+  private getDefaultWidgetData(): WidgetData {
+    return {
+      playState: {
+        isPlaying: false,
+        isPaused: true,
+        isLoading: false
+      },
+      currentSong: {
+        id: '',
+        title: '暂无播放',
+        artist: '未知艺术家',
+        album: '未知专辑',
+        coverImagePath: '',
+        duration: 0
+      },
+      progress: {
+        currentPosition: 0,
+        duration: 0,
+        percentage: 0,
+        currentTimeText: '00:00',
+        totalTimeText: '00:00'
+      },
+      playlist: {
+        hasNext: false,
+        hasPrevious: false,
+        currentIndex: 0,
+        totalCount: 0
+      },
+      config: {
+        size: 'medium',
+        theme: 'auto',
+        showProgress: true,
+        showCover: true
+      }
+    };
+  }
+
+  /**
+   * 计算播放进度百分比
+   */
+  private calculatePercentage(current: number, total: number): number {
+    if (total <= 0) return 0;
+    return Math.min(100, Math.max(0, (current / total) * 100));
+  }
+
+  /**
+   * 格式化时间显示
+   */
+  private formatTime(seconds: number): string {
+    const mins = Math.floor(seconds / 60);
+    const secs = Math.floor(seconds % 60);
+    return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
+  }
+}

+ 229 - 0
entry/src/main/ets/common/widget/WidgetDataManager.ets

@@ -0,0 +1,229 @@
+import formProvider from '@ohos.app.form.formProvider';
+import formBindingData from '@ohos.app.form.formBindingData';
+import preferences from '@ohos.data.preferences';
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { WidgetData, WidgetSize, WidgetTheme, FormattedWidgetData, PreferencesData } from './WidgetTypes';
+
+const TAG = 'WidgetDataManager';
+const WIDGET_PREFERENCES_NAME = 'widget_data_prefs';
+
+/**
+ * 卡片数据管理器
+ * 负责卡片数据的持久化存储和更新
+ */
+export class WidgetDataManager {
+  private preferencesStore: preferences.Preferences | null = null;
+
+  constructor() {
+    this.initPreferences();
+  }
+
+  /**
+   * 初始化数据存储
+   */
+  private async initPreferences(): Promise<void> {
+    try {
+      this.preferencesStore = await preferences.getPreferences(getContext(), WIDGET_PREFERENCES_NAME);
+      hilog.info(0x0000, TAG, 'Preferences initialized successfully');
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to initialize preferences: ${error}`);
+    }
+  }
+
+  /**
+   * 获取初始卡片数据
+   */
+  getInitialWidgetData(): WidgetData {
+    const initialData: WidgetData = {
+      playState: {
+        isPlaying: false,
+        isPaused: true,
+        isLoading: false
+      },
+      currentSong: {
+        id: '',
+        title: '暂无播放',
+        artist: '未知艺术家',
+        album: '未知专辑',
+        coverImagePath: '',
+        duration: 0
+      },
+      progress: {
+        currentPosition: 0,
+        duration: 0,
+        percentage: 0,
+        currentTimeText: '00:00',
+        totalTimeText: '00:00'
+      },
+      playlist: {
+        hasNext: false,
+        hasPrevious: false,
+        currentIndex: 0,
+        totalCount: 0
+      },
+      config: {
+        size: WidgetSize.MEDIUM,
+        theme: WidgetTheme.AUTO,
+        showProgress: true,
+        showCover: true
+      }
+    };
+    return initialData;
+  }
+
+  /**
+   * 保存卡片数据
+   */
+  async saveWidgetData(formId: string, data: WidgetData): Promise<void> {
+    try {
+      if (!this.preferencesStore) {
+        await this.initPreferences();
+      }
+      
+      const dataKey = `widget_${formId}`;
+      await this.preferencesStore?.put(dataKey, JSON.stringify(data));
+      await this.preferencesStore?.flush();
+      
+      hilog.info(0x0000, TAG, `Widget data saved for form: ${formId}`);
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to save widget data: ${error}`);
+    }
+  }
+
+  /**
+   * 获取卡片数据
+   */
+  async getWidgetData(formId: string): Promise<WidgetData> {
+    try {
+      if (!this.preferencesStore) {
+        await this.initPreferences();
+      }
+      
+      const dataKey = `widget_${formId}`;
+      const dataStr = await this.preferencesStore?.get(dataKey, '') as string;
+      
+      if (dataStr) {
+        return JSON.parse(dataStr) as WidgetData;
+      } else {
+        return this.getInitialWidgetData() as WidgetData;
+      }
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to get widget data: ${error}`);
+      return this.getInitialWidgetData() as WidgetData;
+    }
+  }
+
+  /**
+   * 更新卡片显示
+   */
+  async updateWidget(formId: string, data: WidgetData): Promise<void> {
+    try {
+      // 保存数据到本地存储
+      await this.saveWidgetData(formId, data);
+      
+      // 格式化数据用于卡片显示
+      const formattedData = this.formatDataForWidget(data);
+      
+      // 创建卡片绑定数据
+      const formData = formBindingData.createFormBindingData(formattedData);
+      
+      // 更新卡片
+      await formProvider.updateForm(formId, formData);
+      
+      hilog.info(0x0000, TAG, `Widget updated successfully: ${formId}`);
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to update widget: ${error}`);
+    }
+  }
+
+  /**
+   * 批量更新所有卡片
+   */
+  async updateAllWidgets(data?: WidgetData): Promise<void> {
+    try {
+      if (!this.preferencesStore) {
+        await this.initPreferences();
+      }
+      
+      // 获取所有卡片ID
+      const allKeys = await this.preferencesStore?.getAll();
+      const emptyPrefs: PreferencesData = {};
+      const widgetKeys = Object.keys(allKeys || emptyPrefs).filter(key => key.startsWith('widget_'));
+      
+      for (const key of widgetKeys) {
+        const formId = key.replace('widget_', '');
+        const widgetData = data || await this.getWidgetData(formId);
+        await this.updateWidget(formId, widgetData);
+      }
+      
+      hilog.info(0x0000, TAG, `Updated ${widgetKeys.length} widgets`);
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to update all widgets: ${error}`);
+    }
+  }
+
+  /**
+   * 删除卡片数据
+   */
+  async removeWidgetData(formId: string): Promise<void> {
+    try {
+      if (!this.preferencesStore) {
+        await this.initPreferences();
+      }
+      
+      const dataKey = `widget_${formId}`;
+      await this.preferencesStore?.delete(dataKey);
+      await this.preferencesStore?.flush();
+      
+      hilog.info(0x0000, TAG, `Widget data removed for form: ${formId}`);
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to remove widget data: ${error}`);
+    }
+  }
+
+  /**
+   * 格式化数据用于卡片显示
+   */
+  private formatDataForWidget(data: WidgetData): FormattedWidgetData {
+    const formattedData: FormattedWidgetData = {
+      // 播放状态
+      isPlaying: data.playState.isPlaying,
+      isPaused: data.playState.isPaused,
+      isLoading: data.playState.isLoading,
+      
+      // 歌曲信息
+      songTitle: this.truncateText(data.currentSong.title, 20),
+      songArtist: this.truncateText(data.currentSong.artist, 15),
+      songAlbum: this.truncateText(data.currentSong.album, 15),
+      coverImage: data.currentSong.coverImagePath || '',
+      
+      // 播放进度
+      currentTime: data.progress.currentTimeText,
+      totalTime: data.progress.totalTimeText,
+      progressPercentage: data.progress.percentage,
+      
+      // 控制按钮状态
+      hasNext: data.playlist.hasNext,
+      hasPrevious: data.playlist.hasPrevious,
+      
+      // 卡片配置
+      showProgress: data.config.showProgress,
+      showCover: data.config.showCover,
+      widgetSize: data.config.size as string,
+      
+      // 时间戳用于强制更新
+      timestamp: Date.now()
+    };
+    return formattedData;
+  }
+
+  /**
+   * 截断文本
+   */
+  private truncateText(text: string, maxLength: number): string {
+    if (text.length <= maxLength) {
+      return text;
+    }
+    return text.substring(0, maxLength - 1) + '…';
+  }
+}

+ 178 - 0
entry/src/main/ets/common/widget/WidgetTypes.ets

@@ -0,0 +1,178 @@
+/**
+ * 卡片相关的数据类型定义
+ */
+
+/**
+ * 卡片尺寸枚举
+ */
+export enum WidgetSize {
+  SMALL = 'small',    // 2x1
+  MEDIUM = 'medium',  // 4x2
+  LARGE = 'large'     // 4x3
+}
+
+/**
+ * 卡片主题枚举
+ */
+export enum WidgetTheme {
+  AUTO = 'auto',
+  LIGHT = 'light',
+  DARK = 'dark'
+}
+
+/**
+ * 播放控制命令枚举
+ */
+export enum WidgetCommand {
+  PLAY_PAUSE = 'PLAY_PAUSE',
+  NEXT_SONG = 'NEXT_SONG',
+  PREV_SONG = 'PREV_SONG',
+  SEEK_TO = 'SEEK_TO',
+  OPEN_APP = 'OPEN_APP',
+  OPEN_PLAYER = 'OPEN_PLAYER'
+}
+
+/**
+ * 播放状态接口
+ */
+export interface PlayState {
+  isPlaying: boolean;
+  isPaused: boolean;
+  isLoading: boolean;
+}
+
+/**
+ * 歌曲信息接口
+ */
+export interface SongInfo {
+  id: string;
+  title: string;
+  artist: string;
+  album: string;
+  coverImagePath: string;
+  duration: number;
+}
+
+/**
+ * 播放进度接口
+ */
+export interface PlayProgress {
+  currentPosition: number;
+  duration: number;
+  percentage: number;
+  currentTimeText: string;
+  totalTimeText: string;
+}
+
+/**
+ * 播放列表状态接口
+ */
+export interface PlaylistState {
+  hasNext: boolean;
+  hasPrevious: boolean;
+  currentIndex: number;
+  totalCount: number;
+}
+
+/**
+ * 卡片配置接口
+ */
+export interface WidgetConfig {
+  size: WidgetSize | string;
+  theme: WidgetTheme | string;
+  showProgress: boolean;
+  showCover: boolean;
+}
+
+/**
+ * 卡片数据接口
+ */
+export interface WidgetData {
+  playState: PlayState;
+  currentSong: SongInfo;
+  progress: PlayProgress;
+  playlist: PlaylistState;
+  config: WidgetConfig;
+}
+
+/**
+ * 卡片控制参数接口
+ */
+export interface WidgetControlParams {
+  position?: number;
+  songId?: string;
+  percentage?: number;
+}
+
+/**
+ * 卡片控制消息接口
+ */
+export interface WidgetControlMessage {
+  command: WidgetCommand;
+  params?: WidgetControlParams;
+}
+
+/**
+ * 卡片错误类型枚举
+ */
+export enum WidgetErrorType {
+  COMMUNICATION_ERROR = 'communication_error',
+  DATA_SYNC_ERROR = 'data_sync_error',
+  CONTROL_COMMAND_ERROR = 'control_command_error',
+  LAYOUT_ERROR = 'layout_error'
+}
+
+/**
+ * 卡片错误接口
+ */
+export interface WidgetError {
+  type: WidgetErrorType;
+  message: string;
+  code: number;
+  timestamp: number;
+}
+
+/**
+ * 事件数据接口
+ */
+export interface EventData {
+  command: WidgetCommand;
+  params: WidgetControlParams;
+  timestamp: number;
+  source: string;
+}
+
+/**
+ * 请求数据接口
+ */
+export interface RequestData {
+  timestamp: number;
+}
+
+/**
+ * 格式化后的卡片数据接口
+ */
+export interface FormattedWidgetData {
+  isPlaying: boolean;
+  isPaused: boolean;
+  isLoading: boolean;
+  songTitle: string;
+  songArtist: string;
+  songAlbum: string;
+  coverImage: string;
+  currentTime: string;
+  totalTime: string;
+  progressPercentage: number;
+  hasNext: boolean;
+  hasPrevious: boolean;
+  showProgress: boolean;
+  showCover: boolean;
+  widgetSize: string;
+  timestamp: number;
+}
+
+/**
+ * 偏好设置数据接口
+ */
+export class PreferencesData {
+}

+ 179 - 0
entry/src/main/ets/entryformability/PlayerWidgetFormExtensionAbility.ets

@@ -0,0 +1,179 @@
+import formBindingData from '@ohos.app.form.formBindingData';
+import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility';
+import formProvider from '@ohos.app.form.formProvider';
+import Want from '@ohos.app.ability.Want';
+import { hilog } from '@kit.PerformanceAnalysisKit';
+import { WidgetDataManager } from '../common/widget/WidgetDataManager';
+import { PlayerControlService } from '../common/widget/PlayerControlService';
+import { WidgetCommand, WidgetControlParams } from '../common/widget/WidgetTypes';
+
+const TAG = 'PlayerWidgetFormExtensionAbility';
+
+/**
+ * 桌面播放器卡片扩展能力
+ * 负责处理卡片的生命周期管理和用户交互事件
+ */
+export default class PlayerWidgetFormExtensionAbility extends FormExtensionAbility {
+  private widgetDataManager: WidgetDataManager = new WidgetDataManager();
+  private playerControlService: PlayerControlService = new PlayerControlService();
+
+  /**
+   * 卡片创建时调用
+   */
+  onAddForm(want: Want): formBindingData.FormBindingData {
+    hilog.info(0x0000, TAG, 'onAddForm called');
+    
+    const formId = want.parameters?.['ohos.extra.param.key.form_identity'] as string;
+    const formName = want.parameters?.['ohos.extra.param.key.form_name'] as string;
+    const tempFlag = want.parameters?.['ohos.extra.param.key.form_temporary'] as boolean;
+    
+    hilog.info(0x0000, TAG, `Form added: ${formId}, name: ${formName}, temp: ${tempFlag}`);
+    
+    // 初始化卡片数据
+    this.initializeWidget(formId);
+    
+    // 获取初始数据
+    const initialData = this.widgetDataManager.getInitialWidgetData();
+    
+    return formBindingData.createFormBindingData(initialData);
+  }
+
+  /**
+   * 卡片更新时调用
+   */
+  onUpdateForm(formId: string): void {
+    hilog.info(0x0000, TAG, `onUpdateForm called: ${formId}`);
+    
+    // 获取最新的播放状态数据
+    this.updateWidgetData(formId);
+  }
+
+  /**
+   * 卡片删除时调用
+   */
+  onRemoveForm(formId: string): void {
+    hilog.info(0x0000, TAG, `onRemoveForm called: ${formId}`);
+    
+    // 清理卡片相关数据
+    this.widgetDataManager.removeWidgetData(formId);
+  }
+
+  /**
+   * 卡片可见性变化时调用
+   */
+  onVisibilityChange(newStatus: Record<string, number>): void {
+    hilog.info(0x0000, TAG, 'onVisibilityChange called');
+    
+    const formIds = Object.keys(newStatus);
+    for (let i = 0; i < formIds.length; i++) {
+      const formId = formIds[i];
+      const isVisible = newStatus[formId] === 1;
+      hilog.info(0x0000, TAG, `Form ${formId} visibility: ${isVisible}`);
+      
+      if (isVisible) {
+        // 卡片变为可见时,更新数据
+        this.updateWidgetData(formId);
+      }
+    }
+  }
+
+  /**
+   * 处理卡片事件(用户交互)
+   */
+  onFormEvent(formId: string, message: string): void {
+    hilog.info(0x0000, TAG, `onFormEvent called: ${formId}, message: ${message}`);
+    
+    try {
+      const eventData = JSON.parse(message) as Record<string, Object>;
+      this.handleWidgetEvent(formId, eventData);
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to parse form event: ${error}`);
+    }
+  }
+
+  /**
+   * 卡片配置更新时调用
+   */
+  onConfigurationUpdate(newConfig: Object): void {
+    hilog.info(0x0000, TAG, 'onConfigurationUpdate called');
+    
+    // 更新所有卡片以适应新配置
+    this.widgetDataManager.updateAllWidgets();
+  }
+
+  /**
+   * 初始化卡片
+   */
+  private async initializeWidget(formId: string): Promise<void> {
+    try {
+      // 注册播放状态监听
+      this.playerControlService.registerStateListener((data) => {
+        this.widgetDataManager.updateWidget(formId, data);
+      });
+      
+      // 获取当前播放状态
+      const currentState = await this.playerControlService.getCurrentPlayState();
+      await this.widgetDataManager.saveWidgetData(formId, currentState);
+      
+      hilog.info(0x0000, TAG, `Widget ${formId} initialized successfully`);
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to initialize widget ${formId}: ${error}`);
+    }
+  }
+
+  /**
+   * 更新卡片数据
+   */
+  private async updateWidgetData(formId: string): Promise<void> {
+    try {
+      const currentState = await this.playerControlService.getCurrentPlayState();
+      await this.widgetDataManager.updateWidget(formId, currentState);
+      
+      hilog.info(0x0000, TAG, `Widget ${formId} updated successfully`);
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to update widget ${formId}: ${error}`);
+    }
+  }
+
+  /**
+   * 处理卡片事件
+   */
+  private async handleWidgetEvent(formId: string, eventData: Record<string, Object>): Promise<void> {
+    const action = eventData['action'] as string;
+    const params = eventData['params'] as Record<string, Object>;
+    
+    try {
+      switch (action) {
+        case 'play_pause':
+          await this.playerControlService.sendControlCommand(WidgetCommand.PLAY_PAUSE);
+          break;
+        case 'next_song':
+          await this.playerControlService.sendControlCommand(WidgetCommand.NEXT_SONG);
+          break;
+        case 'prev_song':
+          await this.playerControlService.sendControlCommand(WidgetCommand.PREV_SONG);
+          break;
+        case 'seek_to':
+          const seekParams: WidgetControlParams = { position: params?.['position'] as number };
+          await this.playerControlService.sendControlCommand(WidgetCommand.SEEK_TO, seekParams);
+          break;
+        case 'open_app':
+          await this.playerControlService.sendControlCommand(WidgetCommand.OPEN_APP);
+          break;
+        case 'open_player':
+          await this.playerControlService.sendControlCommand(WidgetCommand.OPEN_PLAYER);
+          break;
+        default:
+          hilog.warn(0x0000, TAG, `Unknown widget action: ${action}`);
+      }
+      
+      // 处理完命令后更新卡片状态
+      setTimeout(() => {
+        this.updateWidgetData(formId);
+      }, 100);
+      
+    } catch (error) {
+      hilog.error(0x0000, TAG, `Failed to handle widget event: ${error}`);
+    }
+  }
+}

+ 209 - 0
entry/src/main/ets/widget/pages/PlayerWidgetLarge.ets

@@ -0,0 +1,209 @@
+/**
+ * 大尺寸播放器卡片 (4x3)
+ * 显示专辑封面、完整信息和扩展控制
+ */
+@Entry
+@Component
+struct PlayerWidgetLarge {
+  @LocalStorageProp('isPlaying') isPlaying: boolean = false;
+  @LocalStorageProp('songTitle') songTitle: string = '暂无播放';
+  @LocalStorageProp('songArtist') songArtist: string = '未知艺术家';
+  @LocalStorageProp('songAlbum') songAlbum: string = '未知专辑';
+  @LocalStorageProp('coverImage') coverImage: string = '';
+  @LocalStorageProp('currentTime') currentTime: string = '00:00';
+  @LocalStorageProp('totalTime') totalTime: string = '00:00';
+  @LocalStorageProp('progressPercentage') progressPercentage: number = 0;
+  @LocalStorageProp('hasNext') hasNext: boolean = false;
+  @LocalStorageProp('hasPrevious') hasPrevious: boolean = false;
+  @LocalStorageProp('showProgress') showProgress: boolean = true;
+  @LocalStorageProp('showCover') showCover: boolean = true;
+
+  build() {
+    Column() {
+      // 顶部信息区域
+      Row() {
+        // 专辑封面
+        if (this.showCover) {
+          Image(this.coverImage || $r('app.media.bg_music'))
+            .width(60)
+            .height(60)
+            .borderRadius(8)
+            .objectFit(ImageFit.Cover)
+            .margin({ right: 12 })
+            .onClick(() => {
+              this.handleControlAction('open_player');
+            })
+        }
+
+        // 歌曲信息
+        Column() {
+          Text(this.songTitle)
+            .fontSize(16)
+            .fontColor('#E6000000')
+            .fontWeight(FontWeight.Medium)
+            .maxLines(1)
+            .textOverflow({ overflow: TextOverflow.Ellipsis })
+            .width('100%')
+            .textAlign(TextAlign.Start)
+
+          Text(this.songArtist)
+            .fontSize(13)
+            .fontColor('#99000000')
+            .fontWeight(FontWeight.Normal)
+            .maxLines(1)
+            .textOverflow({ overflow: TextOverflow.Ellipsis })
+            .width('100%')
+            .textAlign(TextAlign.Start)
+            .margin({ top: 4 })
+
+          Text(this.songAlbum)
+            .fontSize(11)
+            .fontColor('#66000000')
+            .fontWeight(FontWeight.Normal)
+            .maxLines(1)
+            .textOverflow({ overflow: TextOverflow.Ellipsis })
+            .width('100%')
+            .textAlign(TextAlign.Start)
+            .margin({ top: 2 })
+        }
+        .layoutWeight(1)
+        .alignItems(HorizontalAlign.Start)
+        .justifyContent(FlexAlign.Start)
+        .onClick(() => {
+          this.handleControlAction('open_player');
+        })
+      }
+      .width('100%')
+      .alignItems(VerticalAlign.Top)
+      .margin({ bottom: 16 })
+
+      // 播放进度区域
+      if (this.showProgress) {
+        Column() {
+          // 进度条
+          Row() {
+            Progress({
+              value: this.progressPercentage,
+              total: 100,
+              type: ProgressType.Linear
+            })
+              .width('100%')
+              .height(4)
+              .color('#FF007DFF')
+              .backgroundColor('#1A007DFF')
+              .onClick((event) => {
+                this.handleProgressClick(event);
+              })
+          }
+          .width('100%')
+          .margin({ bottom: 6 })
+
+          // 时间显示
+          Row() {
+            Text(this.currentTime)
+              .fontSize(11)
+              .fontColor('#99000000')
+
+            Blank()
+
+            Text(this.totalTime)
+              .fontSize(11)
+              .fontColor('#99000000')
+          }
+          .width('100%')
+        }
+        .width('100%')
+        .margin({ bottom: 16 })
+      }
+
+      // 播放控制区域
+      Row() {
+        // 上一首按钮
+        Button() {
+          Image($r('app.media.ic_previous2'))
+            .width(20)
+            .height(20)
+            .fillColor(this.hasPrevious ? '#FF007DFF' : '#66000000')
+        }
+        .width(40)
+        .height(40)
+        .backgroundColor(Color.Transparent)
+        .enabled(this.hasPrevious)
+        .onClick(() => {
+          this.handleControlAction('prev_song');
+        })
+
+        Blank()
+
+        // 播放/暂停按钮
+        Button() {
+          Image(this.isPlaying ? $r('app.media.hm_pause') : $r('app.media.hm_play'))
+            .width(28)
+            .height(28)
+            .fillColor('#FFFFFF')
+        }
+        .width(52)
+        .height(52)
+        .backgroundColor('#FF007DFF')
+        .borderRadius(26)
+        .onClick(() => {
+          this.handleControlAction('play_pause');
+        })
+
+        Blank()
+
+        // 下一首按钮
+        Button() {
+          Image($r('app.media.ic_next2'))
+            .width(20)
+            .height(20)
+            .fillColor(this.hasNext ? '#FF007DFF' : '#66000000')
+        }
+        .width(40)
+        .height(40)
+        .backgroundColor(Color.Transparent)
+        .enabled(this.hasNext)
+        .onClick(() => {
+          this.handleControlAction('next_song');
+        })
+      }
+      .width('100%')
+      .justifyContent(FlexAlign.SpaceBetween)
+      .alignItems(VerticalAlign.Center)
+    }
+    .width('100%')
+    .height('100%')
+    .padding(16)
+    .backgroundColor('#FFFFFF')
+    .borderRadius(12)
+    .alignItems(HorizontalAlign.Start)
+    .justifyContent(FlexAlign.SpaceBetween)
+  }
+
+  /**
+   * 处理控制操作
+   */
+  private handleControlAction(action: string): void {
+    postCardAction(this, {
+      action: action,
+      params: {}
+    });
+  }
+
+  /**
+   * 处理进度条点击
+   */
+  private handleProgressClick(event: ClickEvent): void {
+    // 计算点击位置对应的播放进度
+    const clickX = event.x;
+    const progressWidth = event.target.area.width as number;
+    const percentage = (clickX / progressWidth) * 100;
+    
+    postCardAction(this, {
+      action: 'seek_to',
+      params: {
+        percentage: percentage
+      }
+    });
+  }
+}

+ 176 - 0
entry/src/main/ets/widget/pages/PlayerWidgetMedium.ets

@@ -0,0 +1,176 @@
+/**
+ * 中等尺寸播放器卡片 (4x2)
+ * 显示完整信息、播放控制和进度条
+ */
+@Entry
+@Component
+struct PlayerWidgetMedium {
+  @LocalStorageProp('isPlaying') isPlaying: boolean = false;
+  @LocalStorageProp('songTitle') songTitle: string = '暂无播放';
+  @LocalStorageProp('songArtist') songArtist: string = '未知艺术家';
+  @LocalStorageProp('currentTime') currentTime: string = '00:00';
+  @LocalStorageProp('totalTime') totalTime: string = '00:00';
+  @LocalStorageProp('progressPercentage') progressPercentage: number = 0;
+  @LocalStorageProp('hasNext') hasNext: boolean = false;
+  @LocalStorageProp('hasPrevious') hasPrevious: boolean = false;
+  @LocalStorageProp('showProgress') showProgress: boolean = true;
+
+  build() {
+    Column() {
+      // 歌曲信息区域
+      Row() {
+        Column() {
+          Text(this.songTitle)
+            .fontSize(16)
+            .fontColor('#E6000000')
+            .fontWeight(FontWeight.Medium)
+            .maxLines(1)
+            .textOverflow({ overflow: TextOverflow.Ellipsis })
+            .width('100%')
+            .textAlign(TextAlign.Start)
+
+          Text(this.songArtist)
+            .fontSize(12)
+            .fontColor('#99000000')
+            .fontWeight(FontWeight.Normal)
+            .maxLines(1)
+            .textOverflow({ overflow: TextOverflow.Ellipsis })
+            .width('100%')
+            .textAlign(TextAlign.Start)
+            .margin({ top: 2 })
+        }
+        .layoutWeight(1)
+        .alignItems(HorizontalAlign.Start)
+        .onClick(() => {
+          this.handleControlAction('open_player');
+        })
+      }
+      .width('100%')
+      .margin({ bottom: 12 })
+
+      // 播放控制区域
+      Row() {
+        // 上一首按钮
+        Button() {
+          Image($r('app.media.ic_previous2'))
+            .width(18)
+            .height(18)
+            .fillColor(this.hasPrevious ? '#FF007DFF' : '#66000000')
+        }
+        .width(36)
+        .height(36)
+        .backgroundColor(Color.Transparent)
+        .enabled(this.hasPrevious)
+        .onClick(() => {
+          this.handleControlAction('prev_song');
+        })
+
+        // 播放/暂停按钮
+        Button() {
+          Image(this.isPlaying ? $r('app.media.hm_pause') : $r('app.media.hm_play'))
+            .width(24)
+            .height(24)
+            .fillColor('#FFFFFF')
+        }
+        .width(44)
+        .height(44)
+        .backgroundColor('#FF007DFF')
+        .borderRadius(22)
+        .margin({ left: 12, right: 12 })
+        .onClick(() => {
+          this.handleControlAction('play_pause');
+        })
+
+        // 下一首按钮
+        Button() {
+          Image($r('app.media.ic_next2'))
+            .width(18)
+            .height(18)
+            .fillColor(this.hasNext ? '#FF007DFF' : '#66000000')
+        }
+        .width(36)
+        .height(36)
+        .backgroundColor(Color.Transparent)
+        .enabled(this.hasNext)
+        .onClick(() => {
+          this.handleControlAction('next_song');
+        })
+      }
+      .justifyContent(FlexAlign.Center)
+      .width('100%')
+      .margin({ bottom: this.showProgress ? 8 : 0 })
+
+      // 播放进度区域
+      if (this.showProgress) {
+        Column() {
+          // 进度条
+          Row() {
+            Progress({
+              value: this.progressPercentage,
+              total: 100,
+              type: ProgressType.Linear
+            })
+              .width('100%')
+              .height(4)
+              .color('#FF007DFF')
+              .backgroundColor('#1A007DFF')
+              .onClick((event) => {
+                this.handleProgressClick(event);
+              })
+          }
+          .width('100%')
+          .margin({ bottom: 4 })
+
+          // 时间显示
+          Row() {
+            Text(this.currentTime)
+              .fontSize(10)
+              .fontColor('#99000000')
+
+            Blank()
+
+            Text(this.totalTime)
+              .fontSize(10)
+              .fontColor('#99000000')
+          }
+          .width('100%')
+        }
+        .width('100%')
+      }
+    }
+    .width('100%')
+    .height('100%')
+    .padding(16)
+    .backgroundColor('#FFFFFF')
+    .borderRadius(12)
+    .alignItems(HorizontalAlign.Start)
+    .justifyContent(FlexAlign.SpaceBetween)
+  }
+
+  /**
+   * 处理控制操作
+   */
+  private handleControlAction(action: string): void {
+    postCardAction(this, {
+      action: action,
+      params: {}
+    });
+  }
+
+  /**
+   * 处理进度条点击
+   */
+  private handleProgressClick(event: ClickEvent): void {
+    // 计算点击位置对应的播放进度
+    const clickX = event.x;
+    const progressWidth = event.target.area.width as number;
+    const percentage = (clickX / progressWidth) * 100;
+    
+    postCardAction(this, {
+      action: 'seek_to',
+      params: {
+        percentage: percentage
+      }
+    });
+  }
+}

+ 103 - 0
entry/src/main/ets/widget/pages/PlayerWidgetSmall.ets

@@ -0,0 +1,103 @@
+/**
+ * 小尺寸播放器卡片 (2x1)
+ * 显示基本播放控制和歌曲名称
+ */
+@Entry
+@Component
+struct PlayerWidgetSmall {
+  @LocalStorageProp('isPlaying') isPlaying: boolean = false;
+  @LocalStorageProp('songTitle') songTitle: string = '暂无播放';
+  @LocalStorageProp('hasNext') hasNext: boolean = false;
+  @LocalStorageProp('hasPrevious') hasPrevious: boolean = false;
+
+  build() {
+    Row() {
+      // 播放控制按钮区域
+      Row() {
+        // 上一首按钮
+        Button() {
+          Image($r('app.media.ic_previous2'))
+            .width(16)
+            .height(16)
+            .fillColor(this.hasPrevious ? '#FF007DFF' : '#66000000')
+        }
+        .width(32)
+        .height(32)
+        .backgroundColor(Color.Transparent)
+        .enabled(this.hasPrevious)
+        .onClick(() => {
+          this.handleControlAction('prev_song');
+        })
+
+        // 播放/暂停按钮
+        Button() {
+          Image(this.isPlaying ? $r('app.media.hm_pause') : $r('app.media.hm_play'))
+            .width(20)
+            .height(20)
+            .fillColor('#FF007DFF')
+        }
+        .width(36)
+        .height(36)
+        .backgroundColor('#1A007DFF')
+        .borderRadius(18)
+        .margin({ left: 8, right: 8 })
+        .onClick(() => {
+          this.handleControlAction('play_pause');
+        })
+
+        // 下一首按钮
+        Button() {
+          Image($r('app.media.ic_next2'))
+            .width(16)
+            .height(16)
+            .fillColor(this.hasNext ? '#FF007DFF' : '#66000000')
+        }
+        .width(32)
+        .height(32)
+        .backgroundColor(Color.Transparent)
+        .enabled(this.hasNext)
+        .onClick(() => {
+          this.handleControlAction('next_song');
+        })
+      }
+      .justifyContent(FlexAlign.Center)
+      .alignItems(VerticalAlign.Center)
+
+      // 歌曲信息区域
+      Column() {
+        Text(this.songTitle)
+          .fontSize(14)
+          .fontColor('#E6000000')
+          .fontWeight(FontWeight.Medium)
+          .maxLines(1)
+          .textOverflow({ overflow: TextOverflow.Ellipsis })
+          .width('100%')
+          .textAlign(TextAlign.Start)
+      }
+      .layoutWeight(1)
+      .margin({ left: 12 })
+      .alignItems(HorizontalAlign.Start)
+      .justifyContent(FlexAlign.Center)
+      .onClick(() => {
+        this.handleControlAction('open_player');
+      })
+    }
+    .width('100%')
+    .height('100%')
+    .padding({ left: 16, right: 16, top: 8, bottom: 8 })
+    .backgroundColor('#FFFFFF')
+    .borderRadius(12)
+    .justifyContent(FlexAlign.Start)
+    .alignItems(VerticalAlign.Center)
+  }
+
+  /**
+   * 处理控制操作
+   */
+  private handleControlAction(action: string): void {
+    postCardAction(this, {
+      action: action,
+      params: {}
+    });
+  }
+}

+ 15 - 0
entry/src/main/module.json5

@@ -138,6 +138,21 @@
 
     ],
 
+    "extensionAbilities": [
+      {
+        "name": "PlayerWidgetFormExtensionAbility",
+        "srcEntry": "./ets/entryformability/PlayerWidgetFormExtensionAbility.ets",
+        "label": "$string:form_PlayerWidgetFormExtensionAbility_label",
+        "description": "$string:form_PlayerWidgetFormExtensionAbility_desc",
+        "type": "form",
+        "metadata": [
+          {
+            "name": "ohos.extension.form",
+            "resource": "$profile:form_config"
+          }
+        ]
+      }
+    ],
 
     "requestPermissions": [
       {

+ 8 - 0
entry/src/main/resources/base/element/string.json

@@ -435,6 +435,14 @@
     {
       "name": "onekey_cover",
       "value": "一键获取封面"
+    },
+    {
+      "name": "form_PlayerWidgetFormExtensionAbility_label",
+      "value": "播放器卡片"
+    },
+    {
+      "name": "form_PlayerWidgetFormExtensionAbility_desc",
+      "value": "天天静听桌面播放器卡片"
     }
   ]
 }

+ 61 - 0
entry/src/main/resources/base/profile/form_config.json

@@ -0,0 +1,61 @@
+{
+  "forms": [
+    {
+      "name": "PlayerWidgetSmall",
+      "description": "小尺寸播放器卡片",
+      "src": "./ets/widget/pages/PlayerWidgetSmall.ets",
+      "uiSyntax": "arkts",
+      "window": {
+        "designWidth": 720,
+        "autoDesignWidth": true
+      },
+      "colorMode": "auto",
+      "isDefault": true,
+      "updateEnabled": true,
+      "scheduledUpdateTime": "10:30",
+      "updateDuration": 1,
+      "defaultDimension": "1*2",
+      "supportDimensions": [
+        "1*2"
+      ]
+    },
+    {
+      "name": "PlayerWidgetMedium",
+      "description": "中等尺寸播放器卡片",
+      "src": "./ets/widget/pages/PlayerWidgetMedium.ets",
+      "uiSyntax": "arkts",
+      "window": {
+        "designWidth": 720,
+        "autoDesignWidth": true
+      },
+      "colorMode": "auto",
+      "isDefault": false,
+      "updateEnabled": true,
+      "scheduledUpdateTime": "10:30",
+      "updateDuration": 1,
+      "defaultDimension": "2*4",
+      "supportDimensions": [
+        "2*4"
+      ]
+    },
+    {
+      "name": "PlayerWidgetLarge",
+      "description": "大尺寸播放器卡片",
+      "src": "./ets/widget/pages/PlayerWidgetLarge.ets",
+      "uiSyntax": "arkts",
+      "window": {
+        "designWidth": 720,
+        "autoDesignWidth": true
+      },
+      "colorMode": "auto",
+      "isDefault": false,
+      "updateEnabled": true,
+      "scheduledUpdateTime": "10:30",
+      "updateDuration": 1,
+      "defaultDimension": "4*4",
+      "supportDimensions": [
+        "4*4"
+      ]
+    }
+  ]
+}

+ 0 - 48
ijkplayer/oh_modules/@types/libijkplayer_audio_napi.so/index.d.ts

@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2024 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-export declare class newIjkPlayerAudio {
-  public Id: string;
-  public isVideo: boolean;
-  constructor(Id: string, isVideo: boolean);
-  _native_setup_audio(xcomponentId: string): void;
-  _nativeOpenlog(xcomponentId: string): void;
-  _setDataSource(xcomponentId: string, url:string): void;
-  _setOption(xcomponentId: string, category:string,key:string,value:string): void;
-  _setOptionLong(xcomponentId: string, category:string,key:string,value:string): void;
-  _prepareAsync(xcomponentId: string): void;
-  _start(xcomponentId: string): void;
-  _stop(xcomponentId: string): void;
-  _pause(xcomponentId: string): void;
-  _reset(xcomponentId: string): void;
-  _release(xcomponentId: string): void;
-  _seekTo(xcomponentId: string, msec:string): void;
-  _isPlaying(xcomponentId: string): boolean;
-  _getDuration(xcomponentId: string): number;
-  _setMessageListener(xcomponentId: string, messageCallBack:Function): void;
-  _getCurrentPosition(xcomponentId: string): number;
-  _getAudioSessionId(xcomponentId: string): number;
-  _setPropertyFloat(xcomponentId: string, property: string, value: string): void;
-  _getPropertyFloat(xcomponentId: string, property: string, value: string): number;
-  _setPropertyLong(xcomponentId: string, property: string, value: string): void;
-  _getPropertyLong(xcomponentId: string, property: string, value: string): number;
-  _setVolume(xcomponentId: string, leftVolume: string, rightVolume: string): void;
-  _setLoopCount(xcomponentId: string, loopCount: string): void;
-  _getLoopCount(xcomponentId: string): number;
-  _setStreamSelected(xcomponentId: string, stream: string, select: string): void;
-  _getVideoCodecInfo(xcomponentId: string): string;
-  _getAudioCodecInfo(xcomponentId: string): string;
-  _getMediaMeta(xcomponentId: string): string;
-  _native_setup(xcomponentId: string): void;
-}

+ 0 - 6
ijkplayer/oh_modules/@types/libijkplayer_audio_napi.so/oh-package.json5

@@ -1,6 +0,0 @@
-{
-  "name": "@types/libijkplayer_audio_napi.so",
-  "types": "./index.d.ts",
-  "version": "2.0.3-rc.3",
-  "description": "A Ijkplayer implementation in C"
-}

+ 1 - 2
oh-package-lock.json5

@@ -1,7 +1,6 @@
 {
   "meta": {
-    "stableOrder": true,
-    "enableUnifiedLockfile": false
+    "stableOrder": true
   },
   "lockfileVersion": 3,
   "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",

+ 0 - 14
oh_modules/.ohpm/@alipay+blueshieldsdk@cow+0gass5tzqhymzjby2f6sd+g2xtoatqsiyvi9qsy=/oh_modules/libblueshield.so/index.d.ts

@@ -1,14 +0,0 @@
-export interface RegisterReflectionFuncModel {
-    name: string;
-    func: Function;
-}
-export const setAppContext: (ctx: Object) => boolean;
-export const initBlueShieldManger: (authName?: string, extConfig?: Map<string, string>) => number;
-export const ScpInvokeNative: (proto: number, ...args: Object[]) => Object;
-export const nativeRegisterReflectionFunc: (funcList: RegisterReflectionFuncModel[]) => number;
-export const registerRpcInterceptor: () => number;
-export const notifyValidateResult: (validateResult: number) => number;
-export const ScpGetConfig: (configKey: string, defaultValue: string) => string;
-export const ScpMdapEvent: (bizType: string, eventId: string, param1: string, param2: string, param3: string, param4: string) => number;
-export const ScpLoggerWrite: (tag: string, level: number, fmt: string, msg: string) => number;
-export const ScpSendEventNative: (protocol: string, properties: string, external: Uint8Array, timeout: number) => string;

+ 0 - 6
oh_modules/.ohpm/@alipay+blueshieldsdk@cow+0gass5tzqhymzjby2f6sd+g2xtoatqsiyvi9qsy=/oh_modules/libblueshield.so/oh-package.json5

@@ -1,6 +0,0 @@
-{
-  "name": "libblueshield.so",
-  "types": "./index.d.ts",
-  "version": "1.0.8",
-  "description": "Please describe the basic information."
-}

+ 0 - 24
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/BuildProfile.d.ets

@@ -1,24 +0,0 @@
-// @keepTs
-// @ts-nocheck
-/**
- * Use these variables when you tailor your ArkTS code. They must be of the const type.
- */
-export declare const HAR_VERSION = "1.0.29";
-export declare const BUILD_MODE_NAME = "release";
-export declare const DEBUG = false;
-export declare const TARGET_NAME = "default";
-export declare const USE_ANT_NETWORK_LIB = false;
-export declare const NOT_EMBED_EDGE = true;
-export declare const HAR_NAME = "blueshieldsdk";
-/**
- * BuildProfile Class is used only for compatibility purposes.
- */
-export default class BuildProfile {
-    static readonly HAR_VERSION = "1.0.29";
-    static readonly BUILD_MODE_NAME = "release";
-    static readonly DEBUG = false;
-    static readonly TARGET_NAME = "default";
-    static readonly USE_ANT_NETWORK_LIB = false;
-    static readonly NOT_EMBED_EDGE = true;
-    static readonly HAR_NAME = "blueshieldsdk";
-}

+ 0 - 22
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/Index.d.ets

@@ -1,22 +0,0 @@
-// @keepTs
-// @ts-nocheck
-export { BlueShieldManager, BlueShieldModuleType } from './src/main/ets/components/BlueShieldManager';
-export { IStaticStoreModule } from './src/main/ets/components/trustedterminal/IStaticStoreModule';
-export { IStaticCryptoModule, BS_STAIC_CRYPTO_MODE } from './src/main/ets/components/trustedterminal/IStaticCryptoModule';
-export { IDynamicCryptoModule } from './src/main/ets/components/trustedterminal/IDynamicCryptoModule';
-export { IEnvelopeCryptoModule, BS_ENVELOPE_CRYPTO_MASTER_ALGO, BS_ENVELOPE_CRYPTO_SESSION_ALGO, EnvelopeCryptoParams, EnvelopeCryptoResult } from './src/main/ets/components/trustedterminal/IEnvelopeCryptoModule';
-export { ISafeOtpModule, BS_SAFE_OTP_ALGO } from './src/main/ets/components/trustedterminal/ISafeOtpModule';
-export { ISafeSignatureModule, BS_SAFE_SIGNATURE_ALGO } from './src/main/ets/components/trustedterminal/ISafeSignatureModule';
-export { IDeviceFeatureModule } from './src/main/ets/components/trustedterminal/IDeviceFeatureModule';
-export { ITrustedSignatureModule, BS_TRUSTED_SIGN_TYPE, BS_TRUSTED_SIGN_ENV, BS_TRUSTED_SIGN_RESULT, BS_TRUSTED_SIGN_PARAM_KEY } from './src/main/ets/components/trustedterminal/ITrustedSignatureModule';
-export { ISafeTokenModule } from './src/main/ets/components/trustedterminal/ISafeTokenModule';
-export { IAPDIDModule, TokenResult, APDIDParamKey } from './src/main/ets/components/apdid/IAPDIDModule';
-export { IRDSModule, IRDSEngine, RDSEvent, RDSParamKey } from './src/main/ets/components/secflow/IRDSModule';
-export { IDeviceColorModule, DEVICE_COLOR_CONSTANTS } from './src/main/ets/components/secflow/IDeviceColorModule';
-export { ICaptchaVerifyModule, CaptchaVerifyCallback, CAPTCHA_CODE, CAPTCHA_PARAM, CAPTCHA_TYPE } from './src/main/ets/components/secflow/captcha/ICaptchaVerifyModule';
-export { IEdgeRiskModule, EdgeRiskUAMode } from './src/main/ets/components/edge/IEdgeRiskModule';
-export { StxManager, StxModuleType } from './src/main/ets/components/stx/StxManager';
-export { IStxCirculateModule } from './src/main/ets/components/stx/module/IStxCirculateModule';
-export { EdgeEvent } from './src/main/ets/components/edge/event/model/EdgeEvent';
-export { EventEnum, EventKey, EventError } from './src/main/ets/components/edge/event/model/EdgeEventConstant';
-export { ITrustedEngineModule, ITrustedEngine, } from './src/main/ets/components/trustedterminal/ITrustedEngineModule';

+ 0 - 75
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/ResourceTable.txt

@@ -1,75 +0,0 @@
-string EntryAbility_desc 0x0100000c
-string EntryAbility_label 0x0100000d
-string agree 0x0100000e
-string alipay_privacy_policy 0x0100000f
-string cancel 0x01000010
-string choose_country_or_region 0x01000011
-string choose_country_or_region_search 0x01000012
-string choose_country_or_region_shortcut 0x01000013
-string disagree 0x01000014
-string module_desc 0x01000015
-string ok 0x01000016
-string page_show 0x01000000
-string service_agreement_and_privacy_protection 0x01000017
-string shared_desc 0x01000007
-string system_error_try_later 0x01000018
-string to_best_protect_your_legal_rights_please_read_and_agree_to_the 0x01000019
-color start_window_background 0x0100001a
-color white 0x01000008
-media alipay_slogan_background 0x0100001b
-media alipay_slogan_background1 0x0100001c
-media alipay_slogan_black 0x0100001d
-media alipay_slogan_white 0x0100001e
-media alu_deliver_close 0x0100001f
-media alu_deliver_sound 0x01000020
-media ant_ui_transparent_bg 0x01000038
-media antui_record_img_0 0x01000039
-media antui_record_img_1 0x0100003a
-media antui_record_img_2 0x0100003b
-media antui_record_img_3 0x0100003c
-media antui_record_img_4 0x0100003d
-media antui_record_img_5 0x0100003e
-media antui_record_img_6 0x0100003f
-media antui_record_img_7 0x01000040
-media antui_record_img_8 0x01000041
-media antui_user_head 0x01000042
-media antui_user_head_dark 0x01000043
-media ap_expection_alert 0x01000044
-media ap_expection_empty 0x01000045
-media ap_expection_limit 0x01000046
-media ap_expection_logout 0x01000047
-media ap_expection_networkerror 0x01000048
-media appicon 0x0100000b
-media arrow 0x01000021
-media arrow_down 0x01000022
-media avatar_default 0x01000023
-media captcha_back 0x01000001
-media captcha_reload 0x01000002
-media captcha_slide 0x01000003
-media dialog_deep_icon_findpwd_login 0x01000024
-media dialog_deep_icon_msg_login 0x01000025
-media dialog_deep_icon_pwd_login 0x01000026
-media display_pay_bg 0x01000027
-media display_pay_bg_dark 0x01000028
-media fov_to_org 0x01000049
-media ic_public_back 0x01000029
-media icon 0x01000009
-media login_alipay_slogan_new_black 0x0100002a
-media login_alipay_slogan_new_white 0x0100002b
-media login_clear_bg_light 0x0100002c
-media nearx_bs 0x01000004
-media nearx_dtx 0x01000005
-media org_to_fov 0x0100004a
-media reg_account_icon 0x0100002d
-media search 0x0100002e
-media search_close 0x0100002f
-media setting 0x0100000a
-media startIcon 0x01000030
-media title_bar_back_btn_v2_dark 0x01000031
-media title_bar_back_btn_v2_dark_pressed 0x01000032
-media title_bar_back_btn_v2_light 0x01000033
-media title_bar_back_btn_v2_light_pressed 0x01000034
-media title_bar_back_btn_white 0x01000035
-media user_add 0x01000036
-media wifi 0x01000037
-profile main_pages 0x01000006

二进制
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/ets/modules.abc


+ 0 - 13
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/include/BlueShield/BlueShieldExports.h

@@ -1,13 +0,0 @@
-//
-// Created on 2024/5/6.
-//
-// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
-// please include "napi/native_api.h".
-
-#ifndef APSECDEMO_BLUESHIELD_EXPORTS_H
-#define APSECDEMO_BLUESHIELD_EXPORTS_H
-
-#include "BlueShieldManager.h"
-#include "TrustedTerminalInterface.h"
-
-#endif //APSECDEMO_BLUESHIELD_EXPORTS_H

+ 0 - 70
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/include/BlueShield/BlueShieldManager.h

@@ -1,70 +0,0 @@
-//
-// Created on 2024/1/25.
-//
-// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
-// please include "napi/native_api.h".
-
-#ifndef APSECDEMO_BLUESHIELDMANAGER_H
-#define APSECDEMO_BLUESHIELDMANAGER_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum _BlueShieldModuleType {
-    // Trusted Terminal
-    BS_STATIC_STORE_MODULE = 0,
-    BS_STATIC_CRYPTO_MODULE = 1,
-    BS_ENVELOPE_CRYPTO_MODULE = 2,
-    BS_DYNAMIC_CRYPTO_MODULE = 3,
-    BS_SAFE_SIGNATURE_MODULE = 4,
-    BS_SAFE_OTP_MODULE = 5,
-    BS_TRUSTED_SIGNATURE_MODULE = 6,
-    BS_TRUSTED_ENGINE_MODULE = 7,
-    BS_DEVICE_FEATURE_MODULE = 8,
-    BS_SAFE_TOKEN_MODULE = 9,
-
-    // Aliapy Device ID
-    BS_APDID_MODULE = 16,
-
-    // Security Flow
-    BS_RDS_MODULE = 32,
-    BS_DEVICE_COLOR_MODULE = 33,
-    BS_CAPTCHA_MODULE = 34,
-
-    // Edge Risk Control
-    BS_EDGE_RISK_MODULE = 48,
-
-    //dtx tee interface
-    BS_TEE_MODULE = 1000,
-} BlueShieldModuleType;
-
-typedef struct _BlueShieldManager {
-    /* 蓝盾初始化接口,Android/iOS/鸿蒙不需要调用
-     * @param: resPath 安全图片所在文件夹路径
-     * @param: workPath 程度执行时缓存文件路径
-     * @param: execPath 可执行二进制程序全路径,不传或者传空会默认读取/proc/self/exe
-     * @param: authCode 图片名,如果不定制可以传空串,默认为nearx_bs.jpg
-     * @param: extParams 扩展参数,可以暂时传NULL
-     * @return 初始化是否成功,0未成功,非0为错误码
-     */
-    int   (*Init)(const char* resPath, const char* workPath, const char* execPath, const char* authCode, void *extParams);
-    
-    /* 蓝盾功能模块获取接口
-     * @param moduleType 对应功能模块的ID
-     * return 返回对应功能模块的单例
-     */
-    void* (*GetModule)(BlueShieldModuleType moduleType);
-} BlueShieldManager;
-
-// 获取蓝盾单例
-__attribute__((visibility("default"))) BlueShieldManager *BlueShieldGetManager();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //APSECDEMO_BLUESHIELDMANAGER_H

+ 0 - 152
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/include/BlueShield/TrustedTerminalInterface.h

@@ -1,152 +0,0 @@
-//
-// Created on 2024/5/6.
-//
-// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
-// please include "napi/native_api.h".
-
-#ifndef APSECDEMO_BLUESHIELDTRUSTEDTERMINALINTERFACE_H
-#define APSECDEMO_BLUESHIELDTRUSTEDTERMINALINTERFACE_H
-
-#ifdef TRUSTEDTERMINAL_USE_VISIBILITY_DEFAULT
-#define TRUSTEDTERMINAL_VISIBILITY_DEFAULT __attribute__((visibility("default")))
-#else
-#define TRUSTEDTERMINAL_VISIBILITY_DEFAULT 
-#endif // #ifdef TRUSTEDTERMINAL_USE_VISIBILITY_DEFAULT
-
-#include <stddef.h>
-#include <stdint.h>
-
-typedef union _BSValue {
-    uint8_t     uint8_value;
-    int8_t      int8_value;
-    uint16_t    uint16_value;
-    int16_t     int16_value;
-    uint32_t    uint32_value;
-    int32_t     int32_value;
-    uint64_t    uint64_value;
-    int64_t     int64_value;
-    float       float_value;
-    double      double_value;
-    const char* string_value;
-    void*       pointer_value;
-} BSValue;
-
-typedef struct _BSKeyValue{
-    const char*     key;
-    BSValue   val;
-} BSKeyValue;
-
-// Module 0, 静态密钥存储
-typedef struct _BlueShieldStaticStoreModule {
-    int (*GetCustomData)(const char *appKey, const char *authName, const char** outData);
-} BlueShieldStaticStoreModule;
-
-// Module 1, 静态加解密
-typedef enum _BlueShieldStaticCryptoMode {
-    BS_STATIC_CRYPTO_MODE_SG_AES_128 = 16,
-    BS_STATIC_CRYPTO_MODE_BS_SM4_GCM = 32,
-    BS_STATIC_CRYPTO_MODE_BS_AES_128 = 33,
-} BlueShieldStaticCryptoMode;
-
-typedef struct _BlueShieldStaticCryptoModule {
-    int (*Encrypt)(BlueShieldStaticCryptoMode mode, const char *appKey, const char *authCode, uint8_t *inData,
-                   size_t inLen, uint8_t **outData, size_t *outLen);
-    int (*Decrypt)(BlueShieldStaticCryptoMode mode, const char *appKey, const char *authCode, uint8_t *inData,
-                   size_t inLen, uint8_t **outData, size_t *outLen);
-    int (*EncryptBase64)(BlueShieldStaticCryptoMode mode, const char *appKey, const char *authCode, uint8_t *inData,
-                         size_t inLen, uint8_t **outData, size_t *outLen);
-    int (*DecryptBase64)(BlueShieldStaticCryptoMode mode, const char *appKey, const char *authCode, uint8_t *inData,
-                         size_t inLen, uint8_t **outData, size_t *outLen);
-    int (*EncryptStringBase64)(BlueShieldStaticCryptoMode mode, const char *appKey, const char *authCode,
-                               const char *inData, const char **outData);
-    int (*DecryptStringBase64)(BlueShieldStaticCryptoMode mode, const char *appKey, const char *authCode,
-                               const char *inData, const char **outData);
-} BlueShieldStaticCryptoModule;
-
-// Module 3, 动态加解密
-typedef struct _BlueShieldDynamicCryptoModule {
-    int (*Encrypt)(uint8_t *inData, size_t inLen, uint8_t **outData, size_t *outLen);
-    int (*Decrypt)(uint8_t *inData, size_t inLen, uint8_t **outData, size_t *outLen);
-    int (*EncryptStringBase64)(const char *inData, const char **outData);
-    int (*DecryptStringBase64)(const char *inData, const char **outData);
-} BlueShieldDynamicCryptoModule;
-
-// Module 4, 安全签名
-typedef enum _BlueShieldSafeSignatureAlgo {
-    // 32 - 63 HMAC摘要
-    BS_SAFE_SIGNATURE_ALGO_HMAC_SM3 = 32,
-    BS_SAFE_SIGNATURE_ALGO_HMAC_MD5 = 33,
-    BS_SAFE_SIGNATURE_ALGO_HMAC_SHA1 = 34,
-    BS_SAFE_SIGNATURE_ALGO_HMAC_SHA256 = 35,
-
-    // 64 - 95 正常摘要
-    BS_SAFE_SIGNATURE_ALGO_SM3 = 64,
-    BS_SAFE_SIGNATURE_ALGO_MD5 = 65,
-    BS_SAFE_SIGNATURE_ALGO_SHA1 = 66,
-    BS_SAFE_SIGNATURE_ALGO_SHA256 = 67,
-
-    // 96 - 127 兼容摘要
-    BS_SAFE_SIGNATURE_ALGO_SG_SM3 = 96,
-    BS_SAFE_SIGNATURE_ALGO_SG_MD5 = 97,
-    BS_SAFE_SIGNATURE_ALGO_SG_SHA1 = 98,
-    BS_SAFE_SIGNATURE_ALGO_SG_SHA256 = 99,
-    BS_SAFE_SIGNATURE_ALGO_SG_XIAMI = 100,
-} BlueShieldSafeSignatureAlgo;
-
-typedef struct _BlueShieldSafeSignatureModule {
-    int (*sign)(BlueShieldSafeSignatureAlgo signAlgo, const char *appKey, uint8_t *msgData, size_t msgLen,
-                uint8_t **signBytes, size_t *signLen);
-    int (*signString)(BlueShieldSafeSignatureAlgo signAlgo, const char *appKey, const char *msgStr,
-                      const char **signStr);
-    int (*verify)(BlueShieldSafeSignatureAlgo signAlgo, const char *appKey, uint8_t *msgData, size_t msgLen,
-                  uint8_t *signData, size_t signLen);
-    int (*verifyString)(BlueShieldSafeSignatureAlgo signAlgo, const char *appKey, const char *msgStr,
-                        const char *signStr);
-} BlueShieldSafeSignatureModule;
-
-// Module 7, 可信签名
-#define  BS_TRUSTED_SIGN_PARAM_KEY_SIGN_API         "api"
-#define  BS_TRUSTED_SIGN_PARAM_KEY_SIGN_ENV         "env"
-#define  BS_TRUSTED_SIGN_PARAM_KEY_SIGN_TYPE        "signType"
-#define  BS_TRUSTED_SIGN_PARAM_KEY_SIGN_APPKEY      "appKey"
-#define  BS_TRUSTED_SIGN_PARAM_KEY_SIGN_AUTHCODE    "authCode"
-#define  BS_TRUSTED_SIGN_PARAM_KEY_SIGN_DATA        "signData"
-#define  BS_TRUSTED_SIGN_PARAM_KEY_SIGN_SWITCH      "signSwi"
-
-typedef enum _BlueShieldTrustedSignType {
-    BS_SECURITY_GUARD_MD5 = 0,
-    BS_SECURITY_GUARD_HMAC_SHA1 = 1,
-    // BS_SECURITY_GUARD_ATLAS       = 2,
-    // BS_SECURITY_GUARD_AVMP        = 3,
-    BS_TRUSTED_SIGN_NORMAL = 4,
-} BlueShieldTrustedSignType;
-
-typedef enum _BlueShieldTrustedSignEnv {
-    BS_TRUSTED_SIGN_ENV_ONLINE = 0,
-    BS_TRUSTED_SIGN_ENV_DEV = 1,
-    BS_TRUSTED_SIGN_ENV_PRE = 2,
-} BlueShieldTrustedSignEnv;
-
-typedef struct _BSTrustedSignResult {
-    const char *sign;
-    const char *color;
-    const char *token;
-    const char *reserved0;
-    const char *reserved1;
-} BSTrustedSignResult;
-
-typedef struct _BlueShieldTrustedSignatureModule {
-    int (*GetSign)(BSKeyValue* signParams, size_t paramCount, BSTrustedSignResult* signResult);
-    int (*ReleaseSign)(BSTrustedSignResult* signResult);
-} BlueShieldTrustedSignatureModule;
-
-// Module 8, 动态密钥
-typedef struct _BlueShieldSafeTokenModule {
-    int (*GetEncToken)(const char* value, int flag, uint8_t** out, size_t *outLen);
-    int (*GetPaycodeWithEncToken)(uint8_t* encToken, size_t encTokenLen, int64_t srvTime, int flag, const char** paycode);
-    int (*EncryptWithEncToken)(uint8_t* encToken, size_t encTokenLen, uint8_t* plainData, size_t plainDataLen, int flag, uint8_t** out, size_t* outLen);
-    int (*DecryptWithEncToken)(uint8_t* encToken, size_t encTokenLen, uint8_t* cipherData, size_t cipherDataLen, int flag, uint8_t** out, size_t* outLen);
-    int (*SignWithEncToken)(uint8_t* encToken, size_t encTokenLen, uint8_t* msgData, size_t msgDataLen, int flag, const char** signResult);
-} BlueShieldSafeTokenModule;
-
-#endif // APSECDEMO_BLUESHIELDTRUSTEDTERMINALINTERFACE_H

二进制
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/libs/arm64-v8a/libblueshield.so


+ 0 - 0
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/obfuscation.txt


+ 0 - 1
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/oh-package.json5

@@ -1 +0,0 @@
-{"license":"Apache-2.0","author":"Ant Security Team","name":"@alipay/blueshieldsdk","description":"Security Kits provided by Ant Group","version":"1.0.29","dynamicDependencies":{},"devDependencies":{},"dependencies":{"libblueshield.so":"file:./src/main/cpp/types/libblueshield"},"types":"Index.d.ets","artifactType":"obfuscation","metadata":{"runtimeOnly":{"packages":[]},"byteCodeHar":true,"sourceRoots":["./src/main"],"declarationEntry":[],"useNormalizedOHMUrl":true},"compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","obfuscated":true,"nativeComponents":[{"name":"libapdid.a","compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","linkLibraries":[]},{"name":"libblueshield.so","compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","linkLibraries":[]},{"name":"libcommon.a","compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","linkLibraries":[]},{"name":"libdynamic.a","compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","linkLibraries":[]},{"name":"libsecflow.a","compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","linkLibraries":[]},{"name":"libstee.a","compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","linkLibraries":[]},{"name":"libstx.a","compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","linkLibraries":[]},{"name":"libteec.a","compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","linkLibraries":[]},{"name":"libtrustedterminal.a","compatibleSdkVersion":12,"compatibleSdkType":"HarmonyOS","linkLibraries":[]}]}

+ 0 - 14
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/cpp/types/libblueshield/index.d.ts

@@ -1,14 +0,0 @@
-export interface RegisterReflectionFuncModel {
-    name: string;
-    func: Function;
-}
-export const setAppContext: (ctx: Object) => boolean;
-export const initBlueShieldManger: (authName?: string, extConfig?: Map<string, string>) => number;
-export const ScpInvokeNative: (proto: number, ...args: Object[]) => Object;
-export const nativeRegisterReflectionFunc: (funcList: RegisterReflectionFuncModel[]) => number;
-export const registerRpcInterceptor: () => number;
-export const notifyValidateResult: (validateResult: number) => number;
-export const ScpGetConfig: (configKey: string, defaultValue: string) => string;
-export const ScpMdapEvent: (bizType: string, eventId: string, param1: string, param2: string, param3: string, param4: string) => number;
-export const ScpLoggerWrite: (tag: string, level: number, fmt: string, msg: string) => number;
-export const ScpSendEventNative: (protocol: string, properties: string, external: Uint8Array, timeout: number) => string;

+ 0 - 6
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/cpp/types/libblueshield/oh-package.json5

@@ -1,6 +0,0 @@
-{
-  "name": "libblueshield.so",
-  "types": "./index.d.ts",
-  "version": "1.0.8",
-  "description": "Please describe the basic information."
-}

+ 0 - 27
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/BlueShieldManager.d.ets

@@ -1,27 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import common from '@ohos.app.ability.common';
-export declare class BlueShieldManager {
-    constructor();
-    static setContext(u2: common.Context): boolean;
-    static getInstance(): BlueShieldManager;
-    initialize(j2?: string, k2?: Map<string, string>): number;
-    getModule(i2: BlueShieldModuleType): Object | null;
-}
-export declare const enum BlueShieldModuleType {
-    BS_STATIC_STORE_MODULE = 0,
-    BS_STATIC_CRYPTO_MODULE = 1,
-    BS_ENVELOPE_CRYPTO_MODULE = 2,
-    BS_DYNAMIC_CRYPTO_MODULE = 3,
-    BS_SAFE_SIGNATURE_MODULE = 4,
-    BS_SAFE_OTP_MODULE = 5,
-    BS_TRUSTED_SIGNATURE_MODULE = 6,
-    BS_TRUSTED_ENGINE_MODULE = 7,
-    BS_DEVICE_FEATURE_MODULE = 8,
-    BS_SAFE_TOKEN_MODULE = 9,
-    BS_APDID_MODULE = 16,
-    BS_RDS_MODULE = 32,
-    BS_DEVICE_COLOR_MODULE = 33,
-    BS_CAPTCHA_MODULE = 34,
-    BS_EDGE_RISK_MODULE = 48
-}

+ 0 - 13
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/apdid/APDIDModule.d.ets

@@ -1,13 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { IAPDIDModule, TokenResult } from './IAPDIDModule';
-import { AsyncCallback } from '@ohos.base';
-export declare class APDIDModule implements IAPDIDModule {
-    initToken(q: Map<string, string>, r: AsyncCallback<TokenResult, void>): void;
-    initToken(q: Map<string, string>): Promise<TokenResult>;
-    getTokenResult(): TokenResult;
-    getApdidToken(): string;
-    initOpenToken(g: string, h: string, i: AsyncCallback<string, void>): void;
-    initOpenToken(g: string, h: string): Promise<string>;
-    registerDeviceIdChanged(a: AsyncCallback<number, void>): void;
-}

+ 0 - 78
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/apdid/IAPDIDModule.d.ets

@@ -1,78 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { AsyncCallback } from '@ohos.base';
-/**
- * 设备指纹结果类
- * 包含apdidToken
- */
-export declare class TokenResult {
-    apdidToken: string;
-    apdid: string;
-    umidToken: string;
-}
-export declare const enum APDIDParamKey {
-    TID = "tid",
-    UTDID = "utdid",
-    USERID = "userId"
-}
-/**
- * 设备指纹接口类
- */
-export interface IAPDIDModule {
-    /**
-     * 设备指纹异步初始化回调接口
-     * 采集设备信息并通过RPC发送到服务器,然后回调用户设置的listener接口返回结果
-     * 注意:用户设置的回调listener将在异步线程中被SDK调用,不用直接在listener中做UI相关的操作
-     *
-     * @param inArgs   可扩展参数对象,钱包中主要用于外部传入tid,utdid,userId等变量
-     * @param listener 结果回调,回调参数见{@link TokenResult}
-     * @throws BusinessError 1111 - to be declared error.
-     */
-    initToken(inArgs: Map<string, string>, listener: AsyncCallback<TokenResult>): void;
-    /**
-     * 设备指纹异步初始化Promise接口
-     * 采集设备信息并通过RPC发送到服务器,结果通过Promise返回
-     *
-     * @param inArgs   可扩展参数对象,钱包中主要用于外部传入tid,utdid,userId等变量
-     * @returns Promise<TokenResult>, 结果见{@link TokenResult}
-     */
-    initToken(inArgs: Map<string, string>): Promise<TokenResult>;
-    /**
-     * 同步获取TokenResult
-     *
-     * @return 参照类 {@link TokenResult}
-     */
-    getTokenResult(): TokenResult;
-    /**
-     * 同步获取apdidToken
-     *
-     * @return apdidToken {@link TokenResult.apdidToken}
-     */
-    getApdidToken(): string;
-    /**
-     * 设备指纹开放版异步初始化callback接口
-     * 集成在钱包H5容器中的App调用,获取apdidToken
-     *
-     * @param appName
-     * @param appKeyClient
-     * @param listener, 回调参数为apdidToken
-     */
-    initOpenToken(appName: string, appKeyClient: string, listener: AsyncCallback<string>): void;
-    /**
-     * 设备指纹开放版异步初始化promise接口
-     * 集成在钱包H5容器中的App调用,获取apdidToken
-     *
-     * @param appName
-     * @param appKeyClient
-     * @returns Promise<string>, 结果为apdidToken
-     */
-    initOpenToken(appName: string, appKeyClient: string): Promise<string>;
-    /**
-     * 设备指纹id变化监听注册接口
-     *
-     * @param listener, 回调参数含义:
-     *  0: apdid 没变;
-     *  1: apdid 跟上次比较有变化
-     */
-    registerDeviceIdChanged(listener: AsyncCallback<number>): void;
-}

+ 0 - 7
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/apdid/network/APDIDNetworkUtil.d.ets

@@ -1,7 +0,0 @@
-// @keepTs
-// @ts-nocheck
-export declare class APDIDNetworkUtil {
-    private static readonly operationType;
-    private static packetStr;
-    static executeRPC(l1: string): Promise<string | null>;
-}

+ 0 - 10
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/CollectArgs.d.ets

@@ -1,10 +0,0 @@
-// @keepTs
-// @ts-nocheck
-export interface CollectArgs {
-    appName?: string;
-    userId?: string;
-    tid?: string;
-    utdid?: string;
-    reportReason?: string;
-    timeout?: number;
-}

+ 0 - 15
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/CollectBase.d.ets

@@ -1,15 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectArgs } from './CollectArgs';
-/**
- * 因子采集基类
- */
-export declare abstract class CollectBase {
-    name: string;
-    timeout: number;
-    constructor();
-    promiseWithTimeout<u3>(v3: Promise<u3>, w3: number): Promise<u3>;
-    getCollectName(): string;
-    getResult(c3: CollectArgs): Promise<Record<string, string>>;
-    abstract doCollect(b3?: CollectArgs): Promise<string | number | null> | string | null | number;
-}

+ 0 - 6
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/Index.d.ets

@@ -1,6 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectArgs } from './CollectArgs';
-export declare function generateStaticDataHash(b8: CollectArgs): Promise<string>;
-export declare function collectAllData(y7: CollectArgs): Promise<string>;
-export declare function collectAtomicData(v7: string): Promise<string>;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/application/HA1_AppName.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class AppName extends CollectBase {
-    constructor();
-    doCollect(): Promise<string>;
-}
-declare const _default: AppName;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/application/HA2_AppVersion.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class AppVersion extends CollectBase {
-    constructor();
-    doCollect(): Promise<string>;
-}
-declare const _default: AppVersion;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/application/HA3_SdkName.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class SdkName extends CollectBase {
-    constructor();
-    doCollect(): string;
-}
-declare const _default: SdkName;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/application/HA4_SdkVersion.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class SdkVersion extends CollectBase {
-    constructor();
-    doCollect(): string;
-}
-declare const _default: SdkVersion;
-export default _default;

+ 0 - 5
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/application/Index.d.ets

@@ -1,5 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-export declare const HA_STATIC: CollectBase[];
-export declare const HA_ALL: CollectBase[];

+ 0 - 10
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/customize/HC1_Tid.d.ets

@@ -1,10 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-import { CollectArgs } from '../CollectArgs';
-declare class Tid extends CollectBase {
-    constructor();
-    doCollect(c4?: CollectArgs): Promise<string | null>;
-}
-declare const _default: Tid;
-export default _default;

+ 0 - 10
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/customize/HC2_Utdid.d.ets

@@ -1,10 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-import { CollectArgs } from '../CollectArgs';
-declare class Utdid extends CollectBase {
-    constructor();
-    doCollect(e4?: CollectArgs): Promise<string | null>;
-}
-declare const _default: Utdid;
-export default _default;

+ 0 - 13
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/customize/HC4_RandomStr.d.ets

@@ -1,13 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class RandomStr extends CollectBase {
-    private randomStr;
-    private readonly prefsKey;
-    constructor();
-    private static stringToArray;
-    private static arrayToString;
-    doCollect(): Promise<string | null>;
-}
-declare const _default: RandomStr;
-export default _default;

+ 0 - 10
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/customize/HC5_UserId.d.ets

@@ -1,10 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-import { CollectArgs } from '../CollectArgs';
-declare class UserId extends CollectBase {
-    constructor();
-    doCollect(e5?: CollectArgs): Promise<string | null>;
-}
-declare const _default: UserId;
-export default _default;

+ 0 - 6
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/customize/Index.d.ets

@@ -1,6 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-export declare const HC_STATIC: CollectBase[];
-export declare const HC_DYNAMIC: CollectBase[];
-export declare const HC_ALL: CollectBase[];

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD10_Udid.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class Udid extends CollectBase {
-    constructor();
-    doCollect(): string;
-}
-declare const _default: Udid;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD12_CpuCount.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class CpuCount extends CollectBase {
-    constructor();
-    doCollect(): number;
-}
-declare const _default: CpuCount;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD13_CpuFrequency.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class CpuFrequency extends CollectBase {
-    constructor();
-    doCollect(): string | null;
-}
-declare const _default: CpuFrequency;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD14_Memory.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class Memory extends CollectBase {
-    constructor();
-    doCollect(): string | null;
-}
-declare const _default: Memory;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD15_DataPathSize.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class DataPathSize extends CollectBase {
-    constructor();
-    doCollect(): number;
-}
-declare const _default: DataPathSize;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD16_StoragePathSize.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class StoragePathSize extends CollectBase {
-    constructor();
-    doCollect(): number;
-}
-declare const _default: StoragePathSize;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD17_LocalDeviceId.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class LocalDeviceId extends CollectBase {
-    constructor();
-    doCollect(): string;
-}
-declare const _default: LocalDeviceId;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD19_NetworkType.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class NetworkType extends CollectBase {
-    constructor();
-    doCollect(): Promise<number>;
-}
-declare const _default: NetworkType;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD301_SG.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class FraudCheck extends CollectBase {
-    constructor();
-    doCollect(): string;
-}
-declare const _default: FraudCheck;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD302_DeviceAuth.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class DeviceAuth extends CollectBase {
-    constructor();
-    doCollect(): string;
-}
-declare const _default: DeviceAuth;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD303_SysIntegrity.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class SysIntegrity extends CollectBase {
-    constructor();
-    doCollect(): string;
-}
-declare const _default: SysIntegrity;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD304_SecureLocation.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class SecureLocation extends CollectBase {
-    constructor();
-    doCollect(): string;
-}
-declare const _default: SecureLocation;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD305_MicScreenStatus.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class MicScreenStatus extends CollectBase {
-    constructor();
-    doCollect(): number;
-}
-declare const _default: MicScreenStatus;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD37_Timezone.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class Timezone extends CollectBase {
-    constructor();
-    doCollect(): string;
-}
-declare const _default: Timezone;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD38_Language.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class Language extends CollectBase {
-    constructor();
-    doCollect(): string;
-}
-declare const _default: Language;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD3_SensorListDigest.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class SensorListDigest extends CollectBase {
-    constructor();
-    doCollect(): Promise<string>;
-}
-declare const _default: SensorListDigest;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD4_Oaid.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class Oaid extends CollectBase {
-    constructor();
-    doCollect(): Promise<string>;
-}
-declare const _default: Oaid;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD5_Aaid.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class Aaid extends CollectBase {
-    constructor();
-    doCollect(): Promise<string | null>;
-}
-declare const _default: Aaid;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD6_ScreenWidth.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class ScreenWidth extends CollectBase {
-    constructor();
-    doCollect(): number;
-}
-declare const _default: ScreenWidth;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD7_ScreenHeight.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class ScreenHeight extends CollectBase {
-    constructor();
-    doCollect(): number;
-}
-declare const _default: ScreenHeight;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD8_MacAddress.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class MacAddress extends CollectBase {
-    constructor();
-    doCollect(): Promise<string>;
-}
-declare const _default: MacAddress;
-export default _default;

+ 0 - 9
oh_modules/.ohpm/@cashier_alipay+cashiersdk@15.8.32/oh_modules/@alipay/blueshieldsdk/src/main/ets/components/collect/device/HD9_SimIccid.d.ets

@@ -1,9 +0,0 @@
-// @keepTs
-// @ts-nocheck
-import { CollectBase } from '../CollectBase';
-declare class SimIccid extends CollectBase {
-    constructor();
-    doCollect(): Promise<string>;
-}
-declare const _default: SimIccid;
-export default _default;

部分文件因为文件数量过多而无法显示