/******************************************************************************* * * Nx SDK管理器 * * * * 2021.12.10 ******************************************************************************/ const SDKBase = require( "nx.sdk.base" ); const NxSDKIOS = cc.Class( { extends: SDKBase, name: "NxSDKIOS", // 设备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 {}; } // 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; }, // PHP路径列表 getPHPURLs: function() { let str = jsb.reflection.callStaticMethod( "Interfaces", "getDicValue:", "PHPUrls" ); nx.info( "$SDK:PHP路径列表:", str ); if( nx.dt.strEmpty( str ) ) { return []; } return str.split( "|" ); }, } ); // 模块导出 module.exports = NxSDKIOS;