update:2020.5.11

fix:优化app内部网页管控
add:
This commit is contained in:
2020-05-11 18:34:39 +08:00
parent fbe3acd02b
commit eaa86225aa
11 changed files with 263 additions and 109 deletions

View File

@@ -9,17 +9,17 @@ def releaseTime() {
} }
android { android {
compileSdkVersion 26 compileSdkVersion 29
defaultConfig { defaultConfig {
applicationId "com.jiaoguanyi.appstore" applicationId "com.jiaoguanyi.appstore"
minSdkVersion 15 minSdkVersion 20
targetSdkVersion 26 targetSdkVersion 29
versionCode 125 versionCode 127
versionName "2.8.2"//测试jiaoguanyi.cn versionName "2.8.4"//测试jiaoguanyi.cn
// versionCode 125 // versionCode 126
// versionName "2.0.0.5"// 正式jiaoguanyi.com 双数正式 单数测试 // versionName "2.0.0.6"// 正式jiaoguanyi.com 双数正式 单数测试
multiDexEnabled true multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

View File

@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.os.Handler; import android.os.Handler;
import android.os.Looper;
import android.os.Message; import android.os.Message;
import android.support.multidex.MultiDexApplication; import android.support.multidex.MultiDexApplication;
import android.util.Log; import android.util.Log;
@@ -63,7 +64,9 @@ import uk.co.chrisjenx.calligraphy.CalligraphyConfig;
* Created by Administrator on 2016/2/17 0017. * Created by Administrator on 2016/2/17 0017.
*/ */
public class MyApplication extends MultiDexApplication implements Thread.UncaughtExceptionHandler { //public class MyApplication extends MultiDexApplication implements Thread.UncaughtExceptionHandler {
public class MyApplication extends MultiDexApplication {
public static String userName = null; public static String userName = null;
private static final String TAG = "--MyApplication--"; private static final String TAG = "--MyApplication--";
public static Context context; public static Context context;
@@ -117,7 +120,7 @@ public class MyApplication extends MultiDexApplication implements Thread.Uncaugh
JPushInterface.init(this); JPushInterface.init(this);
context = getApplicationContext(); context = getApplicationContext();
Thread.setDefaultUncaughtExceptionHandler(this); // Thread.setDefaultUncaughtExceptionHandler(this);
mDateFormat = new SimpleDateFormat("HH:mm"); mDateFormat = new SimpleDateFormat("HH:mm");
initOKHttp(); initOKHttp();
@@ -132,6 +135,7 @@ public class MyApplication extends MultiDexApplication implements Thread.Uncaugh
NetStateChangeReceiver.registerReceiver(this); NetStateChangeReceiver.registerReceiver(this);
ToastUtil.init(this); ToastUtil.init(this);
catchException();
} }
@@ -437,25 +441,50 @@ public class MyApplication extends MultiDexApplication implements Thread.Uncaugh
} }
private void catchException() {
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@Override @Override
public void uncaughtException(Thread thread, Throwable ex) { public void uncaughtException(Thread t, Throwable e) {
Log.e(TAG, ex.getMessage(), new Exception(ex)); Log.d("捕获异常子线程:", Thread.currentThread().getName() +
Utils.showToast(this, "程序出现异常,即将退出。。。"); "在:" + e.getStackTrace()[0].getClassName());
}
}
);
//下面是新增方法!
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
while (true) {
try { try {
Thread.sleep(3000); Looper.loop(); //会先执行这个方法,然后在执行下面的异常捕获方法!
} catch (InterruptedException e) { } catch (Exception e) {
Log.d("捕获异常主线程:", Thread.currentThread().getName() + "在:" + e.getStackTrace()[0].getClassName());
e.printStackTrace(); e.printStackTrace();
} }
Intent i = getBaseContext().getPackageManager()
.getLaunchIntentForPackage(getBaseContext().getPackageName());
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
//退出程序
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(1);
} }
}
});
}
// @Override
// public void uncaughtException(Thread thread, Throwable ex) {
//// Log.e(TAG, ex.getMessage(), new Exception(ex));
//// Utils.showToast(this, "程序出现异常,即将退出。。。");
//// try {
//// Thread.sleep(3000);
//// } catch (InterruptedException e) {
//// e.printStackTrace();
//// }
//// Intent i = getBaseContext().getPackageManager()
//// .getLaunchIntentForPackage(getBaseContext().getPackageName());
//// i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
//// startActivity(i);
//// //退出程序
//// android.os.Process.killProcess(android.os.Process.myPid());
//// System.exit(1);
//
// }
@Override @Override
public void onTerminate() { public void onTerminate() {

View File

@@ -488,8 +488,12 @@ public class MainActivity extends AppCompatActivity implements NetStateChangeObs
locked = true; locked = true;
Settings.System.putInt(getApplicationContext().getContentResolver(), "qch_unlock_ipad", 0); Settings.System.putInt(getApplicationContext().getContentResolver(), "qch_unlock_ipad", 0);
Log.e("ttlocked2", "qch_unlock_ipad---------" + locked); Log.e("ttlocked2", "qch_unlock_ipad---------" + locked);
String ss = Settings.System.getString(getApplicationContext().getContentResolver(), "DeselectBrowserArray");
Log.e("ttlocked2", "DeselectBrowserArray---------" + ss); String a = Settings.System.getString(getApplicationContext().getContentResolver(), "DeselectBrowserArray");
Log.e("ttlocked2", "DeselectBrowserArray---------" + a);
String b = Settings.System.getString(getApplicationContext().getContentResolver(), "qch_webblack_url");
Log.e("ttlocked2", "qch_webblack_url---------" + b);
lazyLoading(); lazyLoading();
} }
} }
@@ -510,12 +514,14 @@ public class MainActivity extends AppCompatActivity implements NetStateChangeObs
.subscribe(new Action1<Long>() { .subscribe(new Action1<Long>() {
@Override @Override
public void call(Long aLong) { public void call(Long aLong) {
getDeselectBrowerID();//浏览器网址管控 // getDeselectBrowerID();//浏览器网址管控
HTTPInterface.setBrowserList(MainActivity.this);//浏览器网址管控
HTTPInterface.setHomepagtag(mContext);//设置主页和标签
HTTPInterface.setAppinsideWeb(MainActivity.this);//app内部网页管控
getDeselectID();//ID管控 getDeselectID();//ID管控
getAppLimitApi();//写入可被安装的包名 getAppLimitApi();//写入可被安装的包名
getAppInfo();//上传APP信息 getAppInfo();//上传APP信息
getSystemSetting();//设置系统管控 getSystemSetting();//设置系统管控
HTTPInterface.setAppinsideWeb(MainActivity.this);//app内部网页管控
getNetAndLaunchSetting();//联网管控 getNetAndLaunchSetting();//联网管控
// Aria.download(this).removeAllTask(true); // Aria.download(this).removeAllTask(true);
getForceDownload();//强制下载apk getForceDownload();//强制下载apk
@@ -639,7 +645,7 @@ public class MainActivity extends AppCompatActivity implements NetStateChangeObs
@Override @Override
public void onError(Throwable e) { public void onError(Throwable e) {
Utils.showToast(getApplicationContext(), "网络出错!"); // Utils.showToast(getApplicationContext(), "网络出错!");
Log.e("mjsheng", "brankPicApi---error----" + e.getMessage()); Log.e("mjsheng", "brankPicApi---error----" + e.getMessage());
} }

View File

@@ -7,12 +7,14 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.provider.Settings;
import android.support.annotation.RequiresApi; import android.support.annotation.RequiresApi;
import android.util.Log; import android.util.Log;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.LogUtils; import com.blankj.utilcode.util.LogUtils;
import com.lzy.okgo.OkGo; import com.lzy.okgo.OkGo;
@@ -339,7 +341,7 @@ public class HTTPInterface {
}); });
} }
synchronized public static void setHomepagtag(Context context) { synchronized public static void setHomepagtag(final Context context) {
OkGo.post(Configure.SET_HOMEPAG_TAG) OkGo.post(Configure.SET_HOMEPAG_TAG)
.params("key", Configure.HTTP_KEY) .params("key", Configure.HTTP_KEY)
.params("sn", Utils.getSerial()) .params("sn", Utils.getSerial())
@@ -353,23 +355,44 @@ public class HTTPInterface {
if (code == 200) { if (code == 200) {
String data = jsonObject.getString("data"); String data = jsonObject.getString("data");
JSONObject jsondata = JSON.parseObject(data); JSONObject jsondata = JSON.parseObject(data);
String homepag = jsondata.getString("homepage"); //主页
String labelpage = jsondata.getString("labelpage"); String homepagURL = jsondata.getString("homepage");
Intent homepag = new Intent("qch_app_brower_homepage");
if (homepagURL != null && !homepagURL.equals("")) {
homepag.putExtra("homepage", homepagURL);
} else {
homepag.putExtra("homepage", " ");
}
context.sendBroadcast(homepag);
//书签
String labelpage = jsondata.getString("labelpage");
Intent websiteBookMark = new Intent("qch_app_brower_website");
if (labelpage != null && !labelpage.equals("")) {
websiteBookMark.putExtra("websiteBookMark", labelpage);
} else {
websiteBookMark.putExtra("websiteBookMark", " ");
}
context.sendBroadcast(websiteBookMark);
} else { } else {
ToastUtil.show(msg); Intent intent1 = new Intent("qch_app_brower_homepage");
intent1.putExtra("homepage", " ");
context.sendBroadcast(intent1);
Intent intent2 = new Intent("qch_app_brower_website");
intent2.putExtra("websiteBookMark", " ");
context.sendBroadcast(intent2);
} }
} catch (Exception e) { } catch (Exception e) {
Log.e("fht", e.getMessage()); Log.e("fht", e.getMessage());
ToastUtil.show("数据错误"); // ToastUtil.show("数据错误");
} }
} }
@Override @Override
public void onError(Call call, Response response, Exception e) { public void onError(Call call, Response response, Exception e) {
super.onError(call, response, e); super.onError(call, response, e);
ToastUtil.show("网络连接失败"); // ToastUtil.show("网络连接失败");
} }
}); });
} }
@@ -390,11 +413,15 @@ public class HTTPInterface {
List<Appground> appgrounds = JSON.parseArray(data, Appground.class); List<Appground> appgrounds = JSON.parseArray(data, Appground.class);
if (appgrounds != null && appgrounds.size() > 0) { if (appgrounds != null && appgrounds.size() > 0) {
String strings = ""; String strings = "";
String packageList = ""; String packageList = "";//单条管控名单
for (Appground appground : appgrounds) { for (Appground appground : appgrounds) {
if (appground.getAddress().equals("")) {
packageList += appground.getPackages() + ","; packageList += appground.getPackages() + ",";
} else {
strings += appground.toString() + ";"; strings += appground.toString() + ";";
} }
}
if (packageList.length() > 0) {
//app内所有的网页禁止 //app内所有的网页禁止
packageList = packageList.substring(0, packageList.length() - 1); packageList = packageList.substring(0, packageList.length() - 1);
//去掉多余的, //去掉多余的,
@@ -402,6 +429,10 @@ public class HTTPInterface {
Intent qch_app_website = new Intent("qch_app_website"); Intent qch_app_website = new Intent("qch_app_website");
qch_app_website.putExtra("package_name", packageList); qch_app_website.putExtra("package_name", packageList);
context.sendBroadcast(qch_app_website); context.sendBroadcast(qch_app_website);
} else {
sendAllweb(context);
}
if (strings.length() > 0) {
//app内单个网页地址禁止打开 //app内单个网页地址禁止打开
strings = strings.substring(0, strings.length() - 1); strings = strings.substring(0, strings.length() - 1);
//去掉多余的; //去掉多余的;
@@ -409,25 +440,87 @@ public class HTTPInterface {
Intent intent = new Intent("qch_app_inside_website"); Intent intent = new Intent("qch_app_inside_website");
intent.putExtra("websitelist", strings); intent.putExtra("websitelist", strings);
context.sendBroadcast(intent); context.sendBroadcast(intent);
} else {
sendwebUrl(context);
}
} }
} else if (code == 400) { } else if (code == 400) {
//列表为空的情况 //列表为空的情况
Intent intent = new Intent("qch_app_website"); sendAllweb(context);
intent.putExtra("package_name", "Invalid"); sendwebUrl(context);
context.sendBroadcast(intent);
// ToastUtil.show(msg); // ToastUtil.show(msg);
Log.e("fht", msg);
} }
} catch (Exception e) { } catch (Exception e) {
Log.e("setAppinsideWeb", e.getMessage()); Log.e("setAppinsideWeb", e.getMessage());
ToastUtil.show("数据错误"); // ToastUtil.show("数据错误");
} }
} }
@Override @Override
public void onError(Call call, Response response, Exception e) { public void onError(Call call, Response response, Exception e) {
super.onError(call, response, e); super.onError(call, response, e);
ToastUtil.show("网络连接失败"); // ToastUtil.show("网络连接失败");
} }
}); });
} }
private static void sendAllweb(Context context) {
Intent intent = new Intent("qch_app_website");
intent.putExtra("package_name", "Invalid");
context.sendBroadcast(intent);
}
private static void sendwebUrl(Context context) {
Intent intent = new Intent("qch_app_inside_website");
intent.putExtra("websitelist", "Invalid");
context.sendBroadcast(intent);
}
//设置浏览器黑白名单
synchronized public static void setBrowserList(final Context context) {
OkGo.post(Configure.SET_BROWSER_LIST)
.params("key", Configure.HTTP_KEY)
.params("sn", Utils.getSerial())
.execute(new StringCallback() {
@Override
public void onSuccess(String s, Call call, Response response) {
try {
JSONObject jsonObject = JSON.parseObject(s);
int code = jsonObject.getInteger("code");
String msg = jsonObject.getString("msg");
if (code == 200) {
JSONObject data = JSON.parseObject(jsonObject.getString("data"));
String white = data.getString("white");
if (white != null && !white.equals("")) {
boolean whiteList = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", white);
Log.e("SystemSetting", "setBrowserList---------" + whiteList);
} else {
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", " ");
}
String black = data.getString("black");
if (black != null && !black.equals("")) {
boolean blackList = Settings.System.putString(context.getContentResolver(), "qch_webblack_url", black);
Log.e("SystemSetting", "setBrowserList---------" + blackList);
} else {
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
}
} else {
Log.e("fht", msg);
}
} catch (JSONException e) {
Log.e("fht", e.getMessage());
}
}
@Override
public void onError(Call call, Response response, Exception e) {
super.onError(call, response, e);
}
});
}
} }

