version:1.0
update:2021-10-13 18:52:13 fix:去除okgo,rxAndroid1,优化依赖 add:切换到奥乐云平台
This commit is contained in:
163
app/build.gradle
163
app/build.gradle
@@ -11,16 +11,11 @@ def releaseTime() {
|
|||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.jiaoguanyi.appstore"
|
applicationId "com.aoleyun.sn"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
|
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
packagingOptions {
|
|
||||||
exclude 'META-INF/rxjava.properties'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
@@ -41,100 +36,59 @@ android {
|
|||||||
//新平台正式
|
//新平台正式
|
||||||
newly {
|
newly {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 628
|
versionCode 1
|
||||||
//versionCode 1037
|
versionName "1.0"
|
||||||
versionName "2.2.8"
|
|
||||||
/*********************************极光推送************************************/
|
/*********************************极光推送************************************/
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
JPUSH_PKGNAME: "com.aoleyun.sn",
|
||||||
JPUSH_APPKEY : "20f70bbeb78bad23eddd08d0", //JPush上注册的包名对应的appkey.
|
JPUSH_APPKEY : "79c64ef41b8728ad6aa29af1", //JPush上注册的包名对应的appkey.
|
||||||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||||||
channel_value: "newly",
|
channel_value: "newly",
|
||||||
// AMAP_KEY: "546eb5646a65ac6a5b7d1c7456466e05"
|
|
||||||
]
|
]
|
||||||
/*********************************极光推送end************************************/
|
/*********************************极光推送end************************************/
|
||||||
buildConfigField "String", "ROOT_URL", '"http://name.jiaoguanyi.cn/api/"'
|
buildConfigField "String", "ROOT_URL", '"http://led.aoleyun.cn/api/"'
|
||||||
// buildConfigField "String", "WebsocketURL", '"ws://47.119.147.245:2345"'
|
buildConfigField "String", "SCREEN_BASE_URL", '"https://led.aoleyun.cn:2018/"'
|
||||||
buildConfigField "String", "WebsocketURL", '"wss://name.jiaoguanyi.cn:2018"'
|
buildConfigField "String", "SCREEN_URL", '"https://led.aoleyun.cn:2018/wm/is_online"'
|
||||||
buildConfigField "String", "SCREEN_URL", '"https://name.jiaoguanyi.cn:2018/wm/is_online"'
|
buildConfigField "String", "WebsocketURL", '"wss://led.aoleyun.cn:2018"'
|
||||||
}
|
}
|
||||||
|
|
||||||
MTKnewly {
|
MTKnewly {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 719
|
versionCode 1
|
||||||
//versionCode 1037
|
versionName "1.0"
|
||||||
versionName "2.1.9"
|
|
||||||
/*********************************极光推送************************************/
|
/*********************************极光推送************************************/
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
JPUSH_PKGNAME: "com.aoleyun.sn",
|
||||||
JPUSH_APPKEY : "20f70bbeb78bad23eddd08d0", //JPush上注册的包名对应的appkey.
|
JPUSH_APPKEY : "79c64ef41b8728ad6aa29af1", //JPush上注册的包名对应的appkey.
|
||||||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||||||
channel_value: "newly",
|
channel_value: "newly",
|
||||||
// AMAP_KEY: "546eb5646a65ac6a5b7d1c7456466e05"
|
|
||||||
]
|
]
|
||||||
/*********************************极光推送end************************************/
|
/*********************************极光推送end************************************/
|
||||||
buildConfigField "String", "ROOT_URL", '"http://name.jiaoguanyi.cn/api/"'
|
buildConfigField "String", "ROOT_URL", '"http://led.aoleyun.cn/api/"'
|
||||||
buildConfigField "String", "WebsocketURL", '"wss://name.jiaoguanyi.cn:2018"'
|
buildConfigField "String", "SCREEN_BASE_URL", '"https://led.aoleyun.cn:2018/"'
|
||||||
buildConfigField "String", "SCREEN_URL", '"https://name.jiaoguanyi.cn:2018/wm/is_online"'
|
buildConfigField "String", "SCREEN_URL", '"https://led.aoleyun.cn:2018/wm/is_online"'
|
||||||
|
buildConfigField "String", "WebsocketURL", '"wss://led.aoleyun.cn:2018"'
|
||||||
}
|
}
|
||||||
|
|
||||||
//新平台测试
|
//新平台测试
|
||||||
beta {
|
beta {
|
||||||
|
versionNameSuffix "-beta"
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 5
|
versionCode 1
|
||||||
versionName "1.4"
|
versionName "1.0"
|
||||||
// versionCode 628
|
|
||||||
// versionName "2.1.8"
|
|
||||||
/*********************************极光推送************************************/
|
/*********************************极光推送************************************/
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
JPUSH_PKGNAME: "com.aoleyun.sn",
|
||||||
JPUSH_APPKEY : "52d81643665bb2cadacf0e9e", //JPush上注册的包名对应的appkey.
|
JPUSH_APPKEY : "79c64ef41b8728ad6aa29af1", //JPush上注册的包名对应的appkey.
|
||||||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||||||
channel_value: "beta",
|
channel_value: "beta",
|
||||||
// AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
|
||||||
]
|
]
|
||||||
/*********************************极光推送end************************************/
|
/*********************************极光推送end************************************/
|
||||||
buildConfigField "String", "ROOT_URL", '"http://name.uiuios.com/api/"'
|
buildConfigField "String", "ROOT_URL", '"http://led.aoleyun.cn/api/"'
|
||||||
buildConfigField "String", "WebsocketURL", '"wss://name.uiuios.com:2018"'
|
buildConfigField "String", "SCREEN_BASE_URL", '"https://led.aoleyun.cn:2018/"'
|
||||||
buildConfigField "String", "SCREEN_URL", '"https://name.uiuios.com:2018/wm/is_online"'
|
buildConfigField "String", "SCREEN_URL", '"https://led.aoleyun.cn:2018/wm/is_online"'
|
||||||
versionNameSuffix "-beta"
|
buildConfigField "String", "WebsocketURL", '"wss://led.aoleyun.cn:2018"'
|
||||||
}
|
}
|
||||||
|
|
||||||
// //老平台正式
|
|
||||||
// official {
|
|
||||||
// flavorDimensions "default"
|
|
||||||
// versionCode 1039
|
|
||||||
// versionName "2.0.3.9"
|
|
||||||
// /*********************************极光推送************************************/
|
|
||||||
// manifestPlaceholders = [
|
|
||||||
// JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
|
||||||
// JPUSH_APPKEY : "20f70bbeb78bad23eddd08d0", //JPush上注册的包名对应的appkey.
|
|
||||||
// JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
|
||||||
// channel_value: "official",
|
|
||||||
// AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
|
||||||
// ]
|
|
||||||
// /*********************************极光推送end************************************/
|
|
||||||
// buildConfigField "String", "ROOT_URL", '"http://partner.jiaoguanyi.com/api/"'
|
|
||||||
// buildConfigField "String", "WebsocketURL", '"ws://47.107.133.19:1234"'
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //中优
|
|
||||||
// zhongyou {
|
|
||||||
// flavorDimensions "default"
|
|
||||||
// versionCode 1
|
|
||||||
// versionName "1.0"//测试jiaoguanyi.cn
|
|
||||||
// /*********************************极光推送************************************/
|
|
||||||
// manifestPlaceholders = [
|
|
||||||
// JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
|
||||||
// JPUSH_APPKEY : "a98c8a210687b4bb43c39c39", //JPush上注册的包名对应的appkey.
|
|
||||||
// JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
|
||||||
// channel_value: "zhongyou" ,
|
|
||||||
// AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
|
||||||
// ]
|
|
||||||
// /*********************************极光推送end************************************/
|
|
||||||
// buildConfigField "String", "ROOT_URL", '"https://jgy.jundunxueyuan.com/api/"'
|
|
||||||
// buildConfigField "String", "WebsocketURL", '"ws://39.98.59.202:2345"'
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
@@ -251,11 +205,8 @@ android {
|
|||||||
debug {
|
debug {
|
||||||
buildConfigField "String", "platform", '"MTK"'
|
buildConfigField "String", "platform", '"MTK"'
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
AMAP_KEY: "1af68e0a7edcaac82678b1cbb7643408"
|
||||||
]
|
]
|
||||||
// 不显示Log
|
|
||||||
//buildConfigField "boolean", "LOG_DEBUG", "false"
|
|
||||||
//
|
|
||||||
versionNameSuffix "-debug"
|
versionNameSuffix "-debug"
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
@@ -276,7 +227,7 @@ android {
|
|||||||
release {
|
release {
|
||||||
buildConfigField "String", "platform", '"MTK"'
|
buildConfigField "String", "platform", '"MTK"'
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
AMAP_KEY: "5b68c8ee39800ff700a3762b6e028b78"
|
AMAP_KEY: "1af68e0a7edcaac82678b1cbb7643408"
|
||||||
]
|
]
|
||||||
//混淆
|
//混淆
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
@@ -298,6 +249,7 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
path file('CMakeLists.txt')
|
path file('CMakeLists.txt')
|
||||||
@@ -318,28 +270,39 @@ dependencies {
|
|||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||||
|
//BindView
|
||||||
implementation 'com.jakewharton:butterknife:10.1.0'
|
implementation 'com.jakewharton:butterknife:10.1.0'
|
||||||
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
|
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
|
||||||
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
|
|
||||||
implementation "org.java-websocket:Java-WebSocket:1.4.1"
|
//OkHttp
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||||
|
//Retrofit
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
|
||||||
|
//RxJava
|
||||||
implementation 'io.reactivex.rxjava2:rxjava:2.2.12'
|
implementation 'io.reactivex.rxjava2:rxjava:2.2.12'
|
||||||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
||||||
|
//生命周期管理
|
||||||
|
implementation 'com.trello.rxlifecycle2:rxlifecycle:2.2.2'
|
||||||
|
implementation 'com.trello.rxlifecycle2:rxlifecycle-android:2.2.2'
|
||||||
|
implementation 'com.trello.rxlifecycle2:rxlifecycle-components:2.2.2'
|
||||||
//implementation "com.uber.autodispose:autodispose:1.3.0"
|
//implementation "com.uber.autodispose:autodispose:1.3.0"
|
||||||
//implementation "com.uber.autodispose:autodispose-android-archcomponents:1.3.0"
|
//implementation "com.uber.autodispose:autodispose-android-archcomponents:1.3.0"
|
||||||
|
//Google
|
||||||
implementation 'com.google.code.gson:gson:2.8.7'
|
implementation 'com.google.code.gson:gson:2.8.7'
|
||||||
implementation 'com.google.zxing:core:3.3.0'
|
implementation 'com.google.zxing:core:3.3.0'
|
||||||
implementation 'cn.jiguang.sdk:jpush:3.8.6' // 此处以JPush 3.5.6 版本为例。
|
//fastjson
|
||||||
implementation 'cn.jiguang.sdk:jcore:2.6.0' // 此处以JCore 2.2.8 版本为例。
|
|
||||||
implementation 'com.alibaba:fastjson:1.2.76'
|
implementation 'com.alibaba:fastjson:1.2.76'
|
||||||
//逐渐弃用,几年没更新了
|
//极光推送
|
||||||
implementation 'com.lzy.net:okgo:2.1.4'
|
implementation 'cn.jiguang.sdk:jpush:4.3.0' // 此处以JPush 3.5.6 版本为例。
|
||||||
implementation 'com.lzy.net:okrx:0.1.2'
|
implementation 'cn.jiguang.sdk:jcore:2.9.0' // 此处以JCore 2.2.8 版本为例。
|
||||||
//implementation 'com.lzy.net:okserver:1.1.3'
|
//高德地图定位
|
||||||
//okhttp框架
|
implementation 'com.amap.api:location:5.1.0'
|
||||||
|
//MMKV
|
||||||
|
implementation 'com.tencent:mmkv-static:1.2.10'
|
||||||
|
|
||||||
|
//RxHttp
|
||||||
implementation 'com.github.liujingxing.rxhttp:rxhttp:2.6.5'
|
implementation 'com.github.liujingxing.rxhttp:rxhttp:2.6.5'
|
||||||
//implementation 'com.squareup.okhttp3:okhttp:4.9.1' //rxhttp v2.2.2版本起,需要手动依赖okhttp
|
//implementation 'com.squareup.okhttp3:okhttp:4.9.1' //rxhttp v2.2.2版本起,需要手动依赖okhttp
|
||||||
annotationProcessor 'com.github.liujingxing.rxhttp:rxhttp-compiler:2.6.5'
|
annotationProcessor 'com.github.liujingxing.rxhttp:rxhttp-compiler:2.6.5'
|
||||||
@@ -349,29 +312,25 @@ dependencies {
|
|||||||
//implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
|
//implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
|
||||||
//implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
//implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
|
||||||
implementation 'com.github.liujingxing.rxlife:rxlife-rxjava2:2.1.0' //管理RxJava2生命周期,页面销毁,关闭请求
|
implementation 'com.github.liujingxing.rxlife:rxlife-rxjava2:2.1.0' //管理RxJava2生命周期,页面销毁,关闭请求
|
||||||
|
//工具类
|
||||||
implementation 'com.blankj:utilcodex:1.30.6'
|
implementation 'com.blankj:utilcodex:1.30.6'
|
||||||
|
//Aria
|
||||||
implementation 'com.arialyy.aria:core:3.8.15'
|
implementation 'com.arialyy.aria:core:3.8.15'
|
||||||
annotationProcessor 'com.arialyy.aria:compiler:3.8.15'
|
annotationProcessor 'com.arialyy.aria:compiler:3.8.15'
|
||||||
//高德地图定位
|
|
||||||
implementation 'com.amap.api:location:5.1.0'
|
|
||||||
//压缩文件解压
|
//压缩文件解压
|
||||||
implementation 'org.zeroturnaround:zt-zip:1.13'
|
implementation 'org.zeroturnaround:zt-zip:1.13'
|
||||||
//生命周期管理
|
//更换字体框架
|
||||||
implementation 'com.trello.rxlifecycle2:rxlifecycle:2.2.2'
|
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
|
||||||
implementation 'com.trello.rxlifecycle2:rxlifecycle-android:2.2.2'
|
//Java WebSocket
|
||||||
implementation 'com.trello.rxlifecycle2:rxlifecycle-components:2.2.2'
|
implementation "org.java-websocket:Java-WebSocket:1.4.1"
|
||||||
//状态栏透明
|
//状态栏透明
|
||||||
implementation 'com.gitee.zackratos:UltimateBarX:0.7.1'
|
implementation 'com.gitee.zackratos:UltimateBarX:0.7.1'
|
||||||
|
// // 基础依赖包,必须要依赖
|
||||||
// 基础依赖包,必须要依赖
|
// implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
|
||||||
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
|
// // fragment快速实现(可选)
|
||||||
// fragment快速实现(可选)
|
// implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
|
||||||
implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
|
// // kotlin扩展(可选)
|
||||||
// kotlin扩展(可选)
|
// implementation 'com.gyf.immersionbar:immersionbar-ktx:3.0.0'
|
||||||
//implementation 'com.gyf.immersionbar:immersionbar-ktx:3.0.0'
|
|
||||||
|
|
||||||
implementation 'com.tencent:mmkv-static:1.2.10'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
preBuild {
|
preBuild {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.mjsheng.myappstore"
|
package="com.aoleyun.sn"
|
||||||
android:sharedUserId="android.uid.system">
|
android:sharedUserId="android.uid.system">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||||
@@ -60,10 +60,13 @@
|
|||||||
android:maxSdkVersion="22" />
|
android:maxSdkVersion="22" />
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"
|
android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"
|
||||||
android:maxSdkVersion="23" /> <!-- 高德地图 -->
|
android:maxSdkVersion="23" />
|
||||||
|
<!-- 高德地图 -->
|
||||||
<!-- 用于进行网络定位 -->
|
<!-- 用于进行网络定位 -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 用于访问GPS定位 -->
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 用于获取运营商信息,用于支持提供运营商信息相关的接口 -->
|
<!-- 用于访问GPS定位 -->
|
||||||
|
<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" /> -->
|
||||||
@@ -76,15 +79,17 @@
|
|||||||
<!-- 用于写入缓存数据到扩展存储卡 -->
|
<!-- 用于写入缓存数据到扩展存储卡 -->
|
||||||
<!-- <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" /> <!-- 如果设置了target >= 28 如果需要启动后台定位则必须声明这个权限 -->
|
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- 如果您的应用需要后台定位权限,且有可能运行在Android Q设备上,并且设置了target>28,必须增加这个权限声明 -->
|
<!-- 如果设置了target >= 28 如果需要启动后台定位则必须声明这个权限 -->
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
|
<!-- 如果您的应用需要后台定位权限,且有可能运行在Android Q设备上,并且设置了target>28,必须增加这个权限声明 -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
||||||
<uses-permission android:name="com.jiaoguanyi.appstore.permissions.INSTALL_APK" />
|
<uses-permission android:name="com.aoleyun.sn.permissions.INSTALL_APK" />
|
||||||
|
|
||||||
<permission android:name="com.jiaoguanyi.appstore.permissions.INSTALL_APK" />
|
<permission android:name="com.aoleyun.sn.permissions.INSTALL_APK" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".base.BaseApplication"
|
android:name="com.aoleyun.sn.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"
|
||||||
@@ -93,17 +98,17 @@
|
|||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<service
|
<service
|
||||||
android:name=".service.RemoteService"
|
android:name="com.aoleyun.sn.service.RemoteService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:process=":remote" />
|
android:process=":remote" />
|
||||||
<service
|
<service
|
||||||
android:name=".service.LogcatService"
|
android:name="com.aoleyun.sn.service.LogcatService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
|
|
||||||
<activity android:name=".activity.TopActivity" />
|
<activity android:name="com.aoleyun.sn.activity.TopActivity" />
|
||||||
<activity android:name=".activity.HomeActivity">
|
<activity android:name="com.aoleyun.sn.activity.HomeActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
@@ -111,7 +116,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.MainActivity"
|
android:name="com.aoleyun.sn.activity.MainActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:launchMode="singleTop">
|
android:launchMode="singleTop">
|
||||||
|
|
||||||
@@ -123,9 +128,9 @@
|
|||||||
<!-- </intent-filter> -->
|
<!-- </intent-filter> -->
|
||||||
</activity>
|
</activity>
|
||||||
<!-- <service android:name=".server.MyDownloadService" /> -->
|
<!-- <service android:name=".server.MyDownloadService" /> -->
|
||||||
<service android:name=".service.GuardService" />
|
<service android:name="com.aoleyun.sn.service.GuardService" />
|
||||||
<service
|
<service
|
||||||
android:name=".service.StepService"
|
android:name="com.aoleyun.sn.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" />
|
||||||
@@ -140,7 +145,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
<service
|
<service
|
||||||
android:name=".service.MainService"
|
android:name="com.aoleyun.sn.service.MainService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter android:priority="1000">
|
<intent-filter android:priority="1000">
|
||||||
@@ -150,13 +155,14 @@
|
|||||||
|
|
||||||
<data android:scheme="package" />
|
<data android:scheme="package" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service> <!-- <service -->
|
</service>
|
||||||
|
<!-- <service -->
|
||||||
<!-- android:name=".server.InitJpushServer" -->
|
<!-- android:name=".server.InitJpushServer" -->
|
||||||
<!-- android:enabled="true" -->
|
<!-- android:enabled="true" -->
|
||||||
<!-- android:exported="true"> -->
|
<!-- android:exported="true"> -->
|
||||||
<!-- </service> -->
|
<!-- </service> -->
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".receiver.NewAppReceiver"
|
android:name="com.aoleyun.sn.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">
|
||||||
@@ -169,11 +175,11 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".utils.InstallResultReceiver"
|
android:name="com.aoleyun.sn.utils.InstallResultReceiver"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true" />
|
android:exported="true" />
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".receiver.BootReceiver"
|
android:name="com.aoleyun.sn.receiver.BootReceiver"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter android:priority="1000">
|
<intent-filter android:priority="1000">
|
||||||
@@ -200,9 +206,10 @@
|
|||||||
<!-- <action android:name="android.intent.action.MEDIA_REMOVED" /> -->
|
<!-- <action android:name="android.intent.action.MEDIA_REMOVED" /> -->
|
||||||
<!-- <action android:name="android.intent.action.MEDIA_BAD_REMOVAL" /> -->
|
<!-- <action android:name="android.intent.action.MEDIA_BAD_REMOVAL" /> -->
|
||||||
<!-- 自定义广播 -->
|
<!-- 自定义广播 -->
|
||||||
<action android:name="com.jiaoguanyi.appstore.intent.action.BOOT_COMPLETED" />
|
<action android:name="com.aoleyun.sn.intent.action.BOOT_COMPLETED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver> <!-- <receiver android:name=".log.LogReceiver" -->
|
</receiver>
|
||||||
|
<!-- <receiver android:name=".log.LogReceiver" -->
|
||||||
<!-- android:permission="android.permission.DUMP" > -->
|
<!-- android:permission="android.permission.DUMP" > -->
|
||||||
<!-- <intent-filter> -->
|
<!-- <intent-filter> -->
|
||||||
<!-- <action android:name="android.intent.action.BOOT_COMPLETED" /> -->
|
<!-- <action android:name="android.intent.action.BOOT_COMPLETED" /> -->
|
||||||
@@ -214,7 +221,7 @@
|
|||||||
<!-- </intent-filter> -->
|
<!-- </intent-filter> -->
|
||||||
<!-- </receiver> -->
|
<!-- </receiver> -->
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".receiver.MyJPushReceiver"
|
android:name="com.aoleyun.sn.receiver.MyJPushReceiver"
|
||||||
android:enabled="true">
|
android:enabled="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
||||||
@@ -231,7 +238,8 @@
|
|||||||
|
|
||||||
<category android:name="${JPUSH_PKGNAME}" />
|
<category android:name="${JPUSH_PKGNAME}" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver> <!-- Required. For publish channel feature -->
|
</receiver>
|
||||||
|
<!-- Required. For publish channel feature -->
|
||||||
<!-- JPUSH_CHANNEL 是为了方便开发者统计APK分发渠道。 -->
|
<!-- JPUSH_CHANNEL 是为了方便开发者统计APK分发渠道。 -->
|
||||||
<!-- 例如: -->
|
<!-- 例如: -->
|
||||||
<!-- 发到 Google Play 的APK可以设置为 google-play; -->
|
<!-- 发到 Google Play 的APK可以设置为 google-play; -->
|
||||||
@@ -245,7 +253,7 @@
|
|||||||
<!-- 目前这个渠道统计功能的报表还未开放。 -->
|
<!-- 目前这个渠道统计功能的报表还未开放。 -->
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
android:authorities="com.jiaoguanyi.appstore.fileprovider"
|
android:authorities="com.aoleyun.sn.fileprovider"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:grantUriPermissions="true">
|
android:grantUriPermissions="true">
|
||||||
|
|
||||||
@@ -253,13 +261,15 @@
|
|||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
android:resource="@xml/file_paths" />
|
android:resource="@xml/file_paths" />
|
||||||
</provider> <!-- ##############################极光推送############################## -->
|
</provider>
|
||||||
|
<!-- ##############################极光推送############################## -->
|
||||||
<!-- Rich push 核心功能 since 2.0.6 -->
|
<!-- Rich push 核心功能 since 2.0.6 -->
|
||||||
<activity
|
<activity
|
||||||
android:name="cn.jpush.android.ui.PopWinActivity"
|
android:name="cn.jpush.android.ui.PopWinActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:theme="@style/MyDialogStyle"
|
android:theme="@style/MyDialogStyle"
|
||||||
tools:replace="android:exported" /> <!-- Required SDK核心功能 -->
|
tools:replace="android:exported" />
|
||||||
|
<!-- Required SDK核心功能 -->
|
||||||
<activity
|
<activity
|
||||||
android:name="cn.jpush.android.ui.PushActivity"
|
android:name="cn.jpush.android.ui.PushActivity"
|
||||||
android:configChanges="orientation|keyboardHidden"
|
android:configChanges="orientation|keyboardHidden"
|
||||||
@@ -270,9 +280,10 @@
|
|||||||
<action android:name="cn.jpush.android.ui.PushActivity" />
|
<action android:name="cn.jpush.android.ui.PushActivity" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<category android:name="com.jiaoguanyi.appstore" />
|
<category android:name="com.aoleyun.sn" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity> <!-- Required SDK 核心功能 -->
|
</activity>
|
||||||
|
<!-- Required SDK 核心功能 -->
|
||||||
<!-- 可配置android:process参数将PushService放在其他进程中 -->
|
<!-- 可配置android:process参数将PushService放在其他进程中 -->
|
||||||
<service
|
<service
|
||||||
android:name="cn.jpush.android.service.PushService"
|
android:name="cn.jpush.android.service.PushService"
|
||||||
@@ -284,13 +295,15 @@
|
|||||||
<action android:name="cn.jpush.android.intent.PushService" />
|
<action android:name="cn.jpush.android.intent.PushService" />
|
||||||
<action android:name="cn.jpush.android.intent.PUSH_TIME" />
|
<action android:name="cn.jpush.android.intent.PUSH_TIME" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service> <!-- since 3.0.9 Required SDK 核心功能 -->
|
</service>
|
||||||
|
<!-- since 3.0.9 Required SDK 核心功能 -->
|
||||||
<provider
|
<provider
|
||||||
android:name="cn.jpush.android.service.DataProvider"
|
android:name="cn.jpush.android.service.DataProvider"
|
||||||
android:authorities="com.jiaoguanyi.appstore.DataProvider"
|
android:authorities="com.aoleyun.sn.DataProvider"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:process=":pushcore"
|
android:process=":pushcore"
|
||||||
tools:replace="android:authorities" /> <!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
|
tools:replace="android:authorities" />
|
||||||
|
<!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
|
||||||
<!-- 若不启用该功能可删除该组件,将不拉起其他应用也不能被其他应用拉起 -->
|
<!-- 若不启用该功能可删除该组件,将不拉起其他应用也不能被其他应用拉起 -->
|
||||||
<service
|
<service
|
||||||
android:name="cn.jpush.android.service.DaemonService"
|
android:name="cn.jpush.android.service.DaemonService"
|
||||||
@@ -299,22 +312,25 @@
|
|||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="cn.jpush.android.intent.DaemonService" />
|
<action android:name="cn.jpush.android.intent.DaemonService" />
|
||||||
|
|
||||||
<category android:name="com.jiaoguanyi.appstore" />
|
<category android:name="com.aoleyun.sn" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service> <!-- since 3.1.0 Required SDK 核心功能 -->
|
</service>
|
||||||
|
<!-- since 3.1.0 Required SDK 核心功能 -->
|
||||||
<provider
|
<provider
|
||||||
android:name="cn.jpush.android.service.DownloadProvider"
|
android:name="cn.jpush.android.service.DownloadProvider"
|
||||||
android:authorities="com.jiaoguanyi.appstore.DownloadProvider"
|
android:authorities="com.aoleyun.sn.DownloadProvider"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
tools:replace="android:authorities" /> <!-- Required SDK核心功能 -->
|
tools:replace="android:authorities" />
|
||||||
|
<!-- Required SDK核心功能 -->
|
||||||
<receiver
|
<receiver
|
||||||
android:name="cn.jpush.android.service.PushReceiver"
|
android:name="cn.jpush.android.service.PushReceiver"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="false">
|
android:exported="false"
|
||||||
|
tools:replace="android:exported">
|
||||||
<intent-filter android:priority="1000">
|
<intent-filter android:priority="1000">
|
||||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" />
|
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" />
|
||||||
<!-- Required 显示通知栏 -->
|
<!-- Required 显示通知栏 -->
|
||||||
<category android:name="com.jiaoguanyi.appstore" />
|
<category android:name="com.aoleyun.sn" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.USER_PRESENT" />
|
<action android:name="android.intent.action.USER_PRESENT" />
|
||||||
@@ -327,10 +343,12 @@
|
|||||||
|
|
||||||
<data android:scheme="package" />
|
<data android:scheme="package" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver> <!-- Required SDK核心功能 -->
|
</receiver>
|
||||||
|
<!-- Required SDK核心功能 -->
|
||||||
<receiver
|
<receiver
|
||||||
android:name="cn.jpush.android.service.AlarmReceiver"
|
android:name="cn.jpush.android.service.AlarmReceiver"
|
||||||
android:exported="false" /> <!-- since 3.3.0 Required SDK核心功能 -->
|
android:exported="false" />
|
||||||
|
<!-- since 3.3.0 Required SDK核心功能 -->
|
||||||
<activity
|
<activity
|
||||||
android:name="cn.jpush.android.service.JNotifyActivity"
|
android:name="cn.jpush.android.service.JNotifyActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
@@ -339,19 +357,21 @@
|
|||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="cn.jpush.android.intent.JNotifyActivity" />
|
<action android:name="cn.jpush.android.intent.JNotifyActivity" />
|
||||||
|
|
||||||
<category android:name="com.jiaoguanyi.appstore" />
|
<category android:name="com.aoleyun.sn" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity> <!-- Since JCore2.0.0 Required SDK核心功能 -->
|
</activity>
|
||||||
|
<!-- Since JCore2.0.0 Required SDK核心功能 -->
|
||||||
<!-- 这个Service要继承JCommonService -->
|
<!-- 这个Service要继承JCommonService -->
|
||||||
<service
|
<service
|
||||||
android:name=".jpush.PushService"
|
android:name="com.aoleyun.sn.jpush.PushService"
|
||||||
android:process=":pushcore">
|
android:process=":pushcore">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="cn.jiguang.user.service.action" />
|
<action android:name="cn.jiguang.user.service.action" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service> <!-- User defined. For test only 用户自定义的广播接收器 -->
|
</service>
|
||||||
|
<!-- User defined. For test only 用户自定义的广播接收器 -->
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".jpush.MyReceiver"
|
android:name="com.aoleyun.sn.jpush.MyReceiver"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="false">
|
android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -365,27 +385,31 @@
|
|||||||
<!-- Required 用户打开自定义通知栏的intent -->
|
<!-- Required 用户打开自定义通知栏的intent -->
|
||||||
<action android:name="cn.jpush.android.intent.CONNECTION" />
|
<action android:name="cn.jpush.android.intent.CONNECTION" />
|
||||||
<!-- 接收网络变化 连接/断开 since 1.6.3 -->
|
<!-- 接收网络变化 连接/断开 since 1.6.3 -->
|
||||||
<category android:name="com.jiaoguanyi.appstore" />
|
<category android:name="com.aoleyun.sn" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver> <!-- User defined. For test only 用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调 -->
|
</receiver>
|
||||||
<receiver android:name=".jpush.MyJPushMessageReceiver">
|
<!-- User defined. For test only 用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调 -->
|
||||||
|
<receiver android:name="com.aoleyun.sn.jpush.MyJPushMessageReceiver">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
|
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
|
||||||
|
|
||||||
<category android:name="com.jiaoguanyi.appstore" />
|
<category android:name="com.aoleyun.sn" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="JPUSH_CHANNEL"
|
android:name="JPUSH_CHANNEL"
|
||||||
android:value="developer-default" /> <!-- Required. AppKey copied from Portal -->
|
android:value="developer-default" />
|
||||||
|
<!-- Required. AppKey copied from Portal -->
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="JPUSH_APPKEY"
|
android:name="JPUSH_APPKEY"
|
||||||
android:value="${JPUSH_APPKEY}" /> <!-- 高德地图 -->
|
android:value="${JPUSH_APPKEY}" />
|
||||||
|
<!-- 高德地图 -->
|
||||||
<!-- 设置key -->
|
<!-- 设置key -->
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.amap.api.v2.apikey"
|
android:name="com.amap.api.v2.apikey"
|
||||||
android:value="${AMAP_KEY}" /> <!-- 定位需要的服务 适配Android Q需要加上android:foregroundServiceType="location" -->
|
android:value="${AMAP_KEY}" />
|
||||||
|
<!-- 定位需要的服务 适配Android Q需要加上android:foregroundServiceType="location" -->
|
||||||
<service
|
<service
|
||||||
android:name="com.amap.api.location.APSService"
|
android:name="com.amap.api.location.APSService"
|
||||||
android:foregroundServiceType="location" />
|
android:foregroundServiceType="location" />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// IGetLicenseInterface.aidl
|
// IGetLicenseInterface.aidl
|
||||||
package com.jiaoguanyi.appstore;
|
package com.aoleyun.sn;
|
||||||
|
|
||||||
// Declare any non-default types here with import statements
|
// Declare any non-default types here with import statements
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// KeepAliveConnection.aidl
|
// KeepAliveConnection.aidl
|
||||||
package com.mjsheng.myappstore;
|
package com.aoleyun.sn;
|
||||||
|
|
||||||
// Declare any non-default types here with import statements
|
// Declare any non-default types here with import statements
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<netCheck value="true"/>
|
<netCheck value="true"/>
|
||||||
<!--除非无法使用注解,否则不建议使用广播来接受任务状态,true:使用广播接收任务状态,false:不适用广播接收状态 -->
|
<!--除非无法使用注解,否则不建议使用广播来接受任务状态,true:使用广播接收任务状态,false:不适用广播接收状态 -->
|
||||||
<!-- http://aria.laoyuyu.me/aria_doc/api/use_broadcast.html -->
|
<!-- http://aria.laoyuyu.me/aria_doc/api/use_broadcast.html -->
|
||||||
<useBroadcast value="true"/>
|
<useBroadcast value="false"/>
|
||||||
<!--断网的时候是否重试,true:断网也重试;false:断网不重试,直接走失败的回调-->
|
<!--断网的时候是否重试,true:断网也重试;false:断网不重试,直接走失败的回调-->
|
||||||
<notNetRetry value="true"/>
|
<notNetRetry value="true"/>
|
||||||
</app>
|
</app>
|
||||||
|
|||||||
25
app/src/main/java/com/aoleyun/sn/action/JGYActions.java
Normal file
25
app/src/main/java/com/aoleyun/sn/action/JGYActions.java
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package com.aoleyun.sn.action;
|
||||||
|
|
||||||
|
public class JGYActions {
|
||||||
|
/*
|
||||||
|
* 需要写到底层的数据
|
||||||
|
* */
|
||||||
|
//设备锁定状态
|
||||||
|
public final static String ACTION_QCH_UNLOCK_IPAD = "qch_unlock_ipad";
|
||||||
|
//应用管理-允许联网
|
||||||
|
public final static String ACTION_HR_RECEIVER_JGY = "qch_jgy_network_allow";
|
||||||
|
//应用管理-禁止联网
|
||||||
|
public final static String ACTION_HR_RECEIVER_JGY_DIS = "qch_jgy_network_disallow";
|
||||||
|
//
|
||||||
|
public final static String ACTION_STATUS_BAR_STATUS = "jgy_statusbar_status";
|
||||||
|
//
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 应用内部的数据
|
||||||
|
* */
|
||||||
|
|
||||||
|
//后台上传所有应用包名 将添加到桌面
|
||||||
|
public final static String ACTION_JGY_SHORTCUTLIST = "only_jgy_shortcut_list";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,35 +1,44 @@
|
|||||||
package com.mjsheng.myappstore.activity;
|
package com.aoleyun.sn.activity;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.StatusBarManager;
|
import android.app.StatusBarManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.Color;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Environment;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.BuildConfig;
|
import com.aoleyun.sn.BuildConfig;
|
||||||
import com.mjsheng.myappstore.R;
|
import com.aoleyun.sn.R;
|
||||||
import com.lzy.okgo.model.HttpHeaders;
|
import com.aoleyun.sn.action.JGYActions;
|
||||||
import com.mjsheng.myappstore.base.BaseApplication;
|
import com.aoleyun.sn.base.BaseApplication;
|
||||||
import com.mjsheng.myappstore.service.LogcatService;
|
import com.aoleyun.sn.comm.PackageNames;
|
||||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
import com.aoleyun.sn.service.LogcatService;
|
||||||
import com.mjsheng.myappstore.utils.Logutils;
|
import com.aoleyun.sn.utils.JGYUtils;
|
||||||
import com.mjsheng.myappstore.utils.SPUtils;
|
import com.aoleyun.sn.utils.Logutils;
|
||||||
import com.mjsheng.myappstore.utils.ServiceAliveUtils;
|
import com.aoleyun.sn.utils.SPUtils;
|
||||||
import com.mjsheng.myappstore.utils.StatusBarUtil;
|
import com.aoleyun.sn.utils.ServiceAliveUtils;
|
||||||
import com.mjsheng.myappstore.utils.Utils;
|
import com.aoleyun.sn.utils.Utils;
|
||||||
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
import cn.jpush.android.api.JPushInterface;
|
import cn.jpush.android.api.JPushInterface;
|
||||||
|
|
||||||
|
|
||||||
@@ -41,7 +50,17 @@ public class HomeActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
StatusBarUtil.init(this);
|
setBar();
|
||||||
|
setContentView(R.layout.activity_home);
|
||||||
|
initView();
|
||||||
|
debugTest();
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
|
startActivity(new Intent(HomeActivity.this, MainActivity.class));
|
||||||
|
finish();
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setBar() {
|
||||||
UltimateBarX.statusBar(this)
|
UltimateBarX.statusBar(this)
|
||||||
.transparent()
|
.transparent()
|
||||||
.colorRes(R.color.colorPrimaryDark)
|
.colorRes(R.color.colorPrimaryDark)
|
||||||
@@ -52,58 +71,43 @@ public class HomeActivity extends AppCompatActivity {
|
|||||||
.colorRes(R.color.colorPrimaryDark)
|
.colorRes(R.color.colorPrimaryDark)
|
||||||
.light(true)
|
.light(true)
|
||||||
.apply();
|
.apply();
|
||||||
setContentView(R.layout.activity_home);
|
}
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
bt_log = findViewById(R.id.bt_log);
|
bt_log = findViewById(R.id.bt_log);
|
||||||
bt_log.setVisibility(View.VISIBLE);
|
bt_log.setVisibility(View.VISIBLE);
|
||||||
bt_log.setOnClickListener(new View.OnClickListener() {
|
bt_log.setOnClickListener(view -> {
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
if (!ServiceAliveUtils.isServiceAlive(HomeActivity.this, LogcatService.class.getName())) {
|
if (!ServiceAliveUtils.isServiceAlive(HomeActivity.this, LogcatService.class.getName())) {
|
||||||
startService(new Intent(HomeActivity.this, LogcatService.class));
|
startService(new Intent(HomeActivity.this, LogcatService.class));
|
||||||
}
|
}
|
||||||
Intent intent = new Intent(LogcatService.LOGCAT_START_ACTION);
|
Intent intent = new Intent(LogcatService.LOGCAT_START_ACTION);
|
||||||
sendBroadcast(intent);
|
sendBroadcast(intent);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
bt_stop = findViewById(R.id.bt_stop);
|
bt_stop = findViewById(R.id.bt_stop);
|
||||||
bt_stop.setVisibility(View.VISIBLE);
|
bt_stop.setVisibility(View.VISIBLE);
|
||||||
bt_stop.setOnClickListener(new View.OnClickListener() {
|
bt_stop.setOnClickListener(view -> {
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
if (!ServiceAliveUtils.isServiceAlive(HomeActivity.this, LogcatService.class.getName())) {
|
if (!ServiceAliveUtils.isServiceAlive(HomeActivity.this, LogcatService.class.getName())) {
|
||||||
startService(new Intent(HomeActivity.this, LogcatService.class));
|
startService(new Intent(HomeActivity.this, LogcatService.class));
|
||||||
}
|
}
|
||||||
Intent intent = new Intent(LogcatService.LOGCAT_STOP_ACTION);
|
Intent intent = new Intent(LogcatService.LOGCAT_STOP_ACTION);
|
||||||
sendBroadcast(intent);
|
sendBroadcast(intent);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
if (BuildConfig.DEBUG) {
|
|
||||||
debugTest();
|
|
||||||
}
|
}
|
||||||
// return;
|
|
||||||
}
|
|
||||||
new Handler().postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
startActivity(new Intent(HomeActivity.this, MainActivity.class));
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}, 2000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void debugTest() {
|
private void debugTest() {
|
||||||
|
if (!BuildConfig.DEBUG) return;
|
||||||
// Utils.getHardware(this);
|
// Utils.getHardware(this);
|
||||||
// setWebView();
|
// setWebView();
|
||||||
// hideStatusBar();
|
// hideStatusBar();
|
||||||
Logutils.i(TAG, "DebugTest: " + HttpHeaders.getUserAgent());
|
|
||||||
// boolean qch_force_app = Settings.System.putString(getContentResolver(), "qch_launcher_icon_app", "");
|
// boolean qch_force_app = Settings.System.putString(getContentResolver(), "qch_launcher_icon_app", "");
|
||||||
Logutils.i(TAG, "DebugTest: qch_launcher_icon_app:" + Settings.System.getString(getContentResolver(), "qch_launcher_icon_app"));
|
Logutils.i(TAG, "DebugTest: qch_launcher_icon_app:" + Settings.System.getString(getContentResolver(), "qch_launcher_icon_app"));
|
||||||
Logutils.i(TAG, "DebugTest: qch_hide_NavigationBar: " + Settings.System.getString(getContentResolver(), "qch_hide_NavigationBar"));
|
Logutils.i(TAG, "DebugTest: qch_hide_NavigationBar: " + Settings.System.getString(getContentResolver(), "qch_hide_NavigationBar"));
|
||||||
String only_jgy_shortcut_list = Settings.System.getString(getContentResolver(), "only_jgy_shortcut_list");
|
String only_jgy_shortcut_list = Settings.System.getString(getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
|
||||||
Logutils.i(TAG, "debugTest: only_jgy_shortcut_list:" + only_jgy_shortcut_list);
|
Logutils.i(TAG, "debugTest: only_jgy_shortcut_list:" + only_jgy_shortcut_list);
|
||||||
String qch_app_forbid = Settings.System.getString(getContentResolver(), "qch_app_forbid");
|
String qch_app_forbid = Settings.System.getString(getContentResolver(), "qch_app_forbid");
|
||||||
Logutils.i(TAG, "debugTest: qch_app_forbid:" + qch_app_forbid);
|
Logutils.e(TAG, "debugTest: qch_app_forbid:" + qch_app_forbid);
|
||||||
Logutils.i(TAG, "debugTest: ip = " + JGYUtils.getInstance().getIPAddress());
|
Logutils.i(TAG, "debugTest: ip = " + JGYUtils.getInstance().getIPAddress());
|
||||||
Logutils.i(TAG, "debugTest: getPackage = " + Utils.getPackage());
|
Logutils.i(TAG, "debugTest: getPackage = " + Utils.getPackage());
|
||||||
Logutils.i(TAG, "debugTest: getMacAddress = " + Utils.getAndroid10MAC(this));
|
Logutils.i(TAG, "debugTest: getMacAddress = " + Utils.getAndroid10MAC(this));
|
||||||
@@ -128,12 +132,9 @@ public class HomeActivity extends AppCompatActivity {
|
|||||||
BaseApplication.cleanJpushTag();
|
BaseApplication.cleanJpushTag();
|
||||||
Logutils.e(TAG, "debugTest: SPUtils all " + SPUtils.getAll(this));
|
Logutils.e(TAG, "debugTest: SPUtils all " + SPUtils.getAll(this));
|
||||||
|
|
||||||
}
|
PackageManager packageManager = getPackageManager();
|
||||||
|
packageManager.setApplicationEnabledSetting(PackageNames.OLD_DEVICE_INFO, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||||
private void testRxhttp() {
|
packageManager.setApplicationEnabledSetting(PackageNames.OLD_APPSTORE, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||||
// RxHttp.postForm(URLAddress.SET_WHITE_PACKAGE_LIST)
|
|
||||||
// .add("sn", Utils.getSerial())
|
|
||||||
// .
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
@@ -148,28 +149,29 @@ public class HomeActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
private void bootanimotion() {
|
private void bootanimotion() {
|
||||||
// File file = new File(Environment.getExternalStorageDirectory() + File.separator + "bootanimation.zip");
|
File file = new File(Environment.getExternalStorageDirectory() + File.separator + "bootanimation.zip");
|
||||||
// String path0 = "/data/local/qchmedia/bootanimation.zip";
|
String path0 = "/data/local/qchmedia/bootanimation.zip";
|
||||||
// if (file.exists()) {
|
if (file.exists()) {
|
||||||
// File file1 = new File(path0);
|
File file1 = new File(path0);
|
||||||
// if (!file1.exists()) {
|
if (!file1.exists()) {
|
||||||
// file.mkdirs();
|
file.mkdirs();
|
||||||
// try {
|
try {
|
||||||
// file.createNewFile();
|
file.createNewFile();
|
||||||
// } catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// e.printStackTrace();
|
e.printStackTrace();
|
||||||
// Logutils.e("bootanimation", e.getMessage());
|
Logutils.e("bootanimation", e.getMessage());
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// Logutils.e("bootanimation", "SD卡路径存在");
|
Logutils.e("bootanimation", "SD卡路径存在");
|
||||||
// try {
|
try {
|
||||||
// Path path = Paths.get(file.getAbsolutePath());
|
Path path = Paths.get(file.getAbsolutePath());
|
||||||
// Files.copy(path, new FileOutputStream(path0));
|
Files.copy(path, new FileOutputStream(path0));
|
||||||
// } catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Logutils.e("bootanimation", e.getMessage());
|
Logutils.e("bootanimation", e.getMessage());
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static final String url = "www.baidu.com";
|
static final String url = "www.baidu.com";
|
||||||
@@ -190,7 +192,7 @@ public class HomeActivity extends AppCompatActivity {
|
|||||||
public void onPageFinished(WebView view, String url) {
|
public void onPageFinished(WebView view, String url) {
|
||||||
super.onPageFinished(view, url);
|
super.onPageFinished(view, url);
|
||||||
String realUrl = url;
|
String realUrl = url;
|
||||||
//这个realUrl即为重定向之后的地址
|
//这个realUrl即为重定向之后的地址
|
||||||
Logutils.e(TAG, "onPageFinished: " + realUrl);
|
Logutils.e(TAG, "onPageFinished: " + realUrl);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.activity;
|
package com.aoleyun.sn.activity;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
@@ -14,7 +14,6 @@ import android.view.KeyEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
@@ -22,18 +21,18 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|||||||
|
|
||||||
import com.blankj.utilcode.util.NetworkUtils;
|
import com.blankj.utilcode.util.NetworkUtils;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.mjsheng.myappstore.BuildConfig;
|
import com.aoleyun.sn.BuildConfig;
|
||||||
import com.mjsheng.myappstore.R;
|
import com.aoleyun.sn.R;
|
||||||
import com.mjsheng.myappstore.base.BaseActivity;
|
import com.aoleyun.sn.base.BaseActivity;
|
||||||
import com.mjsheng.myappstore.service.MainService;
|
import com.aoleyun.sn.service.MainService;
|
||||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
import com.aoleyun.sn.utils.ApkUtils;
|
||||||
import com.mjsheng.myappstore.utils.ExampleUtil;
|
import com.aoleyun.sn.utils.ExampleUtil;
|
||||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
import com.aoleyun.sn.utils.JGYUtils;
|
||||||
import com.mjsheng.myappstore.utils.Logutils;
|
import com.aoleyun.sn.utils.Logutils;
|
||||||
import com.mjsheng.myappstore.utils.SaveListUtils;
|
import com.aoleyun.sn.utils.SaveListUtils;
|
||||||
import com.mjsheng.myappstore.utils.SysSettingUtils;
|
import com.aoleyun.sn.utils.SysSettingUtils;
|
||||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
import com.aoleyun.sn.utils.ToastUtil;
|
||||||
import com.mjsheng.myappstore.utils.Utils;
|
import com.aoleyun.sn.utils.Utils;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@@ -41,13 +40,13 @@ import butterknife.BindView;
|
|||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
import cn.jpush.android.api.JPushInterface;
|
import cn.jpush.android.api.JPushInterface;
|
||||||
|
import io.reactivex.Observable;
|
||||||
import io.reactivex.ObservableEmitter;
|
import io.reactivex.ObservableEmitter;
|
||||||
import io.reactivex.ObservableOnSubscribe;
|
import io.reactivex.ObservableOnSubscribe;
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.annotations.NonNull;
|
import io.reactivex.annotations.NonNull;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
import rx.Observable;
|
|
||||||
import rx.android.schedulers.AndroidSchedulers;
|
|
||||||
|
|
||||||
public class MainActivity extends BaseActivity implements MainContact.MainView, NetworkUtils.OnNetworkStatusChangedListener {
|
public class MainActivity extends BaseActivity implements MainContact.MainView, NetworkUtils.OnNetworkStatusChangedListener {
|
||||||
private static final String TAG = MainActivity.class.getSimpleName();
|
private static final String TAG = MainActivity.class.getSimpleName();
|
||||||
@@ -94,7 +93,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
public static boolean isForeground = false;
|
public static boolean isForeground = false;
|
||||||
//for receive customer msg from jpush server
|
//for receive customer msg from jpush server
|
||||||
private MessageReceiver mMessageReceiver;
|
private MessageReceiver mMessageReceiver;
|
||||||
public static final String MESSAGE_RECEIVED_ACTION = "com.jiaoguanyi.appstore.MESSAGE_RECEIVED_ACTION";
|
public static final String MESSAGE_RECEIVED_ACTION = "com.aoleyun.sn.MESSAGE_RECEIVED_ACTION";
|
||||||
public static final String KEY_TITLE = "title";
|
public static final String KEY_TITLE = "title";
|
||||||
public static final String KEY_MESSAGE = "message";
|
public static final String KEY_MESSAGE = "message";
|
||||||
public static final String KEY_EXTRAS = "extras";
|
public static final String KEY_EXTRAS = "extras";
|
||||||
@@ -540,7 +539,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
io.reactivex.Observable.create(mObservableOnSubscribe)
|
Observable.create(mObservableOnSubscribe)
|
||||||
.throttleFirst(10, TimeUnit.SECONDS)
|
.throttleFirst(10, TimeUnit.SECONDS)
|
||||||
//这句很关键,这是RxJava中的操作符,在规定时间内观察者不在接收被观察者发送的事件
|
//这句很关键,这是RxJava中的操作符,在规定时间内观察者不在接收被观察者发送的事件
|
||||||
.subscribe(mObserver);
|
.subscribe(mObserver);
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.activity;
|
package com.aoleyun.sn.activity;
|
||||||
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.mjsheng.myappstore.base.BasePresenter;
|
import com.aoleyun.sn.base.BasePresenter;
|
||||||
import com.mjsheng.myappstore.base.BaseView;
|
import com.aoleyun.sn.base.BaseView;
|
||||||
|
|
||||||
public class MainContact {
|
public class MainContact {
|
||||||
public interface Presenter extends BasePresenter<MainView> {
|
public interface Presenter extends BasePresenter<MainView> {
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
package com.mjsheng.myappstore.activity;
|
package com.aoleyun.sn.activity;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.SystemClock;
|
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -13,37 +12,38 @@ import android.view.View;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.aoleyun.sn.action.JGYActions;
|
||||||
|
import com.aoleyun.sn.comm.PackageNames;
|
||||||
import com.arialyy.aria.core.Aria;
|
import com.arialyy.aria.core.Aria;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.mjsheng.myappstore.BuildConfig;
|
import com.aoleyun.sn.BuildConfig;
|
||||||
import com.mjsheng.myappstore.base.BaseApplication;
|
import com.aoleyun.sn.base.BaseApplication;
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.bean.BrowserData;
|
import com.aoleyun.sn.bean.DefaultApp;
|
||||||
import com.mjsheng.myappstore.bean.DefaultApp;
|
import com.aoleyun.sn.bean.ForceDownloadBean;
|
||||||
import com.mjsheng.myappstore.bean.ForceDownloadBean;
|
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||||
import com.mjsheng.myappstore.bean.ForceDownloadData;
|
import com.aoleyun.sn.bean.LogoImg;
|
||||||
import com.mjsheng.myappstore.bean.LogoImg;
|
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
import com.aoleyun.sn.bean.StudentsInfo;
|
||||||
import com.mjsheng.myappstore.bean.StudentsInfo;
|
import com.aoleyun.sn.jpush.TagAliasOperatorHelper;
|
||||||
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
|
import com.aoleyun.sn.manager.NetInterfaceManager;
|
||||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
import com.aoleyun.sn.network.HTTPInterface;
|
||||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
import com.aoleyun.sn.service.MainService;
|
||||||
import com.mjsheng.myappstore.service.MainService;
|
import com.aoleyun.sn.utils.ApkUtils;
|
||||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
import com.aoleyun.sn.utils.AES.CXAESUtil;
|
||||||
import com.mjsheng.myappstore.utils.AES.CXAESUtil;
|
import com.aoleyun.sn.utils.ForegroundAppUtil;
|
||||||
import com.mjsheng.myappstore.utils.ForegroundAppUtil;
|
import com.aoleyun.sn.utils.JGYUtils;
|
||||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
import com.aoleyun.sn.utils.Logutils;
|
||||||
import com.mjsheng.myappstore.utils.Logutils;
|
import com.aoleyun.sn.utils.SPUtils;
|
||||||
import com.mjsheng.myappstore.utils.SPUtils;
|
import com.aoleyun.sn.utils.SysSettingUtils;
|
||||||
import com.mjsheng.myappstore.utils.SysSettingUtils;
|
import com.aoleyun.sn.utils.TimeUtils;
|
||||||
import com.mjsheng.myappstore.utils.TimeUtils;
|
import com.aoleyun.sn.utils.ToastUtil;
|
||||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
import com.aoleyun.sn.utils.URLUtils;
|
||||||
import com.mjsheng.myappstore.utils.URLUtils;
|
import com.aoleyun.sn.utils.Utils;
|
||||||
import com.mjsheng.myappstore.utils.Utils;
|
|
||||||
import com.trello.rxlifecycle2.LifecycleProvider;
|
import com.trello.rxlifecycle2.LifecycleProvider;
|
||||||
import com.trello.rxlifecycle2.android.ActivityEvent;
|
import com.trello.rxlifecycle2.android.ActivityEvent;
|
||||||
|
|
||||||
@@ -63,8 +63,8 @@ import io.reactivex.disposables.Disposable;
|
|||||||
import io.reactivex.schedulers.Schedulers;
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
|
|
||||||
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_SET;
|
import static com.aoleyun.sn.jpush.TagAliasOperatorHelper.ACTION_SET;
|
||||||
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
|
import static com.aoleyun.sn.jpush.TagAliasOperatorHelper.sequence;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MainActivity和MainService 的 Presenter
|
* MainActivity和MainService 的 Presenter
|
||||||
@@ -194,7 +194,7 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
//如果是解锁状态就隐藏,锁定就显示缓存
|
//如果是解锁状态就隐藏,锁定就显示缓存
|
||||||
if (Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 0) == 1) {
|
if (Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0) == 1) {
|
||||||
mView.setNumberText("", View.GONE);
|
mView.setNumberText("", View.GONE);
|
||||||
mView.setNameText("", View.GONE);
|
mView.setNameText("", View.GONE);
|
||||||
mView.setClassText("", View.GONE);
|
mView.setClassText("", View.GONE);
|
||||||
@@ -258,7 +258,7 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
|
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
|
||||||
int locked = jsonObject.get("lock").getAsInt();
|
int locked = jsonObject.get("lock").getAsInt();
|
||||||
Logutils.e(TAG + ":" + "getLockedState", "locked: " + locked);
|
Logutils.e(TAG + ":" + "getLockedState", "locked: " + locked);
|
||||||
int oldState = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 0);
|
int oldState = Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||||
Logutils.e(TAG + ":" + "getLockedState", "qch_unlock_ipad: " + oldState);
|
Logutils.e(TAG + ":" + "getLockedState", "qch_unlock_ipad: " + oldState);
|
||||||
//后台1是锁定,底层0是锁定
|
//后台1是锁定,底层0是锁定
|
||||||
SPUtils.put(mContext, "first_connect", 1);
|
SPUtils.put(mContext, "first_connect", 1);
|
||||||
@@ -267,10 +267,10 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
Logutils.e(TAG + ":" + "getLockedState", "onNext: " + "state changed , reset devices");
|
Logutils.e(TAG + ":" + "getLockedState", "onNext: " + "state changed , reset devices");
|
||||||
Utils.doMasterClear(mContext);
|
Utils.doMasterClear(mContext);
|
||||||
}
|
}
|
||||||
Settings.System.putInt(mContext.getContentResolver(), "qch_unlock_ipad", 0);
|
Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||||
} else {
|
} else {
|
||||||
// SysSettingUtils.setEnableSetting(mContext);
|
// SysSettingUtils.setEnableSetting(mContext);
|
||||||
Settings.System.putInt(mContext.getContentResolver(), "qch_unlock_ipad", 1);
|
Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 1);
|
||||||
}
|
}
|
||||||
mView.setLockedState(locked == 1);
|
mView.setLockedState(locked == 1);
|
||||||
} else if (response.code == -300) {
|
} else if (response.code == -300) {
|
||||||
@@ -283,7 +283,7 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
Logutils.e(TAG + ":" + "getLockedState", "onError: " + e.getMessage());
|
Logutils.e(TAG + ":" + "getLockedState", "onError: " + e.getMessage());
|
||||||
int locked = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 0);
|
int locked = Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||||
Logutils.e(TAG + ":" + "getLockedState", "locked: " + locked);
|
Logutils.e(TAG + ":" + "getLockedState", "locked: " + locked);
|
||||||
mView.setLockedState(locked == 0);
|
mView.setLockedState(locked == 0);
|
||||||
}
|
}
|
||||||
@@ -387,7 +387,7 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
jsonObject.addProperty("latitude", latitude);
|
jsonObject.addProperty("latitude", latitude);
|
||||||
String add = jsonObject.toString();
|
String add = jsonObject.toString();
|
||||||
Logutils.e(TAG, "updateDevicesInfo: " + add);
|
Logutils.e(TAG, "updateDevicesInfo: " + add);
|
||||||
NetInterfaceManager.getUpdateDeviceInfo()
|
NetInterfaceManager.getInstance().getUpdateDeviceInfo()
|
||||||
.updateDeviceInfo(
|
.updateDeviceInfo(
|
||||||
Utils.getSerial(),
|
Utils.getSerial(),
|
||||||
NetInterfaceManager.HTTP_KEY,
|
NetInterfaceManager.HTTP_KEY,
|
||||||
@@ -617,7 +617,7 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
private void checkUpdateStore() {
|
private void checkUpdateStore() {
|
||||||
NetInterfaceManager.getInstance()
|
NetInterfaceManager.getInstance()
|
||||||
.getUpdateApi()
|
.getUpdateApi()
|
||||||
.getUpdate("com.jiaoguanyi.store",
|
.getUpdate(PackageNames.APPSTORE,
|
||||||
JGYUtils.getInstance().checkAppPlatform())
|
JGYUtils.getInstance().checkAppPlatform())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
@@ -827,19 +827,15 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
if (code == OK) {
|
if (code == OK) {
|
||||||
String data = jsonObject.get("data").getAsJsonObject().get("result").getAsString();
|
String data = jsonObject.get("data").getAsJsonObject().get("result").getAsString();
|
||||||
//开机图标
|
//开机图标
|
||||||
boolean write = Settings.System.putString(mContext.getContentResolver(), "only_jgy_shortcut_list", data);
|
boolean write = Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, data);
|
||||||
Logutils.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
Logutils.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||||
JGYUtils.getInstance().writeAppPackageList(mContext, data);
|
JGYUtils.getInstance().writeAppPackageList(mContext, data);
|
||||||
mView.getAppLimitFinished(data);
|
mView.getAppLimitFinished(data);
|
||||||
} else {
|
} else {
|
||||||
// mView.getAppLimitFinished("");
|
boolean write = Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, " ");
|
||||||
boolean write = Settings.System.putString(mContext.getContentResolver(), "only_jgy_shortcut_list", " ");
|
|
||||||
Logutils.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
Logutils.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||||
Logutils.e(TAG + ":" + "getAppLimit", "onNext: " + bodyString);
|
Logutils.e(TAG + ":" + "getAppLimit", "onNext: " + bodyString);
|
||||||
mView.getAppLimitFinished("");
|
mView.getAppLimitFinished("");
|
||||||
// String oldListString = Settings.System.getString(mContext.getContentResolver(), "qch_app_forbid");
|
|
||||||
// Log.e("getAppLimit", "oldListString: " + oldListString);
|
|
||||||
// mView.getAppLimitFinished(oldListString);
|
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -850,7 +846,7 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
Logutils.e(TAG + ":" + "getAppLimit", "onError: " + e.getMessage());
|
Logutils.e(TAG + ":" + "getAppLimit", "onError: " + e.getMessage());
|
||||||
String oldListString = Settings.System.getString(mContext.getContentResolver(), "only_jgy_shortcut_list");
|
String oldListString = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
|
||||||
Logutils.e(TAG + ":" + "getAppLimit", "oldListString: " + oldListString);
|
Logutils.e(TAG + ":" + "getAppLimit", "oldListString: " + oldListString);
|
||||||
mView.getAppLimitFinished(oldListString);
|
mView.getAppLimitFinished(oldListString);
|
||||||
}
|
}
|
||||||
@@ -868,7 +864,7 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
// mView.getDeviceBatchFinished();
|
// mView.getDeviceBatchFinished();
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
int locked = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 0);
|
int locked = Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||||
Logutils.e(TAG, "getDeviceBatch: " + locked);
|
Logutils.e(TAG, "getDeviceBatch: " + locked);
|
||||||
if (locked == 0) {
|
if (locked == 0) {
|
||||||
// NetInterfaceManager.getInstance()
|
// NetInterfaceManager.getInstance()
|
||||||
@@ -1762,7 +1758,7 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lastRunTime = System.currentTimeMillis();
|
lastRunTime = System.currentTimeMillis();
|
||||||
int locked = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 0);
|
int locked = Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||||
if (JGYUtils.isOfficialVersion() || locked == 1) {
|
if (JGYUtils.isOfficialVersion() || locked == 1) {
|
||||||
mView.setScreenLockStateFinished(false, "");
|
mView.setScreenLockStateFinished(false, "");
|
||||||
return;
|
return;
|
||||||
@@ -1835,7 +1831,7 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
JGYUtils.getInstance().installDesktop(data);
|
JGYUtils.getInstance().installDesktop(data);
|
||||||
} else {
|
} else {
|
||||||
Logutils.e(TAG + ":" + "getDefaultDesktop", "onNext: " + "删除定制桌面");
|
Logutils.e(TAG + ":" + "getDefaultDesktop", "onNext: " + "删除定制桌面");
|
||||||
String whiteList = Settings.System.getString(mContext.getContentResolver(), "only_jgy_shortcut_list");
|
String whiteList = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
|
||||||
if (!TextUtils.isEmpty(whiteList)) {
|
if (!TextUtils.isEmpty(whiteList)) {
|
||||||
if (!whiteList.contains(ApkUtils.desktopAPP.get(0))) {
|
if (!whiteList.contains(ApkUtils.desktopAPP.get(0))) {
|
||||||
ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(0));
|
ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(0));
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.activity;
|
package com.aoleyun.sn.activity;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.R;
|
import com.aoleyun.sn.R;
|
||||||
|
|
||||||
public class TopActivity extends AppCompatActivity {
|
public class TopActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@@ -1,14 +1,10 @@
|
|||||||
package com.mjsheng.myappstore.base;
|
package com.aoleyun.sn.base;
|
||||||
|
|
||||||
import android.graphics.Color;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
import com.aoleyun.sn.R;
|
||||||
import com.mjsheng.myappstore.R;
|
|
||||||
import com.mjsheng.myappstore.utils.StatusBarUtil;
|
|
||||||
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;
|
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;
|
||||||
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
||||||
|
|
||||||
@@ -16,7 +12,14 @@ public abstract class BaseActivity extends RxAppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
// StatusBarUtil.init(this);
|
setBar();
|
||||||
|
//状态栏改变放在setContentView前后有所不同
|
||||||
|
setContentView(this.getLayoutId());
|
||||||
|
initView();
|
||||||
|
initData();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setBar() {
|
||||||
UltimateBarX.statusBar(this)
|
UltimateBarX.statusBar(this)
|
||||||
.transparent()
|
.transparent()
|
||||||
.colorRes(R.color.colorPrimaryDark)
|
.colorRes(R.color.colorPrimaryDark)
|
||||||
@@ -27,10 +30,6 @@ public abstract class BaseActivity extends RxAppCompatActivity {
|
|||||||
.colorRes(R.color.colorPrimaryDark)
|
.colorRes(R.color.colorPrimaryDark)
|
||||||
.light(true)
|
.light(true)
|
||||||
.apply();
|
.apply();
|
||||||
//状态栏改变放在setContentView前后有所不同
|
|
||||||
setContentView(this.getLayoutId());
|
|
||||||
initView();
|
|
||||||
initData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.mjsheng.myappstore.base;
|
package com.aoleyun.sn.base;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.nfc.Tag;
|
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Process;
|
import android.os.Process;
|
||||||
@@ -12,29 +12,25 @@ import androidx.multidex.MultiDexApplication;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.arialyy.aria.core.Aria;
|
import com.arialyy.aria.core.Aria;
|
||||||
import com.arialyy.aria.core.download.DownloadEntity;
|
import com.arialyy.aria.core.download.DownloadEntity;
|
||||||
import com.lzy.okgo.OkGo;
|
import com.aoleyun.sn.BuildConfig;
|
||||||
import com.lzy.okgo.cache.CacheEntity;
|
import com.aoleyun.sn.jpush.TagAliasOperatorHelper;
|
||||||
import com.lzy.okgo.cache.CacheMode;
|
import com.aoleyun.sn.manager.AmapManager;
|
||||||
import com.lzy.okgo.callback.StringCallback;
|
import com.aoleyun.sn.manager.FileManager;
|
||||||
import com.lzy.okgo.cookie.store.PersistentCookieStore;
|
import com.aoleyun.sn.manager.NetInterfaceManager;
|
||||||
import com.mjsheng.myappstore.BuildConfig;
|
import com.aoleyun.sn.network.HTTPInterface;
|
||||||
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
import com.mjsheng.myappstore.manager.AmapManager;
|
import com.aoleyun.sn.statistics.AppInformation;
|
||||||
import com.mjsheng.myappstore.manager.FileManager;
|
import com.aoleyun.sn.statistics.StatisticsInfo;
|
||||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
import com.aoleyun.sn.utils.ApkUtils;
|
||||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
import com.aoleyun.sn.utils.JGYUtils;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.utils.Logutils;
|
||||||
import com.mjsheng.myappstore.statistics.AppInformation;
|
import com.aoleyun.sn.utils.SystemUtils;
|
||||||
import com.mjsheng.myappstore.statistics.StatisticsInfo;
|
import com.aoleyun.sn.utils.ToastUtil;
|
||||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
import com.aoleyun.sn.utils.Utils;
|
||||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
import com.aoleyun.sn.utils.XAPKUtils;
|
||||||
import com.mjsheng.myappstore.utils.Logutils;
|
|
||||||
import com.mjsheng.myappstore.utils.SystemUtils;
|
|
||||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
|
||||||
import com.mjsheng.myappstore.utils.Utils;
|
|
||||||
import com.mjsheng.myappstore.utils.XAPKUtils;
|
|
||||||
import com.tencent.mmkv.MMKV;
|
import com.tencent.mmkv.MMKV;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -43,7 +39,6 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import cn.jpush.android.api.JPushInterface;
|
import cn.jpush.android.api.JPushInterface;
|
||||||
import cn.jpush.android.api.JPushMessage;
|
import cn.jpush.android.api.JPushMessage;
|
||||||
@@ -51,22 +46,21 @@ import io.reactivex.Observable;
|
|||||||
import io.reactivex.ObservableEmitter;
|
import io.reactivex.ObservableEmitter;
|
||||||
import io.reactivex.ObservableOnSubscribe;
|
import io.reactivex.ObservableOnSubscribe;
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import okhttp3.Call;
|
import okhttp3.Call;
|
||||||
import okhttp3.Callback;
|
import okhttp3.Callback;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Administrator on 2016/2/17 0017.
|
|
||||||
*/
|
|
||||||
|
|
||||||
//public class MyApplication extends MultiDexApplication implements Thread.UncaughtExceptionHandler {
|
|
||||||
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();
|
||||||
|
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
public static Context context;
|
public static Context context;
|
||||||
|
@SuppressLint("StaticFieldLeak")
|
||||||
private static BaseApplication instance;
|
private static BaseApplication instance;
|
||||||
|
|
||||||
public static Context getAppContext() {
|
public static Context getAppContext() {
|
||||||
@@ -81,7 +75,6 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
@@ -108,12 +101,9 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
// 设置开启日志,发布时请关闭日志
|
// 设置开启日志,发布时请关闭日志
|
||||||
JPushInterface.setDebugMode(true);
|
JPushInterface.setDebugMode(true);
|
||||||
JPushInterface.requestPermission(this);
|
JPushInterface.requestPermission(this);
|
||||||
|
//解锁设备不需要初始化
|
||||||
// 初始化 JPush
|
// 初始化 JPush
|
||||||
//JPushInterface.init(this);
|
//JPushInterface.init(this);
|
||||||
//解锁设备不需要初始化
|
|
||||||
|
|
||||||
initOKHttp();
|
|
||||||
|
|
||||||
Aria.init(this);
|
Aria.init(this);
|
||||||
Aria.get(this).getDownloadConfig().setMaxTaskNum(1);
|
Aria.get(this).getDownloadConfig().setMaxTaskNum(1);
|
||||||
Aria.get(this).getDownloadConfig().setConvertSpeed(true);
|
Aria.get(this).getDownloadConfig().setConvertSpeed(true);
|
||||||
@@ -123,7 +113,7 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
}
|
}
|
||||||
// Configuration config = getResources().getConfiguration();
|
// Configuration config = getResources().getConfiguration();
|
||||||
// int smallestScreenWidthDp = config.smallestScreenWidthDp;
|
// int smallestScreenWidthDp = config.smallestScreenWidthDp;
|
||||||
// Logutils.e("mjsheng", "smallestScreenWidthDp=" + smallestScreenWidthDp);
|
// Logutils.e("init", "smallestScreenWidthDp=" + smallestScreenWidthDp);
|
||||||
// CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
|
// CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
|
||||||
// .setDefaultFontPath("fonts/1234.ttf")
|
// .setDefaultFontPath("fonts/1234.ttf")
|
||||||
// .setDefaultFontPath("fonts/Roboto-RobotoRegular.ttf")
|
// .setDefaultFontPath("fonts/Roboto-RobotoRegular.ttf")
|
||||||
@@ -134,6 +124,33 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
initTagObservable();
|
initTagObservable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void catchException() {
|
||||||
|
Thread.setDefaultUncaughtExceptionHandler(
|
||||||
|
new Thread.UncaughtExceptionHandler() {
|
||||||
|
@Override
|
||||||
|
public void uncaughtException(Thread t, Throwable e) {
|
||||||
|
Logutils.e("捕获异常子线程:", Thread.currentThread().getName() +
|
||||||
|
"在:" + e.getStackTrace()[0].getClassName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
//下面是新增方法!
|
||||||
|
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
while (true) {
|
||||||
|
try {
|
||||||
|
Looper.loop(); //会先执行这个方法,然后在执行下面的异常捕获方法!
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logutils.e("捕获异常主线程:", Thread.currentThread().getName() + "在:" + e.getStackTrace()[0].getClassName());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onAliasOperatorResult(JPushMessage jPushMessage) {
|
public void onAliasOperatorResult(JPushMessage jPushMessage) {
|
||||||
if (jPushMessage == null) {
|
if (jPushMessage == null) {
|
||||||
return;
|
return;
|
||||||
@@ -397,33 +414,6 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
void onResult(int code);
|
void onResult(int code);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void catchException() {
|
|
||||||
Thread.setDefaultUncaughtExceptionHandler(
|
|
||||||
new Thread.UncaughtExceptionHandler() {
|
|
||||||
@Override
|
|
||||||
public void uncaughtException(Thread t, Throwable e) {
|
|
||||||
Logutils.e("捕获异常子线程:", Thread.currentThread().getName() +
|
|
||||||
"在:" + e.getStackTrace()[0].getClassName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
//下面是新增方法!
|
|
||||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
while (true) {
|
|
||||||
try {
|
|
||||||
Looper.loop(); //会先执行这个方法,然后在执行下面的异常捕获方法!
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logutils.e("捕获异常主线程:", Thread.currentThread().getName() + "在:" + e.getStackTrace()[0].getClassName());
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private boolean finished = false;
|
private boolean finished = false;
|
||||||
|
|
||||||
public boolean isFinished() {
|
public boolean isFinished() {
|
||||||
@@ -434,33 +424,6 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
this.finished = b;
|
this.finished = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initOKHttp() {
|
|
||||||
//必须调用初始化
|
|
||||||
OkGo.init(this);
|
|
||||||
//以下都不是必须的,根据需要自行选择,一般来说只需要 debug,缓存相关,cookie相关的 就可以了
|
|
||||||
OkGo.getInstance()
|
|
||||||
// 打开该调试开关,打印级别INFO,并不是异常,是为了显眼,不需要就不要加入该行
|
|
||||||
// 最后的true表示是否打印okgo的内部异常,一般打开方便调试错误
|
|
||||||
.debug("OkGo", Level.INFO, true)
|
|
||||||
//如果使用默认的 60秒,以下三行也不需要传
|
|
||||||
// .setConnectTimeout(3000) //全局的连接超时时间
|
|
||||||
// .setReadTimeOut(3000) //全局的读取超时时间
|
|
||||||
// .setWriteTimeOut(3000) //全局的写入超时时间
|
|
||||||
//可以全局统一设置缓存模式,默认是不使用缓存,可以不传,具体其他模式看 github 介绍 https://github.com/jeasonlzy/
|
|
||||||
.setCacheMode(CacheMode.REQUEST_FAILED_READ_CACHE)
|
|
||||||
//可以全局统一设置缓存时间,默认永不过期,具体使用方法看 github 介绍
|
|
||||||
.setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE)
|
|
||||||
//可以全局统一设置超时重连次数,默认为三次,那么最差的情况会请求4次(一次原始请求,三次重连请求),不需要可以设置为0
|
|
||||||
.setRetryCount(4)
|
|
||||||
.setCookieStore(new PersistentCookieStore()) //cookie持久化存储,如果cookie不过期,则一直有效
|
|
||||||
//可以设置https的证书,以下几种方案根据需要自己设置 方法一:信任所有证书,不安全有风险
|
|
||||||
.setCertificates();
|
|
||||||
// com.lzy.okserver.download.DownloadManager downloadManager = DownloadService.getDownloadManager();
|
|
||||||
// downloadManager.setTargetFolder(StorageUtils.getFileRoot(this));
|
|
||||||
// downloadManager.setTargetFolder(PathUtils.getExternalDownloadsPath() + "/jgy/");
|
|
||||||
// downloadManager.getThreadPool().setCorePoolSize(5);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void sendAppUsedTime(String random, String type) {
|
public static void sendAppUsedTime(String random, String type) {
|
||||||
StatisticsInfo statisticsInfo = null;
|
StatisticsInfo statisticsInfo = null;
|
||||||
if (type.equals("0")) {
|
if (type.equals("0")) {
|
||||||
@@ -502,26 +465,39 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logutils.e("sendAppUsedTime", e.getMessage());
|
Logutils.e("sendAppUsedTime", e.getMessage());
|
||||||
}
|
}
|
||||||
OkGo.post(URLAddress.SEND_USEDTIME)
|
|
||||||
.params("sn", Utils.getSerial())
|
NetInterfaceManager.getInstance()
|
||||||
.params("random", random)
|
.getAppLogApi()
|
||||||
.params("data", data.toString())
|
.getAppLog(Utils.getSerial(), random, data.toJSONString())
|
||||||
.execute(new StringCallback() {
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String s, Call call, Response response) {
|
public void onSubscribe(Disposable d) {
|
||||||
com.alibaba.fastjson.JSONObject object = JSON.parseObject(s);
|
Log.e("sendAppUsedTime", "onSubscribe: ");
|
||||||
int code = object.getInteger("code");
|
|
||||||
String msg = object.getString("msg");
|
|
||||||
Logutils.e("fht", "code:" + code + "," + msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Call call, Response response, Exception e) {
|
public void onNext(BaseResponse baseResponse) {
|
||||||
super.onError(call, response, e);
|
Log.e("sendAppUsedTime", "onNext: ");
|
||||||
Logutils.e("sendAppUsedTime", e.getMessage());
|
int code = baseResponse.code;
|
||||||
|
String msg = baseResponse.msg;
|
||||||
|
Logutils.e("sendAppUsedTime", "onSubscribe:" + msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e("sendAppUsedTime", "onError: " + e.getMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("sendAppUsedTime", "onComplete: ");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static long totalTime;
|
private static long totalTime;
|
||||||
@@ -554,85 +530,6 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public void uncaughtException(Thread thread, Throwable ex) {
|
|
||||||
//// Logutils.e(TAG, ex.getMessage(), new Exception(ex));
|
|
||||||
//// Utils.showToast(this, "程序出现异常,即将退出。。。");
|
|
||||||
//// try {
|
|
||||||
//// Thread.sleep(3000);
|
|
||||||
//// } catch (InterruptedException e) {
|
|
||||||
//// e.printStackTrace();
|
|
||||||
//// }
|
|
||||||
//// Intent i = getBaseContext().getPackageManager()
|
|
||||||
//// .getLaunchIntentForPackage(getBaseContext().getPackageName());
|
|
||||||
//// i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
||||||
//// startActivity(i);
|
|
||||||
//// //退出程序
|
|
||||||
//// android.os.Process.killProcess(android.os.Process.myPid());
|
|
||||||
//// System.exit(1);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
// static List<FileData> fileList = new ArrayList<>();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// static String packageName = "";
|
|
||||||
//
|
|
||||||
// public void setInstallIngPackageName(String packageNames) {
|
|
||||||
// packageName = packageNames;
|
|
||||||
// Logutils.e("fht", "正在安装:" + packageNames);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public String getInstallIngPackageName() {
|
|
||||||
// return packageName;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void addFileData(FileData data) {
|
|
||||||
// fileList.add(data);
|
|
||||||
// updateList();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void removeDate(String packageName) {
|
|
||||||
// if (fileList != null && fileList.size() > 0) {
|
|
||||||
// for (FileData data : fileList) {
|
|
||||||
// if (data.getPackageName().equals(packageName)) {
|
|
||||||
// fileList.remove(data);
|
|
||||||
// break;
|
|
||||||
// } else {
|
|
||||||
// Logutils.e("fht", "not found object");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// setInstallIngPackageName("");
|
|
||||||
// if (fileList.size() > 0) {
|
|
||||||
// updateList();
|
|
||||||
// } else {
|
|
||||||
// Logutils.e("fht", "fileList为空");
|
|
||||||
// setInstallIngPackageName("");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void updateList() {
|
|
||||||
// if (getInstallIngPackageName().equals("") || ApkUtils.isAvailable(getAppContext(), packageName)) {
|
|
||||||
// if (fileList != null && fileList.size() > 0) {
|
|
||||||
// if (!fileList.get(0).getPackageName().equals("") || ApkUtils.isAvailable(getAppContext(), fileList.get(0).getPackageName())) {
|
|
||||||
// String s = packageName;
|
|
||||||
// ApkUtils.installApp(this, fileList.get(0).getFilePath());
|
|
||||||
// setInstallIngPackageName(fileList.get(0).getPackageName());
|
|
||||||
// } else {
|
|
||||||
// removeDate(fileList.get(0).getPackageName());
|
|
||||||
// Logutils.e("fht", "已安装");
|
|
||||||
// setInstallIngPackageName("");
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// Logutils.e("fht", "任务为空");
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// Logutils.e("fht", "安装中:" + packageName);
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
boolean isForecDownload = false;
|
boolean isForecDownload = false;
|
||||||
|
|
||||||
public boolean isDownloading() {
|
public boolean isDownloading() {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.base;
|
package com.aoleyun.sn.base;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
4
app/src/main/java/com/aoleyun/sn/base/BaseView.java
Normal file
4
app/src/main/java/com/aoleyun/sn/base/BaseView.java
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
package com.aoleyun.sn.base;
|
||||||
|
|
||||||
|
public interface BaseView {
|
||||||
|
}
|
||||||
@@ -1,12 +1,14 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Administrator on 2016/10/9.
|
|
||||||
*/
|
|
||||||
public class AppDateInfo implements Serializable {
|
public class AppDateInfo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -8954939883956606971L;
|
||||||
|
|
||||||
public String id;
|
public String id;
|
||||||
public String app_name;
|
public String app_name;
|
||||||
public String app_package;
|
public String app_package;
|
||||||
@@ -144,21 +146,6 @@ public class AppDateInfo implements Serializable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "AppDateInfo{" +
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
"id='" + id + '\'' +
|
|
||||||
", app_name='" + app_name + '\'' +
|
|
||||||
", app_package='" + app_package + '\'' +
|
|
||||||
", app_version_name='" + app_version_name + '\'' +
|
|
||||||
", app_desc='" + app_desc + '\'' +
|
|
||||||
", app_downloads='" + app_downloads + '\'' +
|
|
||||||
", app_size='" + app_size + '\'' +
|
|
||||||
", app_img='" + app_img + '\'' +
|
|
||||||
", app_url='" + app_url + '\'' +
|
|
||||||
", app_createtime='" + app_createtime + '\'' +
|
|
||||||
", app_score='" + app_score + '\'' +
|
|
||||||
", xitong_id='" + xitong_id + '\'' +
|
|
||||||
", zixitong_id='" + zixitong_id + '\'' +
|
|
||||||
", app_tag='" + app_tag + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@@ -7,6 +7,8 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class AppDownloadInfo implements Serializable {
|
public class AppDownloadInfo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -7868862477686450613L;
|
||||||
|
|
||||||
private String url; //文件URL
|
private String url; //文件URL
|
||||||
private String targetPath; //保存文件地址
|
private String targetPath; //保存文件地址
|
||||||
private String fileName; //保存的文件名
|
private String fileName; //保存的文件名
|
||||||
@@ -1,15 +1,12 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
public class AppInfoBean implements Serializable {
|
||||||
* 作者 mjsheng
|
|
||||||
* 日期 2018/8/29 13:59
|
private static final long serialVersionUID = 4849594429309728182L;
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class AppInfoBean {
|
|
||||||
private int code;
|
private int code;
|
||||||
private String msg;
|
private String msg;
|
||||||
private List<AppDateInfo> data;
|
private List<AppDateInfo> data;
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class AppListInfo implements Serializable {
|
public class AppListInfo implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 9075899098432175779L;
|
private static final long serialVersionUID = 9075899098432175779L;
|
||||||
|
|
||||||
private long app_version_code;
|
private long app_version_code;
|
||||||
private String app_name;
|
private String app_name;
|
||||||
private String app_package;
|
private String app_package;
|
||||||
@@ -1,10 +1,18 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Administrator on 2017/1/10.
|
* Created by Administrator on 2017/1/10.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class AppUpdateInfo {
|
public class AppUpdateInfo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 8448660007210869129L;
|
||||||
|
|
||||||
private String packageName;
|
private String packageName;
|
||||||
private String version;
|
private String version;
|
||||||
|
|
||||||
@@ -26,9 +34,6 @@ public class AppUpdateInfo {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "AppUpdateInfo{" +
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
"packageName='" + packageName + '\'' +
|
|
||||||
", version='" + version + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class Appground implements Serializable {
|
public class Appground implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4623189862812297724L;
|
private static final long serialVersionUID = 4623189862812297724L;
|
||||||
|
|
||||||
private String packages;
|
private String packages;
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
|
||||||
@@ -14,10 +18,9 @@ public class BaseResponse<T> implements Serializable {
|
|||||||
public String msg;
|
public String msg;
|
||||||
public T data;
|
public T data;
|
||||||
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "{" + "code:" + code + "," + "msg:" + msg + "," + "data:" + data + "," + '}';
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class Batch implements Serializable {
|
public class Batch implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -1762804079800707443L;
|
||||||
|
|
||||||
int id;
|
int id;
|
||||||
String batch;
|
String batch;
|
||||||
int admin_id;
|
int admin_id;
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class BrowserBookmarks implements Serializable {
|
public class BrowserBookmarks implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 596864357553413994L;
|
private static final long serialVersionUID = 596864357553413994L;
|
||||||
|
|
||||||
private String homepage;
|
private String homepage;
|
||||||
private String labelpage;
|
private String labelpage;
|
||||||
|
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class BrowserData implements Serializable {
|
public class BrowserData implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 5199831572891077086L;
|
private static final long serialVersionUID = 5199831572891077086L;
|
||||||
|
|
||||||
private String white;
|
private String white;
|
||||||
private String black;
|
private String black;
|
||||||
private String white_ip;
|
private String white_ip;
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@@ -6,11 +9,13 @@ import java.io.Serializable;
|
|||||||
* Created by Administrator on 2016/10/10.
|
* Created by Administrator on 2016/10/10.
|
||||||
*/
|
*/
|
||||||
public class CategoryInfo implements Serializable {
|
public class CategoryInfo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1373346057675939423L;
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
private String name;
|
private String name;
|
||||||
private String img;
|
private String img;
|
||||||
|
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -37,11 +42,7 @@ public class CategoryInfo implements Serializable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CategoryInfo{" +
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
"id='" + id + '\'' +
|
|
||||||
", name='" + name + '\'' +
|
|
||||||
", img='" + img + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
public class CategoryPicBean implements Serializable {
|
||||||
* 作者 mjsheng
|
|
||||||
* 日期 2018/9/14 10:50
|
private static final long serialVersionUID = -4286518544348292816L;
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class CategoryPicBean {
|
|
||||||
private int code;
|
private int code;
|
||||||
private String msg;
|
private String msg;
|
||||||
private List<CategoryInfo> data;
|
private List<CategoryInfo> data;
|
||||||
@@ -40,10 +40,6 @@ public class CategoryPicBean {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CategoryPicBean{" +
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
"code=" + code +
|
|
||||||
", msg='" + msg + '\'' +
|
|
||||||
", data=" + data +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
45
app/src/main/java/com/aoleyun/sn/bean/CommonPicBean.java
Normal file
45
app/src/main/java/com/aoleyun/sn/bean/CommonPicBean.java
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CommonPicBean implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -6056771155399643320L;
|
||||||
|
|
||||||
|
private int code;
|
||||||
|
private String msg;
|
||||||
|
private List<CommonPicData> data;
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(int code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<CommonPicData> getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(List<CommonPicData> data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,14 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class CommonPicData implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -4066453793097764922L;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Administrator on 2016/10/9.
|
|
||||||
*/
|
|
||||||
public class ProjectDateInfo {
|
|
||||||
private String id;
|
private String id;
|
||||||
private String name;
|
private String name;
|
||||||
private String img;
|
private String img;
|
||||||
@@ -70,14 +75,6 @@ public class ProjectDateInfo {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ProjectDateInfo{" +
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
"id=" + id +
|
|
||||||
", name='" + name + '\'' +
|
|
||||||
", img='" + img + '\'' +
|
|
||||||
", createtime=" + createtime +
|
|
||||||
", status='" + status + '\'' +
|
|
||||||
", admin_id=" + admin_id +
|
|
||||||
", batch='" + batch + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@@ -7,6 +7,8 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
public class DefaultApp implements Serializable {
|
public class DefaultApp implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -8180876443269736350L;
|
||||||
|
|
||||||
String default_launcher;
|
String default_launcher;
|
||||||
String default_browser;
|
String default_browser;
|
||||||
String default_videoplayer;
|
String default_videoplayer;
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class Expansions implements Serializable {
|
public class Expansions implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -4958527331079431641L;
|
||||||
|
|
||||||
private String file;
|
private String file;
|
||||||
//包内文件地址
|
//包内文件地址
|
||||||
private String install_location;
|
private String install_location;
|
||||||
45
app/src/main/java/com/aoleyun/sn/bean/ForceDownloadBean.java
Normal file
45
app/src/main/java/com/aoleyun/sn/bean/ForceDownloadBean.java
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class ForceDownloadBean<T> implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 5434001463280365686L;
|
||||||
|
|
||||||
|
private int code;
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
private T data;
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(int code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(T data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,15 +1,12 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者 mjsheng
|
|
||||||
* 日期 2019/3/18 16:39
|
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class ForceDownloadData implements Serializable {
|
public class ForceDownloadData implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2965901905485481437L;
|
private static final long serialVersionUID = 2965901905485481437L;
|
||||||
|
|
||||||
private String app_name;
|
private String app_name;
|
||||||
@@ -69,9 +66,6 @@ public class ForceDownloadData implements Serializable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ForceDownloadData{" +
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
"app_package='" + app_package + '\'' +
|
|
||||||
", app_url='" + app_url + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
|
||||||
public class LocalAppInfo {
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class LocalAppInfo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 7249132627497560565L;
|
||||||
|
|
||||||
public static final int DOWNLOAD_STATUS_NORMAL = 0;
|
public static final int DOWNLOAD_STATUS_NORMAL = 0;
|
||||||
public static final int DOWNLOAD_STATUS_DOWNLOADING = 1;
|
public static final int DOWNLOAD_STATUS_DOWNLOADING = 1;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
@@ -1,22 +1,14 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
public class NetAndLaunchBean implements Serializable {
|
||||||
* 作者 mjsheng
|
|
||||||
* 日期 2018/9/18 14:06
|
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class NetAndLaunchBean {
|
private static final long serialVersionUID = -5029848848935111774L;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* code : 200
|
|
||||||
* msg : ok
|
|
||||||
* data : [{"app_package":"com.mjsheng.news.mycode","is_auto":1,"is_network":0},{"app_package":"com.xueshibaoos","is_auto":0,"is_network":1}]
|
|
||||||
*/
|
|
||||||
|
|
||||||
private int code;
|
private int code;
|
||||||
private String msg;
|
private String msg;
|
||||||
@@ -48,10 +40,6 @@ public class NetAndLaunchBean {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "NetAndLaunchBean{" +
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
"code=" + code +
|
|
||||||
", msg='" + msg + '\'' +
|
|
||||||
", data=" + data +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
/**
|
import com.google.gson.Gson;
|
||||||
* 作者 mjsheng
|
import com.google.gson.JsonParser;
|
||||||
* 日期 2018/9/18 14:06
|
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class NetAndLaunchData {
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class NetAndLaunchData implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 3377827489329306025L;
|
||||||
private String app_package;
|
private String app_package;
|
||||||
private int is_auto;
|
private int is_auto;
|
||||||
private int is_network;
|
private int is_network;
|
||||||
@@ -69,12 +68,6 @@ public class NetAndLaunchData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "NetAndLaunchData{" +
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
"app_package='" + app_package + '\'' +
|
|
||||||
", is_auto=" + is_auto +
|
|
||||||
", is_network=" + is_network +
|
|
||||||
", is_slide=" + is_slide +
|
|
||||||
", is_upgrade=" + is_upgrade +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class SplitApks implements Serializable {
|
public class SplitApks implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 6908179385637563352L;
|
||||||
|
|
||||||
private String file;
|
private String file;
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class StudentsInfo implements Serializable {
|
public class StudentsInfo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -1489445700991359595L;
|
||||||
|
|
||||||
private String batch;
|
private String batch;
|
||||||
private String sno;
|
private String sno;
|
||||||
private String realname;
|
private String realname;
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
/**
|
import com.google.gson.Gson;
|
||||||
* 作者 mjsheng
|
import com.google.gson.JsonParser;
|
||||||
* 日期 2018/9/18 14:06
|
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class SystemSettingData {
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class SystemSettingData implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 8726058107602873282L;
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
private String bids;
|
private String bids;
|
||||||
@@ -130,20 +129,6 @@ public class SystemSettingData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "SystemSettingData{" +
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
"id=" + id +
|
|
||||||
", bids='" + bids + '\'' +
|
|
||||||
", admin_id=" + admin_id +
|
|
||||||
", createtime=" + createtime +
|
|
||||||
", setting_call=" + setting_call +
|
|
||||||
", setting_memory=" + setting_memory +
|
|
||||||
", setting_usb='" + setting_usb + '\'' +
|
|
||||||
", setting_bluetooth=" + setting_bluetooth +
|
|
||||||
", setting_navigation=" + setting_navigation +
|
|
||||||
", setting_statusbar=" + setting_statusbar +
|
|
||||||
", setting_phones='" + setting_phones + '\'' +
|
|
||||||
", setting_phone=" + setting_phone +
|
|
||||||
", status='" + status + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class TTAppground implements Serializable {
|
public class TTAppground implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -2071117846816082338L;
|
private static final long serialVersionUID = -2071117846816082338L;
|
||||||
|
|
||||||
private String packages;
|
private String packages;
|
||||||
private String address;
|
private String address;
|
||||||
private int type;
|
private int type;
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class TimeControl implements Serializable {
|
public class TimeControl implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -7896263624027994538L;
|
||||||
|
|
||||||
String start_time;
|
String start_time;
|
||||||
String end_time;
|
String end_time;
|
||||||
|
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
/**
|
import com.google.gson.Gson;
|
||||||
* 作者 mjsheng
|
import com.google.gson.JsonParser;
|
||||||
* 日期 2018/8/7 14:50
|
|
||||||
* 邮箱 501802639@qq.com
|
import java.io.Serializable;
|
||||||
* 来自:
|
|
||||||
*/
|
public class UploadAppInfo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1746386760446697855L;
|
||||||
|
|
||||||
public class UploadAppInfo {
|
|
||||||
private String package_name;
|
private String package_name;
|
||||||
private String app_name;
|
private String app_name;
|
||||||
private String install_time;
|
private String install_time;
|
||||||
@@ -74,11 +75,6 @@ public class UploadAppInfo {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "UploadAppInfo{" +
|
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||||
"package_name='" + package_name + '\'' +
|
|
||||||
", app_name='" + app_name + '\'' +
|
|
||||||
", install_time=" + install_time +
|
|
||||||
// ", id=" + id +
|
|
||||||
'}';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.mjsheng.myappstore.bean;
|
package com.aoleyun.sn.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public class UserInfo implements Serializable {
|
public class UserInfo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 6411909454407080815L;
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
private String sn_value;
|
private String sn_value;
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
package com.mjsheng.myappstore.comm;
|
package com.aoleyun.sn.comm;
|
||||||
|
|
||||||
|
|
||||||
public class CommonDatas {
|
public class CommonDatas {
|
||||||
public final static String SP_BABY_AGE_KEY = "age_system";//子系统选择
|
|
||||||
public final static String SP_PARENT_PASSWORD = "parent_password";//家长密码
|
|
||||||
public final static String IS_RESET = "IS_RESET";
|
public final static String IS_RESET = "IS_RESET";
|
||||||
public final static int MIN_POWER = 21;
|
public final static int MIN_POWER = 21;
|
||||||
public final static String FORCE_INSTALL = "FORCE_INSTALL";
|
public final static String FORCE_INSTALL = "FORCE_INSTALL";
|
||||||
19
app/src/main/java/com/aoleyun/sn/comm/PackageNames.java
Normal file
19
app/src/main/java/com/aoleyun/sn/comm/PackageNames.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package com.aoleyun.sn.comm;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : fanhuitong
|
||||||
|
* e-mail :
|
||||||
|
* @date : 2021/10/1318:07
|
||||||
|
* desc :
|
||||||
|
* version: 1.0
|
||||||
|
*/
|
||||||
|
public class PackageNames {
|
||||||
|
//旧版的应用市场和设备信息包名
|
||||||
|
public static final String OLD_DEVICE_INFO = "com.jiaoguanyi.appstore";
|
||||||
|
public static final String OLD_APPSTORE = "com.jiaoguanyi.store";
|
||||||
|
//应用市场和设备信息包名
|
||||||
|
public static final String DEVICE_INFO = "com.aoleyun.sn";
|
||||||
|
public static final String APPSTORE = "com.aoleyun.appstore";
|
||||||
|
public static final String APP_STORE_BOOTRECEIVER = "com.aoleyun.appstore.receiver.BootReceiver";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.database;
|
package com.aoleyun.sn.database;
|
||||||
|
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.database;
|
package com.aoleyun.sn.database;
|
||||||
|
|
||||||
public class DBSqlBuilder {
|
public class DBSqlBuilder {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.jpush;
|
package com.aoleyun.sn.jpush;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.jpush;
|
package com.aoleyun.sn.jpush;
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.jpush;
|
package com.aoleyun.sn.jpush;
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.mjsheng.myappstore.jpush;
|
package com.aoleyun.sn.jpush;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.base.BaseApplication;
|
import com.aoleyun.sn.base.BaseApplication;
|
||||||
|
|
||||||
import cn.jpush.android.api.CustomMessage;
|
import cn.jpush.android.api.CustomMessage;
|
||||||
import cn.jpush.android.api.JPushMessage;
|
import cn.jpush.android.api.JPushMessage;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.jpush;
|
package com.aoleyun.sn.jpush;
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -6,7 +6,7 @@ import android.content.Intent;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.activity.MainActivity;
|
import com.aoleyun.sn.activity.MainActivity;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.jpush;
|
package com.aoleyun.sn.jpush;
|
||||||
|
|
||||||
import cn.jpush.android.service.JCommonService;
|
import cn.jpush.android.service.JCommonService;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.jpush;
|
package com.aoleyun.sn.jpush;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@@ -6,8 +6,8 @@ import android.os.Message;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.utils.Logutils;
|
import com.aoleyun.sn.utils.Logutils;
|
||||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
import com.aoleyun.sn.utils.ToastUtil;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.mjsheng.myappstore.jpush.invalid;
|
package com.aoleyun.sn.jpush.invalid;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.jpush.Logger;
|
import com.aoleyun.sn.jpush.Logger;
|
||||||
|
|
||||||
import cn.jpush.android.api.JPushInterface;
|
import cn.jpush.android.api.JPushInterface;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.jpush.invalid;
|
package com.aoleyun.sn.jpush.invalid;
|
||||||
|
|
||||||
|
|
||||||
//public class MainActivity extends InstrumentedActivity implements OnClickListener{
|
//public class MainActivity extends InstrumentedActivity implements OnClickListener{
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.jpush.invalid;
|
package com.aoleyun.sn.jpush.invalid;
|
||||||
|
|
||||||
//public class PushSetActivity extends InstrumentedActivity implements OnClickListener {
|
//public class PushSetActivity extends InstrumentedActivity implements OnClickListener {
|
||||||
// private static final String TAG = "JIGUANG-Example";
|
// private static final String TAG = "JIGUANG-Example";
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.jpush.invalid;
|
package com.aoleyun.sn.jpush.invalid;
|
||||||
|
|
||||||
//public class SettingActivity extends InstrumentedActivity implements OnClickListener {
|
//public class SettingActivity extends InstrumentedActivity implements OnClickListener {
|
||||||
// TimePicker startTime;
|
// TimePicker startTime;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.jpush.invalid;
|
package com.aoleyun.sn.jpush.invalid;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
package com.mjsheng.myappstore.log;
|
package com.aoleyun.sn.log;
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.mjsheng.myappstore.utils.Logutils;
|
import com.aoleyun.sn.utils.Logutils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author MTK81255
|
* @author MTK81255
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.log;
|
package com.aoleyun.sn.log;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.manager;
|
package com.aoleyun.sn.manager;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
@@ -6,8 +6,8 @@ import com.amap.api.location.AMapLocation;
|
|||||||
import com.amap.api.location.AMapLocationClient;
|
import com.amap.api.location.AMapLocationClient;
|
||||||
import com.amap.api.location.AMapLocationClientOption;
|
import com.amap.api.location.AMapLocationClientOption;
|
||||||
import com.amap.api.location.AMapLocationListener;
|
import com.amap.api.location.AMapLocationListener;
|
||||||
import com.mjsheng.myappstore.utils.Logutils;
|
import com.aoleyun.sn.utils.Logutils;
|
||||||
import com.mjsheng.myappstore.utils.SPUtils;
|
import com.aoleyun.sn.utils.SPUtils;
|
||||||
|
|
||||||
public class AmapManager {
|
public class AmapManager {
|
||||||
private static AmapManager sInstance;
|
private static AmapManager sInstance;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.mjsheng.myappstore.manager;
|
package com.aoleyun.sn.manager;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.blankj.utilcode.util.PathUtils;
|
import com.blankj.utilcode.util.PathUtils;
|
||||||
import com.mjsheng.myappstore.utils.Logutils;
|
import com.aoleyun.sn.utils.Logutils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
@@ -1,58 +1,54 @@
|
|||||||
package com.mjsheng.myappstore.manager;
|
package com.aoleyun.sn.manager;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Environment;
|
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.aoleyun.sn.BuildConfig;
|
||||||
import com.mjsheng.myappstore.BuildConfig;
|
import com.aoleyun.sn.bean.Appground;
|
||||||
import com.mjsheng.myappstore.bean.Appground;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BrowserBookmarks;
|
||||||
import com.mjsheng.myappstore.bean.BrowserBookmarks;
|
import com.aoleyun.sn.bean.BrowserData;
|
||||||
import com.mjsheng.myappstore.bean.BrowserData;
|
import com.aoleyun.sn.bean.DefaultApp;
|
||||||
import com.mjsheng.myappstore.bean.DefaultApp;
|
import com.aoleyun.sn.bean.ForceDownloadBean;
|
||||||
import com.mjsheng.myappstore.bean.ForceDownloadBean;
|
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||||
import com.mjsheng.myappstore.bean.ForceDownloadData;
|
import com.aoleyun.sn.bean.LogoImg;
|
||||||
import com.mjsheng.myappstore.bean.LogoImg;
|
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
import com.aoleyun.sn.bean.StudentsInfo;
|
||||||
import com.mjsheng.myappstore.bean.StudentsInfo;
|
import com.aoleyun.sn.network.api.AppLimitApi;
|
||||||
import com.mjsheng.myappstore.network.api.AppLimitApi;
|
import com.aoleyun.sn.network.api.DeselectIDApi;
|
||||||
import com.mjsheng.myappstore.network.api.BrankPicApi;
|
import com.aoleyun.sn.network.api.ForceDownloadApi;
|
||||||
import com.mjsheng.myappstore.network.api.CategoryPicApi;
|
import com.aoleyun.sn.network.api.NetAndLaunchApi;
|
||||||
import com.mjsheng.myappstore.network.api.DeselectBrowserIDApi;
|
import com.aoleyun.sn.network.api.SystemSettingApi;
|
||||||
import com.mjsheng.myappstore.network.api.DeselectIDApi;
|
import com.aoleyun.sn.network.api.UploadAppInfoApi;
|
||||||
import com.mjsheng.myappstore.network.api.ForceDownloadApi;
|
import com.aoleyun.sn.network.api.newapi.AppinsideWebApi;
|
||||||
import com.mjsheng.myappstore.network.api.NetAndLaunchApi;
|
import com.aoleyun.sn.network.api.newapi.BrowserBookmarksApi;
|
||||||
import com.mjsheng.myappstore.network.api.ProjectPicApi;
|
import com.aoleyun.sn.network.api.newapi.BrowserListApi;
|
||||||
import com.mjsheng.myappstore.network.api.RankAppApi;
|
import com.aoleyun.sn.network.api.newapi.CheckTestUpdateApi;
|
||||||
import com.mjsheng.myappstore.network.api.SystemSettingApi;
|
import com.aoleyun.sn.network.api.newapi.CheckUpdateApi;
|
||||||
import com.mjsheng.myappstore.network.api.UploadAppInfoApi;
|
import com.aoleyun.sn.network.api.newapi.CustomROMAppApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.AppinsideWebApi;
|
import com.aoleyun.sn.network.api.newapi.DefaultAppApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.BrowserBookmarksApi;
|
import com.aoleyun.sn.network.api.newapi.DesktopIconApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.BrowserListApi;
|
import com.aoleyun.sn.network.api.newapi.DevicesLockedStateApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.CheckTestUpdateApi;
|
import com.aoleyun.sn.network.api.newapi.GetAllAppApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.CheckUpdateApi;
|
import com.aoleyun.sn.network.api.newapi.GetAppLogApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.CustomROMApp;
|
import com.aoleyun.sn.network.api.newapi.GetBatchApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.DefaultAppApi;
|
import com.aoleyun.sn.network.api.newapi.GetDesktopApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.DesktopIconApi;
|
import com.aoleyun.sn.network.api.newapi.GetDeveloperApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.DevicesLockedStateApi;
|
import com.aoleyun.sn.network.api.newapi.GetEBagCodeApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.GetAllApp;
|
import com.aoleyun.sn.network.api.newapi.GetLockStateApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.GetBatchApi;
|
import com.aoleyun.sn.network.api.newapi.GetJpushTagsApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.GetDesktopApi;
|
import com.aoleyun.sn.network.api.newapi.LogoImgApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.GetDeveloper;
|
import com.aoleyun.sn.network.api.newapi.MACAddressApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.GetEBagCode;
|
import com.aoleyun.sn.network.api.newapi.NewAppinsideWebApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.GetLockStateApi;
|
import com.aoleyun.sn.network.api.newapi.ScreenLockStateApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.JpushTagsApi;
|
import com.aoleyun.sn.network.api.newapi.SendDownloadInfoApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.LogoImgApi;
|
import com.aoleyun.sn.network.api.newapi.SendDownloadTimesApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.MACAddressApi;
|
import com.aoleyun.sn.network.api.newapi.SendScreenshotApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.NewAppinsideWebApi;
|
import com.aoleyun.sn.network.api.newapi.SnTimeControlApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.ScreenLockStateApi;
|
import com.aoleyun.sn.network.api.newapi.StudentsInfosApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.SnTimeControl;
|
import com.aoleyun.sn.network.api.newapi.TopAppControlApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.StudentsInfosApi;
|
import com.aoleyun.sn.network.api.newapi.UpdateDeviceInfoApi;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.TopAppControlApi;
|
import com.aoleyun.sn.utils.Utils;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.UpdateDeviceInfoApi;
|
|
||||||
import com.mjsheng.myappstore.utils.SPUtils;
|
|
||||||
import com.mjsheng.myappstore.utils.Utils;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -65,7 +61,6 @@ import io.reactivex.schedulers.Schedulers;
|
|||||||
import okhttp3.Cache;
|
import okhttp3.Cache;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
import okhttp3.internal.Util;
|
|
||||||
import retrofit2.CallAdapter;
|
import retrofit2.CallAdapter;
|
||||||
import retrofit2.Converter;
|
import retrofit2.Converter;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
@@ -76,8 +71,16 @@ public class NetInterfaceManager {
|
|||||||
@SuppressLint("StaticFieldLeak")
|
@SuppressLint("StaticFieldLeak")
|
||||||
private static NetInterfaceManager INSTANCE;
|
private static NetInterfaceManager INSTANCE;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private static Retrofit mRetrofit;
|
private Retrofit mRetrofit;
|
||||||
private static Retrofit jiguangRetrofit;
|
private OkHttpClient okHttpClient;
|
||||||
|
|
||||||
|
//超时时间
|
||||||
|
private int timeOut = 5;
|
||||||
|
// 缓存文件最大限制大小20M
|
||||||
|
private long cacheSize = 1024 * 1024 * 64;
|
||||||
|
|
||||||
|
private Converter.Factory gsonConverterFactory = GsonConverterFactory.create();
|
||||||
|
private CallAdapter.Factory rxJavaCallAdapterFactory = RxJava2CallAdapterFactory.create();
|
||||||
|
|
||||||
public static final String ROOT_URL = BuildConfig.ROOT_URL;
|
public static final String ROOT_URL = BuildConfig.ROOT_URL;
|
||||||
public static final String WEBSOCKET_URL = BuildConfig.WebsocketURL;
|
public static final String WEBSOCKET_URL = BuildConfig.WebsocketURL;
|
||||||
@@ -85,6 +88,20 @@ public class NetInterfaceManager {
|
|||||||
|
|
||||||
private NetInterfaceManager(Context context) {
|
private NetInterfaceManager(Context context) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
|
if (okHttpClient == null) {
|
||||||
|
//如果无法生存缓存文件目录,检测权限使用已经加上,检测手机是否把文件读写权限禁止了
|
||||||
|
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||||
|
builder.connectTimeout(timeOut, TimeUnit.SECONDS); // 设置连接超时时间
|
||||||
|
builder.writeTimeout(timeOut, TimeUnit.SECONDS);// 设置写入超时时间
|
||||||
|
builder.readTimeout(timeOut, TimeUnit.SECONDS);// 设置读取数据超时时间
|
||||||
|
builder.retryOnConnectionFailure(true);// 设置进行连接失败重试
|
||||||
|
// 设置缓存文件路径
|
||||||
|
String cacheDirectory = mContext.getExternalCacheDir().getAbsolutePath() + "/OkHttpCache";
|
||||||
|
Cache cache = new Cache(new File(cacheDirectory), cacheSize);
|
||||||
|
builder.cache(cache);// 设置缓存
|
||||||
|
okHttpClient = builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
if (null == mRetrofit) {
|
if (null == mRetrofit) {
|
||||||
mRetrofit = new Retrofit.Builder()
|
mRetrofit = new Retrofit.Builder()
|
||||||
.client(okHttpClient)
|
.client(okHttpClient)
|
||||||
@@ -93,14 +110,6 @@ public class NetInterfaceManager {
|
|||||||
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
if (null == jiguangRetrofit) {
|
|
||||||
jiguangRetrofit = new Retrofit.Builder()
|
|
||||||
.client(okHttpClient)
|
|
||||||
.baseUrl(ROOT_URL)
|
|
||||||
.addConverterFactory(gsonConverterFactory)
|
|
||||||
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void init(Context context) {
|
public static void init(Context context) {
|
||||||
@@ -117,34 +126,17 @@ public class NetInterfaceManager {
|
|||||||
return INSTANCE;
|
return INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final long cacheSize = 1024 * 1024 * 32;// 缓存文件最大限制大小20M
|
public OkHttpClient getOkHttpClient() {
|
||||||
private static String cacheDirectory = Environment.getExternalStorageDirectory() + "/okttpcaches"; // 设置缓存文件路径
|
return okHttpClient;
|
||||||
private static Cache cache = new Cache(new File(cacheDirectory), cacheSize); //
|
|
||||||
private static final OkHttpClient okHttpClient;
|
|
||||||
private static final int timeOut = 5;
|
|
||||||
|
|
||||||
static {
|
|
||||||
//如果无法生存缓存文件目录,检测权限使用已经加上,检测手机是否把文件读写权限禁止了
|
|
||||||
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
|
||||||
builder.connectTimeout(timeOut, TimeUnit.SECONDS); // 设置连接超时时间
|
|
||||||
builder.writeTimeout(timeOut, TimeUnit.SECONDS);// 设置写入超时时间
|
|
||||||
builder.readTimeout(timeOut, TimeUnit.SECONDS);// 设置读取数据超时时间
|
|
||||||
builder.retryOnConnectionFailure(true);// 设置进行连接失败重试
|
|
||||||
builder.cache(cache);// 设置缓存
|
|
||||||
okHttpClient = builder.build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CallAdapter.Factory rxJavaCallAdapterFactory = RxJava2CallAdapterFactory.create();
|
|
||||||
private static Converter.Factory gsonConverterFactory = GsonConverterFactory.create();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过sn获取设备的信息
|
* 通过sn获取设备的信息
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Observable<BaseResponse<StudentsInfo>> getStudesInfoObservable() {
|
public Observable<BaseResponse<StudentsInfo>> getStudesInfoObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(StudentsInfosApi.class)
|
||||||
.create(StudentsInfosApi.class)
|
|
||||||
.getStudentsInfo(Utils.getSerial())
|
.getStudentsInfo(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
@@ -156,8 +148,7 @@ public class NetInterfaceManager {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Observable<BaseResponse> getDevicesLockedStateObservable() {
|
public Observable<BaseResponse> getDevicesLockedStateObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(DevicesLockedStateApi.class)
|
||||||
.create(DevicesLockedStateApi.class)
|
|
||||||
.getLockedState(Utils.getSerial())
|
.getLockedState(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
@@ -169,8 +160,7 @@ public class NetInterfaceManager {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Observable<BaseResponse> sendMACAddressObservable() {
|
public Observable<BaseResponse> sendMACAddressObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(MACAddressApi.class)
|
||||||
.create(MACAddressApi.class)
|
|
||||||
.sendMACaddress(Utils.getSerial(),
|
.sendMACaddress(Utils.getSerial(),
|
||||||
Utils.getAndroid10MAC(mContext),
|
Utils.getAndroid10MAC(mContext),
|
||||||
JPushInterface.getRegistrationID(mContext),
|
JPushInterface.getRegistrationID(mContext),
|
||||||
@@ -189,137 +179,119 @@ public class NetInterfaceManager {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Observable<BaseResponse> getJpushTagsObservable() {
|
public Observable<BaseResponse> getJpushTagsObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(GetJpushTagsApi.class)
|
||||||
.create(JpushTagsApi.class)
|
|
||||||
.getJpushTags(Utils.getSerial())
|
.getJpushTags(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse<BrowserData>> getBrowserListSettingObservable() {
|
public Observable<BaseResponse<BrowserData>> getBrowserListSettingObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(BrowserListApi.class)
|
||||||
.create(BrowserListApi.class)
|
|
||||||
.getBrowserList(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getBrowserList(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse<BrowserBookmarks>> getBrowserBookmarksObservable() {
|
public Observable<BaseResponse<BrowserBookmarks>> getBrowserBookmarksObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(BrowserBookmarksApi.class)
|
||||||
.create(BrowserBookmarksApi.class)
|
|
||||||
.getBrowserBookmarks(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getBrowserBookmarks(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse> getDesktopIconObservable() {
|
public Observable<BaseResponse> getDesktopIconObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(DesktopIconApi.class)
|
||||||
.create(DesktopIconApi.class)
|
|
||||||
.getDesktopIcon(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getDesktopIcon(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<NetAndLaunchBean> getAppAutoStartUpdateAndNetObservable() {
|
public Observable<NetAndLaunchBean> getAppAutoStartUpdateAndNetObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(NetAndLaunchApi.class)
|
||||||
.create(NetAndLaunchApi.class)
|
|
||||||
.getNetAndLaunchApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getNetAndLaunchApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<ResponseBody> getAppIDControlObservable() {
|
public Observable<ResponseBody> getAppIDControlObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(DeselectIDApi.class)
|
||||||
.create(DeselectIDApi.class)
|
|
||||||
.getDeselectIDApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getDeselectIDApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse<List<Appground>>> getAppinsideWebObservable() {
|
public Observable<BaseResponse<List<Appground>>> getAppinsideWebObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(AppinsideWebApi.class)
|
||||||
.create(AppinsideWebApi.class)
|
|
||||||
.getAppinsideWeb(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getAppinsideWeb(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse> getNewAppinsideWebObservable() {
|
public Observable<BaseResponse> getNewAppinsideWebObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(NewAppinsideWebApi.class)
|
||||||
.create(NewAppinsideWebApi.class)
|
|
||||||
.getAppinsideWeb(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getAppinsideWeb(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<ResponseBody> getSystemSettingObservable() {
|
public Observable<ResponseBody> getSystemSettingObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(SystemSettingApi.class)
|
||||||
.create(SystemSettingApi.class)
|
|
||||||
.getSystemSettingApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getSystemSettingApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<ResponseBody> getAppLimitObservable() {
|
public Observable<ResponseBody> getAppLimitObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(AppLimitApi.class)
|
||||||
.create(AppLimitApi.class)
|
|
||||||
.getAppLimitApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getAppLimitApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<ForceDownloadBean> getForceDownloadObservable() {
|
public Observable<ForceDownloadBean> getForceDownloadObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(ForceDownloadApi.class)
|
||||||
.create(ForceDownloadApi.class)
|
|
||||||
.getForceDownloadApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getForceDownloadApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Observable<BaseResponse<List<ForceDownloadData>>> getTestUpdateObservable() {
|
public Observable<BaseResponse<List<ForceDownloadData>>> getTestUpdateObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(CheckTestUpdateApi.class)
|
||||||
.create(CheckTestUpdateApi.class)
|
|
||||||
.getTestUpdate(Utils.getSerial())
|
.getTestUpdate(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse> getSnTimeObservable() {
|
public Observable<BaseResponse> getSnTimeObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(SnTimeControlApi.class)
|
||||||
.create(SnTimeControl.class)
|
|
||||||
.getSnTimeControl(Utils.getSerial())
|
.getSnTimeControl(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse> getScreenLockObservable() {
|
public Observable<BaseResponse> getScreenLockObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(ScreenLockStateApi.class)
|
||||||
.create(ScreenLockStateApi.class)
|
|
||||||
.getScreenLockState(Utils.getSerial())
|
.getScreenLockState(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<ResponseBody> getDesktopObservable() {
|
public Observable<ResponseBody> getDesktopObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(GetDesktopApi.class)
|
||||||
.create(GetDesktopApi.class)
|
|
||||||
.getDesktop(Utils.getSerial())
|
.getDesktop(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<ResponseBody> getBatchObservable() {
|
public Observable<ResponseBody> getBatchObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(GetBatchApi.class)
|
||||||
.create(GetBatchApi.class)
|
|
||||||
.getBatch(Utils.getSerial())
|
.getBatch(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse<LogoImg>> getLogoImgObservable() {
|
public Observable<BaseResponse<LogoImg>> getLogoImgObservable() {
|
||||||
return mRetrofit
|
return mRetrofit.create(LogoImgApi.class)
|
||||||
.create(LogoImgApi.class)
|
|
||||||
.getLogoImg(Utils.getSerial())
|
.getLogoImg(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
@@ -333,104 +305,19 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse> getDeveloperControl() {
|
public Observable<BaseResponse> getDeveloperControl() {
|
||||||
return mRetrofit.create(GetDeveloper.class)
|
return mRetrofit.create(GetDeveloperApi.class)
|
||||||
.getDeveloperState(Utils.getSerial())
|
.getDeveloperState(Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<BaseResponse> getEBagCodeControl() {
|
public Observable<BaseResponse> getEBagCodeControl() {
|
||||||
return mRetrofit.create(GetEBagCode.class)
|
return mRetrofit.create(GetEBagCodeApi.class)
|
||||||
.getEBagCode(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
.getEBagCode(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* API
|
|
||||||
*
|
|
||||||
* */
|
|
||||||
public static UploadAppInfoApi getUploadAppInfoApi() {
|
|
||||||
return mRetrofit.create(UploadAppInfoApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DeselectIDApi getDeselectIDApi() {
|
|
||||||
return mRetrofit.create(DeselectIDApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static DeselectBrowserIDApi getDeselectBrowserIDApi() {
|
|
||||||
return mRetrofit.create(DeselectBrowserIDApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static RankAppApi getRankAppApi() {
|
|
||||||
return mRetrofit.create(RankAppApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CategoryPicApi getCategoryPicApi() {
|
|
||||||
return mRetrofit.create(CategoryPicApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ProjectPicApi getProjectPicApi() {
|
|
||||||
return mRetrofit.create(ProjectPicApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static BrankPicApi getBrankPicApi() {
|
|
||||||
return mRetrofit.create(BrankPicApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static AppLimitApi getAppLimitApi() {
|
|
||||||
return mRetrofit.create(AppLimitApi.class);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static SystemSettingApi getSystemSettingApi() {
|
|
||||||
return mRetrofit.create(SystemSettingApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static NetAndLaunchApi getNetAndLaunchApi() {
|
|
||||||
return mRetrofit.create(NetAndLaunchApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ForceDownloadApi getForceDownloadApi() {
|
|
||||||
return mRetrofit.create(ForceDownloadApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static GetLockStateApi getLockState() {
|
|
||||||
return mRetrofit.create(GetLockStateApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static UpdateDeviceInfoApi getUpdateDeviceInfo() {
|
|
||||||
return mRetrofit.create(UpdateDeviceInfoApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static GetBatchApi getBatchApi() {
|
|
||||||
return mRetrofit.create(GetBatchApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static SnTimeControl getSnTimeControlApi() {
|
|
||||||
return mRetrofit.create(SnTimeControl.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static TopAppControlApi getTopAppControlApi() {
|
|
||||||
return mRetrofit.create(TopAppControlApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public CheckUpdateApi getUpdateApi() {
|
|
||||||
return mRetrofit
|
|
||||||
.create(CheckUpdateApi.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public CustomROMApp getCustomROMAppApi() {
|
|
||||||
return mRetrofit.create(CustomROMApp.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public GetAllApp GetAllAppApi() {
|
|
||||||
return mRetrofit.create(GetAllApp.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Observable<BaseResponse<DefaultApp>> getDefaultAppApi() {
|
public Observable<BaseResponse<DefaultApp>> getDefaultAppApi() {
|
||||||
return mRetrofit.create(DefaultAppApi.class)
|
return mRetrofit.create(DefaultAppApi.class)
|
||||||
.getDefaultApp(Utils.getSerial())
|
.getDefaultApp(Utils.getSerial())
|
||||||
@@ -438,4 +325,80 @@ public class NetInterfaceManager {
|
|||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* API
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
public UploadAppInfoApi getUploadAppInfoApi() {
|
||||||
|
return mRetrofit.create(UploadAppInfoApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeselectIDApi getDeselectIDApi() {
|
||||||
|
return mRetrofit.create(DeselectIDApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AppLimitApi getAppLimitApi() {
|
||||||
|
return mRetrofit.create(AppLimitApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SystemSettingApi getSystemSettingApi() {
|
||||||
|
return mRetrofit.create(SystemSettingApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NetAndLaunchApi getNetAndLaunchApi() {
|
||||||
|
return mRetrofit.create(NetAndLaunchApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ForceDownloadApi getForceDownloadApi() {
|
||||||
|
return mRetrofit.create(ForceDownloadApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetLockStateApi getLockState() {
|
||||||
|
return mRetrofit.create(GetLockStateApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateDeviceInfoApi getUpdateDeviceInfo() {
|
||||||
|
return mRetrofit.create(UpdateDeviceInfoApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetBatchApi getBatchApi() {
|
||||||
|
return mRetrofit.create(GetBatchApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SnTimeControlApi getSnTimeControlApi() {
|
||||||
|
return mRetrofit.create(SnTimeControlApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TopAppControlApi getTopAppControlApi() {
|
||||||
|
return mRetrofit.create(TopAppControlApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckUpdateApi getUpdateApi() {
|
||||||
|
return mRetrofit.create(CheckUpdateApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomROMAppApi getCustomROMAppApi() {
|
||||||
|
return mRetrofit.create(CustomROMAppApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetAllAppApi GetAllAppApi() {
|
||||||
|
return mRetrofit.create(GetAllAppApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetAppLogApi getAppLogApi() {
|
||||||
|
return mRetrofit.create(GetAppLogApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendDownloadTimesApi getSendTimesApi() {
|
||||||
|
return mRetrofit.create(SendDownloadTimesApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendDownloadInfoApi getSendInfoApi() {
|
||||||
|
return mRetrofit.create(SendDownloadInfoApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendScreenshotApi getScreenshotApi() {
|
||||||
|
return mRetrofit.create(SendScreenshotApi.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
856
app/src/main/java/com/aoleyun/sn/network/HTTPInterface.java
Normal file
856
app/src/main/java/com/aoleyun/sn/network/HTTPInterface.java
Normal file
@@ -0,0 +1,856 @@
|
|||||||
|
package com.aoleyun.sn.network;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.aoleyun.sn.action.JGYActions;
|
||||||
|
import com.arialyy.aria.core.Aria;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.aoleyun.sn.base.BaseApplication;
|
||||||
|
import com.aoleyun.sn.bean.AppListInfo;
|
||||||
|
import com.aoleyun.sn.bean.BrowserBookmarks;
|
||||||
|
import com.aoleyun.sn.bean.BrowserData;
|
||||||
|
import com.aoleyun.sn.bean.ForceDownloadBean;
|
||||||
|
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||||
|
import com.aoleyun.sn.utils.CacheUtils;
|
||||||
|
import com.aoleyun.sn.utils.JGYUtils;
|
||||||
|
import com.aoleyun.sn.utils.Logutils;
|
||||||
|
import com.aoleyun.sn.utils.URLUtils;
|
||||||
|
import com.aoleyun.sn.bean.Appground;
|
||||||
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
|
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||||
|
import com.aoleyun.sn.jpush.TagAliasOperatorHelper;
|
||||||
|
import com.aoleyun.sn.manager.NetInterfaceManager;
|
||||||
|
import com.aoleyun.sn.network.api.newapi.SnTimeControlApi;
|
||||||
|
import com.aoleyun.sn.network.api.newapi.TopAppControlApi;
|
||||||
|
import com.aoleyun.sn.network.api.newapi.UpdateDeviceInfoApi;
|
||||||
|
import com.aoleyun.sn.service.MainService;
|
||||||
|
import com.aoleyun.sn.utils.ApkUtils;
|
||||||
|
import com.aoleyun.sn.utils.ForegroundAppUtil;
|
||||||
|
import com.aoleyun.sn.utils.Logger;
|
||||||
|
import com.aoleyun.sn.utils.SPUtils;
|
||||||
|
import com.aoleyun.sn.utils.TimeUtils;
|
||||||
|
import com.aoleyun.sn.utils.Utils;
|
||||||
|
import com.trello.rxlifecycle2.android.ActivityEvent;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import io.reactivex.Observer;
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.annotations.NonNull;
|
||||||
|
import io.reactivex.disposables.Disposable;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import okhttp3.ResponseBody;
|
||||||
|
|
||||||
|
import static com.aoleyun.sn.jpush.TagAliasOperatorHelper.ACTION_SET;
|
||||||
|
import static com.aoleyun.sn.jpush.TagAliasOperatorHelper.sequence;
|
||||||
|
|
||||||
|
public class HTTPInterface {
|
||||||
|
private static final String TAG = HTTPInterface.class.getSimpleName();
|
||||||
|
private static final int OK = 200;
|
||||||
|
|
||||||
|
private static void installTestAPK(final Context context, JSONObject jsonObject) {
|
||||||
|
final String url = jsonObject.getString("app_url");
|
||||||
|
int versionCode = jsonObject.getInteger("app_version_code");
|
||||||
|
final String packageName = jsonObject.getString("app_package");
|
||||||
|
String app_name = jsonObject.getString("app_name");
|
||||||
|
String app_md5 = jsonObject.getString("app_md5");
|
||||||
|
final com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
|
||||||
|
object.put("app_name", app_name);
|
||||||
|
object.put("app_package", packageName);
|
||||||
|
object.put("MD5", app_md5);
|
||||||
|
PackageManager pm = context.getPackageManager();
|
||||||
|
PackageInfo packageInfo = null;
|
||||||
|
try {
|
||||||
|
packageInfo = pm.getPackageInfo(packageName, 0);
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
if (packageInfo == null || packageInfo.versionCode < versionCode) {
|
||||||
|
Utils.ariaDownload(context, url, object);
|
||||||
|
} else {
|
||||||
|
Logutils.e("installTestAPK", "APK: " + "无更新");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized public static void setJpushTags(final Context context) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getJpushTagsObservable()
|
||||||
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Logutils.e(TAG + ":" + "setJpushTags", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseResponse response) {
|
||||||
|
if (response.code == 200) {
|
||||||
|
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
|
||||||
|
String batch = jsonObject.get("batch").getAsString();
|
||||||
|
Logutils.e(TAG + ":" + "setJpushTags", "onNext: " + batch);
|
||||||
|
if (!TextUtils.isEmpty(batch)) {
|
||||||
|
Set set = new HashSet();
|
||||||
|
set.add(batch);
|
||||||
|
JGYUtils.getInstance().getAppPlatform(new JGYUtils.GetAppPlatformCallback() {
|
||||||
|
@Override
|
||||||
|
public void AppPlatform(int platform) {
|
||||||
|
if (platform == JGYUtils.MTKPlatform) {
|
||||||
|
set.add(JGYUtils.MTKTag);
|
||||||
|
} else if (platform == JGYUtils.ZhanruiPlatform) {
|
||||||
|
set.add(JGYUtils.ZhanruiTag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
setTag(context, set);
|
||||||
|
} else {
|
||||||
|
Logutils.e(TAG + ":" + "setJpushTags", "onNext: " + "batch empty");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Logutils.e(TAG + ":" + "setJpushTags", "onNext: " + response.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Logutils.e(TAG + ":" + "setJpushTags", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Logutils.e(TAG + ":" + "setJpushTags", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setTag(Context context, Set set) {
|
||||||
|
TagAliasOperatorHelper.TagAliasBean tagAliasBean = new TagAliasOperatorHelper.TagAliasBean();
|
||||||
|
tagAliasBean.action = ACTION_SET;
|
||||||
|
sequence++;
|
||||||
|
tagAliasBean.tags = set;
|
||||||
|
tagAliasBean.isAliasAction = false;
|
||||||
|
TagAliasOperatorHelper.getInstance().handleAction(context, sequence, tagAliasBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface GetAppinsideWebCallback {
|
||||||
|
void onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized public static void getAppinsideWeb(Context context, GetAppinsideWebCallback callback) {
|
||||||
|
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform) {
|
||||||
|
Logutils.e(TAG, "getAppinsideWeb: " + "setAppinsideWeb");
|
||||||
|
setAppinsideWeb(callback);
|
||||||
|
} else {
|
||||||
|
Logutils.e(TAG, "getAppinsideWeb: " + "setNewAppinsideWeb");
|
||||||
|
setNewAppinsideWeb(callback);
|
||||||
|
// setAppinsideWeb(callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setAppinsideWeb(GetAppinsideWebCallback callback) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getAppinsideWebObservable()
|
||||||
|
.observeOn(Schedulers.io())
|
||||||
|
.subscribe(new Observer<BaseResponse<List<Appground>>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Logutils.e("setAppinsideWeb", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseResponse<List<Appground>> listBaseResponse) {
|
||||||
|
Logutils.e("setAppinsideWeb", "onNext: " + listBaseResponse);
|
||||||
|
JGYUtils.getInstance().setAppinsideWeb(listBaseResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Logutils.e("setAppinsideWeb", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Logutils.e("setAppinsideWeb", "onComplete: ");
|
||||||
|
callback.onComplete();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setNewAppinsideWeb(GetAppinsideWebCallback callback) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getNewAppinsideWebObservable()
|
||||||
|
.observeOn(Schedulers.io())
|
||||||
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Logutils.e("getNewAppinsideWeb", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseResponse listBaseResponse) {
|
||||||
|
Logutils.e("getNewAppinsideWeb", "onNext: " + listBaseResponse);
|
||||||
|
long time1 = System.currentTimeMillis();
|
||||||
|
JGYUtils.getInstance().setNewAppinsideWeb(listBaseResponse);
|
||||||
|
Logutils.e(TAG, "setWhiteApp: time = " + (System.currentTimeMillis() - time1));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Logutils.e("getNewAppinsideWeb", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Logutils.e("getNewAppinsideWeb", "onComplete: ");
|
||||||
|
callback.onComplete();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void sendAllweb(Context context) {
|
||||||
|
Intent intent = new Intent("qch_app_website")
|
||||||
|
.setPackage("com.android.settings");
|
||||||
|
intent.putExtra("package_name", "Invalid");
|
||||||
|
context.sendBroadcast(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void sendwebUrl(Context context) {
|
||||||
|
Intent intent = new Intent("qch_app_inside_website")
|
||||||
|
.setPackage("com.android.settings");
|
||||||
|
intent.putExtra("websitelist", "Invalid");
|
||||||
|
context.sendBroadcast(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置浏览器黑白名单
|
||||||
|
synchronized public static void setBrowserBlackList(final Context context) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getBrowserListSettingObservable()
|
||||||
|
.observeOn(Schedulers.io())
|
||||||
|
.subscribe(new Observer<BaseResponse<BrowserData>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Logutils.e("setBrowserBlackList", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse<BrowserData> browserDataBaseResponse) {
|
||||||
|
Logutils.e("setBrowserBlackList", "onNext: ");
|
||||||
|
String homePage = Settings.System.getString(context.getContentResolver(), "homepagURL");
|
||||||
|
if (browserDataBaseResponse.code == 200) {
|
||||||
|
BrowserData data = browserDataBaseResponse.data;
|
||||||
|
String white = data.getWhite();
|
||||||
|
if (!TextUtils.isEmpty(white)) {
|
||||||
|
if (!TextUtils.isEmpty(homePage) && !white.contains(homePage)) {
|
||||||
|
white += "," + homePage;
|
||||||
|
}
|
||||||
|
boolean DeselectBrowserArray = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", white);
|
||||||
|
Logutils.e("setBrowserBlackList", "setBrowserList white = " + white + ":" + DeselectBrowserArray);
|
||||||
|
} else {
|
||||||
|
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", homePage);
|
||||||
|
}
|
||||||
|
String black = data.getBlack();
|
||||||
|
if (!TextUtils.isEmpty(black)) {
|
||||||
|
boolean qch_webblack_url = Settings.System.putString(context.getContentResolver(), "qch_webblack_url", black);
|
||||||
|
Logutils.e("setBrowserBlackList", "setBrowserList black = " + black + ":" + qch_webblack_url);
|
||||||
|
} else {
|
||||||
|
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
|
||||||
|
}
|
||||||
|
String white_ip = data.getWhite_ip();
|
||||||
|
if (!TextUtils.isEmpty(white_ip)) {
|
||||||
|
SPUtils.put(context, "white_ip", white_ip);
|
||||||
|
} else {
|
||||||
|
SPUtils.put(context, "white_ip", " ");
|
||||||
|
}
|
||||||
|
String black_ip = data.getBlack_ip();
|
||||||
|
if (!TextUtils.isEmpty(black_ip)) {
|
||||||
|
SPUtils.put(context, "black_ip", black_ip);
|
||||||
|
} else {
|
||||||
|
SPUtils.put(context, "black_ip", " ");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", homePage);
|
||||||
|
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
|
||||||
|
SPUtils.put(context, "white_ip", " ");
|
||||||
|
SPUtils.put(context, "black_ip", " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Logutils.e("setBrowserBlackList", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Logutils.e("setBrowserBlackList", "onComplete: ");
|
||||||
|
new URLUtils(context).setBrowserWhiteList();
|
||||||
|
new URLUtils(context).setBrowserBlackList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface BookmarksCallback {
|
||||||
|
void onSubscribe();
|
||||||
|
|
||||||
|
void onNext();
|
||||||
|
|
||||||
|
void onError(Throwable e);
|
||||||
|
|
||||||
|
void onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param context
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
@SuppressLint("NewApi")
|
||||||
|
synchronized public static void getHomePageBookmarks(Context context, BookmarksCallback callback) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getBrowserBookmarksObservable()
|
||||||
|
.observeOn(Schedulers.io())
|
||||||
|
.subscribe(new Observer<BaseResponse<BrowserBookmarks>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onSubscribe();
|
||||||
|
}
|
||||||
|
Logutils.e("getHomePageBookmarks", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseResponse<BrowserBookmarks> browserBookmarksBaseResponse) {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onNext();
|
||||||
|
}
|
||||||
|
Logutils.e("getHomePageBookmarks", "onNext: ");
|
||||||
|
if (browserBookmarksBaseResponse.code == 200) {
|
||||||
|
//主页不包含白名单添加进去
|
||||||
|
String homepagURL = browserBookmarksBaseResponse.data.getHomepage();
|
||||||
|
Logutils.e("getHomePageBookmarks ", "homepagURL: " + homepagURL);
|
||||||
|
String oldHome = Settings.System.getString(context.getContentResolver(), "homepagURL");
|
||||||
|
Logutils.e("getHomePageBookmarks", "oldHome: " + oldHome);
|
||||||
|
//数据和之前不一样的时候清除缓存
|
||||||
|
if (!TextUtils.isEmpty(oldHome) && !oldHome.equalsIgnoreCase(homepagURL)) {
|
||||||
|
try {
|
||||||
|
new CacheUtils().cleanApplicationUserData(context, "com.android.browser");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Logutils.e(TAG, "setHomepagtag: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
boolean home = Settings.System.putString(context.getContentResolver(), "homepagURL", homepagURL);
|
||||||
|
Logutils.e("getHomePageBookmarks", "onNext: homepagURL: save homepagURL = " + home);
|
||||||
|
String whitelist = Settings.System.getString(context.getContentResolver(), "DeselectBrowserArray");
|
||||||
|
Logutils.e("getHomePageBookmarks ", "whitelist: " + whitelist);
|
||||||
|
|
||||||
|
// if (!TextUtils.isEmpty(whitelist.trim())) {
|
||||||
|
// HashSet<String> whiteLists = new HashSet<>(Arrays.asList(whitelist.trim().split(",")));
|
||||||
|
// whiteLists.add(homepagURL);
|
||||||
|
// String whiteString = String.join(",", whiteLists);
|
||||||
|
// boolean white = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", whiteString);
|
||||||
|
// Logutils.e("getHomePageBookmarks", "onNext: homepagURL: add to whiteList = " + whiteString + "write: " + white);
|
||||||
|
// } else {
|
||||||
|
// Logutils.e("getHomePageBookmarks", "onNext: whitelist is NULL");
|
||||||
|
// boolean white = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", homepagURL);
|
||||||
|
// Logutils.e("getHomePageBookmarks", "onNext: homepagURL: homepagURL = " + homepagURL + "write: " + white);
|
||||||
|
// }
|
||||||
|
|
||||||
|
//书签
|
||||||
|
String labelpage = browserBookmarksBaseResponse.data.getLabelpage();
|
||||||
|
Intent websiteBookMark = new Intent("qch_app_brower_website");
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
websiteBookMark.setPackage("com.android.settings")
|
||||||
|
.setPackage("com.android.browser");
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(labelpage)) {
|
||||||
|
HashSet<String> labels = new HashSet<>(Arrays.asList(labelpage.split(",")));
|
||||||
|
// List<String> urlList = new ArrayList<>();
|
||||||
|
// for (String urls : labels) {
|
||||||
|
// urlList.add(JGYUtils.getPrefixHttpsURL(urls));
|
||||||
|
// }
|
||||||
|
String join = String.join(",", labels);
|
||||||
|
Logutils.e("getHomePageBookmarks", "onNext: getHomePageBookmarks: " + join);
|
||||||
|
websiteBookMark.putExtra("websiteBookMark", join);
|
||||||
|
} else {
|
||||||
|
websiteBookMark.putExtra("websiteBookMark", "Invalid");
|
||||||
|
}
|
||||||
|
context.sendBroadcast(websiteBookMark);
|
||||||
|
context.sendBroadcast(websiteBookMark);
|
||||||
|
context.sendBroadcast(websiteBookMark);
|
||||||
|
|
||||||
|
//主页
|
||||||
|
Intent homepag = new Intent("qch_app_brower_homepage");
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
homepag.setPackage("com.android.settings")
|
||||||
|
.setPackage("com.android.browser");
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(homepagURL)) {
|
||||||
|
// String newHomePage = JGYUtils.getPrefixHttpsURL(homepagURL);
|
||||||
|
Logutils.e("getHomePageBookmarks", "onNext: newHomePage: " + homepagURL);
|
||||||
|
homepag.putExtra("homepage", homepagURL);
|
||||||
|
} else {
|
||||||
|
homepag.putExtra("homepage", "Invalid");
|
||||||
|
}
|
||||||
|
context.sendBroadcast(homepag);
|
||||||
|
context.sendBroadcast(homepag);
|
||||||
|
context.sendBroadcast(homepag);
|
||||||
|
} else {
|
||||||
|
Intent intent1 = new Intent("qch_app_brower_homepage");
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
intent1.setPackage("com.android.settings")
|
||||||
|
.setPackage("com.android.browser");
|
||||||
|
}
|
||||||
|
intent1.putExtra("homepage", "Invalid");
|
||||||
|
context.sendBroadcast(intent1);
|
||||||
|
|
||||||
|
Settings.System.putString(context.getContentResolver(), "homepagURL", " ");
|
||||||
|
Intent intent2 = new Intent("qch_app_brower_website");
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
intent2.setPackage("com.android.settings")
|
||||||
|
.setPackage("com.android.browser");
|
||||||
|
}
|
||||||
|
intent2.putExtra("websiteBookMark", "Invalid");
|
||||||
|
context.sendBroadcast(intent2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onError(e);
|
||||||
|
}
|
||||||
|
Logutils.e("getHomePageBookmarks", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
if (callback != null) {
|
||||||
|
callback.onComplete();
|
||||||
|
}
|
||||||
|
Logutils.e("getHomePageBookmarks", "onComplete: ");
|
||||||
|
setBrowserBlackList(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setHideDesktopIcon(final Context context) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getDesktopIconObservable()
|
||||||
|
.observeOn(Schedulers.io())
|
||||||
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Logutils.e(TAG + ":" + "getDesktopIcon", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseResponse response) {
|
||||||
|
Logutils.e(TAG + ":" + "getDesktopIcon", "onNext: ");
|
||||||
|
ApkUtils.showAllAPP(context);
|
||||||
|
if (response.code == OK) {
|
||||||
|
String data = response.data.toString();
|
||||||
|
Logutils.e(TAG + ":" + "getDesktopIcon", "data: " + data);
|
||||||
|
if (!TextUtils.isEmpty(data)) {
|
||||||
|
List<String> newList = Arrays.asList(data.split(","));//新的list
|
||||||
|
PackageManager pm = context.getPackageManager();
|
||||||
|
for (String pack : newList) {
|
||||||
|
try {
|
||||||
|
// TODO: 2021/5/24 需要后端替换包名,暂时解决方案
|
||||||
|
try {
|
||||||
|
if ("com.mediatek.camera".equals(pack)) {
|
||||||
|
pm.setApplicationEnabledSetting("com.android.camera2", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||||
|
}
|
||||||
|
if ("com.android.mms".equals(pack)) {
|
||||||
|
pm.setApplicationEnabledSetting("com.android.messaging", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Logutils.e(TAG + ":" + "getDesktopIcon", "Exception: ex: " + ex.getMessage());
|
||||||
|
}
|
||||||
|
pm.setApplicationEnabledSetting(pack, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||||
|
Logutils.e(TAG + ":" + "getDesktopIcon", pack);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logutils.e(TAG + ":" + "getDesktopIcon", "Exception: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Logutils.e(TAG + ":" + "getDesktopIcon", "onNext: " + response.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Logutils.e(TAG + ":" + "getDesktopIcon", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Logutils.e(TAG + ":" + "getDesktopIcon", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
|
synchronized public static void updateDeviceInfo(Context context) {
|
||||||
|
String address = String.valueOf(SPUtils.get(context, "AmapAddress", "-"));
|
||||||
|
if ("-".equals(address)) {
|
||||||
|
address = (String) SPUtils.get(context, "AmapError", "-");
|
||||||
|
}
|
||||||
|
String longitude = String.valueOf(SPUtils.get(context, "longitude", "0"));
|
||||||
|
String latitude = String.valueOf(SPUtils.get(context, "latitude", "0"));
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("address", address);
|
||||||
|
jsonObject.put("longitude", longitude);
|
||||||
|
jsonObject.put("latitude", latitude);
|
||||||
|
String add = jsonObject.toJSONString();
|
||||||
|
UpdateDeviceInfoApi updateDeviceInfo = NetInterfaceManager.getInstance().getUpdateDeviceInfo();
|
||||||
|
updateDeviceInfo.updateDeviceInfo(
|
||||||
|
Utils.getSerial(),
|
||||||
|
NetInterfaceManager.HTTP_KEY,
|
||||||
|
Utils.getMachine(context),
|
||||||
|
Utils.getHardware(context),
|
||||||
|
add
|
||||||
|
)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<ResponseBody>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(ResponseBody responseBody) {
|
||||||
|
try {
|
||||||
|
Logutils.e("updateDeviceInfo", "上传的结果" + responseBody.string());
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Logutils.e("updateDeviceInfo", e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ApkUtils.getAppInfo(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getSnTimeControl(final Context context) {
|
||||||
|
SnTimeControlApi snTimeControl = NetInterfaceManager.getInstance().getSnTimeControlApi();
|
||||||
|
snTimeControl.getSnTimeControl(Utils.getSerial())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Logutils.e(TAG, "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse response) {
|
||||||
|
int code = response.code;
|
||||||
|
if (code == 200) {
|
||||||
|
JSONObject jsonObject = (JSONObject) JSON.toJSON(response.data);
|
||||||
|
String start_time = jsonObject.getString("start_time");
|
||||||
|
String end_time = jsonObject.getString("end_time");
|
||||||
|
TimeUtils.ContralTime c = TimeUtils.String2ContralTime(context, start_time + "-" + end_time);
|
||||||
|
if (null != c) {
|
||||||
|
Logutils.e("getTimeControl", "200: " + c.toString());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
TimeUtils.setEmpty(context);
|
||||||
|
TimeUtils.ContralTime c = TimeUtils.getDefaltContralTime(context);
|
||||||
|
if (null != c) {
|
||||||
|
Logutils.e("getTimeControl", c.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Logutils.e("getSnTimeControl", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.setAction(MainService.TimeChangedReceiver.ACTION_UPDATE);
|
||||||
|
context.sendBroadcast(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getTopAppControl(final Context context) {
|
||||||
|
TopAppControlApi topAppControl = NetInterfaceManager.getInstance().getTopAppControlApi();
|
||||||
|
topAppControl.getSnAppControl(Utils.getSerial())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse response) {
|
||||||
|
if (response.code == 200) {
|
||||||
|
JSONObject jsonObject = (JSONObject) JSON.toJSON(response.data);
|
||||||
|
String app_package = jsonObject.getString("app_package");
|
||||||
|
SPUtils.put(context, ForegroundAppUtil.TOPAPP_KEY, app_package);
|
||||||
|
ForegroundAppUtil.setTopAppClass(context, app_package);
|
||||||
|
ForegroundAppUtil.openTopApp(context);
|
||||||
|
} else {
|
||||||
|
SPUtils.put(context, ForegroundAppUtil.TOPAPP_KEY, "");
|
||||||
|
ForegroundAppUtil.setTopAppClass(context, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getAppLimit(Context context) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getAppLimitObservable()
|
||||||
|
.subscribe(new Observer<ResponseBody>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Logutils.e("getAppLimit", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull ResponseBody responseBody) {
|
||||||
|
try {
|
||||||
|
String bodyString = responseBody.string();
|
||||||
|
Logutils.e("getAppLimit", "onNext: " + bodyString);
|
||||||
|
JsonObject jsonObject = JsonParser.parseString(bodyString).getAsJsonObject();
|
||||||
|
int code = jsonObject.get("code").getAsInt();
|
||||||
|
if (code == 200) {
|
||||||
|
String data = jsonObject.get("data").getAsJsonObject().get("result").getAsString();
|
||||||
|
//开机图标 只记录后台传的包名
|
||||||
|
boolean write = Settings.System.putString(context.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, data);
|
||||||
|
Logutils.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||||
|
JGYUtils.getInstance().writeAppPackageList(context, data);
|
||||||
|
JGYUtils.getInstance().deleteOtherApp();
|
||||||
|
} else {
|
||||||
|
Logutils.e("getAppLimit", "onNext: " + bodyString);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Logutils.e("getAppLimit", "onNext: IOException: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Logutils.e("getAppLimit", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Logutils.e("getAppLimit", "onComplete: ");
|
||||||
|
getAllAppList(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void getAllAppList(Context context) {
|
||||||
|
NetInterfaceManager.getInstance().GetAllAppApi()
|
||||||
|
.getAllAppList(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<BaseResponse<List<AppListInfo>>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Logutils.e("getAllAppList", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse<List<AppListInfo>> listBaseResponse) {
|
||||||
|
Logutils.e("getAllAppList", "onNext: " + JSONObject.toJSONString(listBaseResponse));
|
||||||
|
int code = listBaseResponse.code;
|
||||||
|
if (code == 200) {
|
||||||
|
List<AppListInfo> appListInfos = listBaseResponse.data;
|
||||||
|
getAppAutoStartUpdateAndNet(appListInfos);
|
||||||
|
} else {
|
||||||
|
Logutils.e("getAllAppList", "onNext: " + "no data");
|
||||||
|
Logutils.e("getAllAppList", "onNext: " + listBaseResponse.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Logutils.e("getAllAppList", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Logutils.e("getAllAppList", "onComplete: ");
|
||||||
|
getForceDownload(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getForceDownload(Context context) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getForceDownloadObservable()
|
||||||
|
.subscribe(new Observer<ForceDownloadBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Logutils.e(TAG + ":" + "getForceDownload", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull ForceDownloadBean forceDownloadBean) {
|
||||||
|
Logutils.e(TAG + ":" + "getForceDownload", "onNext: ");
|
||||||
|
switch (forceDownloadBean.getCode()) {
|
||||||
|
case 200:
|
||||||
|
Logutils.e(TAG + ":" + "getForceDownload", "isDownloading=" + BaseApplication.getInstance().isDownloading());
|
||||||
|
BaseApplication.getInstance().checkIsDownloading();
|
||||||
|
if (!BaseApplication.getInstance().isDownloading()) {
|
||||||
|
Type type = new TypeToken<List<ForceDownloadData>>() {
|
||||||
|
}.getType();
|
||||||
|
Gson gson = new Gson();
|
||||||
|
List<ForceDownloadData> forceDownloadData = gson.fromJson(gson.toJson(forceDownloadBean.getData()), type);
|
||||||
|
JGYUtils.getInstance().forceDownload(forceDownloadData);
|
||||||
|
} else {
|
||||||
|
Aria.download(this).resumeAllTask();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case -200:
|
||||||
|
boolean qch_force_app = Settings.System.putString(context.getContentResolver(), "qch_force_app", "invalid");
|
||||||
|
Logutils.e(TAG + ":" + "getForceDownload", "qch_force_app:" + qch_force_app);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Logutils.e(TAG + ":" + "getForceDownload", forceDownloadBean.getMsg());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Logutils.e(TAG + ":" + "getForceDownload", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Logutils.e(TAG + ":" + "getForceDownload", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void getAppAutoStartUpdateAndNet(List<AppListInfo> appListInfos) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getAppAutoStartUpdateAndNetObservable()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<NetAndLaunchBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Logutils.e("getAppAutoStartUpdateAndNet", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull NetAndLaunchBean netAndLaunchBean) {
|
||||||
|
Logutils.e("getAppAutoStartUpdateAndNet", "onNext: " + netAndLaunchBean.toString());
|
||||||
|
if (netAndLaunchBean.getCode() == 200) {
|
||||||
|
JGYUtils.getInstance().setNetAndlaunch(netAndLaunchBean, appListInfos);
|
||||||
|
} else {
|
||||||
|
Logutils.e("getAppAutoStartUpdateAndNet", "onNext: " + netAndLaunchBean.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Logutils.e("getAppAutoStartUpdateAndNet", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Logutils.e("getAppAutoStartUpdateAndNet", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized public static void getNetAndLaunchSetting(final Context context) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getAppAutoStartUpdateAndNetObservable()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new Observer<NetAndLaunchBean>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Logutils.e("getNetAndLaunchSetting", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull NetAndLaunchBean netAndLaunchBean) {
|
||||||
|
Logutils.e("getNetAndLaunchSetting", "onNext: " + netAndLaunchBean.toString());
|
||||||
|
if (netAndLaunchBean.getCode() == 200) {
|
||||||
|
JGYUtils.getInstance().setNetAndlaunch(netAndLaunchBean);
|
||||||
|
} else {
|
||||||
|
Logutils.e("getNetAndLaunchSetting", "onNext: " + netAndLaunchBean.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Logutils.e("getNetAndLaunchSetting", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Logutils.e("getNetAndLaunchSetting", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
package com.mjsheng.myappstore.network;
|
package com.aoleyun.sn.network;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.BuildConfig;
|
import com.aoleyun.sn.BuildConfig;
|
||||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
|
||||||
import com.mjsheng.myappstore.utils.Utils;
|
|
||||||
|
|
||||||
import rxhttp.wrapper.annotation.DefaultDomain;
|
import rxhttp.wrapper.annotation.DefaultDomain;
|
||||||
|
|
||||||
@@ -16,41 +14,41 @@ public class URLAddress {
|
|||||||
|
|
||||||
|
|
||||||
// 下载接口 根据包名匹配 请求后更新下载次数
|
// 下载接口 根据包名匹配 请求后更新下载次数
|
||||||
public static final String HTTP_TAG_DOWNLOAD_URL = HTTP_TAG_HEAD_NEW + "count/index";
|
public static final String SEND_DOWNLOAD_TIMES = "count/index";
|
||||||
//app下载完成发送下载次数
|
//app下载完成发送下载次数
|
||||||
public static final String SEND_DOWNLOAD_FILE_INFO = HTTP_TAG_HEAD_NEW + "app/downloadApp";
|
public static final String SEND_DOWNLOAD_FILE_INFO = "app/downloadApp";
|
||||||
//获取设备锁定状态
|
//获取设备锁定状态
|
||||||
public static final String GET_DEVICES_LOCKED = "lock/index";
|
public static final String GET_DEVICES_LOCKED = "lock/index";
|
||||||
//发送设备信息
|
//发送设备信息
|
||||||
public static final String SEND_DEVICES = "Mac/getMac";
|
public static final String SEND_DEVICES = "Mac/getMac";
|
||||||
//发送app使用情况
|
//发送app使用情况
|
||||||
public static final String SEND_USEDTIME = HTTP_TAG_HEAD_NEW + "Applog/getAppLog";
|
public static final String GET_APP_LOG = "Applog/getAppLog";
|
||||||
//更新接口
|
//更新接口
|
||||||
public static final String CHECK_UPDATE = HTTP_TAG_HEAD_NEW + "Silent/silent";
|
public static final String CHECK_UPDATE = "Silent/silent";
|
||||||
//获取设备标签
|
//获取设备标签
|
||||||
public static final String GET_DEVICES_TAGS = HTTP_TAG_HEAD_NEW + "Sn/getSnTag";
|
public static final String GET_DEVICES_TAGS = "Sn/getSnTag";
|
||||||
//删除Aliases
|
//删除Aliases
|
||||||
public static final String DELETE_GEDEVICE_ALIAS = HTTP_TAG_HEAD_NEW + "Sn/deleteAliases";
|
public static final String DELETE_GEDEVICE_ALIAS = "Sn/deleteAliases";
|
||||||
//浏览器书签主页设置
|
//浏览器书签主页设置
|
||||||
public static final String SET_HOMEPAG_TAG = HTTP_TAG_HEAD_NEW + "Label";
|
public static final String SET_HOMEPAG_TAG = "Label";
|
||||||
//app内部网页管控
|
//app内部网页管控
|
||||||
public static final String SET_APPINSIDEWEB = "Appground";
|
public static final String SET_APPINSIDEWEB = "Appground";
|
||||||
//浏览器黑白名单地址
|
//浏览器黑白名单地址
|
||||||
public static final String SET_BROWSER_LIST = HTTP_TAG_HEAD_NEW + "browser";
|
public static final String SET_BROWSER_LIST = "browser";
|
||||||
//强制安装应用
|
//强制安装应用
|
||||||
public static final String GET_FORCE_INSTALL_LIST = "forceinstall/index";
|
public static final String GET_FORCE_INSTALL_LIST = "forceinstall/index";
|
||||||
//应用白名单
|
//应用白名单
|
||||||
public static final String SET_WHITE_PACKAGE_LIST = "firmware/index";
|
public static final String SET_WHITE_PACKAGE_LIST = "firmware/index";
|
||||||
//获取隐藏桌面图标
|
//获取隐藏桌面图标
|
||||||
public static final String GET_HIDE_DESKTOPICON = HTTP_TAG_HEAD_NEW + "Icon";
|
public static final String GET_HIDE_DESKTOPICON = "Icon";
|
||||||
//获取应用升级自启
|
//获取应用升级自启
|
||||||
public final static String NET_AND_LAUNCH_API = HTTP_TAG_HEAD_NEW + "automatic/get";
|
public final static String NET_AND_LAUNCH_API = "automatic/get";
|
||||||
//通过sn获取信息
|
//通过sn获取信息
|
||||||
public static final String GET_STUDENTS_INFO = "Sn/getStudent";
|
public static final String GET_STUDENTS_INFO = "Sn/getStudent";
|
||||||
//上传截图
|
//上传截图
|
||||||
public static final String SEND_SCREENSHOT = HTTP_TAG_HEAD_NEW + "Screenshot/addImg";
|
public static final String SEND_SCREENSHOT = "Screenshot/addImg";
|
||||||
//上传我的设备
|
//上传我的设备
|
||||||
//public static final String UPDATE_DEVICEINFO = HTTP_TAG_HEAD_NEW + "Mac/getInfo";
|
//public static final String UPDATE_DEVICEINFO = "Mac/getInfo";
|
||||||
//获取霸屏状态
|
//获取霸屏状态
|
||||||
public final static String GET_LOCK_SCREEN_STATE = "Sn/getSnScreen";
|
public final static String GET_LOCK_SCREEN_STATE = "Sn/getSnScreen";
|
||||||
//获取默认桌面升级
|
//获取默认桌面升级
|
||||||
@@ -60,7 +58,7 @@ public class URLAddress {
|
|||||||
//获取顶部app管控
|
//获取顶部app管控
|
||||||
public final static String GET_TOP_APP_CONTROL = "Sn/getSnAppControl";
|
public final static String GET_TOP_APP_CONTROL = "Sn/getSnAppControl";
|
||||||
//获取测试app
|
//获取测试app
|
||||||
public final static String GET_SN_APP_TEST = HTTP_TAG_HEAD_NEW + "Sn/getSnAppTest";
|
public final static String GET_SN_APP_TEST = "Sn/getSnAppTest";
|
||||||
//开机动画
|
//开机动画
|
||||||
public final static String GET_LOGO_IMG = "Sn/getLogoImg";
|
public final static String GET_LOGO_IMG = "Sn/getLogoImg";
|
||||||
//开发人员选项开关
|
//开发人员选项开关
|
||||||
@@ -75,7 +73,7 @@ public class URLAddress {
|
|||||||
public final static String GET_DEFAULT_APP = "app/getDefaultApp";
|
public final static String GET_DEFAULT_APP = "app/getDefaultApp";
|
||||||
|
|
||||||
//删除alias
|
//删除alias
|
||||||
public static final String DELETE_JPUSH_ALIAS = "https://device.jpush.cn/v3/aliases/" ;
|
public static final String DELETE_JPUSH_ALIAS = "https://device.jpush.cn/v3/aliases/";
|
||||||
//删除tags
|
//删除tags
|
||||||
public static final String DELETE_JPUSH_TAG = "https://device.jpush.cn/v3/tags/" ;
|
public static final String DELETE_JPUSH_TAG = "https://device.jpush.cn/v3/tags/";
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.mjsheng.myappstore.network.api;
|
package com.aoleyun.sn.network.api;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
@@ -8,13 +8,6 @@ import retrofit2.http.Field;
|
|||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者 mjsheng
|
|
||||||
* 日期 2018/5/7 08:28
|
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface AppLimitApi {
|
public interface AppLimitApi {
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(URLAddress.SET_WHITE_PACKAGE_LIST)
|
@POST(URLAddress.SET_WHITE_PACKAGE_LIST)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.network.api;
|
package com.aoleyun.sn.network.api;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
@@ -6,13 +6,6 @@ import retrofit2.http.Field;
|
|||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者 mjsheng
|
|
||||||
* 日期 2018/5/7 08:28
|
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface DeselectIDApi {
|
public interface DeselectIDApi {
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("application/index")
|
@POST("application/index")
|
||||||
@@ -1,20 +1,13 @@
|
|||||||
package com.mjsheng.myappstore.network.api;
|
package com.aoleyun.sn.network.api;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.ForceDownloadBean;
|
import com.aoleyun.sn.bean.ForceDownloadBean;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者 mjsheng
|
|
||||||
* 日期 2018/5/7 08:28
|
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface ForceDownloadApi {
|
public interface ForceDownloadApi {
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(URLAddress.GET_FORCE_INSTALL_LIST)
|
@POST(URLAddress.GET_FORCE_INSTALL_LIST)
|
||||||
@@ -1,22 +1,16 @@
|
|||||||
package com.mjsheng.myappstore.network.api;
|
package com.aoleyun.sn.network.api;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||||
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者 mjsheng
|
|
||||||
* 日期 2018/5/7 08:28
|
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface NetAndLaunchApi {
|
public interface NetAndLaunchApi {
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("automatic/get")
|
@POST(URLAddress.NET_AND_LAUNCH_API)
|
||||||
Observable<NetAndLaunchBean> getNetAndLaunchApi(
|
Observable<NetAndLaunchBean> getNetAndLaunchApi(
|
||||||
@Field("key") String key,
|
@Field("key") String key,
|
||||||
@Field("sn") String sn
|
@Field("sn") String sn
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.network.api;
|
package com.aoleyun.sn.network.api;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
@@ -6,12 +6,6 @@ import retrofit2.http.Field;
|
|||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者 mjsheng
|
|
||||||
* 日期 2018/5/7 08:28
|
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface SystemSettingApi {
|
public interface SystemSettingApi {
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.network.api;
|
package com.aoleyun.sn.network.api;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
@@ -6,13 +6,6 @@ import retrofit2.http.Field;
|
|||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者 mjsheng
|
|
||||||
* 日期 2018/5/7 08:28
|
|
||||||
* 邮箱 501802639@qq.com
|
|
||||||
* 来自:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface UploadAppInfoApi {
|
public interface UploadAppInfoApi {
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("log/index")
|
@POST("log/index")
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.Appground;
|
import com.aoleyun.sn.bean.Appground;
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.bean.BrowserBookmarks;
|
import com.aoleyun.sn.bean.BrowserBookmarks;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.bean.BrowserData;
|
import com.aoleyun.sn.bean.BrowserData;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.bean.ForceDownloadData;
|
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
public interface CustomROMApp {
|
public interface CustomROMAppApi {
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(URLAddress.GET_ROM_APP)
|
@POST(URLAddress.GET_ROM_APP)
|
||||||
Observable<BaseResponse> getROMApp(
|
Observable<BaseResponse> getROMApp(
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.bean.DefaultApp;
|
import com.aoleyun.sn.bean.DefaultApp;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.AppListInfo;
|
import com.aoleyun.sn.bean.AppListInfo;
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ import retrofit2.http.Field;
|
|||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
public interface GetAllApp {
|
public interface GetAllAppApi {
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(URLAddress.GET_ALL_APP)
|
@POST(URLAddress.GET_ALL_APP)
|
||||||
Observable<BaseResponse<List<AppListInfo>>> getAllAppList(
|
Observable<BaseResponse<List<AppListInfo>>> getAllAppList(
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.Field;
|
||||||
|
import retrofit2.http.FormUrlEncoded;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
|
public interface GetAppLogApi {
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(URLAddress.GET_APP_LOG)
|
||||||
|
Observable<BaseResponse> getAppLog(
|
||||||
|
@Field("sn") String sn,
|
||||||
|
@Field("random") String random,
|
||||||
|
@Field("data") String data
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
public interface GetDeveloper {
|
public interface GetDeveloperApi {
|
||||||
@GET(URLAddress.GET_DEVELOPER)
|
@GET(URLAddress.GET_DEVELOPER)
|
||||||
Observable<BaseResponse> getDeveloperState(
|
Observable<BaseResponse> getDeveloperState(
|
||||||
@Query("sn") String sn
|
@Query("sn") String sn
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
import retrofit2.http.FormUrlEncoded;
|
import retrofit2.http.FormUrlEncoded;
|
||||||
import retrofit2.http.POST;
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
public interface GetEBagCode {
|
public interface GetEBagCodeApi {
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST(URLAddress.GET_EBAG_CODE)
|
@POST(URLAddress.GET_EBAG_CODE)
|
||||||
Observable<BaseResponse> getEBagCode(
|
Observable<BaseResponse> getEBagCode(
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
public interface JpushTagsApi {
|
public interface GetJpushTagsApi {
|
||||||
@GET(URLAddress.GET_DEVICES_TAGS)
|
@GET(URLAddress.GET_DEVICES_TAGS)
|
||||||
Observable<BaseResponse> getJpushTags(
|
Observable<BaseResponse> getJpushTags(
|
||||||
@Query("sn") String sn
|
@Query("sn") String sn
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.bean.LogoImg;
|
import com.aoleyun.sn.bean.LogoImg;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.Field;
|
||||||
|
import retrofit2.http.FormUrlEncoded;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
|
public interface SendDownloadInfoApi {
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(URLAddress.SEND_DOWNLOAD_FILE_INFO)
|
||||||
|
Observable<BaseResponse> sendDownloadTimes(
|
||||||
|
@Field("key") String key,
|
||||||
|
@Field("sn") String sn,
|
||||||
|
@Field("userId") int userId,
|
||||||
|
@Field("package_name") String package_name,
|
||||||
|
@Field("app_size") long app_size
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.Field;
|
||||||
|
import retrofit2.http.FormUrlEncoded;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
|
public interface SendDownloadTimesApi {
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(URLAddress.SEND_DOWNLOAD_TIMES)
|
||||||
|
Observable<BaseResponse> sendDownloadTimes(
|
||||||
|
@Field("key") String key,
|
||||||
|
@Field("sn") String sn,
|
||||||
|
@Field("package") String packages,
|
||||||
|
@Field("app_id") String app_id
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
|
import com.aoleyun.sn.BuildConfig;
|
||||||
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import retrofit2.http.Field;
|
||||||
|
import retrofit2.http.FormUrlEncoded;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
|
public interface SendScreenStatusApi {
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(BuildConfig.SCREEN_URL)
|
||||||
|
Observable<BaseResponse> sendScreenStatus(
|
||||||
|
@Field("key") String key,
|
||||||
|
@Field("sn") String sn,
|
||||||
|
@Field("is_online") int is_online
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
import retrofit2.http.Field;
|
||||||
|
import retrofit2.http.Multipart;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Part;
|
||||||
|
|
||||||
|
public interface SendScreenshotApi {
|
||||||
|
@Multipart
|
||||||
|
@POST(URLAddress.SEND_SCREENSHOT)
|
||||||
|
Observable<BaseResponse> sendScreenshot(
|
||||||
|
@Field("sn") String sn,
|
||||||
|
@Field("createtime") long createtime,
|
||||||
|
@Part MultipartBody.Part body
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.GET;
|
import retrofit2.http.GET;
|
||||||
import retrofit2.http.Query;
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
public interface SnTimeControl {
|
public interface SnTimeControlApi {
|
||||||
@GET(URLAddress.GET_SN_TIME_CONTROL)
|
@GET(URLAddress.GET_SN_TIME_CONTROL)
|
||||||
Observable<BaseResponse> getSnTimeControl(
|
Observable<BaseResponse> getSnTimeControl(
|
||||||
@Query("sn") String sn
|
@Query("sn") String sn
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.mjsheng.myappstore.network.api.newapi;
|
package com.aoleyun.sn.network.api.newapi;
|
||||||
|
|
||||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
import com.aoleyun.sn.bean.BaseResponse;
|
||||||
import com.mjsheng.myappstore.bean.StudentsInfo;
|
import com.aoleyun.sn.bean.StudentsInfo;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.aoleyun.sn.network.URLAddress;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
import io.reactivex.Observable;
|
||||||
import retrofit2.http.Field;
|
import retrofit2.http.Field;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user