diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 8bc2337f09..97a9cb7d46 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,7 +4,7 @@ diff --git a/app/build.gradle b/app/build.gradle index 97f8e15cac..4efc3a41c6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,6 +4,19 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'android-aspectjx' +//apply ByteX宿主 +apply plugin: 'bytex' +ByteX { + enable true + enableInDebug true + logLevel "DEBUG" +} + +apply plugin: 'chain.log.hook' +hooklog{ + enableLoggerToServer true +} + Properties properties = new Properties(); properties.load(project.rootProject.file("gradle.properties").newDataInputStream()) @@ -29,6 +42,8 @@ android { packagingOptions { exclude 'META-INF/proguard/coroutines.pro' exclude 'META-INF/*' + exclude '*/proguard' + pickFirst 'migrateToAndroidx/migration.xml' } signingConfigs { @@ -132,7 +147,6 @@ aspectjx { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) - //Crash日志收集 implementation rootProject.ext.dependencies.crashSdk implementation rootProject.ext.dependencies.androidxappcompat diff --git a/build.gradle b/build.gradle index 488fd1b534..fc46f91485 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,7 @@ apply from: "javadoc.gradle" buildscript { repositories { + maven { url "https://artifact.bytedance.com/repository/byteX/" } maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/google' } @@ -18,6 +19,8 @@ buildscript { classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31' classpath "com.alibaba:arouter-register:1.0.2" classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4' + classpath "com.bytedance.android.byteX:base-plugin:0.3.0" + classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}" // classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true } } @@ -26,6 +29,7 @@ buildscript { allprojects { repositories { + maven { url "https://artifact.bytedance.com/repository/byteX/" } maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/google' } diff --git a/config.gradle b/config.gradle index 3ead80512b..abeb2b6f37 100644 --- a/config.gradle +++ b/config.gradle @@ -241,6 +241,9 @@ ext { mogoaicloudtrafficlive : "com.mogo.cloud:trafficlive:${MOGO_TRAFFICLIVE_VERSION}", mogoaicloudlocation : "com.mogo.cloud:location:${MOGO_LOCATION_VERSION}", + //plugin + mogochainbase : "com.mogo.cloud:service-chain:${SERVICE_CHAIN_VERSION}", + mogochainplugin : "com.mogo.cloud:hook:${HOOK_LOG_VERSION}", ] } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 1b4a749def..5ce42ef968 100644 --- a/gradle.properties +++ b/gradle.properties @@ -36,7 +36,7 @@ kapt.include.compile.classpath=false # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX -android.enableJetifier=true +android.enableJetifier=false android.jetifier.blacklist=module-service-2.0.58.aar ## maven 配置 RELEASE_REPOSITORY_URL=http://nexus.zhidaoauto.com/repository/maven-releases/ @@ -45,6 +45,22 @@ USERNAME=xintai PASSWORD=xintai2018 # 编译模式: false - 依赖本地版本, true - 依赖 maven 版本 RELEASE=false + +#plugin 插件 +android.enableR8.libraries=false +android.enableR8=false +android.enableD8=true +android.enableD8.desugaring=true +android.enableDesugar=true +bytex.enableHtmlLog=true +bytex.forbidUseLenientMutationDuringGetArtifact=true +bytex.verifyProguardConfigurationChanged=false +bytex.ASM_API=ASM7 + +HOOK_LOG_VERSION=1.4.63 +SERVICE_CHAIN_VERSION=1.0.22 + + # 模块版本 ## 工程内模块 MOGO_COMMONS_VERSION=2.0.58 diff --git a/modules/mogo-module-common/build.gradle b/modules/mogo-module-common/build.gradle index 762eb4ee0c..bd110d83d2 100644 --- a/modules/mogo-module-common/build.gradle +++ b/modules/mogo-module-common/build.gradle @@ -73,6 +73,9 @@ dependencies { implementation project(':core:mogo-core-function-call') } + implementation rootProject.ext.dependencies.mogochainbase + implementation rootProject.ext.dependencies.mogochainplugin + annotationProcessor 'com.elegant.spi:compiler:1.0.3' } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java index 5903a122e3..9c9983c420 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java @@ -29,6 +29,8 @@ import com.mogo.utils.ViewUtils; import com.mogo.utils.logger.Logger; import com.zhidao.carchattingprovider.ICarsChattingProvider; import com.zhidao.carchattingprovider.MogoDriverInfo; +import com.zhjt.service.chain.ChainLog; +import com.zhjt.service.chain.TracingConstants; import java.util.ArrayList; import java.util.Iterator; @@ -138,12 +140,15 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic * * @param data 自车周边数据 */ + @ChainLog(endpoint = TracingConstants.Endpoint.PAD, + nodeAliasCode = "PAD_YINGYAN_SHOW", + paramIndexes = 0, + clientPkFileName = "sn") public void renderSnapshotData(SocketDownData.LauncherSnapshotProto data) { final long start = System.nanoTime(); if (clear(data)) { return; } - if (!MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) { return; } @@ -222,7 +227,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic while (iterator.hasNext()) { IMogoMarker result = iterator.next(); SocketDownData.CloudRoadDataProto proto = ((SocketDownData.CloudRoadDataProto) result.getObject()); - if(proto == null){ // 后续有业务数据在操作,更新数据,不做处理 + if (proto == null) { // 后续有业务数据在操作,更新数据,不做处理 continue; } long internal = Long.parseLong(adasControllerApi.getSatelliteTime()) - proto.getSatelliteTime(); diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java index c99081b320..7d52f427ad 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java @@ -20,6 +20,7 @@ import com.mogo.module.common.drawer.AdasRecognizedResultDrawer; import com.mogo.module.common.drawer.MarkerDrawer; import com.mogo.module.common.drawer.OnlineCarDrawer; import com.mogo.module.common.drawer.RoadConditionDrawer; +import com.mogo.module.common.drawer.SnapshotSetDataDrawer; import com.mogo.module.common.drawer.marker.IMarkerView; import com.mogo.module.common.drawer.marker.MapMarkerAdapter; import com.mogo.module.common.drawer.marker.OnlineCarMarkerView; @@ -147,7 +148,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener, @Override public void onMsgReceived(SocketDownData.LauncherSnapshotProto mogoSnapshotSetData) { DebugConfig.setStatus(DebugConfig.sDownloadSnapshot, true); - // SnapshotSetDataDrawer.getInstance().renderSnapshotData(mogoSnapshotSetData); +// SnapshotSetDataDrawer.getInstance().renderSnapshotData(mogoSnapshotSetData); // Message msg = mSnapshotHandler.obtainMessage(); // msg.obj = mogoSnapshotSetData; // msg.what = MSG_SNAPSHOT;