View File

@@ -40,8 +40,10 @@ public class Network {
// public static final String ROOT_URL = "http://www.as.xueshibao.com.cn/api/"; 弃用 // public static final String ROOT_URL = "http://www.as.xueshibao.com.cn/api/"; 弃用
// public static final String ROOT_URL = "https://www.jiaoguanyi.com/api/";//正式 弃用 // public static final String ROOT_URL = "https://www.jiaoguanyi.com/api/";//正式 弃用
// public static final String ROOT_URL = "https://partner.jiaoguanyi.com/api/";//正式 // public static final String ROOT_URL = "https://partner.jiaoguanyi.com/api/";//正式
public static final String ROOT_URL = "http://www.jiaoguanyi.cn/api/";//测试 // public static final String WebsocketURL = "ws://47.107.133.19:1234";
public static final String ROOT_URL = "http://www.jiaoguanyi.cn/api/";//测试
public static final String WebsocketURL = "ws://47.107.133.19:2345";
private static UploadAppInfoApi uploadAppInfoApi; private static UploadAppInfoApi uploadAppInfoApi;
private static DeselectIDApi deselectIDApi; private static DeselectIDApi deselectIDApi;
@@ -216,6 +218,7 @@ public class Network {
Log.e("mjsheng", "systemSettingApi"); Log.e("mjsheng", "systemSettingApi");
return updateApi; return updateApi;
} }
public static NetAndLaunchApi getNetAndLaunchApi() { public static NetAndLaunchApi getNetAndLaunchApi() {
if (netAndLaunchApi == null) { if (netAndLaunchApi == null) {
Retrofit retrofit = new Retrofit.Builder() Retrofit retrofit = new Retrofit.Builder()
@@ -229,6 +232,7 @@ public class Network {
Log.e("mjsheng", "netAndLaunchApi"); Log.e("mjsheng", "netAndLaunchApi");
return netAndLaunchApi; return netAndLaunchApi;
} }
public static ForceDownloadApi getForceDownloadApi() { public static ForceDownloadApi getForceDownloadApi() {
if (forceDownloadApi == null) { if (forceDownloadApi == null) {
Retrofit retrofit = new Retrofit.Builder() Retrofit retrofit = new Retrofit.Builder()

View File

@@ -19,4 +19,5 @@ public class UrlPath {
//获取当前最顶层应用和电量 //获取当前最顶层应用和电量
public final static String SEND_DRIVE_STATE = HOMEPATHRUL + "Online/online"; public final static String SEND_DRIVE_STATE = HOMEPATHRUL + "Online/online";
} }

View File

@@ -24,6 +24,7 @@ import com.mjsheng.myappstore.MyApplication;
import com.mjsheng.myappstore.comm.CommonDatas; import com.mjsheng.myappstore.comm.CommonDatas;
import com.mjsheng.myappstore.network.HTTPInterface; import com.mjsheng.myappstore.network.HTTPInterface;
import com.mjsheng.myappstore.network.Network; import com.mjsheng.myappstore.network.Network;
import com.mjsheng.myappstore.server.InitJpushServer;
import com.mjsheng.myappstore.utils.ApkUtils; import com.mjsheng.myappstore.utils.ApkUtils;
import com.mjsheng.myappstore.utils.MySQLData; import com.mjsheng.myappstore.utils.MySQLData;
import com.mjsheng.myappstore.utils.SaveListUtils; import com.mjsheng.myappstore.utils.SaveListUtils;
@@ -363,40 +364,42 @@ public class MyJPushReceiver extends BroadcastReceiver {
} }
private void getDeselectBrowerID() { private void getDeselectBrowerID() {
Network.getDeselectBrowserIDApi().getDeselectBrowserIDApi("YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=", Utils.getSerial()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<ResponseBody>() { HTTPInterface.setBrowserList(mContext);//浏览器网址管控
public void onComplete() {
Log.e("mjsheng", "getDeselectBrowerID---onComplete");
}
public void onError(Throwable param1Throwable) { // Network.getDeselectBrowserIDApi().getDeselectBrowserIDApi("YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=", Utils.getSerial()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<ResponseBody>() {
Log.e("mjsheng", "getDeselectBrowerID=onError:"); // public void onComplete() {
} // Log.e("mjsheng", "getDeselectBrowerID---onComplete");
// }
public void onNext(ResponseBody param1ResponseBody) { //
try { // public void onError(Throwable param1Throwable) {
String str1; // Log.e("mjsheng", "getDeselectBrowerID=onError:");
String str2 = param1ResponseBody.string(); // }
Log.e("mjsheng", "DeselectBrowserIDApi::" + str2); //
JSONObject jSONObject = new JSONObject(str2); // public void onNext(ResponseBody param1ResponseBody) {
switch (Integer.valueOf(jSONObject.optInt("code")).intValue()) { // try {
case 200: // String str1;
str1 = jSONObject.getJSONObject("data").optString("ids"); // String str2 = param1ResponseBody.string();
writeDeselectBrowserIDtoSystem(str1); // Log.e("mjsheng", "DeselectBrowserIDApi::" + str2);
return; // JSONObject jSONObject = new JSONObject(str2);
} // switch (Integer.valueOf(jSONObject.optInt("code")).intValue()) {
Log.e("mjsheng", "getDeselectBrowerID---code is -200"); // case 200:
return; // str1 = jSONObject.getJSONObject("data").optString("ids");
} catch (Exception e) { // writeDeselectBrowserIDtoSystem(str1);
Log.e("mjsheng", "getDeselectBrowerID---wroing----" + e.getMessage()); // return;
e.printStackTrace(); // }
return; // Log.e("mjsheng", "getDeselectBrowerID---code is -200");
} // return;
} // } catch (Exception e) {
// Log.e("mjsheng", "getDeselectBrowerID---wroing----" + e.getMessage());
public void onSubscribe(Disposable param1Disposable) { // e.printStackTrace();
Log.e("mjsheng", "getDeselectBrowerID---onSubscribe"); // return;
} // }
}); // }
//
// public void onSubscribe(Disposable param1Disposable) {
// Log.e("mjsheng", "getDeselectBrowerID---onSubscribe");
// }
// });
} }
@@ -708,7 +711,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
private void setHomepagtag(String s) { private void setHomepagtag(String s) {
//设置主页和标签 //设置主页和标签
HTTPInterface.setHomepagtag(mContext); HTTPInterface.setHomepagtag(mContext);//设置主页和标签
// if (TextUtils.isEmpty(s)) { // if (TextUtils.isEmpty(s)) {
// Log.e("mjsheng", "setHomepagtag extras is null"); // Log.e("mjsheng", "setHomepagtag extras is null");
@@ -730,7 +733,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
private void setAPPinsideWebsite(String s) { private void setAPPinsideWebsite(String s) {
//禁止app内部网页访问包名用,隔开 //禁止app内部网页访问包名用,隔开
HTTPInterface.setAppinsideWeb(mContext); HTTPInterface.setAppinsideWeb(mContext);//app内部网页管控
// if (TextUtils.isEmpty(s)) { // if (TextUtils.isEmpty(s)) {
// Log.e("mjsheng", "setAPPinsideWebsite extras is null"); // Log.e("mjsheng", "setAPPinsideWebsite extras is null");
// //

View File

@@ -22,6 +22,7 @@ import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback; import com.lzy.okgo.callback.StringCallback;
import com.mjsheng.myappstore.BuildConfig; import com.mjsheng.myappstore.BuildConfig;
import com.mjsheng.myappstore.MyApplication; import com.mjsheng.myappstore.MyApplication;
import com.mjsheng.myappstore.activity.MainActivity;
import com.mjsheng.myappstore.bean.ForceDownloadBean; import com.mjsheng.myappstore.bean.ForceDownloadBean;
import com.mjsheng.myappstore.bean.ForceDownloadData; import com.mjsheng.myappstore.bean.ForceDownloadData;
import com.mjsheng.myappstore.bean.NetAndLaunchBean; import com.mjsheng.myappstore.bean.NetAndLaunchBean;
@@ -692,13 +693,16 @@ public class InitJpushServer extends Service {
Log.e("jpttlocked2", "DeselectBrowserArray---------" + ss); Log.e("jpttlocked2", "DeselectBrowserArray---------" + ss);
getAppLimitApi(); getAppLimitApi();
getDeselectID(); getDeselectID();
getDeselectBrowerID(); // getDeselectBrowerID();
getNetAndLaunchSetting(); getNetAndLaunchSetting();
// Aria.download(this).removeAllTask(true); // Aria.download(this).removeAllTask(true);
getForceDownload(); getForceDownload();
getSystemSetting();//从后台获取功能状态 getSystemSetting();//从后台获取功能状态
resetDevice(); resetDevice();
HTTPInterface.setAppinsideWeb(InitJpushServer.this); HTTPInterface.setBrowserList(InitJpushServer.this);//浏览器网址管控
HTTPInterface.setAppinsideWeb(InitJpushServer.this);//app内部网页管控
HTTPInterface.setHomepagtag(InitJpushServer.this);//设置主页和标签
} }
} }
} }

View File

@@ -24,6 +24,7 @@ import com.mjsheng.myappstore.KeepAliveConnection;
import com.mjsheng.myappstore.MyApplication; import com.mjsheng.myappstore.MyApplication;
import com.mjsheng.myappstore.bean.AppDateInfo; import com.mjsheng.myappstore.bean.AppDateInfo;
import com.mjsheng.myappstore.bean.FileData; import com.mjsheng.myappstore.bean.FileData;
import com.mjsheng.myappstore.network.Network;
import com.mjsheng.myappstore.utils.ApkUtils; import com.mjsheng.myappstore.utils.ApkUtils;
import com.mjsheng.myappstore.utils.ServiceAliveUtils; import com.mjsheng.myappstore.utils.ServiceAliveUtils;
import com.mjsheng.myappstore.utils.Utils; import com.mjsheng.myappstore.utils.Utils;
@@ -110,7 +111,7 @@ public class StepService extends Service {
* 初始化websocket连接 * 初始化websocket连接
*/ */
private void initSocketClient() { private void initSocketClient() {
URI uri = URI.create("ws://47.107.133.19:1234"); URI uri = URI.create(Network.WebsocketURL);
// URI uri = URI.create("ws://echo.websocket.org"); // URI uri = URI.create("ws://echo.websocket.org");
// URI uri = URI.create("ws://123.207.136.134:9010/ajaxchattest"); // URI uri = URI.create("ws://123.207.136.134:9010/ajaxchattest");
client = new JWebSocketClient(uri) { client = new JWebSocketClient(uri) {

View File

@@ -193,8 +193,8 @@ public class Configure {
public static final String DELETE_GEDEVICE_ALIAS = HTTP_TAG_HEAD_NEW + "Sn/deleteAliases"; public static final String DELETE_GEDEVICE_ALIAS = HTTP_TAG_HEAD_NEW + "Sn/deleteAliases";
//浏览器书签主页设置 //浏览器书签主页设置
public static final String SET_HOMEPAG_TAG = HTTP_TAG_HEAD_NEW + "Label"; public static final String SET_HOMEPAG_TAG = HTTP_TAG_HEAD_NEW + "Label";
// //app内部网页管控
public static final String SET_APPINSIDEWEB = HTTP_TAG_HEAD_NEW + "Appground"; public static final String SET_APPINSIDEWEB = HTTP_TAG_HEAD_NEW + "Appground";
//浏览器黑白名单地址
public static final String SET_BROWSER_LIST = HTTP_TAG_HEAD_NEW + "browser";
} }

View File

@@ -685,11 +685,24 @@ public class Utils {
* *
* @return * @return
*/ */
@SuppressLint("MissingPermission")
public static String getSerial() { public static String getSerial() {
return Build.SERIAL; String serial = "unknow";
// return "QNS3AI000111"; try {
// return "QNW8WJ900002"; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {//9.0+
serial = Build.getSerial();
} else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {//8.0+
serial = Build.SERIAL;
} else {//8.0-
Class<?> c = Class.forName("android.os.SystemProperties");
Method get = c.getMethod("get", String.class);
serial = (String) get.invoke(c, "ro.serialno");
}
} catch (Exception e) {
e.printStackTrace();
Log.e("e", "读取设备序列号异常:" + e.toString());
}
return serial;
} }
public static final long A_GB = 1073741824; public static final long A_GB = 1073741824;