1.4.0521 优化开机动画 控制主页控件显示
This commit is contained in:
@@ -29,8 +29,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.aoleyun.sn"
|
||||
versionCode 130
|
||||
versionName "1.4.0515"
|
||||
versionCode 133
|
||||
versionName "1.4.0521"
|
||||
|
||||
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
|
||||
minSdkVersion 24
|
||||
@@ -379,13 +379,13 @@ android {
|
||||
debuggable true
|
||||
versionNameSuffix "-debug"
|
||||
signingConfig signingConfigs.zhanRui
|
||||
buildConfigField "String", "platform", '"ZhanRuiCube"'
|
||||
buildConfigField "String", "platform", '"展锐"'
|
||||
}
|
||||
|
||||
zhanRuiRelease.initWith(release)
|
||||
zhanRuiRelease {
|
||||
signingConfig signingConfigs.zhanRui
|
||||
buildConfigField "String", "platform", '"ZhanRuiCube"'
|
||||
buildConfigField "String", "platform", '"展锐"'
|
||||
}
|
||||
|
||||
//userdebug rom使用这个版本
|
||||
@@ -394,14 +394,14 @@ android {
|
||||
debuggable true
|
||||
versionNameSuffix "-debug"
|
||||
signingConfig signingConfigs.zhanRuiUserdebug
|
||||
buildConfigField "String", "platform", '"ZhanRuiCube"'
|
||||
buildConfigField "String", "platform", '"展锐"'
|
||||
}
|
||||
|
||||
zhanRuiUserdebugReleas.initWith(release)
|
||||
zhanRuiUserdebugReleas {
|
||||
debuggable true
|
||||
signingConfig signingConfigs.zhanRuiUserdebug
|
||||
buildConfigField "String", "platform", '"ZhanRuiCube"'
|
||||
buildConfigField "String", "platform", '"展锐"'
|
||||
}
|
||||
|
||||
zhanRui12Debug.initWith(debug)
|
||||
@@ -491,10 +491,15 @@ dependencies {
|
||||
implementation 'com.squareup.moshi:moshi:1.9.3'
|
||||
//OkHttp
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.8.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
|
||||
//Retrofit
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'
|
||||
implementation 'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
|
||||
// gson converter
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||
// 标准转换器,去掉 Retrofit以Mutipart上传参数时,String参数会多一对双引号
|
||||
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||
//RxJava
|
||||
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
|
||||
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
|
||||
@@ -504,6 +509,8 @@ dependencies {
|
||||
implementation 'com.trello.rxlifecycle4:rxlifecycle-components:4.0.2'
|
||||
implementation 'com.trello.rxlifecycle4:rxlifecycle-components-preference:4.0.2'
|
||||
implementation 'com.trello.rxlifecycle4:rxlifecycle-android-lifecycle:4.0.2'
|
||||
implementation 'com.jakewharton.rxbinding4:rxbinding:4.0.0'
|
||||
implementation 'com.jeremyliao:live-event-bus-x:1.7.3'
|
||||
|
||||
//implementation "com.uber.autodispose:autodispose:1.3.0"
|
||||
//implementation "com.uber.autodispose:autodispose-android-archcomponents:1.3.0"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.8 KiB |
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="app_name">我的设备测试</string>
|
||||
</resources>
|
||||
@@ -1,397 +0,0 @@
|
||||
package com.aoleyun.sn.activity.checknet;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.base.mvp.BaseMvpActivity;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.SysSettingUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
public class CheckNetActivity extends BaseMvpActivity implements CheckNetContact.MainView, NetworkUtils.OnNetworkStatusChangedListener {
|
||||
private static final String TAG = CheckNetActivity.class.getSimpleName();
|
||||
|
||||
@BindView(R.id.giv_1)
|
||||
GifImageView giv_1;
|
||||
@BindView(R.id.giv_2)
|
||||
GifImageView giv_2;
|
||||
@BindView(R.id.giv_3)
|
||||
GifImageView giv_3;
|
||||
@BindView(R.id.tv_1)
|
||||
TextView tv_1;
|
||||
@BindView(R.id.tv_2)
|
||||
TextView tv_2;
|
||||
@BindView(R.id.tv_3)
|
||||
TextView tv_3;
|
||||
@BindView(R.id.bt_confirm)
|
||||
Button bt_confirm;
|
||||
|
||||
private CheckNetPresenter mCheckNetPresenter;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
@Override
|
||||
public void onDisconnected() {
|
||||
Log.e("OnNetworkStatusChanged", "onDisconnected: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnected(NetworkUtils.NetworkType networkType) {
|
||||
Log.e("OnNetworkStatusChanged", "onConnected: ");
|
||||
giv_1.setBackgroundResource(R.drawable.successful);
|
||||
//直接获取数据
|
||||
mCheckNetPresenter.getLockedState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId() {
|
||||
return R.layout.activity_checknet;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean setNightMode() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean setfitWindow() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
ButterKnife.bind(this);
|
||||
mCheckNetPresenter = new CheckNetPresenter(this);
|
||||
mCheckNetPresenter.attachView(this);
|
||||
mCheckNetPresenter.setProvider(this);
|
||||
mCheckNetPresenter.setLifecycle(getLifecycleSubject());
|
||||
JGYUtils.startServices(CheckNetActivity.this);
|
||||
Log.e(TAG, "initView: " + "start request");
|
||||
NetworkUtils.registerNetworkStatusChangedListener(this);
|
||||
checkNetworkIsAvailable(new NetworkInfo() {
|
||||
@Override
|
||||
public void isAvailable(boolean available) {
|
||||
runOnUiThread(() -> {
|
||||
if (available) {
|
||||
giv_1.setBackgroundResource(R.drawable.successful);
|
||||
mCheckNetPresenter.getLockedState();
|
||||
} else {
|
||||
giv_1.setBackgroundResource(R.drawable.failed);
|
||||
giv_2.setBackgroundResource(R.drawable.failed);
|
||||
giv_3.setBackgroundResource(R.drawable.failed);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
bt_confirm.setOnClickListener(view -> finish());
|
||||
mCheckNetPresenter.getFirstConnect();
|
||||
}
|
||||
|
||||
interface NetworkInfo {
|
||||
void isAvailable(boolean available);
|
||||
}
|
||||
|
||||
private Disposable mDisposable;
|
||||
|
||||
private void checkNetworkIsAvailable(NetworkInfo networkInfo) {
|
||||
/**
|
||||
* start: 开始数值
|
||||
* count: 输出值的个数
|
||||
* initialDelay: 延迟多少秒执行
|
||||
* period: 间隔多久执行一次
|
||||
* TimeUnit: 单位设置,NANOSECONDS(纳秒),MICROSECONDS(微秒),MILLISECONDS(毫秒),SECONDS(秒),MINUTES(分钟),HOURS(小时),DAYS(天)
|
||||
*/
|
||||
Observable.intervalRange(1, 10, 0, 1500, TimeUnit.MILLISECONDS)
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(new Observer<Long>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
mDisposable = d;
|
||||
Log.e("checkNetworkIsAvailable", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull Long aLong) {
|
||||
Log.e("checkNetworkIsAvailable", "onNext: " + "第" + aLong + "次检测网络");
|
||||
if (NetworkUtils.isAvailable()) {
|
||||
Log.e("checkNetworkIsAvailable", "onNext: " + "网络连接成功");
|
||||
networkInfo.isAvailable(true);
|
||||
if (mDisposable != null && !mDisposable.isDisposed()) {
|
||||
mDisposable.dispose();
|
||||
}
|
||||
} else {
|
||||
Log.e("checkNetworkIsAvailable", "onNext: " + "网络无连接");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("checkNetworkIsAvailable", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
networkInfo.isAvailable(NetworkUtils.isAvailable());
|
||||
Log.e("checkNetworkIsAvailable", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
Log.e("getMacAddress", Utils.getAndroid10MAC(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* 首次使用默认关闭所有功能
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
@Override
|
||||
public void setFirstConnect(boolean state) {
|
||||
Log.e(TAG, "isFirstConnect: " + "end request ");
|
||||
Log.e(TAG, "setFirstConnect: " + state);
|
||||
if (state) {
|
||||
mCheckNetPresenter.setDisableSetting();
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void sendMACFinish() {
|
||||
mCheckNetPresenter.updateDeviceInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceInfoFinish() {
|
||||
mCheckNetPresenter.getSnTimeControl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSnTimeControlFinish() {
|
||||
mCheckNetPresenter.getEBagCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getEBagCodeFinish() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushPlatformTagsFinish() {
|
||||
mCheckNetPresenter.checkAoleyunUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkAoleyunUpdateFinish() {
|
||||
mCheckNetPresenter.checkTestUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkTestUpdateFinish() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param loocked 后台1是锁定,底层0是锁定
|
||||
*/
|
||||
@Override
|
||||
public void setLockedState(boolean loocked) {
|
||||
Log.e(TAG, "setLockedState: " + loocked);
|
||||
//发送设备mac地址和信息
|
||||
mCheckNetPresenter.sendMACAddress();
|
||||
if (loocked) {
|
||||
//获取系统管控
|
||||
mCheckNetPresenter.setPushTags();
|
||||
} else {
|
||||
SysSettingUtils.setEnableSetting(this);
|
||||
giv_2.setBackgroundResource(R.drawable.successful);
|
||||
giv_3.setBackgroundResource(R.drawable.successful);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param noTag 为空,没有,错误都返回true
|
||||
* 设备可以没有批次,但是没有批次相当于没有数据了,就不执行下面的请求了
|
||||
*/
|
||||
@Override
|
||||
public void setTagsFinish(boolean noTag) {
|
||||
if (mCheckNetPresenter.isRequestSuccessful()) {
|
||||
Log.e(TAG, "setTagsFinish: " + mCheckNetPresenter.isRequestSuccessful());
|
||||
giv_2.setBackgroundResource(R.drawable.successful);
|
||||
} else {
|
||||
giv_2.setBackgroundResource(R.drawable.failed);
|
||||
}
|
||||
if (noTag) {
|
||||
Log.e(TAG, "setTagsFinished: " + "not set tag");
|
||||
} else {
|
||||
mCheckNetPresenter.getSystemSettingbegin();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSystemSettingbegin() {
|
||||
mCheckNetPresenter.getAppLimit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppLimitFinish() {
|
||||
mCheckNetPresenter.getAllAppList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAllAppListFinish() {
|
||||
mCheckNetPresenter.getDeviceBatch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDeviceBatchFinish() {
|
||||
mCheckNetPresenter.getForceDownload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getForceDownloadFinish() {
|
||||
mCheckNetPresenter.getBrowserList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBrowserListFinish(String whitelist) {
|
||||
mCheckNetPresenter.getBrowserBookmarks(whitelist);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBrowserBookmarksFinish() {
|
||||
mCheckNetPresenter.getBrowserWhiteList();
|
||||
mCheckNetPresenter.getDesktopIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDesktopIconFinish() {
|
||||
mCheckNetPresenter.getAppAutoStartUpdateAndNet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppAutoStartUpdateAndNetFinish() {
|
||||
mCheckNetPresenter.getSnAppAttr();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSnAppAttrFinish() {
|
||||
mCheckNetPresenter.getAppIDControl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppIDControlFinish() {
|
||||
mCheckNetPresenter.setAppinsideWeb();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAppinsideWebFinish() {
|
||||
mCheckNetPresenter.setSystemSetting();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSystemSettingFinish() {
|
||||
mCheckNetPresenter.getDefaultApp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultAppFinish() {
|
||||
mCheckNetPresenter.getROMApp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getROMAppFinish() {
|
||||
mCheckNetPresenter.getDeveloper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDeveloperFinish() {
|
||||
mCheckNetPresenter.setLogoImg();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogoImgFinish() {
|
||||
mCheckNetPresenter.setTopApp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTopAppFinish() {
|
||||
mCheckNetPresenter.getDefaultDesktop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultDesktopFinish() {
|
||||
if (mCheckNetPresenter.isRequestSuccessful()) {
|
||||
giv_3.setBackgroundResource(R.drawable.successful);
|
||||
} else {
|
||||
giv_3.setBackgroundResource(R.drawable.failed);
|
||||
}
|
||||
mMMKV.encode(CommonConfig.DEVICES_FRIST_START, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPoweroffTime() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWiFiPasswd() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScreenLockStateFinish(boolean locked, String tips) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mCheckNetPresenter.detachView();
|
||||
JGYUtils.startServices(CheckNetActivity.this);
|
||||
NetworkUtils.unregisterNetworkStatusChangedListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||
lazyExit();
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
private long mPreClickTime;
|
||||
|
||||
private void lazyExit() {
|
||||
if (System.currentTimeMillis() - mPreClickTime > 3000) {
|
||||
Toaster.show("再按一次,退出");
|
||||
mPreClickTime = System.currentTimeMillis();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,160 +0,0 @@
|
||||
package com.aoleyun.sn.activity.checknet;
|
||||
|
||||
import com.aoleyun.sn.base.mvp.BasePresenter;
|
||||
import com.aoleyun.sn.base.mvp.BaseView;
|
||||
|
||||
public class CheckNetContact {
|
||||
public interface Presenter extends BasePresenter<MainView> {
|
||||
//1.是否第一次联网
|
||||
void getFirstConnect();
|
||||
//1.关闭所有功能
|
||||
void setDisableSetting();
|
||||
|
||||
//发送mac地址
|
||||
void sendMACAddress();
|
||||
//更新设备信息
|
||||
void updateDeviceInfo();
|
||||
//获取时间管控
|
||||
void getSnTimeControl();
|
||||
//获取电子书包激活码
|
||||
void getEBagCode();
|
||||
//设置极光推送平台标签
|
||||
void setPushPlatformTags(int platform);
|
||||
|
||||
//获取设备信息更新
|
||||
void checkAoleyunUpdate();
|
||||
|
||||
//获取测试应用更新
|
||||
void checkTestUpdate();
|
||||
|
||||
//开始
|
||||
//2.获取设备锁定状态
|
||||
void getLockedState();
|
||||
//设置极光推送标签
|
||||
void setPushTags();
|
||||
//获取开发者选项
|
||||
void getDeveloper();
|
||||
//获取设备后台设置
|
||||
void getSystemSettingbegin();
|
||||
//获取可被写入的安装包名
|
||||
void getAppLimit();
|
||||
/*获取所有app详细信息*/
|
||||
void getAllAppList();
|
||||
//获取设备批次
|
||||
void getDeviceBatch();
|
||||
//获取强制下载apk
|
||||
void getForceDownload();
|
||||
//获取浏览器上网管控设置
|
||||
void getBrowserList();
|
||||
//获取浏览器书签设置管控
|
||||
void getBrowserBookmarks(String whitelist);
|
||||
//设置白名单的url
|
||||
void getBrowserWhiteList();
|
||||
//获取应用图标桌面可见性管控
|
||||
void getDesktopIcon();
|
||||
//获取应用自启升级和网络权限管理
|
||||
void getAppAutoStartUpdateAndNet();
|
||||
/*获取禁用app*/
|
||||
void getSnAppAttr();
|
||||
//获取第三方应用子页面ID连网限制
|
||||
void getAppIDControl();
|
||||
//获取第三方应用内部网页跳转屏蔽
|
||||
void setAppinsideWeb();
|
||||
//获取系统其他管控设置
|
||||
void setSystemSetting();
|
||||
//获取系统默认程序设置
|
||||
void getDefaultApp();
|
||||
//获取自定义版本内置app
|
||||
void getROMApp();
|
||||
//设置开机动画
|
||||
void setLogoImg();
|
||||
//应用霸屏
|
||||
void setTopApp();
|
||||
//获取桌面
|
||||
void getDefaultDesktop();
|
||||
//获取关机时间
|
||||
void getPoweroffTime();
|
||||
//获取wifi密码
|
||||
void getWiFiPasswd();
|
||||
/*
|
||||
* MainService
|
||||
* */
|
||||
//获取屏幕锁状态
|
||||
void getScreenLockState();
|
||||
}
|
||||
|
||||
public interface MainView extends BaseView {
|
||||
//1.是否第一次联网
|
||||
void setFirstConnect(boolean state);
|
||||
|
||||
//发送mac地址
|
||||
void sendMACFinish();
|
||||
//更新设备信息
|
||||
void updateDeviceInfoFinish();
|
||||
//获取时间管控
|
||||
void getSnTimeControlFinish();
|
||||
//获取电子书包激活码
|
||||
void getEBagCodeFinish();
|
||||
//设置极光推送平台标签
|
||||
void setPushPlatformTagsFinish();
|
||||
|
||||
//获取设备信息更新
|
||||
void checkAoleyunUpdateFinish();
|
||||
|
||||
//获取测试应用更新
|
||||
void checkTestUpdateFinish();
|
||||
//开始
|
||||
//2.获取设备锁定状态
|
||||
void setLockedState(boolean loocked);
|
||||
//设置极光推送标签
|
||||
void setTagsFinish(boolean noTag);
|
||||
//获取开发者选项结束
|
||||
void getDeveloperFinish();
|
||||
//设置设备后台设置
|
||||
void getSystemSettingbegin();
|
||||
//获取可被写入的安装包名结束
|
||||
void getAppLimitFinish();
|
||||
/*获取所有app详细信息*/
|
||||
void getAllAppListFinish();
|
||||
//获取设备批次结束
|
||||
void getDeviceBatchFinish();
|
||||
//获取强制下载apk结束
|
||||
void getForceDownloadFinish();
|
||||
//获取浏览器上网管控设置结束
|
||||
void getBrowserListFinish(String whitelist);
|
||||
//获取浏览器书签设置管控结束
|
||||
void getBrowserBookmarksFinish();
|
||||
//获取应用图标桌面可见性管控结束
|
||||
void getDesktopIconFinish();
|
||||
//获取应用自启升级和网络权限管理结束
|
||||
void getAppAutoStartUpdateAndNetFinish();
|
||||
/*获取禁用app*/
|
||||
void getSnAppAttrFinish();
|
||||
//获取第三方应用子页面ID连网限制结束
|
||||
void getAppIDControlFinish();
|
||||
//获取第三方应用内部网页跳转屏蔽结束
|
||||
void setAppinsideWebFinish();
|
||||
//获取系统其他管控设置结束
|
||||
void setSystemSettingFinish();
|
||||
//获取系统默认程序设置
|
||||
void setDefaultAppFinish();
|
||||
//获取自定义版本内置app
|
||||
void getROMAppFinish();
|
||||
|
||||
//设置开机动画
|
||||
void setLogoImgFinish();
|
||||
//获取应用霸屏结束
|
||||
void setTopAppFinish();
|
||||
//获取桌面结束
|
||||
void getDefaultDesktopFinish();
|
||||
//获取关机时间
|
||||
void setPoweroffTime();
|
||||
//获取wifi密码结束
|
||||
void setWiFiPasswd();
|
||||
/*
|
||||
* MainService
|
||||
* */
|
||||
//设置屏幕锁状态结束
|
||||
void setScreenLockStateFinish(boolean locked, String tips);
|
||||
}
|
||||
}
|
||||
@@ -1,455 +0,0 @@
|
||||
package com.aoleyun.sn.activity.checknet;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.SysSettingUtils;
|
||||
import com.aoleyun.sn.utils.URLUtils;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.trello.rxlifecycle4.LifecycleProvider;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
|
||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
|
||||
/**
|
||||
* @author jgy
|
||||
*/
|
||||
public class CheckNetPresenter implements CheckNetContact.Presenter {
|
||||
private static final String TAG = CheckNetPresenter.class.getSimpleName();
|
||||
private CheckNetContact.MainView mView;
|
||||
private Context mContext;
|
||||
private ContentResolver crv;
|
||||
private NetInterfaceManager mNetInterfaceManager;
|
||||
|
||||
//是否有接口请求成功
|
||||
public boolean requestSucceeded = true;
|
||||
|
||||
private LifecycleProvider<ActivityEvent> provider;
|
||||
|
||||
public void setProvider(LifecycleProvider<ActivityEvent> provider) {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
public LifecycleProvider<ActivityEvent> getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
private BehaviorSubject<ActivityEvent> lifecycle;
|
||||
|
||||
public void setLifecycle(BehaviorSubject<ActivityEvent> lifecycle) {
|
||||
this.lifecycle = lifecycle;
|
||||
}
|
||||
|
||||
public BehaviorSubject<ActivityEvent> getLifecycle() {
|
||||
return lifecycle;
|
||||
}
|
||||
|
||||
public CheckNetPresenter(Context context) {
|
||||
this.mContext = context;
|
||||
this.crv = mContext.getContentResolver();
|
||||
this.mNetInterfaceManager = NetInterfaceManager.getInstance();
|
||||
Log.e(TAG, "MainPresenter: " + context.getClass());
|
||||
}
|
||||
|
||||
public boolean isRequestSuccessful() {
|
||||
Log.e(TAG, "isRequestSuccessful: " + requestSucceeded);
|
||||
return requestSucceeded;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attachView(@androidx.annotation.NonNull CheckNetContact.MainView view) {
|
||||
this.mView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detachView() {
|
||||
this.mView = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 第一次连接
|
||||
*/
|
||||
@Override
|
||||
public void getFirstConnect() {
|
||||
int first = (int) SPUtils.get(mContext, CommonConfig.JGY_FIRST_CONNECT, 0);
|
||||
Log.e(TAG, "getFirstConnect: " + "first_connect = " + first);
|
||||
mView.setFirstConnect(first == 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDisableSetting() {
|
||||
Log.e(TAG, "setDisableSetting: ");
|
||||
//设置系统管控
|
||||
SysSettingUtils.setDisableSetting(mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMACAddress() {
|
||||
mNetInterfaceManager.sendMACAddress(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.sendMACFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceInfo() {
|
||||
if (JGYUtils.isOfficialVersion()) {
|
||||
mView.updateDeviceInfoFinish();
|
||||
} else {
|
||||
mNetInterfaceManager.updateDeviceInfo(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.updateDeviceInfoFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getSnTimeControl() {
|
||||
if (JGYUtils.isOfficialVersion()) {
|
||||
mView.getSnTimeControlFinish();
|
||||
} else {
|
||||
mNetInterfaceManager.getSnTimeControl(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSnTimeControlFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getEBagCode() {
|
||||
mNetInterfaceManager.getEBagCode(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getEBagCodeFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getLockedState() {
|
||||
mNetInterfaceManager.getLockedState(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getLockedState", "onComplete: ");
|
||||
int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
|
||||
Log.e("getLockedState", "locked: " + locked);
|
||||
mView.setLockedState(locked == JGYActions.FRAME_CODE_LOCKED);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushTags() {
|
||||
mNetInterfaceManager.setPushTags(true, getLifecycle(), new NetInterfaceManager.PushTagCallback() {
|
||||
@Override
|
||||
public void setPushTag(String tag) {
|
||||
Log.e("setPushTags", "onComplete: ");
|
||||
mView.setTagsFinish(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPushPlatformTags(int platform) {
|
||||
mView.setPushPlatformTagsFinish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkAoleyunUpdate() {
|
||||
mNetInterfaceManager.checkAoleyunUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.checkAoleyunUpdateFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取灰度测试更新
|
||||
*/
|
||||
@Override
|
||||
public void checkTestUpdate() {
|
||||
mNetInterfaceManager.checkTestUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.checkTestUpdateFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getSystemSettingbegin() {
|
||||
//重置设备
|
||||
JGYUtils.getInstance().resetDevice();
|
||||
mView.getSystemSettingbegin();
|
||||
Toaster.debugShow("开始获取管控");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppLimit() {
|
||||
mNetInterfaceManager.getAppLimit(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAppLimitFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAllAppList() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAllAppList(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAllAppListFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDeviceBatch() {
|
||||
int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||
Log.e(TAG, "getDeviceBatch: " + locked);
|
||||
if (locked == 0) {
|
||||
// JGYUtils.getInstance().deleteOtherApp();
|
||||
mView.getDeviceBatchFinish();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getForceDownload() {
|
||||
mNetInterfaceManager.getForceDownload(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getForceDownloadFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: 2021/6/8 使用现有代码会影响浏览器主页管控
|
||||
// @Override
|
||||
// public void getBrowserList() {
|
||||
//// if (JGYUtils.isOfficialVersion()) {
|
||||
// SetBrowserList();
|
||||
//// } else {
|
||||
//// NewSetBrowserList();
|
||||
//// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void getBrowserList() {
|
||||
Log.e(TAG, "getBrowserList: ");
|
||||
mView.getBrowserListFinish("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBrowserBookmarks(String whitelist) {
|
||||
mNetInterfaceManager.getBookMarkBlackWhiteList(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getBrowserBookmarksFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBrowserWhiteList() {
|
||||
new URLUtils(mContext).setBrowserBlackList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDesktopIcon() {
|
||||
mNetInterfaceManager.getDesktopIcon(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
// JGYUtils.getInstance().hideSystemAPP();
|
||||
mView.getDesktopIconFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppAutoStartUpdateAndNet() {
|
||||
mNetInterfaceManager.getAppAutoStartUpdateAndNet(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAppAutoStartUpdateAndNetFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSnAppAttr() {
|
||||
mNetInterfaceManager.getSnAppAttr(new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getSnAppAttrFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getAppIDControl() {
|
||||
mNetInterfaceManager.getAppIDControl(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getAppIDControlFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAppinsideWeb() {
|
||||
Log.e(TAG, "setAppinsideWeb: ");
|
||||
mNetInterfaceManager.getAppinsideWeb(new NetInterfaceManager.GetAppinsideWebCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e(TAG, "setAppinsideWeb: " + "onComplete");
|
||||
if (mView != null) {
|
||||
mView.setAppinsideWebFinish();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setSystemSetting() {
|
||||
mNetInterfaceManager.setSystemSetting(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setSystemSettingFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultApp() {
|
||||
mNetInterfaceManager.getDefaultApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setDefaultAppFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getROMApp() {
|
||||
mNetInterfaceManager.getCustomROMApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getROMAppFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDeveloper() {
|
||||
mNetInterfaceManager.getDeveloper(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getDeveloperFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogoImg() {
|
||||
if (JGYUtils.isOfficialVersion()) {
|
||||
mView.setLogoImgFinish();
|
||||
} else {
|
||||
mNetInterfaceManager.setLogoImg(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setLogoImgFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTopApp() {
|
||||
if (JGYUtils.isOfficialVersion()) {
|
||||
mView.setTopAppFinish();
|
||||
|
||||
} else {
|
||||
mNetInterfaceManager.getTopApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setTopAppFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
synchronized public void getScreenLockState() {
|
||||
mNetInterfaceManager.getScreenLockState(true, getLifecycle(), new NetInterfaceManager.ScreenLockStateListener() {
|
||||
@Override
|
||||
public void setScreenLockState(boolean locked, String tips) {
|
||||
mView.setScreenLockStateFinish(locked, tips);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultDesktop() {
|
||||
Log.e(TAG, "getDefaultDesktop: ");
|
||||
if (JGYUtils.isOfficialVersion() || JGYUtils.getInstance().getDeviceIsLocked()) {
|
||||
mNetInterfaceManager.getAppLimit(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
mView.getDefaultDesktopFinish();
|
||||
} else {
|
||||
int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
|
||||
if (JGYUtils.getInstance().isAihuaFramwwork() && aihuaUnlock == 1) {
|
||||
mView.getDefaultDesktopFinish();
|
||||
} else {
|
||||
mNetInterfaceManager.getDefaultDesktop(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getDefaultDesktopFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getPoweroffTime() {
|
||||
mNetInterfaceManager.getPoweroffTime(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setPoweroffTime();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWiFiPasswd() {
|
||||
mNetInterfaceManager.getWiFiPasswd(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setWiFiPasswd();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.aoleyun.sn.activity.main;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.view.View;
|
||||
|
||||
import com.aoleyun.sn.base.mvp.BasePresenter;
|
||||
import com.aoleyun.sn.base.mvp.BaseView;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
public class MainAContact {
|
||||
public interface Presenter extends BasePresenter<MainView> {
|
||||
/*获取设备锁定状态*/
|
||||
void getLockedState();
|
||||
/*获取学生信息*/
|
||||
void getStudesInfo();
|
||||
/*获取电子书包激活码*/
|
||||
void getEBagCode();
|
||||
/*获取学习应用*/
|
||||
void getExclusiveAdminApp();
|
||||
/*获取公网ip*/
|
||||
void getPublicIp();
|
||||
/*手动获取设备信息更新*/
|
||||
void buttonCheckUpdate(View view);
|
||||
/*获取设备信息更新*/
|
||||
void checkAoleyunUpdate();
|
||||
/*获取测试应用更新*/
|
||||
void checkTestUpdate();
|
||||
/*获取桌面*/
|
||||
void getDefaultDesktop();
|
||||
/*获取系统默认程序设置*/
|
||||
void getDefaultApp();
|
||||
}
|
||||
|
||||
public interface MainView extends BaseView {
|
||||
/*获取设备锁定状态*/
|
||||
void setLockedState(boolean loocked);
|
||||
/*获取学生信息*/
|
||||
void setStudesInfo(StudentsInfo studesInfo);
|
||||
/*获取电子书包激活码*/
|
||||
void getEBagCodeFinish(boolean activation);
|
||||
/*获取学习应用*/
|
||||
void getExclusiveAdminAppFinish();
|
||||
/*获取公网ip*/
|
||||
void setPublicIp(String ip);
|
||||
/*手动获取设备信息更新*/
|
||||
void buttonCheckUpdateFinish(boolean update, JsonObject jsonObject);
|
||||
/*获取设备信息更新*/
|
||||
void checkAoleyunUpdateFinish();
|
||||
/*获取测试应用更新*/
|
||||
void checkTestUpdateFinish();
|
||||
/*获取桌面结束*/
|
||||
void getDefaultDesktopFinish();
|
||||
/*获取系统默认程序设置*/
|
||||
void setDefaultAppFinish();
|
||||
}
|
||||
}
|
||||
@@ -1,273 +0,0 @@
|
||||
package com.aoleyun.sn.activity.main;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.bean.AdminAppInfo;
|
||||
import com.aoleyun.sn.bean.AppUpdateInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.utils.AES.CXAESUtil;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
||||
|
||||
/**
|
||||
* MainActivity1 的 Presenter
|
||||
*
|
||||
* @author jgy
|
||||
*/
|
||||
public class MainAPresenter implements MainAContact.Presenter {
|
||||
private static final String TAG = MainAPresenter.class.getSimpleName();
|
||||
private MainAContact.MainView mView;
|
||||
private Context mContext;
|
||||
|
||||
private final int OK = 200;
|
||||
|
||||
private BehaviorSubject<ActivityEvent> lifecycle;
|
||||
|
||||
public void setLifecycle(BehaviorSubject<ActivityEvent> lifecycle) {
|
||||
this.lifecycle = lifecycle;
|
||||
}
|
||||
|
||||
public BehaviorSubject<ActivityEvent> getLifecycle() {
|
||||
return lifecycle;
|
||||
}
|
||||
|
||||
public MainAPresenter(Context context) {
|
||||
this.mContext = context;
|
||||
Log.e(TAG, "MainSPresenter: " + context.getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attachView(@androidx.annotation.NonNull MainAContact.MainView view) {
|
||||
this.mView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detachView() {
|
||||
this.mView = null;
|
||||
this.mContext = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getLockedState() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getLockedState(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getLockedState", "onComplete: ");
|
||||
int locked = Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
|
||||
Log.e("getLockedState", "locked: " + locked);
|
||||
mView.setLockedState(locked == JGYActions.FRAME_CODE_LOCKED);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过sn获取用户信息
|
||||
*/
|
||||
@Override
|
||||
public void getStudesInfo() {
|
||||
NetInterfaceManager.getInstance().getStudesInfo(true, getLifecycle(), new NetInterfaceManager.StudesInfoListener() {
|
||||
@Override
|
||||
public void setStudentsInfo(StudentsInfo studentsInfo) {
|
||||
mView.setStudesInfo(studentsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getEBagCode() {
|
||||
NetInterfaceManager.getInstance().getEBagCode(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getEBagCodeFinish(Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0) == 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getExclusiveAdminApp() {
|
||||
NetInterfaceManager.getInstance().getExclusiveAdminAppObservable()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<AdminAppInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAdminApp", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<AdminAppInfo>> listBaseResponse) {
|
||||
Log.e("getAdminApp", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
List<AdminAppInfo> adminAppInfos = listBaseResponse.data;
|
||||
JGYUtils.getInstance().installAdminApp(adminAppInfos);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAdminApp", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAdminApp", "onComplete: ");
|
||||
mView.getExclusiveAdminAppFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getPublicIp() {
|
||||
NetInterfaceManager.getInstance().getPublicIp(lifecycle, ip -> mView.setPublicIp(ip));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buttonCheckUpdate(View view) {
|
||||
checkUpdateInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkAoleyunUpdate() {
|
||||
checkUpdateInfo();
|
||||
NetInterfaceManager.getInstance()
|
||||
.checkAoleyunUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.checkAoleyunUpdateFinish();
|
||||
}
|
||||
});
|
||||
// mView.checkAoleyunUpdateFinish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkTestUpdate() {
|
||||
if (!JGYUtils.getInstance().tagEmpty()) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.checkTestUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.checkTestUpdateFinish();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Log.e(TAG, "checkTestUpdate: tag is Empty");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultDesktop() {
|
||||
Log.e(TAG, "getDefaultDesktop: ");
|
||||
if (JGYUtils.isOfficialVersion() || !JGYUtils.getInstance().getDeviceIsLocked()) {
|
||||
Log.e(TAG, "getDefaultDesktop: " + "Device unLocked");
|
||||
mView.getDefaultDesktopFinish();
|
||||
} else {
|
||||
int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
|
||||
if (JGYUtils.getInstance().isAihuaFramwwork() && aihuaUnlock == 1) {
|
||||
Log.e(TAG, "getDefaultDesktop: " + "Device aihua");
|
||||
mView.getDefaultDesktopFinish();
|
||||
} else {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultDesktop(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.getDefaultDesktopFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultApp() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mView.setDefaultAppFinish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void checkUpdateInfo() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getUpdateApi()
|
||||
.getUpdate(BuildConfig.APPLICATION_ID,
|
||||
JGYUtils.getInstance().checkAppPlatform())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<AppUpdateInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("checkUpdateInfo", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<AppUpdateInfo> response) {
|
||||
Log.e("checkUpdateInfo", "onNext: " + response);
|
||||
if (response.code == OK) {
|
||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
|
||||
long versionCode = jsonObject.get("version_code").getAsLong();
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
PackageInfo info = null;
|
||||
try {
|
||||
info = pm.getPackageInfo(BuildConfig.APPLICATION_ID, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (null == info || info.versionCode < versionCode) {
|
||||
mView.buttonCheckUpdateFinish(true, jsonObject);
|
||||
} else {
|
||||
mView.buttonCheckUpdateFinish(false, null);
|
||||
}
|
||||
} else {
|
||||
mView.buttonCheckUpdateFinish(false, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("checkUpdateInfo", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("checkUpdateInfo", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.aoleyun.sn.activity.main;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
@@ -9,10 +8,6 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.ServiceConnection;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.wifi.WifiInfo;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.SystemClock;
|
||||
@@ -24,11 +19,14 @@ import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.activity.requestlog.RequestLogActivity;
|
||||
import com.aoleyun.sn.activity.update.UpdateActivity;
|
||||
import com.aoleyun.sn.base.mvvm.BaseMvvmActivity;
|
||||
import com.aoleyun.sn.bean.AppSettings;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
@@ -37,10 +35,10 @@ import com.aoleyun.sn.databinding.ActivityMainBinding;
|
||||
import com.aoleyun.sn.dialog.UpdateDialog;
|
||||
import com.aoleyun.sn.service.main.MainService;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.GlideLoadUtils;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.SysSettingUtils;
|
||||
import com.aoleyun.sn.utils.TimeUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.bumptech.glide.Glide;
|
||||
@@ -48,21 +46,7 @@ import com.google.gson.JsonObject;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import butterknife.OnClick;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.ObservableEmitter;
|
||||
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
import static android.os.BatteryManager.EXTRA_LEVEL;
|
||||
import static android.os.BatteryManager.EXTRA_VOLTAGE;
|
||||
|
||||
public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBinding> implements MainAContact.MainView, NetworkUtils.OnNetworkStatusChangedListener {
|
||||
public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBinding> implements NetworkUtils.OnNetworkStatusChangedListener {
|
||||
private static final String TAG = MainActivity.class.getSimpleName();
|
||||
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
@@ -113,9 +97,6 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
}
|
||||
}
|
||||
|
||||
private MainAPresenter mMainAPresenter;
|
||||
|
||||
private boolean updateApp = false;
|
||||
|
||||
@Override
|
||||
public void onDisconnected() {
|
||||
@@ -125,6 +106,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
@Override
|
||||
public void onConnected(NetworkUtils.NetworkType networkType) {
|
||||
Log.e("OnNetworkStatusChanged", "onConnected: ");
|
||||
setMac();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -161,9 +143,6 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
Settings.System.putString(getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, Utils.getSerial(this));
|
||||
}
|
||||
|
||||
mMainAPresenter = new MainAPresenter(this);
|
||||
mMainAPresenter.attachView(this);
|
||||
mMainAPresenter.setLifecycle(getLifecycleSubject());
|
||||
Log.e(TAG, "initView: " + Build.MODEL);
|
||||
if ("YX-T01".equalsIgnoreCase(Build.MODEL)) {
|
||||
mViewDataBinding.clBind.setVisibility(View.GONE);
|
||||
@@ -172,76 +151,15 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
mViewDataBinding.clBind.setVisibility(View.VISIBLE);
|
||||
mViewDataBinding.clQrcode.setVisibility(View.GONE);
|
||||
}
|
||||
JGYUtils.startServices(MainActivity.this);
|
||||
getDevicesInfo();
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform) {
|
||||
String sn = Utils.getSn();
|
||||
if (!TextUtils.isEmpty(sn)) {
|
||||
if (sn.length() > 4) {
|
||||
// tv_number_name.setText(sn.substring(sn.length() - 4));
|
||||
} else {
|
||||
// tv_number_name.setText(sn);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
// setStoreUpdateListener(bt_checkupdate);
|
||||
registerReceiver();
|
||||
JGYUtils.startServices(MainActivity.this);
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
// ApkUtils.openPackage(MainActivity.this,"com.android.calculator2","com.android.calculator2.Calculator");
|
||||
// ApkUtils.openPackage(MainActivity.this,"com.android.documentsui","com.android.documentsui.LauncherActivity");
|
||||
// ApkUtils.openPackage(MainActivity.this,"com.jxw.wuweijidanci","com.jxw.wuweijidanci.MainActivity");
|
||||
// ApkUtils.openPackage(MainActivity.this,"com.jxw.singsound","com.jxw.singsound.ui.SplashActivity");
|
||||
Settings.Global.putInt(getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
|
||||
Settings.Global.putInt(getContentResolver(), Settings.Global.ADB_ENABLED, 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void setStoreUpdateListener(View view) {
|
||||
ObservableOnSubscribe<View> mObservableOnSubscribe = new ObservableOnSubscribe<View>() {
|
||||
@Override
|
||||
public void subscribe(@NonNull ObservableEmitter<View> emitter) throws Throwable {
|
||||
view.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (updateApp) {
|
||||
Toaster.show("你已经检查过更新,请稍后再试");
|
||||
} else {
|
||||
emitter.onNext(view);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
Observer<View> mObserver = new Observer<View>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("mObserver", "onSubscribe");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull View view) {
|
||||
Log.e("mObserver", "onNext");
|
||||
Toaster.show("正在检查更新");
|
||||
// mMainAPresenter.buttonCheckUpdate(bt_checkupdate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("mObserver", "onError" + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("mObserver", "onComplete");
|
||||
}
|
||||
};
|
||||
|
||||
Observable.create(mObservableOnSubscribe)
|
||||
.throttleFirst(10, TimeUnit.SECONDS)
|
||||
//这句很关键,这是RxJava中的操作符,在规定时间内观察者不在接收被观察者发送的事件
|
||||
.subscribe(mObserver);
|
||||
registerReceiver();
|
||||
}
|
||||
|
||||
private void getDevicesInfo() {
|
||||
@@ -256,7 +174,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
}
|
||||
getIMEI();
|
||||
setMac();
|
||||
checkSnError(sn);
|
||||
|
||||
mViewDataBinding.tvVersion.setText(BuildConfig.VERSION_NAME);
|
||||
//获取自定义版本号
|
||||
Log.e(TAG, "getDevicesInfo: CustomVersion: " + Utils.getCustomVersion());
|
||||
@@ -316,7 +234,104 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
Intent intent = new Intent(MainActivity.this, MainService.class);
|
||||
bindService(intent, serviceConnect, BIND_AUTO_CREATE);
|
||||
startService(intent);
|
||||
mMainAPresenter.getLockedState();
|
||||
|
||||
setObserve();
|
||||
|
||||
mViewModel.init();
|
||||
|
||||
mViewModel.getLockedState();
|
||||
mViewModel.getQrCode();
|
||||
mViewModel.setBindInfoPanel();
|
||||
mViewModel.getAppSettings();
|
||||
}
|
||||
|
||||
private void setObserve() {
|
||||
mViewModel.getLockedData().observe(this, new Observer<Boolean>() {
|
||||
@Override
|
||||
public void onChanged(Boolean aBoolean) {
|
||||
Log.e(TAG, "setLockedState: " + aBoolean);
|
||||
if (aBoolean) {
|
||||
mViewModel.getStudesInfo();
|
||||
} else {
|
||||
setNumberText("", View.GONE);
|
||||
setNameText("", View.GONE);
|
||||
setClassText("", View.GONE);
|
||||
setBatchText("", View.GONE);
|
||||
SysSettingUtils.setEnableSetting(MainActivity.this);
|
||||
}
|
||||
mViewModel.getEBagCode();
|
||||
}
|
||||
});
|
||||
mViewModel.getStudentsInfoData().observe(this, new Observer<StudentsInfo>() {
|
||||
@Override
|
||||
public void onChanged(StudentsInfo studentsInfo) {
|
||||
if (studentsInfo == null) {
|
||||
mViewDataBinding.tvActivationTime.setText("未激活");
|
||||
return;
|
||||
}
|
||||
long activation_time = studentsInfo.getActivation_time();
|
||||
// mViewDataBinding.tvActivationTime.setText("激活时间:" + TimeUtils.getActivationTime(activation_time));
|
||||
|
||||
int trade_type = studentsInfo.getTrade_type();
|
||||
String sno = studentsInfo.getSno();
|
||||
String realname = studentsInfo.getRealname();
|
||||
String classes = studentsInfo.getClasses();
|
||||
String batch = studentsInfo.getBatch();
|
||||
String head_img = studentsInfo.getHead_img();
|
||||
int bind_statu = studentsInfo.getBind_status();
|
||||
if (bind_statu == 1) {
|
||||
String phone = studentsInfo.getBind_mobile();
|
||||
mViewDataBinding.tvBindStatus.setText("绑定号码:" + phone);
|
||||
} else {
|
||||
mViewDataBinding.tvBindStatus.setText("未绑定");
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(sno)) {
|
||||
setNumberText("未设置", View.GONE);
|
||||
} else {
|
||||
setNumberText(sno, View.VISIBLE);
|
||||
}
|
||||
if (TextUtils.isEmpty(realname)) {
|
||||
setNameText("未设置", View.GONE);
|
||||
} else {
|
||||
setNameText(realname, View.VISIBLE);
|
||||
}
|
||||
if (TextUtils.isEmpty(classes)) {
|
||||
setClassText("未设置", View.GONE);
|
||||
} else {
|
||||
setClassText(classes, View.VISIBLE);
|
||||
}
|
||||
if (TextUtils.isEmpty(batch)) {
|
||||
setBatchText("未设置", View.GONE);
|
||||
} else {
|
||||
setBatchText(batch, View.VISIBLE);
|
||||
}
|
||||
if (TextUtils.isEmpty(head_img)) {
|
||||
setIv_head("");
|
||||
} else {
|
||||
setIv_head(head_img);
|
||||
}
|
||||
SPUtils.put(MainActivity.this, CommonConfig.ADMIN_ID, studentsInfo.getAdmin_id());
|
||||
}
|
||||
});
|
||||
mViewModel.getEBagCodeData().observe(this, new Observer<Boolean>() {
|
||||
@Override
|
||||
public void onChanged(Boolean aBoolean) {
|
||||
if (aBoolean) {
|
||||
mViewModel.getExclusiveAdminApp();
|
||||
Log.e(TAG, "getEBagCodeFinish: " + "已激活");
|
||||
} else {
|
||||
Log.e(TAG, "getEBagCodeFinish: " + "未激活");
|
||||
}
|
||||
}
|
||||
});
|
||||
mViewModel.getUpdateInfoData().observe(this, new Observer<JsonObject>() {
|
||||
@Override
|
||||
public void onChanged(JsonObject jsonObject) {
|
||||
showUpdateDialog(jsonObject);
|
||||
}
|
||||
});
|
||||
|
||||
mViewModel.getQrCodeData().observe(this, new androidx.lifecycle.Observer<Bitmap>() {
|
||||
@Override
|
||||
public void onChanged(Bitmap bitmap) {
|
||||
@@ -324,7 +339,23 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
mViewDataBinding.ivQrcode2.setImageBitmap(bitmap);
|
||||
}
|
||||
});
|
||||
mViewModel.getQrCode();
|
||||
|
||||
mViewModel.getShowPanel().observe(this, new Observer<Boolean>() {
|
||||
@Override
|
||||
public void onChanged(Boolean aBoolean) {
|
||||
if (aBoolean) {
|
||||
mViewDataBinding.clBindinfo.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mViewDataBinding.clBindinfo.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
mViewModel.getAppSettingsData().observe(this, new Observer<AppSettings>() {
|
||||
@Override
|
||||
public void onChanged(AppSettings appSettings) {
|
||||
mViewDataBinding.setAppSettings(appSettings);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
MainService.MainBinder mMainBinder;
|
||||
@@ -343,106 +374,6 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param loocked 后台1是锁定,底层0是锁定
|
||||
*/
|
||||
@Override
|
||||
public void setLockedState(boolean loocked) {
|
||||
Log.e(TAG, "setLockedState: " + loocked);
|
||||
if (loocked) {
|
||||
mMainAPresenter.getStudesInfo();
|
||||
} else {
|
||||
setNumberText("", View.GONE);
|
||||
setNameText("", View.GONE);
|
||||
setClassText("", View.GONE);
|
||||
setBatchText("", View.GONE);
|
||||
SysSettingUtils.setEnableSetting(this);
|
||||
}
|
||||
mMainAPresenter.getEBagCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStudesInfo(StudentsInfo studesInfo) {
|
||||
if (studesInfo == null) {
|
||||
mViewDataBinding.tvActivationTime.setText("未激活");
|
||||
return;
|
||||
}
|
||||
long activation_time = studesInfo.getActivation_time();
|
||||
mViewDataBinding.tvActivationTime.setText("激活时间:" + TimeUtils.getActivationTime(activation_time));
|
||||
int trade_type = studesInfo.getTrade_type();
|
||||
String sno = studesInfo.getSno();
|
||||
String realname = studesInfo.getRealname();
|
||||
String classes = studesInfo.getClasses();
|
||||
String batch = studesInfo.getBatch();
|
||||
String head_img = studesInfo.getHead_img();
|
||||
int bind_statu = studesInfo.getBind_status();
|
||||
if (bind_statu == 1) {
|
||||
String phone = studesInfo.getBind_mobile();
|
||||
mViewDataBinding.tvBindStatus.setText("绑定号码:" + phone);
|
||||
} else {
|
||||
mViewDataBinding.tvBindStatus.setText("未绑定");
|
||||
}
|
||||
|
||||
settradeType(trade_type);
|
||||
if (TextUtils.isEmpty(sno)) {
|
||||
setNumberText("未设置", View.GONE);
|
||||
} else {
|
||||
setNumberText(sno, View.VISIBLE);
|
||||
}
|
||||
if (TextUtils.isEmpty(realname)) {
|
||||
setNameText("未设置", View.GONE);
|
||||
} else {
|
||||
setNameText(realname, View.VISIBLE);
|
||||
}
|
||||
if (TextUtils.isEmpty(classes)) {
|
||||
setClassText("未设置", View.GONE);
|
||||
} else {
|
||||
setClassText(classes, View.VISIBLE);
|
||||
}
|
||||
if (TextUtils.isEmpty(batch)) {
|
||||
setBatchText("未设置", View.GONE);
|
||||
} else {
|
||||
setBatchText(batch, View.VISIBLE);
|
||||
}
|
||||
if (TextUtils.isEmpty(head_img)) {
|
||||
setIv_head("");
|
||||
} else {
|
||||
setIv_head(head_img);
|
||||
}
|
||||
SPUtils.put(this, CommonConfig.ADMIN_ID, studesInfo.getAdmin_id());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getEBagCodeFinish(boolean activation) {
|
||||
if (activation) {
|
||||
mMainAPresenter.getExclusiveAdminApp();
|
||||
Log.e(TAG, "getEBagCodeFinish: " + "已激活");
|
||||
} else {
|
||||
Log.e(TAG, "getEBagCodeFinish: " + "未激活");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getExclusiveAdminAppFinish() {
|
||||
Log.e(TAG, "getAdminAppFinish: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPublicIp(String ip) {
|
||||
Log.e(TAG, "setPublicIp: " + ip);
|
||||
mMainAPresenter.checkAoleyunUpdate();
|
||||
}
|
||||
|
||||
public void settradeType(int tradeType) {
|
||||
// if (tradeType == 1) {
|
||||
// tv_class_name.setText("班级");
|
||||
// tv_number_name.setText("学号");
|
||||
// } else if (tradeType == 2) {
|
||||
// tv_class_name.setText("部门");
|
||||
// tv_number_name.setText("工号");
|
||||
// }
|
||||
}
|
||||
|
||||
public void setBatchText(String text, int visibility) {
|
||||
mViewDataBinding.tvBatch.setText(text);
|
||||
// tv_batch.setVisibility(visibility);
|
||||
@@ -450,12 +381,12 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
|
||||
public void setClassText(String text, int visibility) {
|
||||
mViewDataBinding.tvClass.setText(text);
|
||||
// layout_class.setVisibility(visibility);
|
||||
mViewDataBinding.clClass.setVisibility(visibility);
|
||||
}
|
||||
|
||||
public void setNumberText(String text, int visibility) {
|
||||
mViewDataBinding.tvNumber.setText(text);
|
||||
// layout_number.setVisibility(visibility);
|
||||
mViewDataBinding.clNumber.setVisibility(visibility);
|
||||
}
|
||||
|
||||
public void setNameText(String text, int visibility) {
|
||||
@@ -465,48 +396,12 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
|
||||
public void setIv_head(String url) {
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
Glide.with(mViewDataBinding.ivHead).load(getDrawable(R.drawable.default_avatar)).into(mViewDataBinding.ivHead);
|
||||
GlideLoadUtils.getInstance().glideLoad(this, getDrawable(R.drawable.default_avatar), mViewDataBinding.ivHead);
|
||||
} else {
|
||||
Glide.with(mViewDataBinding.ivHead).load(url).error(R.drawable.default_avatar).into(mViewDataBinding.ivHead);
|
||||
GlideLoadUtils.getInstance().glideLoad(this, url, mViewDataBinding.ivHead, R.drawable.default_avatar);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@Override
|
||||
public void buttonCheckUpdateFinish(boolean update, JsonObject jsonObject) {
|
||||
this.updateApp = !update;
|
||||
if (update) {
|
||||
showUpdateDialog(jsonObject);
|
||||
} else {
|
||||
Observable.timer(5000, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> Toaster.show("已经是最新版本"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkAoleyunUpdateFinish() {
|
||||
Log.e(TAG, "checkAoleyunUpdateFinish: ");
|
||||
mMainAPresenter.checkTestUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkTestUpdateFinish() {
|
||||
Log.e(TAG, "checkTestUpdateFinish: ");
|
||||
mMainAPresenter.getDefaultDesktop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDefaultDesktopFinish() {
|
||||
Log.e(TAG, "getDefaultDesktopFinish: ");
|
||||
mMainAPresenter.getDefaultApp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultAppFinish() {
|
||||
Log.e(TAG, "setDefaultAppFinish: ");
|
||||
}
|
||||
|
||||
private void showUpdateDialog(JsonObject jsonObject) {
|
||||
UpdateDialog dialog = new UpdateDialog(this);
|
||||
dialog.setMessage(String.format(getString(R.string.upgrade_app), jsonObject.get("version_name").getAsString()))
|
||||
@@ -533,30 +428,6 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
dialog.setCancelable(false);
|
||||
}
|
||||
|
||||
// private void showDialog(JsonObject jsonObject) {
|
||||
// AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
// builder.setTitle("版本更新");
|
||||
// builder.setMessage(String.format(getString(R.string.upgrade_app),jsonObject.get("version_code").getAsString()));
|
||||
// builder.setIcon(R.mipmap.ic_launcher);
|
||||
// builder.setCancelable(true);
|
||||
// //设置正面按钮
|
||||
// builder.setPositiveButton("更新", new DialogInterface.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(DialogInterface dialog, int which) {
|
||||
// JGYUtils.getInstance().installAPK(jsonObject);
|
||||
// dialog.dismiss();
|
||||
// }
|
||||
// });
|
||||
// //设置反面按钮
|
||||
// builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(DialogInterface dialog, int which) {
|
||||
// dialog.dismiss();
|
||||
// }
|
||||
// });
|
||||
// builder.show();
|
||||
// }
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
@@ -581,8 +452,6 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
mMainAPresenter.detachView();
|
||||
mMainAPresenter = null;
|
||||
unregister();
|
||||
JGYUtils.startServices(MainActivity.this);
|
||||
}
|
||||
@@ -608,16 +477,44 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
}
|
||||
|
||||
private void registerReceiver() {
|
||||
registerWiFiReceiver();
|
||||
registerBatteryReceiver();
|
||||
registerPanelReceiver();
|
||||
}
|
||||
|
||||
|
||||
private void unregister() {
|
||||
if (mWifiReceiver != null) {
|
||||
unregisterReceiver(mWifiReceiver);
|
||||
if (mPanelReceiver != null) {
|
||||
unregisterReceiver(mPanelReceiver);
|
||||
}
|
||||
if (mBatteryReceiver != null) {
|
||||
unregisterReceiver(mBatteryReceiver);
|
||||
}
|
||||
|
||||
private void registerPanelReceiver() {
|
||||
if (mPanelReceiver == null) {
|
||||
mPanelReceiver = new PanelReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(PANEL_SHOW);
|
||||
filter.addAction(PANEL_HIDE);
|
||||
registerReceiver(mPanelReceiver, filter);
|
||||
}
|
||||
|
||||
public static final String PANEL_SHOW = "panel_show_key";
|
||||
public static final String PANEL_HIDE = "panel_hide_key";
|
||||
|
||||
private PanelReceiver mPanelReceiver;
|
||||
|
||||
private class PanelReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
switch (action) {
|
||||
case PANEL_SHOW:
|
||||
mViewDataBinding.clBindinfo.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case PANEL_HIDE:
|
||||
default:
|
||||
mViewDataBinding.clBindinfo.setVisibility(View.GONE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -637,12 +534,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (UPDATE_LOCKED_STATUS.equals(intent.getAction())) {
|
||||
int locked = Settings.System.getInt(getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
|
||||
if (locked == JGYActions.FRAME_CODE_LOCKED) {
|
||||
// iv_locked.setVisibility(View.VISIBLE);
|
||||
// iv_locked.setImageDrawable(getDrawable(R.drawable.locked));
|
||||
} else {
|
||||
// iv_locked.setVisibility(View.VISIBLE);
|
||||
// iv_locked.setImageDrawable(getDrawable(R.drawable.unlock));
|
||||
if (locked != JGYActions.FRAME_CODE_LOCKED) {
|
||||
setNumberText("", View.GONE);
|
||||
setNameText("", View.GONE);
|
||||
setClassText("", View.GONE);
|
||||
@@ -654,110 +546,4 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
}
|
||||
}
|
||||
|
||||
private WifiReceiver mWifiReceiver;
|
||||
|
||||
private void registerWiFiReceiver() {
|
||||
if (mWifiReceiver == null) {
|
||||
mWifiReceiver = new WifiReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.RSSI_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.NETWORK_IDS_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
|
||||
filter.addAction(WifiManager.CONFIGURED_NETWORKS_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION);
|
||||
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
|
||||
registerReceiver(mWifiReceiver, filter);
|
||||
}
|
||||
|
||||
public class WifiReceiver extends BroadcastReceiver {
|
||||
private static final String TAG = "wifiReceiver";
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
switch (intent.getAction()) {
|
||||
case WifiManager.RSSI_CHANGED_ACTION:
|
||||
int rssi = intent.getIntExtra(WifiManager.EXTRA_NEW_RSSI, -1);
|
||||
// tv_signal.setText(rssi + "dBm");
|
||||
//这函数可以计算出信号的等级
|
||||
int strength = WifiManager.calculateSignalLevel(rssi, 5);
|
||||
Log.e(TAG, "wifi信号强度变化");
|
||||
break;
|
||||
//wifi连接上与否
|
||||
case WifiManager.NETWORK_STATE_CHANGED_ACTION:
|
||||
NetworkInfo info = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);
|
||||
if (info.getState().equals(NetworkInfo.State.DISCONNECTED)) {
|
||||
Log.e(TAG, getString(R.string.wifi_disconnected));
|
||||
// tv_wifi.setText(getString(R.string.wifi_disconnected));
|
||||
// tv_signal.setText("");
|
||||
// tv_ip.setText(getString(R.string.unknown));
|
||||
} else if (info.getState().equals(NetworkInfo.State.CONNECTED)) {
|
||||
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
|
||||
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
|
||||
//获取当前wifi名称
|
||||
String newSSID = wifiInfo.getSSID();
|
||||
// tv_wifi.setText(newSSID);
|
||||
// tv_ip.setText(Formatter.formatIpAddress(wifiInfo.getIpAddress()));
|
||||
setMac();
|
||||
Log.e(TAG, "连接到网络 " + newSSID);
|
||||
}
|
||||
break;
|
||||
//wifi打开与否
|
||||
case WifiManager.WIFI_STATE_CHANGED_ACTION:
|
||||
int wifistate = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_DISABLED);
|
||||
if (wifistate == WifiManager.WIFI_STATE_DISABLED) {
|
||||
// tv_wifi.setText(getString(R.string.turn_off_wifi));
|
||||
Log.e(TAG, getString(R.string.turn_off_wifi));
|
||||
} else if (wifistate == WifiManager.WIFI_STATE_ENABLED) {
|
||||
// tv_wifi.setText(getString(R.string.turn_on_wifi));
|
||||
Log.e(TAG, getString(R.string.turn_on_wifi));
|
||||
mMainAPresenter.getPublicIp();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private BatteryReceiver mBatteryReceiver;
|
||||
|
||||
private void registerBatteryReceiver() {
|
||||
if (mBatteryReceiver == null) {
|
||||
mBatteryReceiver = new BatteryReceiver();
|
||||
}
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(Intent.ACTION_BATTERY_CHANGED);
|
||||
registerReceiver(mBatteryReceiver, filter);
|
||||
}
|
||||
|
||||
private class BatteryReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (null == intent) {
|
||||
return;
|
||||
}
|
||||
String action = intent.getAction();
|
||||
if (Intent.ACTION_BATTERY_CHANGED.equals(action)) {
|
||||
int level = intent.getIntExtra(EXTRA_LEVEL, 0);
|
||||
int batteryVolt = intent.getIntExtra(EXTRA_VOLTAGE, -1);
|
||||
String levelStr = getLevel(level);
|
||||
// tv_battery.setText("电量:" + levelStr);
|
||||
String batteryVoltStr = getBatteryVolt(batteryVolt);
|
||||
// tv_voltage.setText("电压:" + batteryVoltStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getLevel(int level) {
|
||||
return String.format("%d %%", level);
|
||||
}
|
||||
|
||||
private String getBatteryVolt(int batteryVolt) {
|
||||
return String.format("%.3f V", batteryVolt / 1000.0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,46 @@
|
||||
package com.aoleyun.sn.activity.main;
|
||||
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.base.mvvm.BaseViewModel;
|
||||
import com.aoleyun.sn.bean.AdminAppInfo;
|
||||
import com.aoleyun.sn.bean.AppSettings;
|
||||
import com.aoleyun.sn.bean.AppUpdateInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.databinding.ActivityMainBinding;
|
||||
import com.aoleyun.sn.gson.GsonUtils;
|
||||
import com.aoleyun.sn.network.NetInterfaceManager;
|
||||
import com.aoleyun.sn.utils.AES.CXAESUtil;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEvent> {
|
||||
private static final String TAG = MainViewModel.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
public ActivityMainBinding getVDBinding() {
|
||||
return binding;
|
||||
@@ -23,16 +51,307 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
|
||||
}
|
||||
|
||||
private MutableLiveData<Bitmap> mQrCodeData =new MutableLiveData<>();
|
||||
public void init() {
|
||||
checkUpdateInfo();
|
||||
checkAoleyunUpdate();
|
||||
checkTestUpdate();
|
||||
getDefaultDesktop();
|
||||
getDefaultApp();
|
||||
}
|
||||
|
||||
private MutableLiveData<Boolean> mLockedData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<Boolean> getLockedData() {
|
||||
return mLockedData;
|
||||
}
|
||||
|
||||
public void getLockedState() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getLockedState(getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getLockedState", "onComplete: ");
|
||||
int locked = Settings.System.getInt(getCtx().getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
|
||||
Log.e("getLockedState", "locked: " + locked);
|
||||
mLockedData.setValue(locked == JGYActions.FRAME_CODE_LOCKED);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private MutableLiveData<StudentsInfo> mStudentsInfoData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<StudentsInfo> getStudentsInfoData() {
|
||||
return mStudentsInfoData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过sn获取用户信息
|
||||
*/
|
||||
public void getStudesInfo() {
|
||||
NetInterfaceManager.getInstance().getStudesInfo(true, getLifecycle(), new NetInterfaceManager.StudesInfoListener() {
|
||||
@Override
|
||||
public void setStudentsInfo(StudentsInfo studentsInfo) {
|
||||
mStudentsInfoData.setValue(studentsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private MutableLiveData<Boolean> mEBagCodeData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<Boolean> getEBagCodeData() {
|
||||
return mEBagCodeData;
|
||||
}
|
||||
|
||||
public void getEBagCode() {
|
||||
NetInterfaceManager.getInstance().getEBagCode(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
mEBagCodeData.setValue(Settings.Global.getInt(getCtx().getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0) == 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void getExclusiveAdminApp() {
|
||||
NetInterfaceManager.getInstance().getExclusiveAdminAppObservable()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<List<AdminAppInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAdminApp", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<AdminAppInfo>> listBaseResponse) {
|
||||
Log.e("getAdminApp", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
List<AdminAppInfo> adminAppInfos = listBaseResponse.data;
|
||||
JGYUtils.getInstance().installAdminApp(adminAppInfos);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAdminApp", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAdminApp", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private MutableLiveData<JsonObject> mUpdateInfoData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<JsonObject> getUpdateInfoData() {
|
||||
return mUpdateInfoData;
|
||||
}
|
||||
|
||||
public void checkUpdateInfo() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getUpdateApi()
|
||||
.getUpdate(BuildConfig.APPLICATION_ID,
|
||||
JGYUtils.getInstance().checkAppPlatform())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<AppUpdateInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("checkUpdateInfo", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<AppUpdateInfo> response) {
|
||||
Log.e("checkUpdateInfo", "onNext: " + response);
|
||||
if (response.code == 200) {
|
||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
|
||||
long versionCode = jsonObject.get("version_code").getAsLong();
|
||||
PackageManager pm = getCtx().getPackageManager();
|
||||
PackageInfo info = null;
|
||||
try {
|
||||
info = pm.getPackageInfo(BuildConfig.APPLICATION_ID, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (null == info || info.versionCode < versionCode) {
|
||||
mUpdateInfoData.setValue(jsonObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("checkUpdateInfo", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("checkUpdateInfo", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void checkAoleyunUpdate() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.checkAoleyunUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void checkTestUpdate() {
|
||||
if (!JGYUtils.getInstance().tagEmpty()) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.checkTestUpdate(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Log.e(TAG, "checkTestUpdate: tag is Empty");
|
||||
}
|
||||
}
|
||||
|
||||
public void getDefaultDesktop() {
|
||||
Log.e(TAG, "getDefaultDesktop: ");
|
||||
if (JGYUtils.isOfficialVersion() || !JGYUtils.getInstance().getDeviceIsLocked()) {
|
||||
Log.e(TAG, "getDefaultDesktop: " + "Device unLocked");
|
||||
|
||||
} else {
|
||||
int aihuaUnlock = Settings.System.getInt(getCtx().getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
|
||||
if (JGYUtils.getInstance().isAihuaFramwwork() && aihuaUnlock == 1) {
|
||||
Log.e(TAG, "getDefaultDesktop: " + "Device aihua");
|
||||
|
||||
} else {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultDesktop(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void getDefaultApp() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDefaultApp(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private MutableLiveData<Bitmap> mQrCodeData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<Bitmap> getQrCodeData() {
|
||||
return mQrCodeData;
|
||||
}
|
||||
|
||||
public void getQrCode(){
|
||||
public void getQrCode() {
|
||||
String encryptString = CXAESUtil.encrypt(CommonConfig.AES_KEY, Utils.getSerial(getCtx()));
|
||||
Log.e("getQRCode", "setImageAndText: " + encryptString);
|
||||
Bitmap bitmap = Utils.createQRImage(encryptString, 400, 400);
|
||||
mQrCodeData.setValue(bitmap);
|
||||
}
|
||||
|
||||
public void getPublicIp() {
|
||||
NetInterfaceManager.getInstance().getPublicIp(getLifecycle(), new NetInterfaceManager.PublicIpCallbak() {
|
||||
@Override
|
||||
public void getPublicIp(String ip) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private MutableLiveData<Boolean> mShowPanel = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<Boolean> getShowPanel() {
|
||||
return mShowPanel;
|
||||
}
|
||||
|
||||
public void setBindInfoPanel() {
|
||||
NetInterfaceManager.getInstance().getSystemSettingObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("setBindInfoPanel", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse baseResponse) {
|
||||
Log.e("setBindInfoPanel", "onNext: " + baseResponse);
|
||||
if (baseResponse.code == 200) {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(GsonUtils.toJSONString(baseResponse.data));
|
||||
JsonElement jsonElement = jsonObject.get("is_control_show");
|
||||
if (jsonElement != null && !jsonElement.isJsonNull()) {
|
||||
int is_control_show = jsonElement.getAsInt();
|
||||
mShowPanel.setValue(is_control_show == 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("setBindInfoPanel", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("setBindInfoPanel", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private MutableLiveData<AppSettings> mAppSettingsData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<AppSettings> getAppSettingsData() {
|
||||
return mAppSettingsData;
|
||||
}
|
||||
|
||||
public void getAppSettings() {
|
||||
NetInterfaceManager.getInstance().getAppSettingObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<AppSettings>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("getAppSettings", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<AppSettings> appSettingsBaseResponse) {
|
||||
Log.e("getAppSettings", "onNext: " + appSettingsBaseResponse);
|
||||
if (appSettingsBaseResponse.code == 200) {
|
||||
mAppSettingsData.setValue(appSettingsBaseResponse.data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("getAppSettings", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("getAppSettings", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
99
app/src/main/java/com/aoleyun/sn/bean/AppSettings.java
Normal file
99
app/src/main/java/com/aoleyun/sn/bean/AppSettings.java
Normal file
@@ -0,0 +1,99 @@
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AppSettings implements Serializable {
|
||||
private static final long serialVersionUID = -3501100183295519224L;
|
||||
|
||||
// APP图标
|
||||
String app_icon;
|
||||
// 小程序二维码
|
||||
String mini_qrcode;
|
||||
// 日志功能开关 1 开 0 关
|
||||
int logs_control;
|
||||
// 定义批次名称 1 开启 0 关闭
|
||||
int custom_batch_control;
|
||||
//批次名称
|
||||
String custom_batch_name;
|
||||
// 定义班级开关 1 开 0 关
|
||||
int custom_class_control;
|
||||
//班级名称
|
||||
String custom_class_name;
|
||||
// 定义学号开关 1 开 0 关
|
||||
int custom_number_control;
|
||||
//学号名称
|
||||
String custom_number_name;
|
||||
|
||||
|
||||
public String getApp_icon() {
|
||||
return app_icon;
|
||||
}
|
||||
|
||||
public void setApp_icon(String app_icon) {
|
||||
this.app_icon = app_icon;
|
||||
}
|
||||
|
||||
public String getMini_qrcode() {
|
||||
return mini_qrcode;
|
||||
}
|
||||
|
||||
public void setMini_qrcode(String mini_qrcode) {
|
||||
this.mini_qrcode = mini_qrcode;
|
||||
}
|
||||
|
||||
public int getLogs_control() {
|
||||
return logs_control;
|
||||
}
|
||||
|
||||
public void setLogs_control(int logs_control) {
|
||||
this.logs_control = logs_control;
|
||||
}
|
||||
|
||||
public int getCustom_batch_control() {
|
||||
return custom_batch_control;
|
||||
}
|
||||
|
||||
public void setCustom_batch_control(int custom_batch_control) {
|
||||
this.custom_batch_control = custom_batch_control;
|
||||
}
|
||||
|
||||
public String getCustom_batch_name() {
|
||||
return custom_batch_name;
|
||||
}
|
||||
|
||||
public void setCustom_batch_name(String custom_batch_name) {
|
||||
this.custom_batch_name = custom_batch_name;
|
||||
}
|
||||
|
||||
public int getCustom_class_control() {
|
||||
return custom_class_control;
|
||||
}
|
||||
|
||||
public void setCustom_class_control(int custom_class_control) {
|
||||
this.custom_class_control = custom_class_control;
|
||||
}
|
||||
|
||||
public String getCustom_class_name() {
|
||||
return custom_class_name;
|
||||
}
|
||||
|
||||
public void setCustom_class_name(String custom_class_name) {
|
||||
this.custom_class_name = custom_class_name;
|
||||
}
|
||||
|
||||
public int getCustom_number_control() {
|
||||
return custom_number_control;
|
||||
}
|
||||
|
||||
public void setCustom_number_control(int custom_number_control) {
|
||||
this.custom_number_control = custom_number_control;
|
||||
}
|
||||
|
||||
public String getCustom_number_name() {
|
||||
return custom_number_name;
|
||||
}
|
||||
|
||||
public void setCustom_number_name(String custom_number_name) {
|
||||
this.custom_number_name = custom_number_name;
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class CacheHelper {
|
||||
|
||||
public void put(String key, String value) {
|
||||
Log.e(TAG, "put: " + key);
|
||||
mMMKV.encode(key, System.currentTimeMillis());
|
||||
mMMKV.encode(key + "_time", System.currentTimeMillis());
|
||||
mMMKV.encode(key + "_mmkv", value);
|
||||
|
||||
DiskLruCache.Editor edit = null;
|
||||
|
||||
@@ -102,7 +102,7 @@ public class ConnectManager {
|
||||
return false;
|
||||
}
|
||||
long nowTime = System.currentTimeMillis();
|
||||
long lastTime = mMMKV.decodeLong(key);
|
||||
long lastTime = mMMKV.decodeLong(key + "_time");
|
||||
// long lastTime = (long) SPUtils.get(mContext, key, 0L);
|
||||
Log.e(TAG, "isNeedConnect: key = " + key + "\ttime = " + lastTime);
|
||||
long intervalTime = getConnectModeTime(connectMode);
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
@@ -27,6 +28,7 @@ import com.aoleyun.sn.bean.AppDateInfo;
|
||||
import com.aoleyun.sn.bean.AppID;
|
||||
import com.aoleyun.sn.bean.AppLimit;
|
||||
import com.aoleyun.sn.bean.AppListInfo;
|
||||
import com.aoleyun.sn.bean.AppSettings;
|
||||
import com.aoleyun.sn.bean.AppUpdateInfo;
|
||||
import com.aoleyun.sn.bean.Appground;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
@@ -63,6 +65,7 @@ import com.aoleyun.sn.manager.ConnectManager;
|
||||
import com.aoleyun.sn.manager.ConnectMode;
|
||||
import com.aoleyun.sn.network.api.GetWhoisApi;
|
||||
import com.aoleyun.sn.network.api.aolelearn.ExclusiveAdminAppApi;
|
||||
import com.aoleyun.sn.network.api.get.AppSettingApi;
|
||||
import com.aoleyun.sn.network.api.get.CheckTestUpdateApi;
|
||||
import com.aoleyun.sn.network.api.get.CloudLessonApi;
|
||||
import com.aoleyun.sn.network.api.get.CloudLessonAppApi;
|
||||
@@ -718,6 +721,13 @@ public class NetInterfaceManager {
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<AppSettings>> getAppSettingObservable() {
|
||||
return mRetrofit.create(AppSettingApi.class)
|
||||
.getAppSetting(Utils.getSerial(mContext))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
@@ -2199,7 +2209,7 @@ public class NetInterfaceManager {
|
||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_STUDENTS_INFO, connectMode)) {
|
||||
getInfo(lifecycle, studesInfoListener);
|
||||
} else {
|
||||
String jsonString = cacheHelper.getAsString(UrlAddress.GET_STUDENTS_INFO);
|
||||
String jsonString = mMMKV.decodeString(UrlAddress.GET_STUDENTS_INFO);
|
||||
//为 "" 是已经请求成功的
|
||||
if (jsonString == null) {
|
||||
getInfo(lifecycle, studesInfoListener);
|
||||
@@ -2207,8 +2217,13 @@ public class NetInterfaceManager {
|
||||
Gson gson = new Gson();
|
||||
Type Type = new TypeToken<StudentsInfo>() {
|
||||
}.getType();
|
||||
StudentsInfo studentsInfo = gson.fromJson(jsonString, Type);
|
||||
studesInfoListener.setStudentsInfo(studentsInfo);
|
||||
try {
|
||||
StudentsInfo studentsInfo = gson.fromJson(jsonString, Type);
|
||||
studesInfoListener.setStudentsInfo(studentsInfo);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "getStudesInfo: " + e.getMessage());
|
||||
studesInfoListener.setStudentsInfo(null);
|
||||
}
|
||||
studesInfoListener.onComplete();
|
||||
}
|
||||
}
|
||||
@@ -2234,9 +2249,9 @@ public class NetInterfaceManager {
|
||||
Log.e("getStudesInfo", "onNext: " + studentsInfoBaseResponse.data);
|
||||
if (studentsInfoBaseResponse.code == OK) {
|
||||
studesInfoListener.setStudentsInfo(studentsInfoBaseResponse.data);
|
||||
cacheHelper.put(UrlAddress.GET_STUDENTS_INFO, GsonUtils.toJSONString(studentsInfoBaseResponse.data));
|
||||
mMMKV.encode(UrlAddress.GET_STUDENTS_INFO, GsonUtils.toJSONString(studentsInfoBaseResponse.data));
|
||||
} else {
|
||||
cacheHelper.put(UrlAddress.GET_STUDENTS_INFO, "");
|
||||
mMMKV.encode(UrlAddress.GET_STUDENTS_INFO, "");
|
||||
Log.e("getStudesInfo", "onNext: " + studentsInfoBaseResponse.toString());
|
||||
}
|
||||
}
|
||||
@@ -2519,9 +2534,11 @@ public class NetInterfaceManager {
|
||||
JGYUtils.getInstance().getAppPlatform(platform -> {
|
||||
if (platform == JGYUtils.MTKPlatform) {
|
||||
tagSets.add(JGYUtils.MTKTag);
|
||||
} else if (platform == JGYUtils.CubePlatform) {
|
||||
tagSets.add(JGYUtils.ZhanruiTag);
|
||||
} else if (platform == JGYUtils.ZhanruiPlatform) {
|
||||
}
|
||||
// else if (platform == JGYUtils.CubePlatform) {
|
||||
// tagSets.add(JGYUtils.ZhanruiTag);
|
||||
// }
|
||||
else if (platform == JGYUtils.ZhanruiPlatform) {
|
||||
tagSets.add(JGYUtils.ZhanruiTag);
|
||||
} else if (platform == JGYUtils.MTK11Platform) {
|
||||
tagSets.add(JGYUtils.MTK11Tag);
|
||||
@@ -2669,32 +2686,21 @@ public class NetInterfaceManager {
|
||||
callback.onComplete();
|
||||
}
|
||||
});
|
||||
uploadAppIcon();
|
||||
}
|
||||
|
||||
private void uploadAppIcon() {
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
List<PackageInfo> packageInfos = pm.getInstalledPackages(0);
|
||||
List<PackageInfo> filter = packageInfos.stream().filter(new Predicate<PackageInfo>() {
|
||||
@Override
|
||||
public boolean test(PackageInfo packageInfo) {
|
||||
if (ApkUtils.isSystemApp(mContext, packageInfo.packageName)) {
|
||||
if (ApkUtils.systemApps.contains(packageInfo.packageName)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
List<PackageInfo> filterJxwApp = filter.stream().filter(packageInfo -> !ApkUtils.mJxwApp.contains(packageInfo.packageName)).collect(Collectors.toList());
|
||||
for (PackageInfo packageInfo : filterJxwApp) {
|
||||
if ("com.uiuipad.find".equals(packageInfo.packageName)
|
||||
|| "com.uiuipad.os".equals(packageInfo.packageName)
|
||||
|| "com.uiui.zybrowser".equals(packageInfo.packageName)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Log.e(TAG, "uploadAppIcon: packageInfos = " + packageInfos);
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN, null);
|
||||
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
List<ResolveInfo> appsWithLauncher = pm.queryIntentActivities(intent, 0);
|
||||
List<String> allLauncherPkgs = appsWithLauncher.stream().map(resolveInfo -> resolveInfo.activityInfo.packageName).collect(Collectors.toList());
|
||||
Log.e(TAG, "uploadAppIcon: allLauncherPkgs = " + allLauncherPkgs);
|
||||
List<PackageInfo> filter = packageInfos.stream().filter(packageInfo -> allLauncherPkgs.contains(packageInfo.packageName)).collect(Collectors.toList());
|
||||
Log.e(TAG, "sendInstalledAppInfo: " + filter);
|
||||
for (PackageInfo packageInfo : filter) {
|
||||
if (!mUploadIconPkgs.contains(packageInfo.packageName)) {
|
||||
Drawable drawable = packageInfo.applicationInfo.loadIcon(pm);
|
||||
File file = BitmapUtils.drawableToFile(mContext, drawable, packageInfo.packageName);
|
||||
@@ -2735,6 +2741,7 @@ public class NetInterfaceManager {
|
||||
public void addIcon(String pkg) {
|
||||
mUploadIconPkgs.add(pkg);
|
||||
mMMKV.encode(uploadIconPkgsKey, mUploadIconPkgs);
|
||||
Log.e("addIcon", "addIcon: " + mMMKV.decodeString(uploadIconPkgsKey));
|
||||
}
|
||||
|
||||
public void uploadLogFile() {
|
||||
|
||||
@@ -104,6 +104,8 @@ public class UrlAddress {
|
||||
public static final String GET_WIFI_ALIAS_PW = "And/SnControl/getWifi";
|
||||
/*获取远程关机时间*/
|
||||
public static final String GET_POWEROFF_TIME = "And/getTimedShutdown";
|
||||
/*获取管控APP设置*/
|
||||
public static final String APP_SETTING = "android/sn-control/app-setting";
|
||||
|
||||
/**
|
||||
* 浏览器策略
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.aoleyun.sn.network.api.get;
|
||||
|
||||
import com.aoleyun.sn.bean.AppSettings;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.UrlAddress;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface AppSettingApi {
|
||||
@GET(UrlAddress.APP_SETTING)
|
||||
Observable<BaseResponse<AppSettings>> getAppSetting(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.aoleyun.sn.push;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ComponentName;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
@@ -258,7 +259,7 @@ public class PushManager {
|
||||
Toaster.debugShow("收到管控:系统设置");
|
||||
if (!TextUtils.isEmpty(extras)) {
|
||||
JGYUtils.getInstance().SettingSysData(extras);
|
||||
JGYUtils.getInstance().removeAllTask();
|
||||
// JGYUtils.getInstance().removeAllTask();
|
||||
}
|
||||
break;
|
||||
case MSG_BROWSER:
|
||||
@@ -777,6 +778,7 @@ public class PushManager {
|
||||
Utils.ariaDownload(mContext, app_url, packageObj);
|
||||
} else {
|
||||
Log.e(TAG, "doDownloadAndInstall: " + app_package + "已安装最新版");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1088,22 +1090,30 @@ public class PushManager {
|
||||
private void setDefalutApp(String extras) {
|
||||
if (TextUtils.isEmpty(extras)) {
|
||||
JGYUtils.getInstance().setDefaultDesktop("");
|
||||
JGYUtils.getInstance().openLauncher3();
|
||||
} else {
|
||||
JsonObject jsonObject = GsonUtils.getJsonObject(extras);
|
||||
JsonElement launcherElement = jsonObject.get("default_launcher");
|
||||
if (launcherElement.isJsonNull()) {
|
||||
JGYUtils.getInstance().setDefaultDesktop("");
|
||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
|
||||
JGYUtils.getInstance().openLauncher3();
|
||||
// SPUtils.put(mContext, "default_launcher", "");
|
||||
} else {
|
||||
String default_launcher = launcherElement.getAsString();
|
||||
if (TextUtils.isEmpty(default_launcher)) {
|
||||
JGYUtils.getInstance().setDefaultDesktop("");
|
||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, "");
|
||||
|
||||
JGYUtils.getInstance().openLauncher3();
|
||||
// SPUtils.put(mContext, "default_launcher", "");
|
||||
} else {
|
||||
JGYUtils.getInstance().setDefaultDesktop(default_launcher);
|
||||
ComponentName cn = new ComponentName(default_launcher, JGYUtils.getInstance().getStartClassName(default_launcher));
|
||||
Intent intent = new Intent();
|
||||
intent.setComponent(cn);
|
||||
intent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
mMMKV.encode(CommonConfig.DEFAULT_LAUNCHER_PACKAGE_NAME, default_launcher);
|
||||
// SPUtils.put(mContext, "default_launcher", default_launcher);
|
||||
}
|
||||
|
||||
@@ -885,11 +885,7 @@ public class GuardService extends Service {
|
||||
}
|
||||
} else if (filepath.endsWith(".zip")) {
|
||||
Log.e("taskComplete", "下载完成:" + task.getPercent() + ":" + task.getExtendField());
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform){
|
||||
JGYUtils.getInstance().setBootanimationG10J(task.getFilePath());
|
||||
}else {
|
||||
JGYUtils.getInstance().setBootanimation(task.getFilePath());
|
||||
}
|
||||
JGYUtils.getInstance().setBootanimationG10J(task.getFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ public class ApkUtils {
|
||||
this.add("com.uisaas.service");
|
||||
this.add("com.ttstd.ttutils");
|
||||
this.add("com.ttstd.qin");
|
||||
this.add("com.uiuios.ailog");
|
||||
}};
|
||||
|
||||
/**
|
||||
@@ -411,6 +412,7 @@ public class ApkUtils {
|
||||
|
||||
this.add("com.ygyb.yischool");
|
||||
this.add("com.gaomuxuexi34");
|
||||
this.add("com.books.wisdom");
|
||||
}};
|
||||
|
||||
|
||||
@@ -472,7 +474,7 @@ public class ApkUtils {
|
||||
|
||||
this.add("com.jxw.souti");
|
||||
this.add("com.jxw.xdfzq");
|
||||
this.add("com.uiui.zysn ");
|
||||
this.add("com.uiui.zysn");
|
||||
}};
|
||||
|
||||
/**
|
||||
|
||||
129
app/src/main/java/com/aoleyun/sn/utils/GlideLoadUtils.java
Normal file
129
app/src/main/java/com/aoleyun/sn/utils/GlideLoadUtils.java
Normal file
@@ -0,0 +1,129 @@
|
||||
package com.aoleyun.sn.utils;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
|
||||
/**
|
||||
* Glide 加载 简单判空封装 防止异步加载数据时调用Glide 抛出异常
|
||||
* Created by Li_Xavier on 2017/6/20 0020.
|
||||
*/
|
||||
public class GlideLoadUtils {
|
||||
private String TAG = "ImageLoader";
|
||||
|
||||
/**
|
||||
* 借助内部类 实现线程安全的单例模式
|
||||
* 属于懒汉式单例,因为Java机制规定,内部类SingletonHolder只有在getInstance()
|
||||
* 方法第一次调用的时候才会被加载(实现了lazy),而且其加载过程是线程安全的。
|
||||
* 内部类加载的时候实例化一次instance。
|
||||
*/
|
||||
public GlideLoadUtils() {
|
||||
}
|
||||
|
||||
private static class GlideLoadUtilsHolder {
|
||||
private final static GlideLoadUtils INSTANCE = new GlideLoadUtils();
|
||||
}
|
||||
|
||||
public static GlideLoadUtils getInstance() {
|
||||
return GlideLoadUtilsHolder.INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Glide 加载 简单判空封装 防止异步加载数据时调用Glide 抛出异常
|
||||
*
|
||||
* @param context
|
||||
* @param url 加载图片的url地址 String
|
||||
* @param imageView 加载图片的ImageView 控件
|
||||
* @param default_image 图片展示错误的本地图片 id
|
||||
*/
|
||||
public void glideLoad(Context context, String url, ImageView imageView, int default_image) {
|
||||
if (context != null) {
|
||||
Glide.with(context).load(url).centerCrop().error(default_image).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,context is null");
|
||||
}
|
||||
}
|
||||
|
||||
public void glideLoadc(Context context, String url, ImageView imageView, Drawable default_image) {
|
||||
if (context != null) {
|
||||
Glide.with(context).load(url).centerCrop().error(default_image).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,context is null");
|
||||
}
|
||||
}
|
||||
|
||||
public void glideLoad(Activity activity, String url, ImageView imageView, Drawable drawable) {
|
||||
if (activity != null && !activity.isDestroyed()) {
|
||||
Glide.with(activity.getApplicationContext()).load(url).error(drawable).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,context is null");
|
||||
}
|
||||
}
|
||||
|
||||
public void glideLoad(Context context, String url, ImageView imageView) {
|
||||
if (context != null) {
|
||||
Glide.with(context).load(url).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,context is null");
|
||||
}
|
||||
}
|
||||
|
||||
public void glideLoad(Context context, Drawable drawable, ImageView imageView) {
|
||||
if (context != null) {
|
||||
Glide.with(context).load(drawable).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,context is null");
|
||||
}
|
||||
}
|
||||
|
||||
public void glideLoad(Context context, int drawableId, ImageView imageView) {
|
||||
if (context != null) {
|
||||
Glide.with(context).load(context.getDrawable(drawableId)).centerCrop().into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,context is null");
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
|
||||
public void glideLoad(Activity activity, String url, ImageView imageView, int default_image) {
|
||||
if (!activity.isDestroyed()) {
|
||||
// Glide.with(activity).load(url).centerCrop().dontAnimate().error(default_image).into(imageView);
|
||||
Glide.with(activity).load(url).into(new SimpleTarget<Drawable>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||
imageView.setImageDrawable(resource);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,activity is Destroyed");
|
||||
}
|
||||
}
|
||||
|
||||
public void glideLoad(Fragment fragment, String url, ImageView imageView, int default_image) {
|
||||
if (fragment != null && fragment.getActivity() != null) {
|
||||
Glide.with(fragment).load(url).centerCrop().error(default_image).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,fragment is null");
|
||||
}
|
||||
}
|
||||
|
||||
public void glideLoad(android.app.Fragment fragment, String url, ImageView imageView, int default_image) {
|
||||
if (fragment != null && fragment.getActivity() != null) {
|
||||
Glide.with(fragment).load(url).centerCrop().error(default_image).into(imageView);
|
||||
} else {
|
||||
Log.i(TAG, "Picture loading failed,android.app.Fragment is null");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,9 +135,10 @@ public class JGYUtils {
|
||||
private TimeUtils.ContralTime mContralTime;
|
||||
|
||||
public static final int UnknowPlatform = 0;
|
||||
|
||||
public static final int MTKPlatform = 1;
|
||||
public static final int CubePlatform = 2;
|
||||
public static final int ZhanruiPlatform = 3;
|
||||
public static final int ZhanruiPlatform = 2;
|
||||
// public static final int CubePlatform = 3;
|
||||
public static final int MTK11Platform = 5;
|
||||
public static final int TeclastP20sPlatform = 6;
|
||||
public static final int AH6016Platform = 9;
|
||||
@@ -151,9 +152,10 @@ public class JGYUtils {
|
||||
|
||||
|
||||
public static final String Other = "其他";
|
||||
|
||||
public static final String MTKTag = "MTK";
|
||||
public static final String CubeTag = "展锐cube";
|
||||
public static final String ZhanruiTag = "展锐";
|
||||
// public static final String CubeTag = "展锐cube";
|
||||
public static final String MTK11Tag = "MTK11";
|
||||
public static final String TeclastP20sTag = "P20S";
|
||||
public static final String AH6016Tag = "AH6016";
|
||||
@@ -250,16 +252,18 @@ public class JGYUtils {
|
||||
|
||||
public int checkAppPlatform() {
|
||||
String platform = BuildConfig.platform;
|
||||
if ("MTK".equalsIgnoreCase(platform)) {
|
||||
if (MTKTag.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "MTK平台");
|
||||
return MTKPlatform;
|
||||
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
|
||||
} else if (ZhanruiTag.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "展锐平台");
|
||||
return ZhanruiPlatform;
|
||||
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "ZhanRuiCube");
|
||||
return CubePlatform;
|
||||
} else if (MTK11Tag.equalsIgnoreCase(platform)) {
|
||||
}
|
||||
// else if (CubeTag.equalsIgnoreCase(platform)) {
|
||||
// Log.i(TAG, "checkAppPlatform: " + "ZhanRuiCube");
|
||||
// return CubePlatform;
|
||||
// }
|
||||
else if (MTK11Tag.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "MTK11");
|
||||
return MTK11Platform;
|
||||
} else if (TeclastP20sTag.equalsIgnoreCase(platform)) {
|
||||
@@ -298,7 +302,7 @@ public class JGYUtils {
|
||||
|
||||
public boolean isSamePlatform(String platform) {
|
||||
String AppPlatform = BuildConfig.platform;
|
||||
if ("ZhanRui".equals(AppPlatform)) {
|
||||
if (ZhanruiTag.equals(AppPlatform)) {
|
||||
return ZhanruiTag.equals(platform);
|
||||
} else {
|
||||
return AppPlatform.equals(platform);
|
||||
@@ -311,13 +315,15 @@ public class JGYUtils {
|
||||
|
||||
public void getAppPlatform(GetAppPlatformCallback getAppPlatformCallback) {
|
||||
String platform = BuildConfig.platform;
|
||||
if ("MTK".equalsIgnoreCase(platform)) {
|
||||
if (MTKTag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(MTKPlatform);
|
||||
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
|
||||
} else if (ZhanruiTag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(ZhanruiPlatform);
|
||||
} else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(CubePlatform);
|
||||
} else if ("MTK11".equalsIgnoreCase(platform)) {
|
||||
}
|
||||
// else if ("ZhanRuiCube".equalsIgnoreCase(platform)) {
|
||||
// getAppPlatformCallback.AppPlatform(CubePlatform);
|
||||
// }
|
||||
else if (MTK11Tag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(MTK11Platform);
|
||||
} else if (TeclastP20sTag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(TeclastP20sPlatform);
|
||||
@@ -344,13 +350,15 @@ public class JGYUtils {
|
||||
|
||||
public String getAppPlatform() {
|
||||
String platform = BuildConfig.platform;
|
||||
if ("MTK".equalsIgnoreCase(platform)) {
|
||||
if (MTKTag.equalsIgnoreCase(platform)) {
|
||||
return MTKTag;
|
||||
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
|
||||
} else if (ZhanruiTag.equalsIgnoreCase(platform)) {
|
||||
return ZhanruiTag;
|
||||
} else if (CubeTag.equalsIgnoreCase(platform)) {
|
||||
return CubeTag;
|
||||
} else if (MTK11Tag.equalsIgnoreCase(platform)) {
|
||||
}
|
||||
// else if (CubeTag.equalsIgnoreCase(platform)) {
|
||||
// return CubeTag;
|
||||
// }
|
||||
else if (MTK11Tag.equalsIgnoreCase(platform)) {
|
||||
return MTK11Tag;
|
||||
} else if (TeclastP20sTag.equalsIgnoreCase(platform)) {
|
||||
return TeclastP20sTag;
|
||||
@@ -747,6 +755,7 @@ public class JGYUtils {
|
||||
|
||||
public void setAllowPermissionsPackage(Context context) {
|
||||
Set<String> privilegeApp = mMMKV.decodeStringSet("aole_app_privilege", new HashSet<>());
|
||||
Log.e(TAG, "setAllowPermissionsPackage: " + privilegeApp);
|
||||
Set<String> pkgSet = privilegeApp.stream().filter(s -> ApkUtils.isAvailable(mContext, s)).collect(Collectors.toSet());
|
||||
Log.e(TAG, "setAllowPermissionsPackage: " + pkgSet);
|
||||
if (pkgSet.size() == 0) {
|
||||
@@ -1741,11 +1750,7 @@ public class JGYUtils {
|
||||
String oldMd5 = FileUtils.getFileMD5ToString(bootFile);
|
||||
if (!TextUtils.isEmpty(oldMd5) && oldMd5.equalsIgnoreCase(MD5)) {
|
||||
Log.e(TAG, "checkBootFile: Bootanimation file exists");
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform) {
|
||||
JGYUtils.getInstance().setBootanimationG10J(bootFile.getAbsolutePath());
|
||||
} else {
|
||||
JGYUtils.getInstance().setBootanimation(bootFile.getAbsolutePath());
|
||||
}
|
||||
setBootanimationG10J(bootFile.getAbsolutePath());
|
||||
} else {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("MD5", MD5);
|
||||
@@ -1762,7 +1767,7 @@ public class JGYUtils {
|
||||
|
||||
private static final String BOOTANIMATION_PATH = "/data/local/qchmedia/bootanimation.zip";
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@Deprecated
|
||||
public void setBootanimation(String filePath) {
|
||||
File systemFile = new File(BOOTANIMATION_PATH);
|
||||
if (!systemFile.exists()) {
|
||||
@@ -1897,39 +1902,18 @@ public class JGYUtils {
|
||||
int oldStatu = Settings.System.getInt(crv, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, 1);
|
||||
if (oldStatu == newStatu) {
|
||||
Log.e(TAG, "setDeveloperOptions: oldStatu = " + oldStatu + " no changed");
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "getDeveloper: state = " + state);
|
||||
Log.e(TAG, "setDeveloperOptions: " + JGYUtils.getInstance().checkAppPlatform());
|
||||
if (!BuildConfig.DEBUG) {
|
||||
//这个需要反着来
|
||||
Settings.System.putInt(crv, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, newStatu);
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZR6016Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.HRAD13Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G10PPlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.C2Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.YXPD1Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G11Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MT8768Platform
|
||||
) {
|
||||
Settings.Global.putInt(crv, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, state);
|
||||
Settings.Global.putInt(crv, Settings.Global.ADB_ENABLED, state);
|
||||
}
|
||||
|
||||
/*已废弃 为1关闭,为0打开*/
|
||||
if (newStatu == 1) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("qch_developeroptions_close");
|
||||
intent.setPackage("com.android.settings");
|
||||
mContext.sendBroadcast(intent);
|
||||
Log.e(TAG, "getDeveloper: " + "关闭开发者模式");
|
||||
} else {
|
||||
Log.e(TAG, "getDeveloper: " + "打开开发者模式");
|
||||
}
|
||||
//这个需要反着来
|
||||
Settings.System.putInt(crv, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, newStatu);
|
||||
Log.e(TAG, "setDeveloperOptions: DEVELOPMENT_SETTINGS_ENABLED = " + Settings.Global.getInt(crv, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0));
|
||||
Log.e(TAG, "setDeveloperOptions: ADB_ENABLED = " + Settings.Global.getInt(crv, Settings.Global.ADB_ENABLED, 0));
|
||||
|
||||
if (Settings.Global.getInt(crv, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != state) {
|
||||
Settings.Global.putInt(crv, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, state);
|
||||
}
|
||||
if (Settings.Global.getInt(crv, Settings.Global.ADB_ENABLED, 0) != state) {
|
||||
Settings.Global.putInt(crv, Settings.Global.ADB_ENABLED, state);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2039,18 +2023,21 @@ public class JGYUtils {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
/*知道要跳转应用的包命与目标Activity*/
|
||||
switch (JGYUtils.getInstance().checkAppPlatform()) {
|
||||
default:
|
||||
case JGYUtils.YXPD1Platform:
|
||||
intent.setComponent(new ComponentName("com.adups.fota", "com.adups.fota.GoogleOtaClient"));
|
||||
break;
|
||||
case JGYUtils.C2Platform:
|
||||
intent.setComponent(new ComponentName("com.jintaiyi.update", "com.jintaiyi.update.activity.NoVersionActivity"));
|
||||
break;
|
||||
case JGYUtils.YXPD1Platform:
|
||||
default:
|
||||
intent.setComponent(new ComponentName("com.adups.fota", "com.adups.fota.GoogleOtaClient"));
|
||||
case JGYUtils.ZhanruiPlatform:
|
||||
intent.setComponent(new ComponentName("com.cube.update", "com.cube.update.GoogleOtaClient"));
|
||||
break;
|
||||
}
|
||||
try {
|
||||
mContext.startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "openOTA: " + e.getMessage());
|
||||
Log.e(TAG, "openRomOta: " + e.getMessage());
|
||||
Toaster.show("打开失败");
|
||||
}
|
||||
}
|
||||
@@ -2440,12 +2427,12 @@ public class JGYUtils {
|
||||
public void setDefaultDesktop(String pkg) {
|
||||
Log.e(TAG, "setDefaultDesktop: " + pkg);
|
||||
if (TextUtils.isEmpty(pkg)) {
|
||||
openLauncher3();
|
||||
setLauncher3();
|
||||
} else {
|
||||
String className = getStartClassName(pkg);
|
||||
Log.e(TAG, "setDefaultDesktop: " + className);
|
||||
if (TextUtils.isEmpty(className)) {
|
||||
openLauncher3();
|
||||
setLauncher3();
|
||||
} else {
|
||||
setDefaultDesktop(pkg, className);
|
||||
}
|
||||
@@ -2462,15 +2449,25 @@ public class JGYUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private void openLauncher3() {
|
||||
// ApkUtils.openPackage(mContext, Launcher3);
|
||||
if ("C2".equals(Build.MODEL)) {
|
||||
private void setLauncher3() {
|
||||
if (ApkUtils.isAvailable(mContext, AoleyunOs)
|
||||
|| "C2".equals(Build.MODEL)) {
|
||||
setDefaultDesktop(AoleyunOs, AoleyunOsClass);
|
||||
} else {
|
||||
setDefaultDesktop(Launcher3, Launcher3Class);
|
||||
}
|
||||
}
|
||||
|
||||
public void openLauncher3() {
|
||||
if (ApkUtils.isAvailable(mContext, AoleyunOs)
|
||||
|| "C2".equals(Build.MODEL)) {
|
||||
ApkUtils.openPackage(mContext, AoleyunOs, AoleyunOsClass);
|
||||
} else {
|
||||
ApkUtils.openPackage(mContext, Launcher3, Launcher3Class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getStartClassName(String pkg) {
|
||||
PackageInfo packageInfo = null;
|
||||
try {
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.activity.main.MainActivity;
|
||||
import com.aoleyun.sn.bean.SnSetting;
|
||||
import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
@@ -67,6 +68,7 @@ public class SysSettingUtils {
|
||||
setAdminApp(context, jsonObject);
|
||||
setSystemAppDisable(context, jsonObject);
|
||||
setNotification(context, jsonObject);
|
||||
setPanelShow(context, jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -960,7 +962,7 @@ public class SysSettingUtils {
|
||||
Settings.Global.putInt(context.getContentResolver(), CommonConfig.AOLE_APP_ALLOW_INSTALL, 1);
|
||||
setUsb(context, 0);
|
||||
setBluetoothTransmission(context, 0);
|
||||
JGYUtils.getInstance().setDeveloperOptions(0);
|
||||
// JGYUtils.getInstance().setDeveloperOptions(0);
|
||||
setCanReset(context, 0);
|
||||
setActionBar(context, 0);
|
||||
setNavigationBar(context, 0);
|
||||
@@ -1090,4 +1092,22 @@ public class SysSettingUtils {
|
||||
}
|
||||
context.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
private static void setPanelShow(Context context, JsonObject jsonObject) {
|
||||
JsonElement jsonElement = jsonObject.get("is_control_show");
|
||||
if (jsonElement != null && !jsonElement.isJsonNull()) {
|
||||
int is_control_show = jsonElement.getAsInt();
|
||||
Intent intent = new Intent();
|
||||
switch (is_control_show) {
|
||||
case 1:
|
||||
intent.setAction(MainActivity.PANEL_SHOW);
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
intent.setAction(MainActivity.PANEL_HIDE);
|
||||
break;
|
||||
}
|
||||
context.sendBroadcast(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,7 +737,7 @@ public class Utils {
|
||||
}
|
||||
|
||||
//获取App版本号
|
||||
public static synchronized String getAPPVersionName(String pck, Context context) {
|
||||
public static String getAPPVersionName(String pck, Context context) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
String versionName;
|
||||
try {
|
||||
@@ -1071,7 +1071,7 @@ public class Utils {
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
synchronized public static void doMasterClear(Context context) {
|
||||
public static void doMasterClear(Context context) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Toaster.show("收到重置设备推送消息");
|
||||
return;
|
||||
@@ -1104,7 +1104,7 @@ public class Utils {
|
||||
* @param disallowList 允许
|
||||
* @return
|
||||
*/
|
||||
static synchronized public boolean writeDisableUpdateList(Context context, String[] allowList, String[] disallowList) {
|
||||
static public boolean writeDisableUpdateList(Context context, String[] allowList, String[] disallowList) {
|
||||
String now = Settings.System.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
|
||||
String[] nowList;
|
||||
List<String> allList;
|
||||
@@ -1568,7 +1568,7 @@ public class Utils {
|
||||
* @param mContext
|
||||
* @return
|
||||
*/
|
||||
synchronized private static int getBatteryLevel(Context mContext) {
|
||||
private static int getBatteryLevel(Context mContext) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return ((BatteryManager) mContext.getSystemService(Context.BATTERY_SERVICE)).getIntProperty(4);
|
||||
} else {
|
||||
@@ -1764,7 +1764,7 @@ public class Utils {
|
||||
*/
|
||||
public static String getCustomVersion() {
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform
|
||||
// || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK11Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.TeclastP20sPlatform
|
||||
@@ -1791,9 +1791,11 @@ public class Utils {
|
||||
public static String getRomVersion() {
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform) {
|
||||
return getProperty("ro.build.id", "获取失败");
|
||||
} else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform) {
|
||||
return Utils.getProperty("ro.build.id", "获取失败");
|
||||
} else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform) {
|
||||
}
|
||||
// else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.CubePlatform) {
|
||||
// return Utils.getProperty("ro.build.id", "获取失败");
|
||||
// }
|
||||
else if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform) {
|
||||
return Utils.getProperty("ro.build.id", "获取失败");
|
||||
} else {
|
||||
return getProperty("ro.build.display.id", "获取失败");
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.aoleyun.sn.view;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.databinding.BindingAdapter;
|
||||
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.utils.GlideLoadUtils;
|
||||
import com.bumptech.glide.Glide;
|
||||
|
||||
public class DataBindingAdapter {
|
||||
@BindingAdapter("android:src")
|
||||
public static void setSrc(ImageView view, Bitmap bitmap) {
|
||||
view.setImageBitmap(bitmap);
|
||||
}
|
||||
|
||||
@BindingAdapter("android:src")
|
||||
public static void setSrc(ImageView view, int resId) {
|
||||
view.setImageResource(resId);
|
||||
}
|
||||
|
||||
@BindingAdapter("imageUrl")
|
||||
public static void setSrc(ImageView imageView, String url) {
|
||||
Glide.with(imageView.getContext())
|
||||
.load(url)
|
||||
.error(R.mipmap.ic_launcher)
|
||||
.centerCrop()
|
||||
.into(imageView);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义设置图片属性 - 在匹配时自定义命名空间会被忽略
|
||||
*/
|
||||
@BindingAdapter({"imageUrl", "error"})
|
||||
public static void loadImage(ImageView imageView, String url, Drawable error) {
|
||||
GlideLoadUtils.getInstance().glideLoadc(imageView.getContext(), url, imageView, error);
|
||||
}
|
||||
|
||||
@BindingAdapter({"loadUrl"})
|
||||
public static void loadUrl(ImageView imageView, String url) {
|
||||
if (TextUtils.isEmpty(url)) {
|
||||
imageView.setVisibility(View.GONE);
|
||||
} else {
|
||||
imageView.setVisibility(View.VISIBLE);
|
||||
Glide.with(imageView.getContext())
|
||||
.load(url)
|
||||
.into(imageView);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -142,13 +142,13 @@
|
||||
android:id="@+id/tv_activation_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="激活时间"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="@dimen/sp_9"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name"
|
||||
tools:text="激活时间" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -203,12 +203,14 @@
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:background="@color/text_gray"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
@@ -247,12 +249,13 @@
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:background="@color/text_gray"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_class"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
@@ -285,6 +288,15 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1px"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:background="@color/text_gray"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -301,6 +313,7 @@
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_weight="4"
|
||||
android:background="@drawable/card_background">
|
||||
|
||||
@@ -561,11 +574,15 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_bindinfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_weight="4"
|
||||
android:background="@drawable/card_background">
|
||||
android:background="@drawable/card_background"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bind_statu"
|
||||
|
||||
@@ -9,6 +9,18 @@
|
||||
<variable
|
||||
name="click"
|
||||
type="com.aoleyun.sn.activity.main.MainActivity.BtnClick" />
|
||||
|
||||
<variable
|
||||
name="studentsInfo"
|
||||
type="com.aoleyun.sn.bean.StudentsInfo" />
|
||||
|
||||
<variable
|
||||
name="appSettings"
|
||||
type="com.aoleyun.sn.bean.AppSettings" />
|
||||
|
||||
<import type="android.text.TextUtils" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -71,6 +83,7 @@
|
||||
android:text="日志上传"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:visibility="@{appSettings==null||appSettings.logs_control==0?View.GONE:View.VISIBLE}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -142,13 +155,13 @@
|
||||
android:id="@+id/tv_activation_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="激活时间"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="@dimen/sp_9"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name"
|
||||
tools:text="激活时间" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -167,20 +180,22 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
android:layout_weight="1"
|
||||
android:visibility="@{appSettings==null||appSettings.custom_batch_control==0?View.GONE:View.VISIBLE}">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView11"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:text="设备批次"
|
||||
android:text="@{appSettings==null||TextUtils.isEmpty(appSettings.custom_batch_name)?`设备批次`:appSettings.custom_batch_name }"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginStart="@dimen/dp_16" />
|
||||
app:layout_goneMarginStart="@dimen/dp_16"
|
||||
tools:text="设备批次" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_batch"
|
||||
@@ -190,12 +205,13 @@
|
||||
android:ellipsize="end"
|
||||
android:maxLength="30"
|
||||
android:singleLine="true"
|
||||
android:text="@string/unknown"
|
||||
android:text="@{studentsInfo==null||TextUtils.isEmpty(studentsInfo.batch)?@string/unknown:studentsInfo.batch }"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@string/unknown" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
@@ -203,28 +219,32 @@
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:background="@color/text_gray"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
android:layout_weight="1"
|
||||
android:visibility="@{appSettings==null||appSettings.custom_number_control==0?View.GONE:View.VISIBLE}">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:text="设备学号"
|
||||
android:text="@{appSettings==null||TextUtils.isEmpty(appSettings.custom_number_name)?`设备学号`:appSettings.custom_number_name }"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginStart="@dimen/dp_16" />
|
||||
app:layout_goneMarginStart="@dimen/dp_16"
|
||||
tools:text="设备学号" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_number"
|
||||
@@ -247,28 +267,31 @@
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:background="@color/text_gray"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_class"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
android:layout_weight="1"
|
||||
android:visibility="@{appSettings==null||appSettings.custom_class_control==0?View.GONE:View.VISIBLE}">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView9"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:text="设备班级"
|
||||
android:text="@{appSettings==null||TextUtils.isEmpty(appSettings.custom_class_name)?`设备学号`:appSettings.custom_class_name }"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginStart="@dimen/dp_16" />
|
||||
app:layout_goneMarginStart="@dimen/dp_16"
|
||||
tools:text="设备班级" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_class"
|
||||
@@ -285,6 +308,15 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1px"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:background="@color/text_gray"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -301,6 +333,7 @@
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginTop="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_weight="4"
|
||||
android:background="@drawable/card_background">
|
||||
|
||||
@@ -561,11 +594,15 @@
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_bindinfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_weight="4"
|
||||
android:background="@drawable/card_background">
|
||||
android:background="@drawable/card_background"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bind_statu"
|
||||
@@ -611,6 +648,8 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/aoleyun_qrcode"
|
||||
app:error="@{@drawable/aoleyun_qrcode}"
|
||||
app:imageUrl="@{appSettings.mini_qrcode}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<string name="device_data">设备型号</string>
|
||||
<string name="scan_code_to_register">扫码注册小程序</string>
|
||||
<string name="not_set">未设置</string>
|
||||
<string name="unknown">unknown</string>
|
||||
<string name="unknown">—</string>
|
||||
<string name="wifi_disconnected">wifi已断开</string>
|
||||
<string name="turn_off_wifi">系统关闭wifi</string>
|
||||
<string name="turn_on_wifi">系统开启wifi</string>
|
||||
|
||||
Reference in New Issue
Block a user