/**
 * @description 应用数据
 * @author 邹勇
 */
export class AppData {

    public getDeviceInfoCompelete: boolean = false;

    /** 错误日志游戏名标志,尽量短 */
    public appNameBugly: string = '3xiao';

    public appVersion: string = '';

    /** 投放渠道号 */
    public tfChannel: string = '';

    /** api版本 */
    public version: string = '1.0.0';

    /** 李杨/悍国服的appId */
    // public appId: string = 'wxcf31f0e54f7fefda';
    /** 测试服/正式服的appId */
    public appId: string = 'wxcf31f0e54f7fefda';

    /** 友盟渠道 */
    public umengChannel: string = '';

    /** 设备型号 */
    public deviceType: string = '';

    /** 安卓版本号 */
    public androidVersion: string = '';

    public mac: string = 'c9:24:e2:12:b3:23,f6:60:e4:1a:b7:27';

    /** 设备信息 */
    public machineInfo = {
        "android_id": "",
        "idfa": "",
        "imei": "",
        "mac": "",
        "oaid": "",
        "umid": ""
    };


    /**
     * 更新设备信息
     * @description 自定义功能 JavaToCocos
     * @param info  info(Java返回)
     */
    public updateDeviceInfo(info) {
        let arr = info.split('#')
        this.machineInfo.android_id = arr[0];
        this.machineInfo.idfa = arr[1];
        this.machineInfo.imei = arr[2];
        this.machineInfo.mac = this.mac = arr[3];
        this.machineInfo.oaid = arr[4];
        this.machineInfo.umid = arr[5];
        this.tfChannel = arr[6];
        this.appVersion = arr[7];

        /** 友盟渠道 */
        this.umengChannel = arr[8];
        /** 设备型号 */
        this.deviceType = arr[9];
        /** 安卓版本号 */
        this.androidVersion = arr[10];

        this.getDeviceInfoCompelete = true;
    }

    public init() {

    }
}