Merge branch 'dev' into dev_1.1.2

This commit is contained in:
董宏宇
2020-07-31 16:38:50 +08:00
89 changed files with 6186 additions and 331 deletions

View File

@@ -10,6 +10,7 @@ import com.mogo.service.passport.IMogoPassportManager;
import com.mogo.service.passport.IMogoTicketCallback;
import com.mogo.utils.logger.Logger;
import com.zhidao.account.sdk.AccountClientManager;
import com.zhidao.account.sdk.Environment;
import com.zhidao.account.sdk.callback.TicketInfoCallback;
import com.zhidao.account.sdk.network.NetEnvironManager;
@@ -27,13 +28,14 @@ class PassportManager implements IMogoPassportManager {
private static volatile PassportManager sInstance;
private PassportManager(){}
private PassportManager() {
}
@Keep
public static PassportManager getInstance(){
if( sInstance == null ){
synchronized( PassportManager.class ) {
if( sInstance == null ){
public static PassportManager getInstance() {
if ( sInstance == null ) {
synchronized ( PassportManager.class ) {
if ( sInstance == null ) {
sInstance = new PassportManager();
}
}
@@ -41,7 +43,7 @@ class PassportManager implements IMogoPassportManager {
return sInstance;
}
public synchronized void release(){
public synchronized void release() {
sInstance = null;
}
@@ -77,11 +79,25 @@ class PassportManager implements IMogoPassportManager {
@Override
public void init( Context context ) {
AccountClientManager.init( context.getApplicationContext(), getNetEnvironment(), NetEnvironManager.OS_2C, "os2.0-launcher" );
}
private Environment getNetEnvironment() {
int mode = DebugConfig.getNetMode();
if ( mode == DebugConfig.NET_MODE_DEMO ) {
// 演示环境用 qa 的
mode = DebugConfig.NET_MODE_QA;
}
AccountClientManager.init( context.getApplicationContext(), mode, NetEnvironManager.OS_2C, "os2.0-launcher" );
switch ( mode ) {
case DebugConfig.NET_MODE_DEV:
return Environment.dev;
case DebugConfig.NET_MODE_DEMO:
case DebugConfig.NET_MODE_QA:
return Environment.qa;
case DebugConfig.NET_MODE_RELEASE:
default:
return Environment.release;
}
}
}

View File

@@ -34,7 +34,7 @@ dependencies {
// 长链
implementation 'com.zhidao.socket:built-in-socket:1.0.15'
// passport
implementation 'com.zhidao.tcloginsdk:tclogin:1.1.0'
implementation 'com.zhidao.tcloginsdk:tclogin:1.1.3'
annotationProcessor 'com.elegant.spi:compiler:1.0.3'