diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 14a180efe..57c14fe4e 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -21,6 +21,9 @@ import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.adjust.sdk.Adjust; +import com.adjust.sdk.AdjustConfig; +import com.adjust.sdk.LogLevel; import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -443,6 +446,12 @@ public class AppContext extends CommonAppContext { configSPApp(); //初始化美颜SDK // FaceManager.initFaceUnity(this); + //初始化Adjust + String appToken = "d6m0zj5a3k00"; + String environment = AdjustConfig.ENVIRONMENT_SANDBOX; + AdjustConfig config = new AdjustConfig(this, appToken, environment); + config.setLogLevel(LogLevel.VERBOSE); + Adjust.onCreate(config); } /** diff --git a/common/build.gradle b/common/build.gradle index 907facb14..1fa72ed86 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -264,4 +264,10 @@ dependencies { //下标切换器 https://github.com/angcyo/DslTabLayout api project(':TabLayout') + + //Adjust SDK + api 'com.adjust.sdk:adjust-android:4.38.5' + api 'com.android.installreferrer:installreferrer:2.2' + // Add the following if you're using the Adjust SDK inside web views on your app + api 'com.adjust.sdk:adjust-android-webbridge:4.38.5' } diff --git a/common/proguard-rules.pro b/common/proguard-rules.pro index cc79a578a..c58339bea 100644 --- a/common/proguard-rules.pro +++ b/common/proguard-rules.pro @@ -28,4 +28,18 @@ -ignorewarnings -keep class com.qiniu.**{*;} -keep class com.qiniu.**{public ();} --ignorewarnings \ No newline at end of file +-ignorewarnings + +#adjust.sdk +-keep class com.adjust.sdk.** { *; } +-keep class com.google.android.gms.common.ConnectionResult { + int SUCCESS; +} +-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { + com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); +} +-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { + java.lang.String getId(); + boolean isLimitAdTrackingEnabled(); +} +-keep public class com.android.installreferrer.** { *; } \ No newline at end of file diff --git a/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java b/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java index 8e6a13fbc..c2f6e87ea 100644 --- a/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/RegisterActivity.java @@ -21,6 +21,8 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; +import com.adjust.sdk.Adjust; +import com.adjust.sdk.AdjustEvent; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.blankj.utilcode.util.DeviceUtils; @@ -374,6 +376,9 @@ public class RegisterActivity extends AbsActivity { public void onSuccess(int code, String msg, String[] info) { if (code == 0) { //注册成功 + //注册埋点 + AdjustEvent adjustEvent = new AdjustEvent("h9yurf"); + Adjust.trackEvent(adjustEvent); login(phoneNum, pwd, mUuidDevice); OpenInstall.reportRegister(); } else {