| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- /**
- * @description 应用数据
- * @author 邹勇
- */
- export class AppData {
- public getDeviceInfoCompelete: boolean = false;
- /** 错误日志游戏名标志,尽量短 */
- public appNameBugly: string = '3xiao';
- public appVersion: string = '';
- /** 投放渠道号 */
- public tfChannel: string = '';
- /** api版本 */
- public version: string = '';
- /** UserAgent */
- UA = '';
- IP = '';
- /** 测试服/正式服的appId */
- public appId: string = '';
- /** 友盟渠道 */
- public umengChannel: string = '';
- /** 设备型号 */
- public deviceType: string = '';
- /** 安卓版本号 */
- public androidVersion: string = '';
- public mac: string = '';
- /** 设备信息 */
- public machineInfo = {
- "android_id": "",
- "idfa": "",
- "imei": "",
- "mac": "",
- "oaid": "",
- "umid": "",
- "UA": ""
- };
- /**
- * 更新设备信息
- * @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.machineInfo.UA = arr[11];
- this.tfChannel = arr[6];
- this.appVersion = arr[7];
- /** 友盟渠道 */
- this.umengChannel = arr[8];
- /** 设备型号 */
- this.deviceType = arr[9];
- /** 安卓版本号 */
- this.androidVersion = arr[10];
- this.IP = arr[12]
- this.getDeviceInfoCompelete = true;
- console.log("===[this.tfChannel", this.tfChannel);
- console.log("===[this.appVersion", this.appVersion);
- console.log("===[this.mac", this.mac);
- }
- public init() {
- }
- /** 更新状态 */
- public updateState: UpdateState = UpdateState.None;
- /** 更新进度 */
- public updatePercent = 0;
- //强更信息--------------------------------------------------------
- /** 需要强制更新 */
- public needForceUpdate;
- /** 安装版本 */
- public installVersion;
- /** 安装路径 */
- public installUrl;
- /** 更新信息 */
- public updateDes;
- /** 修复信息 */
- public fixDes;
- }
- /** 更新状态 */
- export enum UpdateState {
- None = -1,
- CheckForce = 0,
- ForceUpdateFinish = 1,
- CheckHot = 2,
- IsUpdate = 3,
- UpdateFinish = 4,
- }
|