version:2.0.4
update:修改极光推送appkey fix:手动添加白名单无法安装,删除管控之后tf默认关闭,下载完成上传流量问题,开发者选项默认关闭放在系统设置后面管控 add:
This commit is contained in:
@@ -41,13 +41,13 @@ android {
|
|||||||
//新平台正式
|
//新平台正式
|
||||||
newly {
|
newly {
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
versionCode 503
|
versionCode 504
|
||||||
//versionCode 1037
|
//versionCode 1037
|
||||||
versionName "2.0.3"
|
versionName "2.0.4"
|
||||||
/*********************************极光推送************************************/
|
/*********************************极光推送************************************/
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
|
||||||
JPUSH_APPKEY : "52d81643665bb2cadacf0e9e", //JPush上注册的包名对应的appkey.
|
JPUSH_APPKEY : "20f70bbeb78bad23eddd08d0", //JPush上注册的包名对应的appkey.
|
||||||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||||||
channel_value: "newly"
|
channel_value: "newly"
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ public class DiscardActivity extends AppCompatActivity {
|
|||||||
int first = (int) SPUtils.get(DiscardActivity.this, "first_connect", 0);
|
int first = (int) SPUtils.get(DiscardActivity.this, "first_connect", 0);
|
||||||
//开机第一次管控默认关闭所有功能
|
//开机第一次管控默认关闭所有功能
|
||||||
if (first == 0) {
|
if (first == 0) {
|
||||||
SysSettingUtils.setDisableSetting(DiscardActivity.this);//设置系统管控
|
// SysSettingUtils.setDisableSetting(DiscardActivity.this);//设置系统管控
|
||||||
}
|
}
|
||||||
getLockedState(mHandler);
|
getLockedState(mHandler);
|
||||||
// MyApplication.getInstance().getWhitePackageList();
|
// MyApplication.getInstance().getWhitePackageList();
|
||||||
@@ -490,7 +490,7 @@ public class DiscardActivity extends AppCompatActivity {
|
|||||||
locked = false;
|
locked = false;
|
||||||
boolean se = Settings.System.putInt(DiscardActivity.this.getContentResolver(), "qch_unlock_ipad", 1);
|
boolean se = Settings.System.putInt(DiscardActivity.this.getContentResolver(), "qch_unlock_ipad", 1);
|
||||||
Log.e("ttlocked1", "getLockedState---------" + Settings.System.getString(DiscardActivity.this.getContentResolver(), "qch_unlock_ipad"));
|
Log.e("ttlocked1", "getLockedState---------" + Settings.System.getString(DiscardActivity.this.getContentResolver(), "qch_unlock_ipad"));
|
||||||
SysSettingUtils.setEnableSetting(DiscardActivity.this);
|
// SysSettingUtils.setEnableSetting(DiscardActivity.this);
|
||||||
SPUtils.put(DiscardActivity.this, "first_connect", 1);
|
SPUtils.put(DiscardActivity.this, "first_connect", 1);
|
||||||
Log.e("ttlocked1", "qch_unlock_ipad---------" + locked + se);
|
Log.e("ttlocked1", "qch_unlock_ipad---------" + locked + se);
|
||||||
handler.sendEmptyMessage(-3);
|
handler.sendEmptyMessage(-3);
|
||||||
@@ -1515,14 +1515,14 @@ public class DiscardActivity extends AppCompatActivity {
|
|||||||
try {
|
try {
|
||||||
// Log.e("mjsheng", "systemSettingBean::" + systemSettingBean);
|
// Log.e("mjsheng", "systemSettingBean::" + systemSettingBean);
|
||||||
String responString = responseBody.string();
|
String responString = responseBody.string();
|
||||||
Log.e("mjsheng", "系统管控::" + responString);
|
Log.e("getSystemSetting", "系统管控::" + responString);
|
||||||
JSONObject jsonObject = JSON.parseObject(responString);
|
JSONObject jsonObject = JSON.parseObject(responString);
|
||||||
int code = jsonObject.getInteger("code");
|
int code = jsonObject.getInteger("code");
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
JSONObject data = jsonObject.getJSONObject("data");
|
JSONObject data = jsonObject.getJSONObject("data");
|
||||||
SettingSysData(data);
|
SettingSysData(data);
|
||||||
} else {
|
} else {
|
||||||
Log.e("mjhseng", "getSystemSetting---code is -200");
|
Log.e("getSystemSetting", "getSystemSetting---code is -200");
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -1541,7 +1541,7 @@ public class DiscardActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
private void SettingSysData(JSONObject data) {
|
private void SettingSysData(JSONObject data) {
|
||||||
SPUtils.put(DiscardActivity.this, "first_connect", 1);
|
SPUtils.put(DiscardActivity.this, "first_connect", 1);
|
||||||
SysSettingUtils.setSystemSetting(DiscardActivity.this, data.toString());
|
// SysSettingUtils.setSystemSetting(DiscardActivity.this, data.toString());
|
||||||
|
|
||||||
//// try {
|
//// try {
|
||||||
// int setting_call = changeNum(data.optInt("setting_call"));
|
// int setting_call = changeNum(data.optInt("setting_call"));
|
||||||
|
|||||||
@@ -224,11 +224,6 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getSnTimeControlFinished() {
|
public void getSnTimeControlFinished() {
|
||||||
mPresenter.getDeveloper();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getDeveloperFinished() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,6 +339,11 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSystemSettingFinished() {
|
public void setSystemSettingFinished() {
|
||||||
|
mPresenter.getDeveloper();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getDeveloperFinished() {
|
||||||
mPresenter.setLogoImg();
|
mPresenter.setLogoImg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ public class MainContact {
|
|||||||
void updateDeviceInfoFinished();
|
void updateDeviceInfoFinished();
|
||||||
//获取时间管控
|
//获取时间管控
|
||||||
void getSnTimeControlFinished();
|
void getSnTimeControlFinished();
|
||||||
//获取开发者选项结束
|
|
||||||
void getDeveloperFinished();
|
|
||||||
//设置击关推送别名
|
//设置击关推送别名
|
||||||
void setAliasFinished();
|
void setAliasFinished();
|
||||||
//设置极光推送标签
|
//设置极光推送标签
|
||||||
@@ -61,6 +59,8 @@ public class MainContact {
|
|||||||
void setAppinsideWebFinished();
|
void setAppinsideWebFinished();
|
||||||
//获取系统其他管控设置结束
|
//获取系统其他管控设置结束
|
||||||
void setSystemSettingFinished();
|
void setSystemSettingFinished();
|
||||||
|
//获取开发者选项结束
|
||||||
|
void getDeveloperFinished();
|
||||||
//设置开机动画
|
//设置开机动画
|
||||||
void setLogoImgFinished ();
|
void setLogoImgFinished ();
|
||||||
//获取应用霸屏结束
|
//获取应用霸屏结束
|
||||||
@@ -89,8 +89,6 @@ public class MainContact {
|
|||||||
void updateDeviceInfo();
|
void updateDeviceInfo();
|
||||||
//获取时间管控
|
//获取时间管控
|
||||||
void getSnTimeControl();
|
void getSnTimeControl();
|
||||||
//获取开发者选项
|
|
||||||
void getDeveloper();
|
|
||||||
//设置击关推送别名
|
//设置击关推送别名
|
||||||
void setJpushAlias();
|
void setJpushAlias();
|
||||||
//设置极光推送标签
|
//设置极光推送标签
|
||||||
@@ -126,6 +124,8 @@ public class MainContact {
|
|||||||
void setAppinsideWeb();
|
void setAppinsideWeb();
|
||||||
//获取系统其他管控设置
|
//获取系统其他管控设置
|
||||||
void setSystemSetting();
|
void setSystemSetting();
|
||||||
|
//获取开发者选项
|
||||||
|
void getDeveloper();
|
||||||
//设置开机动画
|
//设置开机动画
|
||||||
void setLogoImg();
|
void setLogoImg();
|
||||||
//应用霸屏
|
//应用霸屏
|
||||||
|
|||||||
@@ -528,12 +528,12 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
.subscribe(new Observer<BaseResponse>() {
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
Log.e("checkUpdate", "onSubscribe: ");
|
Log.e("checkUpdateInfo", "onSubscribe: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull BaseResponse response) {
|
public void onNext(@NonNull BaseResponse response) {
|
||||||
Log.e("checkUpdate", "onNext: ");
|
Log.e("checkUpdateInfo", "onNext: ");
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
|
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
|
||||||
long versionCode = jsonObject.get("version_code").getAsLong();
|
long versionCode = jsonObject.get("version_code").getAsLong();
|
||||||
@@ -556,13 +556,13 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(@NonNull Throwable e) {
|
public void onError(@NonNull Throwable e) {
|
||||||
Log.e("checkUpdate", "onError: " + e.getMessage());
|
Log.e("checkUpdateInfo", "onError: " + e.getMessage());
|
||||||
onComplete();
|
onComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
Log.e("checkUpdate", "onComplete: ");
|
Log.e("checkUpdateInfo", "onComplete: ");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -628,16 +628,16 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull ResponseBody responseBody) {
|
public void onNext(@NonNull ResponseBody responseBody) {
|
||||||
Log.e("getAppLimit", "onNext: ");
|
|
||||||
try {
|
try {
|
||||||
String bodyString = responseBody.string();
|
String bodyString = responseBody.string();
|
||||||
|
Log.e("getAppLimit", "onNext: " + bodyString);
|
||||||
JsonObject jsonObject = JsonParser.parseString(bodyString).getAsJsonObject();
|
JsonObject jsonObject = JsonParser.parseString(bodyString).getAsJsonObject();
|
||||||
int code = jsonObject.get("code").getAsInt();
|
int code = jsonObject.get("code").getAsInt();
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
String data = jsonObject.get("data").getAsJsonObject().get("result").getAsString();
|
String data = jsonObject.get("data").getAsJsonObject().get("result").getAsString();
|
||||||
|
//开机图标
|
||||||
boolean write = Settings.System.putString(mContext.getContentResolver(), "only_jgy_shortcut_list", data);
|
boolean write = Settings.System.putString(mContext.getContentResolver(), "only_jgy_shortcut_list", data);
|
||||||
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||||
//开机图标
|
|
||||||
JGYUtils.getInstance().writeAppPackageList(mContext, data);
|
JGYUtils.getInstance().writeAppPackageList(mContext, data);
|
||||||
mView.getAppLimitFinished(data);
|
mView.getAppLimitFinished(data);
|
||||||
} else {
|
} else {
|
||||||
@@ -694,9 +694,9 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
// 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);
|
||||||
@@ -1236,7 +1236,8 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
String data = jsonObject.getAsJsonObject("data").toString();
|
String data = jsonObject.getAsJsonObject("data").toString();
|
||||||
JGYUtils.getInstance().SettingSysData(data);
|
JGYUtils.getInstance().SettingSysData(data);
|
||||||
} else {
|
} else {
|
||||||
Log.e("setSystemSetting", "onNext: " + bodyString);
|
// SysSettingUtils.setDisableSetting(mContext);
|
||||||
|
Settings.System.putInt(mContext.getContentResolver(), "qch_Developeroptions", 1);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -1259,6 +1260,42 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getDeveloper() {
|
||||||
|
NetInterfaceManager.getInstance().getDeveloperControl()
|
||||||
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
Log.e("getDeveloper", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(BaseResponse baseResponse) {
|
||||||
|
Log.e("getDeveloper", "onNext: ");
|
||||||
|
if (baseResponse.code == 200) {
|
||||||
|
JSONObject jsonObject = (JSONObject) JSON.toJSON(baseResponse.data);
|
||||||
|
int is_developer = jsonObject.getInteger("is_developer");
|
||||||
|
//后台1是0否 底层0是1否
|
||||||
|
JGYUtils.getInstance().setDeveloperOptions(is_developer == 0 ? 1 : 0);
|
||||||
|
} else {
|
||||||
|
JGYUtils.getInstance().setDeveloperOptions(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
Log.e("getDeveloper", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
mView.getDeveloperFinished();
|
||||||
|
Log.e("getDeveloper", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setLogoImg() {
|
public void setLogoImg() {
|
||||||
if (JGYUtils.isOfficialVersion()) {
|
if (JGYUtils.isOfficialVersion()) {
|
||||||
@@ -1346,43 +1383,6 @@ public class MainPresenter implements MainContact.Presenter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getDeveloper() {
|
|
||||||
NetInterfaceManager.getInstance().getDeveloperControl()
|
|
||||||
.subscribe(new Observer<BaseResponse>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
Log.e("getDeveloper", "onSubscribe: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(BaseResponse baseResponse) {
|
|
||||||
Log.e("getDeveloper", "onNext: ");
|
|
||||||
if (baseResponse.code == 200) {
|
|
||||||
JSONObject jsonObject = (JSONObject) JSON.toJSON(baseResponse.data);
|
|
||||||
int is_developer = jsonObject.getInteger("is_developer");
|
|
||||||
//后台1是0否 底层0是1否
|
|
||||||
JGYUtils.getInstance().setDeveloperOptions(is_developer == 0 ? 1 : 0);
|
|
||||||
} else {
|
|
||||||
JGYUtils.getInstance().setDeveloperOptions(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
Log.e("getDeveloper", "onError: " + e.getMessage());
|
|
||||||
onComplete();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
mView.getDeveloperFinished();
|
|
||||||
Log.e("getDeveloper", "onComplete: ");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getScreenLockState() {
|
public void getScreenLockState() {
|
||||||
int locked = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", -1);
|
int locked = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", -1);
|
||||||
|
|||||||
@@ -499,34 +499,6 @@ public class BaseApplication extends MultiDexApplication {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized public void getWhitePackageList() {
|
|
||||||
OkGo.post(URLAddress.SET_WHITE_PACKAGE_LIST)
|
|
||||||
.params("sn", Utils.getSerial())
|
|
||||||
.params("key", NetInterfaceManager.HTTP_KEY)
|
|
||||||
.execute(new StringCallback() {
|
|
||||||
@Override
|
|
||||||
public void onSuccess(String s, Call call, Response response) {
|
|
||||||
com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(s);
|
|
||||||
int code = jsonObject.getInteger("code");
|
|
||||||
String msg = jsonObject.getString("msg");
|
|
||||||
String data = jsonObject.getString("data");
|
|
||||||
if (code == 200) {
|
|
||||||
com.alibaba.fastjson.JSONObject resultJson = JSON.parseObject(data);
|
|
||||||
String result = resultJson.getString("result");
|
|
||||||
// writeAppPackageList(result);
|
|
||||||
// setAPPUsage(allList);
|
|
||||||
} else {
|
|
||||||
// setAPPUsage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Call call, Response response, Exception e) {
|
|
||||||
super.onError(call, response, e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public void uncaughtException(Thread thread, Throwable ex) {
|
// public void uncaughtException(Thread thread, Throwable ex) {
|
||||||
//// Log.e(TAG, ex.getMessage(), new Exception(ex));
|
//// Log.e(TAG, ex.getMessage(), new Exception(ex));
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ public class TagAliasOperatorHelper {
|
|||||||
setActionCache.remove(sequence);
|
setActionCache.remove(sequence);
|
||||||
String logs = getActionStr(tagAliasBean.action)+" tags success";
|
String logs = getActionStr(tagAliasBean.action)+" tags success";
|
||||||
Logger.i(TAG,logs);
|
Logger.i(TAG,logs);
|
||||||
Log.e("fht","Tag绑定成功");
|
Log.e(TAG,"Tag绑定成功");
|
||||||
ExampleUtil.showToast(logs, context);
|
ExampleUtil.showToast(logs, context);
|
||||||
}else{
|
}else{
|
||||||
String logs = "Failed to " + getActionStr(tagAliasBean.action)+" tags";
|
String logs = "Failed to " + getActionStr(tagAliasBean.action)+" tags";
|
||||||
@@ -294,7 +294,7 @@ public class TagAliasOperatorHelper {
|
|||||||
setActionCache.remove(sequence);
|
setActionCache.remove(sequence);
|
||||||
String logs = getActionStr(tagAliasBean.action)+" alias success";
|
String logs = getActionStr(tagAliasBean.action)+" alias success";
|
||||||
Logger.i(TAG,logs);
|
Logger.i(TAG,logs);
|
||||||
Log.e("fht","Alias绑定成功");
|
Log.e(TAG,"Alias绑定成功");
|
||||||
ExampleUtil.showToast(logs, context);
|
ExampleUtil.showToast(logs, context);
|
||||||
}else{
|
}else{
|
||||||
String logs = "Failed to " + getActionStr(tagAliasBean.action)+" alias, errorCode:" + jPushMessage.getErrorCode();
|
String logs = "Failed to " + getActionStr(tagAliasBean.action)+" alias, errorCode:" + jPushMessage.getErrorCode();
|
||||||
|
|||||||
@@ -16,7 +16,10 @@ import android.util.Log;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONException;
|
import com.alibaba.fastjson.JSONException;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
import com.mjsheng.myappstore.bean.BrowserData;
|
import com.mjsheng.myappstore.bean.BrowserData;
|
||||||
|
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||||
import com.mjsheng.myappstore.utils.URLUtils;
|
import com.mjsheng.myappstore.utils.URLUtils;
|
||||||
import com.lzy.okgo.OkGo;
|
import com.lzy.okgo.OkGo;
|
||||||
import com.lzy.okgo.callback.StringCallback;
|
import com.lzy.okgo.callback.StringCallback;
|
||||||
@@ -57,6 +60,7 @@ import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_SET;
|
|||||||
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
|
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
|
||||||
|
|
||||||
public class HTTPInterface {
|
public class HTTPInterface {
|
||||||
|
private static final String TAG = HTTPInterface.class.getSimpleName();
|
||||||
// //获取我的设备接口
|
// //获取我的设备接口
|
||||||
// public static synchronized void checkDevicesInfo(final Handler handler) {
|
// public static synchronized void checkDevicesInfo(final Handler handler) {
|
||||||
// OkGo.<String>post(UrlPath.SNINFO)
|
// OkGo.<String>post(UrlPath.SNINFO)
|
||||||
@@ -353,7 +357,7 @@ public class HTTPInterface {
|
|||||||
.execute(new StringCallback() {
|
.execute(new StringCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String s, Call call, Response response) {
|
public void onSuccess(String s, Call call, Response response) {
|
||||||
Log.e("fht", s);
|
Log.e("setJpushTags", s);
|
||||||
com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(s);
|
com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(s);
|
||||||
int code = jsonObject.getInteger("code");
|
int code = jsonObject.getInteger("code");
|
||||||
com.alibaba.fastjson.JSONObject data = jsonObject.getJSONObject("data");
|
com.alibaba.fastjson.JSONObject data = jsonObject.getJSONObject("data");
|
||||||
@@ -1071,5 +1075,52 @@ public class HTTPInterface {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void getAppLimit(Context context) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getAppLimitObservable()
|
||||||
|
.subscribe(new Observer<ResponseBody>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Log.e("getAppLimit", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull ResponseBody responseBody) {
|
||||||
|
try {
|
||||||
|
String bodyString = responseBody.string();
|
||||||
|
Log.e("getAppLimit", "onNext: " + bodyString);
|
||||||
|
JsonObject jsonObject = JsonParser.parseString(bodyString).getAsJsonObject();
|
||||||
|
int code = jsonObject.get("code").getAsInt();
|
||||||
|
if (code == 200) {
|
||||||
|
String data = jsonObject.get("data").getAsJsonObject().get("result").getAsString();
|
||||||
|
//开机图标
|
||||||
|
boolean write = Settings.System.putString(context.getContentResolver(), "only_jgy_shortcut_list", data);
|
||||||
|
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||||
|
JGYUtils.getInstance().writeAppPackageList(context, data);
|
||||||
|
} else {
|
||||||
|
boolean write = Settings.System.putString(context.getContentResolver(), "only_jgy_shortcut_list", "");
|
||||||
|
Settings.System.putString(context.getContentResolver(), "qch_app_forbid", " ");
|
||||||
|
Log.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||||
|
Log.e("getAppLimit", "onNext: " + bodyString);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Log.e("getAppLimit", "onNext: IOException: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Log.e("getAppLimit", "onError: " + e.getMessage());
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("getAppLimit", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -180,7 +180,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
String extras = bundle.getString(JPushInterface.EXTRA_EXTRA);
|
String extras = bundle.getString(JPushInterface.EXTRA_EXTRA);
|
||||||
String package_name = bundle.getString("package_name");
|
String package_name = bundle.getString("package_name");
|
||||||
|
|
||||||
Log.e("mjsheng", "message::" + message + "--type::" + type + "--title::" + title + "--extras::" + extras);
|
Log.e(TAG, "message::" + message + "--type::" + type + "--title::" + title + "--extras::" + extras);
|
||||||
// ToastUtils.showShort("message::" + message + "--type::" + type + "--title::" + title + "--extras::" + extras + "---package_name:" + package_name);
|
// ToastUtils.showShort("message::" + message + "--type::" + type + "--title::" + title + "--extras::" + extras + "---package_name:" + package_name);
|
||||||
// Toast.makeText(context, "message::" + message + "--type::" + type + "--title::" + title + "--extras::" + extras + "---package_name:" + package_name, Toast.LENGTH_SHORT).show();
|
// Toast.makeText(context, "message::" + message + "--type::" + type + "--title::" + title + "--extras::" + extras + "---package_name:" + package_name, Toast.LENGTH_SHORT).show();
|
||||||
switch (message) {
|
switch (message) {
|
||||||
@@ -204,8 +204,8 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
break;
|
break;
|
||||||
case MSG_SETTING:
|
case MSG_SETTING:
|
||||||
if (!TextUtils.isEmpty(extras)) {
|
if (!TextUtils.isEmpty(extras)) {
|
||||||
SettingSysData(extras);
|
JGYUtils.getInstance().SettingSysData(extras);
|
||||||
Log.e(TAG, "title--------" + extras);
|
// Log.e(TAG, "title--------" + extras);
|
||||||
}
|
}
|
||||||
// getSystemSetting();
|
// getSystemSetting();
|
||||||
break;
|
break;
|
||||||
@@ -253,7 +253,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
file.mkdirs();
|
file.mkdirs();
|
||||||
}
|
}
|
||||||
if (TextUtils.isEmpty(extras)) {
|
if (TextUtils.isEmpty(extras)) {
|
||||||
Log.e("mjsheng", "settingNetControl extras is null");
|
Log.e(TAG, "settingNetControl extras is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject extra = JSON.parseObject(extras);
|
JSONObject extra = JSON.parseObject(extras);
|
||||||
@@ -403,7 +403,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
private BluetoothAdapter mBluetoothAdapter;
|
private BluetoothAdapter mBluetoothAdapter;
|
||||||
|
|
||||||
private void SettingSysData(String extras) {
|
private void SettingSysData(String extras) {
|
||||||
SysSettingUtils.setSystemSetting(mContext, extras);
|
// SysSettingUtils.setSystemSetting(mContext, extras);
|
||||||
// try {
|
// try {
|
||||||
// JSONObject data = new JSONObject(extras);
|
// JSONObject data = new JSONObject(extras);
|
||||||
// int setting_call = changeNum(data.optInt("setting_call"));
|
// int setting_call = changeNum(data.optInt("setting_call"));
|
||||||
@@ -644,7 +644,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
file.mkdirs();
|
file.mkdirs();
|
||||||
}
|
}
|
||||||
if (TextUtils.isEmpty(jsonString)) {
|
if (TextUtils.isEmpty(jsonString)) {
|
||||||
Log.e("mjsheng", "doDownloadAndInstall extras is null");
|
Log.e(TAG, "doDownloadAndInstall extras is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject jSONObject = JSON.parseObject(jsonString);
|
JSONObject jSONObject = JSON.parseObject(jsonString);
|
||||||
@@ -710,14 +710,14 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable param1Throwable) {
|
public void onError(Throwable param1Throwable) {
|
||||||
Log.e("mjsheng", "getAppLimitApi=onError:");
|
Log.e(TAG, "getAppLimitApi=onError:");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(ResponseBody param1ResponseBody) {
|
public void onNext(ResponseBody param1ResponseBody) {
|
||||||
try {
|
try {
|
||||||
String str2 = param1ResponseBody.string();
|
String str2 = param1ResponseBody.string();
|
||||||
Log.e("mjsheng", str2);
|
Log.e(TAG, str2);
|
||||||
JSONObject jSONObject = JSON.parseObject(str2);
|
JSONObject jSONObject = JSON.parseObject(str2);
|
||||||
JSONObject data = jSONObject.getJSONObject("data");
|
JSONObject data = jSONObject.getJSONObject("data");
|
||||||
String result = "";
|
String result = "";
|
||||||
@@ -855,18 +855,18 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
// Network.getDeselectBrowserIDApi().getDeselectBrowserIDApi("YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=", Utils.getSerial()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<ResponseBody>() {
|
// Network.getDeselectBrowserIDApi().getDeselectBrowserIDApi("YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=", Utils.getSerial()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<ResponseBody>() {
|
||||||
// public void onComplete() {
|
// public void onComplete() {
|
||||||
// Log.e("mjsheng", "getDeselectBrowerID---onComplete");
|
// Log.e(TAG, "getDeselectBrowerID---onComplete");
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public void onError(Throwable param1Throwable) {
|
// public void onError(Throwable param1Throwable) {
|
||||||
// Log.e("mjsheng", "getDeselectBrowerID=onError:");
|
// Log.e(TAG, "getDeselectBrowerID=onError:");
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public void onNext(ResponseBody param1ResponseBody) {
|
// public void onNext(ResponseBody param1ResponseBody) {
|
||||||
// try {
|
// try {
|
||||||
// String str1;
|
// String str1;
|
||||||
// String str2 = param1ResponseBody.string();
|
// String str2 = param1ResponseBody.string();
|
||||||
// Log.e("mjsheng", "DeselectBrowserIDApi::" + str2);
|
// Log.e(TAG, "DeselectBrowserIDApi::" + str2);
|
||||||
// JSONObject jSONObject = new JSONObject(str2);
|
// JSONObject jSONObject = new JSONObject(str2);
|
||||||
// switch (Integer.valueOf(jSONObject.optInt("code")).intValue()) {
|
// switch (Integer.valueOf(jSONObject.optInt("code")).intValue()) {
|
||||||
// case 200:
|
// case 200:
|
||||||
@@ -874,17 +874,17 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
// writeDeselectBrowserIDtoSystem(str1);
|
// writeDeselectBrowserIDtoSystem(str1);
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// Log.e("mjsheng", "getDeselectBrowerID---code is -200");
|
// Log.e(TAG, "getDeselectBrowerID---code is -200");
|
||||||
// return;
|
// return;
|
||||||
// } catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
// Log.e("mjsheng", "getDeselectBrowerID---wroing----" + e.getMessage());
|
// Log.e(TAG, "getDeselectBrowerID---wroing----" + e.getMessage());
|
||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// public void onSubscribe(Disposable param1Disposable) {
|
// public void onSubscribe(Disposable param1Disposable) {
|
||||||
// Log.e("mjsheng", "getDeselectBrowerID---onSubscribe");
|
// Log.e(TAG, "getDeselectBrowerID---onSubscribe");
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
@@ -971,7 +971,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
Intent intent = new Intent("qch_camera_forbid").setPackage("com.android.settings");
|
Intent intent = new Intent("qch_camera_forbid").setPackage("com.android.settings");
|
||||||
intent.putExtra("camera_package_name", "close");
|
intent.putExtra("camera_package_name", "close");
|
||||||
this.mContext.sendBroadcast(intent);
|
this.mContext.sendBroadcast(intent);
|
||||||
Log.e("mjsheng", "settingNetControl extras is null");
|
Log.e(TAG, "settingNetControl extras is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject jSONObject = JSON.parseObject(s);
|
JSONObject jSONObject = JSON.parseObject(s);
|
||||||
@@ -992,7 +992,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
private void settingOneNet(String s) {
|
private void settingOneNet(String s) {
|
||||||
if (TextUtils.isEmpty(s)) {
|
if (TextUtils.isEmpty(s)) {
|
||||||
Log.e("mjsheng", "settingNetControl extras is null");
|
Log.e(TAG, "settingNetControl extras is null");
|
||||||
// return;
|
// return;
|
||||||
}
|
}
|
||||||
JSONObject jSONObject = JSON.parseObject(s);
|
JSONObject jSONObject = JSON.parseObject(s);
|
||||||
@@ -1004,7 +1004,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
private void settingNetControl(String s) {
|
private void settingNetControl(String s) {
|
||||||
if (TextUtils.isEmpty(s)) {
|
if (TextUtils.isEmpty(s)) {
|
||||||
Log.e("mjsheng", "settingNetControl extras is null");
|
Log.e(TAG, "settingNetControl extras is null");
|
||||||
// return;
|
// return;
|
||||||
}
|
}
|
||||||
JSONObject jSONObject = JSON.parseObject(s);
|
JSONObject jSONObject = JSON.parseObject(s);
|
||||||
@@ -1041,13 +1041,13 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
private void settingPowerOn(String s) {
|
private void settingPowerOn(String s) {
|
||||||
if (TextUtils.isEmpty(s)) {
|
if (TextUtils.isEmpty(s)) {
|
||||||
Log.e("mjsheng", "settingNetControlAndPowerOn extras is null");
|
Log.e(TAG, "settingNetControlAndPowerOn extras is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject jSONObject = JSON.parseObject(s);
|
JSONObject jSONObject = JSON.parseObject(s);
|
||||||
String ban = jSONObject.getString("ban");
|
String ban = jSONObject.getString("ban");
|
||||||
String not = jSONObject.getString("not");
|
String not = jSONObject.getString("not");
|
||||||
Log.e("mjsheng", "settingPowerOn" + not);
|
Log.e(TAG, "settingPowerOn" + not);
|
||||||
Settings.System.putString(this.mContext.getContentResolver(), "qch_app_power_on", not);
|
Settings.System.putString(this.mContext.getContentResolver(), "qch_app_power_on", not);
|
||||||
Log.e("SystemSetting", "qch_app_power_on---------" + not);
|
Log.e("SystemSetting", "qch_app_power_on---------" + not);
|
||||||
}
|
}
|
||||||
@@ -1060,7 +1060,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
Log.e("SystemSetting", "DeselectBrowserArray---------" + bool);
|
Log.e("SystemSetting", "DeselectBrowserArray---------" + bool);
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// Log.e("mjsheng", "writeDeselectBrowserIDtoSystem is null:");
|
// Log.e(TAG, "writeDeselectBrowserIDtoSystem is null:");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setHomepagtag(String s) {
|
private void setHomepagtag(String s) {
|
||||||
@@ -1068,7 +1068,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
HTTPInterface.setHomepagtag(mContext);//设置主页和标签
|
HTTPInterface.setHomepagtag(mContext);//设置主页和标签
|
||||||
|
|
||||||
// if (TextUtils.isEmpty(s)) {
|
// if (TextUtils.isEmpty(s)) {
|
||||||
// Log.e("mjsheng", "setHomepagtag extras is null");
|
// Log.e(TAG, "setHomepagtag extras is null");
|
||||||
//
|
//
|
||||||
// return;
|
// return;
|
||||||
// } else {
|
// } else {
|
||||||
@@ -1089,7 +1089,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
//禁止app内部网页访问,包名用,隔开
|
//禁止app内部网页访问,包名用,隔开
|
||||||
HTTPInterface.setAppinsideWeb(mContext);//app内部网页管控
|
HTTPInterface.setAppinsideWeb(mContext);//app内部网页管控
|
||||||
// if (TextUtils.isEmpty(s)) {
|
// if (TextUtils.isEmpty(s)) {
|
||||||
// Log.e("mjsheng", "setAPPinsideWebsite extras is null");
|
// Log.e(TAG, "setAPPinsideWebsite extras is null");
|
||||||
//
|
//
|
||||||
// return;
|
// return;
|
||||||
// } else {
|
// } else {
|
||||||
@@ -1125,7 +1125,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
// Log.e("SystemSetting", "deselectViewArray---------" + s1);
|
// Log.e("SystemSetting", "deselectViewArray---------" + s1);
|
||||||
// return;
|
// return;
|
||||||
// } else {
|
// } else {
|
||||||
// Log.e("mjsheng", "writeDeselectIDtoSystem is null:");
|
// Log.e(TAG, "writeDeselectIDtoSystem is null:");
|
||||||
// Settings.System.putString(this.mContext.getContentResolver(), "DeselectViewArray", "Invalid");
|
// Settings.System.putString(this.mContext.getContentResolver(), "DeselectViewArray", "Invalid");
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@@ -1137,7 +1137,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
|||||||
*/
|
*/
|
||||||
public void settingLock(String s) {
|
public void settingLock(String s) {
|
||||||
if (TextUtils.isEmpty(s)) {
|
if (TextUtils.isEmpty(s)) {
|
||||||
Log.e("mjsheng", "settingLock extras is null");
|
Log.e(TAG, "settingLock extras is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject jSONObject = JSON.parseObject(s);
|
JSONObject jSONObject = JSON.parseObject(s);
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class DiscardServer extends Service {
|
|||||||
HTTPInterface.getNetAndLaunchSetting(this);
|
HTTPInterface.getNetAndLaunchSetting(this);
|
||||||
int first = (int) SPUtils.get(this, "first_connect", 0);
|
int first = (int) SPUtils.get(this, "first_connect", 0);
|
||||||
if (first == 0) {
|
if (first == 0) {
|
||||||
SysSettingUtils.setDisableSetting(this);//设置系统管控
|
// SysSettingUtils.setDisableSetting(this);//设置系统管控
|
||||||
}
|
}
|
||||||
timerImitate();
|
timerImitate();
|
||||||
// getNetworkState();
|
// getNetworkState();
|
||||||
@@ -1162,7 +1162,7 @@ public class DiscardServer extends Service {
|
|||||||
if (lock == 0) {
|
if (lock == 0) {
|
||||||
locked = false;
|
locked = false;
|
||||||
boolean se = Settings.System.putInt(getContentResolver(), "qch_unlock_ipad", 1);
|
boolean se = Settings.System.putInt(getContentResolver(), "qch_unlock_ipad", 1);
|
||||||
SysSettingUtils.setEnableSetting(DiscardServer.this);
|
// SysSettingUtils.setEnableSetting(DiscardServer.this);
|
||||||
SPUtils.put(DiscardServer.this, "first_connect", 1);
|
SPUtils.put(DiscardServer.this, "first_connect", 1);
|
||||||
Log.e("fht", "getLockedState---------" + Settings.System.getString(getContentResolver(), "qch_unlock_ipad"));
|
Log.e("fht", "getLockedState---------" + Settings.System.getString(getContentResolver(), "qch_unlock_ipad"));
|
||||||
Log.e("jpttlocked1", "qch_unlock_ipad---------" + locked + se);
|
Log.e("jpttlocked1", "qch_unlock_ipad---------" + locked + se);
|
||||||
@@ -1240,7 +1240,7 @@ public class DiscardServer extends Service {
|
|||||||
|
|
||||||
private void SettingSysData(JSONObject data) {
|
private void SettingSysData(JSONObject data) {
|
||||||
SPUtils.put(this, "first_connect", 1);
|
SPUtils.put(this, "first_connect", 1);
|
||||||
SysSettingUtils.setSystemSetting(this, data.toString());
|
// SysSettingUtils.setSystemSetting(this, data.toString());
|
||||||
|
|
||||||
// try {
|
// try {
|
||||||
// int setting_call = changeNum(data.optInt("setting_call"));
|
// int setting_call = changeNum(data.optInt("setting_call"));
|
||||||
|
|||||||
@@ -35,11 +35,13 @@ import com.arialyy.aria.core.Aria;
|
|||||||
import com.arialyy.aria.core.download.DownloadEntity;
|
import com.arialyy.aria.core.download.DownloadEntity;
|
||||||
import com.arialyy.aria.core.task.DownloadTask;
|
import com.arialyy.aria.core.task.DownloadTask;
|
||||||
import com.mjsheng.myappstore.manager.AmapManager;
|
import com.mjsheng.myappstore.manager.AmapManager;
|
||||||
|
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||||
import com.mjsheng.myappstore.network.api.newapi.GetLockStateApi;
|
import com.mjsheng.myappstore.network.api.newapi.GetLockStateApi;
|
||||||
import com.mjsheng.myappstore.receiver.BootReceiver;
|
import com.mjsheng.myappstore.receiver.BootReceiver;
|
||||||
import com.mjsheng.myappstore.receiver.NewAppReceiver;
|
import com.mjsheng.myappstore.receiver.NewAppReceiver;
|
||||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||||
import com.mjsheng.myappstore.utils.NetworkUtils;
|
import com.mjsheng.myappstore.utils.NetworkUtils;
|
||||||
|
import com.mjsheng.myappstore.utils.SPUtils;
|
||||||
import com.mjsheng.myappstore.utils.XAPKUtils;
|
import com.mjsheng.myappstore.utils.XAPKUtils;
|
||||||
import com.lzy.okgo.OkGo;
|
import com.lzy.okgo.OkGo;
|
||||||
import com.lzy.okgo.callback.StringCallback;
|
import com.lzy.okgo.callback.StringCallback;
|
||||||
@@ -48,7 +50,6 @@ import com.mjsheng.myappstore.base.BaseApplication;
|
|||||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
||||||
import com.mjsheng.myappstore.network.URLAddress;
|
import com.mjsheng.myappstore.network.URLAddress;
|
||||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||||
import com.mjsheng.myappstore.utils.SPUtils;
|
|
||||||
import com.mjsheng.myappstore.utils.ServiceAliveUtils;
|
import com.mjsheng.myappstore.utils.ServiceAliveUtils;
|
||||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||||
import com.mjsheng.myappstore.utils.Utils;
|
import com.mjsheng.myappstore.utils.Utils;
|
||||||
@@ -123,7 +124,7 @@ public class GuardService extends Service {
|
|||||||
startService(new Intent(this, StepService.class));
|
startService(new Intent(this, StepService.class));
|
||||||
startService(new Intent(this, GuardService.class));
|
startService(new Intent(this, GuardService.class));
|
||||||
}
|
}
|
||||||
registerTimeReceiver();
|
registerPresentReceiver();
|
||||||
registerBatteryReceiver();
|
registerBatteryReceiver();
|
||||||
registerNetworkReceiver();
|
registerNetworkReceiver();
|
||||||
registerNetworkConnectedReceiver();
|
registerNetworkConnectedReceiver();
|
||||||
@@ -200,8 +201,8 @@ public class GuardService extends Service {
|
|||||||
if (null != mNewAppReceiver) {
|
if (null != mNewAppReceiver) {
|
||||||
unregisterReceiver(mNewAppReceiver);
|
unregisterReceiver(mNewAppReceiver);
|
||||||
}
|
}
|
||||||
if (null != screenReceiver) {
|
if (null != presentReceiver) {
|
||||||
unregisterReceiver(screenReceiver);
|
unregisterReceiver(presentReceiver);
|
||||||
}
|
}
|
||||||
if (null != batteryReceiver) {
|
if (null != batteryReceiver) {
|
||||||
unregisterReceiver(batteryReceiver);
|
unregisterReceiver(batteryReceiver);
|
||||||
@@ -308,11 +309,11 @@ public class GuardService extends Service {
|
|||||||
registerReceiver(mNewAppReceiver, filter);
|
registerReceiver(mNewAppReceiver, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScreenReceiver screenReceiver;
|
private PresentReceiver presentReceiver;
|
||||||
|
|
||||||
//监听时间和日期变化
|
//监听亮屏息屏
|
||||||
public void registerTimeReceiver() {
|
public void registerPresentReceiver() {
|
||||||
screenReceiver = new ScreenReceiver();
|
presentReceiver = new PresentReceiver();
|
||||||
IntentFilter filter = new IntentFilter();
|
IntentFilter filter = new IntentFilter();
|
||||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||||
filter.addAction(Intent.ACTION_USER_PRESENT);
|
filter.addAction(Intent.ACTION_USER_PRESENT);
|
||||||
@@ -321,10 +322,10 @@ public class GuardService extends Service {
|
|||||||
filter.addAction(Intent.ACTION_USER_UNLOCKED);
|
filter.addAction(Intent.ACTION_USER_UNLOCKED);
|
||||||
filter.addAction("android.intent.action.FACTORY_RESET");
|
filter.addAction("android.intent.action.FACTORY_RESET");
|
||||||
filter.addAction("android.intent.action.MASTER_CLEAR");
|
filter.addAction("android.intent.action.MASTER_CLEAR");
|
||||||
registerReceiver(screenReceiver, filter);
|
registerReceiver(presentReceiver, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ScreenReceiver extends BroadcastReceiver {
|
public class PresentReceiver extends BroadcastReceiver {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(final Context context, Intent intent) {
|
public void onReceive(final Context context, Intent intent) {
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
@@ -357,6 +358,7 @@ public class GuardService extends Service {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Intent.ACTION_SCREEN_OFF: {
|
case Intent.ACTION_SCREEN_OFF: {
|
||||||
|
HTTPInterface.getAppLimit(GuardService.this);
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
getLockState("1", String.valueOf(time));
|
getLockState("1", String.valueOf(time));
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
@@ -371,7 +373,7 @@ public class GuardService extends Service {
|
|||||||
case "android.intent.action.MASTER_CLEAR":
|
case "android.intent.action.MASTER_CLEAR":
|
||||||
case "android.intent.action.MASTER_CLEAR_NOTIFICATION":
|
case "android.intent.action.MASTER_CLEAR_NOTIFICATION":
|
||||||
case "android.intent.action.FORCE_FACTORY_RESET":
|
case "android.intent.action.FORCE_FACTORY_RESET":
|
||||||
Log.e("ScreenReceiver", "MASTER_CLEAR");
|
Log.e("PresentReceiver", "MASTER_CLEAR");
|
||||||
android.os.Process.killProcess(android.os.Process.myPid());
|
android.os.Process.killProcess(android.os.Process.myPid());
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
break;
|
break;
|
||||||
@@ -512,31 +514,28 @@ public class GuardService extends Service {
|
|||||||
Log.e("taskComplete", "downloadPath::" + filepath);
|
Log.e("taskComplete", "downloadPath::" + filepath);
|
||||||
Log.e("taskComplete", "extendField::" + extendField);
|
Log.e("taskComplete", "extendField::" + extendField);
|
||||||
|
|
||||||
if (filepath.endsWith(".xapk")) {
|
if (filepath.endsWith("apk")) {
|
||||||
XAPKUtils.getInstance().installXAPK(filepath);
|
JSONObject jsonObject = JSON.parseObject(extendField);
|
||||||
Log.e(TAG, "taskComplete: " + filepath);
|
|
||||||
} else {
|
|
||||||
JSONObject jsonObject = JSON.parseObject(task.getExtendField());
|
|
||||||
String app_name = jsonObject.getString("app_name");
|
String app_name = jsonObject.getString("app_name");
|
||||||
String app_package = jsonObject.getString("app_package");
|
String app_package = jsonObject.getString("app_package");
|
||||||
String app_id = jsonObject.getString("app_id");
|
String app_id = jsonObject.getString("app_id");
|
||||||
ToastUtil.show(app_name + "\t:下载完成");
|
ToastUtil.show(app_name + "\t:下载完成");
|
||||||
if (filepath.endsWith(".apk")) {
|
if (filepath.endsWith(".xapk")) {
|
||||||
|
XAPKUtils.getInstance().installXAPK(filepath);
|
||||||
|
Log.e(TAG, "taskComplete: " + filepath);
|
||||||
|
} else if (filepath.endsWith(".apk")) {
|
||||||
new Thread(() -> ApkUtils.installApp(GuardService.this, filepath)).start();
|
new Thread(() -> ApkUtils.installApp(GuardService.this, filepath)).start();
|
||||||
List<DownloadEntity> list = Aria.download(this).getDRunningTask();
|
List<DownloadEntity> list = Aria.download(this).getDRunningTask();
|
||||||
if (list == null || list.size() == 0) {
|
if (list == null || list.size() == 0) {
|
||||||
BaseApplication.getInstance().setDownloadState(false);
|
BaseApplication.getInstance().setDownloadState(false);
|
||||||
Log.e("aria", "isDownloading=" + BaseApplication.getInstance().isDownloading());
|
Log.e("aria", "isDownloading=" + BaseApplication.getInstance().isDownloading());
|
||||||
}
|
}
|
||||||
} else if (filepath.endsWith(".zip")) {
|
|
||||||
Log.e("aria", "下载完成:" + task.getPercent() + ":" + task.getExtendField());
|
|
||||||
JGYUtils.getInstance().setBootanimation(task.getFilePath());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OkGo.post(URLAddress.HTTP_TAG_DOWNLOAD_URL)
|
OkGo.post(URLAddress.HTTP_TAG_DOWNLOAD_URL)
|
||||||
.params("key", NetInterfaceManager.HTTP_KEY)
|
.params("key", NetInterfaceManager.HTTP_KEY)
|
||||||
.params("sn", Utils.getSerial())
|
.params("sn", Utils.getSerial())
|
||||||
.params("package", app_package)
|
.params("package", app_package)
|
||||||
|
.params("app_id", app_id)
|
||||||
.tag(this)
|
.tag(this)
|
||||||
.execute(new StringCallback() {
|
.execute(new StringCallback() {
|
||||||
@Override
|
@Override
|
||||||
@@ -549,14 +548,19 @@ public class GuardService extends Service {
|
|||||||
super.onError(call, response, e);
|
super.onError(call, response, e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
int userId = (int) SPUtils.get(GuardService.this, "admin_id", 0);
|
||||||
|
long app_size = task.getFileSize();
|
||||||
OkGo.post(URLAddress.SEND_DOWNLOAD_FILE_INFO)
|
OkGo.post(URLAddress.SEND_DOWNLOAD_FILE_INFO)
|
||||||
|
.params("key", NetInterfaceManager.HTTP_KEY)
|
||||||
.params("sn", Utils.getSerial())
|
.params("sn", Utils.getSerial())
|
||||||
.params("app_id", app_id)
|
.params("userId", userId)
|
||||||
|
.params("package_name", app_package)
|
||||||
|
.params("app_size", app_size)
|
||||||
.tag(this)
|
.tag(this)
|
||||||
.execute(new StringCallback() {
|
.execute(new StringCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String s, Call call, okhttp3.Response response) {
|
public void onSuccess(String s, Call call, okhttp3.Response response) {
|
||||||
|
Log.e("downloadApp", "onSuccess: " + s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -564,8 +568,10 @@ public class GuardService extends Service {
|
|||||||
super.onError(call, response, e);
|
super.onError(call, response, e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else if (filepath.endsWith(".zip")) {
|
||||||
|
Log.e("aria", "下载完成:" + task.getPercent() + ":" + task.getExtendField());
|
||||||
|
JGYUtils.getInstance().setBootanimation(task.getFilePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Download.onTaskFail
|
@Download.onTaskFail
|
||||||
|
|||||||
@@ -432,11 +432,6 @@ public class MainService extends Service implements MainContact.MainView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getSnTimeControlFinished() {
|
public void getSnTimeControlFinished() {
|
||||||
mPresenter.getDeveloper();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getDeveloperFinished() {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,6 +514,11 @@ public class MainService extends Service implements MainContact.MainView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSystemSettingFinished() {
|
public void setSystemSettingFinished() {
|
||||||
|
mPresenter.getDeveloper();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void getDeveloperFinished() {
|
||||||
mPresenter.setLogoImg();
|
mPresenter.setLogoImg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1004,7 +1004,7 @@ public class ApkUtils {
|
|||||||
Log.e("addShortcut", "addShortcut: " + result);
|
Log.e("addShortcut", "addShortcut: " + result);
|
||||||
String[] stringList = result.split(",");
|
String[] stringList = result.split(",");
|
||||||
List<String> packages = new ArrayList<>(Arrays.asList(stringList));
|
List<String> packages = new ArrayList<>(Arrays.asList(stringList));
|
||||||
String installedList = "";
|
StringBuilder installedListBuilder = new StringBuilder();
|
||||||
for (String s : packages) {
|
for (String s : packages) {
|
||||||
if ("com.jiaoguanyi.store".equals(s) || "com.jiaoguanyi.appstore".equals(s)) {
|
if ("com.jiaoguanyi.store".equals(s) || "com.jiaoguanyi.appstore".equals(s)) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1013,14 +1013,13 @@ public class ApkUtils {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// ApkUtils.getStartActivityName(context, s);
|
// ApkUtils.getStartActivityName(context, s);
|
||||||
installedList += s + ",";
|
if (installedListBuilder.length() > 0) {
|
||||||
Log.e("addShortcut", s);
|
installedListBuilder.append(",");
|
||||||
}
|
}
|
||||||
if (installedList.length() != 0) {
|
installedListBuilder.append(s);
|
||||||
installedList = installedList.substring(0, installedList.length() - 1);
|
Log.e("addShortcut", "packages: " + s);
|
||||||
} else {
|
|
||||||
Log.e("addShortcut", installedList);
|
|
||||||
}
|
}
|
||||||
|
String installedList = installedListBuilder.toString();
|
||||||
boolean qch_force_app = Settings.System.putString(context.getContentResolver(), "qch_launcher_icon_app", installedList);
|
boolean qch_force_app = Settings.System.putString(context.getContentResolver(), "qch_launcher_icon_app", installedList);
|
||||||
// String old = Settings.System.getString(context.getContentResolver(), "qch_launcher_icon_app");
|
// String old = Settings.System.getString(context.getContentResolver(), "qch_launcher_icon_app");
|
||||||
// Log.e("addShortcut", old);
|
// Log.e("addShortcut", old);
|
||||||
|
|||||||
@@ -447,14 +447,15 @@ public class JGYUtils {
|
|||||||
this.add("com.uiuios.jgy2");
|
this.add("com.uiuios.jgy2");
|
||||||
}};
|
}};
|
||||||
// if (!TextUtils.isEmpty(stringBuilder)) {
|
// if (!TextUtils.isEmpty(stringBuilder)) {
|
||||||
for (String pkg : packages) {
|
for (String pkg : packages) {
|
||||||
if (!packageList.contains(pkg)) {
|
if (!packageList.contains(pkg)) {
|
||||||
stringBuilder.append(",");
|
stringBuilder.append(",");
|
||||||
stringBuilder.append(pkg);
|
stringBuilder.append(pkg);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
boolean b = Settings.System.putString(mContext.getContentResolver(), "qch_app_forbid", stringBuilder.toString());
|
}
|
||||||
Log.e("writeAppPackageList: ", "qch_app_forbid is :" + b + Settings.System.getString(mContext.getContentResolver(), "qch_app_forbid"));
|
boolean b = Settings.System.putString(mContext.getContentResolver(), "qch_app_forbid", stringBuilder.toString());
|
||||||
|
Log.e(TAG, "writeAppPackageList: " + stringBuilder.toString());
|
||||||
|
Log.e("writeAppPackageList: ", "qch_app_forbid is :" + b + " " + Settings.System.getString(mContext.getContentResolver(), "qch_app_forbid"));
|
||||||
// } else {
|
// } else {
|
||||||
// Log.e("writeAppPackageList: ", "writeAppPackageList is null:");
|
// Log.e("writeAppPackageList: ", "writeAppPackageList is null:");
|
||||||
// }
|
// }
|
||||||
@@ -654,8 +655,7 @@ public class JGYUtils {
|
|||||||
if (ApkUtils.canremove_systemapp.contains(packageName)) {
|
if (ApkUtils.canremove_systemapp.contains(packageName)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ("com.jiaoguanyi.appstore".equals(packageName)
|
if ("com.jiaoguanyi.appstore".equals(packageName) || "com.jiaoguanyi.store".equals(packageName)
|
||||||
|| "com.jiaoguanyi.store".equals(packageName)
|
|
||||||
) {
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,11 @@ public class SysSettingUtils {
|
|||||||
// sendBroadcast(otgIntent);
|
// sendBroadcast(otgIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param context 关闭所有功能
|
||||||
|
*/
|
||||||
public static void setDisableSetting(Context context) {
|
public static void setDisableSetting(Context context) {
|
||||||
|
Log.e("setDisableSetting", "Close all settings: ");
|
||||||
setPhoneList(context, 1);
|
setPhoneList(context, 1);
|
||||||
setUSBstate(context, 1);
|
setUSBstate(context, 1);
|
||||||
setBluetooth(context, 1);
|
setBluetooth(context, 1);
|
||||||
@@ -79,6 +83,9 @@ public class SysSettingUtils {
|
|||||||
JGYUtils.getInstance().setDeveloperOptions(1);
|
JGYUtils.getInstance().setDeveloperOptions(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param context 开启所有功能
|
||||||
|
*/
|
||||||
public static void setEnableSetting(Context context) {
|
public static void setEnableSetting(Context context) {
|
||||||
setPhoneList(context, 0);
|
setPhoneList(context, 0);
|
||||||
// setUSBstate(context,0);
|
// setUSBstate(context,0);
|
||||||
|
|||||||
Reference in New Issue
Block a user