fengcong 5 лет назад
Родитель
Сommit
83c632d79b

+ 8 - 0
assets/script/game/data/GameData.ts

@@ -24,6 +24,9 @@ export class GameData {
     public gameData: PlayerProp = null;
     public gameData: PlayerProp = null;
     /** 标志位:刷新主界面货币 */
     /** 标志位:刷新主界面货币 */
     public init_coin: boolean = false;
     public init_coin: boolean = false;
+    
+     /** 标志位:刷新主界面头像 */
+    public init_head:boolean = false;
 
 
     public props: Map<number, number> = new Map<number, number>();
     public props: Map<number, number> = new Map<number, number>();
 
 
@@ -394,3 +397,8 @@ export enum EVENT_TYPE {
     BACK_WxAuth = "BACK_WxAuth",
     BACK_WxAuth = "BACK_WxAuth",
     UPDATE_CashNum = "UPDATE_CashNum",
     UPDATE_CashNum = "UPDATE_CashNum",
 }
 }
+
+export enum StorageKey{
+
+    
+}

+ 90 - 57
assets/script/game/data/LoginData.ts

@@ -6,13 +6,15 @@ import { StorageKey } from "./StorageData";
  */
  */
 export class LoginData {
 export class LoginData {
 
 
-    public loadResCompelete: boolean = false;   
+    public loadResCompelete: boolean = false;
 
 
     /** 是否登录 */
     /** 是否登录 */
     public isLogin: boolean = false;
     public isLogin: boolean = false;
 
 
     public sessionKey: string = '';
     public sessionKey: string = '';
 
 
+    public randomKey: string = "abcdefghijklopqrstuvwxyzabcdefgh";
+
     /** 玩家唯一id */
     /** 玩家唯一id */
     public uin: string = '';
     public uin: string = '';
 
 
@@ -53,20 +55,20 @@ export class LoginData {
     }
     }
 
 
     /**
     /**
-     * 登录流程 initApp-->initAd-->connect-->wxLogin-->checkLogin-->getAccountInfo
+     * 初始化
      */
      */
-    public async login() {
-        mk.pool.init(gData.gameData.pools);
-        gData.appData.init();
-        gData.adData.init();
+    public init() {
+        let uin = mk.storage.getStorage(StorageKey.uin);
+        this.uin = uin ? uin : "";
+        let sessionKey = mk.storage.getStorage(StorageKey.sessionKey);
+        this.sessionKey = sessionKey ? sessionKey : "";
+    }
 
 
-        //测试参数
-        if (cc.sys.os == cc.sys.OS_ANDROID) {
-            mk.ad.ifShowAd = true;
-        }
-        else {
-            mk.ad.ifShowAd = false;
-        }
+    /**
+     * 登录流程 
+     * @description initApp-->initAd-->connect-->wxLogin-->checkLogin-->getAccountInfo
+     */
+    public async login() {
 
 
         //有登录记录直接跳转到登录流程最后一步
         //有登录记录直接跳转到登录流程最后一步
         if (this.sessionKey != '' && this.uin != '') {
         if (this.sessionKey != '' && this.uin != '') {
@@ -74,40 +76,58 @@ export class LoginData {
             this.getAccountInfo();
             this.getAccountInfo();
             return;
             return;
         }
         }
-        console.log("=== login 无登录记录");
-        
-        let ranKey = mk.encrypt.randomString();
+        else {
+            console.log("=== login 无登录记录");
+            this.connect();
+        }
+
+    }
+
+    /**
+     * 链接 
+     * @description 获取临时的uin
+     */
+    private async connect() {
+        //connect
+        this.randomKey = mk.encrypt.randomString();
         let data: any = {
         let data: any = {
             "mac": gData.appData.mac,
             "mac": gData.appData.mac,
-            "psk": ranKey,
+            "psk": this.randomKey,
             "appId": gData.appData.appId
             "appId": gData.appData.appId
         }
         }
 
 
-        //connect
         let response = await mk.http.sendRequest('connectTest', 'POST', JSON.stringify(data));
         let response = await mk.http.sendRequest('connectTest', 'POST', JSON.stringify(data));
         if (response.errcode != 0) {
         if (response.errcode != 0) {
             return;
             return;
         }
         }
-        data = mk.encrypt.decrypt(response.encrypt, ranKey, gData.appData.appId);
+        data = mk.encrypt.decrypt(response.encrypt, this.randomKey, gData.appData.appId);
+        console.log("[FC]connectTest decryptData", data);
         this.tempUin = JSON.parse(data).tmp_uin;
         this.tempUin = JSON.parse(data).tmp_uin;
+        mk.storage.setStorage(StorageKey.uin, this.tempUin);
+        this.wxLogin();
+    }
 
 
+    public async wxLogin() {
         //wxLogin
         //wxLogin
+        let data;
         let encode;
         let encode;
-        if (gData.wechatData.code != null) {//微信登录
+        if (gData.wechatData.code != null) {
+            //微信登录
             encode = mk.encrypt.encrypt(JSON.stringify({ "code": gData.wechatData.code }), this.sessionKey, gData.appData.appId);
             encode = mk.encrypt.encrypt(JSON.stringify({ "code": gData.wechatData.code }), this.sessionKey, gData.appData.appId);
             data = {
             data = {
                 "uin": this.uin,
                 "uin": this.uin,
                 "encrypt": encode
                 "encrypt": encode
             };
             };
         }
         }
-        else {//游客登录
-            encode = mk.encrypt.encrypt(JSON.stringify({ "code": '' }), ranKey, gData.appData.appId);
+        else {
+            //游客登录
+            encode = mk.encrypt.encrypt(JSON.stringify({ "code": '' }), this.randomKey, gData.appData.appId);
             data = {
             data = {
                 "uin": this.tempUin,
                 "uin": this.tempUin,
                 "encrypt": encode
                 "encrypt": encode
             };
             };
         }
         }
-        response = await mk.http.sendRequest('wxlogin', 'POST', JSON.stringify(data), false, false);
+        let response = await mk.http.sendRequest('wxlogin', 'POST', JSON.stringify(data), false, false);
         if (response.errcode != 0) {
         if (response.errcode != 0) {
             if (response.errcode == -10003 || response.errcode == -20003) {
             if (response.errcode == -10003 || response.errcode == -20003) {
                 //清除缓存
                 //清除缓存
@@ -119,13 +139,14 @@ export class LoginData {
             data = mk.encrypt.decrypt(response.encrypt, this.sessionKey, gData.appData.appId);
             data = mk.encrypt.decrypt(response.encrypt, this.sessionKey, gData.appData.appId);
         }
         }
         else {
         else {
-            data = mk.encrypt.decrypt(response.encrypt, ranKey, gData.appData.appId);
+            data = mk.encrypt.decrypt(response.encrypt, this.randomKey, gData.appData.appId);
         }
         }
         data = JSON.parse(data);
         data = JSON.parse(data);
         this.loginTicket = data.login_ticket;
         this.loginTicket = data.login_ticket;
+        console.log("[FC]wxLoginTest decrypt", data);
         mk.storage.setStorage(StorageKey.loginTicket, this.loginTicket);
         mk.storage.setStorage(StorageKey.loginTicket, this.loginTicket);
 
 
-        let isFirstIn = mk.storage.getStorage('isFirstIn');
+        let isFirstIn = mk.storage.getStorage(StorageKey.isFirstIn);
         if (isFirstIn == null) {
         if (isFirstIn == null) {
             this.isFirstIn = true;
             this.isFirstIn = true;
             mk.storage.setStorage(StorageKey.isFirstIn, 1);
             mk.storage.setStorage(StorageKey.isFirstIn, 1);
@@ -138,11 +159,15 @@ export class LoginData {
         else {
         else {
             this.isNew = true;
             this.isNew = true;
         }
         }
-        mk.console.log("uin:", this.uin);
         mk.storage.setStorage(StorageKey.uin, this.uin);
         mk.storage.setStorage(StorageKey.uin, this.uin);
+        this.checkLogin();
+    }
 
 
-        console.log('uin  ', this.uin)
-        console.log('tempUin  ', this.tempUin)
+    /**
+     * 检测登录
+     * @returns 
+     */
+    private async checkLogin() {
         //checkLogin
         //checkLogin
         let tmp_key = '';
         let tmp_key = '';
         if (gData.wechatData.code != null) {
         if (gData.wechatData.code != null) {
@@ -152,49 +177,56 @@ export class LoginData {
             tmp_key = mk.encrypt.randomString();
             tmp_key = mk.encrypt.randomString();
         }
         }
 
 
-        data = {
+        let data = {
             "tmp_key": tmp_key,
             "tmp_key": tmp_key,
             "uin": this.uin,
             "uin": this.uin,
             "login_ticket": this.loginTicket,
             "login_ticket": this.loginTicket,
             "appId": gData.appData.appId
             "appId": gData.appData.appId
         }
         }
-        response = await mk.http.sendRequest('checklogin', 'POST', JSON.stringify(data));
+        let response = await mk.http.sendRequest('checklogin', 'POST', JSON.stringify(data));
         if (response.errcode != 0) {
         if (response.errcode != 0) {
             return;
             return;
         }
         }
+        let decryptData;
         if (gData.wechatData.code != null) {
         if (gData.wechatData.code != null) {
-            data = mk.encrypt.decrypt(response.encrypt, this.sessionKey, gData.appData.appId);
+            decryptData = mk.encrypt.decrypt(response.encrypt, this.sessionKey, gData.appData.appId);
         }
         }
         else {
         else {
-            data = mk.encrypt.decrypt(response.encrypt, tmp_key, gData.appData.appId);
+            decryptData = mk.encrypt.decrypt(response.encrypt, tmp_key, gData.appData.appId);
         }
         }
 
 
-        data = JSON.parse(data);
-        this.sessionKey = data.session_key;
-
-        mk.storage.setStorage('sessionKey', this.sessionKey);
+        let parseData = JSON.parse(decryptData);
+        this.sessionKey = parseData.session_key;
+        console.log("[FC]checkLogin decrypt", parseData);
+        mk.storage.setStorage(StorageKey.sessionKey, this.sessionKey);
+        this.getUserInfo();
+    }
 
 
-        if (gData.wechatData.code != null) {
-            if (this.isNew) {//玩过此游戏并且本地数据是本机的
-                this.getAccountInfo();
-            }
-            else {//玩过此游戏 但 本地数据不是本账户的 清空数据 重新登录游戏
-                this.isNew = false;
-                gData.wechatData.code = null;
-                this.reload();
-            }
-        }
-        else {
-            this.getAccountInfo();
-        }
+    private async getUserInfo() {
+        
+        // if (gData.wechatData.code != null) {
+        //     if (this.isNew) {//玩过此游戏并且本地数据是本机的
+        //         this.getAccountInfo();
+        //     }
+        //     else {//玩过此游戏 但 本地数据不是本账户的 清空数据 重新登录游戏
+        //         this.isNew = false;
+        //         gData.wechatData.code = null;
+        //         this.reload();
+        //     }
+        // }
+        // else {
+        //     this.getAccountInfo();
+        // }
+
+        this.getAccountInfo();
     }
     }
 
 
     private async getAccountInfo() {
     private async getAccountInfo() {
-        let nickname = mk.storage.getStorage(StorageKey.nickname);
-        if (nickname) {
-            gData.wechatData.nickName = nickname;
-        }
-        else {
+        // let nickname = mk.storage.getStorage(StorageKey.nickname);
+        // if (nickname) {
+        //     gData.wechatData.nickName = nickname;
+        // }
+        // else {
             let aa = {
             let aa = {
                 "uin": this.uin,
                 "uin": this.uin,
                 "login_ticket": this.loginTicket
                 "login_ticket": this.loginTicket
@@ -215,22 +247,23 @@ export class LoginData {
             }
             }
             response = mk.http.checkData(response, true);
             response = mk.http.checkData(response, true);
             data = response.data;
             data = response.data;
+            mk.console.logSingle("[FC] getAccountInfo decrypt", data);
             this.isAuth = data.is_auth;
             this.isAuth = data.is_auth;
             if (this.isAuth) {
             if (this.isAuth) {
                 gData.wechatData.nickName = data.nickname;
                 gData.wechatData.nickName = data.nickname;
                 gData.wechatData.avatar = data.headimgurl;
                 gData.wechatData.avatar = data.headimgurl;
+                gData.gameData.init_head = true;
                 mk.storage.setStorage(StorageKey.isAuth, 1);
                 mk.storage.setStorage(StorageKey.isAuth, 1);
                 mk.storage.setStorage(StorageKey.nickname, gData.wechatData.nickName, false);
                 mk.storage.setStorage(StorageKey.nickname, gData.wechatData.nickName, false);
                 mk.storage.setStorage(StorageKey.avatar, gData.wechatData.avatar, false);
                 mk.storage.setStorage(StorageKey.avatar, gData.wechatData.avatar, false);
             }
             }
-        }
+
+        // }
 
 
         //获取游戏数据
         //获取游戏数据
         gData.gameData.init();
         gData.gameData.init();
     }
     }
 
 
-
-
     /**
     /**
      * 本地数据不是本账户的 清空数据 重新登录游戏
      * 本地数据不是本账户的 清空数据 重新登录游戏
      */
      */

+ 15 - 1
assets/script/game/game/Game.ts

@@ -36,7 +36,7 @@ export default class Game extends cc.Component {
 
 
     @property({ type: cc.Node, displayName: "顶部ui组" })
     @property({ type: cc.Node, displayName: "顶部ui组" })
     node_top_ui: cc.Node = null;
     node_top_ui: cc.Node = null;
- 
+
 
 
     onLoad() {
     onLoad() {
         gData.gameData.gameStyle = this;
         gData.gameData.gameStyle = this;
@@ -53,9 +53,14 @@ export default class Game extends cc.Component {
         if (gData.gameData.init_coin) {
         if (gData.gameData.init_coin) {
             this.initInfo();
             this.initInfo();
         }
         }
+
+        if (gData.gameData.init_head) {
+            this.initHead();
+        }
     }
     }
     lateUpdate() {
     lateUpdate() {
         gData.gameData.init_coin = false;
         gData.gameData.init_coin = false;
+        gData.gameData.init_head = false;
     }
     }
 
 
     private initMusic() {
     private initMusic() {
@@ -86,6 +91,11 @@ export default class Game extends cc.Component {
         this.lbl_rmb.string = gData.gameData.gameData.piggyBank + "";
         this.lbl_rmb.string = gData.gameData.gameData.piggyBank + "";
     }
     }
 
 
+    private async initHead() {
+        let result = await mk.loader.loadRemote(gData.wechatData.avatar + "?aaa=aa.jpg", null);
+        this.img_head.spriteFrame = new cc.SpriteFrame(result);
+    }
+
     //测试道具获取效果
     //测试道具获取效果
     private testFly() {
     private testFly() {
         mk.fly.PlayCoinAnim(1, 20, cc.v2(0, -300), cc.v2(0, 0));
         mk.fly.PlayCoinAnim(1, 20, cc.v2(0, -300), cc.v2(0, 0));
@@ -100,6 +110,10 @@ export default class Game extends cc.Component {
 
 
     /**点击分享 */
     /**点击分享 */
     public onClickShare() {
     public onClickShare() {
+        if (!gData.loginData.isAuth) {
+            mk.tip.pop("请先点击头像,在设置界面授权");
+            return;
+        }
         JsbSystem.sharePic();
         JsbSystem.sharePic();
     }
     }
 }
 }

+ 19 - 2
assets/script/game/module/login/Login.ts

@@ -21,6 +21,12 @@ export default class Login extends cc.Component {
     }
     }
 
 
     start() {
     start() {
+        if (JsbSystem.getWxAppId()) {
+            //获取微信id
+            gData.appData.appId = JsbSystem.getWxAppId();
+        }
+
+        //获取设备信息
         JsbSystem.getDeviceInfo();
         JsbSystem.getDeviceInfo();
     }
     }
 
 
@@ -37,11 +43,12 @@ export default class Login extends cc.Component {
         }
         }
         if (gData.loginData.loadResCompelete) {
         if (gData.loginData.loadResCompelete) {
             if (gData.appData.getDeviceInfoCompelete) {
             if (gData.appData.getDeviceInfoCompelete) {
-                gData.loginData.login();
+                this.login();
                 gData.appData.getDeviceInfoCompelete = false;
                 gData.appData.getDeviceInfoCompelete = false;
             }
             }
             else if (gData.gameData.dataFinish) {//登录流程完毕
             else if (gData.gameData.dataFinish) {//登录流程完毕
-                if (!mk.storage.getStorage('notShowAgreementTip')) {//!mk.storage.getStorage('notShowAgreementTip')
+                if (!mk.storage.getStorage('notShowAgreementTip')) {
+                    //!mk.storage.getStorage('notShowAgreementTip')
                     mk.ui.openPanel("module/agreementTip/agreementTip");
                     mk.ui.openPanel("module/agreementTip/agreementTip");
                 } else {
                 } else {
                     mk.ui.openPanel("game/prefab/game");
                     mk.ui.openPanel("game/prefab/game");
@@ -53,6 +60,16 @@ export default class Login extends cc.Component {
         else {
         else {
             gData.loginData.loadLocalRes();
             gData.loginData.loadLocalRes();
         }
         }
+    }
 
 
+    public login() {
+        //初始化相关数据
+        mk.pool.init(gData.gameData.pools);
+        gData.appData.init();
+        gData.adData.init();
+        gData.loginData.init();
+        console.log("[FC] gData.appData.appId", gData.appData.appId);
+        //登录
+        gData.loginData.login();
     }
     }
 }
 }

+ 11 - 9
assets/script/game/module/setting/Setting.ts

@@ -29,14 +29,13 @@ export default class Setting extends cc.Component {
         this.initData();
         this.initData();
     }
     }
 
 
-    start()
-    {
+    start() {
 
 
     }
     }
 
 
     private async initData() {
     private async initData() {
-        console.log("=== gData.wechatData.unionid",gData.wechatData.unionid);
-        console.log("=== gData.wechatData.nickName",gData.wechatData.nickName);
+        console.log("=== gData.wechatData.unionid", gData.wechatData.unionid);
+        console.log("=== gData.wechatData.nickName", gData.wechatData.nickName);
         this.lbl_id.string = "ID:" + gData.wechatData.unionid;
         this.lbl_id.string = "ID:" + gData.wechatData.unionid;
         this.lbl_nickname.string = gData.wechatData.nickName;
         this.lbl_nickname.string = gData.wechatData.nickName;
         let music = "module/setting/texture/" + (mk.audio.getSwitchMusic() ? "on" : "off");
         let music = "module/setting/texture/" + (mk.audio.getSwitchMusic() ? "on" : "off");
@@ -44,9 +43,10 @@ export default class Setting extends cc.Component {
         this.img_music.spriteFrame = await mk.loader.load(music, cc.SpriteFrame);
         this.img_music.spriteFrame = await mk.loader.load(music, cc.SpriteFrame);
         this.img_effect.spriteFrame = await mk.loader.load(effect, cc.SpriteFrame);
         this.img_effect.spriteFrame = await mk.loader.load(effect, cc.SpriteFrame);
 
 
-
-        let result = await mk.loader.loadRemote(gData.wechatData.avatar, null);
-        console.log("loadHead:", result);
+        console.log("=== gData.wechatData.avatar", gData.wechatData.avatar);
+        let result = await mk.loader.loadRemote(gData.wechatData.avatar+"?aaa=aa.jpg", null);
+        this.img_head.spriteFrame = new cc.SpriteFrame(result);
+        console.log("=== loadHead:", result);
         // this.img_head.spriteFrame = result;
         // this.img_head.spriteFrame = result;
     }
     }
 
 
@@ -78,8 +78,10 @@ export default class Setting extends cc.Component {
 
 
     /** 点击微信授权 */
     /** 点击微信授权 */
     onClickWxAuth() {
     onClickWxAuth() {
-        mk.ui.closePanel(this.node.name);
-        JsbSystem.WxAuth();
+        if (!gData.loginData.isAuth) {
+            mk.ui.closePanel(this.node.name);
+            JsbSystem.WxAuth();
+        }
     }
     }
 
 
     async clickRule(data) {
     async clickRule(data) {

+ 9 - 0
assets/script/mk/system/AdSystem.ts

@@ -26,6 +26,15 @@ export default class AdSystem {
 
 
     /** 初始化广告 */
     /** 初始化广告 */
     public init() {
     public init() {
+        
+        //判定下平台
+        if (cc.sys.os == cc.sys.OS_ANDROID) {
+            mk.ad.ifShowAd = true;
+        }
+        else {
+            mk.ad.ifShowAd = false;
+        }
+
         //初始化Topon广告SDK
         //初始化Topon广告SDK
         this.adSdk.initSDK();
         this.adSdk.initSDK();
     }
     }

+ 7 - 7
assets/script/mk/system/JsbSystem.ts

@@ -1,3 +1,5 @@
+import { StorageKey } from "../../game/data/StorageData";
+
 /**
 /**
  * Jsb管理类(与安卓Java类或者IOS交互)
  * Jsb管理类(与安卓Java类或者IOS交互)
  * @description
  * @description
@@ -108,10 +110,10 @@ export default class JsbSystem {
     public static getWxAppId() {
     public static getWxAppId() {
         let appid = "";
         let appid = "";
         if (cc.sys.os == cc.sys.OS_ANDROID) {
         if (cc.sys.os == cc.sys.OS_ANDROID) {
-            appid = this.callStaticMethod(this._JSB_ANDROID_PATH, "getWXAppId", "()Ljava/lang/String;");
+            appid = this.callStaticMethod(this._JSB_ANDROID_PATH, "getWxAppId", "()Ljava/lang/String;");
         }
         }
         else if (cc.sys.os == cc.sys.OS_IOS) {
         else if (cc.sys.os == cc.sys.OS_IOS) {
-            appid = this.callStaticMethod("CsjAdReward", "getWXAppId", "",);
+            appid = this.callStaticMethod("CsjAdReward", "getWxAppId", "",);
         }
         }
         return appid;
         return appid;
     }
     }
@@ -234,7 +236,7 @@ export default class JsbSystem {
             this.callStaticMethod("GameConfig", "installApk:", "");
             this.callStaticMethod("GameConfig", "installApk:", "");
         }
         }
     }
     }
-
+  
     /** 
     /** 
      * 是否可以启动游戏
      * 是否可以启动游戏
      * @param packageName 包名
      * @param packageName 包名
@@ -300,12 +302,10 @@ export default class JsbSystem {
      * @param code  微信code(Java返回)
      * @param code  微信code(Java返回)
      */
      */
     public static onGetWxAccessCode(code) {
     public static onGetWxAccessCode(code) {
-        gData.loginData.sessionKey = "";
-        gData.loginData.uin = "";
         // 暂时注释,需要网络通信
         // 暂时注释,需要网络通信
         gData.wechatData.code = code;
         gData.wechatData.code = code;
         console.log("=== gData.wechatData.code", gData.wechatData.code);
         console.log("=== gData.wechatData.code", gData.wechatData.code);
-        gData.loginData.login();
+        gData.loginData.wxLogin();
     }
     }
 
 
     /**
     /**
@@ -333,7 +333,7 @@ export default class JsbSystem {
             this.callStaticMethod("AppController", "WxAuth", "");
             this.callStaticMethod("AppController", "WxAuth", "");
         }
         }
     }
     }
-    
+
     /**
     /**
      * 分享图片
      * 分享图片
      * @description 微信SDK功能 CocosToJava
      * @description 微信SDK功能 CocosToJava

+ 3 - 3
build/jsb-link/frameworks/runtime-src/proj.android-studio/.idea/modules/-1746423203/libcocos2dx.iml

@@ -33,16 +33,16 @@
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/java/src" isTestSource="false" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/java/src" isTestSource="false" />
     </content>
     </content>
     <content url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx">
     <content url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx">
-      <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/source/apt/debug" isTestSource="false" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out" isTestSource="false" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out" isTestSource="false" generated="true" />
-      <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out" isTestSource="false" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out" isTestSource="false" generated="true" />
+      <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
+      <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/source/apt/debug" isTestSource="false" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/res/rs/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/res/rs/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/res/resValues/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/res/resValues/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
-      <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out" isTestSource="true" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/renderscript_source_output_dir/debugAndroidTest/compileDebugAndroidTestRenderscript/out" isTestSource="true" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/renderscript_source_output_dir/debugAndroidTest/compileDebugAndroidTestRenderscript/out" isTestSource="true" generated="true" />
+      <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out" isTestSource="true" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/res/resValues/androidTest/debug" type="java-test-resource" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/res/resValues/androidTest/debug" type="java-test-resource" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://D:/Develop/CocosDashboard_1.0.9/resources/.editors/Creator/2.4.5/resources/cocos2d-x/cocos/platform/android/libcocos2dx/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />

+ 3 - 3
build/jsb-link/frameworks/runtime-src/proj.android-studio/.idea/modules/app/EasyEliminate.iml

@@ -40,16 +40,16 @@
       <sourceFolder url="file://$MODULE_DIR$/../../../../Classes" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/../../../../Classes" isTestSource="false" />
     </content>
     </content>
     <content url="file://$MODULE_DIR$/../../../app">
     <content url="file://$MODULE_DIR$/../../../app">
-      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/debug" isTestSource="false" generated="true" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out" isTestSource="false" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out" isTestSource="false" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/aidl_source_output_dir/debug/compileDebugAidl/out" isTestSource="false" generated="true" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/debug" isTestSource="false" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
-      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/renderscript_source_output_dir/debug/compileDebugRenderscript/out" isTestSource="false" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/rs/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/rs/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/resValues/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/resValues/debug" type="java-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
-      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/renderscript_source_output_dir/debugAndroidTest/compileDebugAndroidTestRenderscript/out" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/renderscript_source_output_dir/debugAndroidTest/compileDebugAndroidTestRenderscript/out" isTestSource="true" generated="true" />
+      <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/aidl_source_output_dir/debugAndroidTest/compileDebugAndroidTestAidl/out" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/resValues/androidTest/debug" type="java-test-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/res/resValues/androidTest/debug" type="java-test-resource" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
       <sourceFolder url="file://$MODULE_DIR$/../../../app/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />

BIN
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/release/EasyEliminate-release.apk


+ 71 - 0
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/AppActivity.java

@@ -28,10 +28,13 @@ import org.cocos2dx.javascript.thirdSdk.ThirdSdkMgr;
 import org.cocos2dx.lib.Cocos2dxActivity;
 import org.cocos2dx.lib.Cocos2dxActivity;
 import org.cocos2dx.lib.Cocos2dxGLSurfaceView;
 import org.cocos2dx.lib.Cocos2dxGLSurfaceView;
 
 
+import android.Manifest;
+import android.content.pm.PackageManager;
 import android.os.Bundle;
 import android.os.Bundle;
 
 
 import android.content.Intent;
 import android.content.Intent;
 import android.content.res.Configuration;
 import android.content.res.Configuration;
+import android.util.Log;
 
 
 public class AppActivity extends Cocos2dxActivity {
 public class AppActivity extends Cocos2dxActivity {
 
 
@@ -146,4 +149,72 @@ public class AppActivity extends Cocos2dxActivity {
         SDKWrapper.getInstance().onStart();
         SDKWrapper.getInstance().onStart();
         super.onStart();
         super.onStart();
     }
     }
+
+    //用户设备授权-----------------------------------------------------------------------------------
+    /**请求用户权限*/
+    public void requestPermission() {
+//        Log.i(" *************** ", "requestPermission");
+//        // Here, thisActivity is the current activity
+//        if (ContextCompat.checkSelfPermission(this,
+//                Manifest.permission.READ_CONTACTS)
+//                != PackageManager.PERMISSION_GRANTED) {
+//            Log.i("*************** ", "checkSelfPermission");
+//            // Should we show an explanation?
+//            if (ActivityCompat.shouldShowRequestPermissionRationale(this,
+//                    Manifest.permission.READ_CONTACTS)) {
+//                Log.i("*************** ", "shouldShowRequestPermissionRationale");
+//                // Show an expanation to the user *asynchronously* -- don't block
+//                // this thread waiting for the user's response! After the user
+//                // sees the explanation, try again to request the permission.
+//
+//                ActivityCompat.requestPermissions(this,
+//                        new String[]{Manifest.permission.READ_CONTACTS, Manifest.permission.READ_PHONE_STATE, Manifest.permission.WRITE_EXTERNAL_STORAGE},
+//                        1);
+//
+//            } else {
+//                Log.i(" *************** ", "requestPermissions");
+//                // No explanation needed, we can request the permission.
+//                ActivityCompat.requestPermissions(this,
+//                        new String[]{Manifest.permission.READ_CONTACTS, Manifest.permission.READ_PHONE_STATE, Manifest.permission.WRITE_EXTERNAL_STORAGE},
+//                        1);
+//
+//                // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
+//                // app-defined int constant. The callback method gets the
+//                // result of the request.
+//            }
+//        }
+    }
+
+    @Override
+    public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
+        switch (requestCode) {
+            case 1: {
+                // If request is cancelled, the result arrays are empty.
+                if (grantResults.length > 0
+                        && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+                    Log.i("***************", "onRequestPermissionsResult granted");
+                    // permission was granted, yay! Do the
+                    // contacts-related task you need to do.
+                } else {
+                    Log.i("***************", "onRequestPermissionsResult denied");
+                    // permission denied, boo! Disable the
+                    // functionality that depends on this permission.
+                }
+
+//                //点击之后获取设备信息
+//                ThirdSdkMgr.getDeviceInfo();
+//                //友盟这个时候统计
+//                UMSDKMgr.getInstance()._UMSDKInit();
+//                //数数统计
+//                TDSDKMgr.getInstance().initSdk(this);
+//                //数数注册
+//                TDSDKMgr.getInstance().setTAEventRegister();
+
+                return;
+            }
+
+            // other 'case' lines to check for other
+            // permissions this app might request
+        }
+    }
 }
 }

+ 9 - 0
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/thirdSdk/ThirdSdkMgr.java

@@ -109,5 +109,14 @@ public class ThirdSdkMgr {
         return str;
         return str;
     }
     }
 
 
+    /**获取微信appid*/
+    public static String getWxAppId(){
+//        Log.d(">>>>> ", "getWXAppId: " + BuildConfig.WX_APP_ID);
+        return BuildConfig.WX_APP_ID;
+    }
+    public static void requestPermission() {
+
+    }
+
     //埋点相关---------------------------------------------------------------------------------------
     //埋点相关---------------------------------------------------------------------------------------
 }
 }

+ 275 - 97
build/jsb-link/js backups (useful for debugging)/main.index.js

@@ -1800,6 +1800,7 @@ this.adSdk = t;
 this.init();
 this.init();
 }
 }
 t.prototype.init = function() {
 t.prototype.init = function() {
+cc.sys.os == cc.sys.OS_ANDROID ? mk.ad.ifShowAd = !0 : mk.ad.ifShowAd = !1;
 this.adSdk.initSDK();
 this.adSdk.initSDK();
 };
 };
 t.prototype.watchAd = function(t) {
 t.prototype.watchAd = function(t) {
@@ -6960,7 +6961,7 @@ done: !0
 Object.defineProperty(n, "__esModule", {
 Object.defineProperty(n, "__esModule", {
 value: !0
 value: !0
 });
 });
-n.EVENT_TYPE = n.AUDIO_TYPE = n.RewardType = n.RewardState = n.GameProp = n.GameData = void 0;
+n.StorageKey = n.EVENT_TYPE = n.AUDIO_TYPE = n.RewardType = n.RewardState = n.GameProp = n.GameData = void 0;
 var r, a = function() {
 var r, a = function() {
 function t() {
 function t() {
 this.dataFinish = !1;
 this.dataFinish = !1;
@@ -6971,6 +6972,7 @@ this.configs = {};
 this.funOpenData = [];
 this.funOpenData = [];
 this.gameData = null;
 this.gameData = null;
 this.init_coin = !1;
 this.init_coin = !1;
+this.init_head = !1;
 this.props = new Map();
 this.props = new Map();
 this.pools = [ {
 this.pools = [ {
 url: "game/prefab/tips",
 url: "game/prefab/tips",
@@ -7222,6 +7224,7 @@ t.ef_fly = "ef_fly";
 t.BACK_WxAuth = "BACK_WxAuth";
 t.BACK_WxAuth = "BACK_WxAuth";
 t.UPDATE_CashNum = "UPDATE_CashNum";
 t.UPDATE_CashNum = "UPDATE_CashNum";
 })(n.EVENT_TYPE || (n.EVENT_TYPE = {}));
 })(n.EVENT_TYPE || (n.EVENT_TYPE = {}));
+n.StorageKey || (n.StorageKey = {});
 cc._RF.pop();
 cc._RF.pop();
 }, {} ],
 }, {} ],
 GameLogic: [ function(t, e, n) {
 GameLogic: [ function(t, e, n) {
@@ -8242,11 +8245,123 @@ t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n(
 var i, r = arguments.length, a = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, n) : o;
 var i, r = arguments.length, a = r < 3 ? e : null === o ? o = Object.getOwnPropertyDescriptor(e, n) : o;
 if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(t, e, n, o); else for (var c = t.length - 1; c >= 0; c--) (i = t[c]) && (a = (r < 3 ? i(a) : r > 3 ? i(e, n, a) : i(e, n)) || a);
 if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(t, e, n, o); else for (var c = t.length - 1; c >= 0; c--) (i = t[c]) && (a = (r < 3 ? i(a) : r > 3 ? i(e, n, a) : i(e, n)) || a);
 return r > 3 && a && Object.defineProperty(e, n, a), a;
 return r > 3 && a && Object.defineProperty(e, n, a), a;
+}, a = this && this.__awaiter || function(t, e, n, o) {
+return new (n || (n = Promise))(function(i, r) {
+function a(t) {
+try {
+s(o.next(t));
+} catch (t) {
+r(t);
+}
+}
+function c(t) {
+try {
+s(o.throw(t));
+} catch (t) {
+r(t);
+}
+}
+function s(t) {
+t.done ? i(t.value) : (e = t.value, e instanceof n ? e : new n(function(t) {
+t(e);
+})).then(a, c);
+var e;
+}
+s((o = o.apply(t, e || [])).next());
+});
+}, c = this && this.__generator || function(t, e) {
+var n, o, i, r, a = {
+label: 0,
+sent: function() {
+if (1 & i[0]) throw i[1];
+return i[1];
+},
+trys: [],
+ops: []
+};
+return r = {
+next: c(0),
+throw: c(1),
+return: c(2)
+}, "function" == typeof Symbol && (r[Symbol.iterator] = function() {
+return this;
+}), r;
+function c(t) {
+return function(e) {
+return s([ t, e ]);
+};
+}
+function s(r) {
+if (n) throw new TypeError("Generator is already executing.");
+for (;a; ) try {
+if (n = 1, o && (i = 2 & r[0] ? o.return : r[0] ? o.throw || ((i = o.return) && i.call(o), 
+0) : o.next) && !(i = i.call(o, r[1])).done) return i;
+(o = 0, i) && (r = [ 2 & r[0], i.value ]);
+switch (r[0]) {
+case 0:
+case 1:
+i = r;
+break;
+
+case 4:
+a.label++;
+return {
+value: r[1],
+done: !1
+};
+
+case 5:
+a.label++;
+o = r[1];
+r = [ 0 ];
+continue;
+
+case 7:
+r = a.ops.pop();
+a.trys.pop();
+continue;
+
+default:
+if (!(i = a.trys, i = i.length > 0 && i[i.length - 1]) && (6 === r[0] || 2 === r[0])) {
+a = 0;
+continue;
+}
+if (3 === r[0] && (!i || r[1] > i[0] && r[1] < i[3])) {
+a.label = r[1];
+break;
+}
+if (6 === r[0] && a.label < i[1]) {
+a.label = i[1];
+i = r;
+break;
+}
+if (i && a.label < i[2]) {
+a.label = i[2];
+a.ops.push(r);
+break;
+}
+i[2] && a.ops.pop();
+a.trys.pop();
+continue;
+}
+r = e.call(t, a);
+} catch (t) {
+r = [ 6, t ];
+o = 0;
+} finally {
+n = i = 0;
+}
+if (5 & r[0]) throw r[1];
+return {
+value: r[0] ? r[1] : void 0,
+done: !0
+};
+}
 };
 };
 Object.defineProperty(n, "__esModule", {
 Object.defineProperty(n, "__esModule", {
 value: !0
 value: !0
 });
 });
-var a = t("../../mk/system/JsbSystem"), c = t("./FunBtns"), s = cc._decorator, l = s.ccclass, u = s.property, p = function(t) {
+var s = t("../../mk/system/JsbSystem"), l = t("./FunBtns"), u = cc._decorator, p = u.ccclass, d = u.property, h = function(t) {
 i(e, t);
 i(e, t);
 function e() {
 function e() {
 var e = null !== t && t.apply(this, arguments) || this;
 var e = null !== t && t.apply(this, arguments) || this;
@@ -8278,15 +8393,17 @@ this.initInfo();
 };
 };
 e.prototype.update = function() {
 e.prototype.update = function() {
 gData.gameData.init_coin && this.initInfo();
 gData.gameData.init_coin && this.initInfo();
+gData.gameData.init_head && this.initHead();
 };
 };
 e.prototype.lateUpdate = function() {
 e.prototype.lateUpdate = function() {
 gData.gameData.init_coin = !1;
 gData.gameData.init_coin = !1;
+gData.gameData.init_head = !1;
 };
 };
 e.prototype.initMusic = function() {
 e.prototype.initMusic = function() {
 mk.audio.playMusic("bgm");
 mk.audio.playMusic("bgm");
 };
 };
 e.prototype.initBtns = function() {
 e.prototype.initBtns = function() {
-this.node_btn.getComponent(c.default).init();
+this.node_btn.getComponent(l.default).init();
 };
 };
 e.prototype.initQiPaos = function() {
 e.prototype.initQiPaos = function() {
 mk.tween.scale(this.btn_getRed1, .6, 0, 1, null, "backOut");
 mk.tween.scale(this.btn_getRed1, .6, 0, 1, null, "backOut");
@@ -8324,6 +8441,22 @@ e.prototype.initInfo = function() {
 this.lbl_redMoney.string = gData.gameData.gameData.redMoney + "";
 this.lbl_redMoney.string = gData.gameData.gameData.redMoney + "";
 this.lbl_rmb.string = gData.gameData.gameData.piggyBank + "";
 this.lbl_rmb.string = gData.gameData.gameData.piggyBank + "";
 };
 };
+e.prototype.initHead = function() {
+return a(this, void 0, void 0, function() {
+var t;
+return c(this, function(e) {
+switch (e.label) {
+case 0:
+return [ 4, mk.loader.loadRemote(gData.wechatData.avatar + "?aaa=aa.jpg", null) ];
+
+case 1:
+t = e.sent();
+this.img_head.spriteFrame = new cc.SpriteFrame(t);
+return [ 2 ];
+}
+});
+});
+};
 e.prototype.testFly = function() {
 e.prototype.testFly = function() {
 mk.fly.PlayCoinAnim(1, 20, cc.v2(0, -300), cc.v2(0, 0));
 mk.fly.PlayCoinAnim(1, 20, cc.v2(0, -300), cc.v2(0, 0));
 };
 };
@@ -8331,67 +8464,67 @@ e.prototype.onClickStart = function() {
 this.node_gameplay.active = !0;
 this.node_gameplay.active = !0;
 };
 };
 e.prototype.onClickShare = function() {
 e.prototype.onClickShare = function() {
-a.default.sharePic();
+gData.loginData.isAuth ? s.default.sharePic() : mk.tip.pop("请先点击头像,在设置界面授权");
 };
 };
-r([ u({
+r([ d({
 type: cc.Node,
 type: cc.Node,
 displayName: "游戏核心玩法"
 displayName: "游戏核心玩法"
 }) ], e.prototype, "node_gameplay", void 0);
 }) ], e.prototype, "node_gameplay", void 0);
-r([ u({
+r([ d({
 type: cc.Node,
 type: cc.Node,
 displayName: "功能按钮"
 displayName: "功能按钮"
 }) ], e.prototype, "node_btn", void 0);
 }) ], e.prototype, "node_btn", void 0);
-r([ u({
+r([ d({
 type: cc.Sprite,
 type: cc.Sprite,
 displayName: "头像"
 displayName: "头像"
 }) ], e.prototype, "img_head", void 0);
 }) ], e.prototype, "img_head", void 0);
-r([ u({
+r([ d({
 type: cc.Label,
 type: cc.Label,
 displayName: "红包币"
 displayName: "红包币"
 }) ], e.prototype, "lbl_redMoney", void 0);
 }) ], e.prototype, "lbl_redMoney", void 0);
-r([ u({
+r([ d({
 type: cc.Label,
 type: cc.Label,
 displayName: "金猪币"
 displayName: "金猪币"
 }) ], e.prototype, "lbl_rmb", void 0);
 }) ], e.prototype, "lbl_rmb", void 0);
-r([ u({
+r([ d({
 type: cc.Sprite,
 type: cc.Sprite,
 displayName: "红包提现"
 displayName: "红包提现"
 }) ], e.prototype, "btn_cashOutNormal", void 0);
 }) ], e.prototype, "btn_cashOutNormal", void 0);
-r([ u({
+r([ d({
 type: cc.Sprite,
 type: cc.Sprite,
 displayName: "金猪提现"
 displayName: "金猪提现"
 }) ], e.prototype, "btn_cashOutGold", void 0);
 }) ], e.prototype, "btn_cashOutGold", void 0);
-r([ u({
+r([ d({
 type: cc.Node,
 type: cc.Node,
 displayName: "气泡红包1"
 displayName: "气泡红包1"
 }) ], e.prototype, "btn_getRed1", void 0);
 }) ], e.prototype, "btn_getRed1", void 0);
-r([ u({
+r([ d({
 type: cc.Node,
 type: cc.Node,
 displayName: "气泡红包2"
 displayName: "气泡红包2"
 }) ], e.prototype, "btn_getRed2", void 0);
 }) ], e.prototype, "btn_getRed2", void 0);
-r([ u({
+r([ d({
 type: cc.Node,
 type: cc.Node,
 displayName: "气泡红包3"
 displayName: "气泡红包3"
 }) ], e.prototype, "btn_getRed3", void 0);
 }) ], e.prototype, "btn_getRed3", void 0);
-r([ u({
+r([ d({
 type: cc.Button,
 type: cc.Button,
 displayName: "开始游戏"
 displayName: "开始游戏"
 }) ], e.prototype, "btn_start", void 0);
 }) ], e.prototype, "btn_start", void 0);
-r([ u({
+r([ d({
 type: cc.Node,
 type: cc.Node,
 displayName: "红包币图标"
 displayName: "红包币图标"
 }) ], e.prototype, "icon_hb", void 0);
 }) ], e.prototype, "icon_hb", void 0);
-r([ u({
+r([ d({
 type: cc.Node,
 type: cc.Node,
 displayName: "金猪币图标"
 displayName: "金猪币图标"
 }) ], e.prototype, "icon_zb", void 0);
 }) ], e.prototype, "icon_zb", void 0);
-r([ u({
+r([ d({
 type: cc.Node,
 type: cc.Node,
 displayName: "顶部ui组"
 displayName: "顶部ui组"
 }) ], e.prototype, "node_top_ui", void 0);
 }) ], e.prototype, "node_top_ui", void 0);
-return r([ l ], e);
+return r([ p ], e);
 }(cc.Component);
 }(cc.Component);
-n.default = p;
+n.default = h;
 cc._RF.pop();
 cc._RF.pop();
 }, {
 }, {
 "../../mk/system/JsbSystem": "JsbSystem",
 "../../mk/system/JsbSystem": "JsbSystem",
@@ -9224,7 +9357,7 @@ return t;
 };
 };
 t.getWxAppId = function() {
 t.getWxAppId = function() {
 var t = "";
 var t = "";
-cc.sys.os == cc.sys.OS_ANDROID ? t = this.callStaticMethod(this._JSB_ANDROID_PATH, "getWXAppId", "()Ljava/lang/String;") : cc.sys.os == cc.sys.OS_IOS && (t = this.callStaticMethod("CsjAdReward", "getWXAppId", ""));
+cc.sys.os == cc.sys.OS_ANDROID ? t = this.callStaticMethod(this._JSB_ANDROID_PATH, "getWxAppId", "()Ljava/lang/String;") : cc.sys.os == cc.sys.OS_IOS && (t = this.callStaticMethod("CsjAdReward", "getWxAppId", ""));
 return t;
 return t;
 };
 };
 t.getAdvertisingChannel = function() {
 t.getAdvertisingChannel = function() {
@@ -9289,11 +9422,9 @@ t.WxAuth = function() {
 cc.sys.os == cc.sys.OS_ANDROID ? this.callStaticMethod(this._JSB_ANDROID_PATH, "WxAuth", "()V") : cc.sys.os == cc.sys.OS_IOS && this.callStaticMethod("AppController", "WxAuth", "");
 cc.sys.os == cc.sys.OS_ANDROID ? this.callStaticMethod(this._JSB_ANDROID_PATH, "WxAuth", "()V") : cc.sys.os == cc.sys.OS_IOS && this.callStaticMethod("AppController", "WxAuth", "");
 };
 };
 t.onGetWxAccessCode = function(t) {
 t.onGetWxAccessCode = function(t) {
-gData.loginData.sessionKey = "";
-gData.loginData.uin = "";
 gData.wechatData.code = t;
 gData.wechatData.code = t;
 console.log("=== gData.wechatData.code", gData.wechatData.code);
 console.log("=== gData.wechatData.code", gData.wechatData.code);
-gData.loginData.login();
+gData.loginData.wxLogin();
 };
 };
 t.OpenMiniGame = function() {
 t.OpenMiniGame = function() {
 cc.sys.os == cc.sys.OS_ANDROID ? this.callStaticMethod(this._JSB_ANDROID_PATH, "OpenMiniGame", "()V") : cc.sys.os == cc.sys.OS_IOS && this.callStaticMethod("AppController", "WxAuth", "");
 cc.sys.os == cc.sys.OS_ANDROID ? this.callStaticMethod(this._JSB_ANDROID_PATH, "OpenMiniGame", "()V") : cc.sys.os == cc.sys.OS_IOS && this.callStaticMethod("AppController", "WxAuth", "");
@@ -9677,6 +9808,7 @@ function t() {
 this.loadResCompelete = !1;
 this.loadResCompelete = !1;
 this.isLogin = !1;
 this.isLogin = !1;
 this.sessionKey = "";
 this.sessionKey = "";
+this.randomKey = "abcdefghijklopqrstuvwxyzabcdefgh";
 this.uin = "";
 this.uin = "";
 this.tempUin = "";
 this.tempUin = "";
 this.loginTicket = "";
 this.loginTicket = "";
@@ -9706,139 +9838,172 @@ return [ 2 ];
 });
 });
 });
 });
 };
 };
+t.prototype.init = function() {
+var t = mk.storage.getStorage(r.StorageKey.uin);
+this.uin = t || "";
+var e = mk.storage.getStorage(r.StorageKey.sessionKey);
+this.sessionKey = e || "";
+};
 t.prototype.login = function() {
 t.prototype.login = function() {
 return o(this, void 0, void 0, function() {
 return o(this, void 0, void 0, function() {
-var t, e, n, o, a;
-return i(this, function(i) {
-switch (i.label) {
-case 0:
-mk.pool.init(gData.gameData.pools);
-gData.appData.init();
-gData.adData.init();
-cc.sys.os == cc.sys.OS_ANDROID ? mk.ad.ifShowAd = !0 : mk.ad.ifShowAd = !1;
+return i(this, function() {
 if ("" != this.sessionKey && "" != this.uin) {
 if ("" != this.sessionKey && "" != this.uin) {
 console.log("=== login 有登录记录直接跳转到登录流程最后一步");
 console.log("=== login 有登录记录直接跳转到登录流程最后一步");
 this.getAccountInfo();
 this.getAccountInfo();
 return [ 2 ];
 return [ 2 ];
 }
 }
 console.log("=== login 无登录记录");
 console.log("=== login 无登录记录");
-t = mk.encrypt.randomString();
-e = {
+this.connect();
+return [ 2 ];
+});
+});
+};
+t.prototype.connect = function() {
+return o(this, void 0, void 0, function() {
+var t, e;
+return i(this, function(n) {
+switch (n.label) {
+case 0:
+this.randomKey = mk.encrypt.randomString();
+t = {
 mac: gData.appData.mac,
 mac: gData.appData.mac,
-psk: t,
+psk: this.randomKey,
 appId: gData.appData.appId
 appId: gData.appData.appId
 };
 };
-return [ 4, mk.http.sendRequest("connectTest", "POST", JSON.stringify(e)) ];
+return [ 4, mk.http.sendRequest("connectTest", "POST", JSON.stringify(t)) ];
 
 
 case 1:
 case 1:
-if (0 != (n = i.sent()).errcode) return [ 2 ];
-e = mk.encrypt.decrypt(n.encrypt, t, gData.appData.appId);
-this.tempUin = JSON.parse(e).tmp_uin;
+if (0 != (e = n.sent()).errcode) return [ 2 ];
+t = mk.encrypt.decrypt(e.encrypt, this.randomKey, gData.appData.appId);
+console.log("[FC]connectTest decryptData", t);
+this.tempUin = JSON.parse(t).tmp_uin;
+mk.storage.setStorage(r.StorageKey.uin, this.tempUin);
+this.wxLogin();
+return [ 2 ];
+}
+});
+});
+};
+t.prototype.wxLogin = function() {
+return o(this, void 0, void 0, function() {
+var t, e, n;
+return i(this, function(o) {
+switch (o.label) {
+case 0:
 if (null != gData.wechatData.code) {
 if (null != gData.wechatData.code) {
-o = mk.encrypt.encrypt(JSON.stringify({
+e = mk.encrypt.encrypt(JSON.stringify({
 code: gData.wechatData.code
 code: gData.wechatData.code
 }), this.sessionKey, gData.appData.appId);
 }), this.sessionKey, gData.appData.appId);
-e = {
+t = {
 uin: this.uin,
 uin: this.uin,
-encrypt: o
+encrypt: e
 };
 };
 } else {
 } else {
-o = mk.encrypt.encrypt(JSON.stringify({
+e = mk.encrypt.encrypt(JSON.stringify({
 code: ""
 code: ""
-}), t, gData.appData.appId);
-e = {
+}), this.randomKey, gData.appData.appId);
+t = {
 uin: this.tempUin,
 uin: this.tempUin,
-encrypt: o
+encrypt: e
 };
 };
 }
 }
-return [ 4, mk.http.sendRequest("wxlogin", "POST", JSON.stringify(e), !1, !1) ];
+return [ 4, mk.http.sendRequest("wxlogin", "POST", JSON.stringify(t), !1, !1) ];
 
 
-case 2:
-if (0 != (n = i.sent()).errcode) {
+case 1:
+if (0 != (n = o.sent()).errcode) {
 -10003 != n.errcode && -20003 != n.errcode || this.reload();
 -10003 != n.errcode && -20003 != n.errcode || this.reload();
 return [ 2 ];
 return [ 2 ];
 }
 }
-e = null != gData.wechatData.code ? mk.encrypt.decrypt(n.encrypt, this.sessionKey, gData.appData.appId) : mk.encrypt.decrypt(n.encrypt, t, gData.appData.appId);
-e = JSON.parse(e);
-this.loginTicket = e.login_ticket;
+t = null != gData.wechatData.code ? mk.encrypt.decrypt(n.encrypt, this.sessionKey, gData.appData.appId) : mk.encrypt.decrypt(n.encrypt, this.randomKey, gData.appData.appId);
+t = JSON.parse(t);
+this.loginTicket = t.login_ticket;
+console.log("[FC]wxLoginTest decrypt", t);
 mk.storage.setStorage(r.StorageKey.loginTicket, this.loginTicket);
 mk.storage.setStorage(r.StorageKey.loginTicket, this.loginTicket);
-if (null == mk.storage.getStorage("isFirstIn")) {
+if (null == mk.storage.getStorage(r.StorageKey.isFirstIn)) {
 this.isFirstIn = !0;
 this.isFirstIn = !0;
 mk.storage.setStorage(r.StorageKey.isFirstIn, 1);
 mk.storage.setStorage(r.StorageKey.isFirstIn, 1);
 }
 }
-if (this.uin != e.uin) {
-this.uin = e.uin;
+if (this.uin != t.uin) {
+this.uin = t.uin;
 this.isNew = !1;
 this.isNew = !1;
 } else this.isNew = !0;
 } else this.isNew = !0;
-mk.console.log("uin:", this.uin);
 mk.storage.setStorage(r.StorageKey.uin, this.uin);
 mk.storage.setStorage(r.StorageKey.uin, this.uin);
-console.log("uin  ", this.uin);
-console.log("tempUin  ", this.tempUin);
-a = "";
-a = null != gData.wechatData.code ? this.sessionKey : mk.encrypt.randomString();
+this.checkLogin();
+return [ 2 ];
+}
+});
+});
+};
+t.prototype.checkLogin = function() {
+return o(this, void 0, void 0, function() {
+var t, e, n, o, a;
+return i(this, function(i) {
+switch (i.label) {
+case 0:
+t = "";
+t = null != gData.wechatData.code ? this.sessionKey : mk.encrypt.randomString();
 e = {
 e = {
-tmp_key: a,
+tmp_key: t,
 uin: this.uin,
 uin: this.uin,
 login_ticket: this.loginTicket,
 login_ticket: this.loginTicket,
 appId: gData.appData.appId
 appId: gData.appData.appId
 };
 };
 return [ 4, mk.http.sendRequest("checklogin", "POST", JSON.stringify(e)) ];
 return [ 4, mk.http.sendRequest("checklogin", "POST", JSON.stringify(e)) ];
 
 
-case 3:
+case 1:
 if (0 != (n = i.sent()).errcode) return [ 2 ];
 if (0 != (n = i.sent()).errcode) return [ 2 ];
-e = null != gData.wechatData.code ? mk.encrypt.decrypt(n.encrypt, this.sessionKey, gData.appData.appId) : mk.encrypt.decrypt(n.encrypt, a, gData.appData.appId);
-e = JSON.parse(e);
-this.sessionKey = e.session_key;
-mk.storage.setStorage("sessionKey", this.sessionKey);
-if (null != gData.wechatData.code) if (this.isNew) this.getAccountInfo(); else {
-this.isNew = !1;
-gData.wechatData.code = null;
-this.reload();
-} else this.getAccountInfo();
+o = null != gData.wechatData.code ? mk.encrypt.decrypt(n.encrypt, this.sessionKey, gData.appData.appId) : mk.encrypt.decrypt(n.encrypt, t, gData.appData.appId);
+a = JSON.parse(o);
+this.sessionKey = a.session_key;
+console.log("[FC]checkLogin decrypt", a);
+mk.storage.setStorage(r.StorageKey.sessionKey, this.sessionKey);
+this.getUserInfo();
 return [ 2 ];
 return [ 2 ];
 }
 }
 });
 });
 });
 });
 };
 };
+t.prototype.getUserInfo = function() {
+return o(this, void 0, void 0, function() {
+return i(this, function() {
+this.getAccountInfo();
+return [ 2 ];
+});
+});
+};
 t.prototype.getAccountInfo = function() {
 t.prototype.getAccountInfo = function() {
 return o(this, void 0, void 0, function() {
 return o(this, void 0, void 0, function() {
-var t, e, n, o;
-return i(this, function(i) {
-switch (i.label) {
+var t, e, n;
+return i(this, function(o) {
+switch (o.label) {
 case 0:
 case 0:
-if (!(t = mk.storage.getStorage(r.StorageKey.nickname))) return [ 3, 1 ];
-gData.wechatData.nickName = t;
-return [ 3, 3 ];
-
-case 1:
-e = {
+t = {
 uin: this.uin,
 uin: this.uin,
 login_ticket: this.loginTicket
 login_ticket: this.loginTicket
 };
 };
-n = {
+e = {
 uin: this.uin,
 uin: this.uin,
-encrypt: mk.encrypt.encrypt(JSON.stringify(e), this.sessionKey, gData.appData.appId)
+encrypt: mk.encrypt.encrypt(JSON.stringify(t), this.sessionKey, gData.appData.appId)
 };
 };
-return [ 4, mk.http.sendRequest("user", "POST", JSON.stringify(n), !1, !1) ];
+return [ 4, mk.http.sendRequest("user", "POST", JSON.stringify(e), !1, !1) ];
 
 
-case 2:
-if (0 != (o = i.sent()).errcode) {
--10003 != o.errcode && -20003 != o.errcode || this.reload();
+case 1:
+if (0 != (n = o.sent()).errcode) {
+-10003 != n.errcode && -20003 != n.errcode || this.reload();
 return [ 2 ];
 return [ 2 ];
 }
 }
-o = mk.http.checkData(o, !0);
-n = o.data;
-this.isAuth = n.is_auth;
+n = mk.http.checkData(n, !0);
+e = n.data;
+mk.console.logSingle("[FC] getAccountInfo decrypt", e);
+this.isAuth = e.is_auth;
 if (this.isAuth) {
 if (this.isAuth) {
-gData.wechatData.nickName = n.nickname;
-gData.wechatData.avatar = n.headimgurl;
+gData.wechatData.nickName = e.nickname;
+gData.wechatData.avatar = e.headimgurl;
+gData.gameData.init_head = !0;
 mk.storage.setStorage(r.StorageKey.isAuth, 1);
 mk.storage.setStorage(r.StorageKey.isAuth, 1);
 mk.storage.setStorage(r.StorageKey.nickname, gData.wechatData.nickName, !1);
 mk.storage.setStorage(r.StorageKey.nickname, gData.wechatData.nickName, !1);
 mk.storage.setStorage(r.StorageKey.avatar, gData.wechatData.avatar, !1);
 mk.storage.setStorage(r.StorageKey.avatar, gData.wechatData.avatar, !1);
 }
 }
-i.label = 3;
-
-case 3:
 gData.gameData.init();
 gData.gameData.init();
 return [ 2 ];
 return [ 2 ];
 }
 }
@@ -9899,6 +10064,7 @@ e.prototype.onLoad = function() {
 this.setProgress(0);
 this.setProgress(0);
 };
 };
 e.prototype.start = function() {
 e.prototype.start = function() {
+a.default.getWxAppId() && (gData.appData.appId = a.default.getWxAppId());
 a.default.getDeviceInfo();
 a.default.getDeviceInfo();
 };
 };
 e.prototype.setProgress = function(t) {
 e.prototype.setProgress = function(t) {
@@ -9912,7 +10078,7 @@ this.setProgress(this.process);
 }
 }
 if (gData.loginData.loadResCompelete) {
 if (gData.loginData.loadResCompelete) {
 if (gData.appData.getDeviceInfoCompelete) {
 if (gData.appData.getDeviceInfoCompelete) {
-gData.loginData.login();
+this.login();
 gData.appData.getDeviceInfoCompelete = !1;
 gData.appData.getDeviceInfoCompelete = !1;
 } else if (gData.gameData.dataFinish) {
 } else if (gData.gameData.dataFinish) {
 mk.storage.getStorage("notShowAgreementTip") ? mk.ui.openPanel("game/prefab/game") : mk.ui.openPanel("module/agreementTip/agreementTip");
 mk.storage.getStorage("notShowAgreementTip") ? mk.ui.openPanel("game/prefab/game") : mk.ui.openPanel("module/agreementTip/agreementTip");
@@ -9920,6 +10086,14 @@ gData.gameData.dataFinish = !1;
 }
 }
 } else gData.loginData.loadLocalRes();
 } else gData.loginData.loadLocalRes();
 };
 };
+e.prototype.login = function() {
+mk.pool.init(gData.gameData.pools);
+gData.appData.init();
+gData.adData.init();
+gData.loginData.init();
+console.log("[FC] gData.appData.appId", gData.appData.appId);
+gData.loginData.login();
+};
 r([ u(c.default) ], e.prototype, "bar", void 0);
 r([ u(c.default) ], e.prototype, "bar", void 0);
 r([ u({
 r([ u({
 displayName: "加载文字",
 displayName: "加载文字",
@@ -15391,11 +15565,13 @@ return [ 4, mk.loader.load(e, cc.SpriteFrame) ];
 
 
 case 2:
 case 2:
 o.spriteFrame = r.sent();
 o.spriteFrame = r.sent();
-return [ 4, mk.loader.loadRemote(gData.wechatData.avatar, null) ];
+console.log("=== gData.wechatData.avatar", gData.wechatData.avatar);
+return [ 4, mk.loader.loadRemote(gData.wechatData.avatar + "?aaa=aa.jpg", null) ];
 
 
 case 3:
 case 3:
 i = r.sent();
 i = r.sent();
-console.log("loadHead:", i);
+this.img_head.spriteFrame = new cc.SpriteFrame(i);
+console.log("=== loadHead:", i);
 return [ 2 ];
 return [ 2 ];
 }
 }
 });
 });
@@ -15446,8 +15622,10 @@ return [ 2 ];
 };
 };
 e.prototype.clickUpdate = function() {};
 e.prototype.clickUpdate = function() {};
 e.prototype.onClickWxAuth = function() {
 e.prototype.onClickWxAuth = function() {
+if (!gData.loginData.isAuth) {
 mk.ui.closePanel(this.node.name);
 mk.ui.closePanel(this.node.name);
 s.default.WxAuth();
 s.default.WxAuth();
+}
 };
 };
 e.prototype.clickRule = function(t) {
 e.prototype.clickRule = function(t) {
 return a(this, void 0, void 0, function() {
 return a(this, void 0, void 0, function() {