adjust 配置初步
This commit is contained in:
parent
80038162cf
commit
53d1acedc9
|
|
@ -0,0 +1 @@
|
|||
/build
|
||||
|
|
@ -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")
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||
|
||||
</manifest>
|
||||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package com.gamedog.statisticreporter
|
||||
|
||||
class test {
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
@ -39,3 +39,4 @@ include ':app'
|
|||
include ':bill'
|
||||
include ':base'
|
||||
include ':notification'
|
||||
include ':StatisticReporter'
|
||||
|
|
|
|||
Loading…
Reference in New Issue