Przeglądaj źródła

备份奇境SDK

trevorHsu 2 lat temu
rodzic
commit
4d97601aca

+ 1 - 1
app/src/main/assets/YyrhParam.cnf

@@ -1,2 +1,2 @@
-GCP_CODE=Y01010102
+GCP_CODE=Y010101016
 CHANNELTAG=YYRHSDK

+ 3 - 2
app/src/main/java/constant/yysdk/com/main_yy_rh_sdk/MainActivity.java

@@ -16,6 +16,7 @@ import android.os.Bundle;
 
 
 import android.util.Log;
+import android.view.KeyEvent;
 import android.view.View;
 import android.view.Window;
 import android.view.WindowManager;
@@ -461,9 +462,11 @@ public class MainActivity extends Activity implements View.OnClickListener {
 
     }
 
+
     @Override
     public void onBackPressed() {
         // TODO Auto-generated method stub
+
         sdk.exitGame(MainActivity.this, new ExitCallback() {
 
             @Override
@@ -482,8 +485,6 @@ public class MainActivity extends Activity implements View.OnClickListener {
 
 
 
-
-
     @Override
     public void onConfigurationChanged(Configuration newConfig) {
         // TODO Auto-generated method stub

+ 1 - 1
hnqj/build.gradle

@@ -32,7 +32,7 @@ android {
 }
 android.libraryVariants.all { variant ->
     variant.outputs.all {
-        outputFileName = 'hnqj-release-1.0.4.aar'
+        outputFileName = 'hnqj-release-1.0.8.aar'
     }
 }
 

+ 1 - 1
hnqj/src/main/java/com/yyrh/Version.java

@@ -1,5 +1,5 @@
 package com.yyrh;
 
 public class Version {
-    public static final String VERSION_NAME = "1.0.4";
+    public static final String VERSION_NAME = "1.0.8";
 }

+ 2 - 2
hnqj/src/main/java/com/yyrh/constant/URLConstants.java

@@ -2,8 +2,8 @@ package com.yyrh.constant;
 
 public class URLConstants {
 
-//    public static final String BASEURL = "https://fxsy.qijinghao.com";
-  public static final String BASEURL = "http://testsdkapi.yyxxgame.com";
+  public static final String BASEURL = "https://fxsy.qijinghao.com";
+//  public static final String BASEURL = "http://testsdkapi.yyxxgame.com";
 
 
     //    public static final String BASEURL = "http://49.234.153.160";

+ 3 - 3
hnqj/src/main/java/com/yyrh/networking/NetRequestApi.java

@@ -180,9 +180,9 @@ public class NetRequestApi {
             @Override
             public void onFailure(int code, String errorMessage) {
 
-                new TosUtil(activity, TosUtil.TOAST_ERROR, activity.getString(ResourceUtil.getStringId(activity, "hnyy_network_error_tip"))).show();
+                new TosUtil(activity, TosUtil.TOAST_ERROR, activity.getString(ResourceUtil.getStringId(activity, "qj_network_error_tip"))).show();
 
-                loginCallback.onLoginError(activity.getString(ResourceUtil.getStringId(activity, "hnyy_network_error_tip")));
+                loginCallback.onLoginError(activity.getString(ResourceUtil.getStringId(activity, "qj_network_error_tip")));
             }
 
             @Override
@@ -219,7 +219,7 @@ public class NetRequestApi {
                 }
 
                 YYLog.i("登录成功。+ token:" +  loginData.token);
-
+                YYLog.i("登录成功。+ loginData" +  loginData.toString());
                 loginCallback.onLoginSuccess(loginData.token);
 
             }

+ 1 - 1
hnqj/src/main/java/com/yyrh/sdk/SDKEntry.java

@@ -64,7 +64,7 @@ public class SDKEntry {
     private PayCallback payCall;
     private LogoutCallback logoutCall;
     private ExitCallback exitCall;
-    private RealNameMsgCallback realNameMsgCallback;
+    public RealNameMsgCallback realNameMsgCallback;
     public Activity gameAct;
 
     private UserPolicyCallback userPolicyCallback;

+ 38 - 63
hnqj/src/main/java/com/yyrh/sdk/YyrhSdkManager.java

@@ -7,6 +7,7 @@ import android.content.Intent;
 import android.content.SharedPreferences;
 import android.os.Build;
 import android.os.Handler;
+import android.support.annotation.UiThread;
 import android.util.Log;
 
 import com.yyrh.constant.InitConfig;
@@ -286,12 +287,12 @@ public class YyrhSdkManager {
 
 
     private void autoLogin(final Activity activity) {
-        AutoLoginDialog.Builder builder = new AutoLoginDialog.Builder(activity);
+        final AutoLoginDialog.Builder builder = new AutoLoginDialog.Builder(activity);
         builder.setPositiveButton(new DialogInterface.OnClickListener() {
             @Override
             public void onClick(DialogInterface dialog, int which) {
                 //取消回调
-                dialog.dismiss();
+                builder.dialogDismiss();
 
                 showLoginView(activity,FragmentUtils.SDK_USER_SWITCH_ACCOUNT);
 
@@ -334,6 +335,7 @@ public class YyrhSdkManager {
     }
 
     public void yyrhExitGame(final Activity activity){
+        YYLog.i("yyrhExitGame");
         CustomExitGameDialog.Builder builder = new CustomExitGameDialog.Builder(activity);
         builder.setPositiveButton(new DialogInterface.OnClickListener() {
             @Override
@@ -341,9 +343,10 @@ public class YyrhSdkManager {
 
                 FloatViewManager.defaultManager(activity).destroyFloat();
 
-                dialog.dismiss();
+
                 SDKEntry.getSdkInstance().adSdkCallback.onExitGame(activity);
                 SDKEntry.getSdkInstance().sdkCallback.onExiGameCallback(true,"Exit Game.");
+                dialog.dismiss();
             }
         });
         builder.setnegativeButton(new DialogInterface.OnClickListener() {
@@ -385,84 +388,56 @@ public class YyrhSdkManager {
         DatabaseHelper.excuteSql(context, insert_sql);
 
 
-        if (isOpenRealName){
-
-            if (!isVefityRealName){
-
-                if (SDKSettings.isForceRealName){
-
-                    new WvPageListDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"), SDKSettings.loginData.authentication,
-                            new WvPageListDialog.OnClosePageListener() {
-                                @Override
-                                public void onClose() {
-
-                                    if (SDKSettings.loginData.rn_bd.equals("")){
-
-                                        SDKSettings.loginData = null;
-
-                                    }
-
-                                }
-
-                                @Override
-                                public void onDissmiss() {
-                                    operateFloatViewInUIThread((Activity)context,SHOW_FLOAT);
-                                    openEmaiDialogInUIThread((Activity) context);
-                                }
-
-
-                                @Override
-                                public void onRealNameSuccess(String birthday) {
-
+        operateRealNameDialog(token);
+}
 
-                                    SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
+    void operateRealNameDialog(final String token) {
+        if (isOpenRealName) {
 
+            if (isVefityRealName) {
 
+                new WvPageListDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"), SDKSettings.loginData.authentication,
+                        new WvPageListDialog.OnClosePageListener() {
+                            @Override
+                            public void onClose() {
 
-                                }
-                            },SDKSettings.isForceRealName).show();
-                }else {
-                    new WvPageListDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"), SDKSettings.loginData.authentication,
-                                 new WvPageListDialog.OnClosePageListener() {
-                                     @Override
-                                     public void onClose() {
+                            }
 
-                                         SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
+                            @Override
+                            public void onDissmiss() {
 
+                                showLoginSuccessUi(token);
 
-                                     }
+                            }
 
-                                     @Override
-                                     public void onDissmiss() {
-                                         operateFloatViewInUIThread((Activity)context,SHOW_FLOAT);
-                                         openEmaiDialogInUIThread((Activity) context);
-                                     }
+                            @Override
+                            public void onRealNameSuccess(String birthday) {
+                                YYLog.i("onRealNameSuccess");
+                            }
 
+                        }, SDKSettings.isForceRealName).show();
 
-                                     @Override
-                                     public void onRealNameSuccess(String birthday) {
-                                         YYLog.i("onRealNameSuccess");
 
-                                     }
-                                 }).show();
+            } else {
 
+                showLoginSuccessUi(token);
 
-                }
+            }
 
-            }else {
+        } else {
 
-                operateFloatViewInUIThread((Activity)context,SHOW_FLOAT);
-                SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
+            showLoginSuccessUi(token);
 
+        }
+    }
 
-                }
 
-        }else{
-            operateFloatViewInUIThread((Activity)context,SHOW_FLOAT);
-            SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
-         }
-}
+    private void  showLoginSuccessUi(String token){
+        openEmaiDialogInUIThread((Activity) context);
+        operateFloatViewInUIThread((Activity) context, SHOW_FLOAT);
+        SDKEntry.getSdkInstance().sdkCallback.onLoginSuccess(token);
 
+    }
 
     public void yyrhGetRealNameInfo(Activity activity,RealNameMsgCallback msgCallback){
 
@@ -496,7 +471,7 @@ public class YyrhSdkManager {
             @Override
             public void run() {
 
-                new EmailDialog(context, ResourceUtil.getStyleId(context, "qj_half_black_dialog"),SDKSettings.loginData.solo_email).show();
+                new EmailDialog(gameAct, ResourceUtil.getStyleId(gameAct, "qj_half_black_dialog"),SDKSettings.loginData.solo_email).show();
 
             }
         });

+ 3 - 2
hnqj/src/main/java/com/yyrh/ui/dialog/AutoLoginDialog.java

@@ -5,6 +5,7 @@ import android.app.Dialog;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.SharedPreferences;
+import android.os.Looper;
 import android.util.TypedValue;
 import android.view.Gravity;
 import android.view.LayoutInflater;
@@ -35,7 +36,6 @@ public class AutoLoginDialog extends Dialog {
 
 	public AutoLoginDialog(Context context, int theme) {
 		super(context, theme);
-
 	}
 
 	public  static class  Builder{
@@ -112,7 +112,7 @@ public class AutoLoginDialog extends Dialog {
 
 			@Override
 			public void run() {
-
+				Looper.prepare();
 				dialogDismiss();
 
 				SharedPreferences sp = context.getSharedPreferences("yyrh", Activity.MODE_PRIVATE);
@@ -143,6 +143,7 @@ public class AutoLoginDialog extends Dialog {
 
 					}
 				});
+				Looper.loop();
 
 			}
 

+ 4 - 4
hnqj/src/main/java/com/yythird/base/BaseSDK.java

@@ -77,10 +77,10 @@ public class BaseSDK {
 
     }
     public void SDKExit(Activity ac, final ChannelSdkCallback sdkCallback) {
-        String tip = ac.getString(ResourceUtil.getStringId(ac, "yyrh_exit_tip"));
-        String message = ac.getString(ResourceUtil.getStringId(ac, "yyrh_issure_exit"));
-        String left = ac.getString(ResourceUtil.getStringId(ac, "yyrh_sure"));
-        String right = ac.getString(ResourceUtil.getStringId(ac, "yyrh_cancel"));
+        String tip = ac.getString(ResourceUtil.getStringId(ac, "qj_exit_tip"));
+        String message = ac.getString(ResourceUtil.getStringId(ac, "qj_issure_exit"));
+        String left = ac.getString(ResourceUtil.getStringId(ac, "qj_sure"));
+        String right = ac.getString(ResourceUtil.getStringId(ac, "qj_cancel"));
         new AlertDialog.Builder(ac)
                 .setTitle(tip)
                 .setMessage(message)

+ 1 - 6
hnqj/src/main/res/layout/qj_email_dialog.xml

@@ -24,12 +24,7 @@
             />
 
 
-        <ImageView
-            android:layout_width="30dp"
-            android:layout_height="30dp"
-            android:layout_centerInParent="true"
-            android:id="@+id/qj_loading"
-            android:background="@mipmap/qj_loading"/>
+
         <ImageView
             android:id="@+id/close_btn"
             android:layout_width="28dp"

+ 6 - 13
hnqj/src/main/res/layout/qj_usercenter_dialog.xml

@@ -1,18 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
+    android:layout_width="460dp"
     android:layout_height="match_parent"
-    android:orientation="vertical"
-    >
+      >
 
 
 
-    <RelativeLayout
-        android:id="@+id/rl1"
-        android:layout_width="520dp"
-        android:layout_height="match_parent"
 
-        >
 
 
         <WebView
@@ -25,20 +19,19 @@
             android:background="@drawable/qj_common_wv_bg"
             />
 
-
-
         <ImageView
             android:id="@+id/close_btn"
             android:layout_width="30dp"
             android:layout_height="30dp"
-            android:layout_toRightOf="@id/wb_user_info"
+            android:layout_toRightOf="@+id/wb_user_info"
             android:background="@mipmap/qj_usercenter_close"
             android:layout_marginTop="10dp"
             android:layout_marginLeft="15dp"
 
-
             />
-    </RelativeLayout>
+
+
+
 
 
 

BIN
hnqj/src/main/res/mipmap-xhdpi/qj_usercenter_close.png