update:2019.01.16

fix:修复安装
add:
This commit is contained in:
2020-01-16 18:12:46 +08:00
parent 7164c94e18
commit a781113b30
29 changed files with 10111 additions and 20 deletions

View File

@@ -181,19 +181,19 @@ public class MainActivity extends AppCompatActivity implements NetStateChangeObs
.params("sn", Utils.getSerial())
.params("mac", com.blankj.utilcode.util.DeviceUtils.getMacAddress())
.params("jpush_id", rid)
.params("appstore_version", Utils.getProperty("ro.custom.build.version","获取失败"))
.params("appstore_version", Utils.getProperty("ro.custom.build.version", "获取失败"))
.params("store_version", BuildConfig.VERSION_NAME)
.execute(new StringCallback() {
@Override
public void onSuccess(String s, Call call, Response response) {
com.alibaba.fastjson.JSONObject msgObject = JSON.parseObject(s);
Log.e("fht", "sendMACaddress onSuccess"+s);
Log.e("fht", "sendMACaddress onSuccess" + s);
}
@Override
public void onError(Call call, Response response, Exception e) {
super.onError(call, response, e);
Log.e("fht", "sendMACaddress onError:"+e.getMessage());
Log.e("fht", "sendMACaddress onError:" + e.getMessage());
}
});
@@ -826,9 +826,19 @@ public class MainActivity extends AppCompatActivity implements NetStateChangeObs
}
private void writeAppPackageList(String result) {
String appstore = "com.jiaoguanyi.appstore";
String store = "com.jiaoguanyi.store";
if (!TextUtils.isEmpty(result)) {
LogUtils.e(result);
Settings.System.putString(getContentResolver(), "qch_app_forbid", result);
if (!result.contains(appstore)) {
result = result + "," + appstore;
}
if (!result.contains(store)) {
result = result + "," + store;
}
boolean b = Settings.System.putString(getContentResolver(), "qch_app_forbid", result);
Log.e("mjsheng", "writeAppPackageList is :" + b + Settings.System.getString(getContentResolver(), "qch_app_forbid"));
} else {
Log.e("mjsheng", "writeAppPackageList is null:");

View File

@@ -654,14 +654,22 @@ public class MyJPushReceiver extends BroadcastReceiver {
}
}
private void writeAppPackageList(String s) {
if (!TextUtils.isEmpty(s)) {
LogUtils.e(s);
Settings.System.putString(this.mContext.getContentResolver(), "qch_app_forbid", s);
Log.e("SystemSetting", "qch_app_forbid__________" + Settings.System.getString(this.mContext.getContentResolver(), "qch_app_forbid"));
return;
private void writeAppPackageList(String result) {
String appstore = "com.jiaoguanyi.appstore";
String store = "com.jiaoguanyi.store";
if (!TextUtils.isEmpty(result)) {
LogUtils.e(result);
if (!result.contains(appstore)) {
result = result + "," + appstore;
}
if (!result.contains(store)) {
result = result + "," + store;
}
Settings.System.putString(mContext.getContentResolver(), "qch_app_forbid", result);
} else {
Log.e("mjsheng", "writeAppPackageList is null:");
}
Log.e("mjsheng", "writeAppPackageList is null:");
}
private void writeDeselectBrowserIDtoSystem(String s) {
@@ -675,11 +683,20 @@ public class MyJPushReceiver extends BroadcastReceiver {
}
//应用id管控
private void writeDeselectIDtoSystem(String s1, String s2) {
if (!TextUtils.isEmpty(s1) && !TextUtils.isEmpty(s2)) {
Settings.System.putString(this.mContext.getContentResolver(), "qch_app_forbid", s2);
private void writeDeselectIDtoSystem(String s1, String result) {
if (!TextUtils.isEmpty(s1) && !TextUtils.isEmpty(result)) {
String appstore = "com.jiaoguanyi.appstore";
String store = "com.jiaoguanyi.store";
LogUtils.e(result);
if (!result.contains(appstore)) {
result = result + "," + appstore;
}
if (!result.contains(store)) {
result = result + "," + store;
}
Settings.System.putString(this.mContext.getContentResolver(), "qch_app_forbid", result);
Settings.System.putString(this.mContext.getContentResolver(), "DeselectViewArray", s1);
Log.e("SystemSetting", "qch_app_forbid---------" + s2);
Log.e("SystemSetting", "qch_app_forbid---------" + result);
Log.e("SystemSetting", "deselectViewArray---------" + s1);
return;
}

View File

@@ -99,9 +99,8 @@ public class GuardService extends Service {
if (s != null && !s.contains(packageName)) {
s1 = s + "," + packageName;
Settings.System.putString(getContentResolver(), "qch_app_forbid", s1);
ApkUtils.installApp(GuardService.this, filepath);
}
ApkUtils.installApp(GuardService.this, filepath);
}
}

View File

@@ -344,11 +344,20 @@ public class InitJpushServer extends Service {
}
private void writeAppPackageList(String result) {
String appstore = "com.jiaoguanyi.appstore";
String store = "com.jiaoguanyi.store";
if (!TextUtils.isEmpty(result)) {
LogUtils.e(result);
if (!result.contains(appstore)) {
result = result + "," + appstore;
}
if (!result.contains(store)) {
result = result + ","+ store;
}
Settings.System.putString(getContentResolver(), "qch_app_forbid", result);
} else {
Log.e("mjsheng", "writeAppPackageList is null:");
}
}