version:huaruian 1.1.1
fix:修复自动升级后不下载桌面和其他更新 update:增加bugly
This commit is contained in:
@@ -79,15 +79,15 @@ android {
|
|||||||
|
|
||||||
AH6016 {
|
AH6016 {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 8
|
versionCode 9
|
||||||
versionName "1.7"
|
versionName "1.8"
|
||||||
buildConfigField "String", "platform", '"AH6016"'
|
buildConfigField "String", "platform", '"AH6016"'
|
||||||
}
|
}
|
||||||
|
|
||||||
G10Z {
|
G10Z {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 8
|
versionCode 9
|
||||||
versionName "1.7"
|
versionName "1.8"
|
||||||
buildConfigField "String", "platform", '"ZR6016"'
|
buildConfigField "String", "platform", '"ZR6016"'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,9 +109,9 @@ android {
|
|||||||
|
|
||||||
Huaruian {
|
Huaruian {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 9
|
versionCode 12
|
||||||
versionName "1.0.8"
|
versionName "1.1.1"
|
||||||
buildConfigField "String", "platform", '"MTK11"'
|
buildConfigField "String", "platform", '"ZR6016"'
|
||||||
}
|
}
|
||||||
|
|
||||||
Teclast {
|
Teclast {
|
||||||
@@ -439,6 +439,8 @@ dependencies {
|
|||||||
implementation 'com.baidu.lbsyun:BaiduMapSDK_Location:9.1.8'
|
implementation 'com.baidu.lbsyun:BaiduMapSDK_Location:9.1.8'
|
||||||
//MMKV
|
//MMKV
|
||||||
implementation 'com.tencent:mmkv-static:1.2.13'
|
implementation 'com.tencent:mmkv-static:1.2.13'
|
||||||
|
//bugly
|
||||||
|
implementation 'com.tencent.bugly:crashreport:4.1.9.2'
|
||||||
//工具类
|
//工具类
|
||||||
implementation 'com.blankj:utilcodex:1.31.0'
|
implementation 'com.blankj:utilcodex:1.31.0'
|
||||||
//Aria
|
//Aria
|
||||||
|
|||||||
@@ -95,44 +95,44 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
|
||||||
|
|
||||||
<!-- 【必须】 移动推送 TPNS SDK 所需权限 -->
|
<!-- 【必须】 移动推送 TPNS SDK 所需权限 -->
|
||||||
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
||||||
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />-->
|
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />-->
|
||||||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
||||||
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
|
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
|
||||||
|
|
||||||
<!-- 【常用】 移动推送 TPNS SDK所需权限 -->
|
<!-- 【常用】 移动推送 TPNS SDK所需权限 -->
|
||||||
<!-- <uses-permission android:name="android.permission.WAKE_LOCK" />-->
|
<!-- <uses-permission android:name="android.permission.WAKE_LOCK" />-->
|
||||||
<!-- <uses-permission android:name="android.permission.VIBRATE" />-->
|
<!-- <uses-permission android:name="android.permission.VIBRATE" />-->
|
||||||
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
|
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
|
||||||
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
||||||
<!-- <uses-permission android:name="android.permission.GET_TASKS" />-->
|
<!-- <uses-permission android:name="android.permission.GET_TASKS" />-->
|
||||||
|
|
||||||
<!-- 高德地图 -->
|
<!-- 高德地图 -->
|
||||||
<!-- 用于进行网络定位 -->
|
<!-- 用于进行网络定位 -->
|
||||||
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />-->
|
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />-->
|
||||||
<!-- 用于访问GPS定位 -->
|
<!-- 用于访问GPS定位 -->
|
||||||
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />-->
|
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />-->
|
||||||
<!-- 用于获取运营商信息,用于支持提供运营商信息相关的接口 -->
|
<!-- 用于获取运营商信息,用于支持提供运营商信息相关的接口 -->
|
||||||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
|
||||||
<!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
|
<!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
|
||||||
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />-->
|
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />-->
|
||||||
<!-- 用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
|
<!-- 用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
|
||||||
<!-- <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />-->
|
<!-- <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />-->
|
||||||
<!-- 用于访问网络,网络定位需要上网 -->
|
<!-- 用于访问网络,网络定位需要上网 -->
|
||||||
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
|
||||||
<!-- 用于读取手机当前的状态 -->
|
<!-- 用于读取手机当前的状态 -->
|
||||||
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
|
||||||
<!-- 用于写入缓存数据到扩展存储卡 -->
|
<!-- 用于写入缓存数据到扩展存储卡 -->
|
||||||
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />-->
|
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />-->
|
||||||
<!-- 用于申请调用A-GPS模块 -->
|
<!-- 用于申请调用A-GPS模块 -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||||
<!-- 如果设置了target >= 28 如果需要启动后台定位则必须声明这个权限 -->
|
<!-- 如果设置了target >= 28 如果需要启动后台定位则必须声明这个权限 -->
|
||||||
<!-- <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />-->
|
<!-- <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />-->
|
||||||
<!-- 如果您的应用需要后台定位权限,且有可能运行在Android Q设备上,并且设置了target>28,必须增加这个权限声明 -->
|
<!-- 如果您的应用需要后台定位权限,且有可能运行在Android Q设备上,并且设置了target>28,必须增加这个权限声明 -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name="com.aoleyun.sn.base.BaseApplication"
|
android:name=".base.BaseApplication"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
@@ -140,7 +140,9 @@
|
|||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<activity android:name="com.aoleyun.sn.activity.SplashActivity">
|
<activity
|
||||||
|
android:name=".activity.SplashActivity"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
@@ -148,27 +150,27 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.aoleyun.sn.activity.checknet.CheckNetActivity"
|
android:name=".activity.checknet.CheckNetActivity"
|
||||||
android:theme="@style/activity_styles">
|
android:theme="@style/activity_styles">
|
||||||
<!-- <intent-filter>-->
|
<!-- <intent-filter>-->
|
||||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||||
|
|
||||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||||
<!-- </intent-filter>-->
|
<!-- </intent-filter>-->
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="com.aoleyun.sn.activity.main.MainActivity"
|
android:name=".activity.main.MainActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:screenOrientation="userPortrait" />
|
android:screenOrientation="userPortrait" />
|
||||||
<activity android:name="com.aoleyun.sn.activity.TopActivity" />
|
<activity android:name=".activity.TopActivity" />
|
||||||
<activity android:name="com.aoleyun.sn.activity.MainActivity1" />
|
<activity android:name=".activity.MainActivity1" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.aoleyun.sn.activity.requestlog.RequestLogActivity"
|
android:name=".activity.requestlog.RequestLogActivity"
|
||||||
android:launchMode="singleTask" />
|
android:launchMode="singleTask" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="com.aoleyun.sn.service.main.MainService"
|
android:name=".service.main.MainService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter android:priority="1000">
|
<intent-filter android:priority="1000">
|
||||||
@@ -180,16 +182,16 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
<service
|
<service
|
||||||
android:name="com.aoleyun.sn.service.RemoteService"
|
android:name=".service.RemoteService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:process=":remote" />
|
android:process=":remote" />
|
||||||
<service
|
<service
|
||||||
android:name="com.aoleyun.sn.service.LogcatService"
|
android:name=".service.LogcatService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
<service
|
<service
|
||||||
android:name="com.aoleyun.sn.service.GuardService"
|
android:name=".service.GuardService"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter android:priority="1000">
|
<intent-filter android:priority="1000">
|
||||||
<action android:name="android.intent.action.USER_PRESENT" />
|
<action android:name="android.intent.action.USER_PRESENT" />
|
||||||
@@ -207,7 +209,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
<service
|
<service
|
||||||
android:name="com.aoleyun.sn.service.StepService"
|
android:name=".service.StepService"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter android:priority="1000">
|
<intent-filter android:priority="1000">
|
||||||
<action android:name="android.intent.action.SCREEN_OFF" />
|
<action android:name="android.intent.action.SCREEN_OFF" />
|
||||||
@@ -224,7 +226,7 @@
|
|||||||
</service>
|
</service>
|
||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
android:name="com.aoleyun.sn.receiver.NewAppReceiver"
|
android:name=".receiver.NewAppReceiver"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:permission="com.example.broadcast.permission">
|
android:permission="com.example.broadcast.permission">
|
||||||
@@ -237,11 +239,11 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<receiver
|
<receiver
|
||||||
android:name="com.aoleyun.sn.utils.InstallResultReceiver"
|
android:name=".utils.InstallResultReceiver"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
<receiver
|
<receiver
|
||||||
android:name="com.aoleyun.sn.receiver.BootReceiver"
|
android:name=".receiver.BootReceiver"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter android:priority="1000">
|
<intent-filter android:priority="1000">
|
||||||
@@ -298,7 +300,7 @@
|
|||||||
|
|
||||||
<!-- 消息接收监听器 (用户可自主扩展) -->
|
<!-- 消息接收监听器 (用户可自主扩展) -->
|
||||||
<receiver
|
<receiver
|
||||||
android:name="com.aoleyun.sn.push.alipush.AliyunMessageReceiver"
|
android:name=".push.alipush.AliyunMessageReceiver"
|
||||||
android:exported="false">
|
android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
|
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
|
||||||
@@ -311,22 +313,22 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<!-- <service-->
|
<!-- <service-->
|
||||||
<!-- android:name=".push.alipush.AliMessageIntentService"-->
|
<!-- android:name=".push.alipush.AliMessageIntentService"-->
|
||||||
<!-- android:exported="false">-->
|
<!-- android:exported="false">-->
|
||||||
<!-- <intent-filter>-->
|
<!-- <intent-filter>-->
|
||||||
<!-- <action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />-->
|
<!-- <action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />-->
|
||||||
<!-- </intent-filter>-->
|
<!-- </intent-filter>-->
|
||||||
<!-- <intent-filter>-->
|
<!-- <intent-filter>-->
|
||||||
<!-- <action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />-->
|
<!-- <action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />-->
|
||||||
<!-- </intent-filter>-->
|
<!-- </intent-filter>-->
|
||||||
<!-- <intent-filter>-->
|
<!-- <intent-filter>-->
|
||||||
<!-- <action android:name="com.alibaba.sdk.android.push.RECEIVE" />-->
|
<!-- <action android:name="com.alibaba.sdk.android.push.RECEIVE" />-->
|
||||||
<!-- </intent-filter>-->
|
<!-- </intent-filter>-->
|
||||||
<!-- </service>-->
|
<!-- </service>-->
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.aoleyun.sn.base.CustomGlideModule"
|
android:name=".base.CustomGlideModule"
|
||||||
android:value="AppGlideModule" />
|
android:value="AppGlideModule" />
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.baidu.lbsapi.API_KEY"
|
android:name="com.baidu.lbsapi.API_KEY"
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public class MainAContact {
|
|||||||
void getQrCode(boolean loocked);
|
void getQrCode(boolean loocked);
|
||||||
/*获取学生信息*/
|
/*获取学生信息*/
|
||||||
void getStudesInfo();
|
void getStudesInfo();
|
||||||
|
//获取电子书包激活码
|
||||||
|
void getEBagCode();
|
||||||
/*获取公网ip*/
|
/*获取公网ip*/
|
||||||
void getPublicIp();
|
void getPublicIp();
|
||||||
/*手动获取设备信息更新*/
|
/*手动获取设备信息更新*/
|
||||||
@@ -24,6 +26,8 @@ public class MainAContact {
|
|||||||
void checkAoleyunUpdate();
|
void checkAoleyunUpdate();
|
||||||
/*获取测试应用更新*/
|
/*获取测试应用更新*/
|
||||||
void checkTestUpdate();
|
void checkTestUpdate();
|
||||||
|
/*获取桌面*/
|
||||||
|
void getDefaultDesktop();
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface MainView extends BaseView {
|
public interface MainView extends BaseView {
|
||||||
@@ -33,6 +37,8 @@ public class MainAContact {
|
|||||||
void setQrCode(Bitmap qrcode);
|
void setQrCode(Bitmap qrcode);
|
||||||
/*获取学生信息*/
|
/*获取学生信息*/
|
||||||
void setStudesInfo(StudentsInfo studesInfo);
|
void setStudesInfo(StudentsInfo studesInfo);
|
||||||
|
//获取电子书包激活码
|
||||||
|
void getEBagCodeFinish();
|
||||||
/*获取公网ip*/
|
/*获取公网ip*/
|
||||||
void setPublicIp(String ip);
|
void setPublicIp(String ip);
|
||||||
/*手动获取设备信息更新*/
|
/*手动获取设备信息更新*/
|
||||||
@@ -41,5 +47,7 @@ public class MainAContact {
|
|||||||
void checkAoleyunUpdateFinish();
|
void checkAoleyunUpdateFinish();
|
||||||
/*获取测试应用更新*/
|
/*获取测试应用更新*/
|
||||||
void checkTestUpdateFinish();
|
void checkTestUpdateFinish();
|
||||||
|
/*获取桌面结束*/
|
||||||
|
void getDefaultDesktopFinish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,16 @@ public class MainAPresenter implements MainAContact.Presenter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getEBagCode() {
|
||||||
|
NetInterfaceManager.getInstance().getEBagCode(true, getLifecycle(), new NetInterfaceManager.onCompleteCallback() {
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
mView.getEBagCodeFinish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getPublicIp() {
|
public void getPublicIp() {
|
||||||
NetInterfaceManager.getInstance().getPublicIp(lifecycle, ip -> mView.setPublicIp(ip));
|
NetInterfaceManager.getInstance().getPublicIp(lifecycle, ip -> mView.setPublicIp(ip));
|
||||||
@@ -146,6 +156,29 @@ public class MainAPresenter implements MainAContact.Presenter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void checkUpdateInfo() {
|
private void checkUpdateInfo() {
|
||||||
NetInterfaceManager.getInstance()
|
NetInterfaceManager.getInstance()
|
||||||
.getUpdateApi()
|
.getUpdateApi()
|
||||||
|
|||||||
@@ -78,10 +78,20 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
|||||||
TextView tv_name;
|
TextView tv_name;
|
||||||
@BindView(R.id.tv_batch)
|
@BindView(R.id.tv_batch)
|
||||||
TextView tv_batch;
|
TextView tv_batch;
|
||||||
|
@BindView(R.id.cl_student)
|
||||||
|
ConstraintLayout cl_student;
|
||||||
@BindView(R.id.tv_number)
|
@BindView(R.id.tv_number)
|
||||||
TextView tv_number;
|
TextView tv_number;
|
||||||
|
@BindView(R.id.cl_serial)
|
||||||
|
ConstraintLayout cl_serial;
|
||||||
|
@BindView(R.id.cl_class)
|
||||||
|
ConstraintLayout cl_class;
|
||||||
@BindView(R.id.tv_class)
|
@BindView(R.id.tv_class)
|
||||||
TextView tv_class;
|
TextView tv_class;
|
||||||
|
@BindView(R.id.cl_number_name)
|
||||||
|
ConstraintLayout cl_number_name;
|
||||||
|
@BindView(R.id.tv_number_name)
|
||||||
|
TextView tv_number_name;
|
||||||
@BindView(R.id.tv_model)
|
@BindView(R.id.tv_model)
|
||||||
TextView tv_model;
|
TextView tv_model;
|
||||||
@BindView(R.id.cl_ota)
|
@BindView(R.id.cl_ota)
|
||||||
@@ -116,26 +126,6 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
|||||||
@BindView(R.id.tv_bind_time)
|
@BindView(R.id.tv_bind_time)
|
||||||
TextView tv_bind_time;
|
TextView tv_bind_time;
|
||||||
|
|
||||||
// @BindView(R.id.tv_class_name)
|
|
||||||
// TextView tv_class_name;
|
|
||||||
// @BindView(R.id.tv_number_name)
|
|
||||||
// TextView tv_number_name;
|
|
||||||
// @BindView(R.id.chkupd)
|
|
||||||
// Button bt_checkupdate;
|
|
||||||
// @BindView(R.id.checkupdate)
|
|
||||||
// ConstraintLayout checkupdate;
|
|
||||||
// @BindView(R.id.iv_locked)
|
|
||||||
// ImageView iv_locked;
|
|
||||||
// @BindView(R.id.layout_class)
|
|
||||||
// ConstraintLayout layout_class;
|
|
||||||
// @BindView(R.id.layout_number)
|
|
||||||
// ConstraintLayout layout_number;
|
|
||||||
// @BindView(R.id.layout_name)
|
|
||||||
// ConstraintLayout layout_name;
|
|
||||||
// @BindView(R.id.cl_imei)
|
|
||||||
// ConstraintLayout cl_imei;
|
|
||||||
|
|
||||||
|
|
||||||
@OnClick({R.id.iv_back, R.id.tv_title})
|
@OnClick({R.id.iv_back, R.id.tv_title})
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
switch (view.getId()) {
|
switch (view.getId()) {
|
||||||
@@ -197,7 +187,26 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
|||||||
} else {
|
} else {
|
||||||
tv_signal.setText("未连接");
|
tv_signal.setText("未连接");
|
||||||
}
|
}
|
||||||
// setStoreUpdateListener(bt_checkupdate);
|
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.AH6016Platform) {
|
||||||
|
cl_student.setVisibility(View.GONE);
|
||||||
|
cl_serial.setVisibility(View.VISIBLE);
|
||||||
|
cl_class.setVisibility(View.GONE);
|
||||||
|
cl_number_name.setVisibility(View.VISIBLE);
|
||||||
|
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 {
|
||||||
|
cl_student.setVisibility(View.VISIBLE);
|
||||||
|
cl_serial.setVisibility(View.GONE);
|
||||||
|
cl_class.setVisibility(View.VISIBLE);
|
||||||
|
cl_number_name.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
// setStoreUpdateListener(bt_checkupdate);
|
||||||
registerReceiver();
|
registerReceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -358,6 +367,7 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
|||||||
setBatchText("", View.GONE);
|
setBatchText("", View.GONE);
|
||||||
SysSettingUtils.setEnableSetting(this);
|
SysSettingUtils.setEnableSetting(this);
|
||||||
}
|
}
|
||||||
|
mMainAPresenter.getEBagCode();
|
||||||
mMainAPresenter.getQrCode(loocked);
|
mMainAPresenter.getQrCode(loocked);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -408,6 +418,11 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
|||||||
SPUtils.put(this, CommonConfig.ADMIN_ID, studesInfo.getAdmin_id());
|
SPUtils.put(this, CommonConfig.ADMIN_ID, studesInfo.getAdmin_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getEBagCodeFinish() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPublicIp(String ip) {
|
public void setPublicIp(String ip) {
|
||||||
Log.e(TAG, "setPublicIp: " + ip);
|
Log.e(TAG, "setPublicIp: " + ip);
|
||||||
@@ -473,7 +488,12 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkTestUpdateFinish() {
|
public void checkTestUpdateFinish() {
|
||||||
|
mMainAPresenter.getDefaultDesktop();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getDefaultDesktopFinish() {
|
||||||
|
Log.e(TAG, "getDefaultDesktopFinish: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showUpdateDialog(JsonObject jsonObject) {
|
private void showUpdateDialog(JsonObject jsonObject) {
|
||||||
|
|||||||
@@ -23,8 +23,17 @@ import com.aoleyun.sn.utils.Utils;
|
|||||||
import com.aoleyun.sn.utils.WiFiUtils;
|
import com.aoleyun.sn.utils.WiFiUtils;
|
||||||
import com.aoleyun.sn.utils.XAPKUtils;
|
import com.aoleyun.sn.utils.XAPKUtils;
|
||||||
import com.arialyy.aria.core.Aria;
|
import com.arialyy.aria.core.Aria;
|
||||||
|
import com.tencent.bugly.crashreport.CrashReport;
|
||||||
import com.tencent.mmkv.MMKV;
|
import com.tencent.mmkv.MMKV;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
public class BaseApplication extends MultiDexApplication {
|
public class BaseApplication extends MultiDexApplication {
|
||||||
private static final String TAG = BaseApplication.class.getSimpleName();
|
private static final String TAG = BaseApplication.class.getSimpleName();
|
||||||
|
|
||||||
@@ -45,7 +54,13 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
String rootDir = MMKV.initialize(this);
|
String rootDir = MMKV.initialize(this);
|
||||||
Log.e(TAG, "mmkv root: " + rootDir);
|
Log.e(TAG, "mmkv root: " + rootDir);
|
||||||
|
|
||||||
|
CrashReport.initCrashReport(getApplicationContext(), "b16b3c7f1a", false);
|
||||||
|
CrashReport.setDeviceModel(this, Utils.getSerial(this));
|
||||||
|
|
||||||
PushManager.init(this);
|
PushManager.init(this);
|
||||||
|
initRegisterObservable();
|
||||||
|
initAliasObservable();
|
||||||
|
initTagObservable();
|
||||||
aliyunPushInit();
|
aliyunPushInit();
|
||||||
|
|
||||||
ToastUtil.init(this);
|
ToastUtil.init(this);
|
||||||
@@ -91,6 +106,52 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface OnRegisterResult {
|
||||||
|
void onResult(String code);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static OnRegisterResult mOnRegisterResult;
|
||||||
|
|
||||||
|
private void initRegisterObservable() {
|
||||||
|
Log.e(TAG, "initTagObservable: ");
|
||||||
|
Observable.create(new ObservableOnSubscribe<String>() {
|
||||||
|
@Override
|
||||||
|
public void subscribe(ObservableEmitter<String> emitter) {
|
||||||
|
mOnRegisterResult = new OnRegisterResult() {
|
||||||
|
@Override
|
||||||
|
public void onResult(String code) {
|
||||||
|
Log.e("initRegisterObservable", "onResult: " + code);
|
||||||
|
emitter.onNext(code);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}).throttleLast(60, TimeUnit.SECONDS)
|
||||||
|
.subscribe(new Observer<String>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(String code) {
|
||||||
|
Log.e("initRegisterObservable", "onNext: " + code);
|
||||||
|
Log.e("initRegisterObservable", "onNext: 重新注册aliyunPush");
|
||||||
|
aliyunPushInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void aliyunPushInit() {
|
private void aliyunPushInit() {
|
||||||
PushServiceFactory.init(this);
|
PushServiceFactory.init(this);
|
||||||
final CloudPushService pushService = PushServiceFactory.getCloudPushService();
|
final CloudPushService pushService = PushServiceFactory.getCloudPushService();
|
||||||
@@ -106,13 +167,56 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
@Override
|
@Override
|
||||||
public void onFailed(String errorCode, String errorMessage) {
|
public void onFailed(String errorCode, String errorMessage) {
|
||||||
Log.e("AliyunPush", "init cloudchannel failed -- errorcode:" + errorCode + " -- errorMessage:" + errorMessage);
|
Log.e("AliyunPush", "init cloudchannel failed -- errorcode:" + errorCode + " -- errorMessage:" + errorMessage);
|
||||||
Handler.getMain().postDelayed(new Runnable() {
|
mOnRegisterResult.onResult(errorCode);
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Log.e("AliyunPush", "retry register");
|
|
||||||
aliyunPushInit();
|
|
||||||
}
|
}
|
||||||
}, 30000);
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
interface OnAliasResult {
|
||||||
|
void onResult(String code);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static OnAliasResult mOnAliasResult;
|
||||||
|
|
||||||
|
private void initAliasObservable() {
|
||||||
|
Log.e(TAG, "initAliasObservable: ");
|
||||||
|
Observable.create(new ObservableOnSubscribe<String>() {
|
||||||
|
@Override
|
||||||
|
public void subscribe(ObservableEmitter<String> emitter) throws Exception {
|
||||||
|
mOnAliasResult = new OnAliasResult() {
|
||||||
|
@Override
|
||||||
|
public void onResult(String code) {
|
||||||
|
Log.e("initAliasObservable", "onResult: " + code);
|
||||||
|
emitter.onNext(code);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}).throttleLast(60, TimeUnit.SECONDS)
|
||||||
|
.subscribe(new Observer<String>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(String code) {
|
||||||
|
Log.e("initAliasObservable", "onNext: " + code);
|
||||||
|
switch (code){
|
||||||
|
case "PUSH_20101":
|
||||||
|
aliyunPushInit();
|
||||||
|
default:
|
||||||
|
setAlias();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -133,13 +237,7 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
public void onFailed(String errorCode, String errorMsg) {
|
public void onFailed(String errorCode, String errorMsg) {
|
||||||
Log.e("AliyunPush", "bind account " + sn + " failed." +
|
Log.e("AliyunPush", "bind account " + sn + " failed." +
|
||||||
"errorCode: " + errorCode + ", errorMsg:" + errorMsg);
|
"errorCode: " + errorCode + ", errorMsg:" + errorMsg);
|
||||||
Handler.getMain().postDelayed(new Runnable() {
|
mOnAliasResult.onResult(errorCode);
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Log.e("AliyunPush", "retry bindAccount");
|
|
||||||
setAlias();
|
|
||||||
}
|
|
||||||
}, 30000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
pushService.addAlias(sn, new CommonCallback() {
|
pushService.addAlias(sn, new CommonCallback() {
|
||||||
@@ -152,15 +250,56 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
public void onFailed(String errorCode, String errorMsg) {
|
public void onFailed(String errorCode, String errorMsg) {
|
||||||
Log.e("AliyunPush", "add alias " + sn + " failed." +
|
Log.e("AliyunPush", "add alias " + sn + " failed." +
|
||||||
"errorCode: " + errorCode + ", errorMsg:" + errorMsg + "\n");
|
"errorCode: " + errorCode + ", errorMsg:" + errorMsg + "\n");
|
||||||
Handler.getMain().postDelayed(new Runnable() {
|
mOnAliasResult.onResult(errorCode);
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Log.e("AliyunPush", "retry addAlias");
|
|
||||||
setAlias();
|
|
||||||
}
|
|
||||||
}, 30000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void onTagOperatorResult(String code) {
|
||||||
|
onTagResult.onResult(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static OnTagResult onTagResult;
|
||||||
|
|
||||||
|
interface OnTagResult {
|
||||||
|
void onResult(String code);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initTagObservable() {
|
||||||
|
Log.e(TAG, "initTagObservable: ");
|
||||||
|
Observable.create(new ObservableOnSubscribe<String>() {
|
||||||
|
@Override
|
||||||
|
public void subscribe(ObservableEmitter<String> emitter) {
|
||||||
|
onTagResult = new OnTagResult() {
|
||||||
|
@Override
|
||||||
|
public void onResult(String code) {
|
||||||
|
Log.e("initTagObservable", "onResult: " + code);
|
||||||
|
emitter.onNext(code);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}).throttleLast(60, TimeUnit.SECONDS)
|
||||||
|
.subscribe(new Observer<String>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(String code) {
|
||||||
|
Log.e("initTagObservable", "onNext: " + code);
|
||||||
|
NetInterfaceManager.getInstance().setPushTags();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,8 +31,11 @@ public class CommonConfig {
|
|||||||
*/
|
*/
|
||||||
public final static String DEVICES_FRIST_START = "DEVICES_FRIST_START";
|
public final static String DEVICES_FRIST_START = "DEVICES_FRIST_START";
|
||||||
|
|
||||||
|
/*是否激活*/
|
||||||
|
public static final String UIUI_ACTIVATION_KEY = "uiui_activation";
|
||||||
/*保存激活码*/
|
/*保存激活码*/
|
||||||
public static final String ACTIVATIONBEAN_CODE_KEY = "UIUI_ACTIVATIONBEAN_CODE";
|
public static final String ACTIVATIONBEAN_CODE_KEY = "UIUI_ACTIVATIONBEAN_CODE";
|
||||||
|
|
||||||
/*保存的应用版本号*/
|
/*保存的应用版本号*/
|
||||||
public final static String SN_VERSIONCODE = "SN_VERSIONCODE";
|
public final static String SN_VERSIONCODE = "SN_VERSIONCODE";
|
||||||
/*重启标识*/
|
/*重启标识*/
|
||||||
@@ -57,6 +60,7 @@ public class CommonConfig {
|
|||||||
public final static String GET_DEVICES_TAG_LASTTIME = "Aoleyun_devices_tag_last_time";
|
public final static String GET_DEVICES_TAG_LASTTIME = "Aoleyun_devices_tag_last_time";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管控系统指令
|
* 管控系统指令
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import com.tencent.mmkv.MMKV;
|
|||||||
public class ConnectManager {
|
public class ConnectManager {
|
||||||
private static final String TAG = ConnectManager.class.getSimpleName();
|
private static final String TAG = ConnectManager.class.getSimpleName();
|
||||||
|
|
||||||
|
public static final long ONE_MILLISECOND = 1000;
|
||||||
public static final long ONE_MINUTES_TIME = 60 * 1000;
|
public static final long ONE_MINUTES_TIME = 60 * ONE_MILLISECOND;
|
||||||
public static final long FIFTEEN_MINUTES_TIME = ONE_MINUTES_TIME * 15;
|
public static final long FIFTEEN_MINUTES_TIME = ONE_MINUTES_TIME * 15;
|
||||||
public static final long HALF_HOUR_TIME = FIFTEEN_MINUTES_TIME * 2;
|
public static final long HALF_HOUR_TIME = FIFTEEN_MINUTES_TIME * 2;
|
||||||
public static final long ONE_HOUR_TIME = HALF_HOUR_TIME * 2;
|
public static final long ONE_HOUR_TIME = HALF_HOUR_TIME * 2;
|
||||||
@@ -107,7 +107,7 @@ public class ConnectManager {
|
|||||||
Log.e(TAG, "isNeedConnect: key = " + key + "\ttime = " + lastTime);
|
Log.e(TAG, "isNeedConnect: key = " + key + "\ttime = " + lastTime);
|
||||||
long intervalTime = getConnectModeTime(connectMode);
|
long intervalTime = getConnectModeTime(connectMode);
|
||||||
//防止一分钟内重复请求
|
//防止一分钟内重复请求
|
||||||
boolean refresh = nowTime - lastTime > intervalTime && nowTime - lastTime > ONE_MINUTES_TIME;
|
boolean refresh = nowTime - lastTime > intervalTime && nowTime - lastTime > ONE_MILLISECOND * 5;
|
||||||
Log.e(TAG, "isNeedConnect: " + refresh);
|
Log.e(TAG, "isNeedConnect: " + refresh);
|
||||||
return refresh;
|
return refresh;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import com.alibaba.sdk.android.push.CloudPushService;
|
|||||||
import com.alibaba.sdk.android.push.CommonCallback;
|
import com.alibaba.sdk.android.push.CommonCallback;
|
||||||
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
|
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory;
|
||||||
import com.aoleyun.sn.BuildConfig;
|
import com.aoleyun.sn.BuildConfig;
|
||||||
|
import com.aoleyun.sn.base.BaseApplication;
|
||||||
import com.aoleyun.sn.bean.AppAttr;
|
import com.aoleyun.sn.bean.AppAttr;
|
||||||
import com.aoleyun.sn.bean.AppID;
|
import com.aoleyun.sn.bean.AppID;
|
||||||
import com.aoleyun.sn.bean.AppLimit;
|
import com.aoleyun.sn.bean.AppLimit;
|
||||||
@@ -55,6 +56,7 @@ import com.aoleyun.sn.manager.ConnectMode;
|
|||||||
import com.aoleyun.sn.network.api.GetWhoisApi;
|
import com.aoleyun.sn.network.api.GetWhoisApi;
|
||||||
import com.aoleyun.sn.network.api.get.CheckTestUpdateApi;
|
import com.aoleyun.sn.network.api.get.CheckTestUpdateApi;
|
||||||
import com.aoleyun.sn.network.api.get.DefaultAppApi;
|
import com.aoleyun.sn.network.api.get.DefaultAppApi;
|
||||||
|
import com.aoleyun.sn.network.api.get.DesktopsDiyUpdateApi;
|
||||||
import com.aoleyun.sn.network.api.get.GetDesktopApi;
|
import com.aoleyun.sn.network.api.get.GetDesktopApi;
|
||||||
import com.aoleyun.sn.network.api.get.GetDeveloperApi;
|
import com.aoleyun.sn.network.api.get.GetDeveloperApi;
|
||||||
import com.aoleyun.sn.network.api.get.GetPushTagsApi;
|
import com.aoleyun.sn.network.api.get.GetPushTagsApi;
|
||||||
@@ -507,6 +509,13 @@ public class NetInterfaceManager {
|
|||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Observable<BaseResponse<ForceDownloadData>> getDesktopsDiyUpdate() {
|
||||||
|
return mRetrofit.create(DesktopsDiyUpdateApi.class)
|
||||||
|
.getDesktopsDiyUpdate(Utils.getSerial(mContext))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
|
}
|
||||||
|
|
||||||
public Observable<ResponseBody> getBatchObservable() {
|
public Observable<ResponseBody> getBatchObservable() {
|
||||||
return mRetrofit.create(GetBatchApi.class)
|
return mRetrofit.create(GetBatchApi.class)
|
||||||
.getBatch(Utils.getSerial(mContext))
|
.getBatch(Utils.getSerial(mContext))
|
||||||
@@ -710,7 +719,7 @@ public class NetInterfaceManager {
|
|||||||
synchronized public void checkAoleyunUpdate(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
synchronized public void checkAoleyunUpdate(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.ONE_MINUTE;
|
connectMode = ConnectMode.DEFAULT;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.CHECK_UPDATE, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.CHECK_UPDATE, connectMode)) {
|
||||||
checkAoleyunUpdate(lifecycle, callback);
|
checkAoleyunUpdate(lifecycle, callback);
|
||||||
@@ -835,9 +844,9 @@ public class NetInterfaceManager {
|
|||||||
* 获取灰度测试更新
|
* 获取灰度测试更新
|
||||||
*/
|
*/
|
||||||
public void checkTestUpdate(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void checkTestUpdate(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.ONE_MINUTE;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.ONE_MINUTE;
|
connectMode = ConnectMode.DEFAULT;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_SN_APP_TEST, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_SN_APP_TEST, connectMode)) {
|
||||||
checkTestUpdate(lifecycle, callback);
|
checkTestUpdate(lifecycle, callback);
|
||||||
@@ -987,9 +996,9 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getDefaultDesktop(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getDefaultDesktop(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.ONE_HOUR;
|
ConnectMode connectMode = ConnectMode.ONE_MINUTE;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.ONE_MINUTE;
|
connectMode = ConnectMode.DEFAULT;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_DESKTOP, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_DESKTOP, connectMode)) {
|
||||||
getDefaultDesktop(lifecycle, callback);
|
getDefaultDesktop(lifecycle, callback);
|
||||||
@@ -1011,33 +1020,70 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void getDefaultDesktop(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getDefaultDesktop(BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
getDesktopObservable()
|
Observable.zip(getDesktopObservable(), getDesktopsDiyUpdate(), new BiFunction<BaseResponse<ForceDownloadData>, BaseResponse<ForceDownloadData>, List<ForceDownloadData>>() {
|
||||||
|
@Override
|
||||||
|
public List<ForceDownloadData> apply(BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse, BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse2) throws Throwable {
|
||||||
|
List<ForceDownloadData> forceDownloadDataList = new ArrayList<>();
|
||||||
|
if (forceDownloadDataBaseResponse.code == 200) {
|
||||||
|
forceDownloadDataList.add(forceDownloadDataBaseResponse.data);
|
||||||
|
}
|
||||||
|
if (forceDownloadDataBaseResponse2.code == 200) {
|
||||||
|
forceDownloadDataList.add(forceDownloadDataBaseResponse2.data);
|
||||||
|
}
|
||||||
|
return forceDownloadDataList;
|
||||||
|
}
|
||||||
|
})
|
||||||
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
.compose(RxLifecycle.bindUntilEvent(lifecycle, ActivityEvent.DESTROY))
|
||||||
.subscribe(getDefaultDesktopObserver(callback));
|
.subscribe(getDefaultDesktopObserver(callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getDefaultDesktop(onCompleteCallback callback) {
|
public void getDefaultDesktop(onCompleteCallback callback) {
|
||||||
getDesktopObservable()
|
Observable.zip(getDesktopObservable(), getDesktopsDiyUpdate(), new BiFunction<BaseResponse<ForceDownloadData>, BaseResponse<ForceDownloadData>, List<ForceDownloadData>>() {
|
||||||
|
@Override
|
||||||
|
public List<ForceDownloadData> apply(BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse, BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse2) throws Throwable {
|
||||||
|
List<ForceDownloadData> forceDownloadDataList = new ArrayList<>();
|
||||||
|
if (forceDownloadDataBaseResponse.code == 200) {
|
||||||
|
forceDownloadDataList.add(forceDownloadDataBaseResponse.data);
|
||||||
|
}
|
||||||
|
if (forceDownloadDataBaseResponse2.code == 200) {
|
||||||
|
forceDownloadDataList.add(forceDownloadDataBaseResponse2.data);
|
||||||
|
}
|
||||||
|
return forceDownloadDataList;
|
||||||
|
}
|
||||||
|
})
|
||||||
.subscribe(getDefaultDesktopObserver(callback));
|
.subscribe(getDefaultDesktopObserver(callback));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getDefaultDesktop() {
|
public void getDefaultDesktop() {
|
||||||
getDesktopObservable()
|
Observable.zip(getDesktopObservable(), getDesktopsDiyUpdate(), new BiFunction<BaseResponse<ForceDownloadData>, BaseResponse<ForceDownloadData>, List<ForceDownloadData>>() {
|
||||||
|
@Override
|
||||||
|
public List<ForceDownloadData> apply(BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse, BaseResponse<ForceDownloadData> forceDownloadDataBaseResponse2) throws Throwable {
|
||||||
|
List<ForceDownloadData> forceDownloadDataList = new ArrayList<>();
|
||||||
|
if (forceDownloadDataBaseResponse.code == 200) {
|
||||||
|
forceDownloadDataList.add(forceDownloadDataBaseResponse.data);
|
||||||
|
}
|
||||||
|
if (forceDownloadDataBaseResponse2.code == 200) {
|
||||||
|
forceDownloadDataList.add(forceDownloadDataBaseResponse2.data);
|
||||||
|
}
|
||||||
|
return forceDownloadDataList;
|
||||||
|
}
|
||||||
|
})
|
||||||
.subscribe(getDefaultDesktopObserver(null));
|
.subscribe(getDefaultDesktopObserver(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observer<BaseResponse<ForceDownloadData>> getDefaultDesktopObserver(onCompleteCallback callback) {
|
public Observer<List<ForceDownloadData>> getDefaultDesktopObserver(onCompleteCallback callback) {
|
||||||
return new Observer<BaseResponse<ForceDownloadData>>() {
|
return new Observer<List<ForceDownloadData>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
Log.e("getDefaultDesktop", "onSubscribe: ");
|
Log.e("getDefaultDesktop", "onSubscribe: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull BaseResponse<ForceDownloadData> baseResponse) {
|
public void onNext(@NonNull List<ForceDownloadData> baseResponse) {
|
||||||
Log.e("getDefaultDesktop", "onNext: " + baseResponse);
|
Log.e("getDefaultDesktop", "onNext: " + baseResponse);
|
||||||
if (baseResponse.code == OK) {
|
if (baseResponse.size() != 0) {
|
||||||
ForceDownloadData desktopInfo = baseResponse.data;
|
// TODO: 2023/8/14 不会存在两个桌面的情况
|
||||||
|
ForceDownloadData desktopInfo = baseResponse.get(0);
|
||||||
String jsonString = GsonUtils.toJSONString(desktopInfo);
|
String jsonString = GsonUtils.toJSONString(desktopInfo);
|
||||||
JsonObject data = GsonUtils.getJsonObject(jsonString);
|
JsonObject data = GsonUtils.getJsonObject(jsonString);
|
||||||
cacheHelper.put(UrlAddress.GET_DESKTOP, jsonString);
|
cacheHelper.put(UrlAddress.GET_DESKTOP, jsonString);
|
||||||
@@ -1048,6 +1094,7 @@ public class NetInterfaceManager {
|
|||||||
cacheHelper.put(UrlAddress.GET_DESKTOP, "");
|
cacheHelper.put(UrlAddress.GET_DESKTOP, "");
|
||||||
// String whiteList = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
|
// String whiteList = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
|
||||||
for (String s : ApkUtils.desktopAPP) {
|
for (String s : ApkUtils.desktopAPP) {
|
||||||
|
if (!BuildConfig.DEBUG)
|
||||||
ApkUtils.UninstallAPP(mContext, s);
|
ApkUtils.UninstallAPP(mContext, s);
|
||||||
Log.e("getDefaultDesktop", "UninstallAPP: " + s);
|
Log.e("getDefaultDesktop", "UninstallAPP: " + s);
|
||||||
}
|
}
|
||||||
@@ -1061,8 +1108,6 @@ public class NetInterfaceManager {
|
|||||||
setDefaultDesktop("com.aoleyunos.dop3");
|
setDefaultDesktop("com.aoleyunos.dop3");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1680,7 +1725,7 @@ public class NetInterfaceManager {
|
|||||||
public void getEBagCode(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
public void getEBagCode(boolean refresh, BehaviorSubject<ActivityEvent> lifecycle, onCompleteCallback callback) {
|
||||||
ConnectMode connectMode = ConnectMode.HALF_DAY;
|
ConnectMode connectMode = ConnectMode.HALF_DAY;
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
connectMode = ConnectMode.SIX_HOUR;
|
connectMode = ConnectMode.DEFAULT;
|
||||||
}
|
}
|
||||||
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_EBAG_CODE, connectMode)) {
|
if (ConnectManager.getInstance().isNeedConnect(UrlAddress.GET_EBAG_CODE, connectMode)) {
|
||||||
getEBagCode(lifecycle, callback);
|
getEBagCode(lifecycle, callback);
|
||||||
@@ -1717,9 +1762,11 @@ public class NetInterfaceManager {
|
|||||||
cacheHelper.put(UrlAddress.GET_EBAG_CODE, GsonUtils.toJSONString(eBagCode));
|
cacheHelper.put(UrlAddress.GET_EBAG_CODE, GsonUtils.toJSONString(eBagCode));
|
||||||
String ebagCode = eBagCode.getEbagCode();
|
String ebagCode = eBagCode.getEbagCode();
|
||||||
SPUtils.put(mContext, "ebagCode", ebagCode);
|
SPUtils.put(mContext, "ebagCode", ebagCode);
|
||||||
|
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 1);
|
||||||
} else {
|
} else {
|
||||||
cacheHelper.put(UrlAddress.GET_EBAG_CODE, "");
|
cacheHelper.put(UrlAddress.GET_EBAG_CODE, "");
|
||||||
Log.e("getEBagCode", "onNext: " + baseResponse.data);
|
Log.e("getEBagCode", "onNext: " + baseResponse.data);
|
||||||
|
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2198,6 +2245,7 @@ public class NetInterfaceManager {
|
|||||||
public void onFailed(String errorCode, String errorMsg) {
|
public void onFailed(String errorCode, String errorMsg) {
|
||||||
Log.e("clearAndAppendTags", "bind tag " + Arrays.toString(tag) + " failed." +
|
Log.e("clearAndAppendTags", "bind tag " + Arrays.toString(tag) + " failed." +
|
||||||
"errorCode: " + errorCode + ", errorMsg:" + errorMsg + "\n");
|
"errorCode: " + errorCode + ", errorMsg:" + errorMsg + "\n");
|
||||||
|
BaseApplication.onTagOperatorResult(errorCode);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ public class UrlAddress {
|
|||||||
public static final String GET_LOGO_IMG = "Sn/getLogoImg";
|
public static final String GET_LOGO_IMG = "Sn/getLogoImg";
|
||||||
/*获取默认桌面升级*/
|
/*获取默认桌面升级*/
|
||||||
public static final String GET_DESKTOP = "Sn/getSnDesktop";
|
public static final String GET_DESKTOP = "Sn/getSnDesktop";
|
||||||
|
/*获取DIY桌面升级*/
|
||||||
|
public static final String GET_DESKTOPS_DIY_UPDATE = "Sn/getDesktopsDiyUpdate";
|
||||||
|
|
||||||
/*获取系统默认程序*/
|
/*获取系统默认程序*/
|
||||||
public static final String GET_DEFAULT_APP = "app/getDefaultApp";
|
public static final String GET_DEFAULT_APP = "app/getDefaultApp";
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.aoleyun.sn.network.api.get;
|
||||||
|
|
||||||
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
|
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||||
|
import com.aoleyun.sn.network.UrlAddress;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface DesktopsDiyUpdateApi {
|
||||||
|
@GET(UrlAddress.GET_DESKTOPS_DIY_UPDATE)
|
||||||
|
Observable<BaseResponse<ForceDownloadData>> getDesktopsDiyUpdate(
|
||||||
|
@Query("sn") String sn
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1120,8 +1120,13 @@ public class PushManager {
|
|||||||
String ebagCode = jsonObject.get("ebagCode").getAsString();
|
String ebagCode = jsonObject.get("ebagCode").getAsString();
|
||||||
if (TextUtils.isEmpty(ebagCode)) {
|
if (TextUtils.isEmpty(ebagCode)) {
|
||||||
Log.e(TAG, "setEbagCode: " + "ebagCode is empty");
|
Log.e(TAG, "setEbagCode: " + "ebagCode is empty");
|
||||||
|
SPUtils.put(mContext, "ebagCode", "");
|
||||||
|
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, "");
|
||||||
|
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||||
} else {
|
} else {
|
||||||
SPUtils.put(mContext, "ebagCode", ebagCode);
|
SPUtils.put(mContext, "ebagCode", ebagCode);
|
||||||
|
Settings.System.putString(mContext.getContentResolver(), CommonConfig.ACTIVATIONBEAN_CODE_KEY, ebagCode);
|
||||||
|
Settings.Global.putInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public class NewAppReceiver extends BroadcastReceiver {
|
|||||||
switch (action) {
|
switch (action) {
|
||||||
case Intent.ACTION_PACKAGE_ADDED:
|
case Intent.ACTION_PACKAGE_ADDED:
|
||||||
state = "安装了:";
|
state = "安装了:";
|
||||||
|
checkDefaultDesktop(packageName);
|
||||||
break;
|
break;
|
||||||
case Intent.ACTION_PACKAGE_REPLACED:
|
case Intent.ACTION_PACKAGE_REPLACED:
|
||||||
// JGYUtils.getInstance().cleanLauncher3Cache();
|
// JGYUtils.getInstance().cleanLauncher3Cache();
|
||||||
@@ -74,6 +75,12 @@ public class NewAppReceiver extends BroadcastReceiver {
|
|||||||
newAppListener.setNewAppListener(packageName);
|
newAppListener.setNewAppListener(packageName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkDefaultDesktop(String pkg) {
|
||||||
|
if (ApkUtils.desktopAPP.contains(pkg)) {
|
||||||
|
ApkUtils.openApp(mContext, pkg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public interface NewAppListener {
|
public interface NewAppListener {
|
||||||
void setNewAppListener(String packageName);
|
void setNewAppListener(String packageName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -355,10 +355,12 @@ public class MainSPresenter implements MainSContact.Presenter {
|
|||||||
public void getDefaultDesktop() {
|
public void getDefaultDesktop() {
|
||||||
Log.e(TAG, "getDefaultDesktop: ");
|
Log.e(TAG, "getDefaultDesktop: ");
|
||||||
if (JGYUtils.isOfficialVersion() || !JGYUtils.getInstance().getDeviceIsLocked()) {
|
if (JGYUtils.isOfficialVersion() || !JGYUtils.getInstance().getDeviceIsLocked()) {
|
||||||
|
Log.e(TAG, "getDefaultDesktop: "+"Device unLocked");
|
||||||
mView.getDefaultDesktopFinish();
|
mView.getDefaultDesktopFinish();
|
||||||
} else {
|
} else {
|
||||||
int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
|
int aihuaUnlock = Settings.System.getInt(mContext.getContentResolver(), CommonConfig.AIHUA_UNLOCK, 0);
|
||||||
if (JGYUtils.getInstance().isAihuaFramwwork() && aihuaUnlock == 1) {
|
if (JGYUtils.getInstance().isAihuaFramwwork() && aihuaUnlock == 1) {
|
||||||
|
Log.e(TAG, "getDefaultDesktop: "+"Device aihua");
|
||||||
mView.getDefaultDesktopFinish();
|
mView.getDefaultDesktopFinish();
|
||||||
} else {
|
} else {
|
||||||
NetInterfaceManager.getInstance()
|
NetInterfaceManager.getInstance()
|
||||||
|
|||||||
@@ -626,16 +626,16 @@ public class JGYUtils {
|
|||||||
|
|
||||||
if (whiteList == null || whiteList.size() == 0) {
|
if (whiteList == null || whiteList.size() == 0) {
|
||||||
SPUtils.put(context, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
SPUtils.put(context, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
||||||
Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
// Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
||||||
} else {
|
} else {
|
||||||
String net_not = String.join(",", whiteList);
|
String net_not = String.join(",", whiteList);
|
||||||
SPUtils.put(context, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, net_not);
|
SPUtils.put(context, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, net_not);
|
||||||
Log.e(TAG, "setAppNetwork: net_not = " + net_not);
|
Log.e(TAG, "setAppNetwork: net_not = " + net_not);
|
||||||
List<String> filterList = whiteList.stream().filter(s -> !ApkUtils.isAvailable(context, s)).collect(Collectors.toList());
|
List<String> filterList = whiteList.stream().filter(s -> !ApkUtils.isAvailable(context, s)).collect(Collectors.toList());
|
||||||
if (filterList.size() == 0) {
|
if (filterList.size() == 0) {
|
||||||
Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
// Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
||||||
} else {
|
} else {
|
||||||
Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, String.join(",", filterList));
|
// Settings.System.putString(contentResolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, String.join(",", filterList));
|
||||||
}
|
}
|
||||||
Log.e(TAG, "setAppNetwork: filterList = " + filterList);
|
Log.e(TAG, "setAppNetwork: filterList = " + filterList);
|
||||||
}
|
}
|
||||||
@@ -658,9 +658,9 @@ public class JGYUtils {
|
|||||||
List<String> whiteList = new ArrayList<>(Arrays.asList(whiteString.split(",")));
|
List<String> whiteList = new ArrayList<>(Arrays.asList(whiteString.split(",")));
|
||||||
List<String> filterList = whiteList.stream().filter(s -> !ApkUtils.isAvailable(mContext, s)).collect(Collectors.toList());
|
List<String> filterList = whiteList.stream().filter(s -> !ApkUtils.isAvailable(mContext, s)).collect(Collectors.toList());
|
||||||
if (filterList.size() == 0) {
|
if (filterList.size() == 0) {
|
||||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
// Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
|
||||||
} else {
|
} else {
|
||||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, String.join(",", filterList));
|
// Settings.System.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, String.join(",", filterList));
|
||||||
}
|
}
|
||||||
Log.e(TAG, "updateNetworkWhiteList: " + filterList);
|
Log.e(TAG, "updateNetworkWhiteList: " + filterList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -756,7 +756,7 @@ public class SysSettingUtils {
|
|||||||
int state = 1;
|
int state = 1;
|
||||||
try {
|
try {
|
||||||
state = jsonObject.get("setting_browserInput").getAsInt();
|
state = jsonObject.get("setting_browserInput").getAsInt();
|
||||||
Log.e(TAG, "setBrowserInput: " + state);
|
Log.e(TAG, "setBrowserInput: setting_browserInput = " + state);
|
||||||
String json = jsonObject.get("setting_browserInput").getAsString();
|
String json = jsonObject.get("setting_browserInput").getAsString();
|
||||||
if (TextUtils.isEmpty(json)) {
|
if (TextUtils.isEmpty(json)) {
|
||||||
state = 1;
|
state = 1;
|
||||||
@@ -771,6 +771,19 @@ public class SysSettingUtils {
|
|||||||
} else {
|
} else {
|
||||||
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", 0);
|
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
int is_browser_network;
|
||||||
|
if (TextUtils.isEmpty(jsonObject.get("is_browser_network").getAsString())) {
|
||||||
|
is_browser_network = 0;
|
||||||
|
} else {
|
||||||
|
is_browser_network = jsonObject.get("is_browser_network").getAsInt();
|
||||||
|
}
|
||||||
|
Log.e(TAG, "setBrowserInput: is_browser_network = " + is_browser_network);
|
||||||
|
Settings.Global.putInt(context.getContentResolver(), "is_browser_network", is_browser_network);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "setBrowserInput: e: " + e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -781,5 +794,6 @@ public class SysSettingUtils {
|
|||||||
*/
|
*/
|
||||||
private static void setBrowserInput(Context context, int state) {
|
private static void setBrowserInput(Context context, int state) {
|
||||||
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", 0);
|
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", 0);
|
||||||
|
Settings.Global.putInt(context.getContentResolver(), "is_browser_network", changeNum(state));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -216,6 +216,7 @@
|
|||||||
app:layout_constraintStart_toEndOf="@+id/constraintLayout6" />
|
app:layout_constraintStart_toEndOf="@+id/constraintLayout6" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_class"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dp_16"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
|
|||||||
@@ -114,25 +114,27 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="--"
|
android:text="--"
|
||||||
android:visibility="gone"
|
|
||||||
android:textColor="@color/text_gray"
|
android:textColor="@color/text_gray"
|
||||||
android:textSize="@dimen/sp_10"
|
android:textSize="@dimen/sp_10"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
|
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:maxWidth="@dimen/dp_210"
|
|
||||||
android:layout_marginEnd="@dimen/dp_16"
|
android:layout_marginEnd="@dimen/dp_16"
|
||||||
|
android:gravity="center"
|
||||||
|
android:maxWidth="@dimen/dp_210"
|
||||||
|
android:orientation="horizontal"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout5"
|
android:id="@+id/constraintLayout5"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/dp_40"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -142,8 +144,8 @@
|
|||||||
android:id="@+id/tv_batch"
|
android:id="@+id/tv_batch"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="批次"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
|
android:text="批次"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_10"
|
android:textSize="@dimen/sp_10"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -166,15 +168,14 @@
|
|||||||
android:id="@+id/view"
|
android:id="@+id/view"
|
||||||
android:layout_width="1px"
|
android:layout_width="1px"
|
||||||
android:layout_height="@dimen/dp_16"
|
android:layout_height="@dimen/dp_16"
|
||||||
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
android:background="@color/text_gray"
|
android:background="@color/text_gray"
|
||||||
android:layout_marginStart="@dimen/dp_16"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/constraintLayout5" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout6"
|
android:id="@+id/cl_student"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/dp_40"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dp_16"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -185,8 +186,8 @@
|
|||||||
android:id="@+id/tv_number"
|
android:id="@+id/tv_number"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="学号"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
|
android:text="学号"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_10"
|
android:textSize="@dimen/sp_10"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -194,7 +195,6 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView4"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="我的学号"
|
android:text="我的学号"
|
||||||
@@ -205,18 +205,41 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@+id/tv_number" />
|
app:layout_constraintTop_toBottomOf="@+id/tv_number" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_serial"
|
||||||
|
android:layout_width="@dimen/dp_40"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/view"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="编号"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_10"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/view2"
|
android:id="@+id/view2"
|
||||||
android:layout_width="1px"
|
android:layout_width="1px"
|
||||||
android:layout_marginStart="@dimen/dp_16"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
android:layout_height="@dimen/dp_16"
|
android:layout_height="@dimen/dp_16"
|
||||||
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
android:background="@color/text_gray"
|
android:background="@color/text_gray"
|
||||||
app:layout_constraintStart_toEndOf="@+id/constraintLayout6" />
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/cl_class"
|
||||||
|
android:layout_width="@dimen/dp_40"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dp_16"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -227,8 +250,8 @@
|
|||||||
android:id="@+id/tv_class"
|
android:id="@+id/tv_class"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="班级"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
|
android:text="班级"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_10"
|
android:textSize="@dimen/sp_10"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -247,8 +270,32 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@+id/tv_class" />
|
app:layout_constraintTop_toBottomOf="@+id/tv_class" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_number_name"
|
||||||
|
android:layout_width="@dimen/dp_40"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/view2"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_number_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="班级"
|
||||||
|
android:textColor="@color/text_gray"
|
||||||
|
android:textSize="@dimen/sp_10"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
@@ -692,9 +739,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_4"
|
android:layout_marginTop="@dimen/dp_4"
|
||||||
android:text="@string/binding_time"
|
android:text="@string/binding_time"
|
||||||
android:visibility="gone"
|
|
||||||
android:textColor="@color/text_gray"
|
android:textColor="@color/text_gray"
|
||||||
android:textSize="@dimen/sp_10"
|
android:textSize="@dimen/sp_10"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/iv_qrcode"
|
app:layout_constraintEnd_toEndOf="@+id/iv_qrcode"
|
||||||
app:layout_constraintStart_toStartOf="@+id/iv_qrcode"
|
app:layout_constraintStart_toStartOf="@+id/iv_qrcode"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/iv_qrcode" />
|
app:layout_constraintTop_toBottomOf="@+id/iv_qrcode" />
|
||||||
|
|||||||
Reference in New Issue
Block a user