import systemDeviceInfo from '@ohos.deviceInfo';
import systemDateTime from '@ohos.systemDateTime';
import bundleManager from '@ohos.bundle.bundleManager';
import i18n from '@ohos.i18n';
import connection from '@ohos.net.connection';
import systemDisplay from '@ohos.display';
export default class UPSysInfoUtil {
    static systemVersion() {
        let q11 = '';
        try {
            q11 = systemDeviceInfo.majorVersion.toString(10) + '.' + systemDeviceInfo.seniorVersion.toString(10) + '.' + systemDeviceInfo.featureVersion.toString(10) + '.' + systemDeviceInfo.buildVersion.toString(10);
        }
        catch (r11) {
        }
        return q11;
    }
    static systemManufacture() {
        let o11 = '';
        try {
            o11 = systemDeviceInfo.manufacture;
        }
        catch (p11) {
        }
        return o11;
    }
    static async systemResolution() {
        let j11 = '';
        let k11;
        k11 = await systemDisplay.getAllDisplays();
        if (k11 instanceof Array) {
            if (k11[0]?.width && k11[0]?.height) {
                j11 = k11[0]?.width.toString(10) + "*" + k11[0]?.height.toString(10);
            }
        }
        return new Promise((m11, n11) => {
            m11(j11);
        });
    }
    static machineType() {
        let h11 = '';
        try {
            h11 = systemDeviceInfo.displayVersion;
        }
        catch (i11) {
        }
        return h11;
    }
    static timeZone() {
        let f11 = '';
        try {
            f11 = systemDateTime.getTimezoneSync();
        }
        catch (g11) {
        }
        return f11;
    }
    static systemAppSign() {
        let d11 = '';
        try {
            d11 = bundleManager.getBundleInfoForSelfSync(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO).signatureInfo.fingerprint;
        }
        catch (e11) {
        }
        return d11;
    }
    static systemBundleName() {
        let b11 = '';
        try {
            b11 = bundleManager.getBundleInfoForSelfSync(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION).name;
        }
        catch (c11) {
        }
        return b11;
    }
    static systemLanguage() {
        let z10 = '';
        try {
            z10 = i18n.System.getSystemLanguage();
        }
        catch (a11) {
        }
        return z10;
    }
    static systemRegion() {
        let x10 = '';
        try {
            x10 = i18n.System.getSystemRegion();
        }
        catch (y10) {
        }
        return x10;
    }
    static systemNetMode() {
        let t10 = '0';
        try {
            let v10 = connection.getDefaultNetSync();
            let w10 = connection.getNetCapabilitiesSync(v10);
            switch (w10.bearerTypes[0]) {
                case connection.NetBearType.BEARER_CELLULAR: {
                    t10 = '1';
                    break;
                }
                case connection.NetBearType.BEARER_WIFI: {
                    t10 = '2';
                    break;
                }
                case connection.NetBearType.BEARER_ETHERNET: {
                    t10 = '3';
                    break;
                }
            }
        }
        catch (u10) {
        }
        return t10;
    }
}
