mirror of
				https://git.unlock-music.dev/um/web.git
				synced 2025-11-04 11:53:30 +08:00 
			
		
		
		
	Adjust for Debugging
This commit is contained in:
		
							parent
							
								
									dcde0d3fbb
								
							
						
					
					
						commit
						9aab7a7713
					
				
							
								
								
									
										12
									
								
								src/App.vue
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/App.vue
									
									
									
									
									
								
							@ -95,8 +95,10 @@
 | 
			
		||||
                            duration: 3000
 | 
			
		||||
                        });
 | 
			
		||||
                    }
 | 
			
		||||
                    let _rp_data = [data.title, data.artist, data.album];
 | 
			
		||||
                    window._paq.push(["trackEvent", "Unlock", data.rawExt + "," + data.mime, JSON.stringify(_rp_data)]);
 | 
			
		||||
                    if (process.env.NODE_ENV === 'production') {
 | 
			
		||||
                        let _rp_data = [data.title, data.artist, data.album];
 | 
			
		||||
                        window._paq.push(["trackEvent", "Unlock", data.rawExt + "," + data.mime, JSON.stringify(_rp_data)]);
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    this.showFail(data.message, data.rawFilename + "." + data.rawExt)
 | 
			
		||||
                }
 | 
			
		||||
@ -109,8 +111,10 @@
 | 
			
		||||
                    dangerouslyUseHTMLString: true,
 | 
			
		||||
                    duration: 6000
 | 
			
		||||
                });
 | 
			
		||||
                window._paq.push(["trackEvent", "Error", errInfo, filename]);
 | 
			
		||||
                console.error(errInfo, filename);
 | 
			
		||||
                if (process.env.NODE_ENV === 'production') {
 | 
			
		||||
                    window._paq.push(["trackEvent", "Error", errInfo, filename]);
 | 
			
		||||
                    console.error(errInfo, filename);
 | 
			
		||||
                }
 | 
			
		||||
            },
 | 
			
		||||
            changePlaying(url) {
 | 
			
		||||
                this.playing_url = url;
 | 
			
		||||
 | 
			
		||||
@ -26,7 +26,7 @@
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        mounted() {
 | 
			
		||||
            if (document.location.host !== "") {
 | 
			
		||||
            if (document.location.host !== "" && process.env.NODE_ENV === 'production') {
 | 
			
		||||
                //todo: Fail on Hot Reload
 | 
			
		||||
                const worker = require("workerize-loader!../decrypt/common");
 | 
			
		||||
                this.thread_num = navigator.hardwareConcurrency || 1;
 | 
			
		||||
 | 
			
		||||
@ -29,6 +29,9 @@ async function Decrypt(file, raw_filename, raw_ext) {
 | 
			
		||||
    // 读取Meta
 | 
			
		||||
    let tag = await musicMetadata.parseBlob(musicData);
 | 
			
		||||
    const info = util.GetFileInfo(tag.common.artist, tag.common.title, raw_filename);
 | 
			
		||||
    reportKeyInfo(new Uint8Array(fileBuffer.slice(-0x170)), seed.mask,
 | 
			
		||||
        info.artist, info.title, tag.common.album, raw_filename);
 | 
			
		||||
 | 
			
		||||
    // 返回
 | 
			
		||||
    return {
 | 
			
		||||
        status: true,
 | 
			
		||||
@ -48,11 +51,10 @@ class Mask {
 | 
			
		||||
    constructor() {
 | 
			
		||||
        this.index = -1;
 | 
			
		||||
        this.mask_index = -1;
 | 
			
		||||
        this.mask = Array(128).fill(0x00);
 | 
			
		||||
        this.mask = new Uint8Array(128);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    DetectMask(data) {
 | 
			
		||||
 | 
			
		||||
        let search_len = data.length - 256, mask;
 | 
			
		||||
        for (let block_idx = 0; block_idx < search_len; block_idx += 128) {
 | 
			
		||||
            let flag = true;
 | 
			
		||||
@ -66,12 +68,11 @@ class Mask {
 | 
			
		||||
            }
 | 
			
		||||
            if (!flag) continue;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            for (let test_idx = 0; test_idx < FLAC_HEADER.length; test_idx++) {
 | 
			
		||||
                let p = data[test_idx] ^ mask[test_idx];
 | 
			
		||||
                if (p !== FLAC_HEADER[test_idx]) {
 | 
			
		||||
                    flag = false;
 | 
			
		||||
                    debugger;
 | 
			
		||||
                    //todo: Check this
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@ -96,3 +97,15 @@ class Mask {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function reportKeyInfo(keyData, maskData, artist, title, album, filename) {
 | 
			
		||||
    fetch("https://stats.ixarea.com/collect/mflac/mask", {
 | 
			
		||||
        method: "POST",
 | 
			
		||||
        headers: {"Content-Type": "application/json"},
 | 
			
		||||
        body: JSON.stringify({
 | 
			
		||||
            Mask: Array.from(maskData), Key: Array.from(keyData),
 | 
			
		||||
            Artist: artist, Title: title, Album: album, Filename: filename
 | 
			
		||||
        }),
 | 
			
		||||
    }).then().catch()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user