version:
update:2021.03.19 fix:移除不需要的组件 add:
This commit is contained in:
@@ -31,7 +31,8 @@
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
<uses-permission
|
||||
android:name="android.permission.DELETE_PACKAGES"
|
||||
tools:ignore="ProtectedPermissions" /> <!-- ##############################极光推送############################## -->
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<!-- ##############################极光推送############################## -->
|
||||
<!-- Required -->
|
||||
<permission
|
||||
android:name="${JPUSH_PKGNAME}.permission.JPUSH_MESSAGE"
|
||||
@@ -54,8 +55,10 @@
|
||||
android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"
|
||||
android:maxSdkVersion="23" /> <!-- 高德地图 -->
|
||||
<!-- 用于进行网络定位 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 用于访问GPS定位 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 用于获取运营商信息,用于支持提供运营商信息相关的接口 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<!-- 用于访问GPS定位 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<!-- 用于获取运营商信息,用于支持提供运营商信息相关的接口 -->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> -->
|
||||
<!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位 -->
|
||||
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> -->
|
||||
@@ -68,8 +71,10 @@
|
||||
<!-- 用于写入缓存数据到扩展存储卡 -->
|
||||
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> -->
|
||||
<!-- 用于申请调用A-GPS模块 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- 如果设置了target >= 28 如果需要启动后台定位则必须声明这个权限 -->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <!-- 如果您的应用需要后台定位权限,且有可能运行在Android Q设备上,并且设置了target>28,必须增加这个权限声明 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||
<!-- 如果设置了target >= 28 如果需要启动后台定位则必须声明这个权限 -->
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<!-- 如果您的应用需要后台定位权限,且有可能运行在Android Q设备上,并且设置了target>28,必须增加这个权限声明 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
||||
|
||||
<application
|
||||
@@ -99,12 +104,12 @@
|
||||
android:name=".activity.MainActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleTop" />
|
||||
<activity android:name=".activity.MainTestActivity" >
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
<activity android:name=".activity.MainTestActivity">
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
</activity>
|
||||
|
||||
<service android:name=".server.MyDownloadService" />
|
||||
@@ -168,7 +173,8 @@
|
||||
<!-- 自定义广播 -->
|
||||
<action android:name="com.jiaoguanyi.appstore.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver> <!-- <receiver android:name=".log.LogReceiver" -->
|
||||
</receiver>
|
||||
<!-- <receiver android:name=".log.LogReceiver" -->
|
||||
<!-- android:permission="android.permission.DUMP" > -->
|
||||
<!-- <intent-filter> -->
|
||||
<!-- <action android:name="android.intent.action.BOOT_COMPLETED" /> -->
|
||||
@@ -197,7 +203,8 @@
|
||||
|
||||
<category android:name="${JPUSH_PKGNAME}" />
|
||||
</intent-filter>
|
||||
</receiver> <!-- Required. For publish channel feature -->
|
||||
</receiver>
|
||||
<!-- Required. For publish channel feature -->
|
||||
<!-- JPUSH_CHANNEL 是为了方便开发者统计APK分发渠道。 -->
|
||||
<!-- 例如: -->
|
||||
<!-- 发到 Google Play 的APK可以设置为 google-play; -->
|
||||
@@ -219,13 +226,15 @@
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths" />
|
||||
</provider> <!-- ##############################极光推送############################## -->
|
||||
</provider>
|
||||
<!-- ##############################极光推送############################## -->
|
||||
<!-- Rich push 核心功能 since 2.0.6 -->
|
||||
<activity
|
||||
android:name="cn.jpush.android.ui.PopWinActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/MyDialogStyle"
|
||||
tools:replace="android:exported" /> <!-- Required SDK核心功能 -->
|
||||
tools:replace="android:exported" />
|
||||
<!-- Required SDK核心功能 -->
|
||||
<activity
|
||||
android:name="cn.jpush.android.ui.PushActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
@@ -238,7 +247,8 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="com.jiaoguanyi.appstore" />
|
||||
</intent-filter>
|
||||
</activity> <!-- Required SDK 核心功能 -->
|
||||
</activity>
|
||||
<!-- Required SDK 核心功能 -->
|
||||
<!-- 可配置android:process参数将PushService放在其他进程中 -->
|
||||
<service
|
||||
android:name="cn.jpush.android.service.PushService"
|
||||
@@ -250,13 +260,15 @@
|
||||
<action android:name="cn.jpush.android.intent.PushService" />
|
||||
<action android:name="cn.jpush.android.intent.PUSH_TIME" />
|
||||
</intent-filter>
|
||||
</service> <!-- since 3.0.9 Required SDK 核心功能 -->
|
||||
</service>
|
||||
<!-- since 3.0.9 Required SDK 核心功能 -->
|
||||
<provider
|
||||
android:name="cn.jpush.android.service.DataProvider"
|
||||
android:authorities="com.jiaoguanyi.appstore.DataProvider"
|
||||
android:exported="false"
|
||||
android:process=":pushcore"
|
||||
tools:replace="android:authorities" /> <!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
|
||||
tools:replace="android:authorities" />
|
||||
<!-- since 1.8.0 option 可选项。用于同一设备中不同应用的JPush服务相互拉起的功能。 -->
|
||||
<!-- 若不启用该功能可删除该组件,将不拉起其他应用也不能被其他应用拉起 -->
|
||||
<service
|
||||
android:name="cn.jpush.android.service.DaemonService"
|
||||
@@ -267,18 +279,21 @@
|
||||
|
||||
<category android:name="com.jiaoguanyi.appstore" />
|
||||
</intent-filter>
|
||||
</service> <!-- since 3.1.0 Required SDK 核心功能 -->
|
||||
</service>
|
||||
<!-- since 3.1.0 Required SDK 核心功能 -->
|
||||
<provider
|
||||
android:name="cn.jpush.android.service.DownloadProvider"
|
||||
android:authorities="com.jiaoguanyi.appstore.DownloadProvider"
|
||||
android:exported="true"
|
||||
tools:replace="android:authorities" /> <!-- Required SDK核心功能 -->
|
||||
tools:replace="android:authorities" />
|
||||
<!-- Required SDK核心功能 -->
|
||||
<receiver
|
||||
android:name="cn.jpush.android.service.PushReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false">
|
||||
<intent-filter android:priority="1000">
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" /> <!-- Required 显示通知栏 -->
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" />
|
||||
<!-- Required 显示通知栏 -->
|
||||
<category android:name="com.jiaoguanyi.appstore" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
@@ -292,10 +307,12 @@
|
||||
|
||||
<data android:scheme="package" />
|
||||
</intent-filter>
|
||||
</receiver> <!-- Required SDK核心功能 -->
|
||||
</receiver>
|
||||
<!-- Required SDK核心功能 -->
|
||||
<receiver
|
||||
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
|
||||
android:name="cn.jpush.android.service.JNotifyActivity"
|
||||
android:exported="true"
|
||||
@@ -306,7 +323,8 @@
|
||||
|
||||
<category android:name="com.jiaoguanyi.appstore" />
|
||||
</intent-filter>
|
||||
</activity> <!-- Since JCore2.0.0 Required SDK核心功能 -->
|
||||
</activity>
|
||||
<!-- Since JCore2.0.0 Required SDK核心功能 -->
|
||||
<!-- 这个Service要继承JCommonService -->
|
||||
<service
|
||||
android:name=".jpush.PushService"
|
||||
@@ -314,20 +332,27 @@
|
||||
<intent-filter>
|
||||
<action android:name="cn.jiguang.user.service.action" />
|
||||
</intent-filter>
|
||||
</service> <!-- User defined. For test only 用户自定义的广播接收器 -->
|
||||
</service>
|
||||
<!-- User defined. For test only 用户自定义的广播接收器 -->
|
||||
<receiver
|
||||
android:name=".jpush.MyReceiver"
|
||||
android:enabled="true"
|
||||
android:exported="false">
|
||||
<intent-filter>
|
||||
<action android:name="cn.jpush.android.intent.REGISTRATION" /> <!-- Required 用户注册SDK的intent -->
|
||||
<action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" /> <!-- Required 用户接收SDK消息的intent -->
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" /> <!-- Required 用户接收SDK通知栏信息的intent -->
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" /> <!-- Required 用户打开自定义通知栏的intent -->
|
||||
<action android:name="cn.jpush.android.intent.CONNECTION" /> <!-- 接收网络变化 连接/断开 since 1.6.3 -->
|
||||
<action android:name="cn.jpush.android.intent.REGISTRATION" />
|
||||
<!-- Required 用户注册SDK的intent -->
|
||||
<action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" />
|
||||
<!-- Required 用户接收SDK消息的intent -->
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" />
|
||||
<!-- Required 用户接收SDK通知栏信息的intent -->
|
||||
<action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" />
|
||||
<!-- Required 用户打开自定义通知栏的intent -->
|
||||
<action android:name="cn.jpush.android.intent.CONNECTION" />
|
||||
<!-- 接收网络变化 连接/断开 since 1.6.3 -->
|
||||
<category android:name="com.jiaoguanyi.appstore" />
|
||||
</intent-filter>
|
||||
</receiver> <!-- User defined. For test only 用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调 -->
|
||||
</receiver>
|
||||
<!-- User defined. For test only 用户自定义接收消息器,3.0.7开始支持,目前新tag/alias接口设置结果会在该广播接收器对应的方法中回调 -->
|
||||
<receiver android:name=".jpush.MyJPushMessageReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" />
|
||||
@@ -338,14 +363,17 @@
|
||||
|
||||
<meta-data
|
||||
android:name="JPUSH_CHANNEL"
|
||||
android:value="developer-default" /> <!-- Required. AppKey copied from Portal -->
|
||||
android:value="developer-default" />
|
||||
<!-- Required. AppKey copied from Portal -->
|
||||
<meta-data
|
||||
android:name="JPUSH_APPKEY"
|
||||
android:value="${JPUSH_APPKEY}" /> <!-- 高德地图 -->
|
||||
android:value="${JPUSH_APPKEY}" />
|
||||
<!-- 高德地图 -->
|
||||
<!-- 设置key -->
|
||||
<meta-data
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="5b68c8ee39800ff700a3762b6e028b78" /> <!-- 定位需要的服务 适配Android Q需要加上android:foregroundServiceType="location" -->
|
||||
android:value="5b68c8ee39800ff700a3762b6e028b78" />
|
||||
<!-- 定位需要的服务 适配Android Q需要加上android:foregroundServiceType="location" -->
|
||||
<service
|
||||
android:name="com.amap.api.location.APSService"
|
||||
android:foregroundServiceType="location" />
|
||||
|
||||
@@ -29,13 +29,11 @@ import com.amap.api.location.AMapLocationListener;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.arialyy.aria.core.download.DownloadEntity;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.cache.CacheEntity;
|
||||
import com.lzy.okgo.cache.CacheMode;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.lzy.okgo.cookie.store.PersistentCookieStore;
|
||||
import com.lzy.okserver.download.DownloadService;
|
||||
import com.mjsheng.myappstore.statistics.AppInformation;
|
||||
import com.mjsheng.myappstore.statistics.StatisticsInfo;
|
||||
import com.mjsheng.myappstore.activity.MainActivity;
|
||||
@@ -49,7 +47,7 @@ import com.mjsheng.myappstore.server.GuardService;
|
||||
import com.mjsheng.myappstore.server.InitJpushServer;
|
||||
import com.mjsheng.myappstore.server.MyDownloadService;
|
||||
import com.mjsheng.myappstore.server.StepService;
|
||||
import com.mjsheng.myappstore.utils.Configure;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.mjsheng.myappstore.utils.MySQLData;
|
||||
import com.mjsheng.myappstore.utils.NetworkUtils;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
@@ -136,12 +134,12 @@ public class MyApplication extends MultiDexApplication {
|
||||
//by mjsheng 激活
|
||||
MySQLData.SetData(this, CommonDatas.SP_USER_VIP, "1");
|
||||
|
||||
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
|
||||
// .setDefaultFontPath("fonts/1234.ttf")
|
||||
// .setDefaultFontPath("fonts/Roboto-RobotoRegular.ttf")
|
||||
.setFontAttrId(R.attr.fontPath)
|
||||
.build()
|
||||
);
|
||||
// CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
|
||||
// .setDefaultFontPath("fonts/1234.ttf")
|
||||
// .setDefaultFontPath("fonts/Roboto-RobotoRegular.ttf")
|
||||
// .setFontAttrId(R.attr.fontPath)
|
||||
// .build()
|
||||
// );
|
||||
|
||||
// 设置开启日志,发布时请关闭日志
|
||||
JPushInterface.setDebugMode(true);
|
||||
@@ -281,12 +279,6 @@ public class MyApplication extends MultiDexApplication {
|
||||
|
||||
private ScreenReceiver screenReceiver;
|
||||
|
||||
Long time1 = 0L;
|
||||
Long time2 = 0L;
|
||||
|
||||
Long time3 = 0L;
|
||||
Long time4 = 0L;
|
||||
|
||||
public class ScreenReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
@@ -666,23 +658,10 @@ public class MyApplication extends MultiDexApplication {
|
||||
//可以设置https的证书,以下几种方案根据需要自己设置 方法一:信任所有证书,不安全有风险
|
||||
.setCertificates();
|
||||
|
||||
com.lzy.okserver.download.DownloadManager downloadManager = DownloadService.getDownloadManager();
|
||||
// com.lzy.okserver.download.DownloadManager downloadManager = DownloadService.getDownloadManager();
|
||||
// downloadManager.setTargetFolder(StorageUtils.getFileRoot(this));
|
||||
downloadManager.setTargetFolder(PathUtils.getExternalDownloadsPath() + "/jgy/");
|
||||
downloadManager.getThreadPool().setCorePoolSize(5);
|
||||
}
|
||||
|
||||
|
||||
// 添加Activity到容器中
|
||||
public static void addActivity(Activity activity) {
|
||||
activityList.add(activity);
|
||||
}
|
||||
|
||||
// 遍历所有Activity并finish
|
||||
public void exit() {
|
||||
for (Activity activity : activityList) {
|
||||
activity.finish();
|
||||
}
|
||||
// downloadManager.setTargetFolder(PathUtils.getExternalDownloadsPath() + "/jgy/");
|
||||
// downloadManager.getThreadPool().setCorePoolSize(5);
|
||||
}
|
||||
|
||||
public static void sendAppUsedTime(String random, String type) {
|
||||
@@ -722,7 +701,7 @@ public class MyApplication extends MultiDexApplication {
|
||||
} catch (Exception e) {
|
||||
Log.e("fht", e.getMessage());
|
||||
}
|
||||
OkGo.post(Configure.SEND_USEDTIME)
|
||||
OkGo.post(URLAddress.SEND_USEDTIME)
|
||||
.params("sn", Utils.getSerial())
|
||||
.params("random", random)
|
||||
.params("data", data.toString())
|
||||
@@ -775,9 +754,9 @@ public class MyApplication extends MultiDexApplication {
|
||||
}
|
||||
|
||||
synchronized public void getWhitePackageList() {
|
||||
OkGo.post(Configure.SET_WHITE_PACKAGE_LIST)
|
||||
OkGo.post(URLAddress.SET_WHITE_PACKAGE_LIST)
|
||||
.params("sn", Utils.getSerial())
|
||||
.params("key", Configure.HTTP_KEY)
|
||||
.params("key", URLAddress.HTTP_KEY)
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s, Call call, Response response) {
|
||||
|
||||
@@ -15,7 +15,6 @@ import android.content.res.Configuration;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.PersistableBundle;
|
||||
@@ -49,8 +48,6 @@ import com.hjq.permissions.Permission;
|
||||
import com.hjq.permissions.XXPermissions;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.lzy.okserver.download.DownloadManager;
|
||||
import com.lzy.okserver.download.DownloadService;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.MyApplication;
|
||||
import com.mjsheng.myappstore.R;
|
||||
@@ -72,7 +69,7 @@ import com.mjsheng.myappstore.network.api.NetAndLaunchApi;
|
||||
import com.mjsheng.myappstore.network.api.SystemSettingApi;
|
||||
import com.mjsheng.myappstore.server.MyDownloadService;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.Configure;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.mjsheng.myappstore.utils.ExampleUtil;
|
||||
import com.mjsheng.myappstore.utils.MySQLData;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
@@ -112,7 +109,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
private Context mContext;
|
||||
private final String ACTION_HrReceiver_JGY_DIS = "qch_jgy_network_disallow";
|
||||
private final String ACTION_HrReceiver_JGY = "qch_jgy_network_allow";
|
||||
private DownloadManager downloadManager;
|
||||
// private DownloadManager downloadManager;
|
||||
private ImageView imageView;
|
||||
private TextView tv_devsn, tv_devmac, tv_version;
|
||||
private TextView tv_batch, tv_class, tv_number, tv_name;
|
||||
@@ -157,8 +154,8 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
initView();
|
||||
initData();
|
||||
|
||||
downloadManager = DownloadService.getDownloadManager();
|
||||
downloadManager.startAllTask();
|
||||
// downloadManager = DownloadService.getDownloadManager();
|
||||
// downloadManager.startAllTask();
|
||||
Intent allIntent = new Intent();
|
||||
allIntent.setAction(Utils.DOWNLOAD_ALLTASK_ACTION);
|
||||
sendBroadcast(allIntent);
|
||||
@@ -264,7 +261,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
synchronized public void sendMACaddress() {
|
||||
String devices_version = Utils.getProperty("ro.custom.build.version", "获取失败");//获取自定义版本
|
||||
String rid = JPushInterface.getRegistrationID(MainActivity.this);
|
||||
OkGo.post(Configure.SEND_DEVICES)
|
||||
OkGo.post(URLAddress.SEND_DEVICES)
|
||||
.params("sn", Utils.getSerial())
|
||||
.params("mac", com.blankj.utilcode.util.DeviceUtils.getMacAddress())
|
||||
.params("jpush_id", rid)
|
||||
@@ -480,9 +477,10 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
@Override
|
||||
public void hasPermission(List<String> granted, boolean isAll) {
|
||||
if (isAll) {
|
||||
String path = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "POStemp";
|
||||
File file = new File(path);
|
||||
file.mkdirs();
|
||||
File file = new File(PathUtils.getExternalDownloadsPath() + "/jgy/");
|
||||
if (!file.exists()){
|
||||
file.mkdirs();
|
||||
}
|
||||
} else {
|
||||
ToastUtil.show("需要授予所有权限才能正常使用本程序!");
|
||||
}
|
||||
@@ -536,7 +534,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
private boolean locked = false;
|
||||
|
||||
public void getLockedState(final Handler handler) {
|
||||
OkGo.post(Configure.HTTP_TAG_FIRST)
|
||||
OkGo.post(URLAddress.HTTP_TAG_FIRST)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -839,7 +837,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
}
|
||||
|
||||
private void getInfo(final Handler handler) {
|
||||
OkGo.post(Configure.GET_STUDENTS_INFO)
|
||||
OkGo.post(URLAddress.GET_STUDENTS_INFO)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -1104,7 +1102,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
|
||||
private void getAppLimitApi() {
|
||||
AppLimitApi appLimitApi = Network.getAppLimitApi();
|
||||
appLimitApi.getAppLimitApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
appLimitApi.getAppLimitApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@@ -1184,7 +1182,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
|
||||
private void getDeselectID() {
|
||||
DeselectIDApi deselectIDApi = Network.getDeselectIDApi();
|
||||
deselectIDApi.getDeselectIDApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
deselectIDApi.getDeselectIDApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@@ -1257,7 +1255,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
|
||||
private void getDeselectBrowerID() {
|
||||
DeselectBrowserIDApi deselectBrowserIDApi = Network.getDeselectBrowserIDApi();
|
||||
deselectBrowserIDApi.getDeselectBrowserIDApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
deselectBrowserIDApi.getDeselectBrowserIDApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@@ -1304,7 +1302,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
|
||||
private void getNetAndLaunchSetting() {
|
||||
NetAndLaunchApi netAndLaunchApi = Network.getNetAndLaunchApi();
|
||||
netAndLaunchApi.getNetAndLaunchApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
netAndLaunchApi.getNetAndLaunchApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<NetAndLaunchBean>() {
|
||||
@@ -1339,7 +1337,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
|
||||
private void getForceDownload() {
|
||||
ForceDownloadApi forceDownloadApi = Network.getForceDownloadApi();
|
||||
forceDownloadApi.getForceDownloadApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
forceDownloadApi.getForceDownloadApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ForceDownloadBean>() {
|
||||
@@ -1643,7 +1641,7 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
|
||||
|
||||
private void getSystemSetting() {
|
||||
final SystemSettingApi systemSettingApi = Network.getSystemSettingApi();
|
||||
systemSettingApi.getSystemSettingApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
systemSettingApi.getSystemSettingApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
|
||||
@@ -4,13 +4,10 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.icu.text.SimpleDateFormat;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -26,24 +23,20 @@ import com.mjsheng.myappstore.bean.Appground;
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
||||
import com.mjsheng.myappstore.bean.NetAndLaunchData;
|
||||
import com.mjsheng.myappstore.bean.UserInfo;
|
||||
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
|
||||
import com.mjsheng.myappstore.network.api.newapi.SnTimeControl;
|
||||
import com.mjsheng.myappstore.network.api.newapi.TopAppControl;
|
||||
import com.mjsheng.myappstore.network.api.newapi.UpdateDeviceInfo;
|
||||
import com.mjsheng.myappstore.server.InitJpushServer;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.Configure;
|
||||
import com.mjsheng.myappstore.utils.ForegroundAppUtil;
|
||||
import com.mjsheng.myappstore.utils.Logger;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
import com.mjsheng.myappstore.utils.TimeUtils;
|
||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -60,223 +53,221 @@ import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_SET;
|
||||
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
|
||||
|
||||
public class HTTPInterface {
|
||||
private final static int requestCodeOK = 200;
|
||||
|
||||
//获取我的设备接口
|
||||
public static synchronized void checkDevicesInfo(final Handler handler) {
|
||||
OkGo.<String>post(UrlPath.SNINFO)
|
||||
.params("sn", Utils.getSn())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
Log.e("onSuccess", "checkDevicesInfo");
|
||||
try {
|
||||
JSONObject bodyObject = JSON.parseObject(s);
|
||||
Integer code = (bodyObject.getInteger("code"));
|
||||
String msg = bodyObject.getString("msg");
|
||||
String data = bodyObject.getString("data");
|
||||
UserInfo userInfo = JSON.parseObject(data, UserInfo.class);
|
||||
Message message = new Message();
|
||||
message.obj = userInfo;
|
||||
if (code == requestCodeOK) {
|
||||
message.what = 1;
|
||||
handler.sendMessage(message);
|
||||
} else if (code == -200) {
|
||||
message.what = 0;
|
||||
handler.sendMessage(message);
|
||||
} else if (code == -250) {
|
||||
ToastUtil.show(msg);
|
||||
handler.sendEmptyMessage(2);
|
||||
//设备验证
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.e("checkDevicesInfo", ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onError(Call call, Response response, Exception e) {
|
||||
super.onError(call, response, e);
|
||||
Log.e("onError", e.getMessage());
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public static void sendTimeLog(final Handler handler, UserInfo userInfo, String appname, int status, long time) {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = new Date(System.currentTimeMillis());
|
||||
String times = simpleDateFormat.format(date);
|
||||
OkGo.<String>post(UrlPath.APPLOG)
|
||||
.params("sn", Utils.getSerial())
|
||||
.params("app_name", appname)
|
||||
.params("use_time", time)
|
||||
.params("status", status)
|
||||
.params("createtime", times)
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
Log.e("onSuccess", "sendTimeLog");
|
||||
try {
|
||||
JSONObject bodyObject = JSON.parseObject(s);
|
||||
Log.e("onSuccess", bodyObject.toString());
|
||||
|
||||
Integer code = (bodyObject.getInteger("code"));
|
||||
String msg = bodyObject.getString("msg");
|
||||
String data = bodyObject.getString("data");
|
||||
UserInfo userInfo = JSON.parseObject(data, UserInfo.class);
|
||||
Message message = new Message();
|
||||
message.obj = userInfo;
|
||||
if (code == requestCodeOK) {
|
||||
|
||||
} else if (code == -200) {
|
||||
|
||||
} else if (code == -250) {
|
||||
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.e("checkDevicesInfo", ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Call call, Response response, Exception e) {
|
||||
super.onError(call, response, e);
|
||||
Log.e("onError", e.getMessage());
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
synchronized public static void checkUpdateByPackage(final Handler handler, String packageName, String versionCode) {
|
||||
OkGo.<String>post(UrlPath.GET_APP_UPDATE)
|
||||
.params("code", versionCode)
|
||||
.params("package", packageName)
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
try {
|
||||
JSONObject body = JSON.parseObject(s);
|
||||
int code = body.getInteger("code");
|
||||
String msg = body.getString("msg");
|
||||
if (code == 200) {
|
||||
Message message = new Message();
|
||||
JSONObject data = JSON.parseObject(body.getString("data"));
|
||||
if (data != null) {
|
||||
String url = data.getString("downloadurl");
|
||||
String newversion = data.getString("newversion");
|
||||
String content = data.getString("content");
|
||||
message.what = 200;
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("url", url);
|
||||
bundle.putString("versionCode", newversion);
|
||||
bundle.putString("content", content);
|
||||
message.obj = bundle;
|
||||
} else {
|
||||
message.what = -200;
|
||||
}
|
||||
handler.sendMessage(message);
|
||||
Log.e("checkUpdateByPackage", msg);
|
||||
} else {
|
||||
Log.e("checkUpdateByPackage", msg);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("checkUpdateByPackage", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Call call, Response response, Exception e) {
|
||||
super.onError(call, response, e);
|
||||
Log.e("onError", e.getMessage());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
synchronized public static void setAppuninstallInfo(String sn_id, String packageName) {
|
||||
OkGo.<String>post(UrlPath.SET_APP_UNINSTALL_INFO)
|
||||
.params("sn_id", sn_id)
|
||||
.params("package", packageName)
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
JSONObject object = JSON.parseObject(s);
|
||||
int code = object.getInteger("code");
|
||||
String msg = object.getString("msg");
|
||||
LogUtils.e("setAppinstallInfo", msg);
|
||||
if (code == 200) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Call call, Response response, Exception e) {
|
||||
super.onError(call, response, e);
|
||||
Log.e("onError", e.getMessage());
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
synchronized public static void sendStartTime(Context context, long startTime, String packageName, int battery, String random) {
|
||||
String sn_id = (String) SPUtils.get(context, "sn_id", "-1");
|
||||
String member_id = (String) SPUtils.get(context, "member_id", "-1");
|
||||
OkGo.<String>post(UrlPath.SEND_RUNINGAPPINFO)
|
||||
.params("start_time", startTime)
|
||||
.params("package", packageName)
|
||||
.params("battery", battery)
|
||||
.params("member_id", member_id)
|
||||
.params("sn_id", sn_id)
|
||||
.params("random", random)
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
String body = s;
|
||||
LogUtils.e("sendStartTime", body);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Call call, Response response, Exception e) {
|
||||
super.onError(call, response, e);
|
||||
Log.e("onError", e.getMessage());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
synchronized public static void getDriveState(String member_id, String sn_id) {
|
||||
|
||||
OkGo.<String>post(UrlPath.SEND_DRIVE_STATE)
|
||||
.params("member_id", member_id)
|
||||
.params("sn_id", sn_id)
|
||||
.params("status", 1)
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Call call, Response response, Exception e) {
|
||||
super.onError(call, response, e);
|
||||
Log.e("onError", e.getMessage());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
// //获取我的设备接口
|
||||
// public static synchronized void checkDevicesInfo(final Handler handler) {
|
||||
// OkGo.<String>post(UrlPath.SNINFO)
|
||||
// .params("sn", Utils.getSn())
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
// Log.e("onSuccess", "checkDevicesInfo");
|
||||
// try {
|
||||
// JSONObject bodyObject = JSON.parseObject(s);
|
||||
// Integer code = (bodyObject.getInteger("code"));
|
||||
// String msg = bodyObject.getString("msg");
|
||||
// String data = bodyObject.getString("data");
|
||||
// UserInfo userInfo = JSON.parseObject(data, UserInfo.class);
|
||||
// Message message = new Message();
|
||||
// message.obj = userInfo;
|
||||
// if (code == 200) {
|
||||
// message.what = 1;
|
||||
// handler.sendMessage(message);
|
||||
// } else if (code == -200) {
|
||||
// message.what = 0;
|
||||
// handler.sendMessage(message);
|
||||
// } else if (code == -250) {
|
||||
// ToastUtil.show(msg);
|
||||
// handler.sendEmptyMessage(2);
|
||||
// //设备验证
|
||||
// }
|
||||
// } catch (Exception ex) {
|
||||
// Log.e("checkDevicesInfo", ex.getMessage());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Call call, Response response, Exception e) {
|
||||
// super.onError(call, response, e);
|
||||
// Log.e("onError", e.getMessage());
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// @RequiresApi(api = Build.VERSION_CODES.N)
|
||||
// public static void sendTimeLog(final Handler handler, UserInfo userInfo, String appname, int status, long time) {
|
||||
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// Date date = new Date(System.currentTimeMillis());
|
||||
// String times = simpleDateFormat.format(date);
|
||||
// OkGo.<String>post(UrlPath.APPLOG)
|
||||
// .params("sn", Utils.getSerial())
|
||||
// .params("app_name", appname)
|
||||
// .params("use_time", time)
|
||||
// .params("status", status)
|
||||
// .params("createtime", times)
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
// Log.e("onSuccess", "sendTimeLog");
|
||||
// try {
|
||||
// JSONObject bodyObject = JSON.parseObject(s);
|
||||
// Log.e("onSuccess", bodyObject.toString());
|
||||
//
|
||||
// Integer code = (bodyObject.getInteger("code"));
|
||||
// String msg = bodyObject.getString("msg");
|
||||
// String data = bodyObject.getString("data");
|
||||
// UserInfo userInfo = JSON.parseObject(data, UserInfo.class);
|
||||
// Message message = new Message();
|
||||
// message.obj = userInfo;
|
||||
// if (code == 200) {
|
||||
//
|
||||
// } else if (code == -200) {
|
||||
//
|
||||
// } else if (code == -250) {
|
||||
//
|
||||
// }
|
||||
// } catch (Exception ex) {
|
||||
// Log.e("checkDevicesInfo", ex.getMessage());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Call call, Response response, Exception e) {
|
||||
// super.onError(call, response, e);
|
||||
// Log.e("onError", e.getMessage());
|
||||
//
|
||||
// }
|
||||
//
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// synchronized public static void checkUpdateByPackage(final Handler handler, String packageName, String versionCode) {
|
||||
// OkGo.<String>post(UrlPath.GET_APP_UPDATE)
|
||||
// .params("code", versionCode)
|
||||
// .params("package", packageName)
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
// try {
|
||||
// JSONObject body = JSON.parseObject(s);
|
||||
// int code = body.getInteger("code");
|
||||
// String msg = body.getString("msg");
|
||||
// if (code == 200) {
|
||||
// Message message = new Message();
|
||||
// JSONObject data = JSON.parseObject(body.getString("data"));
|
||||
// if (data != null) {
|
||||
// String url = data.getString("downloadurl");
|
||||
// String newversion = data.getString("newversion");
|
||||
// String content = data.getString("content");
|
||||
// message.what = 200;
|
||||
// Bundle bundle = new Bundle();
|
||||
// bundle.putString("url", url);
|
||||
// bundle.putString("versionCode", newversion);
|
||||
// bundle.putString("content", content);
|
||||
// message.obj = bundle;
|
||||
// } else {
|
||||
// message.what = -200;
|
||||
// }
|
||||
// handler.sendMessage(message);
|
||||
// Log.e("checkUpdateByPackage", msg);
|
||||
// } else {
|
||||
// Log.e("checkUpdateByPackage", msg);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// Log.e("checkUpdateByPackage", e.getMessage());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Call call, Response response, Exception e) {
|
||||
// super.onError(call, response, e);
|
||||
// Log.e("onError", e.getMessage());
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// synchronized public static void setAppuninstallInfo(String sn_id, String packageName) {
|
||||
// OkGo.<String>post(UrlPath.SET_APP_UNINSTALL_INFO)
|
||||
// .params("sn_id", sn_id)
|
||||
// .params("package", packageName)
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
// JSONObject object = JSON.parseObject(s);
|
||||
// int code = object.getInteger("code");
|
||||
// String msg = object.getString("msg");
|
||||
// LogUtils.e("setAppinstallInfo", msg);
|
||||
// if (code == 200) {
|
||||
//
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Call call, Response response, Exception e) {
|
||||
// super.onError(call, response, e);
|
||||
// Log.e("onError", e.getMessage());
|
||||
//
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// }
|
||||
//
|
||||
// synchronized public static void sendStartTime(Context context, long startTime, String packageName, int battery, String random) {
|
||||
// String sn_id = (String) SPUtils.get(context, "sn_id", "-1");
|
||||
// String member_id = (String) SPUtils.get(context, "member_id", "-1");
|
||||
// OkGo.<String>post(UrlPath.SEND_RUNINGAPPINFO)
|
||||
// .params("start_time", startTime)
|
||||
// .params("package", packageName)
|
||||
// .params("battery", battery)
|
||||
// .params("member_id", member_id)
|
||||
// .params("sn_id", sn_id)
|
||||
// .params("random", random)
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
// String body = s;
|
||||
// LogUtils.e("sendStartTime", body);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Call call, Response response, Exception e) {
|
||||
// super.onError(call, response, e);
|
||||
// Log.e("onError", e.getMessage());
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// synchronized public static void getDriveState(String member_id, String sn_id) {
|
||||
//
|
||||
// OkGo.<String>post(UrlPath.SEND_DRIVE_STATE)
|
||||
// .params("member_id", member_id)
|
||||
// .params("sn_id", sn_id)
|
||||
// .params("status", 1)
|
||||
// .execute(new StringCallback() {
|
||||
// @Override
|
||||
// public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Call call, Response response, Exception e) {
|
||||
// super.onError(call, response, e);
|
||||
// Log.e("onError", e.getMessage());
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
synchronized public static void checkUpdate(final Handler handler, String packageName) {
|
||||
|
||||
OkGo.<String>post(Configure.CHECK_UPDATE)
|
||||
OkGo.<String>post(URLAddress.CHECK_UPDATE)
|
||||
.params("package", packageName)
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -304,9 +295,8 @@ public class HTTPInterface {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
synchronized public static void checkTestUpdate(final Context context) {
|
||||
OkGo.<String>get(Configure.GET_SN_APP_TEST)
|
||||
OkGo.<String>get(URLAddress.GET_SN_APP_TEST)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -354,9 +344,8 @@ public class HTTPInterface {
|
||||
|
||||
}
|
||||
|
||||
|
||||
synchronized public static void setJpushTags(final Context context) {
|
||||
OkGo.get(Configure.GET_DEVICES_TAGS)
|
||||
OkGo.get(URLAddress.GET_DEVICES_TAGS)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -390,7 +379,7 @@ public class HTTPInterface {
|
||||
}
|
||||
|
||||
public static void cleanJpushAlias(String alias) {
|
||||
OkGo.<String>post(Configure.DELETE_GEDEVICE_ALIAS)
|
||||
OkGo.<String>post(URLAddress.DELETE_GEDEVICE_ALIAS)
|
||||
.params("sn", alias)
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -413,8 +402,8 @@ public class HTTPInterface {
|
||||
|
||||
synchronized public static void setHomepagtag(final Context context) {
|
||||
//7.0setPackage不加没有问题,.setPackage("com.android.settings"),10.0需要加上,待底层修改后
|
||||
OkGo.post(Configure.SET_HOMEPAG_TAG)
|
||||
.params("key", Configure.HTTP_KEY)
|
||||
OkGo.post(URLAddress.SET_HOMEPAG_TAG)
|
||||
.params("key", URLAddress.HTTP_KEY)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -485,8 +474,8 @@ public class HTTPInterface {
|
||||
}
|
||||
|
||||
synchronized public static void setAppinsideWeb(final Context context) {
|
||||
OkGo.post(Configure.SET_APPINSIDEWEB)
|
||||
.params("key", Configure.HTTP_KEY)
|
||||
OkGo.post(URLAddress.SET_APPINSIDEWEB)
|
||||
.params("key", URLAddress.HTTP_KEY)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -568,11 +557,10 @@ public class HTTPInterface {
|
||||
context.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
|
||||
//设置浏览器黑白名单
|
||||
synchronized public static void setBrowserList(final Context context) {
|
||||
OkGo.post(Configure.SET_BROWSER_LIST)
|
||||
.params("key", Configure.HTTP_KEY)
|
||||
OkGo.post(URLAddress.SET_BROWSER_LIST)
|
||||
.params("key", URLAddress.HTTP_KEY)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -612,10 +600,9 @@ public class HTTPInterface {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static void setHideDesktopIcon(final Context context) {
|
||||
OkGo.post(Configure.GET_HIDE_DESKTOPICON)
|
||||
.params("key", Configure.HTTP_KEY)
|
||||
OkGo.post(URLAddress.GET_HIDE_DESKTOPICON)
|
||||
.params("key", URLAddress.HTTP_KEY)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -667,8 +654,8 @@ public class HTTPInterface {
|
||||
}
|
||||
|
||||
synchronized public static void getNetAndLaunchSetting(final Context context) {
|
||||
OkGo.post(Configure.NET_AND_LAUNCH_API)
|
||||
.params("key", Configure.HTTP_KEY)
|
||||
OkGo.post(URLAddress.NET_AND_LAUNCH_API)
|
||||
.params("key", URLAddress.HTTP_KEY)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -807,7 +794,6 @@ public class HTTPInterface {
|
||||
// context.sendBroadcast(intent1);
|
||||
}
|
||||
|
||||
|
||||
public static void updateDeviceInfo(Context context) {
|
||||
String address = String.valueOf(SPUtils.get(context, "AmapAddress", "-"));
|
||||
String longitude = String.valueOf(SPUtils.get(context, "longitude", "0"));
|
||||
@@ -819,7 +805,7 @@ public class HTTPInterface {
|
||||
UpdateDeviceInfo updateDeviceInfo = Network.getUpdateDeviceInfo();
|
||||
updateDeviceInfo.updateDeviceInfo(
|
||||
Utils.getSerial(),
|
||||
Configure.HTTP_KEY,
|
||||
URLAddress.HTTP_KEY,
|
||||
Utils.getMachine(context),
|
||||
Utils.getHardware(context),
|
||||
jsonObject.toJSONString()
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.mjsheng.myappstore.network;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
public class URLAddress {
|
||||
//http tag
|
||||
public static final String HTTP_KEY = "YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=";
|
||||
|
||||
private static final String HTTP_TAG_HEAD_NEW = Network.ROOT_URL;
|
||||
|
||||
// 下载接口 根据包名匹配 请求后更新下载次数
|
||||
public static final String HTTP_TAG_DOWNLOAD_URL = HTTP_TAG_HEAD_NEW + "count/index";
|
||||
|
||||
public static final String SEND_DOWNLOAD_FILE_INFO = HTTP_TAG_HEAD_NEW + "app/downloadApp";
|
||||
|
||||
public static final String HTTP_TAG_FIRST = HTTP_TAG_HEAD_NEW + "lock/index";
|
||||
|
||||
public static final String SEND_DEVICES = HTTP_TAG_HEAD_NEW + "Mac/getMac";
|
||||
|
||||
public static final String SEND_USEDTIME = HTTP_TAG_HEAD_NEW + "Applog/getAppLog";
|
||||
|
||||
public static final String CHECK_UPDATE = HTTP_TAG_HEAD_NEW + "Silent/silent";
|
||||
//更新接口
|
||||
public static final String GET_DEVICES_TAGS = HTTP_TAG_HEAD_NEW + "Sn/getSnTag";
|
||||
//获取设备标签
|
||||
public static final String DELETE_GEDEVICE_ALIAS = HTTP_TAG_HEAD_NEW + "Sn/deleteAliases";
|
||||
//删除Aliases
|
||||
public static final String SET_HOMEPAG_TAG = HTTP_TAG_HEAD_NEW + "Label";
|
||||
//浏览器书签主页设置
|
||||
public static final String SET_APPINSIDEWEB = HTTP_TAG_HEAD_NEW + "Appground";
|
||||
//app内部网页管控
|
||||
public static final String SET_BROWSER_LIST = HTTP_TAG_HEAD_NEW + "browser";
|
||||
//浏览器黑白名单地址
|
||||
public static final String SET_WHITE_PACKAGE_LIST = HTTP_TAG_HEAD_NEW + "firmware/index";
|
||||
//应用白名单
|
||||
public static final String GET_HIDE_DESKTOPICON = HTTP_TAG_HEAD_NEW + "Icon";
|
||||
//获取隐藏桌面图标
|
||||
public final static String NET_AND_LAUNCH_API = HTTP_TAG_HEAD_NEW + "automatic/get";
|
||||
//获取应用升级自启
|
||||
public static final String GET_STUDENTS_INFO = HTTP_TAG_HEAD_NEW + "Sn/getStudent";
|
||||
//通过sn获取信息
|
||||
public static final String SEND_SCREENSHOT = HTTP_TAG_HEAD_NEW + "Screenshot/addImg";
|
||||
//上传截图
|
||||
// public static final String UPDATE_DEVICEINFO = HTTP_TAG_HEAD_NEW + "Mac/getInfo";
|
||||
//上传我的设备
|
||||
public final static String GET_LOCK_SCREEN_STATE = HTTP_TAG_HEAD_NEW + "Sn/getSnScreen";
|
||||
//获取霸屏状态
|
||||
public final static String GET_DESKTOP = HTTP_TAG_HEAD_NEW + "Sn/getSnDesktop";
|
||||
//获取默认桌面升级
|
||||
public final static String GET_SN_TIME_CONTROL = HTTP_TAG_HEAD_NEW + "Sn/getSnTimeControl";
|
||||
//获取时间管控
|
||||
public final static String GET_TOP_APP_CONTROL = HTTP_TAG_HEAD_NEW + "Sn/getSnAppControl";
|
||||
//获取顶部app管控
|
||||
public final static String GET_SN_APP_TEST = HTTP_TAG_HEAD_NEW + "Sn/getSnAppTest";
|
||||
//获取测试app
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.mjsheng.myappstore.network;
|
||||
|
||||
public class UrlPath {
|
||||
public static final String HOMEPATHRUL = "http://homework.tuiinfo.com/api/";
|
||||
//主页接口
|
||||
|
||||
public static final String SNINFO = HOMEPATHRUL + "Member/snInfo";
|
||||
//我的设备接口
|
||||
public static final String APPLOG = HOMEPATHRUL + "App/getApplog";
|
||||
|
||||
public final static String GET_APP_UPDATE = HOMEPATHRUL + "Update/update";
|
||||
//根据包名获取更新
|
||||
|
||||
public final static String SET_APP_INSTALL_INFO = HOMEPATHRUL + "App/appInstall";
|
||||
//发送app安装信息
|
||||
public final static String SET_APP_UNINSTALL_INFO = HOMEPATHRUL + "App/appUnload";
|
||||
//发送app卸载信息
|
||||
public final static String SEND_RUNINGAPPINFO = HOMEPATHRUL + "Monitoring/getAppNow";
|
||||
//获取当前最顶层应用和电量
|
||||
public final static String SEND_DRIVE_STATE = HOMEPATHRUL + "Online/online";
|
||||
|
||||
}
|
||||
@@ -1,15 +1,14 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.TimeControl;
|
||||
import com.mjsheng.myappstore.utils.Configure;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnTimeControl {
|
||||
@GET(Configure.GET_SN_TIME_CONTROL)
|
||||
@GET(URLAddress.GET_SN_TIME_CONTROL)
|
||||
Observable<BaseResponse> getSnTimeControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.utils.Configure;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface TopAppControl {
|
||||
@GET(Configure.GET_TOP_APP_CONTROL)
|
||||
@GET(URLAddress.GET_TOP_APP_CONTROL)
|
||||
Observable<BaseResponse> getSnAppControl(
|
||||
@Query("sn") String sn
|
||||
);
|
||||
|
||||
@@ -18,20 +18,21 @@ public class BootReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.e(TAG, "action:" + intent.getAction());
|
||||
if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
|
||||
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
|
||||
HTTPInterface.updateDeviceInfo(context);
|
||||
startService(context);
|
||||
} else if (
|
||||
intent.getAction().equals("android.intent.action.BroadcastReceiver")
|
||||
|| intent.getAction().equals("android.intent.action.BATTERY_CHANGED")
|
||||
|| intent.getAction().equals("android.intent.action.BATTERY_LOW")
|
||||
|| intent.getAction().equals("android.intent.action.BATTERY_OKAY")
|
||||
|| intent.getAction().equals("android.intent.action.ACTION_POWER_CONNECTED")
|
||||
|| intent.getAction().equals("android.intent.action.DATE_CHANGED")
|
||||
|| intent.getAction().equals("android.intent.action.TIME_TICK")
|
||||
|| intent.getAction().equals("android.intent.action.USER_PRESENT")
|
||||
|| intent.getAction().equals("android.intent.action.SCREEN_ON")
|
||||
|| intent.getAction().equals("android.intent.action.SCREEN_OFF")
|
||||
|| intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)
|
||||
|| intent.getAction().equals(Intent.ACTION_BATTERY_LOW)
|
||||
|| intent.getAction().equals(Intent.ACTION_BATTERY_OKAY)
|
||||
|| intent.getAction().equals(Intent.ACTION_POWER_CONNECTED)
|
||||
|| intent.getAction().equals(Intent.ACTION_POWER_DISCONNECTED)
|
||||
|| intent.getAction().equals(Intent.ACTION_DATE_CHANGED)
|
||||
|| intent.getAction().equals(Intent.ACTION_TIME_TICK)
|
||||
|| intent.getAction().equals(Intent.ACTION_USER_PRESENT)
|
||||
|| intent.getAction().equals(Intent.ACTION_SCREEN_OFF)
|
||||
|| intent.getAction().equals(Intent.ACTION_SCREEN_ON)
|
||||
//测试
|
||||
// || intent.getAction().equals("android.hardware.usb.action.USB_ACCESSORY_ATTACHED")
|
||||
// || intent.getAction().equals("android.hardware.usb.action.USB_ACCESSORY_DETACHED")
|
||||
|
||||
@@ -7,14 +7,11 @@ import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.provider.Browser;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -23,45 +20,32 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.amap.api.location.AMapLocation;
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
import com.amap.api.location.AMapLocationListener;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.blankj.utilcode.util.AppUtils;
|
||||
import com.blankj.utilcode.util.EncryptUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.MyApplication;
|
||||
import com.mjsheng.myappstore.activity.MainActivity;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadBean;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadData;
|
||||
import com.mjsheng.myappstore.comm.CommonDatas;
|
||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||
import com.mjsheng.myappstore.network.Network;
|
||||
import com.mjsheng.myappstore.network.api.ForceDownloadApi;
|
||||
import com.mjsheng.myappstore.server.InitJpushServer;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.CmdUtil;
|
||||
import com.mjsheng.myappstore.utils.Configure;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.mjsheng.myappstore.utils.ForegroundAppUtil;
|
||||
import com.mjsheng.myappstore.utils.MySQLData;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
import com.mjsheng.myappstore.utils.SaveListUtils;
|
||||
import com.mjsheng.myappstore.utils.ServiceAliveUtils;
|
||||
import com.mjsheng.myappstore.utils.SysSettingUtils;
|
||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
|
||||
import cn.jpush.android.api.JPushInterface;
|
||||
import io.reactivex.Observable;
|
||||
@@ -709,7 +693,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
}
|
||||
|
||||
private void getAppLimitApi() {
|
||||
Network.getAppLimitApi().getAppLimitApi(Configure.HTTP_KEY, Utils.getSerial()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<ResponseBody>() {
|
||||
Network.getAppLimitApi().getAppLimitApi(URLAddress.HTTP_KEY, Utils.getSerial()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<ResponseBody>() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
}
|
||||
@@ -1319,7 +1303,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
Log.e("uplaodImage", "File does not exists");
|
||||
return;
|
||||
}
|
||||
OkGo.post(Configure.SEND_SCREENSHOT)
|
||||
OkGo.post(URLAddress.SEND_SCREENSHOT)
|
||||
.params("sn", Utils.getSerial())
|
||||
.params("createtime", time)
|
||||
.params("file", file)
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.lzy.okgo.callback.StringCallback;
|
||||
import com.mjsheng.myappstore.KeepAliveConnection;
|
||||
import com.mjsheng.myappstore.MyApplication;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.Configure;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
import com.mjsheng.myappstore.utils.ServiceAliveUtils;
|
||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||
@@ -296,8 +296,8 @@ public class GuardService extends Service {
|
||||
String app_name = jsonObject.getString("app_name");
|
||||
String app_package = jsonObject.getString("app_package");
|
||||
ToastUtil.show(app_name + "\t:下载完成");
|
||||
OkGo.post(Configure.HTTP_TAG_DOWNLOAD_URL)
|
||||
.params("key", Configure.HTTP_KEY)
|
||||
OkGo.post(URLAddress.HTTP_TAG_DOWNLOAD_URL)
|
||||
.params("key", URLAddress.HTTP_KEY)
|
||||
.params("sn", Utils.getSerial())
|
||||
.params("package", app_package)
|
||||
.tag(this)
|
||||
@@ -315,8 +315,8 @@ public class GuardService extends Service {
|
||||
});
|
||||
int userId = (int) SPUtils.get(GuardService.this, "admin_id", 0);
|
||||
long app_size = task.getFileSize();
|
||||
OkGo.post(Configure.SEND_DOWNLOAD_FILE_INFO)
|
||||
.params("key", Configure.HTTP_KEY)
|
||||
OkGo.post(URLAddress.SEND_DOWNLOAD_FILE_INFO)
|
||||
.params("key", URLAddress.HTTP_KEY)
|
||||
.params("sn", Utils.getSerial())
|
||||
.params("userId", userId)
|
||||
.params("package_name", packageName)
|
||||
|
||||
@@ -11,7 +11,6 @@ import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
@@ -36,8 +35,6 @@ import com.lzy.okgo.callback.StringCallback;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.MyApplication;
|
||||
import com.mjsheng.myappstore.R;
|
||||
import com.mjsheng.myappstore.activity.MainActivity;
|
||||
import com.mjsheng.myappstore.activity.TopActivity;
|
||||
import com.mjsheng.myappstore.bean.Batch;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadBean;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadData;
|
||||
@@ -49,7 +46,6 @@ import com.mjsheng.myappstore.comm.CommonDatas;
|
||||
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
|
||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||
import com.mjsheng.myappstore.network.Network;
|
||||
import com.mjsheng.myappstore.network.UrlPath;
|
||||
import com.mjsheng.myappstore.network.api.AppLimitApi;
|
||||
import com.mjsheng.myappstore.network.api.DeselectBrowserIDApi;
|
||||
import com.mjsheng.myappstore.network.api.DeselectIDApi;
|
||||
@@ -58,7 +54,7 @@ import com.mjsheng.myappstore.network.api.NetAndLaunchApi;
|
||||
import com.mjsheng.myappstore.network.api.SystemSettingApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.GetBatchApi;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.Configure;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.mjsheng.myappstore.utils.ForegroundAppUtil;
|
||||
import com.mjsheng.myappstore.utils.MySQLData;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
@@ -67,7 +63,6 @@ import com.mjsheng.myappstore.utils.SysSettingUtils;
|
||||
import com.mjsheng.myappstore.utils.TimeUtils;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -87,8 +82,6 @@ import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.ResponseBody;
|
||||
import okhttp3.internal.Util;
|
||||
import retrofit2.Retrofit;
|
||||
import rx.Observable;
|
||||
import rx.functions.Action1;
|
||||
|
||||
@@ -148,7 +141,7 @@ public class InitJpushServer extends Service {
|
||||
}
|
||||
|
||||
private void getInfo() {
|
||||
OkGo.post(Configure.GET_STUDENTS_INFO)
|
||||
OkGo.post(URLAddress.GET_STUDENTS_INFO)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -177,7 +170,7 @@ public class InitJpushServer extends Service {
|
||||
}
|
||||
|
||||
private void getScreenLockState() {
|
||||
OkGo.get(Configure.GET_LOCK_SCREEN_STATE)
|
||||
OkGo.get(URLAddress.GET_LOCK_SCREEN_STATE)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -450,7 +443,7 @@ public class InitJpushServer extends Service {
|
||||
}
|
||||
|
||||
private void getDefaultDesktop() {
|
||||
OkGo.get(Configure.GET_DESKTOP)
|
||||
OkGo.get(URLAddress.GET_DESKTOP)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
@@ -517,7 +510,7 @@ public class InitJpushServer extends Service {
|
||||
|
||||
private void getDeselectID() {
|
||||
DeselectIDApi deselectIDApi = Network.getDeselectIDApi();
|
||||
deselectIDApi.getDeselectIDApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
deselectIDApi.getDeselectIDApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@@ -564,7 +557,7 @@ public class InitJpushServer extends Service {
|
||||
|
||||
private void getDeselectBrowerID() {
|
||||
DeselectBrowserIDApi deselectBrowserIDApi = Network.getDeselectBrowserIDApi();
|
||||
deselectBrowserIDApi.getDeselectBrowserIDApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
deselectBrowserIDApi.getDeselectBrowserIDApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@@ -611,7 +604,7 @@ public class InitJpushServer extends Service {
|
||||
|
||||
private void getAppLimitApi() {
|
||||
AppLimitApi appLimitApi = Network.getAppLimitApi();
|
||||
appLimitApi.getAppLimitApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
appLimitApi.getAppLimitApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@@ -773,7 +766,7 @@ public class InitJpushServer extends Service {
|
||||
|
||||
private void getNetAndLaunchSetting() {
|
||||
NetAndLaunchApi netAndLaunchApi = Network.getNetAndLaunchApi();
|
||||
netAndLaunchApi.getNetAndLaunchApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
netAndLaunchApi.getNetAndLaunchApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<NetAndLaunchBean>() {
|
||||
@@ -809,7 +802,7 @@ public class InitJpushServer extends Service {
|
||||
//强制下载
|
||||
private void getForceDownload() {
|
||||
ForceDownloadApi forceDownloadApi = Network.getForceDownloadApi();
|
||||
forceDownloadApi.getForceDownloadApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
forceDownloadApi.getForceDownloadApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ForceDownloadBean>() {
|
||||
@@ -1090,7 +1083,7 @@ public class InitJpushServer extends Service {
|
||||
|
||||
private void getSystemSetting() {
|
||||
final SystemSettingApi systemSettingApi = Network.getSystemSettingApi();
|
||||
systemSettingApi.getSystemSettingApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
systemSettingApi.getSystemSettingApi(URLAddress.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@@ -1153,7 +1146,7 @@ public class InitJpushServer extends Service {
|
||||
synchronized public void sendMACaddress() {
|
||||
String rid = JPushInterface.getRegistrationID(InitJpushServer.this);
|
||||
|
||||
OkGo.post(Configure.SEND_DEVICES)
|
||||
OkGo.post(URLAddress.SEND_DEVICES)
|
||||
.params("sn", Utils.getSerial())
|
||||
.params("mac", com.blankj.utilcode.util.DeviceUtils.getMacAddress())
|
||||
.params("jpush_id", rid)
|
||||
@@ -1181,7 +1174,7 @@ public class InitJpushServer extends Service {
|
||||
boolean locked = false;
|
||||
|
||||
synchronized public void getLockedState() {
|
||||
OkGo.post(Configure.HTTP_TAG_FIRST)
|
||||
OkGo.post(URLAddress.HTTP_TAG_FIRST)
|
||||
.params("sn", Utils.getSerial())
|
||||
.execute(new StringCallback() {
|
||||
@Override
|
||||
|
||||
@@ -2,41 +2,19 @@
|
||||
package com.mjsheng.myappstore.server;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.IBinder;
|
||||
import android.provider.Settings;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import android.util.Log;
|
||||
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.request.GetRequest;
|
||||
import com.lzy.okserver.download.DownloadInfo;
|
||||
import com.lzy.okserver.download.DownloadManager;
|
||||
import com.lzy.okserver.download.DownloadService;
|
||||
import com.lzy.okserver.listener.DownloadListener;
|
||||
import com.mjsheng.myappstore.MyApplication;
|
||||
import com.mjsheng.myappstore.bean.AppDateInfo;
|
||||
import com.mjsheng.myappstore.bean.AppDownloadInfo;
|
||||
import com.mjsheng.myappstore.download.StorageUtils;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.SaveListUtils;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
// 下载管理服务
|
||||
public class MyDownloadService extends Service {
|
||||
|
||||
private DownloadReceiver downloadReceiver;
|
||||
private DownloadManager downloadManager;
|
||||
public List<DownloadInfo> allTask;
|
||||
// private DownloadReceiver downloadReceiver;
|
||||
// private DownloadManager downloadManager;
|
||||
// public List<DownloadInfo> allTask;
|
||||
private List<String> downloadURL; // 当前下载的任务
|
||||
private static final String ACTION_START = "START";
|
||||
private static final String ACTION_STOP = "STOP";
|
||||
@@ -52,30 +30,30 @@ public class MyDownloadService extends Service {
|
||||
public void onCreate() {
|
||||
|
||||
super.onCreate();
|
||||
downloadManager = DownloadService.getDownloadManager();
|
||||
downloadManager.getThreadPool().setCorePoolSize(1);
|
||||
downloadManager.startAllTask();
|
||||
allTask = downloadManager.getAllTask();
|
||||
for (DownloadInfo downloadInfo : allTask) {
|
||||
DownloadListener downloadListener = new MyDownloadListener();
|
||||
downloadListener.setUserTag(downloadInfo.getUrl());
|
||||
downloadInfo.setListener(downloadListener);
|
||||
}
|
||||
downloadReceiver = new DownloadReceiver();
|
||||
downloadURL = new ArrayList<>();
|
||||
/* 注册广播 */
|
||||
IntentFilter mScreenOnFilter = new IntentFilter();
|
||||
mScreenOnFilter.addAction(Utils.DOWNLOAD_STARTALL_ACTION);
|
||||
mScreenOnFilter.addAction(Utils.DOWNLOAD_DELETE_UPDATE_ACTION);
|
||||
mScreenOnFilter.addAction(Utils.DOWNLOAD_START_ACTION);
|
||||
mScreenOnFilter.addAction(Utils.DOWNLOAD_STOP_ACTION);
|
||||
mScreenOnFilter.addAction(Utils.DOWNLOAD_INITIALIZE_ACTION);
|
||||
mScreenOnFilter.addAction(Utils.DOWNLOAD_DELETE_URL_ACTION);
|
||||
mScreenOnFilter.addAction(Utils.DOWNLOAD_DELETE_PACKAGENAME_ACTION);
|
||||
mScreenOnFilter.addAction(Utils.DOWNLOAD_DELETEALL_ACTION);
|
||||
mScreenOnFilter.addAction(Utils.DOWNLOAD_ALLTASK_ACTION);
|
||||
mScreenOnFilter.addAction(Utils.DOWNLOAD_PACKAGENAME_ACTION);
|
||||
MyDownloadService.this.registerReceiver(downloadReceiver, mScreenOnFilter);
|
||||
// downloadManager = DownloadService.getDownloadManager();
|
||||
// downloadManager.getThreadPool().setCorePoolSize(1);
|
||||
// downloadManager.startAllTask();
|
||||
// allTask = downloadManager.getAllTask();
|
||||
// for (DownloadInfo downloadInfo : allTask) {
|
||||
// DownloadListener downloadListener = new MyDownloadListener();
|
||||
// downloadListener.setUserTag(downloadInfo.getUrl());
|
||||
// downloadInfo.setListener(downloadListener);
|
||||
// }
|
||||
// downloadReceiver = new DownloadReceiver();
|
||||
// downloadURL = new ArrayList<>();
|
||||
// /* 注册广播 */
|
||||
// IntentFilter mScreenOnFilter = new IntentFilter();
|
||||
// mScreenOnFilter.addAction(Utils.DOWNLOAD_STARTALL_ACTION);
|
||||
// mScreenOnFilter.addAction(Utils.DOWNLOAD_DELETE_UPDATE_ACTION);
|
||||
// mScreenOnFilter.addAction(Utils.DOWNLOAD_START_ACTION);
|
||||
// mScreenOnFilter.addAction(Utils.DOWNLOAD_STOP_ACTION);
|
||||
// mScreenOnFilter.addAction(Utils.DOWNLOAD_INITIALIZE_ACTION);
|
||||
// mScreenOnFilter.addAction(Utils.DOWNLOAD_DELETE_URL_ACTION);
|
||||
// mScreenOnFilter.addAction(Utils.DOWNLOAD_DELETE_PACKAGENAME_ACTION);
|
||||
// mScreenOnFilter.addAction(Utils.DOWNLOAD_DELETEALL_ACTION);
|
||||
// mScreenOnFilter.addAction(Utils.DOWNLOAD_ALLTASK_ACTION);
|
||||
// mScreenOnFilter.addAction(Utils.DOWNLOAD_PACKAGENAME_ACTION);
|
||||
// MyDownloadService.this.registerReceiver(downloadReceiver, mScreenOnFilter);
|
||||
|
||||
startService(new Intent(this, StepService.class));
|
||||
startService(new Intent(this, GuardService.class));
|
||||
@@ -89,17 +67,17 @@ public class MyDownloadService extends Service {
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (downloadManager != null) {
|
||||
downloadManager.stopAllTask();
|
||||
}
|
||||
if (allTask != null) {
|
||||
allTask.clear();
|
||||
allTask = null;
|
||||
}
|
||||
downloadURL.clear();
|
||||
MyDownloadService.this.unregisterReceiver(downloadReceiver);
|
||||
Intent sevice = new Intent(this, DownloadService.class);
|
||||
this.startService(sevice);
|
||||
// if (downloadManager != null) {
|
||||
// downloadManager.stopAllTask();
|
||||
// }
|
||||
// if (allTask != null) {
|
||||
// allTask.clear();
|
||||
// allTask = null;
|
||||
// }
|
||||
// downloadURL.clear();
|
||||
// MyDownloadService.this.unregisterReceiver(downloadReceiver);
|
||||
// Intent sevice = new Intent(this, DownloadService.class);
|
||||
// this.startService(sevice);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -108,256 +86,256 @@ public class MyDownloadService extends Service {
|
||||
return null;
|
||||
}
|
||||
|
||||
private class MyDownloadListener extends DownloadListener {
|
||||
// private class MyDownloadListener extends DownloadListener {
|
||||
//
|
||||
// @Override
|
||||
// public void onProgress(DownloadInfo downloadInfo) {
|
||||
// Log.e("mjsheng", "onProgress::::::::" + downloadInfo.getProgress());
|
||||
// sendDownloadState(downloadInfo);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFinish(DownloadInfo downloadInfo) {
|
||||
// Log.e("fht", "onFinish");
|
||||
// sendDownloadState(downloadInfo);
|
||||
// AppDateInfo info = (AppDateInfo) downloadInfo.getData();
|
||||
// String s = Settings.System.getString(getContentResolver(), "qch_app_forbid");
|
||||
// String s1 = s;
|
||||
// if (!s.contains(info.getApp_baoming())) {
|
||||
// s1 = s + "," + info.getApp_baoming();
|
||||
// }
|
||||
// Settings.System.putString(getContentResolver(), "qch_app_forbid", s1);
|
||||
// Log.e("SystemSetting", "qch_app_forbid__________" + Settings.System.getString(getContentResolver(), "qch_app_forbid"));
|
||||
//
|
||||
// if (info.getApp_baoming().equals(Utils.YOUNGSYSTEM_APP_TONGBU) || info.getApp_baoming().equals(MyApplication.getAppContext().getPackageName())) {
|
||||
//// ApkUtils.install(MyApplication.getAppContext(), new File(downloadInfo.getTargetPath()));
|
||||
// ApkUtils.installApp(MyDownloadService.this, downloadInfo.getTargetPath());
|
||||
// Log.e("fht", "updateTask1");
|
||||
//// ApkUtils.updateTask(getApplicationContext());
|
||||
//
|
||||
// }
|
||||
// if (downloadURL.contains(downloadInfo.getUrl())) {
|
||||
//// ApkUtils.install(MyApplication.getAppContext(), new File(downloadInfo.getTargetPath()));
|
||||
//// if (MyApplication.getInstance().getInstallIngPackageName().equals("") || ApkUtils.isAvailable(getApplicationContext(), MyApplication.getInstance().getInstallIngPackageName())) {
|
||||
// //没有任务或者任务已经安装
|
||||
// Log.e("fht", "task package is installed , install new apk ");
|
||||
// ApkUtils.installApp(MyDownloadService.this, info.getApp_file());
|
||||
//// } else {
|
||||
//// //更新正在安装的信息,更新任务列表
|
||||
//// MyApplication.getInstance().setInstallIngPackageName("");
|
||||
//// MyApplication.getInstance().updateList();
|
||||
//// }
|
||||
//
|
||||
// //有bug,会一直回调
|
||||
// Log.e("fht", "updateTask2");
|
||||
// downloadURL.remove(downloadInfo.getUrl());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(DownloadInfo downloadInfo, String errorMsg, Exception e) {
|
||||
// sendDownloadState(downloadInfo);
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onProgress(DownloadInfo downloadInfo) {
|
||||
Log.e("mjsheng", "onProgress::::::::" + downloadInfo.getProgress());
|
||||
sendDownloadState(downloadInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish(DownloadInfo downloadInfo) {
|
||||
Log.e("fht", "onFinish");
|
||||
sendDownloadState(downloadInfo);
|
||||
AppDateInfo info = (AppDateInfo) downloadInfo.getData();
|
||||
String s = Settings.System.getString(getContentResolver(), "qch_app_forbid");
|
||||
String s1 = s;
|
||||
if (!s.contains(info.getApp_baoming())) {
|
||||
s1 = s + "," + info.getApp_baoming();
|
||||
}
|
||||
Settings.System.putString(getContentResolver(), "qch_app_forbid", s1);
|
||||
Log.e("SystemSetting", "qch_app_forbid__________" + Settings.System.getString(getContentResolver(), "qch_app_forbid"));
|
||||
|
||||
if (info.getApp_baoming().equals(Utils.YOUNGSYSTEM_APP_TONGBU) || info.getApp_baoming().equals(MyApplication.getAppContext().getPackageName())) {
|
||||
// ApkUtils.install(MyApplication.getAppContext(), new File(downloadInfo.getTargetPath()));
|
||||
ApkUtils.installApp(MyDownloadService.this, downloadInfo.getTargetPath());
|
||||
Log.e("fht", "updateTask1");
|
||||
// ApkUtils.updateTask(getApplicationContext());
|
||||
|
||||
}
|
||||
if (downloadURL.contains(downloadInfo.getUrl())) {
|
||||
// ApkUtils.install(MyApplication.getAppContext(), new File(downloadInfo.getTargetPath()));
|
||||
// if (MyApplication.getInstance().getInstallIngPackageName().equals("") || ApkUtils.isAvailable(getApplicationContext(), MyApplication.getInstance().getInstallIngPackageName())) {
|
||||
//没有任务或者任务已经安装
|
||||
Log.e("fht", "task package is installed , install new apk ");
|
||||
ApkUtils.installApp(MyDownloadService.this, info.getApp_file());
|
||||
// } else {
|
||||
// //更新正在安装的信息,更新任务列表
|
||||
// MyApplication.getInstance().setInstallIngPackageName("");
|
||||
// MyApplication.getInstance().updateList();
|
||||
// }
|
||||
|
||||
//有bug,会一直回调
|
||||
Log.e("fht", "updateTask2");
|
||||
downloadURL.remove(downloadInfo.getUrl());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(DownloadInfo downloadInfo, String errorMsg, Exception e) {
|
||||
sendDownloadState(downloadInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void sendDownloadState(DownloadInfo downloadInfo) {
|
||||
if (downloadInfo == null) return;
|
||||
AppDownloadInfo info = new AppDownloadInfo();
|
||||
info.setFileName(downloadInfo.getFileName());
|
||||
info.setProgress(downloadInfo.getProgress());
|
||||
info.setTargetPath(downloadInfo.getTargetPath());
|
||||
info.setUrl(downloadInfo.getUrl());
|
||||
info.setState(downloadInfo.getState());
|
||||
info.setDownloadLength(downloadInfo.getDownloadLength());
|
||||
info.setTotalLength(downloadInfo.getTotalLength());
|
||||
AppDateInfo dateInfo = (AppDateInfo) downloadInfo.getData();
|
||||
info.setPackageName(dateInfo.getApp_baoming());
|
||||
info.setVersion(dateInfo.getApp_banben());
|
||||
info.setData(dateInfo);
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Utils.DOWNLOAD_SERVICE_ACTION);
|
||||
intent.putExtra("DownloadInfo", info);
|
||||
sendBroadcast(intent);
|
||||
}
|
||||
// private void sendDownloadState(DownloadInfo downloadInfo) {
|
||||
// if (downloadInfo == null) return;
|
||||
// AppDownloadInfo info = new AppDownloadInfo();
|
||||
// info.setFileName(downloadInfo.getFileName());
|
||||
// info.setProgress(downloadInfo.getProgress());
|
||||
// info.setTargetPath(downloadInfo.getTargetPath());
|
||||
// info.setUrl(downloadInfo.getUrl());
|
||||
// info.setState(downloadInfo.getState());
|
||||
// info.setDownloadLength(downloadInfo.getDownloadLength());
|
||||
// info.setTotalLength(downloadInfo.getTotalLength());
|
||||
// AppDateInfo dateInfo = (AppDateInfo) downloadInfo.getData();
|
||||
// info.setPackageName(dateInfo.getApp_baoming());
|
||||
// info.setVersion(dateInfo.getApp_banben());
|
||||
// info.setData(dateInfo);
|
||||
// Intent intent = new Intent();
|
||||
// intent.setAction(Utils.DOWNLOAD_SERVICE_ACTION);
|
||||
// intent.putExtra("DownloadInfo", info);
|
||||
// sendBroadcast(intent);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 是否存在该包名的下载任务
|
||||
*/
|
||||
public DownloadInfo getPackageName(String packagename) {
|
||||
if (packagename != null) {
|
||||
for (DownloadInfo downloadInfo : allTask) {
|
||||
AppDateInfo info = (AppDateInfo) downloadInfo.getData();
|
||||
if (info.getApp_baoming() != null) {
|
||||
if (info.getApp_baoming().equals(packagename)) {
|
||||
return downloadInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// public DownloadInfo getPackageName(String packagename) {
|
||||
// if (packagename != null) {
|
||||
// for (DownloadInfo downloadInfo : allTask) {
|
||||
// AppDateInfo info = (AppDateInfo) downloadInfo.getData();
|
||||
// if (info.getApp_baoming() != null) {
|
||||
// if (info.getApp_baoming().equals(packagename)) {
|
||||
// return downloadInfo;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
|
||||
public class DownloadReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (Utils.DOWNLOAD_STARTALL_ACTION.equals(intent.getAction())) {
|
||||
downloadManager.startAllTask();
|
||||
} else if (Utils.DOWNLOAD_DELETE_URL_ACTION.equals(intent.getAction())) {
|
||||
// 删除标识 下载地址
|
||||
String URL = intent.getStringExtra("URL");
|
||||
DownloadInfo downloadInfo = downloadManager.getDownloadInfo(URL);
|
||||
if (downloadInfo != null) {
|
||||
downloadInfo.setState(10);
|
||||
sendDownloadState(downloadInfo);
|
||||
downloadManager.removeTask(downloadInfo.getUrl(), true);
|
||||
}
|
||||
} else if (Utils.DOWNLOAD_START_ACTION.equals(intent.getAction())) {
|
||||
// 下载
|
||||
String URL = intent.getStringExtra("URL");
|
||||
AppDateInfo appDateInfo = (AppDateInfo) intent.getSerializableExtra("AppDateInfo");
|
||||
if (appDateInfo != null) {
|
||||
GetRequest request = OkGo.get(URL);
|
||||
MyDownloadListener listener = new MyDownloadListener();
|
||||
listener.setUserTag(URL);
|
||||
if (URL != null) {
|
||||
if (downloadManager.getDownloadInfo(URL) == null) {
|
||||
if (!StorageUtils.isFileIsExists("/Android/data/" + context.getPackageName() + "/files/Download")) {
|
||||
// StorageUtils.getFileRoot(context);
|
||||
}
|
||||
downloadManager.addTask(URL, appDateInfo, request, listener);
|
||||
SaveListUtils.addDownLoadList(appDateInfo.getApp_baoming());
|
||||
DownloadInfo downloadInfo = downloadManager.getDownloadInfo(URL);
|
||||
AppDownloadInfo info = new AppDownloadInfo();
|
||||
info.setFileName(downloadInfo.getFileName());
|
||||
info.setProgress(downloadInfo.getProgress());
|
||||
info.setTargetPath(downloadInfo.getTargetPath());
|
||||
info.setUrl(downloadInfo.getUrl());
|
||||
info.setState(downloadInfo.getState());
|
||||
info.setDownloadLength(downloadInfo.getDownloadLength());
|
||||
info.setTotalLength(downloadInfo.getTotalLength());
|
||||
AppDateInfo dateInfo = (AppDateInfo) downloadInfo.getData();
|
||||
info.setPackageName(dateInfo.getApp_baoming());
|
||||
String s = Settings.System.getString(getContentResolver(), "qch_app_forbid");
|
||||
Settings.System.putString(getContentResolver(), "qch_app_forbid", s + "," + dateInfo.getApp_baoming());
|
||||
Log.e("SystemSetting", "qch_app_forbid__________" + Settings.System.getString(getContentResolver(), "qch_app_forbid"));
|
||||
|
||||
//2019.9.26
|
||||
info.setVersion(dateInfo.getApp_banben());
|
||||
info.setData(dateInfo);
|
||||
Intent allIntent = new Intent();
|
||||
allIntent.setAction(Utils.DOWNLOAD_NEWSERVICE_ACTION);
|
||||
allIntent.putExtra("addTask", info);
|
||||
sendBroadcast(allIntent);
|
||||
|
||||
} else {
|
||||
if (!StorageUtils.isFileIsExists(downloadManager.getDownloadInfo(URL).getTargetPath())) {
|
||||
downloadManager.removeTask(URL, true);
|
||||
// StorageUtils.getFileRoot(context);
|
||||
}
|
||||
downloadManager.addTask(URL, appDateInfo, request, listener);
|
||||
}
|
||||
if (!downloadURL.contains(URL)) {
|
||||
downloadURL.add(URL);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (downloadManager.getDownloadInfo(URL) != null) {
|
||||
downloadManager.restartTask(URL);
|
||||
}
|
||||
}
|
||||
} else if (Utils.DOWNLOAD_INITIALIZE_ACTION.equals(intent.getAction())) {
|
||||
// 初始化item状态
|
||||
String URL = intent.getStringExtra("URL");
|
||||
DownloadInfo downloadInfo = downloadManager.getDownloadInfo(URL);
|
||||
if (downloadInfo != null && StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
sendDownloadState(downloadInfo);
|
||||
}
|
||||
} else if (Utils.DOWNLOAD_PACKAGENAME_ACTION.equals(intent.getAction())) {
|
||||
// 初始化item状态
|
||||
String packageName = intent.getStringExtra("packageName");
|
||||
DownloadInfo downloadInfo = getPackageName(packageName);
|
||||
if (downloadInfo != null && StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
sendDownloadState(downloadInfo);
|
||||
}
|
||||
} else if (Utils.DOWNLOAD_STOP_ACTION.equals(intent.getAction())) {
|
||||
// 暂停标识
|
||||
String URL = intent.getStringExtra("URL");
|
||||
downloadManager.pauseTask(URL);
|
||||
DownloadInfo downloadInfo = downloadManager.getDownloadInfo(URL);
|
||||
if (downloadInfo != null && StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
sendDownloadState(downloadInfo);
|
||||
}
|
||||
} else if (Utils.DOWNLOAD_DELETE_PACKAGENAME_ACTION.equals(intent.getAction())) {
|
||||
// 删除标识 包名
|
||||
String packageName = intent.getStringExtra("packageName");
|
||||
DownloadInfo downloadInfo = getPackageName(packageName);
|
||||
if (downloadInfo != null && StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
downloadInfo.setState(10);
|
||||
sendDownloadState(downloadInfo);
|
||||
downloadManager.removeTask(downloadInfo.getUrl(), true);
|
||||
|
||||
}
|
||||
} else if (Utils.DOWNLOAD_DELETE_UPDATE_ACTION.equals(intent.getAction())) {
|
||||
// 删除 应用更新包
|
||||
String packageName = intent.getStringExtra("packageName");
|
||||
DownloadInfo downloadInfo = getPackageName(packageName);
|
||||
if (downloadInfo != null && downloadInfo.getData() != null) {
|
||||
AppDateInfo dateInfo = (AppDateInfo) downloadInfo.getData();
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
try {
|
||||
PackageInfo packInfo = packageManager.getPackageInfo(context.getPackageName(),
|
||||
0);
|
||||
String version = packInfo.versionName;
|
||||
String oldVersion = dateInfo.getApp_banben();
|
||||
if (oldVersion == null || oldVersion.equals("")) {
|
||||
downloadManager.removeTask(downloadInfo.getUrl(), true);
|
||||
} else if (Utils.isUpdate(oldVersion, version) == true || oldVersion.equals(version)) {
|
||||
downloadManager.removeTask(downloadInfo.getUrl(), true);
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
downloadInfo.setState(10);
|
||||
sendDownloadState(downloadInfo);
|
||||
downloadManager.removeTask(downloadInfo.getUrl(), true);
|
||||
}
|
||||
}
|
||||
} else if (Utils.DOWNLOAD_ALLTASK_ACTION.equals(intent.getAction())) {
|
||||
downloadManager = DownloadService.getDownloadManager();
|
||||
allTask = downloadManager.getAllTask();
|
||||
List<AppDownloadInfo> list = new ArrayList<>();
|
||||
if (allTask.size() > 0) {
|
||||
for (int i = 0; i < allTask.size(); i++) {
|
||||
DownloadInfo downloadInfo = allTask.get(i);
|
||||
if (downloadInfo != null && StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
AppDateInfo dateInfo = (AppDateInfo) downloadInfo.getData();
|
||||
if (!dateInfo.getApp_baoming().equals(Utils.YOUNGSYSTEM_APP_TONGBU) && !dateInfo.getApp_baoming().equals(context.getPackageName())) {
|
||||
AppDownloadInfo info = new AppDownloadInfo();
|
||||
info.setFileName(downloadInfo.getFileName());
|
||||
info.setProgress(downloadInfo.getProgress());
|
||||
info.setTargetPath(downloadInfo.getTargetPath());
|
||||
info.setUrl(downloadInfo.getUrl());
|
||||
info.setState(downloadInfo.getState());
|
||||
info.setDownloadLength(downloadInfo.getDownloadLength());
|
||||
info.setTotalLength(downloadInfo.getTotalLength());
|
||||
info.setPackageName(dateInfo.getApp_baoming());
|
||||
info.setVersion(dateInfo.getApp_banben());
|
||||
info.setData(dateInfo);
|
||||
list.add(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Intent allIntent = new Intent();
|
||||
allIntent.setAction(Utils.DOWNLOAD_ALLSERVICE_ACTION);
|
||||
allIntent.putExtra("allTask", (Serializable) list);
|
||||
sendBroadcast(allIntent);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// public class DownloadReceiver extends BroadcastReceiver {
|
||||
//
|
||||
// @Override
|
||||
// public void onReceive(Context context, Intent intent) {
|
||||
// if (Utils.DOWNLOAD_STARTALL_ACTION.equals(intent.getAction())) {
|
||||
// downloadManager.startAllTask();
|
||||
// } else if (Utils.DOWNLOAD_DELETE_URL_ACTION.equals(intent.getAction())) {
|
||||
// // 删除标识 下载地址
|
||||
// String URL = intent.getStringExtra("URL");
|
||||
// DownloadInfo downloadInfo = downloadManager.getDownloadInfo(URL);
|
||||
// if (downloadInfo != null) {
|
||||
// downloadInfo.setState(10);
|
||||
// sendDownloadState(downloadInfo);
|
||||
// downloadManager.removeTask(downloadInfo.getUrl(), true);
|
||||
// }
|
||||
// } else if (Utils.DOWNLOAD_START_ACTION.equals(intent.getAction())) {
|
||||
// // 下载
|
||||
// String URL = intent.getStringExtra("URL");
|
||||
// AppDateInfo appDateInfo = (AppDateInfo) intent.getSerializableExtra("AppDateInfo");
|
||||
// if (appDateInfo != null) {
|
||||
// GetRequest request = OkGo.get(URL);
|
||||
// MyDownloadListener listener = new MyDownloadListener();
|
||||
// listener.setUserTag(URL);
|
||||
// if (URL != null) {
|
||||
// if (downloadManager.getDownloadInfo(URL) == null) {
|
||||
// if (!StorageUtils.isFileIsExists("/Android/data/" + context.getPackageName() + "/files/Download")) {
|
||||
//// StorageUtils.getFileRoot(context);
|
||||
// }
|
||||
// downloadManager.addTask(URL, appDateInfo, request, listener);
|
||||
// SaveListUtils.addDownLoadList(appDateInfo.getApp_baoming());
|
||||
// DownloadInfo downloadInfo = downloadManager.getDownloadInfo(URL);
|
||||
// AppDownloadInfo info = new AppDownloadInfo();
|
||||
// info.setFileName(downloadInfo.getFileName());
|
||||
// info.setProgress(downloadInfo.getProgress());
|
||||
// info.setTargetPath(downloadInfo.getTargetPath());
|
||||
// info.setUrl(downloadInfo.getUrl());
|
||||
// info.setState(downloadInfo.getState());
|
||||
// info.setDownloadLength(downloadInfo.getDownloadLength());
|
||||
// info.setTotalLength(downloadInfo.getTotalLength());
|
||||
// AppDateInfo dateInfo = (AppDateInfo) downloadInfo.getData();
|
||||
// info.setPackageName(dateInfo.getApp_baoming());
|
||||
// String s = Settings.System.getString(getContentResolver(), "qch_app_forbid");
|
||||
// Settings.System.putString(getContentResolver(), "qch_app_forbid", s + "," + dateInfo.getApp_baoming());
|
||||
// Log.e("SystemSetting", "qch_app_forbid__________" + Settings.System.getString(getContentResolver(), "qch_app_forbid"));
|
||||
//
|
||||
// //2019.9.26
|
||||
// info.setVersion(dateInfo.getApp_banben());
|
||||
// info.setData(dateInfo);
|
||||
// Intent allIntent = new Intent();
|
||||
// allIntent.setAction(Utils.DOWNLOAD_NEWSERVICE_ACTION);
|
||||
// allIntent.putExtra("addTask", info);
|
||||
// sendBroadcast(allIntent);
|
||||
//
|
||||
// } else {
|
||||
// if (!StorageUtils.isFileIsExists(downloadManager.getDownloadInfo(URL).getTargetPath())) {
|
||||
// downloadManager.removeTask(URL, true);
|
||||
//// StorageUtils.getFileRoot(context);
|
||||
// }
|
||||
// downloadManager.addTask(URL, appDateInfo, request, listener);
|
||||
// }
|
||||
// if (!downloadURL.contains(URL)) {
|
||||
// downloadURL.add(URL);
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// if (downloadManager.getDownloadInfo(URL) != null) {
|
||||
// downloadManager.restartTask(URL);
|
||||
// }
|
||||
// }
|
||||
// } else if (Utils.DOWNLOAD_INITIALIZE_ACTION.equals(intent.getAction())) {
|
||||
// // 初始化item状态
|
||||
// String URL = intent.getStringExtra("URL");
|
||||
// DownloadInfo downloadInfo = downloadManager.getDownloadInfo(URL);
|
||||
// if (downloadInfo != null && StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
// sendDownloadState(downloadInfo);
|
||||
// }
|
||||
// } else if (Utils.DOWNLOAD_PACKAGENAME_ACTION.equals(intent.getAction())) {
|
||||
// // 初始化item状态
|
||||
// String packageName = intent.getStringExtra("packageName");
|
||||
// DownloadInfo downloadInfo = getPackageName(packageName);
|
||||
// if (downloadInfo != null && StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
// sendDownloadState(downloadInfo);
|
||||
// }
|
||||
// } else if (Utils.DOWNLOAD_STOP_ACTION.equals(intent.getAction())) {
|
||||
// // 暂停标识
|
||||
// String URL = intent.getStringExtra("URL");
|
||||
// downloadManager.pauseTask(URL);
|
||||
// DownloadInfo downloadInfo = downloadManager.getDownloadInfo(URL);
|
||||
// if (downloadInfo != null && StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
// sendDownloadState(downloadInfo);
|
||||
// }
|
||||
// } else if (Utils.DOWNLOAD_DELETE_PACKAGENAME_ACTION.equals(intent.getAction())) {
|
||||
// // 删除标识 包名
|
||||
// String packageName = intent.getStringExtra("packageName");
|
||||
// DownloadInfo downloadInfo = getPackageName(packageName);
|
||||
// if (downloadInfo != null && StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
// downloadInfo.setState(10);
|
||||
// sendDownloadState(downloadInfo);
|
||||
// downloadManager.removeTask(downloadInfo.getUrl(), true);
|
||||
//
|
||||
// }
|
||||
// } else if (Utils.DOWNLOAD_DELETE_UPDATE_ACTION.equals(intent.getAction())) {
|
||||
// // 删除 应用更新包
|
||||
// String packageName = intent.getStringExtra("packageName");
|
||||
// DownloadInfo downloadInfo = getPackageName(packageName);
|
||||
// if (downloadInfo != null && downloadInfo.getData() != null) {
|
||||
// AppDateInfo dateInfo = (AppDateInfo) downloadInfo.getData();
|
||||
// PackageManager packageManager = context.getPackageManager();
|
||||
// try {
|
||||
// PackageInfo packInfo = packageManager.getPackageInfo(context.getPackageName(),
|
||||
// 0);
|
||||
// String version = packInfo.versionName;
|
||||
// String oldVersion = dateInfo.getApp_banben();
|
||||
// if (oldVersion == null || oldVersion.equals("")) {
|
||||
// downloadManager.removeTask(downloadInfo.getUrl(), true);
|
||||
// } else if (Utils.isUpdate(oldVersion, version) == true || oldVersion.equals(version)) {
|
||||
// downloadManager.removeTask(downloadInfo.getUrl(), true);
|
||||
// }
|
||||
// } catch (PackageManager.NameNotFoundException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// if (StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
// downloadInfo.setState(10);
|
||||
// sendDownloadState(downloadInfo);
|
||||
// downloadManager.removeTask(downloadInfo.getUrl(), true);
|
||||
// }
|
||||
// }
|
||||
// } else if (Utils.DOWNLOAD_ALLTASK_ACTION.equals(intent.getAction())) {
|
||||
// downloadManager = DownloadService.getDownloadManager();
|
||||
// allTask = downloadManager.getAllTask();
|
||||
// List<AppDownloadInfo> list = new ArrayList<>();
|
||||
// if (allTask.size() > 0) {
|
||||
// for (int i = 0; i < allTask.size(); i++) {
|
||||
// DownloadInfo downloadInfo = allTask.get(i);
|
||||
// if (downloadInfo != null && StorageUtils.isFileIsExists(downloadInfo.getTargetPath())) {
|
||||
// AppDateInfo dateInfo = (AppDateInfo) downloadInfo.getData();
|
||||
// if (!dateInfo.getApp_baoming().equals(Utils.YOUNGSYSTEM_APP_TONGBU) && !dateInfo.getApp_baoming().equals(context.getPackageName())) {
|
||||
// AppDownloadInfo info = new AppDownloadInfo();
|
||||
// info.setFileName(downloadInfo.getFileName());
|
||||
// info.setProgress(downloadInfo.getProgress());
|
||||
// info.setTargetPath(downloadInfo.getTargetPath());
|
||||
// info.setUrl(downloadInfo.getUrl());
|
||||
// info.setState(downloadInfo.getState());
|
||||
// info.setDownloadLength(downloadInfo.getDownloadLength());
|
||||
// info.setTotalLength(downloadInfo.getTotalLength());
|
||||
// info.setPackageName(dateInfo.getApp_baoming());
|
||||
// info.setVersion(dateInfo.getApp_banben());
|
||||
// info.setData(dateInfo);
|
||||
// list.add(info);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// Intent allIntent = new Intent();
|
||||
// allIntent.setAction(Utils.DOWNLOAD_ALLSERVICE_ACTION);
|
||||
// allIntent.putExtra("allTask", (Serializable) list);
|
||||
// sendBroadcast(allIntent);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.google.gson.Gson;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.R;
|
||||
import com.mjsheng.myappstore.bean.UploadAppInfo;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.mjsheng.myappstore.network.Network;
|
||||
import com.mjsheng.myappstore.network.api.UploadAppInfoApi;
|
||||
|
||||
@@ -1072,7 +1073,7 @@ public class ApkUtils {
|
||||
// Log.e("mjsheng", "json========" + jsonString);
|
||||
|
||||
UploadAppInfoApi uploadAppInfoApi = Network.getUploadAppInfoApi();
|
||||
uploadAppInfoApi.getUploadAppInfoApi(Configure.HTTP_KEY, Utils.getSerial(), jsonString)
|
||||
uploadAppInfoApi.getUploadAppInfoApi(URLAddress.HTTP_KEY, Utils.getSerial(), jsonString)
|
||||
.subscribeOn(io.reactivex.schedulers.Schedulers.io())
|
||||
.observeOn(io.reactivex.android.schedulers.AndroidSchedulers.mainThread())
|
||||
.subscribe(new io.reactivex.Observer<ResponseBody>() {
|
||||
|
||||
@@ -1,225 +0,0 @@
|
||||
package com.mjsheng.myappstore.utils;
|
||||
|
||||
|
||||
import com.mjsheng.myappstore.network.Network;
|
||||
|
||||
/**
|
||||
* @ClassName Config
|
||||
* @Description 客户端所有的配置项
|
||||
*/
|
||||
public class Configure {
|
||||
/**
|
||||
* 获取数据成功
|
||||
**/
|
||||
public static final int SUCCESS = 200;
|
||||
|
||||
//http tag
|
||||
public static final String HTTP_TAG_APP_RECOMMEND = "app_recommend";
|
||||
public static final String HTTP_TAG_SEARCH = "search";
|
||||
public static final String HTTP_TAG_CATEGORY_TABLE = "category_table";
|
||||
public static final String HTTP_TAG_RANKING_APPS = "ranking_apps";
|
||||
|
||||
|
||||
public static final String HTTP_TYPE_BRAND = "brand品牌";
|
||||
public static final String HTTP_TYPE_PROJECT = "project专题";
|
||||
public static final String HTTP_TYPE_HOMEPAGE = "homepage推荐";
|
||||
public static final String RANKING_TYPE_UPDATE = "update更新";
|
||||
public static final String RANKING_TYPE_APPSOTRE = "appstore应用商店弹窗";
|
||||
public static final String RANKING_TYPE_MOREAPP = "subjectmore更多应用";
|
||||
public static final String HTTP_KEY = "YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=";
|
||||
|
||||
private static final String HTTP_TAG_HEAD = "http://www.uiapi.tuiinfo.com/index.php/";
|
||||
// private static final String HTTP_TAG_HEAD_NEW = "http://www.jiaoguanyi.cn/api/";
|
||||
private static final String HTTP_TAG_HEAD_NEW = Network.ROOT_URL;
|
||||
|
||||
|
||||
// 应用更新接口 通过包名获取app信息 post baoming
|
||||
public static final String HTTP_TAG_APPBAOMING = HTTP_TAG_HEAD + "App";
|
||||
|
||||
|
||||
// 应用详情 通过包名获取app信息 post baoming
|
||||
// public static final String HTTP_TAG_APPDETAILS= HTTP_TAG_HEAD + "Appdetails";
|
||||
public static final String HTTP_TAG_APPDETAILS = HTTP_TAG_HEAD_NEW + "app/index";
|
||||
|
||||
|
||||
// 获取子系统分类
|
||||
public static final String HTTP_TAG_SYSTEMTYPE = HTTP_TAG_HEAD_NEW + "category/index";
|
||||
|
||||
// 获取子系统分类应用
|
||||
// public static final String HTTP_TAG_SYSTEMAPP = HTTP_TAG_HEAD + "Xitong/zixitongapp?zxtid=";
|
||||
public static final String HTTP_TAG_SYSTEMAPP = HTTP_TAG_HEAD_NEW + "category/app";
|
||||
|
||||
// 推荐页信息
|
||||
//改为最新上架 所有的应用
|
||||
// public static final String HTTP_TAG_HOMEPAGE_URL = HTTP_TAG_HEAD + "Tuij";
|
||||
public static final String HTTP_TAG_HOMEPAGE_URL = HTTP_TAG_HEAD_NEW + "recommend/index";
|
||||
|
||||
|
||||
// 排行页贴心推荐
|
||||
// public static final String HTTP_TAG_RECOMM_URL = HTTP_TAG_HEAD + "Top";
|
||||
public static final String HTTP_TAG_RECOMM_URL = HTTP_TAG_HEAD_NEW + "rank/index";
|
||||
|
||||
// 推荐页最新上架
|
||||
public static final String HTTP_TAG_LATEST_URL = HTTP_TAG_HEAD_NEW + "recommend/newreleases";
|
||||
// public static final String HTTP_TAG_LATEST_URL = HTTP_TAG_HEAD + "Tuij/gengduo?tj=1";
|
||||
|
||||
// 推荐页热门应用
|
||||
public static final String HTTP_TAG_HOTS_URL = HTTP_TAG_HEAD_NEW + "recommend/hot";
|
||||
// public static final String HTTP_TAG_HOTS_URL = HTTP_TAG_HEAD + "Tuij/gengduo?tj=2";
|
||||
|
||||
|
||||
// 推荐页首页专题品牌推荐
|
||||
public static final String HTTP_TAG_HOME_PAGE_URL = HTTP_TAG_HEAD + "Tuij/pztj";
|
||||
|
||||
// 品牌页信息
|
||||
public static final String HTTP_TAG_BRAND_URL = HTTP_TAG_HEAD_NEW + "brand/index";
|
||||
|
||||
// 品牌详情页
|
||||
// public static final String HTTP_TAG_BRAND_DETAILS_URL = HTTP_TAG_BRAND_URL + "/pinpaiapp?pid=";
|
||||
public static final String HTTP_TAG_BRAND_DETAILS_URL = HTTP_TAG_HEAD_NEW + "brand/app";
|
||||
|
||||
// 专题页信息
|
||||
public static final String HTTP_TAG_PROJECT_URL = HTTP_TAG_HEAD_NEW + "subject/index";
|
||||
|
||||
// 专题详情页
|
||||
// public static final String HTTP_TAG_PROJECT_DETAILS_URL = HTTP_TAG_PROJECT_URL + "/zhuantiapp?ztid=";
|
||||
public static final String HTTP_TAG_PROJECT_DETAILS_URL = HTTP_TAG_HEAD_NEW + "subject/app";
|
||||
|
||||
|
||||
// 搜索页面
|
||||
public static final String HTTP_TAG_SEARCH_URL = HTTP_TAG_HEAD_NEW + "search/index";
|
||||
// public static final String HTTP_TAG_SEARCH_URL = HTTP_TAG_HEAD + "Soea";
|
||||
|
||||
|
||||
// 下载接口 根据包名匹配 请求后更新下载次数
|
||||
// public static final String HTTP_TAG_DOWNLOAD_URL = HTTP_TAG_HEAD + "Down?baoming=";
|
||||
public static final String HTTP_TAG_DOWNLOAD_URL = HTTP_TAG_HEAD_NEW + "count/index";
|
||||
|
||||
public static final String SEND_DOWNLOAD_FILE_INFO = HTTP_TAG_HEAD_NEW + "app/downloadApp";
|
||||
|
||||
// app详细窗口 相关推荐接口
|
||||
public static final String HTTP_TAG_APPDETAIL_URL = HTTP_TAG_HEAD + "Tuij/xiang?aid=";
|
||||
|
||||
|
||||
// 子系统弹窗接口
|
||||
public static final String HTTP_TAG_APPSTORE_URL = HTTP_TAG_HEAD + "Xitong/zixitongapp?zxtid=";
|
||||
|
||||
// 用户定位接口 post user_name/user_position
|
||||
public static final String HTTP_TAG_POSITION = HTTP_TAG_HEAD + "Position";
|
||||
|
||||
// 获取注册验证码接口 post num
|
||||
public static final String HTTP_TAG_SMSCODE = HTTP_TAG_HEAD + "User/code";
|
||||
|
||||
|
||||
// 用户注册接口 post user_name/user_pwd
|
||||
public static final String HTTP_TAG_USERREGISTER = HTTP_TAG_HEAD + "User";
|
||||
|
||||
|
||||
// 用户登录接口 post user_name/user_pwd
|
||||
public static final String HTTP_TAG_USERLOG = HTTP_TAG_HEAD + "User/tell";
|
||||
|
||||
|
||||
// 修改密码接口 post user_name/user_pwd
|
||||
public static final String HTTP_TAG_CHANGEPWD = HTTP_TAG_HEAD + "User/mima";
|
||||
|
||||
|
||||
// 重置密码接口 post user_name/user_pwd
|
||||
public static final String HTTP_TAG_RESETPWD = HTTP_TAG_HEAD + "User/pwd";
|
||||
|
||||
|
||||
// 家长密码修改接口 post user_name/user_pwd
|
||||
public static final String HTTP_TAG_PARENTPWD = HTTP_TAG_HEAD + "User/jiachang";
|
||||
|
||||
|
||||
// 家长密码找回接口 post user_name/user_pwd
|
||||
public static final String HTTP_TAG_FORGETPARENTPWD = HTTP_TAG_HEAD + "User/zhjcmm";
|
||||
|
||||
|
||||
// 宝宝信息接口 post user_name
|
||||
public static final String HTTP_TAG_BABYINFO = HTTP_TAG_HEAD + "Baob";
|
||||
|
||||
|
||||
// 家长信箱接口 post user_name/xin_file
|
||||
public static final String HTTP_TAG_PARENTMAIL = HTTP_TAG_HEAD + "Xin";
|
||||
|
||||
|
||||
// 学习日志上传接口 post user_name/log_file
|
||||
public static final String HTTP_TAG_LEARNLOG = HTTP_TAG_HEAD + "Log";
|
||||
|
||||
|
||||
// 学习日志下载接口 post user_name
|
||||
public static final String HTTP_TAG_LEARNLOG_DOWNLOAD = HTTP_TAG_HEAD + "Log/dow";
|
||||
|
||||
|
||||
// 学习日志图片上传 post log_head 文件
|
||||
public static final String HTTP_TAG_UPLOADIMAGE = HTTP_TAG_HEAD + "Log/upimg";
|
||||
|
||||
|
||||
// 获取评论
|
||||
// public static final String HTTP_TAG_GET_APP_COMMENTS_REQ = HTTP_TAG_HEAD + "Pinglun/pls";
|
||||
public static final String HTTP_TAG_GET_APP_COMMENTS_REQ = HTTP_TAG_HEAD_NEW + "score/get";
|
||||
|
||||
// 提交评论
|
||||
// public static final String HTTP_TAG_POST_APP_COMMENTS_REQ = HTTP_TAG_HEAD + "Pinglun";
|
||||
public static final String HTTP_TAG_POST_APP_COMMENTS_REQ = HTTP_TAG_HEAD_NEW + "score/set";
|
||||
|
||||
// 激活码接口
|
||||
public static final String HTTP_TAG_USERCODE = HTTP_TAG_HEAD + "Jicode";
|
||||
|
||||
|
||||
// 更新接口
|
||||
public static final String HTTP_TAG_UPDATE = HTTP_TAG_HEAD + "Upapp";
|
||||
|
||||
// 课程表接口 post user_name
|
||||
public static final String HTTP_TAG_COURSETAB = HTTP_TAG_HEAD + "Course";
|
||||
|
||||
|
||||
// 积分上传接口
|
||||
public static final String HTTP_TAG_SETPOINT = HTTP_TAG_HEAD + "/Jifen";
|
||||
|
||||
// 积分获取接口
|
||||
public static final String HTTP_TAG_GETPOINT = HTTP_TAG_HEAD + "Jifen/get";
|
||||
|
||||
|
||||
public static final String HTTP_TAG_FIRST = HTTP_TAG_HEAD_NEW + "lock/index";
|
||||
|
||||
public static final String SEND_DEVICES = HTTP_TAG_HEAD_NEW + "Mac/getMac";
|
||||
|
||||
public static final String SEND_USEDTIME = HTTP_TAG_HEAD_NEW + "Applog/getAppLog";
|
||||
|
||||
public static final String CHECK_UPDATE = HTTP_TAG_HEAD_NEW + "Silent/silent";
|
||||
//更新接口
|
||||
public static final String GET_DEVICES_TAGS = HTTP_TAG_HEAD_NEW + "Sn/getSnTag";
|
||||
//获取设备标签
|
||||
public static final String DELETE_GEDEVICE_ALIAS = HTTP_TAG_HEAD_NEW + "Sn/deleteAliases";
|
||||
//删除Aliases
|
||||
public static final String SET_HOMEPAG_TAG = HTTP_TAG_HEAD_NEW + "Label";
|
||||
//浏览器书签主页设置
|
||||
public static final String SET_APPINSIDEWEB = HTTP_TAG_HEAD_NEW + "Appground";
|
||||
//app内部网页管控
|
||||
public static final String SET_BROWSER_LIST = HTTP_TAG_HEAD_NEW + "browser";
|
||||
//浏览器黑白名单地址
|
||||
public static final String SET_WHITE_PACKAGE_LIST = HTTP_TAG_HEAD_NEW + "firmware/index";
|
||||
//应用白名单
|
||||
public static final String GET_HIDE_DESKTOPICON = HTTP_TAG_HEAD_NEW + "Icon";
|
||||
//获取隐藏桌面图标
|
||||
public final static String NET_AND_LAUNCH_API = HTTP_TAG_HEAD_NEW + "automatic/get";
|
||||
//获取应用升级自启
|
||||
public static final String GET_STUDENTS_INFO = HTTP_TAG_HEAD_NEW + "Sn/getStudent";
|
||||
//通过sn获取信息
|
||||
public static final String SEND_SCREENSHOT = HTTP_TAG_HEAD_NEW + "Screenshot/addImg";
|
||||
//上传截图
|
||||
// public static final String UPDATE_DEVICEINFO = HTTP_TAG_HEAD_NEW + "Mac/getInfo";
|
||||
//上传我的设备
|
||||
public final static String GET_LOCK_SCREEN_STATE = HTTP_TAG_HEAD_NEW + "Sn/getSnScreen";
|
||||
//获取霸屏状态
|
||||
public final static String GET_DESKTOP = HTTP_TAG_HEAD_NEW + "Sn/getSnDesktop";
|
||||
//获取默认桌面升级
|
||||
public final static String GET_SN_TIME_CONTROL = HTTP_TAG_HEAD_NEW + "Sn/getSnTimeControl";
|
||||
//获取时间管控
|
||||
public final static String GET_TOP_APP_CONTROL = HTTP_TAG_HEAD_NEW + "Sn/getSnAppControl";
|
||||
//获取顶部app管控
|
||||
public final static String GET_SN_APP_TEST = HTTP_TAG_HEAD_NEW + "Sn/getSnAppTest";
|
||||
//获取测试app
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user