mirror of
https://git.um-react.app/um/um-react.git
synced 2026-11-27 23:56:59 +00:00
refactor: reorganize Kugou and Kuwo imports, add key management features
- 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.
This commit is contained in:
1 parent
a9a937bc5e
commit
7a11d4f941
58 files changed
+522
-311
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { DatabaseKeyExtractor } from '~/util/DatabaseKeyExtractor';
|
||||
import { parseAndroidQmEKey } from '~/util/mmkv/qm';
|
||||
import { getFileName } from '~/util/pathHelper';
|
||||
import type { StagingQMCv2Key } from './types';
|
||||
|
||||
/** Parse a QMCv2 key database / MMKV dump into staging key rows (without `id`). */
|
||||
export async function importQMCv2KeysFromFile(file: File): Promise<null | Omit<StagingQMCv2Key, 'id'>[]> {
|
||||
const fileBuffer = await file.arrayBuffer();
|
||||
|
||||
if (/(player_process[_.]db|music_audio_play)(\.db)?$/i.test(file.name)) {
|
||||
const extractor = await DatabaseKeyExtractor.getInstance();
|
||||
return extractor.extractQmcV2KeysFromSqliteDb(fileBuffer);
|
||||
}
|
||||
|
||||
if (/MMKVStreamEncryptId|filenameEkeyMap|qmpc-mmkv-v1|(\.mmkv$)/i.test(file.name)) {
|
||||
const map = parseAndroidQmEKey(new DataView(fileBuffer));
|
||||
return Array.from(map.entries(), ([name, ekey]) => ({ name: getFileName(name), ekey }));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in new issue
Block a user