Prechádzať zdrojové kódy

v1.0.0开发:谷歌支付开发

#Suyghur 3 rokov pred
rodič
commit
82aca9931c
57 zmenil súbory, kde vykonal 1056 pridanie a 273 odobranie
  1. 1 1
      build.gradle
  2. 3 0
      demo/build.gradle
  3. 0 22
      demo/src/main/AndroidManifest.xml
  4. 93 0
      demo/src/main/java/com/eyuangame/demo/CacheRoleInfo.kt
  5. 100 13
      demo/src/main/java/com/eyuangame/demo/DemoActivity.kt
  6. 19 10
      demo/src/main/res/values/strings.xml
  7. 3 2
      library_base/build.gradle
  8. 8 3
      library_base/src/main/java/cn/yyxx/eyuangame/base/EYuanGame.kt
  9. 2 0
      library_base/src/main/java/cn/yyxx/eyuangame/base/EYuanGameApplication.kt
  10. 5 2
      library_base/src/main/java/cn/yyxx/eyuangame/base/entity/SdkChargeInfo.kt
  11. 3 2
      library_base/src/main/java/cn/yyxx/eyuangame/base/entity/SdkRoleInfo.kt
  12. 16 6
      library_core/build.gradle
  13. 31 2
      library_core/src/main/AndroidManifest.xml
  14. 1 1
      library_core/src/main/cpp/comm_map.cpp
  15. 2 2
      library_core/src/main/java/cn/yyxx/eyuangame/core/SdkBridge.kt
  16. 10 0
      library_core/src/main/java/cn/yyxx/eyuangame/core/entity/SubmitTiming.kt
  17. 10 10
      library_core/src/main/java/cn/yyxx/eyuangame/core/entity/bean/init/FloatCfg.kt
  18. 16 9
      library_core/src/main/java/cn/yyxx/eyuangame/core/entity/bean/init/InitBean.kt
  19. 31 14
      library_core/src/main/java/cn/yyxx/eyuangame/core/impl/SdkBridgeImpl.kt
  20. 176 0
      library_core/src/main/java/cn/yyxx/eyuangame/core/impl/center/HybridActivity.kt
  21. 1 0
      library_core/src/main/java/cn/yyxx/eyuangame/core/impl/center/fragment/BindAccountFragment.kt
  22. 24 11
      library_core/src/main/java/cn/yyxx/eyuangame/core/impl/center/fragment/BindPhoneFragment.kt
  23. 1 1
      library_core/src/main/java/cn/yyxx/eyuangame/core/impl/center/fragment/ModifyPwdFragment.kt
  24. 17 5
      library_core/src/main/java/cn/yyxx/eyuangame/core/impl/floatball/FloatCenterService.kt
  25. 111 61
      library_core/src/main/java/cn/yyxx/eyuangame/core/impl/iab/ChargeImpl.kt
  26. 18 2
      library_core/src/main/java/cn/yyxx/eyuangame/core/impl/iab/InAppBilling.kt
  27. 0 1
      library_core/src/main/java/cn/yyxx/eyuangame/core/impl/login/LoginActivity.kt
  28. 2 2
      library_core/src/main/java/cn/yyxx/eyuangame/core/impl/login/fragment/LauncherFragment.kt
  29. 25 1
      library_core/src/main/java/cn/yyxx/eyuangame/core/linking/Linking.kt
  30. 22 0
      library_core/src/main/java/cn/yyxx/eyuangame/core/linking/channel/LinkingFacebookImpl.kt
  31. 4 4
      library_core/src/main/java/cn/yyxx/eyuangame/core/network/Host.kt
  32. 13 40
      library_core/src/main/java/cn/yyxx/eyuangame/core/network/SdkRequest.kt
  33. 5 2
      library_core/src/main/java/cn/yyxx/eyuangame/core/network/VolleyRequest.kt
  34. 20 10
      library_core/src/main/java/cn/yyxx/eyuangame/core/ui/dialog/ForgetPwdDialog.kt
  35. 33 22
      library_core/src/main/java/cn/yyxx/eyuangame/core/ui/floatview/FloatingBall.kt
  36. 6 5
      library_core/src/main/java/cn/yyxx/eyuangame/core/utils/MMKVUtils.kt
  37. 3 5
      library_core/src/main/java/cn/yyxx/eyuangame/core/utils/SessionUtils.kt
  38. BIN
      library_core/src/main/jniLibs/arm64-v8a/libdolin-zap.so
  39. BIN
      library_core/src/main/jniLibs/arm64-v8a/libmmkv.so
  40. BIN
      library_core/src/main/jniLibs/armeabi-v7a/libdolin-zap.so
  41. BIN
      library_core/src/main/jniLibs/armeabi-v7a/libmmkv.so
  42. BIN
      library_core/src/main/jniLibs/x86/libdolin-zap.so
  43. BIN
      library_core/src/main/jniLibs/x86/libmmkv.so
  44. BIN
      library_core/src/main/jniLibs/x86_64/libdolin-zap.so
  45. BIN
      library_core/src/main/jniLibs/x86_64/libmmkv.so
  46. BIN
      library_core/src/main/res/drawable-xhdpi/yyxx_back_img.png
  47. BIN
      library_core/src/main/res/drawable-xhdpi/yyxx_float_logo_left_img.png
  48. BIN
      library_core/src/main/res/drawable-xhdpi/yyxx_float_logo_right_img.png
  49. 9 0
      library_core/src/main/res/drawable/yyxx_green_blue_panel_title.xml
  50. 9 0
      library_core/src/main/res/drawable/yyxx_white_panel_content_bg.xml
  51. 75 0
      library_core/src/main/res/layout-land/yyxx_hybrid.xml
  52. 75 0
      library_core/src/main/res/layout/yyxx_hybrid.xml
  53. 2 0
      library_core/src/main/res/layout/yyxx_login_launcher.xml
  54. 1 0
      library_core/src/main/res/layout/yyxx_login_register.xml
  55. 7 1
      library_core/src/main/res/values/yyxx_strings.xml
  56. 10 1
      library_core/src/main/res/values/yyxx_styles.xml
  57. 33 0
      shell/decompress_log.py

+ 1 - 1
build.gradle

