import http from '@ohos.net.http';
import UPUtil from '../utils/UPUtil';
import UPConstant from '../common/UPConstant';
export async function getConfigReqMsg(x, y, z) {
    let a1;
    try {
        a1 = await UPUtil.getDeviceInfo();
    }
    catch (k1) {
        a1 = {};
    }
    let b1 = '';
    if (x) {
        let j1 = UPUtil.strToHexStr(x);
        b1 = UPUtil.rsaEncryptMsg(y, j1);
    }
    a1['tn'] = b1;
    a1['v'] = UPConstant.NETMODE_VERSION;
    a1['sdkVerMode'] = UPConstant.SDK_MODE;
    a1['appUuId'] = UPUtil.uuidString();
    if (z) {
        a1['isLimitSe'] = '1';
        a1['seType'] = UPUtil.seType2CarrierType(z);
    }
    let c1 = JSON.stringify(a1);
    let d1 = new Map([['Content-Type', 'application/json;charset=UTF-8']]);
    let e1 = UPUtil.getServerUrl(y);
    let f1 = {
        path: e1,
        bodyStr: c1,
        method: http.RequestMethod.POST,
        header: d1,
    };
    return new Promise((h1, i1) => {
        h1(f1);
    });
}
