diff --git a/runtime/main/extend/systemplugin/napi/ohos_security_huks.js b/runtime/main/extend/systemplugin/napi/ohos_security_huks.js index 9e7fb70f..cbe48ac8 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_security_huks.js +++ b/runtime/main/extend/systemplugin/napi/ohos_security_huks.js @@ -527,6 +527,18 @@ export function mockHuks() { }) } }, + attestKey: function (...args) { + console.warn("huks.attestKey interface mocked in the Previewer. How this interface works on the Previewer" + + " may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, HuksResult) + } else { + return new Promise((resolve, reject) => { + resolve(HuksResult) + }) + } + }, getSdkVersion: function (...args) { console.warn("huks.getSdkVersion interface mocked in the Previewer. How this interface works on the Previewer" + " may be different from that on a real device.")