@@ -12,7 +12,7 @@ buildscript {
     // buildToolsVersion
     ext.BUILD_TOOLS_VERSION = '30.0.3'
     // minSdkVersion
-    ext.MIN_SDK_VERSION = 21
+    ext.MIN_SDK_VERSION = 16
     // targetSdkVersion
     ext.TARGET_SDK_VERSION = 30
 

+ 3 - 0
demo/build.gradle

@@ -17,6 +17,9 @@ android {
         targetSdkVersion TARGET_SDK_VERSION
         versionCode 1
         versionName "1.0"
+
+        multiDexEnabled true
+
     }
 
     signingConfigs {

+ 0 - 22
demo/src/main/AndroidManifest.xml

@@ -48,28 +48,6 @@
             </intent-filter>
         </activity>
 
-        <!-- Facebook start -->
-        <meta-data
-            android:name="com.facebook.sdk.ApplicationId"
-            android:value="\1047370039003298" />
-
-        <activity
-            android:name="com.facebook.FacebookActivity"
-            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" />
-
-        <activity
-            android:name="com.facebook.CustomTabActivity"
-            android:exported="true">
-            <intent-filter>
-                <action android:name="android.intent.action.VIEW" />
-
-                <category android:name="android.intent.category.DEFAULT" />
-                <category android:name="android.intent.category.BROWSABLE" />
-
-                <data android:scheme="fb1047370039003298" />
-            </intent-filter>
-        </activity>
-
         <!-- Facebook 分享 -->
         <!--        <provider-->
         <!--            android:name="com.facebook.FacebookContentProvider"-->

+ 93 - 0
demo/src/main/java/com/eyuangame/demo/CacheRoleInfo.kt

@@ -0,0 +1,93 @@
+package com.eyuangame.demo
+
+import android.content.Context
+import android.text.TextUtils
+import org.json.JSONException
+import org.json.JSONObject
+
+/**
+ * @author #Suyghur.
+ * Created on 2020/12/7
+ */
+class CacheRoleInfo {
+
+
+    data class RoleInfo(
+        var roleId: String = "", var roleName: String = "", var roleLevel: String = "",
+        var serverCode: String = "", var serverName: String = "", var vipLevel: String = "",
+        var balance: String = "", var totalPurchase: Int = 0, var roleCTime: Long = 0
+    ) {
+
+
+        fun toJsonString(): String {
+            try {
+                val jsonObject = JSONObject()
+                jsonObject.put("role_id", roleId)
+                jsonObject.put("role_name", roleName)
+                jsonObject.put("role_level", roleLevel)
+                jsonObject.put("server_code", serverCode)
+                jsonObject.put("server_name", serverName)
+                jsonObject.put("vip_level", vipLevel)
+                jsonObject.put("balance", balance)
+                jsonObject.put("total_purchase", totalPurchase)
+                jsonObject.put("role_ctime", roleCTime)
+                return jsonObject.toString()
+            } catch (e: JSONException) {
+                e.printStackTrace()
+            }
+            return ""
+        }
+    }
+
+    companion object {
+
+        fun setDemoRoleInfo(context: Context, userId: String): RoleInfo {
+            val ts = System.currentTimeMillis() / 1000
+            val roleInfo = RoleInfo(
+                roleId = "aaa$ts",
+                roleName = "角色名123",
+                roleLevel = "110",
+                serverCode = "333",
+                serverName = "服务器名333",
+                vipLevel = "1",
+                balance = "600",
+                totalPurchase = 0,
+                roleCTime = ts
+            )
+            val info = roleInfo.toJsonString()
+            val sp = context.getSharedPreferences("app_role_info", Context.MODE_PRIVATE)
+            val editor = sp.edit()
+            editor.putString(userId, info)
+            editor.apply()
+            return roleInfo
+        }
+
+        fun getDemoRoleInfo(context: Context, userId: String): RoleInfo? {
+            try {
+                val sp = context.getSharedPreferences("app_role_info", Context.MODE_PRIVATE)
+                val info = sp.getString(userId, "")
+                return if (TextUtils.isEmpty(info)) {
+                    //没有则创建
+                    setDemoRoleInfo(context, userId)
+                } else {
+                    val jsonObject = JSONObject(info!!)
+                    RoleInfo(
+                        roleId = jsonObject.getString("role_id"),
+                        roleName = jsonObject.getString("role_name"),
+                        roleLevel = jsonObject.getString("role_level"),
+                        serverCode = jsonObject.getString("server_code"),
+                        serverName = jsonObject.getString("server_name"),
+                        vipLevel = jsonObject.getString("vip_level"),
+                        balance = jsonObject.getString("balance"),
+                        totalPurchase = jsonObject.getInt("total_purchase"),
+                        roleCTime = jsonObject.getLong("role_ctime")
+                    )
+                }
+
+            } catch (e: Exception) {
+                e.printStackTrace()
+            }
+            return null
+        }
+    }
+}

+ 100 - 13
demo/src/main/java/com/eyuangame/demo/DemoActivity.kt

@@ -10,9 +10,11 @@ import android.view.KeyEvent
 import android.view.View
 import android.widget.*
 import cn.yyxx.eyuangame.base.EYuanGame
+import cn.yyxx.eyuangame.base.entity.SdkChargeInfo
+import cn.yyxx.eyuangame.base.entity.SdkRoleInfo
 import cn.yyxx.eyuangame.base.internal.ICallback
-import cn.yyxx.eyuangame.core.ui.dialog.ScaleLoadingDialog
 import cn.yyxx.support.hawkeye.LogUtils
+import cn.yyxx.support.hawkeye.ToastUtils
 import kotlin.system.exitProcess
 
 
@@ -29,13 +31,17 @@ class DemoActivity : Activity(), View.OnClickListener {
         Item(3, "03 角色创建上报"),
         Item(4, "04 角色登录上报"),
         Item(5, "05 角色升级上报"),
-        Item(6, "06 定额充值"),
+        Item(6, "06 Google应用内购"),
+        Item(7, "07 第三方H5支付"),
+        Item(8, "08 Crashlytics崩溃测试"),
     )
 
 
     private lateinit var layout: LinearLayout
     private lateinit var mTextView: TextView
 
+    private var cacheRoleInfo: CacheRoleInfo.RoleInfo? = null
+
     private val handler = object : Handler(Looper.getMainLooper()) {
         override fun handleMessage(msg: Message) {
             when (msg.what) {
@@ -48,13 +54,13 @@ class DemoActivity : Activity(), View.OnClickListener {
         }
     }
 
-
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         initView()
         LogUtils.handler = handler
         EYuanGame.getInstance().initialize(this, false, object : ICallback {
             override fun onResult(code: Int, result: String) {
+                ToastUtils.toastInfo(this@DemoActivity, "---- demo提示不做翻译 ----\ncode : $code\n msg : $result\n ---- demo提示不做翻译 ----")
             }
         })
     }
@@ -73,7 +79,6 @@ class DemoActivity : Activity(), View.OnClickListener {
         setContentView(scrollView)
     }
 
-
     private fun initButton() {
         for (event in events) {
             with(Button(this)) {
@@ -86,16 +91,18 @@ class DemoActivity : Activity(), View.OnClickListener {
         }
     }
 
-
     override fun onClick(v: View?) {
         v?.apply {
-            mTextView.text = ""
+//            mTextView.text = ""
             when (tag as Int) {
                 0 -> EnvActivity.start(this@DemoActivity)
                 1 -> {
                     EYuanGame.getInstance().login(this@DemoActivity, true, object : ICallback {
                         override fun onResult(code: Int, result: String) {
-
+                            ToastUtils.toastInfo(this@DemoActivity, "---- demo提示不做翻译 ----\ncode : $code\n msg : $result\n ---- demo提示不做翻译 ----")
+                            if (code == 0) {
+                                cacheRoleInfo = CacheRoleInfo.getDemoRoleInfo(this@DemoActivity, EYuanGame.getInstance().getCurrentUserId())
+                            }
                         }
                     })
                 }
@@ -103,22 +110,102 @@ class DemoActivity : Activity(), View.OnClickListener {
                     EYuanGame.getInstance().logout(this@DemoActivity, object : ICallback {
                         override fun onResult(code: Int, result: String) {
                             if (code == 0) {
-                                EYuanGame.getInstance()
-                                    .login(this@DemoActivity, false, object : ICallback {
-                                        override fun onResult(code: Int, result: String) {
-                                        }
-                                    })
+                                EYuanGame.getInstance().login(this@DemoActivity, false, object : ICallback {
+                                    override fun onResult(code: Int, result: String) {
+                                        ToastUtils.toastInfo(this@DemoActivity, "---- demo提示不做翻译 ----\ncode : $code\n msg : $result\n ---- demo提示不做翻译 ----")
+                                    }
+                                })
                             }
                         }
                     })
                 }
                 3 -> {
-                    ScaleLoadingDialog(this@DemoActivity, "").show()
+                    cacheRoleInfo = null
+                    cacheRoleInfo = CacheRoleInfo.setDemoRoleInfo(this@DemoActivity, EYuanGame.getInstance().getCurrentUserId())
+                    EYuanGame.getInstance().roleCreate(this@DemoActivity, getGameRoleInfo())
+                }
+                4 -> EYuanGame.getInstance().roleLauncher(this@DemoActivity, getGameRoleInfo())
+                5 -> EYuanGame.getInstance().roleLevelUp(this@DemoActivity, getGameRoleInfo())
+                6 -> {
+                    EYuanGame.getInstance().charge(this@DemoActivity, getGameChargeInfo(), true, object : ICallback {
+                        override fun onResult(code: Int, result: String) {
+                            ToastUtils.toastInfo(this@DemoActivity, "---- demo提示不做翻译 ----\ncode : $code\n msg : $result\n ---- demo提示不做翻译 ----")
+                        }
+
+                    })
                 }
+                7 -> {
+                    EYuanGame.getInstance().charge(this@DemoActivity, getGameChargeInfo(), false, object : ICallback {
+                        override fun onResult(code: Int, result: String) {
+                            ToastUtils.toastInfo(this@DemoActivity, "---- demo提示不做翻译 ----\ncode : $code\n msg : $result\n ---- demo提示不做翻译 ----")
+                        }
+
+                    })
+                }
+                8 -> throw RuntimeException("Test Crashlytics Feature")
             }
         }
     }
 
+    private fun getGameRoleInfo(): SdkRoleInfo {
+        val gameRoleInfo = SdkRoleInfo()
+        //用户ID
+        gameRoleInfo.userId = EYuanGame.getInstance().getCurrentUserId()
+        cacheRoleInfo?.apply {
+            //角色ID
+            gameRoleInfo.roleId = roleId
+            //角色名称
+            gameRoleInfo.roleName = roleName
+            //角色等级
+            gameRoleInfo.roleLevel = roleLevel
+            //服务器ID
+            gameRoleInfo.serverId = serverCode
+            //服务器名
+            gameRoleInfo.serverName = serverName
+            //用户VIP等级,无该字段则传空串""
+            gameRoleInfo.vipLevel = vipLevel
+            //当前角色游戏币余额
+            gameRoleInfo.balance = balance
+        }
+        return gameRoleInfo
+    }
+
+    private fun getGameChargeInfo(): SdkChargeInfo {
+        val gameChargeInfo = SdkChargeInfo()
+        val orderId = "order_" + System.currentTimeMillis()
+        //用户ID
+        gameChargeInfo.userId = EYuanGame.getInstance().getCurrentUserId()
+        cacheRoleInfo?.apply {
+            //角色ID
+            gameChargeInfo.roleId = roleId
+            //角色名称
+            gameChargeInfo.roleName = roleName
+            //角色等级
+            gameChargeInfo.roleLevel = roleLevel
+            //创角时间戳
+            gameChargeInfo.roleCTime = roleCTime
+            //服务器ID
+            gameChargeInfo.serverId = serverCode
+            //服务器名
+            gameChargeInfo.serverName = serverName
+        }
+        //游戏的订单号
+        gameChargeInfo.cpOrderId = orderId
+        //透传字段,会在回调地址中原样返回
+        gameChargeInfo.cpExt = "cp_callback_info||$orderId"
+        //金额,单位分,币种美金
+        gameChargeInfo.amount = 99
+        //商品ID,计费点
+        gameChargeInfo.productId = "com.shzd.1usd"
+        //商品名称
+        gameChargeInfo.productName = "60元寶"
+        //商品描述
+        gameChargeInfo.productDesc = "60元寶"
+        gameChargeInfo.cpPayTime = System.currentTimeMillis() / 1000
+        gameChargeInfo.cpPaySign = "test123"
+        return gameChargeInfo
+    }
+
     override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
         if (keyCode == KeyEvent.KEYCODE_BACK) {
             EYuanGame.getInstance().openExitView(this, object : ICallback {

+ 19 - 10
demo/src/main/res/values/strings.xml

@@ -1,13 +1,22 @@
 <resources>
+    <string name="facebook_app_id" translatable="false">1047370039003298</string>
+    <string name="fb_login_protocol_scheme" translatable="false">fb1047370039003298</string>
     <string name="app_name" translatable="false">EYuanGameSdk-KTX</string>
-<!--    <string name="gcm_defaultSenderId" translatable="false">38153824010</string>-->
-<!--    <string name="google_api_key" translatable="false">AIzaSyAvNhYCtqGbzqd2aCLTxUAwCVSySDX7tng</string>-->
-<!--    <string name="google_app_id" translatable="false">1:38153824010:android:607f0f217d4cfa889dfcf3</string>-->
-<!--    <string name="google_crash_reporting_api_key" translatable="false">AIzaSyAvNhYCtqGbzqd2aCLTxUAwCVSySDX7tng</string>-->
-<!--    <string name="google_storage_bucket" translatable="false">api-project-82067969.appspot.com</string>-->
-<!--    <string name="project_id" translatable="false">api-project-82067969</string>-->
-<!--    <string name="default_web_client_id" translatable="false">38153824010-b2e01psqkkf8kfcr26d5l98pgana4pi2.apps.googleusercontent.com</string>-->
-<!--    <string name="com.crashlytics.RequireBuildId" translatable="false">true</string>-->
-<!--    <string name="com.google.firebase.crashlytics.mapping_file_id" translatable="false">00000000000000000000000000000000</string>-->
-<!--    <string name="title_feature_test">FeatureTest</string>-->
+    <!-- project_number -->
+    <string name="gcm_defaultSenderId" translatable="false">70429070957</string>
+    <!-- current_key -->
+    <string name="google_api_key" translatable="false">AIzaSyCm83BI5DNj8--WPduAppPDkyoFSx0yOdE</string>
+    <!-- mobilesdk_app_id -->
+    <string name="google_app_id" translatable="false">1:70429070957:android:07d3ee059d2d420cfb9164</string>
+    <!-- current_key -->
+    <string name="google_crash_reporting_api_key" translatable="false">AIzaSyCm83BI5DNj8--WPduAppPDkyoFSx0yOdE</string>
+    <!-- storage_bucket -->
+    <string name="google_storage_bucket" translatable="false">api-project-33500926.appspot.com</string>
+    <!-- project_id -->
+    <string name="project_id" translatable="false">api-project-33500926</string>
+    <!-- type3的client_id -->
+    <string name="default_web_client_id" translatable="false">70429070957-7clr9u565jrjgbgg474ksg8q2esq2okj.apps.googleusercontent.com</string>
+    <string name="com.crashlytics.RequireBuildId" translatable="false">true</string>
+    <string name="com.google.firebase.crashlytics.mapping_file_id" translatable="false">00000000000000000000000000000000</string>
+
 </resources>

+ 3 - 2
library_base/build.gradle

@@ -50,7 +50,8 @@ android {
 }
 
 dependencies {
-    api files('../libs/dolin_zap_1.0.0.jar')
+//    api files('../libs/dolin_zap_1.0.0.jar')
     api files('../libs/yyxx_support_1.0.1.jar')
-    implementation 'androidx.core:core-ktx:1.5.0'
+    implementation 'androidx.core:core-ktx:1.6.0'
+    implementation 'io.github.suyghur.dolin:zap:1.0.0'
 }

+ 8 - 3
library_base/src/main/java/cn/yyxx/eyuangame/base/EYuanGame.kt

@@ -16,6 +16,7 @@ import cn.yyxx.eyuangame.base.internal.ICallback
 import cn.yyxx.eyuangame.base.internal.IInitialize
 import cn.yyxx.eyuangame.base.utils.Logger
 import cn.yyxx.support.AppUtils
+import org.json.JSONObject
 
 /**
  * @author #Suyghur.
@@ -194,7 +195,7 @@ class EYuanGame private constructor() {
      * @param chargeInfo 支付信息实体对象
      * @param callback   支付回调对象
      */
-    fun charge(activity: Activity, chargeInfo: SdkChargeInfo, callback: ICallback) {
+    fun charge(activity: Activity, chargeInfo: SdkChargeInfo, isIab: Boolean, callback: ICallback) {
         if (checkSdkBridgeNull(Function.CHARGE, callback)) {
             return
         }
@@ -211,8 +212,8 @@ class EYuanGame private constructor() {
         clickChargeTime = System.currentTimeMillis()
         SdkBridgeManager.call(
             Function.CHARGE,
-            arrayOf(Activity::class.java, SdkChargeInfo::class.java, ICallback::class.java),
-            arrayOf(activity, chargeInfo, callback)
+            arrayOf(Activity::class.java, SdkChargeInfo::class.java, Boolean::class.java, ICallback::class.java),
+            arrayOf(activity, chargeInfo, isIab, callback)
         )
     }
 
@@ -392,6 +393,10 @@ class EYuanGame private constructor() {
         return Version.VERSION_NAME
     }
 
+    fun linkingEvent(activity: Activity, params: JSONObject) {
+
+    }
+
 
     private fun checkSdkBridgeNull(function: String, callback: ICallback?): Boolean {
         return if (mSdkBridge == null) {

+ 2 - 0
library_base/src/main/java/cn/yyxx/eyuangame/base/EYuanGameApplication.kt

@@ -2,6 +2,7 @@ package cn.yyxx.eyuangame.base
 
 import android.app.Application
 import android.content.Context
+import cn.yyxx.support.multidex.MultiDex
 
 /**
  * @author #Suyghur.
@@ -11,6 +12,7 @@ open class EYuanGameApplication : Application() {
 
     override fun attachBaseContext(base: Context) {
         super.attachBaseContext(base)
+        MultiDex.install(base)
         EYuanGame.getInstance().attachBaseContext(this, base)
     }
 

+ 5 - 2
library_base/src/main/java/cn/yyxx/eyuangame/base/entity/SdkChargeInfo.kt

@@ -12,6 +12,7 @@ class SdkChargeInfo : Serializable {
     var roleId: String = ""
     var roleName: String = ""
     var roleLevel: String = ""
+    var roleCTime: Long = 0
     var serverId: String = ""
     var serverName: String = ""
     var amount = 0
@@ -20,10 +21,12 @@ class SdkChargeInfo : Serializable {
     var productDesc: String = ""
     var cpOrderId: String = ""
     var orderId: String = ""
-    var cpCallbackInfo: String = ""
+    var cpExt: String = ""
+    var cpPayTime: Long = 0
+    var cpPaySign: String = ""
 
     override fun toString(): String {
-        return "SdkChargeInfo(userId='$userId', roleId='$roleId', roleName='$roleName', roleLevel='$roleLevel', serverId='$serverId', serverName='$serverName', amount=$amount, productId='$productId', productName='$productName', productDesc='$productDesc', cpOrderId='$cpOrderId', orderId='$orderId', cpCallbackInfo='$cpCallbackInfo')"
+        return "SdkChargeInfo(userId='$userId', roleId='$roleId', roleName='$roleName', roleLevel='$roleLevel', roleCTIme=$roleCTime, serverId='$serverId', serverName='$serverName', amount=$amount, productId='$productId', productName='$productName', productDesc='$productDesc', cpOrderId='$cpOrderId', orderId='$orderId', cpExt='$cpExt', cpPayTime=$cpPayTime, cpPaySign='$cpPaySign')"
     }
 
 }

+ 3 - 2
library_base/src/main/java/cn/yyxx/eyuangame/base/entity/SdkRoleInfo.kt

@@ -10,14 +10,15 @@ class SdkRoleInfo {
     var roleId: String = ""
     var roleName: String = ""
     var roleLevel: String = ""
+    var roleCTime: Long = 0
     var serverId: String = ""
     var serverName: String = ""
     var vipLevel: String = ""
     var balance: String = ""
+    var totalPurchase: Int = 0
 
 
     override fun toString(): String {
-        return "SdkRoleInfo(userId='$userId', roleId='$roleId', roleName='$roleName', roleLevel='$roleLevel', serverId='$serverId', serverName='$serverName', vipLevel='$vipLevel', balance='$balance')"
+        return "SdkRoleInfo(userId='$userId', roleId='$roleId', roleName='$roleName', roleLevel='$roleLevel', roleCTime=$roleCTime, serverId='$serverId', serverName='$serverName', vipLevel='$vipLevel', balance='$balance', totalPurchase=$totalPurchase)"
     }
-
 }

+ 16 - 6
library_core/build.gradle

@@ -66,18 +66,28 @@ android {
 
 dependencies {
 
-    api files('../libs/mmkv-static-1.2.8.jar')
-    implementation 'androidx.core:core-ktx:1.5.0'
+    //mmkv
+//    api files('../libs/mmkv-static-1.2.8.jar')
+    implementation 'com.tencent:mmkv-static:1.2.10'
+
+    //日志采集框架
+    implementation 'io.github.suyghur.dolin:zap:1.0.0'
+
+    implementation 'androidx.core:core-ktx:1.6.0'
     implementation 'androidx.fragment:fragment-ktx:1.3.5'
     implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
-    implementation 'com.google.android.material:material:1.3.0'
-
+    implementation 'com.google.android.material:material:1.4.0'
+    //google
     implementation 'com.google.android.play:core:1.10.0'
     implementation 'com.google.android.gms:play-services-auth:19.0.0'
     implementation 'com.android.billingclient:billing-ktx:4.0.0'
-
-
+    implementation 'com.google.firebase:firebase-analytics-ktx:19.0.0'
+    implementation 'com.google.firebase:firebase-crashlytics-ktx:18.1.0'
+    //facebook
     implementation 'com.facebook.android:facebook-login:9.0.0'
+    implementation 'com.facebook.android:facebook-android-sdk:5.15.3'
+    //adjust
+    implementation 'com.adjust.sdk:adjust-android:4.25.0'
 
     api project(':library_base')
 //    api project(':library_comm')

+ 31 - 2
library_core/src/main/AndroidManifest.xml

@@ -22,7 +22,7 @@
             android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
             android:imeOptions="flagNoFullscreen|flagNoExtractUi"
             android:launchMode="singleTask"
-            android:theme="@style/ColumbusTheme"
+            android:theme="@style/EYuanGameTheme"
             android:windowSoftInputMode="adjustResize|stateHidden|stateVisible" />
 
         <activity
@@ -30,13 +30,42 @@
             android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
             android:imeOptions="flagNoFullscreen|flagNoExtractUi"
             android:launchMode="singleTask"
-            android:theme="@style/ColumbusTheme"
+            android:theme="@style/EYuanGameTheme"
             android:windowSoftInputMode="adjustResize|stateHidden|stateVisible" />
 
+        <activity
+            android:name=".impl.center.HybridActivity"
+            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
+            android:imeOptions="flagNoFullscreen|flagNoExtractUi"
+            android:launchMode="singleTask"
+            android:theme="@style/EYuanGameTheme"
+            android:windowSoftInputMode="adjustResize|stateHidden|stateVisible" />
 
         <service
             android:name=".impl.floatball.FloatCenterService"
             android:exported="true" />
+
+        <!-- Facebook start -->
+        <meta-data
+            android:name="com.facebook.sdk.ApplicationId"
+            android:value="@string/facebook_app_id" />
+
+        <activity
+            android:name="com.facebook.FacebookActivity"
+            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" />
+
+        <activity
+            android:name="com.facebook.CustomTabActivity"
+            android:exported="true">
+            <intent-filter>
+                <action android:name="android.intent.action.VIEW" />
+
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.BROWSABLE" />
+
+                <data android:scheme="@string/fb_login_protocol_scheme" />
+            </intent-filter>
+        </activity>
     </application>
 
 </manifest>

+ 1 - 1
library_core/src/main/cpp/comm_map.cpp

@@ -35,7 +35,7 @@ void CommMap::Init(JNIEnv *env, jobject context) {
 
     comm_params["android_id"] = ToolKit::GetAndroidDeviceId(env, context);
     comm_params["network"] = ToolKit::GetNetworkType(env, context);
-    comm_params["os"] = "android";
+    comm_params["os"] = 1;
     comm_params["os_version"] = ToolKit::GetDeviceSoftwareVersion();
     comm_params["mobile_model"] = ToolKit::GetDeviceModel();
     comm_params["mobile_mfrs"] = ToolKit::GetDeviceManufacturer();

+ 2 - 2
library_core/src/main/java/cn/yyxx/eyuangame/core/SdkBridge.kt

@@ -45,8 +45,8 @@ class SdkBridge constructor(context: Context) {
         mImpl?.logout(activity, callback)
     }
 
-    fun charge(activity: Activity, chargeInfo: SdkChargeInfo, callback: ICallback) {
-        mImpl?.charge(activity, chargeInfo, callback)
+    fun charge(activity: Activity, chargeInfo: SdkChargeInfo, isIab: Boolean, callback: ICallback) {
+        mImpl?.charge(activity, chargeInfo, isIab, callback)
     }
 
     fun roleCreate(activity: Activity, roleInfo: SdkRoleInfo) {

+ 10 - 0
library_core/src/main/java/cn/yyxx/eyuangame/core/entity/SubmitTiming.kt

@@ -0,0 +1,10 @@
+package cn.yyxx.eyuangame.core.entity
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/07/07
+ */
+enum class SubmitTiming {
+    ROLE_CREATE,
+    ROLE_LAUNCHER
+}

+ 10 - 10
library_core/src/main/java/cn/yyxx/eyuangame/core/entity/bean/init/FloatCfg.kt

@@ -30,12 +30,12 @@ class FloatCfg {
             bean.gmCfg = FeatureCfg()
             bean.chargeCfg = FeatureCfg()
             bean.inviteCfg = FeatureCfg()
-            if (JsonUtils.hasJsonKey(floatCfg, "switch")) {
-                bean.switch = floatCfg.getInt("switch")
+            if (JsonUtils.hasJsonKey(floatCfg, "cfg_s")) {
+                bean.switch = floatCfg.getInt("cfg_s")
             }
 
-            if (JsonUtils.hasJsonKey(floatCfg, "float_icon_url")) {
-                bean.floatIconUrl = floatCfg.getString("float_icon_url")
+            if (JsonUtils.hasJsonKey(floatCfg, "float_icon_line")) {
+                bean.floatIconUrl = floatCfg.getString("float_icon_line")
             }
 
             if (JsonUtils.hasJsonKey(floatCfg, "member_cfg")) {
@@ -75,16 +75,16 @@ class FloatCfg {
         companion object {
             fun toBean(cfg: JSONObject): FeatureCfg {
                 val bean = FeatureCfg()
-                if (JsonUtils.hasJsonKey(cfg, "switch")) {
-                    bean.switch = cfg.getInt("switch")
+                if (JsonUtils.hasJsonKey(cfg, "cfg_s")) {
+                    bean.switch = cfg.getInt("cfg_s")
                 }
 
-                if (JsonUtils.hasJsonKey(cfg, "icon_url")) {
-                    bean.iconUrl = cfg.getString("icon_url")
+                if (JsonUtils.hasJsonKey(cfg, "icon_line")) {
+                    bean.iconUrl = cfg.getString("icon_line")
                 }
 
-                if (JsonUtils.hasJsonKey(cfg, "url")) {
-                    bean.url = cfg.getString("url")
+                if (JsonUtils.hasJsonKey(cfg, "line")) {
+                    bean.url = cfg.getString("line")
                 }
                 return bean
             }

+ 16 - 9
library_core/src/main/java/cn/yyxx/eyuangame/core/entity/bean/init/InitBean.kt

@@ -1,6 +1,7 @@
 package cn.yyxx.eyuangame.core.entity.bean.init
 
 import android.text.TextUtils
+import cn.yyxx.eyuangame.base.utils.Logger
 import cn.yyxx.support.JsonUtils
 import org.json.JSONException
 import org.json.JSONObject
@@ -14,8 +15,8 @@ class InitBean private constructor() {
     lateinit var noticeCfg: NoticeCfg
     lateinit var privacyCfg: PrivacyCfg
     lateinit var floatCfg: FloatCfg
-
     var rewardId = ""
+    val areaCodeList = mutableListOf<String>()
 
     override fun toString(): String {
         return "InitBean(noticeCfg=$noticeCfg, privacyCfg=$privacyCfg, floatCfg=$floatCfg, rewardId='$rewardId')"
@@ -37,12 +38,12 @@ class InitBean private constructor() {
 
                 if (JsonUtils.hasJsonKey(jsonObject, "notice_cfg")) {
                     val cfg = jsonObject.getJSONObject("notice_cfg")
-                    if (JsonUtils.hasJsonKey(cfg, "switch")) {
-                        bean.noticeCfg.switch = cfg.getInt("switch")
+                    if (JsonUtils.hasJsonKey(cfg, "cfg_s")) {
+                        bean.noticeCfg.switch = cfg.getInt("cfg_s")
                     }
 
-                    if (JsonUtils.hasJsonKey(cfg, "url")) {
-                        bean.noticeCfg.url = cfg.getString("url")
+                    if (JsonUtils.hasJsonKey(cfg, "line")) {
+                        bean.noticeCfg.url = cfg.getString("line")
                     }
 
                     if (JsonUtils.hasJsonKey(cfg, "show_count")) {
@@ -52,12 +53,12 @@ class InitBean private constructor() {
 
                 if (JsonUtils.hasJsonKey(jsonObject, "privacy_cfg")) {
                     val cfg = jsonObject.getJSONObject("privacy_cfg")
-                    if (JsonUtils.hasJsonKey(cfg, "switch")) {
-                        bean.privacyCfg.switch = cfg.getInt("switch")
+                    if (JsonUtils.hasJsonKey(cfg, "cfg_s")) {
+                        bean.privacyCfg.switch = cfg.getInt("cfg_s")
                     }
 
-                    if (JsonUtils.hasJsonKey(cfg, "url")) {
-                        bean.privacyCfg.url = cfg.getString("url")
+                    if (JsonUtils.hasJsonKey(cfg, "line")) {
+                        bean.privacyCfg.url = cfg.getString("line")
                     }
                 }
 
@@ -69,6 +70,12 @@ class InitBean private constructor() {
                 if (JsonUtils.hasJsonKey(jsonObject, "reward_id")) {
                     bean.rewardId = jsonObject.getString("reward_id")
                 }
+                if (JsonUtils.hasJsonKey(jsonObject, "area_code_list")) {
+                    val list = jsonObject.getJSONArray("area_code_list")
+                    for (i in 0 until list.length()) {
+                        bean.areaCodeList.add(list[i].toString())
+                    }
+                }
             } catch (e: JSONException) {
                 e.printStackTrace()
             }

+ 31 - 14
library_core/src/main/java/cn/yyxx/eyuangame/core/impl/SdkBridgeImpl.kt

@@ -14,6 +14,7 @@ import cn.yyxx.eyuangame.base.utils.ParamsUtils
 import cn.yyxx.eyuangame.core.entity.ResultInfo
 import cn.yyxx.eyuangame.core.entity.SdkBackLoginInfo
 import cn.yyxx.eyuangame.core.entity.bean.init.InitBean
+import cn.yyxx.eyuangame.core.impl.center.HybridActivity
 import cn.yyxx.eyuangame.core.impl.floatball.FloatCenterServiceManager
 import cn.yyxx.eyuangame.core.impl.iab.ChargeImpl
 import cn.yyxx.eyuangame.core.impl.login.LoginActivity
@@ -40,7 +41,7 @@ import java.util.concurrent.atomic.AtomicInteger
  * Created on 2021/06/16
  */
 class SdkBridgeImpl(context: Context) {
-    
+
     private var hasReadGaid = false
     private var roleInfo: SdkRoleInfo? = null
 
@@ -94,7 +95,7 @@ class SdkBridgeImpl(context: Context) {
     fun initialize(activity: Activity, isLandscape: Boolean, callback: ICallback, initCallback: IInitialize) {
         Logger.i("EYuanGameSdk initialize ...")
         isLand = isLandscape
-        
+
         if (TextUtils.isEmpty(ParamsUtils.getGcpCode(activity))) {
             Logger.e("初始化失败,参数异常,请检查yyxx_cfg.properties中YYXX_GCP_CODE的值")
             initCallback.onResult(-1, "初始化失败,参数异常,请检查yyxx_cfg.properties中YYXX_GAME_CODE的值")
@@ -174,7 +175,7 @@ class SdkBridgeImpl(context: Context) {
 
     fun login(activity: Activity, isAutoLogin: Boolean, callback: ICallback) {
         Logger.i("EYuanGameSdk login ...")
-        
+
         if (!initState) {
             Logger.e("登录失败,SDK未初始化或初始化失败")
             callback.onResult(-1, "登录失败,SDK未初始化或初始化失败")
@@ -218,23 +219,23 @@ class SdkBridgeImpl(context: Context) {
         LoginActivity.login(activity, isAutoLogin, object : IImplCallback {
             override fun onResult(code: Int, result: String) {
                 Logger.d("onResult code : $code , result : $result")
-                ToastUtils.toastInfo(activity, "onResult code : $code , result : $result")
+                callback.onResult(code, result)
             }
         })
     }
 
     fun logout(activity: Activity, callback: ICallback) {
         Logger.i("EYuanGameSdk logout ...")
-        
+
         this.roleInfo = null
         SdkBackLoginInfo.instance.reset()
         FloatCenterServiceManager.instance.detach()
         callback.onResult(0, "用户登出成功")
     }
 
-    fun charge(activity: Activity, chargeInfo: SdkChargeInfo, callback: ICallback) {
+    fun charge(activity: Activity, chargeInfo: SdkChargeInfo, isIab: Boolean, callback: ICallback) {
         Logger.i("EYuanGameSdk charge ...")
-        
+
         if (!initState) {
             Logger.e("支付失败,SDK未初始化或初始化失败")
             callback.onResult(-1, "支付失败,SDK未初始化或初始化失败")
@@ -262,29 +263,45 @@ class SdkBridgeImpl(context: Context) {
             callback.onResult(-1, "支付失败,支付信息对象拷贝过程异常")
             return
         }
-        ChargeImpl.instance.charge(activity, innerChargeInfo, object : IImplCallback {
-            override fun onResult(code: Int, result: String) {
-                callback.onResult(code, result)
-            }
-        })
+        if (isIab) {
+            ChargeImpl.instance.charge(activity, innerChargeInfo, object : IImplCallback {
+                override fun onResult(code: Int, result: String) {
+                    callback.onResult(code, result)
+                }
+            })
+        } else {
+            //H5支付
+            HybridActivity.start(activity, initBean.floatCfg.chargeCfg.url)
+        }
     }
 
     fun roleCreate(activity: Activity, roleInfo: SdkRoleInfo) {
         Logger.i("EYuanGameSdk roleCreate ...")
-
+        submitRoleData(activity, 0, roleInfo)
     }
 
     fun roleLauncher(activity: Activity, roleInfo: SdkRoleInfo) {
         Logger.i("EYuanGameSdk roleLauncher ...")
+        submitRoleData(activity, 1, roleInfo)
     }
 
     fun roleLevelUp(activity: Activity, roleInfo: SdkRoleInfo) {
         Logger.i("EYuanGameSdk roleLevelUp ...")
     }
 
+    private fun submitRoleData(activity: Activity, timing: Int, roleInfo: SdkRoleInfo) {
+        isSubmitRoleData = true
+        SdkRequest.instance.submitRoleData(activity, timing, roleInfo, object : IRequestCallback {
+            override fun onResponse(resultInfo: ResultInfo) {
+
+            }
+
+        })
+    }
+
     fun openExitView(activity: Activity, callback: ICallback) {
         Logger.i("EYuanGameSdk openExitView ...")
-        
+
         exitDialog?.apply {
             dismiss()
             exitDialog = null

+ 176 - 0
library_core/src/main/java/cn/yyxx/eyuangame/core/impl/center/HybridActivity.kt

@@ -0,0 +1,176 @@
+package cn.yyxx.eyuangame.core.impl.center
+
+import android.app.Activity
+import android.content.Intent
+import android.net.Uri
+import android.net.http.SslError
+import android.os.Bundle
+import android.text.TextUtils
+import android.view.View
+import android.view.WindowManager
+import android.webkit.*
+import android.widget.FrameLayout
+import android.widget.ImageView
+import android.widget.TextView
+import cn.yyxx.eyuangame.core.impl.SdkBridgeImpl
+import cn.yyxx.support.AndroidBug5497Workaround
+import cn.yyxx.support.ResUtils
+import cn.yyxx.support.device.DeviceInfoUtils
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/07/02
+ */
+class HybridActivity : Activity() {
+
+    private lateinit var ivReturn: ImageView
+    private lateinit var tvTitle: TextView
+    private lateinit var webView: WebView
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+
+        initView()
+        initWebView()
+    }
+
+    private fun initView() {
+        if (SdkBridgeImpl.isLand) {
+            window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
+        }
+        setContentView(ResUtils.getResId(this, "yyxx_hybrid", "layout"))
+
+        if (!SdkBridgeImpl.isLand) {
+            AndroidBug5497Workaround.assistActivity(this)
+        }
+
+        tvTitle = findViewById(ResUtils.getResId(this, "yyxx_tv_title", "id"))
+        ivReturn = findViewById(ResUtils.getResId(this, "yyxx_iv_return", "id"))
+    }
+
+
+    private fun initWebView() {
+        webView = WebView(this)
+        webView.isVerticalScrollBarEnabled = true
+        webView.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY
+//        webView.addJavascriptInterface(SdkJsImpl(this, callback), "FlyFunSdk")
+        val container = findViewById<FrameLayout>(ResUtils.getResId(this, "yyxx_webview_container", "id"))
+        container.addView(webView)
+
+//        webView.viewTreeObserver.addOnGlobalLayoutListener {
+//            if (isSoftShowing()) {
+//                view.visibility = View.GONE
+//            } else {
+//                view.visibility = View.VISIBLE
+//            }
+//        }
+
+        val webSetting = webView.settings
+        webSetting.allowFileAccess = true
+        webSetting.layoutAlgorithm = WebSettings.LayoutAlgorithm.NARROW_COLUMNS
+        webSetting.setSupportZoom(true)
+        webSetting.saveFormData = true
+        webSetting.savePassword = true
+        webSetting.builtInZoomControls = false
+        webSetting.useWideViewPort = true
+        webSetting.setSupportMultipleWindows(false)
+        webSetting.setAppCacheEnabled(false)
+        webSetting.domStorageEnabled = true
+        webSetting.javaScriptEnabled = true
+        webSetting.setGeolocationEnabled(true)
+        webSetting.setAppCacheMaxSize(Long.MAX_VALUE)
+        webSetting.setAppCachePath(getDir("appcache", 0).path)
+        webSetting.databasePath = getDir("databases", 0).path
+        webSetting.setGeolocationDatabasePath(getDir("geolocation", 0).path)
+        webSetting.pluginState = WebSettings.PluginState.ON_DEMAND
+        CookieSyncManager.createInstance(this)
+        CookieSyncManager.getInstance().sync()
+
+        if (DeviceInfoUtils.isNetworkConnected(this)) {
+            webView.loadUrl(url)
+            //webView.loadUrl("file:///android_asset/test.html");
+        } else {
+            //这种写法可以正确解码
+            webView.loadData("网络异常,请检查重试", "text/html; charset=UTF-8", null)
+        }
+
+        webView.webViewClient = object : WebViewClient() {
+            override fun onPageFinished(view: WebView, url: String) {
+                super.onPageFinished(view, url)
+//                if (view.canGoBack() && Uri.parse(url).path != "/index.html") {
+//                    ivReturn.visibility = View.VISIBLE
+//                } else {
+//                    ivReturn.visibility = View.GONE
+//                }
+            }
+
+            override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
+                val hitTestResult = view.hitTestResult
+                if (url.startsWith("http:") || url.startsWith("https:")) {
+                    //解决重定向加载的问题 return false
+                    if (!view.canGoBack()) {
+                        return false
+                    }
+                    //解决重定向加载的问题 return false
+                    if (hitTestResult.type == WebView.HitTestResult.UNKNOWN_TYPE) {
+                        return false
+                    }
+                    view.loadUrl(url)
+                }
+                return false
+            }
+
+            override fun onReceivedSslError(view: WebView, handler: SslErrorHandler, error: SslError) {
+                //部分手机浏览器不支持https,所以此处需要接受证书
+//                handler.proceed()
+//                showSslErrorDialog(handler)
+
+            }
+        }
+
+        webView.webChromeClient = object : WebChromeClient() {
+            override fun onProgressChanged(view: WebView, newProgress: Int) {
+                super.onProgressChanged(view, newProgress)
+                //progressWebView.setProgressBarProgress(newProgress);
+//                if (newProgress == 100 && loadingDialog != null && loadingDialog!!.isShowing) {
+//                    //加载完成,关闭loading
+//                    loadingDialog!!.dismiss()
+//                }
+            }
+
+            //For Android > 5.0
+            override fun onShowFileChooser(webView: WebView, filePathCallback: ValueCallback<Array<Uri>>, fileChooserParams: FileChooserParams): Boolean {
+//                openFileChooserImplForAndroid5(filePathCallback)
+                return true
+            }
+
+            override fun onReceivedTitle(view: WebView, title: String) {
+                super.onReceivedTitle(view, title)
+                if (!DeviceInfoUtils.isNetworkConnected(view.context)) {
+                    tvTitle.text = "网络异常"
+                    return
+                }
+                if (!TextUtils.isEmpty(view.title)) {
+                    var viewtitle = view.title
+                    if (viewtitle!!.length > 10) {
+                        viewtitle = viewtitle.substring(0, 10)
+                        viewtitle = "$viewtitle..."
+                    }
+                    tvTitle.text = viewtitle
+                }
+            }
+        }
+    }
+
+    companion object {
+
+        private var url = ""
+
+        fun start(activity: Activity, url: String) {
+            Companion.url = url
+            activity.startActivity(Intent(activity, HybridActivity::class.java).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
+        }
+
+
+    }
+}

+ 1 - 0
library_core/src/main/java/cn/yyxx/eyuangame/core/impl/center/fragment/BindAccountFragment.kt

@@ -116,6 +116,7 @@ class BindAccountFragment : Fragment(), View.OnClickListener {
                 SdkRequest.instance.bindAccount(requireActivity(), this, object : IRequestCallback {
                     override fun onResponse(resultInfo: ResultInfo) {
                         if (resultInfo.code == 1) {
+                            SdkBackLoginInfo.instance.hasBindAccount = true
                             ToastUtils.toastInfo(requireActivity(), resultInfo.msg)
                             requireActivity().onBackPressed()
                         } else {

+ 24 - 11
library_core/src/main/java/cn/yyxx/eyuangame/core/impl/center/fragment/BindPhoneFragment.kt

@@ -18,6 +18,7 @@ import cn.yyxx.eyuangame.base.utils.Logger
 import cn.yyxx.eyuangame.core.entity.ClickType
 import cn.yyxx.eyuangame.core.entity.ResultInfo
 import cn.yyxx.eyuangame.core.entity.SdkBackLoginInfo
+import cn.yyxx.eyuangame.core.impl.SdkBridgeImpl
 import cn.yyxx.eyuangame.core.impl.center.MemberActivity
 import cn.yyxx.eyuangame.core.internal.IRequestCallback
 import cn.yyxx.eyuangame.core.network.SdkRequest
@@ -54,7 +55,7 @@ class BindPhoneFragment : Fragment(), View.OnClickListener {
     private lateinit var llAreaList: LinearLayout
     private lateinit var svAreaList: ScrollView
 
-    private val areaList = mutableListOf<String>()
+    private val areaCodeList = mutableListOf<String>()
 
     private var imgUp = 0
     private var imgDown = 0
@@ -125,19 +126,30 @@ class BindPhoneFragment : Fragment(), View.OnClickListener {
         autoFillAreaList(requireActivity())
 
         tvBindTips = view.findViewById(ResUtils.getResId(requireActivity(), "yyxx_tv_tips2", "id"))
-        tvBindTips.text = "${ResUtils.getResString(requireActivity(), "yyxx_iv_bind_phone_tips2")}135xxxx0963"
+        val tipsPhone = if (SdkBackLoginInfo.instance.phoneNum.length > 6) {
+            val head = SdkBackLoginInfo.instance.phoneNum.substring(0, 3)
+            val foot = SdkBackLoginInfo.instance.phoneNum.substring(SdkBackLoginInfo.instance.phoneNum.length - 3, SdkBackLoginInfo.instance.phoneNum.length)
+            "${head}xxxx${foot}"
+        } else {
+            SdkBackLoginInfo.instance.phoneNum
+        }
+        tvBindTips.text = "${ResUtils.getResString(requireActivity(), "yyxx_iv_bind_phone_tips2")}$tipsPhone"
     }
 
     private fun autoFillAreaList(context: Context) {
-        if (areaList.size == 0) {
+        if (SdkBridgeImpl.initBean.areaCodeList.isNullOrEmpty()) {
             //默认4个地区
-            areaList.add("86")
+            areaCodeList.add("86")
             //香港
-            areaList.add("852")
+            areaCodeList.add("852")
             //澳门
-            areaList.add("853")
+            areaCodeList.add("853")
             //台湾
-            areaList.add("886")
+            areaCodeList.add("886")
+        } else {
+            SdkBridgeImpl.initBean.areaCodeList.forEach {
+                areaCodeList.add(it)
+            }
         }
         initAreaList(context)
     }
@@ -155,7 +167,7 @@ class BindPhoneFragment : Fragment(), View.OnClickListener {
         }
         //ScrollView高度
         var maxHeight = 0
-        areaList.apply {
+        areaCodeList.apply {
             maxHeight = if (size < 2) {
                 size * height
             } else {
@@ -163,7 +175,7 @@ class BindPhoneFragment : Fragment(), View.OnClickListener {
             }
         }
         //循环添加列
-        areaList.apply {
+        areaCodeList.apply {
             for (i in indices) {
                 val areaCode = this[i]
                 //添加线
@@ -206,7 +218,7 @@ class BindPhoneFragment : Fragment(), View.OnClickListener {
         Logger.d("$areaCode ...")
         val phoneNum = eetPhone.editText.text.trim().toString()
 
-        if (TextUtils.isEmpty(areaCode)) {
+        if (TextUtils.isEmpty(areaCode) || areaCode == ResUtils.getResString(requireActivity(), "yyxx_tv_area_code")) {
             ToastUtils.toastInfo(requireActivity(), ResUtils.getResString(requireActivity(), "yyxx_tips_area_code_format_error"))
             return
         }
@@ -258,6 +270,7 @@ class BindPhoneFragment : Fragment(), View.OnClickListener {
                 SdkRequest.instance.bindPhone(requireActivity(), this, object : IRequestCallback {
                     override fun onResponse(resultInfo: ResultInfo) {
                         if (resultInfo.code == 1) {
+                            SdkBackLoginInfo.instance.phoneNum = phoneNum
                             ToastUtils.toastInfo(requireActivity(), resultInfo.msg)
                             requireActivity().onBackPressed()
                         } else {
@@ -326,7 +339,7 @@ class BindPhoneFragment : Fragment(), View.OnClickListener {
 
     override fun onDestroy() {
         super.onDestroy()
-        areaList.clear()
+        areaCodeList.clear()
         rlAreaList.visibility = View.GONE
     }
 

+ 1 - 1
library_core/src/main/java/cn/yyxx/eyuangame/core/impl/center/fragment/ModifyPwdFragment.kt

@@ -128,7 +128,7 @@ class ModifyPwdFragment : Fragment(), View.OnClickListener {
         try {
             with(JSONObject()) {
                 put("uid", SdkBackLoginInfo.instance.userId)
-                put("old_pwd", oldPwd)
+                put("pwd", oldPwd)
                 put("new_pwd", newPwd)
                 SdkRequest.instance.modifyUserPwd(requireActivity(), this, object : IRequestCallback {
                     override fun onResponse(resultInfo: ResultInfo) {

+ 17 - 5
library_core/src/main/java/cn/yyxx/eyuangame/core/impl/floatball/FloatCenterService.kt

@@ -6,9 +6,9 @@ import android.content.Intent
 import android.os.Binder
 import android.os.IBinder
 import android.widget.ImageView
-import cn.yyxx.eyuangame.base.utils.Logger
 import cn.yyxx.eyuangame.core.entity.FloatFeature
 import cn.yyxx.eyuangame.core.impl.SdkBridgeImpl
+import cn.yyxx.eyuangame.core.impl.center.HybridActivity
 import cn.yyxx.eyuangame.core.impl.center.MemberActivity
 import cn.yyxx.eyuangame.core.ui.floatview.FloatingBall
 import cn.yyxx.eyuangame.core.ui.floatview.FloatingBallMenu
@@ -25,7 +25,18 @@ class FloatCenterService : Service() {
 
     private val callback = object : FloatingBall.FloatingBallCallback {
         override fun onUpdateBallView(ballView: ImageView, isLeftLocation: Boolean, isHide: Boolean) {
-            ballView.setBackgroundResource(ResUtils.getResId(mActivity, "yyxx_float_logo_img", "drawable"))
+            val resId = if (isHide) {
+                ballView.alpha = 0.8f
+                if (isLeftLocation) {
+                    ResUtils.getResId(mActivity, "yyxx_float_logo_left_img", "drawable")
+                } else {
+                    ResUtils.getResId(mActivity, "yyxx_float_logo_right_img", "drawable")
+                }
+            } else {
+                ballView.alpha = 1.0f
+                ResUtils.getResId(mActivity, "yyxx_float_logo_img", "drawable")
+            }
+            ballView.setBackgroundResource(resId)
         }
 
         override fun onInitMenuData(): MutableList<FloatingBallMenu.FloatingBallMenuItem> {
@@ -49,9 +60,12 @@ class FloatCenterService : Service() {
         }
 
         override fun onMenuItemClick(item: FloatingBallMenu.FloatingBallMenuItem, pos: Int) {
-            Logger.d("onMenuItemClick , ${item.type.name}")
             when (item.type) {
                 FloatFeature.FEATURE_MEMBER -> MemberActivity.start(mActivity!!)
+                FloatFeature.FEATURE_GIF -> HybridActivity.start(mActivity!!, SdkBridgeImpl.initBean.floatCfg.gifCfg.url)
+                FloatFeature.FEATURE_GM -> HybridActivity.start(mActivity!!, SdkBridgeImpl.initBean.floatCfg.gmCfg.url)
+                FloatFeature.FEATURE_CHARGE -> HybridActivity.start(mActivity!!, SdkBridgeImpl.initBean.floatCfg.chargeCfg.url)
+                FloatFeature.FEATURE_INVITE -> HybridActivity.start(mActivity!!, SdkBridgeImpl.initBean.floatCfg.inviteCfg.url)
             }
         }
 
@@ -61,7 +75,6 @@ class FloatCenterService : Service() {
         override fun onDismissMenu() {
             floatingBall?.dismissMenu()
         }
-
     }
 
     override fun onCreate() {
@@ -102,5 +115,4 @@ class FloatCenterService : Service() {
     inner class FloatCenterServiceBinder : Binder() {
         val service: FloatCenterService = this@FloatCenterService
     }
-
 }

+ 111 - 61
library_core/src/main/java/cn/yyxx/eyuangame/core/impl/iab/ChargeImpl.kt

@@ -9,7 +9,8 @@ import cn.yyxx.eyuangame.core.impl.SdkBridgeImpl
 import cn.yyxx.eyuangame.core.internal.IImplCallback
 import cn.yyxx.eyuangame.core.internal.IRequestCallback
 import cn.yyxx.eyuangame.core.network.SdkRequest
-import cn.yyxx.support.JsonUtils
+import cn.yyxx.eyuangame.core.utils.MMKVUtils
+import cn.yyxx.support.ResUtils
 import cn.yyxx.support.hawkeye.ToastUtils
 import com.android.billingclient.api.*
 import org.json.JSONException
@@ -23,7 +24,6 @@ class ChargeImpl : InAppBilling() {
 
     //初始化IAB收银台客户端
     //连接谷歌商店
-//    private var payLoadingDialog: CircleProgressLoadingDialog? = null
     private lateinit var implCallback: IImplCallback
     private lateinit var chargeInfo: SdkChargeInfo
 
@@ -36,16 +36,14 @@ class ChargeImpl : InAppBilling() {
         }
         this.implCallback = callback
         this.chargeInfo = chargeInfo
-        //dismissDialog()
-        //showDialog()
+        showDialog(activity)
 
-        checkLocalNotifyFailedOrder(activity)
+//        checkLocalNotifyFailedOrder(activity)
         getOrderId(activity)
-
     }
 
     override fun chargePurchasesUpdated(activity: Activity, purchase: Purchase) {
-        notifyOrder2Backend(activity, chargeInfo.orderId, purchase.originalJson, purchase.signature, false)
+        notifyOrder2Backend(activity, chargeInfo.orderId, purchase, false)
     }
 
     override fun preRewardPurchasesUpdated(activity: Activity, purchase: Purchase) {
@@ -61,6 +59,7 @@ class ChargeImpl : InAppBilling() {
         billingClient?.apply {
             queryPurchasesAsync(BillingClient.SkuType.INAPP, object : PurchasesResponseListener {
                 override fun onQueryPurchasesResponse(billingResult: BillingResult, list: MutableList<Purchase>) {
+                    logBillingResult("onQueryPurchasesResponse", billingResult)
                     if (list.isNullOrEmpty()) {
                         //正常发起支付流程
                         Logger.d("正常发起支付流程")
@@ -69,14 +68,13 @@ class ChargeImpl : InAppBilling() {
                         Logger.e("存在未消耗订单,发起补单流程,size : ${list.size}")
                         run breaking@{
                             list.forEach { purchase ->
-                                Logger.d(purchase.toString())
                                 purchase.skus.forEach {
                                     if (it.equals(SdkBridgeImpl.initBean.rewardId)) {
                                         Logger.e("存在阻塞的预注册奖励,停止支付流程")
                                         if (list.size == 1) {
-                                            ToastUtils.toastInfo(activity, "In-app Billing has some error , please restart app and try again")
                                             dismissDialog()
                                             disConnection()
+                                            ToastUtils.toastInfo(activity, "In-app Billing has some error , please restart app and try again")
                                             implCallback.onResult(-1, "存在阻塞的预注册奖励,停止支付流程")
                                         }
                                         //跳出支付流程
@@ -89,17 +87,14 @@ class ChargeImpl : InAppBilling() {
                         }
                     }
                 }
-
             })
         }
     }
 
     override fun purchasesUpdatedFailed() {
-        TODO("Not yet implemented")
     }
 
     override fun connectGooglePlayFailed() {
-        TODO("Not yet implemented")
     }
 
     /**
@@ -126,9 +121,24 @@ class ChargeImpl : InAppBilling() {
                         connectGooglePlay(activity, false)
                     } catch (e: JSONException) {
                         e.printStackTrace()
-                        //dismissDialog()
+                        dismissDialog()
+                        val msg = if (TextUtils.isEmpty(resultInfo.msg)) {
+                            ResUtils.getResString(activity, "yyxx_charge_tv_error")
+                        } else {
+                            resultInfo.msg
+                        }
+                        ToastUtils.toastInfo(activity, msg)
                         implCallback.onResult(-1, "获取订单异常")
                     }
+                } else {
+                    dismissDialog()
+                    val msg = if (TextUtils.isEmpty(resultInfo.msg)) {
+                        ResUtils.getResString(activity, "yyxx_charge_tv_error")
+                    } else {
+                        resultInfo.msg
+                    }
+                    ToastUtils.toastInfo(activity, msg)
+                    implCallback.onResult(-1, "获取订单异常")
                 }
             }
 
@@ -142,26 +152,27 @@ class ChargeImpl : InAppBilling() {
         val skus = mutableListOf<String>()
         skus.add(chargeInfo.productId)
         val params = SkuDetailsParams.newBuilder().setType(BillingClient.SkuType.INAPP).setSkusList(skus).build()
-        billingClient?.querySkuDetailsAsync(params, object : SkuDetailsResponseListener {
-            override fun onSkuDetailsResponse(billingResult: BillingResult, list: MutableList<SkuDetails>?) {
-                dismissDialog()
-                if (list.isNullOrEmpty()) {
-                    //查询商品信息失败
-                    Logger.e("查询商品信息失败")
-                    implCallback.onResult(-1, "查询商品信息失败")
-                    disConnection()
+        billingClient?.querySkuDetailsAsync(params) { billingResult, list ->
+            logBillingResult("onSkuDetailsResponse", billingResult)
+            dismissDialog()
+            if (list.isNullOrEmpty()) {
+                //查询商品信息失败
+                Logger.e("查询商品信息失败")
+                ToastUtils.toastInfo(activity, ResUtils.getResString(activity, "yyxx_charge_tv_error"))
+                implCallback.onResult(-1, "查询商品信息失败")
+                disConnection()
+            } else {
+                if (list.size == 1) {
+                    val skuDetails = list[0]
+                    Logger.d("product id : ${skuDetails.sku}")
+                    launchBillingFlow(activity, skuDetails)
                 } else {
-                    if (list.size == 1) {
-                        val skuDetails = list[0]
-                        Logger.d("product id : ${skuDetails.sku}")
-                        launchBillingFlow(activity, skuDetails)
-                    } else {
-                        implCallback.onResult(-1, "查询商品信息异常")
-                        disConnection()
-                    }
+                    ToastUtils.toastInfo(activity, ResUtils.getResString(activity, "yyxx_charge_tv_error"))
+                    implCallback.onResult(-1, "查询商品信息异常")
+                    disConnection()
                 }
             }
-        })
+        }
     }
 
     /**
@@ -172,15 +183,19 @@ class ChargeImpl : InAppBilling() {
         billingClient?.apply {
             if (isReady) {
                 val flowParams = BillingFlowParams.newBuilder().setObfuscatedAccountId(chargeInfo.orderId).setSkuDetails(skuDetails).build()
+
                 val billingResult = launchBillingFlow(activity, flowParams)
+                logBillingResult("launchBillingFlow", billingResult)
                 if (billingResult.responseCode != BillingClient.BillingResponseCode.OK) {
                     dismissDialog()
                     disConnection()
+                    ToastUtils.toastInfo(activity, ResUtils.getResString(activity, "yyxx_charge_tv_error"))
                     implCallback.onResult(-1, "启动谷歌收银台失败")
                 }
             } else {
                 dismissDialog()
                 disConnection()
+                ToastUtils.toastInfo(activity, ResUtils.getResString(activity, "yyxx_charge_tv_error"))
                 implCallback.onResult(-1, "启动谷歌收银台失败")
             }
         }
@@ -189,22 +204,24 @@ class ChargeImpl : InAppBilling() {
     /**
      * 通知服务端发货
      */
-    private fun notifyOrder2Backend(activity: Activity, orderId: String, originalJson: String, signature: String, isCache: Boolean = false) {
-        if (!isCache) {
-            // saveOrder2Local()
-        }
-        SdkRequest.instance.notifyOrder(activity, orderId, originalJson, signature, object : IRequestCallback {
+    private fun notifyOrder2Backend(activity: Activity, orderId: String, purchase: Purchase, isCache: Boolean = false) {
+        SdkRequest.instance.notifyOrder(activity, orderId, purchase.originalJson, object : IRequestCallback {
             override fun onResponse(resultInfo: ResultInfo) {
-                try {
+                if (resultInfo.code == 1) {
                     //消耗订单
-                    val jsonObject = JSONObject(originalJson)
-                    if (JsonUtils.hasJsonKey(jsonObject, "purchaseToken")) {
-                        consumeAsync(activity, jsonObject.getString("purchaseToken"), isCache)
-                    }
-                } catch (e: JSONException) {
-                    e.printStackTrace()
+                    consumeAsync(activity, purchase, isCache)
+                } else {
+                    //失败则缓存订单
+                    saveOrderInfo(purchase.orderId, orderId)
                     dismissDialog()
                     disConnection()
+                    val msg = if (TextUtils.isEmpty(resultInfo.msg)) {
+                        ResUtils.getResString(activity, "yyxx_charge_tv_error")
+                    } else {
+                        resultInfo.msg
+                    }
+                    ToastUtils.toastInfo(activity, msg)
+                    implCallback.onResult(-1, "发货失败")
                 }
             }
         })
@@ -215,45 +232,78 @@ class ChargeImpl : InAppBilling() {
      */
     private fun consumeCacheOrder(activity: Activity, purchase: Purchase) {
         //消耗完了再发起支付
-        val cache = ""
-        val orerId = ""
-        val originalJson = purchase.originalJson
-        val purchaseToken = ""
+        Logger.d("消耗缓存订单 : $purchase")
+        var orderId = ""
+        purchase.accountIdentifiers?.apply {
+            orderId = if (!TextUtils.isEmpty(obfuscatedAccountId)) {
+                obfuscatedAccountId!!
+            } else {
+                //TODO getLocalOrderId
+                getOrderInfo(purchase.orderId)
+            }
+        }
+        notifyOrder2Backend(activity, orderId, purchase, true)
+//        consumeAsync(activity, purchase.purchaseToken, true)
 
     }
 
     /**
      * 消耗订单
      */
-    private fun consumeAsync(activity: Activity, purchaseToken: String, isCache: Boolean = false) {
-        val consumeParams = ConsumeParams.newBuilder().setPurchaseToken(purchaseToken).build()
+    private fun consumeAsync(activity: Activity, purchase: Purchase, isCache: Boolean = false) {
+        val consumeParams = ConsumeParams.newBuilder().setPurchaseToken(purchase.purchaseToken).build()
         billingClient?.apply {
             if (isReady) {
-                consumeAsync(consumeParams, object : ConsumeResponseListener {
-                    override fun onConsumeResponse(billingResult: BillingResult, purchaseToken: String) {
-                        dismissDialog()
-                        if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
-                            // saveOrder2Local()
-                            if (isCache) {
-                                querySkuDetails(activity)
-                            } else {
-                                disConnection()
-                                implCallback.onResult(0, "支付成功")
-                            }
+                consumeAsync(consumeParams) { billingResult, _ ->
+                    logBillingResult("onConsumeResponse", billingResult)
+                    dismissDialog()
+                    if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
+                        // saveOrder2Local()
+                        if (isCache) {
+                            querySkuDetails(activity)
                         } else {
                             disConnection()
-                            implCallback.onResult(-1, "消耗订单异常")
+                            implCallback.onResult(0, "支付成功")
                         }
+                        removeOrderInfo(purchase.orderId)
+                    } else {
+                        disConnection()
+                        implCallback.onResult(-1, "消耗订单异常")
+                        ToastUtils.toastInfo(activity, ResUtils.getResString(activity, "yyxx_charge_tv_error"))
+
                     }
-                })
+                }
             } else {
                 dismissDialog()
                 disConnection()
                 implCallback.onResult(-1, "消耗订单异常")
+                ToastUtils.toastInfo(activity, ResUtils.getResString(activity, "yyxx_charge_tv_error"))
             }
         }
     }
 
+    private fun saveOrderInfo(googleOrderId: String, orderId: String) {
+        try {
+            MMKVUtils.instance.orderKV?.encode(googleOrderId, orderId)
+        } catch (e: JSONException) {
+            e.printStackTrace()
+        }
+    }
+
+    private fun getOrderInfo(googleOrderId: String): String {
+        val info = MMKVUtils.instance.orderKV?.decodeString(googleOrderId)
+        Logger.d("getOrderInfo : $info")
+        return if (TextUtils.isEmpty(info)) {
+            ""
+        } else {
+            info!!
+        }
+    }
+
+    private fun removeOrderInfo(googleOrderId: String) {
+        MMKVUtils.instance.orderKV?.removeValueForKey(googleOrderId)
+    }
+
 
     companion object {
         val instance: ChargeImpl by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {

+ 18 - 2
library_core/src/main/java/cn/yyxx/eyuangame/core/impl/iab/InAppBilling.kt

@@ -1,8 +1,10 @@
 package cn.yyxx.eyuangame.core.impl.iab
 
 import android.app.Activity
+import android.content.Context
 import cn.yyxx.eyuangame.base.utils.Logger
 import cn.yyxx.eyuangame.core.impl.SdkBridgeImpl
+import cn.yyxx.eyuangame.core.ui.dialog.ScaleLoadingDialog
 import com.android.billingclient.api.BillingClient
 import com.android.billingclient.api.BillingClientStateListener
 import com.android.billingclient.api.BillingResult
@@ -17,6 +19,7 @@ import com.google.android.gms.common.GoogleApiAvailability
 abstract class InAppBilling {
 
     protected var billingClient: BillingClient? = null
+    private var loadingDialog: ScaleLoadingDialog? = null
 
     protected fun checkGoogleApiAvailability(activity: Activity): Boolean {
         return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(activity) == ConnectionResult.SUCCESS
@@ -102,9 +105,22 @@ abstract class InAppBilling {
         Logger.d("$callbackFuncName , code : $code , msg : $msg")
     }
 
-    protected fun showDialog() {}
+    protected fun showDialog(context: Context) {
+        loadingDialog?.apply {
+            dismiss()
+            loadingDialog = null
+        }
+
+        loadingDialog = ScaleLoadingDialog(context, "")
+        loadingDialog?.show()
+    }
 
-    protected fun dismissDialog() {}
+    protected fun dismissDialog() {
+        loadingDialog?.apply {
+            dismiss()
+            loadingDialog = null
+        }
+    }
 
     /**
      * charge

+ 0 - 1
library_core/src/main/java/cn/yyxx/eyuangame/core/impl/login/LoginActivity.kt

@@ -93,7 +93,6 @@ class LoginActivity : FragmentActivity(), View.OnClickListener {
             }
 
             override fun onFailed(result: String) {
-                //TODO 失败情况需要测试
                 if (showAutoLoginDialog) {
                     showAutoLoginDialog = false
                     showChooseDialog = true

+ 2 - 2
library_core/src/main/java/cn/yyxx/eyuangame/core/impl/login/fragment/LauncherFragment.kt

@@ -297,7 +297,7 @@ class LauncherFragment : Fragment(), View.OnClickListener {
             dismiss()
             forgetPwdDialog = null
         }
-        forgetPwdDialog = ForgetPwdDialog(requireContext(), SdkBridgeImpl.isLand, mutableListOf())
+        forgetPwdDialog = ForgetPwdDialog(requireContext(), SdkBridgeImpl.isLand, SdkBridgeImpl.initBean.areaCodeList)
         forgetPwdDialog?.apply {
             loginImpl.hideLoginView()
             ivReturn.setOnClickListener {
@@ -359,7 +359,7 @@ class LauncherFragment : Fragment(), View.OnClickListener {
                 return
             }
 
-            if (TextUtils.isEmpty(areaCode)) {
+            if (TextUtils.isEmpty(areaCode) || areaCode == ResUtils.getResString(requireActivity(), "yyxx_tv_area_code")) {
                 ToastUtils.toastInfo(requireActivity(), ResUtils.getResString(requireActivity(), "yyxx_tips_area_code_format_error"))
                 return
             }

+ 25 - 1
library_core/src/main/java/cn/yyxx/eyuangame/core/linking/Linking.kt

@@ -3,21 +3,24 @@ package cn.yyxx.eyuangame.core.linking
 import android.content.Context
 import cn.yyxx.eyuangame.core.internal.IEventObserver
 import cn.yyxx.eyuangame.core.linking.channel.LinkingAdjustImpl
+import cn.yyxx.eyuangame.core.linking.channel.LinkingFacebookImpl
 import cn.yyxx.eyuangame.core.linking.channel.LinkingFirebaseImpl
 
 /**
  * @author #Suyghur.
  * Created on 2021/06/17
  */
-class Linking {
+class Linking private constructor() {
 
     private val observers: MutableList<IEventObserver> = mutableListOf()
 
     fun attach(context: Context) {
         observers.add(LinkingAdjustImpl())
         observers.add(LinkingFirebaseImpl())
+        observers.add(LinkingFacebookImpl())
     }
 
+
     fun detach() {
         if (!observers.isNullOrEmpty()) {
             observers.clear()
@@ -25,6 +28,27 @@ class Linking {
     }
 
 
+    fun login() {
+
+    }
+
+    fun register() {
+
+    }
+
+    fun charge() {
+
+    }
+
+    fun roleCreate() {
+
+    }
+
+    fun roleLauncher(){
+
+    }
+
+
     companion object {
         val instance: Linking by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
             Linking()

+ 22 - 0
library_core/src/main/java/cn/yyxx/eyuangame/core/linking/channel/LinkingFacebookImpl.kt

@@ -0,0 +1,22 @@
+package cn.yyxx.eyuangame.core.linking.channel
+
+import android.content.Context
+import cn.yyxx.eyuangame.core.internal.IEventObserver
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/07/06
+ */
+class LinkingFacebookImpl : IEventObserver {
+    override fun onInitialize(context: Context) {
+    }
+
+    override fun onLogin(context: Context) {
+    }
+
+    override fun onRegister(context: Context) {
+    }
+
+    override fun onBillingFinish(context: Context) {
+    }
+}

+ 4 - 4
library_core/src/main/java/cn/yyxx/eyuangame/core/network/Host.kt

@@ -23,13 +23,13 @@ object Host {
     const val BASIC_ROUTE_LOGIN = "member_login"
     const val BASIC_ROUTE_THIRD_PART_LOGIN = "third_plat_login"
     const val BASIC_ROUTE_REGISTER = "member_register"
-    const val BASIC_ROUTE_BIND_ACCOUNT = "bind_member"
+    const val BASIC_ROUTE_BIND_ACCOUNT = "bind_member_user"
     const val BASIC_ROUTE_BIND_PHONE = "bind_phone"
     const val BASIC_ROUTE_GET_CAPTCHA = "phone_captcha"
-    const val BASIC_ROUTE_FORGET_PWD = "forget_pwd"
+    const val BASIC_ROUTE_FORGET_PWD = "forgot_pwd"
     const val BASIC_ROUTE_MODIFY_PWD = "modify_pwd"
-    const val BASIC_ROUTE_CREATE_ORDER = ""
-    const val BASIC_ROUTE_NOTIFY_ORDER = ""
+    const val BASIC_ROUTE_CREATE_ORDER = "iap_init"
+    const val BASIC_ROUTE_NOTIFY_ORDER = "iap_notify"
     const val BASIC_ROUTE_NOTIFY_REWARD = ""
     const val BASIC_ROUTE_SUBMIT_ROLE_INFO = ""
 

+ 13 - 40
library_core/src/main/java/cn/yyxx/eyuangame/core/network/SdkRequest.kt

@@ -1,18 +1,11 @@
 package cn.yyxx.eyuangame.core.network
 
 import android.content.Context
-import android.text.TextUtils
-import cn.yyxx.eyuangame.Version
 import cn.yyxx.eyuangame.base.entity.SdkChargeInfo
 import cn.yyxx.eyuangame.base.entity.SdkRoleInfo
-import cn.yyxx.eyuangame.base.utils.ParamsUtils
 import cn.yyxx.eyuangame.core.entity.LoginType
 import cn.yyxx.eyuangame.core.entity.SdkBackLoginInfo
 import cn.yyxx.eyuangame.core.internal.IRequestCallback
-import cn.yyxx.support.AppUtils
-import cn.yyxx.support.DensityUtils
-import cn.yyxx.support.device.DeviceInfoUtils
-import cn.yyxx.support.gaid.GAIDUtils
 import org.json.JSONException
 import org.json.JSONObject
 
@@ -109,6 +102,7 @@ class SdkRequest {
             jsonObject.put("role_id", chargeInfo.roleId)
             jsonObject.put("role_name", chargeInfo.roleName)
             jsonObject.put("role_level", chargeInfo.roleLevel)
+            jsonObject.put("role_ctime", chargeInfo.roleCTime)
             jsonObject.put("server_id", chargeInfo.serverId)
             jsonObject.put("server_name", chargeInfo.serverName)
             jsonObject.put("amount", chargeInfo.amount)
@@ -116,7 +110,9 @@ class SdkRequest {
             jsonObject.put("product_name", chargeInfo.productName)
             jsonObject.put("product_desc", chargeInfo.productDesc)
             jsonObject.put("cp_order_id", chargeInfo.cpOrderId)
-            jsonObject.put("cp_callback_info", chargeInfo.cpCallbackInfo)
+            jsonObject.put("cp_ext", chargeInfo.cpExt)
+            jsonObject.put("cp_pay_time", chargeInfo.cpPayTime)
+            jsonObject.put("cp_pay_sign", chargeInfo.cpPaySign)
             jsonObject.put("route_path", Host.BASIC_ROUTE_CREATE_ORDER)
         } catch (e: JSONException) {
             e.printStackTrace()
@@ -125,44 +121,21 @@ class SdkRequest {
     }
 
 
-    fun notifyOrder(context: Context, orderId: String, originalJson: String, signature: String, callback: IRequestCallback) {
-
-    }
-
-    fun submitRoleData(context: Context, roleInfo: SdkRoleInfo, callback: IRequestCallback) {
-
-    }
-
-    private fun getCommon(context: Context): JSONObject {
-        val common = JSONObject()
+    fun notifyOrder(context: Context, orderId: String, originalJson: String, callback: IRequestCallback) {
+        val jsonObject = JSONObject()
         try {
-            common.put("gcp_code", ParamsUtils.getGcpCode(context))
-            common.put("game_code", ParamsUtils.getGameCode(context))
-            common.put("package_name", context.packageName)
-            common.put("server_version", Version.SERVER_VERSION)
-            common.put("client_version", Version.VERSION_NAME)
-            common.put("game_version", AppUtils.getVersionName(context))
-            common.put("screen", DensityUtils.getResolution(context))
-            common.put("simulator", DeviceInfoUtils.isEmulator(context))
-            if (TextUtils.isEmpty(GAIDUtils.getGoogleAdid())) {
-                common.put("device_id", DeviceInfoUtils.getAndroidDeviceId(context))
-                common.put("id_type", 1)
-            } else {
-                common.put("device_id", GAIDUtils.getGoogleAdid())
-                common.put("id_type", 0)
-            }
-            common.put("network", DeviceInfoUtils.getNetworkType(context))
-            common.put("os", "android")
-            common.put("os_version", DeviceInfoUtils.getDeviceSoftwareVersion())
-            common.put("mobile_model", DeviceInfoUtils.getDeviceModel())
-            common.put("mobile_mfrs", DeviceInfoUtils.getDeviceManufacturer())
-            common.put("mobile_brand", DeviceInfoUtils.getDeviceBrand())
+            jsonObject.put("route_path", Host.BASIC_ROUTE_NOTIFY_ORDER)
+            jsonObject.put("order_id", orderId)
+            jsonObject.put("iap_notify_data", originalJson)
         } catch (e: JSONException) {
             e.printStackTrace()
         }
-        return common
+        VolleyRequest.post(context, jsonObject, callback)
     }
 
+    fun submitRoleData(context: Context, timing: Int, roleInfo: SdkRoleInfo, callback: IRequestCallback) {
+
+    }
 
     companion object {
         val instance: SdkRequest by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {

+ 5 - 2
library_core/src/main/java/cn/yyxx/eyuangame/core/network/VolleyRequest.kt

@@ -1,6 +1,7 @@
 package cn.yyxx.eyuangame.core.network
 
 import android.content.Context
+import android.text.TextUtils
 import cn.yyxx.eyuangame.base.utils.Logger
 import cn.yyxx.eyuangame.core.entity.ResultInfo
 import cn.yyxx.eyuangame.core.impl.SdkDrive
@@ -131,10 +132,12 @@ object VolleyRequest {
     private fun getErrorResultInfo(volleyError: VolleyError): ResultInfo {
         val resultInfo = ResultInfo()
         resultInfo.code = 400
-        resultInfo.msg = "网络异常"
+        resultInfo.msg = ""
         volleyError.networkResponse?.apply {
             resultInfo.code = statusCode
-            resultInfo.msg = volleyError.message.toString()
+            if (!TextUtils.isEmpty(volleyError.message)) {
+                resultInfo.msg = volleyError.message!!
+            }
         }
 
         resultInfo.data = ""

+ 20 - 10
library_core/src/main/java/cn/yyxx/eyuangame/core/ui/dialog/ForgetPwdDialog.kt

@@ -6,6 +6,7 @@ import android.graphics.Color
 import android.graphics.drawable.ColorDrawable
 import android.view.*
 import android.widget.*
+import cn.yyxx.eyuangame.core.impl.SdkBridgeImpl
 import cn.yyxx.eyuangame.core.ui.EventEditText
 import cn.yyxx.support.DensityUtils
 import cn.yyxx.support.ResUtils
@@ -14,7 +15,8 @@ import cn.yyxx.support.ResUtils
  * @author #Suyghur.
  * Created on 2021/06/23
  */
-class ForgetPwdDialog(context: Context, private val isLandscape: Boolean, private val areaList: MutableList<String>) : Dialog(context) {
+class ForgetPwdDialog(context: Context, private val isLandscape: Boolean, private val areaCodeList: MutableList<String>) :
+    Dialog(context, ResUtils.getResId(context, "EYuanGameTheme", "style")) {
 
     lateinit var ivReturn: ImageView
     lateinit var eetAccount: EventEditText
@@ -44,9 +46,15 @@ class ForgetPwdDialog(context: Context, private val isLandscape: Boolean, privat
 
     private fun initView(context: Context) {
 
+//        if (SdkBridgeImpl.isLand) {
+//            window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
+//        }
+
         val view: View = LayoutInflater.from(context).inflate(ResUtils.getResId(context, "yyxx_forget_pwd_dialog", "layout"), null)
+
         setContentView(view)
 
+
         val attr = window?.attributes as WindowManager.LayoutParams
         //设置dialog 在布局中的位置
         attr.height = ViewGroup.LayoutParams.WRAP_CONTENT
@@ -58,6 +66,8 @@ class ForgetPwdDialog(context: Context, private val isLandscape: Boolean, privat
         }
         attr.gravity = Gravity.CENTER
 
+//        attr.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN or WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE
+
         imgUp = ResUtils.getResId(context, "yyxx_pack_up_white_img", "drawable")
         imgDown = ResUtils.getResId(context, "yyxx_pack_down_white_img", "drawable")
 
@@ -90,15 +100,15 @@ class ForgetPwdDialog(context: Context, private val isLandscape: Boolean, privat
     }
 
     private fun autoFillAreaList(context: Context) {
-        if (areaList.size == 0) {
+        if (areaCodeList.size == 0) {
             //默认4个地区
-            areaList.add("86")
+            areaCodeList.add("86")
             //香港
-            areaList.add("852")
+            areaCodeList.add("852")
             //澳门
-            areaList.add("853")
+            areaCodeList.add("853")
             //台湾
-            areaList.add("886")
+            areaCodeList.add("886")
         }
         initAreaList(context)
     }
@@ -116,7 +126,7 @@ class ForgetPwdDialog(context: Context, private val isLandscape: Boolean, privat
         }
         //ScrollView高度
         var maxHeight = 0
-        areaList.apply {
+        areaCodeList.apply {
             maxHeight = if (size < 2) {
                 size * height
             } else {
@@ -124,7 +134,7 @@ class ForgetPwdDialog(context: Context, private val isLandscape: Boolean, privat
             }
         }
         //循环添加列
-        areaList.apply {
+        areaCodeList.apply {
             for (i in indices) {
                 val areaCode = this[i]
                 //添加线
@@ -142,7 +152,6 @@ class ForgetPwdDialog(context: Context, private val isLandscape: Boolean, privat
                     val tvAreaCode = findViewById<TextView>(ResUtils.getResId(context, "yyxx_tv_area", "id"))
                     tvAreaCode.gravity = Gravity.CENTER
                     tvAreaCode.text = areaCode
-                    code = areaCode
                     setOnClickListener(OnItemClick(areaCode))
                     layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, height)
                     llAreaList.addView(this, llAreaList.childCount)
@@ -165,7 +174,7 @@ class ForgetPwdDialog(context: Context, private val isLandscape: Boolean, privat
 
     override fun dismiss() {
         super.dismiss()
-        areaList.clear()
+        areaCodeList.clear()
         rlAreaList.visibility = View.GONE
     }
 
@@ -177,6 +186,7 @@ class ForgetPwdDialog(context: Context, private val isLandscape: Boolean, privat
             tvArea.apply {
                 changeAreaList()
                 tvArea.text = areaCode
+                code = areaCode
             }
         }
     }

+ 33 - 22
library_core/src/main/java/cn/yyxx/eyuangame/core/ui/floatview/FloatingBall.kt

@@ -47,6 +47,9 @@ class FloatingBall(val activity: Activity, private val isLandscape: Boolean, pri
     //是否展开
     private var hasShowContent = false
 
+    //当前贴边状态
+    private var isHide = false
+
     //默认吸附在左边
     private var isLeftLocation = true
 
@@ -62,7 +65,12 @@ class FloatingBall(val activity: Activity, private val isLandscape: Boolean, pri
     private val timerHandler = object : Handler(Looper.getMainLooper()) {
         override fun handleMessage(msg: Message) {
             when (msg.what) {
-                1000 -> Logger.d("logo折半")
+                1000 -> {
+                    invokeBallFullOrHalt(true)
+                    callback.onUpdateBallView(ballView, isLeftLocation, true)
+                    //把worker取消掉防止一直在执行
+                    displayWorker?.cancel()
+                }
             }
         }
     }
@@ -96,7 +104,7 @@ class FloatingBall(val activity: Activity, private val isLandscape: Boolean, pri
 
     private fun createView() {
         rootLinearLayout = LinearLayout(activity)
-        rootLinearLayout.layoutParams = ViewGroup.LayoutParams(DensityUtils.dip2px(activity, 45f), DensityUtils.dip2px(activity, 50f))
+        rootLinearLayout.layoutParams = ViewGroup.LayoutParams(DensityUtils.dip2px(activity, 45f), DensityUtils.dip2px(activity, 45f))
 
         frameLayout = FrameLayout(activity)
         frameLayout.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)
@@ -108,9 +116,6 @@ class FloatingBall(val activity: Activity, private val isLandscape: Boolean, pri
             scaleType = ImageView.ScaleType.FIT_XY
             //TODO onClickListener ?
             setOnTouchListener(this@FloatingBall)
-//            ballView.setOnClickListener {
-//                invokeMenuShowOrDismiss()
-//            }
             frameLayout.addView(this)
         }
 
@@ -155,6 +160,22 @@ class FloatingBall(val activity: Activity, private val isLandscape: Boolean, pri
         callback.onUpdateBallView(ballView, isLeftLocation, false)
     }
 
+    private fun invokeBallFullOrHalt(isHalf: Boolean) {
+        if (hasShowContent && !isHide) {
+            return
+        }
+        this.isHide = isHalf
+        if (isHalf) {
+            rootLinearLayout.layoutParams = LayoutParams(DensityUtils.dip2px(activity, 22.5f), DensityUtils.dip2px(activity, 45f))
+            layoutParams = LayoutParams(DensityUtils.dip2px(activity, 22.5f), DensityUtils.dip2px(activity, 45f))
+            frameLayout.updateViewLayout(ballView, layoutParams)
+        } else {
+            rootLinearLayout.layoutParams = LayoutParams(DensityUtils.dip2px(activity, 45f), DensityUtils.dip2px(activity, 45f))
+            layoutParams = LayoutParams(DensityUtils.dip2px(activity, 45f), DensityUtils.dip2px(activity, 45f))
+            frameLayout.updateViewLayout(ballView, layoutParams)
+        }
+    }
+
     private fun invokeMenuShowOrDismiss() {
         if (hasShowContent) {
             hasShowContent = false
@@ -184,7 +205,7 @@ class FloatingBall(val activity: Activity, private val isLandscape: Boolean, pri
     private fun invokeDisplayTimerWork() {
         displayWorker?.invokeAtFixedRate({
             timerHandler.sendEmptyMessage(1000)
-        }, 30, 30, TimeUnit.SECONDS)
+        }, 10, 10, TimeUnit.SECONDS)
     }
 
 
@@ -195,33 +216,21 @@ class FloatingBall(val activity: Activity, private val isLandscape: Boolean, pri
             frameLayout.visibility = View.VISIBLE
             rootLinearLayout.visibility = View.VISIBLE
             visibility = View.VISIBLE
-//            invalidate()
-//            requestLayout()
-//            wm.updateViewLayout(this, wlp)
         }
     }
 
     fun detach() {
         if (visibility == View.VISIBLE) {
             if (hasShowContent) {
-//                dismissMenu()
                 hasShowContent = false
                 menu.dismiss()
             }
 
             displayWorker?.cancel()
-//            ballView.clearAnimation()
-//            frameLayout.clearAnimation()
-//            rootLinearLayout.clearAnimation()
-//            clearAnimation()
-
             ballView.visibility = View.GONE
             frameLayout.visibility = View.GONE
             rootLinearLayout.visibility = View.GONE
             visibility = View.GONE
-//            invalidate()
-//            requestLayout()
-//            wm.updateViewLayout(this, wlp)
         }
     }
 
@@ -284,6 +293,7 @@ class FloatingBall(val activity: Activity, private val isLandscape: Boolean, pri
         return false
     }
 
+
     override fun onTouch(v: View, event: MotionEvent): Boolean {
         displayWorker?.cancel()
         //获取相对屏幕的坐标
@@ -304,6 +314,7 @@ class FloatingBall(val activity: Activity, private val isLandscape: Boolean, pri
                 if (abs(mTouchStartX - moveStartX) > 3 && abs(mTouchStartY - moveStartY) > 3) {
                     wlp.x = (x - mTouchStartX).toInt()
                     wlp.y = (y - mTouchStartY).toInt()
+                    //移动时收起菜单
                     wm.updateViewLayout(this, wlp)
                     isMove = true
                     if (menu.isShowing) {
@@ -324,16 +335,16 @@ class FloatingBall(val activity: Activity, private val isLandscape: Boolean, pri
                     wlp.x = DensityUtils.getHeigthAndWidth(activity)[0]
                     isLeftLocation = false
                 }
-
                 wm.updateViewLayout(this, wlp)
 
-                invokeMenuShowOrDismiss()
-
                 if (isMove) {
                     invokeDisplayTimerWork()
                 } else {
-                    callback.onUpdateBallView(ballView, isLeftLocation, false)
+                    invokeMenuShowOrDismiss()
                 }
+                //还原贴边的悬浮球
+                invokeBallFullOrHalt(false)
+                callback.onUpdateBallView(ballView, isLeftLocation, false)
             }
         }
 

+ 6 - 5
library_core/src/main/java/cn/yyxx/eyuangame/core/utils/MMKVUtils.kt

@@ -1,7 +1,6 @@
 package cn.yyxx.eyuangame.core.utils
 
 import android.content.Context
-import androidx.annotation.Keep
 import cn.yyxx.eyuangame.base.utils.Logger
 import com.tencent.mmkv.MMKV
 import com.tencent.mmkv.MMKVHandler
@@ -16,13 +15,15 @@ import java.io.File
  */
 class MMKVUtils private constructor() : MMKVHandler {
 
-    var mmkv: MMKV? = null
+    var userKV: MMKV? = null
+    var orderKV: MMKV? = null
 
     fun init(context: Context) {
-        val dir = context.getExternalFilesDir("")!!.absolutePath + File.separator + "/user_info"
+        val dir = context.getExternalFilesDir("")!!.absolutePath + File.separator + "/sdk_info"
         MMKV.initialize(context, dir, MMKVLogLevel.LevelInfo)
         MMKV.registerHandler(this)
-        mmkv = MMKV.defaultMMKV()
+        userKV = MMKV.mmkvWithID("user_info")
+        orderKV = MMKV.mmkvWithID("order_info")
     }
 
     override fun onMMKVCRCCheckFail(mmapID: String?): MMKVRecoverStrategic {
@@ -44,7 +45,7 @@ class MMKVUtils private constructor() : MMKVHandler {
     }
 
     companion object {
-        val instance:MMKVUtils by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED){
+        val instance: MMKVUtils by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
             MMKVUtils()
         }
     }

+ 3 - 5
library_core/src/main/java/cn/yyxx/eyuangame/core/utils/SessionUtils.kt

@@ -2,8 +2,6 @@ package cn.yyxx.eyuangame.core.utils
 
 import android.content.Context
 import android.text.TextUtils
-import androidx.annotation.Keep
-import cn.yyxx.eyuangame.base.EYuanGame
 import cn.yyxx.eyuangame.base.utils.Logger
 import cn.yyxx.eyuangame.core.entity.LoginType
 import cn.yyxx.eyuangame.core.entity.Session
@@ -59,7 +57,7 @@ class SessionUtils private constructor() {
                 HostModelUtils.ENV_TEST -> "test"
                 else -> "online"
             }
-            MMKVUtils.instance.mmkv?.encode(keyName, jsonObject.toString())
+            MMKVUtils.instance.userKV?.encode(keyName, jsonObject.toString())
 //            FileUtils.writeFile(jsonObject.toString(), filePath)
         }
     }
@@ -104,7 +102,7 @@ class SessionUtils private constructor() {
             HostModelUtils.ENV_TEST -> "test"
             else -> "online"
         }
-        val json = MMKVUtils.instance.mmkv?.decodeString(keyName)
+        val json = MMKVUtils.instance.userKV?.decodeString(keyName)
 //        val json = FileUtils.readFile(FileUtils.getUserInfoFilePath(context))
         return if (TextUtils.isEmpty(json)) {
             mutableListOf()
@@ -153,7 +151,7 @@ class SessionUtils private constructor() {
             HostModelUtils.ENV_TEST -> "test"
             else -> "online"
         }
-        MMKVUtils.instance.mmkv?.encode(keyName, jsonObject.toString())
+        MMKVUtils.instance.userKV?.encode(keyName, jsonObject.toString())
 //        FileUtils.writeFile(jsonObject.toString(), filePath)
     }
 

BIN
library_core/src/main/jniLibs/arm64-v8a/libdolin-zap.so


BIN
library_core/src/main/jniLibs/arm64-v8a/libmmkv.so


BIN
library_core/src/main/jniLibs/armeabi-v7a/libdolin-zap.so


BIN
library_core/src/main/jniLibs/armeabi-v7a/libmmkv.so


BIN
library_core/src/main/jniLibs/x86/libdolin-zap.so


BIN
library_core/src/main/jniLibs/x86/libmmkv.so


BIN
library_core/src/main/jniLibs/x86_64/libdolin-zap.so


BIN
library_core/src/main/jniLibs/x86_64/libmmkv.so


BIN
library_core/src/main/res/drawable-xhdpi/yyxx_back_img.png


BIN
library_core/src/main/res/drawable-xhdpi/yyxx_float_logo_left_img.png


BIN
library_core/src/main/res/drawable-xhdpi/yyxx_float_logo_right_img.png


+ 9 - 0
library_core/src/main/res/drawable/yyxx_green_blue_panel_title.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <corners
+        android:topLeftRadius="8dp"
+        android:topRightRadius="8dp" />
+    <solid android:color="@color/yyxx_color_green_blue" />
+</shape>
+
+

+ 9 - 0
library_core/src/main/res/drawable/yyxx_white_panel_content_bg.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <corners
+        android:bottomLeftRadius="8dp"
+        android:bottomRightRadius="8dp" />
+    <solid android:color="@color/yyxx_color_white_90" />
+</shape>
+
+

+ 75 - 0
library_core/src/main/res/layout-land/yyxx_hybrid.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_gravity="center">
+
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="50dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/yyxx_title_container"
+            android:layout_width="match_parent"
+            android:layout_height="30dp"
+            android:background="@drawable/yyxx_green_blue_panel_title"
+            app:layout_constraintBottom_toTopOf="@id/yyxx_content_container"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent">
+
+            <ImageView
+                android:id="@+id/yyxx_iv_return"
+                android:layout_width="20dp"
+                android:layout_height="20dp"
+                android:layout_marginStart="10dp"
+                android:background="@drawable/yyxx_back_img"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:id="@+id/yyxx_tv_title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/yyxx_color_white"
+                android:textSize="18sp"
+                android:textStyle="bold"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/yyxx_content_container"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/yyxx_white_panel_content_bg"
+            android:padding="10dp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@id/yyxx_title_container">
+
+            <FrameLayout
+                android:id="@+id/yyxx_webview_container"
+                android:layout_width="match_parent"
+                android:layout_height="260dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 75 - 0
library_core/src/main/res/layout/yyxx_hybrid.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:layout_gravity="center">
+
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="20dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/yyxx_title_container"
+            android:layout_width="match_parent"
+            android:layout_height="30dp"
+            android:background="@drawable/yyxx_green_blue_panel_title"
+            app:layout_constraintBottom_toTopOf="@id/yyxx_content_container"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent">
+
+            <ImageView
+                android:id="@+id/yyxx_iv_return"
+                android:layout_width="20dp"
+                android:layout_height="20dp"
+                android:layout_marginStart="10dp"
+                android:background="@drawable/yyxx_back_img"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:id="@+id/yyxx_tv_title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/yyxx_color_white"
+                android:textSize="18sp"
+                android:textStyle="bold"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/yyxx_content_container"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/yyxx_white_panel_content_bg"
+            android:padding="10dp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@id/yyxx_title_container">
+
+            <FrameLayout
+                android:id="@+id/yyxx_webview_container"
+                android:layout_width="match_parent"
+                android:layout_height="320dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 2 - 0
library_core/src/main/res/layout/yyxx_login_launcher.xml

@@ -38,6 +38,7 @@
         android:textColor="@color/yyxx_color_green_blue"
         android:textSize="12sp"
         android:textStyle="bold"
+        app:layout_constraintBottom_toTopOf="@id/yyxx_btn_launcher"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintTop_toBottomOf="@id/yyxx_eet_pwd" />
 
@@ -51,6 +52,7 @@
         android:text="@string/yyxx_tv_launcher"
         android:textColor="@color/yyxx_color_white"
         android:textSize="16sp"
+        app:layout_constraintBottom_toTopOf="@id/yyxx_cl_agreement"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/yyxx_tv_forget" />

+ 1 - 0
library_core/src/main/res/layout/yyxx_login_register.xml

@@ -39,6 +39,7 @@
         android:text="@string/yyxx_tv_register"
         android:textColor="@color/yyxx_color_white"
         android:textSize="16sp"
+        app:layout_constraintBottom_toTopOf="@id/yyxx_cl_agreement"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/yyxx_eet_pwd" />

+ 7 - 1
library_core/src/main/res/values/yyxx_strings.xml

@@ -66,5 +66,11 @@
     <string name="yyxx_tips_new_pwd_format_error">您輸入的新密碼格式有誤,請重新輸入</string>
     <string name="yyxx_tips_phone_format_error">您輸入的手機門號格式有誤,請重新輸入</string>
     <string name="yyxx_tips_area_code_format_error">您選擇的區號有誤,請重新選擇</string>
-<string name="yyxx_tips_captcha_format_error">您輸入的手機驗證碼格式有誤,請重新輸入</string>
+    <string name="yyxx_tips_captcha_format_error">您輸入的手機驗證碼格式有誤,請重新輸入</string>
+
+    <string name="yyxx_charge_tv_error">支付服務異常,請稍後重試</string>
+    <string name="yyxx_charge_loading_tips">正在獲取訂單信息,請稍候…</string>
+
+    <string name="facebook_app_id" translatable="false"></string>
+    <string name="fb_login_protocol_scheme" translatable="false"></string>
 </resources>

+ 10 - 1
library_core/src/main/res/values/yyxx_styles.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 
-    <style name="ColumbusTheme" parent="Theme.AppCompat.NoActionBar">
+    <style name="EYuanGameTheme" parent="Theme.AppCompat.NoActionBar">
         <item name="android:windowBackground">@color/yyxx_transparent</item>
         <item name="background">@color/yyxx_transparent</item>
         <item name="android:windowIsTranslucent">true</item>
@@ -13,4 +13,13 @@
         <item name="android:windowContentOverlay">@null</item>
         <item name="android:backgroundDimEnabled">false</item>
     </style>
+
+<!--    <style name="EYuanGameThemeDialog" parent="@style/Theme.AppCompat.Light.Dialog">-->
+<!--        <item name="android:background">@color/yyxx_transparent</item>-->
+<!--        <item name="android:windowFrame">@null</item>-->
+<!--        <item name="android:windowIsFloating">true</item>-->
+<!--        <item name="windowNoTitle">true</item>-->
+<!--        <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>-->
+<!--        <item name="android:windowContentOverlay">@null</item>-->
+<!--    </style>-->
 </resources>

+ 33 - 0
shell/decompress_log.py

@@ -0,0 +1,33 @@
+import zlib
+import os
+import sys
+
+
+def decompress_py2(args):
+    decompressor = zlib.decompressobj(-zlib.MAX_WBITS)
+    src = args[0]
+    dst = src[:len(src) - 4] + "-decompress.zap"
+    _buffer = []
+    with open(src, "rb") as src_fp:
+        _buffer = bytearray(os.path.getsize(src))
+        src_fp.readinto(_buffer)
+    with open(dst, "w+") as dst_fp:
+        tmp = decompressor.decompress(str(_buffer))
+        dst_fp.write(tmp)
+
+
+def decompress_py3(args):
+    decompressor = zlib.decompressobj(-zlib.MAX_WBITS)
+    src = args[0]
+    dst = src[:len(src) - 4] + "-decompress.zap"
+    with open(src, "rb") as src_fp:
+        _buffer = src_fp.read()
+    with open(dst, "w+") as dst_fp:
+        tmp = decompressor.decompress(_buffer)
+        dst_fp.write(bytes.decode(tmp))
+
+
+if __name__ == "__main__":
+    decompress_py3(sys.argv[1:])
+    # py2用下面的方法
+    # decompress_py2(sys.argv[1:])