2026-04-13 19:34:58 +08:00
|
|
|
package com.nova.brain.glass;
|
2026-04-13 16:37:34 +08:00
|
|
|
|
2026-04-14 13:58:04 +08:00
|
|
|
import com.blankj.utilcode.util.Utils;
|
2026-04-16 22:25:23 +08:00
|
|
|
import com.nova.brain.glass.helper.AsrHelper;
|
2026-04-14 13:58:04 +08:00
|
|
|
import com.nova.brain.glass.helper.OfflineCmdServiceHelper;
|
2026-04-14 12:49:14 +08:00
|
|
|
import com.nova.brain.glass.repository.HeaderInterceptor;
|
2026-04-14 13:58:04 +08:00
|
|
|
import com.rokid.security.glass3.open.sdk.GlassSdk;
|
|
|
|
|
import com.rokid.security.glass3.open.sdk.client.IServiceConnectionCallback;
|
2026-04-13 16:37:34 +08:00
|
|
|
import com.xuqm.base.App;
|
2026-04-16 17:55:38 +08:00
|
|
|
import com.xuqm.base.di.component.AppComponent;
|
2026-04-13 16:37:34 +08:00
|
|
|
import com.xuqm.base.di.manager.HttpManager;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author xuqm
|
|
|
|
|
*/
|
|
|
|
|
public class MyApplication extends App {
|
|
|
|
|
|
2026-04-18 12:09:21 +08:00
|
|
|
// public static String baseUrl = "http://22fs132201.imwork.net";
|
|
|
|
|
public static String baseUrl = "http://192.168.6.20";
|
2026-04-18 11:04:37 +08:00
|
|
|
|
|
|
|
|
public static AppComponent appComponent1;
|
2026-04-13 16:37:34 +08:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onCreate() {
|
|
|
|
|
super.onCreate();
|
|
|
|
|
appComponent = HttpManager.getAppComponent(baseUrl, new HeaderInterceptor(getApplicationContext()));
|
2026-04-18 12:09:21 +08:00
|
|
|
// appComponent1 = HttpManager.getAppComponent("https://22v1322u01.vicp.fun", new HeaderInterceptor(getApplicationContext()));
|
|
|
|
|
appComponent1 = HttpManager.getAppComponent("http://192.168.6.20:12119", new HeaderInterceptor(getApplicationContext()));
|
2026-04-13 16:37:34 +08:00
|
|
|
|
2026-04-14 13:58:04 +08:00
|
|
|
initSdk();
|
2026-04-14 12:49:14 +08:00
|
|
|
|
2026-04-13 16:37:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean showLog() {
|
|
|
|
|
return super.showLog();
|
|
|
|
|
}
|
2026-04-14 13:58:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
void initSdk() {
|
|
|
|
|
// 如果SDK已经初始化了,则直接返回
|
|
|
|
|
if (GlassSdk.isReady()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
GlassSdk.bindSecurityService(Utils.getApp(), new IServiceConnectionCallback() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onServiceConnected() {
|
|
|
|
|
OfflineCmdServiceHelper.INSTANCE.init();
|
2026-04-16 22:25:23 +08:00
|
|
|
AsrHelper.INSTANCE.init();
|
2026-04-14 13:58:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onServiceDisconnected() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onBindingDied() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-13 16:37:34 +08:00
|
|
|
}
|