1 Commits

Author SHA1 Message Date
01fc196429 version:2.0.1
update:更新不需要获取批次情况也会删除多余app,更新高德地图获取失败的时候返回错误信息
fix:
add:
2021-05-12 18:25:17 +08:00
5 changed files with 63 additions and 62 deletions

View File

@@ -15,10 +15,6 @@ android {
minSdkVersion 24 minSdkVersion 24
targetSdkVersion 29 targetSdkVersion 29
//versionCode 105
//versionName "3.1.0"//测试jiaoguanyi.cn
//versionCode 1008
//versionName "2.0.1.8"// 正式jiaoguanyi.com 双数正式 单数测试
multiDexEnabled true multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -45,9 +41,9 @@ android {
//新平台正式 //新平台正式
newly { newly {
flavorDimensions "default" flavorDimensions "default"
versionCode 500 versionCode 501
//versionCode 1037 //versionCode 1037
versionName "2.0.0" versionName "2.0.1"
/*********************************极光推送************************************/ /*********************************极光推送************************************/
manifestPlaceholders = [ manifestPlaceholders = [
JPUSH_PKGNAME: "com.jiaoguanyi.appstore", JPUSH_PKGNAME: "com.jiaoguanyi.appstore",

View File

@@ -280,11 +280,13 @@ public class MainPresenter implements MainContact.Presenter {
} }
@SuppressLint("NewApi") @SuppressLint("NewApi")
private void updateDevicesInfo(Context context) { synchronized private void updateDevicesInfo(Context context) {
String address = String.valueOf(SPUtils.get(context, "AmapAddress", "-")); String address = String.valueOf(SPUtils.get(context, "AmapAddress", "-"));
if ("-".equals(address)) {
address = (String) SPUtils.get(context, "AmapError", "-");
}
String longitude = String.valueOf(SPUtils.get(context, "longitude", "0")); String longitude = String.valueOf(SPUtils.get(context, "longitude", "0"));
String latitude = String.valueOf(SPUtils.get(context, "latitude", "0")); String latitude = String.valueOf(SPUtils.get(context, "latitude", "0"));
JsonObject jsonObject = new JsonObject(); JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("address", address); jsonObject.addProperty("address", address);
jsonObject.addProperty("longitude", longitude); jsonObject.addProperty("longitude", longitude);
@@ -393,7 +395,7 @@ public class MainPresenter implements MainContact.Presenter {
mView.setAliasFinished(); mView.setAliasFinished();
} }
private void SetAlias(){ private void SetAlias() {
TagAliasOperatorHelper.TagAliasBean tagAliasBean = new TagAliasOperatorHelper.TagAliasBean(); TagAliasOperatorHelper.TagAliasBean tagAliasBean = new TagAliasOperatorHelper.TagAliasBean();
tagAliasBean.action = ACTION_SET; tagAliasBean.action = ACTION_SET;
sequence++; sequence++;
@@ -441,7 +443,7 @@ public class MainPresenter implements MainContact.Presenter {
}); });
} }
private void setTag(String batch){ private void setTag(String batch) {
Set set = new HashSet(); Set set = new HashSet();
set.add(batch); set.add(batch);
TagAliasOperatorHelper.TagAliasBean tagAliasBean = new TagAliasOperatorHelper.TagAliasBean(); TagAliasOperatorHelper.TagAliasBean tagAliasBean = new TagAliasOperatorHelper.TagAliasBean();
@@ -663,52 +665,52 @@ public class MainPresenter implements MainContact.Presenter {
} }
int locked = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 1); int locked = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 1);
if (locked == 0) { if (locked == 0) {
NetInterfaceManager.getInstance() // NetInterfaceManager.getInstance()
.getBatchObservable() // .getBatchObservable()
.observeOn(Schedulers.io()) // .observeOn(Schedulers.io())
.subscribe(new Observer<ResponseBody>() { // .subscribe(new Observer<ResponseBody>() {
@Override // @Override
public void onSubscribe(@NonNull Disposable d) { // public void onSubscribe(@NonNull Disposable d) {
Log.e("getDeviceBatch", "onSubscribe: "); // Log.e("getDeviceBatch", "onSubscribe: ");
} // }
//
@Override // @Override
public void onNext(@NonNull ResponseBody responseBody) { // public void onNext(@NonNull ResponseBody responseBody) {
Log.e("getDeviceBatch", "onNext: "); // Log.e("getDeviceBatch", "onNext: ");
try { // try {
String respons = responseBody.string(); // String respons = responseBody.string();
JSONObject jsonObject = JSON.parseObject(respons); // JSONObject jsonObject = JSON.parseObject(respons);
int code = jsonObject.getInteger("code"); // int code = jsonObject.getInteger("code");
if (code == 200) { // if (code == 200) {
String data = jsonObject.getString("data"); // String data = jsonObject.getString("data");
List<Batch> batchList = JSON.parseArray(data, Batch.class); // List<Batch> batchList = JSON.parseArray(data, Batch.class);
if (null != batchList && batchList.size() > 1) { // if (null != batchList && batchList.size() > 1) {
Log.e("getDeviceBatch", "onNext: " + "deleteOtherApp"); // Log.e("getDeviceBatch", "onNext: " + "deleteOtherApp");
if (!BuildConfig.DEBUG) { if (!BuildConfig.DEBUG) {
JGYUtils.getInstance().deleteOtherApp(packageList); JGYUtils.getInstance().deleteOtherApp(packageList);
} }
} else { // } else {
Log.e("getDeviceBatch", "批次为空"); // Log.e("getDeviceBatch", "批次为空");
Log.e("getDeviceBatch", "onNext: respons:" + respons); // Log.e("getDeviceBatch", "onNext: respons:" + respons);
} // }
} // }
} catch (IOException e) { // } catch (IOException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
} // }
//
@Override // @Override
public void onError(@NonNull Throwable e) { // public void onError(@NonNull Throwable e) {
Log.e("getDeviceBatch", "onError: " + e.getMessage()); // Log.e("getDeviceBatch", "onError: " + e.getMessage());
onComplete(); // onComplete();
} // }
//
@Override // @Override
public void onComplete() { // public void onComplete() {
Log.e("getDeviceBatch", "onComplete: "); // Log.e("getDeviceBatch", "onComplete: ");
mView.getDeviceBatchFinished(); // mView.getDeviceBatchFinished();
} // }
}); // });
} }
} }

View File

@@ -69,8 +69,8 @@ public class AmapManager {
sb.append("定位失败" + "\n"); sb.append("定位失败" + "\n");
SPUtils.put(mContext, "AmapError", aMapLocation.getErrorInfo()); SPUtils.put(mContext, "AmapError", aMapLocation.getErrorInfo());
} }
Log.e("AmapAddress", (String) SPUtils.get(mContext, "AmapAddress", "")); Log.e("AmapAddress", (String) SPUtils.get(mContext, "AmapAddress", "-"));
Log.e("AmapError", (String) SPUtils.get(mContext, "AmapError", "")); Log.e("AmapError", (String) SPUtils.get(mContext, "AmapError", "-"));
Log.e("addr", sb.toString()); Log.e("addr", sb.toString());
} }
}); });

