xuguohong

add wegame version

No preview for this file type
import commonH5Utils from"./commonH5Utils.js";export default class{constructor(){this.hasInit=!1;this.hasLogout=!1;this.hasSwitchAccount=!1;this.hasFloatView=!1;this.hasUserCenter=!1;this.hasExitDialog=!1;this.sdkInfo={};this.loginExt="1";this.gameSettingData={has_micro_client:0,is_share:0,is_focus:0,is_apple_pay:0,is_open_pay:1,is_desktop:0,is_switch_account:0,is_realverify:0,is_real_name_verify:-1,birthday:"",is_super_kefu:0,is_backtogame:0,is_lock:0,is_focus_gift:0,is_bindphone:0,is_msgseccheck:0,is_checkbalance:0,is_showad:0,is_usercenter:0,is_kefu:0,is_score:0,is_query_products_info:0,is_event_track:0,is_blue_vip_function:0,is_subscribe_whats_new:0,msg_subscribe_code:0,is_get_scene_interface:0,is_show_vip:0,is_show_qqun:0}}init(){console.log("super init")}login(){console.log("super login")}logout(){console.log("super logout")}switchAccount(){console.log("super switchaccmount")}userCenter(){console.log("super userCenter")}submitData(){console.log("super submitData")}expansionInterface(n,t,i){var r,u;console.log("super expansionInterface");commonH5SDK.expansion_type.gameSetting==n?(r={code:0,message:"success",data:this.gameSettingData},i(r)):(u={code:-1,message:""},i(u))}createOrder(n){var t={onSuccess:function(t){commonH5SDK.h5Proxy.pay(n,t)},onFail:function(){console.log("create order fail");commonH5SDK.callback(commonH5SDK.code.PAY_FAIL,"创建订单错误")}};commonH5Utils.getInstance().payCheck(n,t)}pay(){console.log("super pay")}showExitDialog(){console.log("super showExitDialog")}exitGame(){}}
\ No newline at end of file
import commonBaseProxy from"./commonBaseProxy.js";import commonH5Utils from"./commonH5Utils.js";var n=require("./wxgame_sdk.js");export default class extends commonBaseProxy{constructor(){super()}init(){}login(){var i=commonH5Utils.getInstance().configInfoReturn.sdkAppId,t=commonH5Utils.getInstance();n.login(i,function(i,r){if(i==1){var u={gameSimpleName:t.sdkInfo.gameSimpleName,sdkSimpleName:t.sdkInfo.sdkSimpleName,sdkVersionCode:t.sdkInfo.sdkVersionCode,result:"",userType:"",openId:r.openId,userName:"",token:r.token,timestamp:r.timestamp,other:r.loginKey,serverSign:""};t.loginCheck(u);n.menuShareInit("")}else window.commonH5SDK.callback(commonH5SDK.code.LOGIN_FAIL,"sdk login fail"),console.log("login fail",r)})}submitData(t,i){switch(t){case window.commonH5SDK.type.enterGame:n.sdkUserCloudStorage("xizhai",i.roleLevel)}}pay(){}expansionInterface(t,i,r){switch(t){case commonH5SDK.expansion_type.mulShare:i&&i.type==0&&n.sdkShareContent(i.data);break;default:super.expansionInterface(t,i,r)}}}
\ No newline at end of file
import commonH5Proxy from"./commonH5Proxy.js";import commonH5Utils from"./commonH5Utils.js";window.commonH5SDK={sdk_isShowLog:!1,code:{INIT_SUCCESS:1,INIT_FAIL:-1,LOGIN_SUCCESS:10,LOGIN_FAIL:-10,LOGOUT_SUCCESS:100,LOGOUT_FAIL:-100,SWITCH_SUCCESS:1e3,SWITCH_FAIL:-1e3,PAY_SUCCESS:2,PAY_FAIL:-2,PAY_CANCEL:-3,EXIT_SUCCESS:4,EXIT_CANCEL:-4},type:{arriveServerSelectPage:1,createRole:2,enterGame:3,upRoleLevel:4,arriveEntrance:5,enterServer:6,arriveFirstScene:7,arriveLoadingFinish:8,arriveLoadingZero:9,arriveCreateRolePage:10,newcomerFinish:11,checkpointStart:12,checkpointEnd:13,selectRole:14,renameRole:15,newcomerStart:16},expansion_type:{gameSetting:100,downloadMicroClent:101,share:102,focus:103,save2Desktop:104,realVerify:105,back2Game:106,bindPhone:107,msgSecCheck:108,checkBalance:109,showAd:110,score:111,kefu:112,queryProductsInfo:113,userCenter:114,eventTrack:115,realNameVerify:116,mulShare:117,blueVip:118,blueVipBuy:119,whatsNewSubscriptionsSetting:120,subscribeWhatsNew:121,firstEnterGameScene:122,msgSubscribe:123},callback:{},h5Proxy:"",init:function(n,t){this.callback=t;var i=this,r={onCheckConfigSuccess:function(){i.h5Proxy=new commonH5Proxy;i.h5Proxy.init({});i.h5Proxy.hasInit||t(commonH5SDK.code.INIT_SUCCESS,"初始化成功")},onCheckConfigFail:function(){console.log("onCheckConfigFail");i.callback(i.code.INIT_FAIL,"初始化错误")}};commonH5Utils.getInstance().configCheck(n,r)},login:function(n){commonH5Utils.getInstance().submitInfo("event:openSDKLogin",null);this.h5Proxy.loginExt=n;this.h5Proxy.login(n)},pay:function(n){this.h5Proxy.createOrder(n)},hasLogout:function(){return this.h5Proxy.hasLogout},logout:function(){this.h5Proxy.logout()},hasSwitchAccount:function(){return this.h5Proxy.hasSwitchAccount},switchAccount:function(){return this.h5Proxy.switchAccount()},hasShowExitDialog:function(){return this.h5Proxy.hasExitDialog},showExitDialog:function(){this.h5Proxy.showExitDialog()},exitGame:function(){this.h5Proxy.exitGame()},submitData:function(n,t){console.log("submitData type:"+n);switch(n){case this.type.enterGame:commonH5Utils.getInstance().submitInfo("enter",t)}this.h5Proxy.submitData(n,t)},getParamValueByKey:function(n){return commonH5Utils.getInstance().sdkInfo[n]},expansionInterface:function(n,t,i){this.h5Proxy.expansionInterface(n,t,i)},statistics:function(n,t){var i={onStatisticsSuccess:function(){t.onStatisticsSuccess()},onStatisticsFail:function(){t.onStatisticsFail()}};commonH5Utils.getInstance().statistics(n,i)}};module{}.exports=window.commonH5SDK
\ No newline at end of file
var n=require("./commonMd5.js");export default class t{constructor(){this.checkConfigListener="";this.checkOrderListener="";this.statisticsListenerProxy="";this.location="";this.configInfoReturn;this.gzyasjhInfo={};this.configCheckUrl="https://static.public.sdk.guangkatf.com/config";this.sdkInfo={gameSimpleName:"",sdkSimpleName:"",sdkVersionCode:"",sdkClientVersion:"",loginCheckUrl:"",payOrderUrl:"",payCheckUrl:"",logReportUrl:"",statisticsUrl:"",channelParameter1:"",channelParameter2:"",channelId:"",custom:""};this.loginInfo={gameSimpleName:"",sdkSimpleName:"",sdkVersionCode:"",result:"",userType:"",openId:"",userName:"",sign:"",timestamp:"",other:"",serverSign:"",custom:"",custom2:"",di:"",nt:"",gv:"",ot:navigator.platform,imei:"",rl:"",c1:"",c2:""};this.payInfo={serverId:"",serverName:"",playerId:"",playerName:"",playerLevel:"",postAmount:"",productId:"",productName:"",productDesc:"",custom:"",exchange:"",otherInfo:"",timestamp:"",tsign:"",userId:"",di:"",nt:"",gv:"",ot:navigator.platform,imei:"",rl:"",c1:"",c2:"",coinName:"",coinNum:""};this.orderInfo={queryID:"",serverID:"",roleId:"",postTime:"",postAmount:"",productID:"",currency:"",other:"",products:"",danjiConfig:""};this.roleInfo={roleId:"",roleName:"",roleLevel:"",roleSex:"",serverId:"",serverName:"",roleCTime:"",partyName:"",roleType:"",roleChangeTime:"",vipLevel:"",diamond:"",moneyType:"",custom:""}}static getInstance(){return t.instance||(t.instance=new t),t.instance}connection(n,t,i){var u=this,r=new XMLHttpRequest,f,e;r.onreadystatechange=function(){if(r.readyState==4)if(r.status>=200&&r.status<300||r==304){u.sdkLog("H5SDKLog||"+n+"||Connect server successful:"+r.responseText);try{u.sdkLog(typeof r.responseText);u.responseListener(n,JSON.parse(r.responseText),r.status)}catch(t){u.sdkLog(t)}}else u.noResponse(n),u.sdkLog("H5SDKLog||"+n+"||Fail to connect server!");u.sdkLog("readyState: "+r.readyState)};n=="login"?(r.open("post",t,!1),f="data="+JSON.stringify(this.loginInfo),u.sdkLog("login url: "+t),u.sdkLog("login data: "+f),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.send(f)):n=="submitInfo"?(f=this.addUrlParam("",i),r.open("post",t,!1),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.send(f.substring(1))):n=="statistics"?(r.open("post",t,!1),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),f=JSON.stringify(i),r.send(f)):(n=="configInfo"?(t=t+"/"+this.sdkInfo.gameSimpleName+"/"+this.sdkInfo.sdkSimpleName+"/"+this.sdkInfo.sdkVersionCode+"/config.json",u.sdkLog("configInfo url:"+t)):n=="location"||(n=="payCheck"?(e=JSON.stringify(i),window.conch||(e=encodeURIComponent(e)),t=t+"/"+this.sdkInfo.gameSimpleName+"/"+this.sdkInfo.sdkSimpleName+"/"+this.sdkInfo.sdkVersionCode+"?data="+e):(t=t+"/"+this.sdkInfo.gameSimpleName+"/"+this.sdkInfo.sdkSimpleName+"/"+this.sdkInfo.sdkVersionCode,t=this.addUrlParam(t,i))),u.sdkLog(t),r.open("get",t,!1),r.send(null))}configCheck(n,t){typeof n=="string"&&(n=JSON.parse(n));for(var i in n)this.sdkInfo[i]=n[i],i==="otherInfo"&&this.setGzyasjhInfo(n[i]),this.sdkLog(this.sdkInfo[i]);this.checkConfigListener=t;this.sdkLog("H5SDKLog||Ask configCheck to server with sdkInfo:"+JSON.stringify(this.sdkInfo));this.connection("configInfo",this.configCheckUrl,this.sdkInfo)}loginCheck(n){for(var t in n)this.loginInfo[t]=n[t];this.loginInfo.sign=n.token;this.loginInfo.custom=commonH5SDK.h5Proxy.loginExt;this.loginInfo=this._addDataToTable(this.loginInfo);this.sdkLog("H5SDKLog||Ask loginCheck to server with loginInfo:"+JSON.stringify(this.loginInfo));this.connection("login",this.sdkInfo.loginCheckUrl,this.loginInfo)}payCheck(t,i){for(var r in t)this.payInfo[r]=t[r];t.openId!=undefined&&t.openId.length>0&&(this.payInfo.userId=t.openId);this.payInfo.tsign=n(this.payInfo.timestamp+"12*&#**@321");this.checkOrderListener=i;this.payInfo=this._addDataToTable(this.payInfo);this.sdkLog("H5SDKLog||Ask payCheck to server with payInfo:"+JSON.stringify(this.payInfo));this.connection("payCheck",this.sdkInfo.payOrderUrl,this.payInfo)}submitInfo(t,i){var f,e,u,r,s;if(i!=null)for(f in i)this.roleInfo[f]=i[f];e="";t.indexOf(":")!=-1&&(e=t.substring(t.indexOf(":")+1));u={pid:this.roleInfo.roleId,pn:this.roleInfo.roleName,sid:this.roleInfo.serverId,sn:this.roleInfo.serverName,lv:this.roleInfo.roleLevel,openId:this.loginInfo.openId,gameSimpleName:this.sdkInfo.gameSimpleName,sdkSimpleName:this.sdkInfo.sdkSimpleName,sdkVersionCode:this.sdkInfo.sdkVersionCode,di:"",nt:"",gv:"",ot:navigator.platform,imei:"",rl:"",c1:this.sdkInfo.channelParameter1,c2:this.sdkInfo.channelParameter2,eventName:e};u=this._addDataToTable(u);r=(new Date).getTime().toString();r=r.substring(0,r.length-3);this.sdkLog(JSON.stringify(u));var h="action="+t+"jssdk=yt="+r+"12909asdask23",o={action:t,data:JSON.stringify(u),jssdk:"y",t:r,ta:"default",test:"test",sign:n(h)};this.sdkLog("H5SDKLog||Submit to server with roleCheckInfo:"+JSON.stringify(o));s=this.sdkInfo.logReportUrl+"?ya_game="+this.sdkInfo.gameSimpleName+"&ya_sn="+this.sdkInfo.sdkSimpleName+"&ya_ssv="+this.sdkInfo.sdkVersionCode;this.connection("submitInfo",s,o)}statistics(n,t){this.statisticsListenerProxy=t;this.connection("statistics",this.sdkInfo.statisticsUrl,n)}addUrlParam(n,t){for(var i in t)n+=n.indexOf("?")==-1?"?":"&",n=n+i+"="+t[i];return n}responseListener(n,t,i){var f,u,e,r;if(n=="configInfo")t.code==1?(this.sdkInfo.payCheckUrl=t.data.payCheckUrl,this.sdkInfo.payOrderUrl=t.data.payOrderUrl,this.sdkInfo.loginCheckUrl=t.data.loginCheckUrl,this.sdkInfo.logReportUrl=t.data.logReportUrl,this.sdkInfo.channelParameter1=t.data.channelParameter1,this.sdkInfo.custom=t.data.custom,this.sdkInfo.channelId=t.data.channelSimpleName,this.loginInfo.c1=t.data.channelParameter1,this.payInfo.c1=t.data.channelParameter1,this.sdkInfo.channelParameter2=t.data.channelParameter2,this.loginInfo.c2=t.data.channelParameter2,this.payInfo.c2=t.data.channelParameter2,this.sdkLog("H5SDKLog||ConfigCheck successful with configInfo:"+JSON.parse(t.data.clientConfig)),this.configInfoReturn=JSON.parse(t.data.clientConfig),this.checkConfigListener.onCheckConfigSuccess()):(this.sdkLog("H5SDKLog||No configs!Please check whether the sdkInfo is matching or not!"),this.checkConfigListener.onCheckConfigFail());else if(n=="login")t.code==1?(this.sdkLog("H5SDKLog||LoginCheck successful with loginInfo:"+JSON.stringify(t)),this.loginInfo.openId=t.openId,this.payInfo.userId=t.openId,this.loginInfo.custom=commonH5SDK.h5Proxy.loginExt,t.custom=commonH5SDK.h5Proxy.loginExt,t.custom2=this.loginInfo.custom2,commonH5SDK.callback(commonH5SDK.code.LOGIN_SUCCESS,t)):(this.sdkLog("H5SDKLog||LoginCheck fail with message:"+t.message),commonH5SDK.callback(commonH5SDK.code.LOGIN_FAIL,"login error"));else if(n=="payCheck"){for(r in t)r=="code"?f=t[r]:r=="data"?u=t[r]:r=="message"&&(e=t[r]);if(this.sdkLog(f),this.sdkLog(u),this.sdkLog(e),f==1){this.sdkLog("H5SDKLog||PayCheck successful with orderInfo:"+JSON.stringify(u));this.checkOrderListener.onSuccess(u)}else this.sdkLog("H5SDKLog||PayCheck fail with message:"+e),this.checkOrderListener.onFail()}else n=="roleInfo"?this.sdkLog("H5SDKLog||Submit roleInfo result:"+t):n=="statistics"?i==200?(this.sdkLog("H5SDKLog||Statistics result:"+i),this.statisticsListenerProxy.onStatisticsSuccess()):(this.sdkLog("H5SDKLog||Statistics result:"+i),this.statisticsListenerProxy.onStatisticsFail()):n=="location"&&(t.code==0?(this.location=t.data,this.sdkLog("Location:"+t.data)):this.sdkLog("Location:Fail!"))}noResponse(n){n=="configInfo"?this.checkConfigListener.onCheckConfigFail():n=="login"?commonH5SDK.callback(commonH5SDK.code.LOGIN_FAIL,"login check network error"):n=="payCheck"?this.checkOrderListener.onFail():n=="roleInfo"||(n=="statistics"?this.statisticsListenerProxy.onStatisticsFail():n=="location"&&this.sdkLog("Location:Fail!"))}setGzyasjhInfo(n){if(n&&n.length>0){var t=JSON.parse(decodeURIComponent(n));t&&(this.gzyasjhInfo=t)}typeof this.gzyasjhInfo!="object"&&(this.gzyasjhInfo={})}_addDataToTable(n){if(typeof n=="object"){var t=navigator.platform;this.gzyasjhInfo.ot==null&&navigator.userAgent&&(t=t+"|"+JSON.stringify(this.allinfo()));n.di=this.gzyasjhInfo.di||"";n.nt=this.gzyasjhInfo.nt||"";n.gv=this.gzyasjhInfo.gv||"";n.ot=(this.gzyasjhInfo.ot||"")+"|"+t;n.imei=this.gzyasjhInfo.imei||"";n.rl=this.gzyasjhInfo.rl||""}return n}allinfo(){return{userAgent:(navigator.userAgent||"").replace(/[;/]/g," "),appName:navigator.appName||"",appVersion:(navigator.appVersion||"").replace(/[;/]/g," "),cookieEnabled:navigator.cookieEnabled||"",cpuClass:navigator.cpuClass||"",mimeType:navigator.mimeTypes||"",platform:navigator.platform||"",userLanguage:navigator.userLanguage||"",systemLanguage:navigator.systemLanguage||"",oscpu:navigator.oscpu||"",product:navigator.product||"",productSub:navigator.productSub||"",vender:navigator.vender||"",vendorSub:navigator.vendorSub||"",webkitPersistentStorage:navigator.webkitPersistentStorage||"",language:navigator.language||"",appCodeName:navigator.appCodeName||""}}getPayUrlCallBack(){return this.sdkInfo.payCheckUrl+"/"+this.sdkInfo.gameSimpleName+"/"+this.sdkInfo.sdkSimpleName+"/"+this.sdkInfo.sdkVersionCode}sdkLog(n){commonH5SDK.sdk_isShowLog&&console.log("commonH5SDK:"+n)}}
\ No newline at end of file
function common_md5(n){function a(n,t){return n<<t|n>>>32-t}function o(n,t){var f,e,r,u,i;return(r=n&2147483648,u=t&2147483648,f=n&1073741824,e=t&1073741824,i=(n&1073741823)+(t&1073741823),f&e)?i^2147483648^r^u:f|e?i&1073741824?i^3221225472^r^u:i^1073741824^r^u:i^r^u}function vt(n,t,i){return n&t|~n&i}function yt(n,t,i){return n&i|t&~i}function pt(n,t,i){return n^t^i}function wt(n,t,i){return t^(n|~i)}function s(n,t,i,r,u,f,e){return n=o(n,o(o(vt(t,i,r),u),e)),o(a(n,f),t)}function h(n,t,i,r,u,f,e){return n=o(n,o(o(yt(t,i,r),u),e)),o(a(n,f),t)}function c(n,t,i,r,u,f,e){return n=o(n,o(o(pt(t,i,r),u),e)),o(a(n,f),t)}function l(n,t,i,r,u,f,e){return n=o(n,o(o(wt(t,i,r),u),e)),o(a(n,f),t)}function bt(n){for(var r,u=n.length,o=u+8,s=(o-o%64)/64,e=(s+1)*16,i=Array(e-1),f=0,t=0;t<u;)r=(t-t%4)/4,f=t%4*8,i[r]=i[r]|n.charCodeAt(t)<<f,t++;return r=(t-t%4)/4,f=t%4*8,i[r]=i[r]|128<<f,i[e-2]=u<<3,i[e-1]=u>>>29,i}function v(n){for(var i="",r="",u,t=0;t<=3;t++)u=n>>>t*8&255,r="0"+u.toString(16),i=i+r.substr(r.length-2,2);return i}function kt(n){var i,r,t;for(n=n.replace(/\r\n/g,"\n"),i="",r=0;r<n.length;r++)t=n.charCodeAt(r),t<128?i+=String.fromCharCode(t):t>127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128));return i}var e=Array(),f,ht,ct,lt,at,t,i,r,u,y=7,p=12,w=17,b=22,k=5,d=9,g=14,nt=20,tt=4,it=11,rt=16,ut=23,ft=6,et=10,ot=15,st=21;for(n=kt(n),e=bt(n),t=1732584193,i=4023233417,r=2562383102,u=271733878,f=0;f<e.length;f+=16)ht=t,ct=i,lt=r,at=u,t=s(t,i,r,u,e[f+0],y,3614090360),u=s(u,t,i,r,e[f+1],p,3905402710),r=s(r,u,t,i,e[f+2],w,606105819),i=s(i,r,u,t,e[f+3],b,3250441966),t=s(t,i,r,u,e[f+4],y,4118548399),u=s(u,t,i,r,e[f+5],p,1200080426),r=s(r,u,t,i,e[f+6],w,2821735955),i=s(i,r,u,t,e[f+7],b,4249261313),t=s(t,i,r,u,e[f+8],y,1770035416),u=s(u,t,i,r,e[f+9],p,2336552879),r=s(r,u,t,i,e[f+10],w,4294925233),i=s(i,r,u,t,e[f+11],b,2304563134),t=s(t,i,r,u,e[f+12],y,1804603682),u=s(u,t,i,r,e[f+13],p,4254626195),r=s(r,u,t,i,e[f+14],w,2792965006),i=s(i,r,u,t,e[f+15],b,1236535329),t=h(t,i,r,u,e[f+1],k,4129170786),u=h(u,t,i,r,e[f+6],d,3225465664),r=h(r,u,t,i,e[f+11],g,643717713),i=h(i,r,u,t,e[f+0],nt,3921069994),t=h(t,i,r,u,e[f+5],k,3593408605),u=h(u,t,i,r,e[f+10],d,38016083),r=h(r,u,t,i,e[f+15],g,3634488961),i=h(i,r,u,t,e[f+4],nt,3889429448),t=h(t,i,r,u,e[f+9],k,568446438),u=h(u,t,i,r,e[f+14],d,3275163606),r=h(r,u,t,i,e[f+3],g,4107603335),i=h(i,r,u,t,e[f+8],nt,1163531501),t=h(t,i,r,u,e[f+13],k,2850285829),u=h(u,t,i,r,e[f+2],d,4243563512),r=h(r,u,t,i,e[f+7],g,1735328473),i=h(i,r,u,t,e[f+12],nt,2368359562),t=c(t,i,r,u,e[f+5],tt,4294588738),u=c(u,t,i,r,e[f+8],it,2272392833),r=c(r,u,t,i,e[f+11],rt,1839030562),i=c(i,r,u,t,e[f+14],ut,4259657740),t=c(t,i,r,u,e[f+1],tt,2763975236),u=c(u,t,i,r,e[f+4],it,1272893353),r=c(r,u,t,i,e[f+7],rt,4139469664),i=c(i,r,u,t,e[f+10],ut,3200236656),t=c(t,i,r,u,e[f+13],tt,681279174),u=c(u,t,i,r,e[f+0],it,3936430074),r=c(r,u,t,i,e[f+3],rt,3572445317),i=c(i,r,u,t,e[f+6],ut,76029189),t=c(t,i,r,u,e[f+9],tt,3654602809),u=c(u,t,i,r,e[f+12],it,3873151461),r=c(r,u,t,i,e[f+15],rt,530742520),i=c(i,r,u,t,e[f+2],ut,3299628645),t=l(t,i,r,u,e[f+0],ft,4096336452),u=l(u,t,i,r,e[f+7],et,1126891415),r=l(r,u,t,i,e[f+14],ot,2878612391),i=l(i,r,u,t,e[f+5],st,4237533241),t=l(t,i,r,u,e[f+12],ft,1700485571),u=l(u,t,i,r,e[f+3],et,2399980690),r=l(r,u,t,i,e[f+10],ot,4293915773),i=l(i,r,u,t,e[f+1],st,2240044497),t=l(t,i,r,u,e[f+8],ft,1873313359),u=l(u,t,i,r,e[f+15],et,4264355552),r=l(r,u,t,i,e[f+6],ot,2734768916),i=l(i,r,u,t,e[f+13],st,1309151649),t=l(t,i,r,u,e[f+4],ft,4149444226),u=l(u,t,i,r,e[f+11],et,3174756917),r=l(r,u,t,i,e[f+2],ot,718787259),i=l(i,r,u,t,e[f+9],st,3951481745),t=o(t,ht),i=o(i,ct),r=o(r,lt),u=o(u,at);return(v(t)+v(i)+v(r)+v(u)).toLowerCase()}module.exports=common_md5
\ No newline at end of file
function wxNetworkRequest(n,t,i,r){wx.request({url:"https://sdk.xizhai2021.com"+n,data:t,header:{"content-type":r},method:"POST",success(n){console.log(n.data);i&&i(1,n.data)},fail(n){console.log(n);i&&i(0,"network request error")}})}function loginDataHandler(n,t){var u=n;if(u.code==0){var i=u.msg,f=i.open_id,e=i.login_key,s=i.token,h=i.pay_channel_id,r=i.wechat,o=r.openid,c=r.unionid,l=r.session_key,a=i.share_str,v=i.share_pic,y=i.timestamp;try{wx.setStorageSync("common_sdkOpenId",f+"");wx.setStorageSync("common_wxOpenId",o);wx.setStorageSync("common_wxUnionid",c);wx.setStorageSync("common_sdkLoginKey",e);wx.setStorageSync("common_sdkPayChannelId",h);wx.setStorageSync("common_wxSessionKey",l);wx.setStorageSync("common_wxShareTitle",a);wx.setStorageSync("common_wxShareImage",v)}catch(p){}t(1,{openId:f,loginKey:e,token:s,wxOpenId:o,timestamp:y})}else console.log("loginResult:",n),t(0,"server callback error")}function commonSdkLogin(n,t){console.log("commonSdkLogin1111");wx.setStorageSync("common_sdkAppId",n);console.log("commonSdkLogin");wx.login({success(i){if(i.code){var r="code="+i.code+"&app_id="+n;wxNetworkRequest("/sdk/login?format=json&type=7&mk=",r,function(n,i){n==1?loginDataHandler(i,t):t(0,"login fail")},"application/x-www-form-urlencoded")}else t&&t(0,i.errMsg)}})}function wxMenuShareInit(n){wxMenuShareInit2(wx.getStorageSync("common_wxShareTitle"),wx.getStorageSync("common_wxShareImage"),n)}function wxMenuShareInit2(n,t,i){wx.showShareMenu({withShareTicket:!0});wx.onShareAppMessage(function(){return{title:n,imageUrl:t,query:i}})}function wxSdkShareContent(n){wxSdkShareContent2(wx.getStorageSync("common_wxShareTitle"),wx.getStorageSync("common_wxShareImage"),n)}function wxSdkShareContent2(n,t,i){wx.shareAppMessage({title:n,imageUrl:t,query:i})}function wxMenuShareTimelineInit(n){wxMenuShareTimelineInit2(wx.getStorageSync("common_wxShareTitle"),wx.getStorageSync("common_wxShareImage"),n)}function wxMenuShareTimelineInit2(n,t,i){wx.showShareMenu({withShareTicket:!0});wx.onShareTimeline(function(){return{title:n,imageUrl:t,query:i}})}function wxUserCloudStorage(n,t){var i={wxgame:{score:parseInt(t),update_time:Date.parse(new Date)/1e3}},r={key:n,value:JSON.stringify(i)};wx.setUserCloudStorage({KVDataList:[r]})}function sdkConfirmOrderRequest(){}function sdkCreateOrderRequest(n,t){var i="role_name="+n.roleName;i+="&encode=0";i+="&login_key="+wx.getStorageSync("common_sdkLoginKey");i+="&pay_channel_id="+wx.getStorageSync("common_sdkPayChannelId");i+="&productid="+n.productId;i+="&money="+n.amount;i+="&open_id="+wx.getStorageSync("common_sdkOpenId");i+="&role_id="+n.roleId;i+="&callback="+n.orderId;i+="&game_amount="+n.exchage*n.amount;i+="&serverid="+n.serverId;i+="&app_id="+wx.getStorageSync("common_sdkAppId");i+="&wx_open_id="+wx.getStorageSync("common_wxOpenId");wxNetworkRequest("/sdk/pay?format=json",i,t,"application/x-www-form-urlencoded")}function wxSdkPay(n){sdkCreateOrderRequest(n,function(n,t){console.log("create order result:"+t)})}module{}.exports={login:commonSdkLogin,menuShareInit:wxMenuShareInit,menuShareInit2:wxMenuShareInit2,sdkShareContent:wxSdkShareContent,menuShareTimeline:wxMenuShareTimelineInit,menuShareTimeline2:wxMenuShareTimelineInit2,sdkUserCloudStorage:wxUserCloudStorage,sdkPay:wxSdkPay}
\ No newline at end of file
This diff is collapsed. Click to expand it.
http://gitlab.9133.com:10080/sdk_9133/sdk_public_android/edit/master/doc/%E5%85%AC%E5%85%B1SDK%E6%9C%8D%E5%8A%A1%E7%AB%AF%E6%8E%A5%E5%85%A5%E6%96%87%E6%A1%A3.md
\ No newline at end of file