feat(platform): 新增 TDT65 平台适配并优化无网络禁用app
This commit is contained in:
1 parent
dfd43a167b
commit
1d5d7c790a
8 files changed
+74
-9
No files matched your search
+25
-2
@@ -18,8 +18,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.aoleyun.sn"
|
||||
versionCode 253
|
||||
versionName "1.6.1022"
|
||||
versionCode 254
|
||||
versionName "1.6.1023"
|
||||
|
||||
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
|
||||
minSdkVersion 24
|
||||
@@ -343,9 +343,32 @@ android {
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
|
||||
TDT65 {
|
||||
storeFile file("keystore/G122J.p12")
|
||||
storePassword "123456"
|
||||
keyAlias "g122j"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
TDT65Debug.initWith(debug)
|
||||
TDT65Debug {
|
||||
buildConfigField "String", "platform", '"TDT65"'
|
||||
versionNameSuffix "_debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.TDT65
|
||||
}
|
||||
|
||||
TDT65Release.initWith(release)
|
||||
TDT65Release {
|
||||
buildConfigField "String", "platform", '"TDT65"'
|
||||
signingConfig signingConfigs.TDT65
|
||||
}
|
||||
|
||||
CrosshatchDebug.initWith(debug)
|
||||
CrosshatchDebug {
|
||||
buildConfigField "String", "platform", '"AOSP"'
|
||||
|
||||
@@ -67,7 +67,22 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
|
||||
public void getLockedState() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getLockedState(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getLockedState(getLifecycle(), new NetInterfaceManager.ObserverCallback() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse response) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getLockedState", "onComplete: ");
|
||||
|
||||
@@ -113,6 +113,10 @@ public class CommonConfig {
|
||||
public final static String AOLE_ACTION_USB_USB_MIDI = "aole_action_usb_usb_midi";
|
||||
|
||||
|
||||
/**
|
||||
* 工厂内置白名单应用列表,只读不改,开之后隔一段时间读取
|
||||
*/
|
||||
public final static String AOLE_FACTORY_APP = "aole_factory_app";
|
||||
/*是否允许应用安装*/
|
||||
public final static String AOLE_APP_ALLOW_INSTALL = "aole_app_allow_install";
|
||||
/*应用安装白名单*/
|
||||
|
||||
@@ -2130,7 +2130,7 @@ public class NetInterfaceManager {
|
||||
* @param lifecycle
|
||||
* @param callback
|
||||
*/
|
||||
public void getLockedState(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||
public void getLockedState(BehaviorSubject<ActivityEvent> lifecycle, ObserverCallback callback) {
|
||||
getDevicesLockedStateObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@@ -2202,6 +2202,7 @@ public class NetInterfaceManager {
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getLockedState", "onError: " + e.getMessage());
|
||||
// onComplete();
|
||||
callback.onError(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -395,10 +395,9 @@ public class MainService extends BaseService implements NetworkUtils.OnNetworkSt
|
||||
|
||||
// aliyunPushInit();
|
||||
|
||||
|
||||
// TODO: 2026/10/23 从30秒改为1小时
|
||||
Observable.create(killSubscribe)
|
||||
.throttleLast(30, TimeUnit.SECONDS)
|
||||
// .throttleLast(3, TimeUnit.SECONDS)
|
||||
.throttleLast(1, TimeUnit.HOURS)
|
||||
.subscribe(killObserver);
|
||||
|
||||
Observable.create(networkSubscribe)
|
||||
@@ -431,7 +430,6 @@ public class MainService extends BaseService implements NetworkUtils.OnNetworkSt
|
||||
}
|
||||
});
|
||||
|
||||
mMMKV.encode(CommonConfig.DEVICES_FRIST_START, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -560,6 +558,7 @@ public class MainService extends BaseService implements NetworkUtils.OnNetworkSt
|
||||
Log.e(TAG, "initOnBackground: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
mMMKV.encode(CommonConfig.DEVICES_FRIST_START, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,7 +74,22 @@ public class MainServiceModel extends ViewModel {
|
||||
}
|
||||
}
|
||||
NetInterfaceManager.getInstance()
|
||||
.getLockedState(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
.getLockedState(getLifecycle(), new NetInterfaceManager.ObserverCallback() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse response) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
getIconControl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getLockedState", "onComplete: ");
|
||||
|
||||
@@ -182,6 +182,7 @@ public class JgyUtils {
|
||||
public static final int DX11Platform = 31;
|
||||
public static final int G12NLPlatform = 32;
|
||||
public static final int G122JPlatform = 34;
|
||||
public static final int TDT65Platform = 35;
|
||||
|
||||
|
||||
public static final String Other = "其他";
|
||||
@@ -211,6 +212,7 @@ public class JgyUtils {
|
||||
public static final String DX11_TAG = "DX11";
|
||||
public static final String G12NL_TAG = "G12NL";
|
||||
public static final String G122J_TAG = "G122J";
|
||||
public static final String TDT65_TAG = "TDT65";
|
||||
|
||||
|
||||
private CacheHelper cacheHelper;
|
||||
@@ -379,6 +381,9 @@ public class JgyUtils {
|
||||
} else if (G122J_TAG.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "G122J");
|
||||
return G122JPlatform;
|
||||
} else if (TDT65_TAG.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "TDT65");
|
||||
return TDT65Platform;
|
||||
} else {
|
||||
Log.i(TAG, "checkAppPlatform: " + "没有数据");
|
||||
return UnknowPlatform;
|
||||
@@ -453,6 +458,8 @@ public class JgyUtils {
|
||||
getAppPlatformCallback.AppPlatform(DX11Platform);
|
||||
} else if (G122J_TAG.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(G122JPlatform);
|
||||
} else if (TDT65_TAG.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(TDT65Platform);
|
||||
} else {
|
||||
getAppPlatformCallback.AppPlatform(UnknowPlatform);
|
||||
}
|
||||
|
||||
@@ -1847,6 +1847,7 @@ public class Utils {
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.DX11Platform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G12NLPlatform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G122JPlatform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.TDT65Platform
|
||||
) {
|
||||
return Utils.getProperty("ro.build.display.id", "获取失败");
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user