mirror of
https://git.um-react.app/um/um-react.git
synced 2026-11-27 23:56:59 +00:00
- Updated import paths for Kugou and Kuwo instructions to reflect new directory structure. - Introduced new key management functionalities for Kugou, including key import and selection logic. - Added comprehensive instructions for both Kugou and Kuwo key handling across various platforms. - Implemented Redux selectors for managing staging and production keys for Kugou and Kuwo. - Enhanced documentation and tests for new features and key management processes.
14 lines
563 B
TypeScript
14 lines
563 B
TypeScript
import { parseAndroidKuwoEKey, parseIosKuwoEKey } from '~/util/mmkv/kuwo';
|
|
import type { StagingKWMv2Key } from './types';
|
|
|
|
/** Parse a Kuwo MMKV / iOS ekey dump into staging key rows (without `id`). */
|
|
export async function importKWMv2KeysFromFile(file: File): Promise<null | Omit<StagingKWMv2Key, 'id'>[]> {
|
|
if (/cn\.kuwo\.player\.mmkv/i.test(file.name)) {
|
|
return parseAndroidKuwoEKey(new DataView(await file.arrayBuffer()));
|
|
}
|
|
if (/kw_ekey/.test(file.name)) {
|
|
return parseIosKuwoEKey(new DataView(await file.arrayBuffer()));
|
|
}
|
|
return null;
|
|
}
|