This commit is contained in:
unknown
2020-07-23 13:20:32 +08:00
7 changed files with 27 additions and 9 deletions

View File

@@ -87,6 +87,7 @@ android {
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'true'
// 是否作为 launcher 运行
buildConfigField 'boolean', 'IS_LAUNCHER', 'false'
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
}
// launcher app
launcher{
@@ -98,6 +99,7 @@ android {
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'true'
// 是否作为 launcher 运行
buildConfigField 'boolean', 'IS_LAUNCHER', 'true'
buildConfigField 'String', 'SOCKET_APP_ID', '\"com.mogo.launcher\"'
}
// f系列-分体机全系列,未细分
f8xx{

View File

@@ -91,6 +91,7 @@ public class MogoApplication extends AbsMogoApplication {
DebugConfig.setActiveAIAssistFlag( BuildConfig.AI_ASSIST_ACTIVE_STAUTS );
DebugConfig.setCarMachineType( BuildConfig.CAR_MACHINE_TYPE );
DebugConfig.setProductFlavor( BuildConfig.FLAVOR_product );
DebugConfig.setSocketAppId( BuildConfig.SOCKET_APP_ID );
}
@Override
@@ -98,7 +99,7 @@ public class MogoApplication extends AbsMogoApplication {
super.init();
UiThreadHandler.postDelayed( () -> {
final IMogoServiceApis apis = ARouter.getInstance().navigation( IMogoServiceApis.class );
apis.getSocketManagerApi( getApplicationContext() ).init( getApplicationContext(), "com.mogo.launcher" );
apis.getSocketManagerApi( getApplicationContext() ).init( getApplicationContext(), DebugConfig.getSocketAppId() );
apis.getPassportManagerApi().requestTicket( new IMogoTicketCallback() {
@Override
public void onSuccess( String ticket ) {

View File

@@ -74,7 +74,7 @@ class MogoLocationInfoServices implements IMogoLocationInfoService {
@Override
public void init( Context context ) {
LocUploadConfig.instance().
setAppId( "dataCrawler" ).
setAppId( DebugConfig.getSocketAppId() ).
setContext( context.getApplicationContext() ).
setLocEnvironment( getEnvironment() ).
setLoggable( DebugConfig.isDebug() ).

View File

@@ -95,7 +95,7 @@ class PassportManager implements IMogoPassportManager {
// 演示环境用 qa 的
mode = DebugConfig.NET_MODE_QA;
}
NetEnvironManager.instance().setEnviron( mode );
LoginManager.getInstance( context ).login(true, DebugConfig.getProductFlavor());
LoginManager.getInstance( context ).setNetEnviron( mode );
LoginManager.getInstance( context ).login(DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE, DebugConfig.getProductFlavor());
}
}

View File

@@ -87,7 +87,7 @@ class SocketManager implements IMogoSocketManager, Callback {
.setEnvironment( getEnvironment() )
.setClient( Platform.getClient( Platform.car ) )
.setAppId( appId )
.setOpenAnalytics( true )
// .setOpenAnalytics( true )
.setDebug( DebugConfig.isDebug() );
SocketMessageDispatcher.getInstance().start( context );
}

View File

@@ -227,4 +227,14 @@ public class DebugConfig {
public static void setProductFlavor( String sProductFlavor ) {
DebugConfig.sProductFlavor = sProductFlavor;
}
private static String sSocketAppId;
public static void setSocketAppId( String sSocketAppId ) {
DebugConfig.sSocketAppId = sSocketAppId;
}
public static String getSocketAppId() {
return sSocketAppId;
}
}

View File

@@ -2,6 +2,7 @@ package com.mogo.commons.network;
import android.Manifest;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.telephony.CellLocation;
import android.telephony.TelephonyManager;
@@ -9,6 +10,10 @@ import android.telephony.cdma.CdmaCellLocation;
import android.telephony.gsm.GsmCellLocation;
import android.text.TextUtils;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.utils.storage.SharedPrefsMgr;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -61,11 +66,11 @@ public class Utils {
public static final String PROPERTIES = "android.os.SystemProperties";
public static String getSn() {
String sn = getSystemProperties( GSM_SERIAL );
if ( TextUtils.isEmpty( sn ) ) {
sn = getSystemProperties( BYD_SERIAL );
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE ) {
return SharedPrefsMgr.getInstance( AbsMogoApplication.getApp() ).getString( "allocated_sn" );
}
return sn;
return getSystemProperties( GSM_SERIAL );
}
public static String getFotaVersion() {