From 53d1acedc9647b44889f63d8c2e5511128cdfb8f Mon Sep 17 00:00:00 2001 From: renhaoting <370797079@qq.com> Date: Wed, 31 Dec 2025 18:48:19 +0800 Subject: [PATCH] =?UTF-8?q?adjust=20=E9=85=8D=E7=BD=AE=E5=88=9D=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StatisticReporter/.gitignore | 1 + StatisticReporter/build.gradle.kts | 49 +++++++++++++++++++ StatisticReporter/consumer-rules.pro | 0 StatisticReporter/proguard-rules.pro | 21 ++++++++ .../ExampleInstrumentedTest.kt | 24 +++++++++ .../src/main/AndroidManifest.xml | 7 +++ .../statisticreporter/adjust/AdjustManager.kt | 38 ++++++++++++++ .../com/gamedog/statisticreporter/test.kt | 4 ++ .../statisticreporter/ExampleUnitTest.kt | 17 +++++++ app/build.gradle | 1 + .../java/com/gamedog/vididin/VidiConst.kt | 7 +++ .../java/com/gamedog/vididin/VidiDinApp.kt | 2 + settings.gradle | 1 + 13 files changed, 172 insertions(+) create mode 100644 StatisticReporter/.gitignore create mode 100644 StatisticReporter/build.gradle.kts create mode 100644 StatisticReporter/consumer-rules.pro create mode 100644 StatisticReporter/proguard-rules.pro create mode 100644 StatisticReporter/src/androidTest/java/com/gamedog/statisticreporter/ExampleInstrumentedTest.kt create mode 100644 StatisticReporter/src/main/AndroidManifest.xml create mode 100644 StatisticReporter/src/main/java/com/gamedog/statisticreporter/adjust/AdjustManager.kt create mode 100644 StatisticReporter/src/main/java/com/gamedog/statisticreporter/test.kt create mode 100644 StatisticReporter/src/test/java/com/gamedog/statisticreporter/ExampleUnitTest.kt diff --git a/StatisticReporter/.gitignore b/StatisticReporter/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/StatisticReporter/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/StatisticReporter/build.gradle.kts b/StatisticReporter/build.gradle.kts new file mode 100644 index 0000000..a7d77bc --- /dev/null +++ b/StatisticReporter/build.gradle.kts @@ -0,0 +1,49 @@ +plugins { + alias(libs.plugins.androidLibrary) + alias(libs.plugins.kotlinAndroid) +} + +android { + namespace = "com.gamedog.statisticreporter" + compileSdk = 36 + + defaultConfig { + minSdk = 24 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.appcompat) + implementation(libs.material) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.espresso.core) + + api("com.adjust.sdk:adjust-android:5.5.0") + api("com.android.installreferrer:installreferrer:2.2") + // Add the following if you are using the Adjust SDK inside web views on your app + api("com.adjust.sdk:adjust-android-webbridge:5.5.0") + api("com.android.installreferrer:installreferrer:2.2") + api("com.adjust.sdk:adjust-android-huawei-referrer:5.0.0") +} \ No newline at end of file diff --git a/StatisticReporter/consumer-rules.pro b/StatisticReporter/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/StatisticReporter/proguard-rules.pro b/StatisticReporter/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/StatisticReporter/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/StatisticReporter/src/androidTest/java/com/gamedog/statisticreporter/ExampleInstrumentedTest.kt b/StatisticReporter/src/androidTest/java/com/gamedog/statisticreporter/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..32d1ccb --- /dev/null +++ b/StatisticReporter/src/androidTest/java/com/gamedog/statisticreporter/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.gamedog.statisticreporter + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.gamedog.statisticreporter.test", appContext.packageName) + } +} \ No newline at end of file diff --git a/StatisticReporter/src/main/AndroidManifest.xml b/StatisticReporter/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9141bca --- /dev/null +++ b/StatisticReporter/src/main/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/StatisticReporter/src/main/java/com/gamedog/statisticreporter/adjust/AdjustManager.kt b/StatisticReporter/src/main/java/com/gamedog/statisticreporter/adjust/AdjustManager.kt new file mode 100644 index 0000000..b3ab6de --- /dev/null +++ b/StatisticReporter/src/main/java/com/gamedog/statisticreporter/adjust/AdjustManager.kt @@ -0,0 +1,38 @@ +package com.gamedog.statisticreporter.adjust + +import android.content.Context +import com.adjust.sdk.Adjust +import com.adjust.sdk.AdjustConfig +import com.adjust.sdk.LogLevel +import com.adjust.sdk.huawei.BuildConfig + + + + +class AdjustManager private constructor() { + companion object { + @Volatile + private var INSTANCE: AdjustManager? = null + + fun instance(): AdjustManager { + return INSTANCE ?: synchronized(this) { + INSTANCE ?: AdjustManager().also { INSTANCE = it } + } + } + } + + private lateinit var mAppContext: Context + + + fun initSdk(appToken: String) { + val isDebug = BuildConfig.DEBUG + val environment = if (isDebug) AdjustConfig.ENVIRONMENT_SANDBOX else AdjustConfig.ENVIRONMENT_PRODUCTION + val config = AdjustConfig(mAppContext, appToken, environment).apply { + setLogLevel(if (isDebug) LogLevel.VERBOSE else LogLevel.WARN) + } + Adjust.initSdk(config) + } + + +} + diff --git a/StatisticReporter/src/main/java/com/gamedog/statisticreporter/test.kt b/StatisticReporter/src/main/java/com/gamedog/statisticreporter/test.kt new file mode 100644 index 0000000..e788f2a --- /dev/null +++ b/StatisticReporter/src/main/java/com/gamedog/statisticreporter/test.kt @@ -0,0 +1,4 @@ +package com.gamedog.statisticreporter + +class test { +} \ No newline at end of file diff --git a/StatisticReporter/src/test/java/com/gamedog/statisticreporter/ExampleUnitTest.kt b/StatisticReporter/src/test/java/com/gamedog/statisticreporter/ExampleUnitTest.kt new file mode 100644 index 0000000..ecc5e0a --- /dev/null +++ b/StatisticReporter/src/test/java/com/gamedog/statisticreporter/ExampleUnitTest.kt @@ -0,0 +1,17 @@ +package com.gamedog.statisticreporter + +import org.junit.Test + +import org.junit.Assert.* + +/** + * Example local unit test, which will execute on the development machine (host). + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +class ExampleUnitTest { + @Test + fun addition_isCorrect() { + assertEquals(4, 2 + 2) + } +} \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 1dc5708..1d60810 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -75,6 +75,7 @@ dependencies { implementation(project(":bill")) implementation(project(":youtube:core")) implementation(project(":youtube:custom-ui")) + implementation(project(":StatisticReporter")) implementation libs.androidx.navigation.fragment.ktx implementation(libs.startup) diff --git a/app/src/main/java/com/gamedog/vididin/VidiConst.kt b/app/src/main/java/com/gamedog/vididin/VidiConst.kt index 76b3c28..16d0bef 100644 --- a/app/src/main/java/com/gamedog/vididin/VidiConst.kt +++ b/app/src/main/java/com/gamedog/vididin/VidiConst.kt @@ -3,6 +3,13 @@ package com.gamedog.vididin object VidiConst { + const val ADJUST_TOKEN: String = "sa8ei0td10xs" + const val ADJUST_TOKEN_S2: String = "f3cff8c4bba54c6dc08b3401069ae06d" + const val ADJUST_WITHDRAW_SUCCESS_EVENT: String = "tjs3fp" + const val ADJUST_WITHDRAW_FAILED_EVENT: String = "33jp2j" + + + const val NEWBIE_GIFT_GOLD_NUM: Long = 100 diff --git a/app/src/main/java/com/gamedog/vididin/VidiDinApp.kt b/app/src/main/java/com/gamedog/vididin/VidiDinApp.kt index 7aac15e..a7aa6c7 100644 --- a/app/src/main/java/com/gamedog/vididin/VidiDinApp.kt +++ b/app/src/main/java/com/gamedog/vididin/VidiDinApp.kt @@ -1,6 +1,7 @@ package com.gamedog.vididin import com.ama.core.architecture.BaseApp +import com.gamedog.statisticreporter.adjust.AdjustManager import com.gamedog.vididin.core.login.login.AccountManager import com.gamedog.vididin.manager.TaskManager import dagger.hilt.android.HiltAndroidApp @@ -22,5 +23,6 @@ class VidiDinApp : BaseApp() { AccountManager.getAccount() TaskManager.instance().initNotificationData() TaskManager.instance() + AdjustManager.instance().initSdk(VidiConst.ADJUST_TOKEN) } } \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 2496eac..bb1298e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -39,3 +39,4 @@ include ':app' include ':bill' include ':base' include ':notification' +include ':StatisticReporter'