1import { hasComplete } from "./utils" 2 3export function mockCipher() { 4 global.systemplugin.cipher = { 5 rsa: function(...args) { 6 console.warn("cipher.rsa interface mocked in the Previewer. How this interface works on the Previewer may be" + 7 " different from that on a real device.") 8 const result = '[PC preview] rsa xxxxxxxxxxxxx' 9 args[0].success(result) 10 hasComplete(args[0].complete) 11 }, 12 aes: function(...args) { 13 console.warn("cipher.aes interface mocked in the Previewer. How this interface works on the Previewer may be" + 14 " different from that on a real device.") 15 const result = '[PC preview] aes xxxxxxxxxxxxx' 16 args[0].success(result) 17 hasComplete(args[0].complete) 18 } 19 } 20 }