diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index cb58b5cb2b..116359f324 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -67,6 +67,10 @@
+
+
+
+
diff --git a/app/build.gradle b/app/build.gradle
index 110d231660..d31249a591 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -348,6 +348,7 @@ dependencies {
apply from: "./functions/gpssimulator.gradle"
apply from: "./functions/leftpanel.gradle"
apply from: "./functions/skin.gradle"
+ apply from: "./functions/crashreport.gradle"
}
android.applicationVariants.all { variant ->
diff --git a/app/functions/crashreport.gradle b/app/functions/crashreport.gradle
new file mode 100644
index 0000000000..7fb0712d47
--- /dev/null
+++ b/app/functions/crashreport.gradle
@@ -0,0 +1,13 @@
+// bugly 上报,目前仅在debug编译下加载bugly
+
+project.dependencies {
+ if (Boolean.valueOf(RELEASE)) {
+ implementation rootProject.ext.dependencies.crashreport
+ debugImplementation rootProject.ext.dependencies.crashreportbugly
+ releaseImplementation rootProject.ext.dependencies.crashreportnoop
+ } else {
+ implementation project(':test:crashreport')
+ debugImplementation project(':test:crashreport-bugly')
+ releaseImplementation project(':test:crashreport-noop')
+ }
+}
\ No newline at end of file
diff --git a/app/functions/skin.gradle b/app/functions/skin.gradle
index 15fbbad2c8..5945ee7e4c 100644
--- a/app/functions/skin.gradle
+++ b/app/functions/skin.gradle
@@ -2,47 +2,47 @@ project.dependencies {
if (Boolean.valueOf(RELEASE)) {
bydautoImplementation rootProject.ext.dependencies.skinsupportnoop
+ d8xxImplementation rootProject.ext.dependencies.skinsupportnoop
+ d82xImplementation rootProject.ext.dependencies.skinsupportnoop
+ em1Implementation rootProject.ext.dependencies.skinsupportnoop
+ d80xImplementation rootProject.ext.dependencies.skinsupportnoop
+ em3Implementation rootProject.ext.dependencies.skinsupportnoop
f8xxImplementation rootProject.ext.dependencies.skinsupportimpl
f80xImplementation rootProject.ext.dependencies.skinsupportimpl
em4Implementation rootProject.ext.dependencies.skinsupportimpl
e8xxImplementation rootProject.ext.dependencies.skinsupportimpl
- d8xxImplementation rootProject.ext.dependencies.skinsupportimpl
- d82xImplementation rootProject.ext.dependencies.skinsupportimpl
- em1Implementation rootProject.ext.dependencies.skinsupportimpl
- d80xImplementation rootProject.ext.dependencies.skinsupportimpl
- em3Implementation rootProject.ext.dependencies.skinsupportimpl
f8xxImplementation rootProject.ext.dependencies.skinsupportlight
f80xImplementation rootProject.ext.dependencies.skinsupportlight
em4Implementation rootProject.ext.dependencies.skinsupportlight
e8xxImplementation rootProject.ext.dependencies.skinsupportlight
- d8xxImplementation rootProject.ext.dependencies.skinsupportlight
- d82xImplementation rootProject.ext.dependencies.skinsupportlight
- em1Implementation rootProject.ext.dependencies.skinsupportlight
- d80xImplementation rootProject.ext.dependencies.skinsupportlight
- em3Implementation rootProject.ext.dependencies.skinsupportlight
+// d8xxImplementation rootProject.ext.dependencies.skinsupportlight
+// d82xImplementation rootProject.ext.dependencies.skinsupportlight
+// em1Implementation rootProject.ext.dependencies.skinsupportlight
+// d80xImplementation rootProject.ext.dependencies.skinsupportlight
+// em3Implementation rootProject.ext.dependencies.skinsupportlight
} else {
bydautoImplementation project(':skin:mogo-skin-support-noop')
+ d8xxImplementation project(':skin:mogo-skin-support-noop')
+ d82xImplementation project(':skin:mogo-skin-support-noop')
+ em1Implementation project(':skin:mogo-skin-support-noop')
+ d80xImplementation project(':skin:mogo-skin-support-noop')
+ em3Implementation project(':skin:mogo-skin-support-noop')
f8xxImplementation project(':skin:mogo-skin-support-impl')
f80xImplementation project(':skin:mogo-skin-support-impl')
em4Implementation project(':skin:mogo-skin-support-impl')
e8xxImplementation project(':skin:mogo-skin-support-impl')
- d8xxImplementation project(':skin:mogo-skin-support-impl')
- d82xImplementation project(':skin:mogo-skin-support-impl')
- em1Implementation project(':skin:mogo-skin-support-impl')
- d80xImplementation project(':skin:mogo-skin-support-impl')
- em3Implementation project(':skin:mogo-skin-support-impl')
f8xxImplementation project(':skin:mogo-skin-light')
f80xImplementation project(':skin:mogo-skin-light')
em4Implementation project(':skin:mogo-skin-light')
e8xxImplementation project(':skin:mogo-skin-light')
- d8xxImplementation project(':skin:mogo-skin-light')
- d82xImplementation project(':skin:mogo-skin-light')
- em1Implementation project(':skin:mogo-skin-light')
- d80xImplementation project(':skin:mogo-skin-light')
- em3Implementation project(':skin:mogo-skin-light')
+// d8xxImplementation project(':skin:mogo-skin-light')
+// d82xImplementation project(':skin:mogo-skin-light')
+// em1Implementation project(':skin:mogo-skin-light')
+// d80xImplementation project(':skin:mogo-skin-light')
+// em3Implementation project(':skin:mogo-skin-light')
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/mogo/launcher/MogoApplication.java b/app/src/main/java/com/mogo/launcher/MogoApplication.java
index 5d49b003e5..381aa2c9b2 100644
--- a/app/src/main/java/com/mogo/launcher/MogoApplication.java
+++ b/app/src/main/java/com/mogo/launcher/MogoApplication.java
@@ -29,6 +29,7 @@ import com.mogo.module.widgets.MogoWidgetsProvider;
import com.mogo.service.IMogoServiceApis;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.passport.IMogoTicketCallback;
+import com.mogo.test.crashreport.ITestCrashReportProvider;
import com.mogo.utils.UiThreadHandler;
import com.mogo.utils.logger.LogLevel;
import com.mogo.utils.logger.Logger;
@@ -100,6 +101,11 @@ public class MogoApplication extends AbsMogoApplication {
}
LeakCanary.install( this );
+
+ // debug 下初始化 bugly 上报
+ if ( DebugConfig.isDebug() ) {
+ ARouter.getInstance().navigation( ITestCrashReportProvider.class );
+ }
Log.i( "timer", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
}
diff --git a/config.gradle b/config.gradle
index ca2e153a19..8cbe49b6ab 100644
--- a/config.gradle
+++ b/config.gradle
@@ -161,7 +161,7 @@ targetSdkVersion : 22,
gpssimulatornoop : "com.mogo.module:module-gps-simulator-noop:${MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION}",
adasapi : "com.zhidao.autopilot.support:adas:1.0.1",
- adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.4",
+ adasconfigapi : "com.zhidao.adasconfig:adasconfig:1.1.5",
// 个人中心的SDK
personalsdk : "com.zhidaoauto.person.info:data:1.0.1",
@@ -205,6 +205,10 @@ targetSdkVersion : 22,
skinsupportimpl : "com.mogo.skin:skin-support-impl:${MOGO_SKIN_SUPPORT_IMPL_VERSION}",
skinsupportnoop : "com.mogo.skin:skin-support-noop:${MOGO_SKIN_SUPPORT_NOOP_VERSION}",
skinsupportlight : "com.mogo.skin:skin-light:${MOGO_SKIN_LIGHT_VERSION}",
+
+ crashreport : "com.mogo.test:crashrepot:${CRASHREPORT_VERSION}",
+ crashreportbugly : "com.mogo.test:crashreport-bugly:${CRASHREPORT_BUGLY_VERSION}",
+ crashreportnoop : "com.mogo.test:crashreport-noop:${CRASHREPORT_NOOP_VERSION}",
]
}
\ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index f5955caa34..57bdb8d90b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -114,6 +114,10 @@ LOGLIB_VERSION = 1.0.4
# monitor
MOGO_MODULE_MONITOR_VERSION = 1.0.0-SNAPSHOT
+CRASHREPORT_VERSION = 1.0.0
+CRASHREPORT_BUGLY_VERSION = 1.0.0
+CRASHREPORT_NOOP_VERSION = 1.0.0
+
## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级
applicationId=com.mogo.launcer
applicationName=IntelligentPilot
diff --git a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapViewWrapper.java b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapViewWrapper.java
index f5cf1dfd7f..7b33644b91 100644
--- a/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapViewWrapper.java
+++ b/libraries/map-amap/src/main/java/com/mogo/map/impl/amap/AMapViewWrapper.java
@@ -27,7 +27,6 @@ import com.amap.api.maps.model.Poi;
import com.amap.api.maps.model.Polyline;
import com.amap.api.maps.model.animation.Animation;
import com.amap.api.maps.model.animation.TranslateAnimation;
-import com.amap.api.navi.AMapNaviViewOptions;
import com.amap.api.navi.model.NaviInfo;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.map.IMogoMap;
@@ -70,8 +69,6 @@ public class AMapViewWrapper implements IMogoMapView,
AMap.OnCameraChangeListener,
AMap.OnMyLocationChangeListener {
- private static boolean sIsCreated = false;
-
private static final String TAG = "AMapViewWrapper";
private final MapView mMapView;
@@ -183,6 +180,7 @@ public class AMapViewWrapper implements IMogoMapView,
aMap.setOnCameraChangeListener( this );
aMap.setOnMyLocationChangeListener( this );
}
+ AMapMessageManager.getInstance().clear();
AMapMessageManager.getInstance().registerAMapMessageListener( this );
}
@@ -202,13 +200,6 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onCreate( Bundle bundle ) {
- if ( sIsCreated ) {
- initMapView();
- initListeners();
- initMyLocation();
- return;
- }
- sIsCreated = true;
if ( mMapView != null ) {
mMapView.onCreate( bundle );
Logger.d( TAG, "map onCreate" );
@@ -222,6 +213,7 @@ public class AMapViewWrapper implements IMogoMapView,
public void onResume() {
if ( mMapView != null ) {
mMapView.onResume();
+ Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
Logger.d( TAG, "map onResume" );
}
}
@@ -236,7 +228,6 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onDestroy() {
- sIsCreated = false;
if ( mMapView != null ) {
mMapView.onDestroy();
Logger.d( TAG, "map onDestroy" );
@@ -390,7 +381,7 @@ public class AMapViewWrapper implements IMogoMapView,
}
private boolean checkMapView() {
- if ( mMapView == null ) {
+ if ( mMapView == null || mMapView.getMap() == null ) {
Logger.e( TAG, "高德mapView实例为空,请检查" );
return false;
}
@@ -425,7 +416,7 @@ public class AMapViewWrapper implements IMogoMapView,
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
}
if ( checkMapView() ) {
- MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
+ MyLocationStyle style = getMyLocationStyle();
if ( style == null ) {
style = new MyLocationStyle();
}
@@ -447,7 +438,7 @@ public class AMapViewWrapper implements IMogoMapView,
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
}
if ( checkMapView() ) {
- MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
+ MyLocationStyle style = getMyLocationStyle();
if ( style == null ) {
style = new MyLocationStyle();
}
@@ -460,7 +451,7 @@ public class AMapViewWrapper implements IMogoMapView,
public void initMyLocation() {
if ( checkMapView() ) {
mMapView.getMap().setMyLocationEnabled( true );
- MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
+ MyLocationStyle style = getMyLocationStyle();
style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER );
style.interval( 1000 );
style.anchor( 0.5F, 0.5F );
@@ -471,6 +462,14 @@ public class AMapViewWrapper implements IMogoMapView,
}
}
+ private MyLocationStyle getMyLocationStyle() {
+ try {
+ return mMapView.getMap().getMyLocationStyle();
+ } catch ( Exception e ) {
+ return new MyLocationStyle();
+ }
+ }
+
@Override
public void recoverLockMode() {
if ( checkMapView() ) {
@@ -478,7 +477,10 @@ public class AMapViewWrapper implements IMogoMapView,
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
}
Logger.d( TAG, "锁车" );
- MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
+ MyLocationStyle style = getMyLocationStyle();
+ if ( style == null ) {
+ style = new MyLocationStyle();
+ }
style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW );
mMapView.getMap().setMyLocationStyle( style );
mIsCarLocked = true;
@@ -491,7 +493,7 @@ public class AMapViewWrapper implements IMogoMapView,
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
}
Logger.d( TAG, "解锁锁车" );
- MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
+ MyLocationStyle style = getMyLocationStyle();
style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW_NO_CENTER );
mMapView.getMap().setMyLocationStyle( style );
mIsCarLocked = false;
diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java
index 289e76249d..355c6324b5 100644
--- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java
+++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/cards/MogoModulesManager.java
@@ -185,7 +185,7 @@ public class MogoModulesManager implements MogoModulesHandler {
return;
}
mActivity.getSupportFragmentManager().beginTransaction()
- .add( containerId, fragment, provider.getModuleName() )
+ .replace( containerId, fragment, provider.getModuleName() )
.commitAllowingStateLoss();
}
}
diff --git a/settings.gradle b/settings.gradle
index 802707be57..fa434b5b48 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,3 +1,6 @@
+include ':test:crashreport'
+include ':test:crashreport-bugly'
+include ':test:crashreport-noop'
include ':skin:skin-support'
include ':skin:skin-support-appcompat'
include ':skin:skin-support-cardview'
@@ -54,3 +57,4 @@ include ':modules:mogo-module-guide'
include ':modules:mogo-module-tanlu'
include ':libraries:tanlulib'
include ':skin'
+include ':test'
diff --git a/test/crashreport-bugly/.gitignore b/test/crashreport-bugly/.gitignore
new file mode 100644
index 0000000000..42afabfd2a
--- /dev/null
+++ b/test/crashreport-bugly/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/test/crashreport-bugly/build.gradle b/test/crashreport-bugly/build.gradle
new file mode 100644
index 0000000000..2ee98887fe
--- /dev/null
+++ b/test/crashreport-bugly/build.gradle
@@ -0,0 +1,58 @@
+apply plugin: 'com.android.library'
+apply plugin: 'com.alibaba.arouter'
+
+android {
+ compileSdkVersion rootProject.ext.android.compileSdkVersion
+ // buildToolsVersion rootProject.ext.android.buildToolsVersion
+ defaultConfig {
+ minSdkVersion rootProject.ext.android.minSdkVersion
+ targetSdkVersion rootProject.ext.android.targetSdkVersion
+ versionCode Integer.valueOf(VERSION_CODE)
+ versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ consumerProguardFiles "consumer-rules.pro"
+
+ ndk {
+ // 设置支持的SO库架构
+ abiFilters 'armeabi' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
+ }
+
+ javaCompileOptions {
+ annotationProcessorOptions {
+ arguments = [AROUTER_MODULE_NAME: project.getName()]
+ }
+ }
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: "libs", include: ["*.jar"])
+ implementation rootProject.ext.dependencies.androidxappcompat
+ implementation rootProject.ext.dependencies.arouter
+ annotationProcessor rootProject.ext.dependencies.aroutercompiler
+
+ if (Boolean.valueOf(RELEASE)) {
+ implementation rootProject.ext.dependencies.crashreport
+ implementation rootProject.ext.dependencies.mogoutils
+ implementation rootProject.ext.dependencies.mogocommons
+ } else {
+ implementation project(":test:crashreport")
+ implementation project(":foudations:mogo-utils")
+ implementation project(":foudations:mogo-commons")
+ }
+
+ implementation 'com.tencent.bugly:crashreport:latest.release'
+ //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如2.1.9
+ implementation 'com.tencent.bugly:nativecrashreport:latest.release'
+ //其中latest.release指代最新Bugly NDK版本号,也可以指定明确的版本号,例如3.0
+}
+
+apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
\ No newline at end of file
diff --git a/test/crashreport-bugly/consumer-rules.pro b/test/crashreport-bugly/consumer-rules.pro
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/test/crashreport-bugly/gradle.properties b/test/crashreport-bugly/gradle.properties
new file mode 100644
index 0000000000..6b451eda5d
--- /dev/null
+++ b/test/crashreport-bugly/gradle.properties
@@ -0,0 +1,3 @@
+GROUP=com.mogo.test
+POM_ARTIFACT_ID=crashreport-bugly
+VERSION_CODE=1
diff --git a/test/crashreport-bugly/proguard-rules.pro b/test/crashreport-bugly/proguard-rules.pro
new file mode 100644
index 0000000000..481bb43481
--- /dev/null
+++ b/test/crashreport-bugly/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/test/crashreport-bugly/src/main/AndroidManifest.xml b/test/crashreport-bugly/src/main/AndroidManifest.xml
new file mode 100644
index 0000000000..d9f7357150
--- /dev/null
+++ b/test/crashreport-bugly/src/main/AndroidManifest.xml
@@ -0,0 +1,5 @@
+
+ * 描述 + */ +class CrashReportConstants { + + public static final String PATH = "/crashreport/api"; + + public static final String NAME = "CrashReportApi"; +} diff --git a/test/crashreport/src/main/java/com/mogo/test/crashreport/ITestCrashReportProvider.java b/test/crashreport/src/main/java/com/mogo/test/crashreport/ITestCrashReportProvider.java new file mode 100644 index 0000000000..82c27f8f79 --- /dev/null +++ b/test/crashreport/src/main/java/com/mogo/test/crashreport/ITestCrashReportProvider.java @@ -0,0 +1,14 @@ +package com.mogo.test.crashreport; + +import com.alibaba.android.arouter.facade.template.IProvider; + +public +/** + * @author congtaowang + * @since 2020/9/9 + * + * 描述 + */ +interface ITestCrashReportProvider extends IProvider { + +}