Pārlūkot izejas kodu

v1.0.1开发:支付上报增加order_id

#Suyghur 3 gadi atpakaļ
vecāks
revīzija
e1bef4d087

+ 4 - 20
build.gradle

@@ -1,27 +1,11 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
+apply from: 'config.gradle'
 buildscript {
-
     ext {
-        // demo远程依赖
-        REMOTE_LIBRARY = false
-        // 发布开关
-        PUBLISH_ENABLE = true
-        // 混淆开关
-        MINIFY_ENABLE = true
-        // ndk版本
-        NDK_VERSION = '21.4.7075529'
-        // kotlin版本
-        KOTLIN_VERSION = '1.4.20'
-        // compileSdkVersion
-        COMPILE_SDK_VERSION = 31
-        // buildToolsVersion
-        BUILD_TOOLS_VERSION = '30.0.3'
-        // minSdkVersion
-        MIN_SDK_VERSION = 16
-        // targetSdkVersion
-        TARGET_SDK_VERSION = 31
+        kotlin_version = '1.5.30'
     }
 
+
     repositories {
         google()
         mavenCentral()
@@ -29,7 +13,7 @@ buildscript {
     }
     dependencies {
         classpath 'com.android.tools.build:gradle:4.1.3'
-        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
 

+ 8 - 11
demo/build.gradle

@@ -8,15 +8,15 @@ def keystoreProperties = new Properties()
 keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
 
 android {
-    compileSdkVersion COMPILE_SDK_VERSION
-    buildToolsVersion BUILD_TOOLS_VERSION
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
 
     defaultConfig {
         applicationId 'com.shzd.eyuangame'
-        minSdkVersion MIN_SDK_VERSION
-        targetSdkVersion TARGET_SDK_VERSION
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
         versionCode 1
-        versionName "1.0"
+        versionName "0.0.1"
 
         multiDexEnabled true
 
@@ -72,15 +72,12 @@ android {
 }
 
 dependencies {
-    if (PUBLISH_ENABLE) {
-        if (REMOTE_LIBRARY) {
-            implementation 'io.github.yyxxgame.sdk:eyuangame-sdk-ktx:1.0.0-alpha10'
+    if (rootProject.ext.module.publish) {
+        if (rootProject.ext.module.remoteLib) {
+            implementation 'io.github.yyxxgame.sdk:eyuangame-sdk-ktx:1.0.0'
         } else {
             api(name: 'library_core-release', ext: 'aar')
 
-            implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"
-            implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'
-
             //mmkv
             implementation 'com.tencent:mmkv-static:1.2.10'
 

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

@@ -25,7 +25,7 @@ import kotlin.system.exitProcess
  */
 class DemoActivity : Activity(), View.OnClickListener {
 
-    private val events = arrayListOf(
+    private val events = mutableListOf(
         Item(0, "00 接口环境切换"),
         Item(1, "01 登录"),
         Item(2, "02 切换账号"),

+ 6 - 7
library_base/build.gradle

@@ -4,13 +4,12 @@ plugins {
 }
 
 android {
-
-    compileSdkVersion COMPILE_SDK_VERSION
-    buildToolsVersion BUILD_TOOLS_VERSION
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
 
     defaultConfig {
-        minSdkVersion MIN_SDK_VERSION
-        targetSdkVersion TARGET_SDK_VERSION
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
 
         ndk {
             // 设置支持的SO库架构
@@ -21,7 +20,7 @@ android {
 
     buildTypes {
         release {
-            minifyEnabled MINIFY_ENABLE
+            minifyEnabled rootProject.ext.module.minifyEnabled
             proguardFiles 'proguard-rules.pro'
         }
     }
@@ -51,7 +50,7 @@ android {
 
 dependencies {
     api files('../libs/yyxx_support_1.0.1.jar')
-    implementation 'androidx.core:core-ktx:1.6.0'
+    implementation 'androidx.core:core-ktx:1.7.0'
     implementation 'io.github.suyghur.dolin:zap:1.0.0'
 }
 

+ 12 - 17
library_core/build.gradle

@@ -4,13 +4,12 @@ plugins {
 }
 
 android {
-
-    compileSdkVersion COMPILE_SDK_VERSION
-    buildToolsVersion BUILD_TOOLS_VERSION
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+    buildToolsVersion rootProject.ext.android.buildToolsVersion
 
     defaultConfig {
-        minSdkVersion MIN_SDK_VERSION
-        targetSdkVersion TARGET_SDK_VERSION
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
 
         externalNativeBuild {
             cmake {
@@ -28,7 +27,7 @@ android {
 
     buildTypes {
         release {
-            minifyEnabled MINIFY_ENABLE
+            minifyEnabled rootProject.ext.module.minifyEnabled
             proguardFiles 'proguard-rules.pro'
         }
     }
@@ -61,22 +60,18 @@ android {
         }
     }
 
-    ndkVersion NDK_VERSION
 }
 
 dependencies {
-    implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"
-    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'
-
     //mmkv
     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.6'
-    implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
+    implementation 'androidx.core:core-ktx:1.7.0'
+    implementation 'androidx.fragment:fragment-ktx:1.4.0'
+    implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
     implementation 'com.google.android.material:material:1.4.0'
     implementation 'com.android.installreferrer:installreferrer:2.2'
 
@@ -85,9 +80,9 @@ dependencies {
     implementation 'com.google.android.gms:play-services-auth:19.2.0'
     //4.0.0的billing库消耗商品会回调两次,后续在排查,先用3.0.3
     implementation "com.android.billingclient:billing-ktx:3.0.3"
-    implementation 'com.google.firebase:firebase-analytics-ktx:19.0.2'
-    implementation 'com.google.firebase:firebase-crashlytics-ktx:18.2.3'
-    implementation 'com.google.firebase:firebase-crashlytics-ndk:18.2.3'
+    implementation 'com.google.firebase:firebase-analytics-ktx:20.0.0'
+    implementation 'com.google.firebase:firebase-crashlytics-ktx:18.2.4'
+    implementation 'com.google.firebase:firebase-crashlytics-ndk:18.2.4'
 
     //facebook
     implementation 'com.facebook.android:facebook-android-sdk:11.2.0'
@@ -95,7 +90,7 @@ dependencies {
     //adjust
     implementation 'com.adjust.sdk:adjust-android:4.28.2'
 
-    if (PUBLISH_ENABLE) {
+    if (rootProject.ext.module.publish) {
         api files('../libs/eyuangamesdk_base_1.0.0.jar')
     } else {
         api project(':library_base')

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

@@ -279,7 +279,6 @@ class SdkBridgeImpl(context: Context) {
 
     fun logout(activity: Activity, callback: ICallback) {
         Logger.i("EYuanGameSdk logout ...")
-
         this.roleInfo = null
         SdkBackLoginInfo.instance.reset()
         FirebaseCrashlytics.getInstance().setUserId("")

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

@@ -273,8 +273,9 @@ class HybridActivity : Activity(), View.OnClickListener {
         super.onNewIntent(intent)
     }
 
-    override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent) {
+    override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {
         super.onActivityResult(requestCode, resultCode, intent)
+
         if (requestCode == FILE_CHOOSER_RESULT_CODE_FOR_ANDROID_5) {
             Logger.d("onActivityResult FILE_CHOOSER_RESULT_CODE_FOR_ANDROID_5")
             if (uploadMessageForAndroid5 == null) {

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

@@ -212,7 +212,6 @@ class ChargeImpl : InAppBilling() {
 
     /**
      * 启动收银台
-     *
      */
     private fun launchBillingFlow(activity: Activity, skuDetails: SkuDetails) {
         billingClient?.apply {
@@ -278,7 +277,6 @@ class ChargeImpl : InAppBilling() {
         }
         notifyOrder2Backend(activity, orderId, purchase, true)
 //        consumeAsync(activity, purchase.purchaseToken, true)
-
     }
 
     /**

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

@@ -353,7 +353,7 @@ class LoginActivity : FragmentActivity(), View.OnClickListener {
         autoLoginDialog?.apply {
             dismiss()
             TimeDownUtils.cancel()
-            chooseDialog = null
+            autoLoginDialog = null
         }
     }
 

+ 1 - 1
library_core/src/main/java/cn/yyxx/eyuangame/core/impl/share/ShareImpl.kt

@@ -55,7 +55,7 @@ class ShareImpl private constructor() {
     }
 
 
-    fun onShareResult(requestCode: Int, resultCode: Int, intent: Intent) {
+    fun onShareResult(requestCode: Int, resultCode: Int, intent: Intent?) {
         fbCallback?.onActivityResult(requestCode, resultCode, intent)
     }
 

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

@@ -151,6 +151,7 @@ class LinkingAdjustImpl(val callback: OnAdjustIdRead) : IEventObserver {
                 if (JsonUtils.hasJsonKey(this, "first_purchase")) {
                     val event = AdjustEvent(this.getString("first_purchase"))
                     event.setRevenue(amount.toDouble() / 100, "USD")
+                    event.setOrderId("order_id")
                     Adjust.trackEvent(event)
                     Logger.d("adjust log first charge success")
                     MMKVUtils.instance.eventKV.encode("adjust_first_purchase", true)
@@ -160,6 +161,7 @@ class LinkingAdjustImpl(val callback: OnAdjustIdRead) : IEventObserver {
             if (JsonUtils.hasJsonKey(this, "ecommerce_purchase")) {
                 val event = AdjustEvent(this.getString("ecommerce_purchase"))
                 event.setRevenue(amount.toDouble() / 100, "USD")
+                event.setOrderId("order_id")
                 Adjust.trackEvent(event)
                 Logger.d("adjust log charge success")
             }

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

@@ -14,7 +14,6 @@ import android.widget.FrameLayout
 import android.widget.ImageView
 import android.widget.LinearLayout
 import android.widget.PopupWindow
-import cn.yyxx.eyuangame.base.utils.Logger
 import cn.yyxx.support.DensityUtils
 import cn.yyxx.support.scheduler.ScheduledWorker
 import java.util.concurrent.TimeUnit

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

@@ -71,6 +71,7 @@
         android:id="@+id/yyxx_btn_switch"
         android:layout_width="150dp"
         android:layout_height="30dp"
+        style="?android:attr/borderlessButtonStyle"
         android:layout_marginTop="20dp"
         android:background="@drawable/yyxx_btn_green_blue_bg"
         android:text="@string/yyxx_tv_switch"