import i1 from "@ohos:bundle.bundleManager"; import j1 from "@ohos:net.connection"; import { FaceSecDevice } from '@normalized:N&&&aliyunfaceguard/src/main/ets/face/security/device/api/FaceSecDevice&2.0.1'; export class FaceSecID { static getAppName(z1) { let a2 = ""; if (z1 == null) { return a2; } try { let c2 = i1.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION; let d2 = i1.getBundleInfoForSelfSync(c2); if (d2 == null) { return a2; } let e2 = z1.resourceManager.getStringSync(d2.appInfo.labelId); if (e2 !== null && e2.length > 0) { a2 = e2; } } catch (b2) { } return a2; } static initSystemStatus(s1, t1) { let u1 = canIUse("SystemCapability.Security.Asset"); let v1 = canIUse("SystemCapability.Nfc"); let w1 = canIUse("SystemCapability.Communication.NFC.Core"); let x1 = canIUse("SystemCapability.Communication.Bluetooth.Core"); let y1 = FaceSecID.getAppName(s1); t1.set("assetStatus", `${u1}`); t1.set("nfcStatus", `${v1}`); t1.set("nfcCoreStatus", `${w1}`); t1.set("bluetoothStatus", `${x1}`); t1.set("appName", y1); t1.set("filesDir", s1.filesDir); return; } static initEnvStates(k1) { let l1 = new Map(); j1.getDefaultHttpProxy((n1, o1) => { if (n1) { return; } let p1 = o1.host; let q1 = o1.port; if (p1.length > 0 && q1 > 0) { let r1 = o1.host + ":" + o1.port; l1.set("httpProxy", r1); l1.set("isHttpProxy", "1"); FaceSecDevice.getInstance().setParamsOption(k1, l1, 1); } }); } } 