View File

@@ -492,11 +492,12 @@ public class HTTPInterface {
//设置浏览器黑白名单 //设置浏览器黑白名单
synchronized public static void setBrowserBlackList(final Context context) { synchronized public static void setBrowserBlackList(final Context context) {
// if (JGYUtils.isOfficialVersion()) { // if (JGYUtils.isOfficialVersion()) {
oldSetBrowserList(context); oldSetBrowserList(context);
// } else { // } else {
// setBrowserList(context); // setBrowserList(context);
// } // }
} }
private static void setBrowserList(Context context) { private static void setBrowserList(Context context) {
NetInterfaceManager.getInstance() NetInterfaceManager.getInstance()
.getBrowserListSettingObservable() .getBrowserListSettingObservable()
@@ -890,8 +891,11 @@ public class HTTPInterface {
} }
@SuppressLint("NewApi") @SuppressLint("NewApi")
public static void updateDeviceInfo(Context context) { synchronized public static void updateDeviceInfo(Context context) {
String address = String.valueOf(SPUtils.get(context, "AmapAddress", "-")); String address = String.valueOf(SPUtils.get(context, "AmapAddress", "-"));
if ("-".equals(address)) {
address = (String) SPUtils.get(context, "AmapError", "-");
}
String longitude = String.valueOf(SPUtils.get(context, "longitude", "0")); String longitude = String.valueOf(SPUtils.get(context, "longitude", "0"));
String latitude = String.valueOf(SPUtils.get(context, "latitude", "0")); String latitude = String.valueOf(SPUtils.get(context, "latitude", "0"));
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
@@ -905,7 +909,7 @@ public class HTTPInterface {
NetInterfaceManager.HTTP_KEY, NetInterfaceManager.HTTP_KEY,
Utils.getMachine(context), Utils.getMachine(context),
Utils.getHardware(context), Utils.getHardware(context),
jsonObject.toJSONString() add
) )
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())

View File

@@ -27,7 +27,6 @@ public class BootReceiver extends BroadcastReceiver {
if (TextUtils.isEmpty(packageList)) { if (TextUtils.isEmpty(packageList)) {
Settings.System.putString(context.getContentResolver(), "qch_launcher_icon_app", ""); Settings.System.putString(context.getContentResolver(), "qch_launcher_icon_app", "");
} }
HTTPInterface.updateDeviceInfo(context);
startService(context); startService(context);
break; break;
case BOOT_COMPLETED: case BOOT_COMPLETED: