/******************************************************************************* * * Nx SDK管理器 * * * * 2021.12.10 ******************************************************************************/ const SDKBase = require( "nx.sdk.base" ); const NxSDKMac = cc.Class( { extends: SDKBase, name: "NxSDKMac", // ============================================ // 设备信息 // ============================================ // 设备ID getDeviceID: function() { return jsb.reflection.callStaticMethod( "Interfaces", "getDeviceUUID" ); }, // 包版本 getPackVersion: function() { return jsb.reflection.callStaticMethod( "Interfaces", "getApkVersion" ); }, // 包参数 getPackArgs: function() { let str = jsb.reflection.callStaticMethod( "Interfaces", "getDicValue:", "PackArgs" ); nx.info( "$SDK:包参数:", str ); if( nx.dt.strEmpty( str ) ) { return null; } // Exam: name#fc|cnn#dev|lang#tw|gm#1 let args = {}; let arr = str.split( "|" ); for( let i in arr ) { let pair = arr[i].split("#"); args[pair[0]] = pair[1]; } nx.info( "$SDK:拆解结果:", nx.dt.enjson( args ) ); return args; }, } ); // 模块导出 module.exports = NxSDKMac;