version:1.0
update:2021-10-13 18:52:13 fix:去除okgo,rxAndroid1,优化依赖 add:切换到奥乐云平台
This commit is contained in:
25
app/src/main/java/com/aoleyun/sn/action/JGYActions.java
Normal file
25
app/src/main/java/com/aoleyun/sn/action/JGYActions.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.aoleyun.sn.action;
|
||||
|
||||
public class JGYActions {
|
||||
/*
|
||||
* 需要写到底层的数据
|
||||
* */
|
||||
//设备锁定状态
|
||||
public final static String ACTION_QCH_UNLOCK_IPAD = "qch_unlock_ipad";
|
||||
//应用管理-允许联网
|
||||
public final static String ACTION_HR_RECEIVER_JGY = "qch_jgy_network_allow";
|
||||
//应用管理-禁止联网
|
||||
public final static String ACTION_HR_RECEIVER_JGY_DIS = "qch_jgy_network_disallow";
|
||||
//
|
||||
public final static String ACTION_STATUS_BAR_STATUS = "jgy_statusbar_status";
|
||||
//
|
||||
|
||||
/*
|
||||
* 应用内部的数据
|
||||
* */
|
||||
|
||||
//后台上传所有应用包名 将添加到桌面
|
||||
public final static String ACTION_JGY_SHORTCUTLIST = "only_jgy_shortcut_list";
|
||||
|
||||
|
||||
}
|
||||
@@ -1,35 +1,44 @@
|
||||
package com.mjsheng.myappstore.activity;
|
||||
package com.aoleyun.sn.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.StatusBarManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.R;
|
||||
import com.lzy.okgo.model.HttpHeaders;
|
||||
import com.mjsheng.myappstore.base.BaseApplication;
|
||||
import com.mjsheng.myappstore.service.LogcatService;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.mjsheng.myappstore.utils.Logutils;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
import com.mjsheng.myappstore.utils.ServiceAliveUtils;
|
||||
import com.mjsheng.myappstore.utils.StatusBarUtil;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.action.JGYActions;
|
||||
import com.aoleyun.sn.base.BaseApplication;
|
||||
import com.aoleyun.sn.comm.PackageNames;
|
||||
import com.aoleyun.sn.service.LogcatService;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.ServiceAliveUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import cn.jpush.android.api.JPushInterface;
|
||||
|
||||
|
||||
@@ -41,7 +50,17 @@ public class HomeActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
StatusBarUtil.init(this);
|
||||
setBar();
|
||||
setContentView(R.layout.activity_home);
|
||||
initView();
|
||||
debugTest();
|
||||
new Handler().postDelayed(() -> {
|
||||
startActivity(new Intent(HomeActivity.this, MainActivity.class));
|
||||
finish();
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
private void setBar() {
|
||||
UltimateBarX.statusBar(this)
|
||||
.transparent()
|
||||
.colorRes(R.color.colorPrimaryDark)
|
||||
@@ -52,58 +71,43 @@ public class HomeActivity extends AppCompatActivity {
|
||||
.colorRes(R.color.colorPrimaryDark)
|
||||
.light(true)
|
||||
.apply();
|
||||
setContentView(R.layout.activity_home);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
if (BuildConfig.DEBUG) {
|
||||
bt_log = findViewById(R.id.bt_log);
|
||||
bt_log.setVisibility(View.VISIBLE);
|
||||
bt_log.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (!ServiceAliveUtils.isServiceAlive(HomeActivity.this, LogcatService.class.getName())) {
|
||||
startService(new Intent(HomeActivity.this, LogcatService.class));
|
||||
}
|
||||
Intent intent = new Intent(LogcatService.LOGCAT_START_ACTION);
|
||||
sendBroadcast(intent);
|
||||
bt_log.setOnClickListener(view -> {
|
||||
if (!ServiceAliveUtils.isServiceAlive(HomeActivity.this, LogcatService.class.getName())) {
|
||||
startService(new Intent(HomeActivity.this, LogcatService.class));
|
||||
}
|
||||
Intent intent = new Intent(LogcatService.LOGCAT_START_ACTION);
|
||||
sendBroadcast(intent);
|
||||
});
|
||||
bt_stop = findViewById(R.id.bt_stop);
|
||||
bt_stop.setVisibility(View.VISIBLE);
|
||||
bt_stop.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (!ServiceAliveUtils.isServiceAlive(HomeActivity.this, LogcatService.class.getName())) {
|
||||
startService(new Intent(HomeActivity.this, LogcatService.class));
|
||||
}
|
||||
Intent intent = new Intent(LogcatService.LOGCAT_STOP_ACTION);
|
||||
sendBroadcast(intent);
|
||||
bt_stop.setOnClickListener(view -> {
|
||||
if (!ServiceAliveUtils.isServiceAlive(HomeActivity.this, LogcatService.class.getName())) {
|
||||
startService(new Intent(HomeActivity.this, LogcatService.class));
|
||||
}
|
||||
Intent intent = new Intent(LogcatService.LOGCAT_STOP_ACTION);
|
||||
sendBroadcast(intent);
|
||||
});
|
||||
if (BuildConfig.DEBUG) {
|
||||
debugTest();
|
||||
}
|
||||
// return;
|
||||
}
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
startActivity(new Intent(HomeActivity.this, MainActivity.class));
|
||||
finish();
|
||||
}
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
private void debugTest() {
|
||||
if (!BuildConfig.DEBUG) return;
|
||||
// Utils.getHardware(this);
|
||||
// setWebView();
|
||||
// hideStatusBar();
|
||||
Logutils.i(TAG, "DebugTest: " + HttpHeaders.getUserAgent());
|
||||
// boolean qch_force_app = Settings.System.putString(getContentResolver(), "qch_launcher_icon_app", "");
|
||||
Logutils.i(TAG, "DebugTest: qch_launcher_icon_app:" + Settings.System.getString(getContentResolver(), "qch_launcher_icon_app"));
|
||||
Logutils.i(TAG, "DebugTest: qch_hide_NavigationBar: " + Settings.System.getString(getContentResolver(), "qch_hide_NavigationBar"));
|
||||
String only_jgy_shortcut_list = Settings.System.getString(getContentResolver(), "only_jgy_shortcut_list");
|
||||
String only_jgy_shortcut_list = Settings.System.getString(getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
|
||||
Logutils.i(TAG, "debugTest: only_jgy_shortcut_list:" + only_jgy_shortcut_list);
|
||||
String qch_app_forbid = Settings.System.getString(getContentResolver(), "qch_app_forbid");
|
||||
Logutils.i(TAG, "debugTest: qch_app_forbid:" + qch_app_forbid);
|
||||
Logutils.e(TAG, "debugTest: qch_app_forbid:" + qch_app_forbid);
|
||||
Logutils.i(TAG, "debugTest: ip = " + JGYUtils.getInstance().getIPAddress());
|
||||
Logutils.i(TAG, "debugTest: getPackage = " + Utils.getPackage());
|
||||
Logutils.i(TAG, "debugTest: getMacAddress = " + Utils.getAndroid10MAC(this));
|
||||
@@ -128,12 +132,9 @@ public class HomeActivity extends AppCompatActivity {
|
||||
BaseApplication.cleanJpushTag();
|
||||
Logutils.e(TAG, "debugTest: SPUtils all " + SPUtils.getAll(this));
|
||||
|
||||
}
|
||||
|
||||
private void testRxhttp() {
|
||||
// RxHttp.postForm(URLAddress.SET_WHITE_PACKAGE_LIST)
|
||||
// .add("sn", Utils.getSerial())
|
||||
// .
|
||||
PackageManager packageManager = getPackageManager();
|
||||
packageManager.setApplicationEnabledSetting(PackageNames.OLD_DEVICE_INFO, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
packageManager.setApplicationEnabledSetting(PackageNames.OLD_APPSTORE, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@@ -148,28 +149,29 @@ public class HomeActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
private void bootanimotion() {
|
||||
// File file = new File(Environment.getExternalStorageDirectory() + File.separator + "bootanimation.zip");
|
||||
// String path0 = "/data/local/qchmedia/bootanimation.zip";
|
||||
// if (file.exists()) {
|
||||
// File file1 = new File(path0);
|
||||
// if (!file1.exists()) {
|
||||
// file.mkdirs();
|
||||
// try {
|
||||
// file.createNewFile();
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// Logutils.e("bootanimation", e.getMessage());
|
||||
// }
|
||||
// }
|
||||
// Logutils.e("bootanimation", "SD卡路径存在");
|
||||
// try {
|
||||
// Path path = Paths.get(file.getAbsolutePath());
|
||||
// Files.copy(path, new FileOutputStream(path0));
|
||||
// } catch (Exception e) {
|
||||
// Logutils.e("bootanimation", e.getMessage());
|
||||
// }
|
||||
// }
|
||||
File file = new File(Environment.getExternalStorageDirectory() + File.separator + "bootanimation.zip");
|
||||
String path0 = "/data/local/qchmedia/bootanimation.zip";
|
||||
if (file.exists()) {
|
||||
File file1 = new File(path0);
|
||||
if (!file1.exists()) {
|
||||
file.mkdirs();
|
||||
try {
|
||||
file.createNewFile();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Logutils.e("bootanimation", e.getMessage());
|
||||
}
|
||||
}
|
||||
Logutils.e("bootanimation", "SD卡路径存在");
|
||||
try {
|
||||
Path path = Paths.get(file.getAbsolutePath());
|
||||
Files.copy(path, new FileOutputStream(path0));
|
||||
} catch (Exception e) {
|
||||
Logutils.e("bootanimation", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static final String url = "www.baidu.com";
|
||||
@@ -190,7 +192,7 @@ public class HomeActivity extends AppCompatActivity {
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
String realUrl = url;
|
||||
//这个realUrl即为重定向之后的地址
|
||||
//这个realUrl即为重定向之后的地址
|
||||
Logutils.e(TAG, "onPageFinished: " + realUrl);
|
||||
}
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.activity;
|
||||
package com.aoleyun.sn.activity;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -14,7 +14,6 @@ import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
@@ -22,18 +21,18 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.R;
|
||||
import com.mjsheng.myappstore.base.BaseActivity;
|
||||
import com.mjsheng.myappstore.service.MainService;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.ExampleUtil;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.mjsheng.myappstore.utils.Logutils;
|
||||
import com.mjsheng.myappstore.utils.SaveListUtils;
|
||||
import com.mjsheng.myappstore.utils.SysSettingUtils;
|
||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.base.BaseActivity;
|
||||
import com.aoleyun.sn.service.MainService;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.ExampleUtil;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
import com.aoleyun.sn.utils.SaveListUtils;
|
||||
import com.aoleyun.sn.utils.SysSettingUtils;
|
||||
import com.aoleyun.sn.utils.ToastUtil;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -41,13 +40,13 @@ import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import cn.jpush.android.api.JPushInterface;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import rx.Observable;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
|
||||
public class MainActivity extends BaseActivity implements MainContact.MainView, NetworkUtils.OnNetworkStatusChangedListener {
|
||||
private static final String TAG = MainActivity.class.getSimpleName();
|
||||
@@ -94,7 +93,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
||||
public static boolean isForeground = false;
|
||||
//for receive customer msg from jpush server
|
||||
private MessageReceiver mMessageReceiver;
|
||||
public static final String MESSAGE_RECEIVED_ACTION = "com.jiaoguanyi.appstore.MESSAGE_RECEIVED_ACTION";
|
||||
public static final String MESSAGE_RECEIVED_ACTION = "com.aoleyun.sn.MESSAGE_RECEIVED_ACTION";
|
||||
public static final String KEY_TITLE = "title";
|
||||
public static final String KEY_MESSAGE = "message";
|
||||
public static final String KEY_EXTRAS = "extras";
|
||||
@@ -540,7 +539,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView,
|
||||
}
|
||||
};
|
||||
|
||||
io.reactivex.Observable.create(mObservableOnSubscribe)
|
||||
Observable.create(mObservableOnSubscribe)
|
||||
.throttleFirst(10, TimeUnit.SECONDS)
|
||||
//这句很关键,这是RxJava中的操作符,在规定时间内观察者不在接收被观察者发送的事件
|
||||
.subscribe(mObserver);
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mjsheng.myappstore.activity;
|
||||
package com.aoleyun.sn.activity;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.view.View;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mjsheng.myappstore.base.BasePresenter;
|
||||
import com.mjsheng.myappstore.base.BaseView;
|
||||
import com.aoleyun.sn.base.BasePresenter;
|
||||
import com.aoleyun.sn.base.BaseView;
|
||||
|
||||
public class MainContact {
|
||||
public interface Presenter extends BasePresenter<MainView> {
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.mjsheng.myappstore.activity;
|
||||
package com.aoleyun.sn.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.SystemClock;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -13,37 +12,38 @@ import android.view.View;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aoleyun.sn.action.JGYActions;
|
||||
import com.aoleyun.sn.comm.PackageNames;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.base.BaseApplication;
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.BrowserData;
|
||||
import com.mjsheng.myappstore.bean.DefaultApp;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadBean;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadData;
|
||||
import com.mjsheng.myappstore.bean.LogoImg;
|
||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
||||
import com.mjsheng.myappstore.bean.StudentsInfo;
|
||||
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
|
||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||
import com.mjsheng.myappstore.service.MainService;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.AES.CXAESUtil;
|
||||
import com.mjsheng.myappstore.utils.ForegroundAppUtil;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.mjsheng.myappstore.utils.Logutils;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
import com.mjsheng.myappstore.utils.SysSettingUtils;
|
||||
import com.mjsheng.myappstore.utils.TimeUtils;
|
||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||
import com.mjsheng.myappstore.utils.URLUtils;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.base.BaseApplication;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.DefaultApp;
|
||||
import com.aoleyun.sn.bean.ForceDownloadBean;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.bean.LogoImg;
|
||||
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.jpush.TagAliasOperatorHelper;
|
||||
import com.aoleyun.sn.manager.NetInterfaceManager;
|
||||
import com.aoleyun.sn.network.HTTPInterface;
|
||||
import com.aoleyun.sn.service.MainService;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.AES.CXAESUtil;
|
||||
import com.aoleyun.sn.utils.ForegroundAppUtil;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.SysSettingUtils;
|
||||
import com.aoleyun.sn.utils.TimeUtils;
|
||||
import com.aoleyun.sn.utils.ToastUtil;
|
||||
import com.aoleyun.sn.utils.URLUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.trello.rxlifecycle2.LifecycleProvider;
|
||||
import com.trello.rxlifecycle2.android.ActivityEvent;
|
||||
|
||||
@@ -63,8 +63,8 @@ import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.ResponseBody;
|
||||
|
||||
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_SET;
|
||||
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
|
||||
import static com.aoleyun.sn.jpush.TagAliasOperatorHelper.ACTION_SET;
|
||||
import static com.aoleyun.sn.jpush.TagAliasOperatorHelper.sequence;
|
||||
|
||||
/**
|
||||
* MainActivity和MainService 的 Presenter
|
||||
@@ -194,7 +194,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
//如果是解锁状态就隐藏,锁定就显示缓存
|
||||
if (Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 0) == 1) {
|
||||
if (Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0) == 1) {
|
||||
mView.setNumberText("", View.GONE);
|
||||
mView.setNameText("", View.GONE);
|
||||
mView.setClassText("", View.GONE);
|
||||
@@ -258,7 +258,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
|
||||
int locked = jsonObject.get("lock").getAsInt();
|
||||
Logutils.e(TAG + ":" + "getLockedState", "locked: " + locked);
|
||||
int oldState = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 0);
|
||||
int oldState = Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||
Logutils.e(TAG + ":" + "getLockedState", "qch_unlock_ipad: " + oldState);
|
||||
//后台1是锁定,底层0是锁定
|
||||
SPUtils.put(mContext, "first_connect", 1);
|
||||
@@ -267,10 +267,10 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
Logutils.e(TAG + ":" + "getLockedState", "onNext: " + "state changed , reset devices");
|
||||
Utils.doMasterClear(mContext);
|
||||
}
|
||||
Settings.System.putInt(mContext.getContentResolver(), "qch_unlock_ipad", 0);
|
||||
Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||
} else {
|
||||
// SysSettingUtils.setEnableSetting(mContext);
|
||||
Settings.System.putInt(mContext.getContentResolver(), "qch_unlock_ipad", 1);
|
||||
Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 1);
|
||||
}
|
||||
mView.setLockedState(locked == 1);
|
||||
} else if (response.code == -300) {
|
||||
@@ -283,7 +283,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logutils.e(TAG + ":" + "getLockedState", "onError: " + e.getMessage());
|
||||
int locked = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 0);
|
||||
int locked = Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||
Logutils.e(TAG + ":" + "getLockedState", "locked: " + locked);
|
||||
mView.setLockedState(locked == 0);
|
||||
}
|
||||
@@ -387,7 +387,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
jsonObject.addProperty("latitude", latitude);
|
||||
String add = jsonObject.toString();
|
||||
Logutils.e(TAG, "updateDevicesInfo: " + add);
|
||||
NetInterfaceManager.getUpdateDeviceInfo()
|
||||
NetInterfaceManager.getInstance().getUpdateDeviceInfo()
|
||||
.updateDeviceInfo(
|
||||
Utils.getSerial(),
|
||||
NetInterfaceManager.HTTP_KEY,
|
||||
@@ -617,7 +617,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
private void checkUpdateStore() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getUpdateApi()
|
||||
.getUpdate("com.jiaoguanyi.store",
|
||||
.getUpdate(PackageNames.APPSTORE,
|
||||
JGYUtils.getInstance().checkAppPlatform())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@@ -827,19 +827,15 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
if (code == OK) {
|
||||
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(), JGYActions.ACTION_JGY_SHORTCUTLIST, data);
|
||||
Logutils.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||
JGYUtils.getInstance().writeAppPackageList(mContext, data);
|
||||
mView.getAppLimitFinished(data);
|
||||
} else {
|
||||
// mView.getAppLimitFinished("");
|
||||
boolean write = Settings.System.putString(mContext.getContentResolver(), "only_jgy_shortcut_list", " ");
|
||||
boolean write = Settings.System.putString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST, " ");
|
||||
Logutils.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||
Logutils.e(TAG + ":" + "getAppLimit", "onNext: " + bodyString);
|
||||
mView.getAppLimitFinished("");
|
||||
// String oldListString = Settings.System.getString(mContext.getContentResolver(), "qch_app_forbid");
|
||||
// Log.e("getAppLimit", "oldListString: " + oldListString);
|
||||
// mView.getAppLimitFinished(oldListString);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@@ -850,7 +846,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logutils.e(TAG + ":" + "getAppLimit", "onError: " + e.getMessage());
|
||||
String oldListString = Settings.System.getString(mContext.getContentResolver(), "only_jgy_shortcut_list");
|
||||
String oldListString = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
|
||||
Logutils.e(TAG + ":" + "getAppLimit", "oldListString: " + oldListString);
|
||||
mView.getAppLimitFinished(oldListString);
|
||||
}
|
||||
@@ -868,7 +864,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
// mView.getDeviceBatchFinished();
|
||||
// return;
|
||||
// }
|
||||
int locked = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 0);
|
||||
int locked = Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||
Logutils.e(TAG, "getDeviceBatch: " + locked);
|
||||
if (locked == 0) {
|
||||
// NetInterfaceManager.getInstance()
|
||||
@@ -1762,7 +1758,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
return;
|
||||
}
|
||||
lastRunTime = System.currentTimeMillis();
|
||||
int locked = Settings.System.getInt(mContext.getContentResolver(), "qch_unlock_ipad", 0);
|
||||
int locked = Settings.System.getInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, 0);
|
||||
if (JGYUtils.isOfficialVersion() || locked == 1) {
|
||||
mView.setScreenLockStateFinished(false, "");
|
||||
return;
|
||||
@@ -1835,7 +1831,7 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
JGYUtils.getInstance().installDesktop(data);
|
||||
} else {
|
||||
Logutils.e(TAG + ":" + "getDefaultDesktop", "onNext: " + "删除定制桌面");
|
||||
String whiteList = Settings.System.getString(mContext.getContentResolver(), "only_jgy_shortcut_list");
|
||||
String whiteList = Settings.System.getString(mContext.getContentResolver(), JGYActions.ACTION_JGY_SHORTCUTLIST);
|
||||
if (!TextUtils.isEmpty(whiteList)) {
|
||||
if (!whiteList.contains(ApkUtils.desktopAPP.get(0))) {
|
||||
ApkUtils.UninstallAPP(mContext, ApkUtils.desktopAPP.get(0));
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mjsheng.myappstore.activity;
|
||||
package com.aoleyun.sn.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import com.mjsheng.myappstore.R;
|
||||
import com.aoleyun.sn.R;
|
||||
|
||||
public class TopActivity extends AppCompatActivity {
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
package com.mjsheng.myappstore.base;
|
||||
package com.aoleyun.sn.base;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.mjsheng.myappstore.R;
|
||||
import com.mjsheng.myappstore.utils.StatusBarUtil;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;
|
||||
import com.zackratos.ultimatebarx.ultimatebarx.java.UltimateBarX;
|
||||
|
||||
@@ -16,7 +12,14 @@ public abstract class BaseActivity extends RxAppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// StatusBarUtil.init(this);
|
||||
setBar();
|
||||
//状态栏改变放在setContentView前后有所不同
|
||||
setContentView(this.getLayoutId());
|
||||
initView();
|
||||
initData();
|
||||
}
|
||||
|
||||
private void setBar() {
|
||||
UltimateBarX.statusBar(this)
|
||||
.transparent()
|
||||
.colorRes(R.color.colorPrimaryDark)
|
||||
@@ -27,10 +30,6 @@ public abstract class BaseActivity extends RxAppCompatActivity {
|
||||
.colorRes(R.color.colorPrimaryDark)
|
||||
.light(true)
|
||||
.apply();
|
||||
//状态栏改变放在setContentView前后有所不同
|
||||
setContentView(this.getLayoutId());
|
||||
initView();
|
||||
initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.base;
|
||||
package com.aoleyun.sn.base;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.nfc.Tag;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Process;
|
||||
@@ -12,29 +12,25 @@ import androidx.multidex.MultiDexApplication;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.arialyy.aria.core.download.DownloadEntity;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.cache.CacheEntity;
|
||||
import com.lzy.okgo.cache.CacheMode;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.lzy.okgo.cookie.store.PersistentCookieStore;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
|
||||
import com.mjsheng.myappstore.manager.AmapManager;
|
||||
import com.mjsheng.myappstore.manager.FileManager;
|
||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.mjsheng.myappstore.statistics.AppInformation;
|
||||
import com.mjsheng.myappstore.statistics.StatisticsInfo;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.mjsheng.myappstore.utils.Logutils;
|
||||
import com.mjsheng.myappstore.utils.SystemUtils;
|
||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.mjsheng.myappstore.utils.XAPKUtils;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.jpush.TagAliasOperatorHelper;
|
||||
import com.aoleyun.sn.manager.AmapManager;
|
||||
import com.aoleyun.sn.manager.FileManager;
|
||||
import com.aoleyun.sn.manager.NetInterfaceManager;
|
||||
import com.aoleyun.sn.network.HTTPInterface;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
import com.aoleyun.sn.statistics.AppInformation;
|
||||
import com.aoleyun.sn.statistics.StatisticsInfo;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
import com.aoleyun.sn.utils.SystemUtils;
|
||||
import com.aoleyun.sn.utils.ToastUtil;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.aoleyun.sn.utils.XAPKUtils;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -43,7 +39,6 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import cn.jpush.android.api.JPushInterface;
|
||||
import cn.jpush.android.api.JPushMessage;
|
||||
@@ -51,22 +46,21 @@ import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2016/2/17 0017.
|
||||
*/
|
||||
|
||||
//public class MyApplication extends MultiDexApplication implements Thread.UncaughtExceptionHandler {
|
||||
public class BaseApplication extends MultiDexApplication {
|
||||
private static final String TAG = BaseApplication.class.getSimpleName();
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
public static Context context;
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static BaseApplication instance;
|
||||
|
||||
public static Context getAppContext() {
|
||||
@@ -81,7 +75,6 @@ public class BaseApplication extends MultiDexApplication {
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
@@ -108,12 +101,9 @@ public class BaseApplication extends MultiDexApplication {
|
||||
// 设置开启日志,发布时请关闭日志
|
||||
JPushInterface.setDebugMode(true);
|
||||
JPushInterface.requestPermission(this);
|
||||
//解锁设备不需要初始化
|
||||
// 初始化 JPush
|
||||
//JPushInterface.init(this);
|
||||
//解锁设备不需要初始化
|
||||
|
||||
initOKHttp();
|
||||
|
||||
Aria.init(this);
|
||||
Aria.get(this).getDownloadConfig().setMaxTaskNum(1);
|
||||
Aria.get(this).getDownloadConfig().setConvertSpeed(true);
|
||||
@@ -123,7 +113,7 @@ public class BaseApplication extends MultiDexApplication {
|
||||
}
|
||||
// Configuration config = getResources().getConfiguration();
|
||||
// int smallestScreenWidthDp = config.smallestScreenWidthDp;
|
||||
// Logutils.e("mjsheng", "smallestScreenWidthDp=" + smallestScreenWidthDp);
|
||||
// Logutils.e("init", "smallestScreenWidthDp=" + smallestScreenWidthDp);
|
||||
// CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
|
||||
// .setDefaultFontPath("fonts/1234.ttf")
|
||||
// .setDefaultFontPath("fonts/Roboto-RobotoRegular.ttf")
|
||||
@@ -134,6 +124,33 @@ public class BaseApplication extends MultiDexApplication {
|
||||
initTagObservable();
|
||||
}
|
||||
|
||||
private void catchException() {
|
||||
Thread.setDefaultUncaughtExceptionHandler(
|
||||
new Thread.UncaughtExceptionHandler() {
|
||||
@Override
|
||||
public void uncaughtException(Thread t, Throwable e) {
|
||||
Logutils.e("捕获异常子线程:", Thread.currentThread().getName() +
|
||||
"在:" + e.getStackTrace()[0].getClassName());
|
||||
}
|
||||
}
|
||||
);
|
||||
//下面是新增方法!
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
while (true) {
|
||||
try {
|
||||
Looper.loop(); //会先执行这个方法,然后在执行下面的异常捕获方法!
|
||||
} catch (Exception e) {
|
||||
Logutils.e("捕获异常主线程:", Thread.currentThread().getName() + "在:" + e.getStackTrace()[0].getClassName());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void onAliasOperatorResult(JPushMessage jPushMessage) {
|
||||
if (jPushMessage == null) {
|
||||
return;
|
||||
@@ -397,33 +414,6 @@ public class BaseApplication extends MultiDexApplication {
|
||||
void onResult(int code);
|
||||
}
|
||||
|
||||
private void catchException() {
|
||||
Thread.setDefaultUncaughtExceptionHandler(
|
||||
new Thread.UncaughtExceptionHandler() {
|
||||
@Override
|
||||
public void uncaughtException(Thread t, Throwable e) {
|
||||
Logutils.e("捕获异常子线程:", Thread.currentThread().getName() +
|
||||
"在:" + e.getStackTrace()[0].getClassName());
|
||||
}
|
||||
}
|
||||
);
|
||||
//下面是新增方法!
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
while (true) {
|
||||
try {
|
||||
Looper.loop(); //会先执行这个方法,然后在执行下面的异常捕获方法!
|
||||
} catch (Exception e) {
|
||||
Logutils.e("捕获异常主线程:", Thread.currentThread().getName() + "在:" + e.getStackTrace()[0].getClassName());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private boolean finished = false;
|
||||
|
||||
public boolean isFinished() {
|
||||
@@ -434,33 +424,6 @@ public class BaseApplication extends MultiDexApplication {
|
||||
this.finished = b;
|
||||
}
|
||||
|
||||
private void initOKHttp() {
|
||||
//必须调用初始化
|
||||
OkGo.init(this);
|
||||
//以下都不是必须的,根据需要自行选择,一般来说只需要 debug,缓存相关,cookie相关的 就可以了
|
||||
OkGo.getInstance()
|
||||
// 打开该调试开关,打印级别INFO,并不是异常,是为了显眼,不需要就不要加入该行
|
||||
// 最后的true表示是否打印okgo的内部异常,一般打开方便调试错误
|
||||
.debug("OkGo", Level.INFO, true)
|
||||
//如果使用默认的 60秒,以下三行也不需要传
|
||||
// .setConnectTimeout(3000) //全局的连接超时时间
|
||||
// .setReadTimeOut(3000) //全局的读取超时时间
|
||||
// .setWriteTimeOut(3000) //全局的写入超时时间
|
||||
//可以全局统一设置缓存模式,默认是不使用缓存,可以不传,具体其他模式看 github 介绍 https://github.com/jeasonlzy/
|
||||
.setCacheMode(CacheMode.REQUEST_FAILED_READ_CACHE)
|
||||
//可以全局统一设置缓存时间,默认永不过期,具体使用方法看 github 介绍
|
||||
.setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE)
|
||||
//可以全局统一设置超时重连次数,默认为三次,那么最差的情况会请求4次(一次原始请求,三次重连请求),不需要可以设置为0
|
||||
.setRetryCount(4)
|
||||
.setCookieStore(new PersistentCookieStore()) //cookie持久化存储,如果cookie不过期,则一直有效
|
||||
//可以设置https的证书,以下几种方案根据需要自己设置 方法一:信任所有证书,不安全有风险
|
||||
.setCertificates();
|
||||
// com.lzy.okserver.download.DownloadManager downloadManager = DownloadService.getDownloadManager();
|
||||
// downloadManager.setTargetFolder(StorageUtils.getFileRoot(this));
|
||||
// downloadManager.setTargetFolder(PathUtils.getExternalDownloadsPath() + "/jgy/");
|
||||
// downloadManager.getThreadPool().setCorePoolSize(5);
|
||||
}
|
||||
|
||||
public static void sendAppUsedTime(String random, String type) {
|
||||
StatisticsInfo statisticsInfo = null;
|
||||
if (type.equals("0")) {
|
||||
@@ -502,26 +465,39 @@ public class BaseApplication extends MultiDexApplication {
|
||||
} catch (Exception e) {
|
||||
Logutils.e("sendAppUsedTime", e.getMessage());
|
||||
}
|
||||
OkGo.post(URLAddress.SEND_USEDTIME)
|
||||
.params("sn", Utils.getSerial())
|
||||
.params("random", random)
|
||||
.params("data", data.toString())
|
||||
.execute(new StringCallback() {
|
||||
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppLogApi()
|
||||
.getAppLog(Utils.getSerial(), random, data.toJSONString())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSuccess(String s, Call call, Response response) {
|
||||
com.alibaba.fastjson.JSONObject object = JSON.parseObject(s);
|
||||
int code = object.getInteger("code");
|
||||
String msg = object.getString("msg");
|
||||
Logutils.e("fht", "code:" + code + "," + msg);
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("sendAppUsedTime", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Call call, Response response, Exception e) {
|
||||
super.onError(call, response, e);
|
||||
Logutils.e("sendAppUsedTime", e.getMessage());
|
||||
public void onNext(BaseResponse baseResponse) {
|
||||
Log.e("sendAppUsedTime", "onNext: ");
|
||||
int code = baseResponse.code;
|
||||
String msg = baseResponse.msg;
|
||||
Logutils.e("sendAppUsedTime", "onSubscribe:" + msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("sendAppUsedTime", "onError: " + e.getMessage());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("sendAppUsedTime", "onComplete: ");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static long totalTime;
|
||||
@@ -554,85 +530,6 @@ public class BaseApplication extends MultiDexApplication {
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void uncaughtException(Thread thread, Throwable ex) {
|
||||
//// Logutils.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);
|
||||
//
|
||||
// }
|
||||
|
||||
// static List<FileData> fileList = new ArrayList<>();
|
||||
//
|
||||
//
|
||||
// static String packageName = "";
|
||||
//
|
||||
// public void setInstallIngPackageName(String packageNames) {
|
||||
// packageName = packageNames;
|
||||
// Logutils.e("fht", "正在安装:" + packageNames);
|
||||
// }
|
||||
//
|
||||
// public String getInstallIngPackageName() {
|
||||
// return packageName;
|
||||
// }
|
||||
//
|
||||
// public void addFileData(FileData data) {
|
||||
// fileList.add(data);
|
||||
// updateList();
|
||||
// }
|
||||
//
|
||||
// public void removeDate(String packageName) {
|
||||
// if (fileList != null && fileList.size() > 0) {
|
||||
// for (FileData data : fileList) {
|
||||
// if (data.getPackageName().equals(packageName)) {
|
||||
// fileList.remove(data);
|
||||
// break;
|
||||
// } else {
|
||||
// Logutils.e("fht", "not found object");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// setInstallIngPackageName("");
|
||||
// if (fileList.size() > 0) {
|
||||
// updateList();
|
||||
// } else {
|
||||
// Logutils.e("fht", "fileList为空");
|
||||
// setInstallIngPackageName("");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public void updateList() {
|
||||
// if (getInstallIngPackageName().equals("") || ApkUtils.isAvailable(getAppContext(), packageName)) {
|
||||
// if (fileList != null && fileList.size() > 0) {
|
||||
// if (!fileList.get(0).getPackageName().equals("") || ApkUtils.isAvailable(getAppContext(), fileList.get(0).getPackageName())) {
|
||||
// String s = packageName;
|
||||
// ApkUtils.installApp(this, fileList.get(0).getFilePath());
|
||||
// setInstallIngPackageName(fileList.get(0).getPackageName());
|
||||
// } else {
|
||||
// removeDate(fileList.get(0).getPackageName());
|
||||
// Logutils.e("fht", "已安装");
|
||||
// setInstallIngPackageName("");
|
||||
// }
|
||||
// } else {
|
||||
// Logutils.e("fht", "任务为空");
|
||||
// }
|
||||
// } else {
|
||||
// Logutils.e("fht", "安装中:" + packageName);
|
||||
//
|
||||
// }
|
||||
// }
|
||||
boolean isForecDownload = false;
|
||||
|
||||
public boolean isDownloading() {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.base;
|
||||
package com.aoleyun.sn.base;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
4
app/src/main/java/com/aoleyun/sn/base/BaseView.java
Normal file
4
app/src/main/java/com/aoleyun/sn/base/BaseView.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package com.aoleyun.sn.base;
|
||||
|
||||
public interface BaseView {
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2016/10/9.
|
||||
*/
|
||||
public class AppDateInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8954939883956606971L;
|
||||
|
||||
public String id;
|
||||
public String app_name;
|
||||
public String app_package;
|
||||
@@ -144,21 +146,6 @@ public class AppDateInfo implements Serializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AppDateInfo{" +
|
||||
"id='" + id + '\'' +
|
||||
", app_name='" + app_name + '\'' +
|
||||
", app_package='" + app_package + '\'' +
|
||||
", app_version_name='" + app_version_name + '\'' +
|
||||
", app_desc='" + app_desc + '\'' +
|
||||
", app_downloads='" + app_downloads + '\'' +
|
||||
", app_size='" + app_size + '\'' +
|
||||
", app_img='" + app_img + '\'' +
|
||||
", app_url='" + app_url + '\'' +
|
||||
", app_createtime='" + app_createtime + '\'' +
|
||||
", app_score='" + app_score + '\'' +
|
||||
", xitong_id='" + xitong_id + '\'' +
|
||||
", zixitong_id='" + zixitong_id + '\'' +
|
||||
", app_tag='" + app_tag + '\'' +
|
||||
'}';
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -7,6 +7,8 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class AppDownloadInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -7868862477686450613L;
|
||||
|
||||
private String url; //文件URL
|
||||
private String targetPath; //保存文件地址
|
||||
private String fileName; //保存的文件名
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/8/29 13:59
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
public class AppInfoBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4849594429309728182L;
|
||||
|
||||
public class AppInfoBean {
|
||||
private int code;
|
||||
private String msg;
|
||||
private List<AppDateInfo> data;
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AppListInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 9075899098432175779L;
|
||||
|
||||
private long app_version_code;
|
||||
private String app_name;
|
||||
private String app_package;
|
||||
@@ -1,10 +1,18 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/1/10.
|
||||
*/
|
||||
|
||||
public class AppUpdateInfo {
|
||||
public class AppUpdateInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8448660007210869129L;
|
||||
|
||||
private String packageName;
|
||||
private String version;
|
||||
|
||||
@@ -26,9 +34,6 @@ public class AppUpdateInfo {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AppUpdateInfo{" +
|
||||
"packageName='" + packageName + '\'' +
|
||||
", version='" + version + '\'' +
|
||||
'}';
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Appground implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4623189862812297724L;
|
||||
|
||||
private String packages;
|
||||
private String address;
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@@ -14,10 +18,9 @@ public class BaseResponse<T> implements Serializable {
|
||||
public String msg;
|
||||
public T data;
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{" + "code:" + code + "," + "msg:" + msg + "," + "data:" + data + "," + '}';
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Batch implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1762804079800707443L;
|
||||
|
||||
int id;
|
||||
String batch;
|
||||
int admin_id;
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class BrowserBookmarks implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 596864357553413994L;
|
||||
|
||||
private String homepage;
|
||||
private String labelpage;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class BrowserData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5199831572891077086L;
|
||||
|
||||
private String white;
|
||||
private String black;
|
||||
private String white_ip;
|
||||
@@ -1,4 +1,7 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -6,11 +9,13 @@ import java.io.Serializable;
|
||||
* Created by Administrator on 2016/10/10.
|
||||
*/
|
||||
public class CategoryInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1373346057675939423L;
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String img;
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -37,11 +42,7 @@ public class CategoryInfo implements Serializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CategoryInfo{" +
|
||||
"id='" + id + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", img='" + img + '\'' +
|
||||
'}';
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/9/14 10:50
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
public class CategoryPicBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4286518544348292816L;
|
||||
|
||||
public class CategoryPicBean {
|
||||
private int code;
|
||||
private String msg;
|
||||
private List<CategoryInfo> data;
|
||||
@@ -40,10 +40,6 @@ public class CategoryPicBean {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CategoryPicBean{" +
|
||||
"code=" + code +
|
||||
", msg='" + msg + '\'' +
|
||||
", data=" + data +
|
||||
'}';
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
45
app/src/main/java/com/aoleyun/sn/bean/CommonPicBean.java
Normal file
45
app/src/main/java/com/aoleyun/sn/bean/CommonPicBean.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class CommonPicBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6056771155399643320L;
|
||||
|
||||
private int code;
|
||||
private String msg;
|
||||
private List<CommonPicData> data;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public List<CommonPicData> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<CommonPicData> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class CommonPicData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4066453793097764922L;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2016/10/9.
|
||||
*/
|
||||
public class ProjectDateInfo {
|
||||
private String id;
|
||||
private String name;
|
||||
private String img;
|
||||
@@ -70,14 +75,6 @@ public class ProjectDateInfo {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ProjectDateInfo{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", img='" + img + '\'' +
|
||||
", createtime=" + createtime +
|
||||
", status='" + status + '\'' +
|
||||
", admin_id=" + admin_id +
|
||||
", batch='" + batch + '\'' +
|
||||
'}';
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -7,6 +7,8 @@ import java.io.Serializable;
|
||||
*/
|
||||
public class DefaultApp implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8180876443269736350L;
|
||||
|
||||
String default_launcher;
|
||||
String default_browser;
|
||||
String default_videoplayer;
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Expansions implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4958527331079431641L;
|
||||
|
||||
private String file;
|
||||
//包内文件地址
|
||||
private String install_location;
|
||||
45
app/src/main/java/com/aoleyun/sn/bean/ForceDownloadBean.java
Normal file
45
app/src/main/java/com/aoleyun/sn/bean/ForceDownloadBean.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ForceDownloadBean<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5434001463280365686L;
|
||||
|
||||
private int code;
|
||||
private String msg;
|
||||
|
||||
private T data;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2019/3/18 16:39
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
|
||||
public class ForceDownloadData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2965901905485481437L;
|
||||
|
||||
private String app_name;
|
||||
@@ -69,9 +66,6 @@ public class ForceDownloadData implements Serializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ForceDownloadData{" +
|
||||
"app_package='" + app_package + '\'' +
|
||||
", app_url='" + app_url + '\'' +
|
||||
'}';
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
public class LocalAppInfo {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class LocalAppInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7249132627497560565L;
|
||||
|
||||
public static final int DOWNLOAD_STATUS_NORMAL = 0;
|
||||
public static final int DOWNLOAD_STATUS_DOWNLOADING = 1;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/9/18 14:06
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
public class NetAndLaunchBean implements Serializable {
|
||||
|
||||
public class NetAndLaunchBean {
|
||||
|
||||
|
||||
/**
|
||||
* code : 200
|
||||
* msg : ok
|
||||
* data : [{"app_package":"com.mjsheng.news.mycode","is_auto":1,"is_network":0},{"app_package":"com.xueshibaoos","is_auto":0,"is_network":1}]
|
||||
*/
|
||||
private static final long serialVersionUID = -5029848848935111774L;
|
||||
|
||||
private int code;
|
||||
private String msg;
|
||||
@@ -48,10 +40,6 @@ public class NetAndLaunchBean {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NetAndLaunchBean{" +
|
||||
"code=" + code +
|
||||
", msg='" + msg + '\'' +
|
||||
", data=" + data +
|
||||
'}';
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,13 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/9/18 14:06
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
public class NetAndLaunchData {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class NetAndLaunchData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3377827489329306025L;
|
||||
private String app_package;
|
||||
private int is_auto;
|
||||
private int is_network;
|
||||
@@ -69,12 +68,6 @@ public class NetAndLaunchData {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NetAndLaunchData{" +
|
||||
"app_package='" + app_package + '\'' +
|
||||
", is_auto=" + is_auto +
|
||||
", is_network=" + is_network +
|
||||
", is_slide=" + is_slide +
|
||||
", is_upgrade=" + is_upgrade +
|
||||
'}';
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class SplitApks implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6908179385637563352L;
|
||||
|
||||
private String file;
|
||||
private String id;
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class StudentsInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1489445700991359595L;
|
||||
|
||||
private String batch;
|
||||
private String sno;
|
||||
private String realname;
|
||||
@@ -1,16 +1,15 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/9/18 14:06
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
public class SystemSettingData {
|
||||
import java.io.Serializable;
|
||||
|
||||
public class SystemSettingData implements Serializable {
|
||||
|
||||
private int id;
|
||||
private static final long serialVersionUID = 8726058107602873282L;
|
||||
|
||||
private int id;
|
||||
private String bids;
|
||||
private int admin_id;
|
||||
private int createtime;
|
||||
@@ -130,20 +129,6 @@ public class SystemSettingData {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SystemSettingData{" +
|
||||
"id=" + id +
|
||||
", bids='" + bids + '\'' +
|
||||
", admin_id=" + admin_id +
|
||||
", createtime=" + createtime +
|
||||
", setting_call=" + setting_call +
|
||||
", setting_memory=" + setting_memory +
|
||||
", setting_usb='" + setting_usb + '\'' +
|
||||
", setting_bluetooth=" + setting_bluetooth +
|
||||
", setting_navigation=" + setting_navigation +
|
||||
", setting_statusbar=" + setting_statusbar +
|
||||
", setting_phones='" + setting_phones + '\'' +
|
||||
", setting_phone=" + setting_phone +
|
||||
", status='" + status + '\'' +
|
||||
'}';
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class TTAppground implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2071117846816082338L;
|
||||
|
||||
private String packages;
|
||||
private String address;
|
||||
private int type;
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class TimeControl implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -7896263624027994538L;
|
||||
|
||||
String start_time;
|
||||
String end_time;
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/8/7 14:50
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class UploadAppInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1746386760446697855L;
|
||||
|
||||
public class UploadAppInfo {
|
||||
private String package_name;
|
||||
private String app_name;
|
||||
private String install_time;
|
||||
@@ -74,11 +75,6 @@ public class UploadAppInfo {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UploadAppInfo{" +
|
||||
"package_name='" + package_name + '\'' +
|
||||
", app_name='" + app_name + '\'' +
|
||||
", install_time=" + install_time +
|
||||
// ", id=" + id +
|
||||
'}';
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.aoleyun.sn.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class UserInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6411909454407080815L;
|
||||
|
||||
private String id;
|
||||
|
||||
private String sn_value;
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.mjsheng.myappstore.comm;
|
||||
package com.aoleyun.sn.comm;
|
||||
|
||||
|
||||
public class CommonDatas {
|
||||
public final static String SP_BABY_AGE_KEY = "age_system";//子系统选择
|
||||
public final static String SP_PARENT_PASSWORD = "parent_password";//家长密码
|
||||
public final static String IS_RESET = "IS_RESET";
|
||||
public final static int MIN_POWER = 21;
|
||||
public final static String FORCE_INSTALL = "FORCE_INSTALL";
|
||||
19
app/src/main/java/com/aoleyun/sn/comm/PackageNames.java
Normal file
19
app/src/main/java/com/aoleyun/sn/comm/PackageNames.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.aoleyun.sn.comm;
|
||||
|
||||
/**
|
||||
* @author : fanhuitong
|
||||
* e-mail :
|
||||
* @date : 2021/10/1318:07
|
||||
* desc :
|
||||
* version: 1.0
|
||||
*/
|
||||
public class PackageNames {
|
||||
//旧版的应用市场和设备信息包名
|
||||
public static final String OLD_DEVICE_INFO = "com.jiaoguanyi.appstore";
|
||||
public static final String OLD_APPSTORE = "com.jiaoguanyi.store";
|
||||
//应用市场和设备信息包名
|
||||
public static final String DEVICE_INFO = "com.aoleyun.sn";
|
||||
public static final String APPSTORE = "com.aoleyun.appstore";
|
||||
public static final String APP_STORE_BOOTRECEIVER = "com.aoleyun.appstore.receiver.BootReceiver";
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.database;
|
||||
package com.aoleyun.sn.database;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.database;
|
||||
package com.aoleyun.sn.database;
|
||||
|
||||
public class DBSqlBuilder {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.aoleyun.sn.jpush;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.aoleyun.sn.jpush;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.aoleyun.sn.jpush;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.aoleyun.sn.jpush;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mjsheng.myappstore.base.BaseApplication;
|
||||
import com.aoleyun.sn.base.BaseApplication;
|
||||
|
||||
import cn.jpush.android.api.CustomMessage;
|
||||
import cn.jpush.android.api.JPushMessage;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.aoleyun.sn.jpush;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -6,7 +6,7 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mjsheng.myappstore.activity.MainActivity;
|
||||
import com.aoleyun.sn.activity.MainActivity;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.aoleyun.sn.jpush;
|
||||
|
||||
import cn.jpush.android.service.JCommonService;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.aoleyun.sn.jpush;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
@@ -6,8 +6,8 @@ import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import com.mjsheng.myappstore.utils.Logutils;
|
||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
import com.aoleyun.sn.utils.ToastUtil;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.jpush.invalid;
|
||||
package com.aoleyun.sn.jpush.invalid;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import com.mjsheng.myappstore.jpush.Logger;
|
||||
import com.aoleyun.sn.jpush.Logger;
|
||||
|
||||
import cn.jpush.android.api.JPushInterface;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush.invalid;
|
||||
package com.aoleyun.sn.jpush.invalid;
|
||||
|
||||
|
||||
//public class MainActivity extends InstrumentedActivity implements OnClickListener{
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush.invalid;
|
||||
package com.aoleyun.sn.jpush.invalid;
|
||||
|
||||
//public class PushSetActivity extends InstrumentedActivity implements OnClickListener {
|
||||
// private static final String TAG = "JIGUANG-Example";
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush.invalid;
|
||||
package com.aoleyun.sn.jpush.invalid;
|
||||
|
||||
//public class SettingActivity extends InstrumentedActivity implements OnClickListener {
|
||||
// TimePicker startTime;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush.invalid;
|
||||
package com.aoleyun.sn.jpush.invalid;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.mjsheng.myappstore.log;
|
||||
package com.aoleyun.sn.log;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mjsheng.myappstore.utils.Logutils;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
|
||||
/**
|
||||
* @author MTK81255
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.log;
|
||||
package com.aoleyun.sn.log;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.manager;
|
||||
package com.aoleyun.sn.manager;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -6,8 +6,8 @@ import com.amap.api.location.AMapLocation;
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
import com.amap.api.location.AMapLocationClientOption;
|
||||
import com.amap.api.location.AMapLocationListener;
|
||||
import com.mjsheng.myappstore.utils.Logutils;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
|
||||
public class AmapManager {
|
||||
private static AmapManager sInstance;
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.mjsheng.myappstore.manager;
|
||||
package com.aoleyun.sn.manager;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
import com.mjsheng.myappstore.utils.Logutils;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -1,58 +1,54 @@
|
||||
package com.mjsheng.myappstore.manager;
|
||||
package com.aoleyun.sn.manager;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Environment;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.bean.Appground;
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.BrowserBookmarks;
|
||||
import com.mjsheng.myappstore.bean.BrowserData;
|
||||
import com.mjsheng.myappstore.bean.DefaultApp;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadBean;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadData;
|
||||
import com.mjsheng.myappstore.bean.LogoImg;
|
||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
||||
import com.mjsheng.myappstore.bean.StudentsInfo;
|
||||
import com.mjsheng.myappstore.network.api.AppLimitApi;
|
||||
import com.mjsheng.myappstore.network.api.BrankPicApi;
|
||||
import com.mjsheng.myappstore.network.api.CategoryPicApi;
|
||||
import com.mjsheng.myappstore.network.api.DeselectBrowserIDApi;
|
||||
import com.mjsheng.myappstore.network.api.DeselectIDApi;
|
||||
import com.mjsheng.myappstore.network.api.ForceDownloadApi;
|
||||
import com.mjsheng.myappstore.network.api.NetAndLaunchApi;
|
||||
import com.mjsheng.myappstore.network.api.ProjectPicApi;
|
||||
import com.mjsheng.myappstore.network.api.RankAppApi;
|
||||
import com.mjsheng.myappstore.network.api.SystemSettingApi;
|
||||
import com.mjsheng.myappstore.network.api.UploadAppInfoApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.AppinsideWebApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.BrowserBookmarksApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.BrowserListApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.CheckTestUpdateApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.CheckUpdateApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.CustomROMApp;
|
||||
import com.mjsheng.myappstore.network.api.newapi.DefaultAppApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.DesktopIconApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.DevicesLockedStateApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.GetAllApp;
|
||||
import com.mjsheng.myappstore.network.api.newapi.GetBatchApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.GetDesktopApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.GetDeveloper;
|
||||
import com.mjsheng.myappstore.network.api.newapi.GetEBagCode;
|
||||
import com.mjsheng.myappstore.network.api.newapi.GetLockStateApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.JpushTagsApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.LogoImgApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.MACAddressApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.NewAppinsideWebApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.ScreenLockStateApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.SnTimeControl;
|
||||
import com.mjsheng.myappstore.network.api.newapi.StudentsInfosApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.TopAppControlApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.UpdateDeviceInfoApi;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.bean.Appground;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.BrowserBookmarks;
|
||||
import com.aoleyun.sn.bean.BrowserData;
|
||||
import com.aoleyun.sn.bean.DefaultApp;
|
||||
import com.aoleyun.sn.bean.ForceDownloadBean;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.bean.LogoImg;
|
||||
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.network.api.AppLimitApi;
|
||||
import com.aoleyun.sn.network.api.DeselectIDApi;
|
||||
import com.aoleyun.sn.network.api.ForceDownloadApi;
|
||||
import com.aoleyun.sn.network.api.NetAndLaunchApi;
|
||||
import com.aoleyun.sn.network.api.SystemSettingApi;
|
||||
import com.aoleyun.sn.network.api.UploadAppInfoApi;
|
||||
import com.aoleyun.sn.network.api.newapi.AppinsideWebApi;
|
||||
import com.aoleyun.sn.network.api.newapi.BrowserBookmarksApi;
|
||||
import com.aoleyun.sn.network.api.newapi.BrowserListApi;
|
||||
import com.aoleyun.sn.network.api.newapi.CheckTestUpdateApi;
|
||||
import com.aoleyun.sn.network.api.newapi.CheckUpdateApi;
|
||||
import com.aoleyun.sn.network.api.newapi.CustomROMAppApi;
|
||||
import com.aoleyun.sn.network.api.newapi.DefaultAppApi;
|
||||
import com.aoleyun.sn.network.api.newapi.DesktopIconApi;
|
||||
import com.aoleyun.sn.network.api.newapi.DevicesLockedStateApi;
|
||||
import com.aoleyun.sn.network.api.newapi.GetAllAppApi;
|
||||
import com.aoleyun.sn.network.api.newapi.GetAppLogApi;
|
||||
import com.aoleyun.sn.network.api.newapi.GetBatchApi;
|
||||
import com.aoleyun.sn.network.api.newapi.GetDesktopApi;
|
||||
import com.aoleyun.sn.network.api.newapi.GetDeveloperApi;
|
||||
import com.aoleyun.sn.network.api.newapi.GetEBagCodeApi;
|
||||
import com.aoleyun.sn.network.api.newapi.GetLockStateApi;
|
||||
import com.aoleyun.sn.network.api.newapi.GetJpushTagsApi;
|
||||
import com.aoleyun.sn.network.api.newapi.LogoImgApi;
|
||||
import com.aoleyun.sn.network.api.newapi.MACAddressApi;
|
||||
import com.aoleyun.sn.network.api.newapi.NewAppinsideWebApi;
|
||||
import com.aoleyun.sn.network.api.newapi.ScreenLockStateApi;
|
||||
import com.aoleyun.sn.network.api.newapi.SendDownloadInfoApi;
|
||||
import com.aoleyun.sn.network.api.newapi.SendDownloadTimesApi;
|
||||
import com.aoleyun.sn.network.api.newapi.SendScreenshotApi;
|
||||
import com.aoleyun.sn.network.api.newapi.SnTimeControlApi;
|
||||
import com.aoleyun.sn.network.api.newapi.StudentsInfosApi;
|
||||
import com.aoleyun.sn.network.api.newapi.TopAppControlApi;
|
||||
import com.aoleyun.sn.network.api.newapi.UpdateDeviceInfoApi;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
@@ -65,7 +61,6 @@ import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.Cache;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.ResponseBody;
|
||||
import okhttp3.internal.Util;
|
||||
import retrofit2.CallAdapter;
|
||||
import retrofit2.Converter;
|
||||
import retrofit2.Retrofit;
|
||||
@@ -76,8 +71,16 @@ public class NetInterfaceManager {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static NetInterfaceManager INSTANCE;
|
||||
private Context mContext;
|
||||
private static Retrofit mRetrofit;
|
||||
private static Retrofit jiguangRetrofit;
|
||||
private Retrofit mRetrofit;
|
||||
private OkHttpClient okHttpClient;
|
||||
|
||||
//超时时间
|
||||
private int timeOut = 5;
|
||||
// 缓存文件最大限制大小20M
|
||||
private long cacheSize = 1024 * 1024 * 64;
|
||||
|
||||
private Converter.Factory gsonConverterFactory = GsonConverterFactory.create();
|
||||
private CallAdapter.Factory rxJavaCallAdapterFactory = RxJava2CallAdapterFactory.create();
|
||||
|
||||
public static final String ROOT_URL = BuildConfig.ROOT_URL;
|
||||
public static final String WEBSOCKET_URL = BuildConfig.WebsocketURL;
|
||||
@@ -85,6 +88,20 @@ public class NetInterfaceManager {
|
||||
|
||||
private NetInterfaceManager(Context context) {
|
||||
this.mContext = context;
|
||||
if (okHttpClient == null) {
|
||||
//如果无法生存缓存文件目录,检测权限使用已经加上,检测手机是否把文件读写权限禁止了
|
||||
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||
builder.connectTimeout(timeOut, TimeUnit.SECONDS); // 设置连接超时时间
|
||||
builder.writeTimeout(timeOut, TimeUnit.SECONDS);// 设置写入超时时间
|
||||
builder.readTimeout(timeOut, TimeUnit.SECONDS);// 设置读取数据超时时间
|
||||
builder.retryOnConnectionFailure(true);// 设置进行连接失败重试
|
||||
// 设置缓存文件路径
|
||||
String cacheDirectory = mContext.getExternalCacheDir().getAbsolutePath() + "/OkHttpCache";
|
||||
Cache cache = new Cache(new File(cacheDirectory), cacheSize);
|
||||
builder.cache(cache);// 设置缓存
|
||||
okHttpClient = builder.build();
|
||||
}
|
||||
|
||||
if (null == mRetrofit) {
|
||||
mRetrofit = new Retrofit.Builder()
|
||||
.client(okHttpClient)
|
||||
@@ -93,14 +110,6 @@ public class NetInterfaceManager {
|
||||
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
||||
.build();
|
||||
}
|
||||
if (null == jiguangRetrofit) {
|
||||
jiguangRetrofit = new Retrofit.Builder()
|
||||
.client(okHttpClient)
|
||||
.baseUrl(ROOT_URL)
|
||||
.addConverterFactory(gsonConverterFactory)
|
||||
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
@@ -117,34 +126,17 @@ public class NetInterfaceManager {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private static final long cacheSize = 1024 * 1024 * 32;// 缓存文件最大限制大小20M
|
||||
private static String cacheDirectory = Environment.getExternalStorageDirectory() + "/okttpcaches"; // 设置缓存文件路径
|
||||
private static Cache cache = new Cache(new File(cacheDirectory), cacheSize); //
|
||||
private static final OkHttpClient okHttpClient;
|
||||
private static final int timeOut = 5;
|
||||
|
||||
static {
|
||||
//如果无法生存缓存文件目录,检测权限使用已经加上,检测手机是否把文件读写权限禁止了
|
||||
OkHttpClient.Builder builder = new OkHttpClient.Builder();
|
||||
builder.connectTimeout(timeOut, TimeUnit.SECONDS); // 设置连接超时时间
|
||||
builder.writeTimeout(timeOut, TimeUnit.SECONDS);// 设置写入超时时间
|
||||
builder.readTimeout(timeOut, TimeUnit.SECONDS);// 设置读取数据超时时间
|
||||
builder.retryOnConnectionFailure(true);// 设置进行连接失败重试
|
||||
builder.cache(cache);// 设置缓存
|
||||
okHttpClient = builder.build();
|
||||
public OkHttpClient getOkHttpClient() {
|
||||
return okHttpClient;
|
||||
}
|
||||
|
||||
private static CallAdapter.Factory rxJavaCallAdapterFactory = RxJava2CallAdapterFactory.create();
|
||||
private static Converter.Factory gsonConverterFactory = GsonConverterFactory.create();
|
||||
|
||||
/**
|
||||
* 通过sn获取设备的信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Observable<BaseResponse<StudentsInfo>> getStudesInfoObservable() {
|
||||
return mRetrofit
|
||||
.create(StudentsInfosApi.class)
|
||||
return mRetrofit.create(StudentsInfosApi.class)
|
||||
.getStudentsInfo(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
@@ -156,8 +148,7 @@ public class NetInterfaceManager {
|
||||
* @return
|
||||
*/
|
||||
public Observable<BaseResponse> getDevicesLockedStateObservable() {
|
||||
return mRetrofit
|
||||
.create(DevicesLockedStateApi.class)
|
||||
return mRetrofit.create(DevicesLockedStateApi.class)
|
||||
.getLockedState(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
@@ -169,8 +160,7 @@ public class NetInterfaceManager {
|
||||
* @return
|
||||
*/
|
||||
public Observable<BaseResponse> sendMACAddressObservable() {
|
||||
return mRetrofit
|
||||
.create(MACAddressApi.class)
|
||||
return mRetrofit.create(MACAddressApi.class)
|
||||
.sendMACaddress(Utils.getSerial(),
|
||||
Utils.getAndroid10MAC(mContext),
|
||||
JPushInterface.getRegistrationID(mContext),
|
||||
@@ -189,137 +179,119 @@ public class NetInterfaceManager {
|
||||
* @return
|
||||
*/
|
||||
public Observable<BaseResponse> getJpushTagsObservable() {
|
||||
return mRetrofit
|
||||
.create(JpushTagsApi.class)
|
||||
return mRetrofit.create(GetJpushTagsApi.class)
|
||||
.getJpushTags(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<BrowserData>> getBrowserListSettingObservable() {
|
||||
return mRetrofit
|
||||
.create(BrowserListApi.class)
|
||||
return mRetrofit.create(BrowserListApi.class)
|
||||
.getBrowserList(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<BrowserBookmarks>> getBrowserBookmarksObservable() {
|
||||
return mRetrofit
|
||||
.create(BrowserBookmarksApi.class)
|
||||
return mRetrofit.create(BrowserBookmarksApi.class)
|
||||
.getBrowserBookmarks(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getDesktopIconObservable() {
|
||||
return mRetrofit
|
||||
.create(DesktopIconApi.class)
|
||||
return mRetrofit.create(DesktopIconApi.class)
|
||||
.getDesktopIcon(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<NetAndLaunchBean> getAppAutoStartUpdateAndNetObservable() {
|
||||
return mRetrofit
|
||||
.create(NetAndLaunchApi.class)
|
||||
return mRetrofit.create(NetAndLaunchApi.class)
|
||||
.getNetAndLaunchApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<ResponseBody> getAppIDControlObservable() {
|
||||
return mRetrofit
|
||||
.create(DeselectIDApi.class)
|
||||
return mRetrofit.create(DeselectIDApi.class)
|
||||
.getDeselectIDApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<List<Appground>>> getAppinsideWebObservable() {
|
||||
return mRetrofit
|
||||
.create(AppinsideWebApi.class)
|
||||
return mRetrofit.create(AppinsideWebApi.class)
|
||||
.getAppinsideWeb(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getNewAppinsideWebObservable() {
|
||||
return mRetrofit
|
||||
.create(NewAppinsideWebApi.class)
|
||||
return mRetrofit.create(NewAppinsideWebApi.class)
|
||||
.getAppinsideWeb(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<ResponseBody> getSystemSettingObservable() {
|
||||
return mRetrofit
|
||||
.create(SystemSettingApi.class)
|
||||
return mRetrofit.create(SystemSettingApi.class)
|
||||
.getSystemSettingApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<ResponseBody> getAppLimitObservable() {
|
||||
return mRetrofit
|
||||
.create(AppLimitApi.class)
|
||||
return mRetrofit.create(AppLimitApi.class)
|
||||
.getAppLimitApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<ForceDownloadBean> getForceDownloadObservable() {
|
||||
return mRetrofit
|
||||
.create(ForceDownloadApi.class)
|
||||
return mRetrofit.create(ForceDownloadApi.class)
|
||||
.getForceDownloadApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
|
||||
public Observable<BaseResponse<List<ForceDownloadData>>> getTestUpdateObservable() {
|
||||
return mRetrofit
|
||||
.create(CheckTestUpdateApi.class)
|
||||
return mRetrofit.create(CheckTestUpdateApi.class)
|
||||
.getTestUpdate(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getSnTimeObservable() {
|
||||
return mRetrofit
|
||||
.create(SnTimeControl.class)
|
||||
return mRetrofit.create(SnTimeControlApi.class)
|
||||
.getSnTimeControl(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getScreenLockObservable() {
|
||||
return mRetrofit
|
||||
.create(ScreenLockStateApi.class)
|
||||
return mRetrofit.create(ScreenLockStateApi.class)
|
||||
.getScreenLockState(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<ResponseBody> getDesktopObservable() {
|
||||
return mRetrofit
|
||||
.create(GetDesktopApi.class)
|
||||
return mRetrofit.create(GetDesktopApi.class)
|
||||
.getDesktop(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<ResponseBody> getBatchObservable() {
|
||||
return mRetrofit
|
||||
.create(GetBatchApi.class)
|
||||
return mRetrofit.create(GetBatchApi.class)
|
||||
.getBatch(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<LogoImg>> getLogoImgObservable() {
|
||||
return mRetrofit
|
||||
.create(LogoImgApi.class)
|
||||
return mRetrofit.create(LogoImgApi.class)
|
||||
.getLogoImg(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
@@ -333,104 +305,19 @@ public class NetInterfaceManager {
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getDeveloperControl() {
|
||||
return mRetrofit.create(GetDeveloper.class)
|
||||
return mRetrofit.create(GetDeveloperApi.class)
|
||||
.getDeveloperState(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getEBagCodeControl() {
|
||||
return mRetrofit.create(GetEBagCode.class)
|
||||
return mRetrofit.create(GetEBagCodeApi.class)
|
||||
.getEBagCode(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* API
|
||||
*
|
||||
* */
|
||||
public static UploadAppInfoApi getUploadAppInfoApi() {
|
||||
return mRetrofit.create(UploadAppInfoApi.class);
|
||||
}
|
||||
|
||||
public static DeselectIDApi getDeselectIDApi() {
|
||||
return mRetrofit.create(DeselectIDApi.class);
|
||||
}
|
||||
|
||||
public static DeselectBrowserIDApi getDeselectBrowserIDApi() {
|
||||
return mRetrofit.create(DeselectBrowserIDApi.class);
|
||||
}
|
||||
|
||||
public static RankAppApi getRankAppApi() {
|
||||
return mRetrofit.create(RankAppApi.class);
|
||||
}
|
||||
|
||||
public static CategoryPicApi getCategoryPicApi() {
|
||||
return mRetrofit.create(CategoryPicApi.class);
|
||||
}
|
||||
|
||||
public static ProjectPicApi getProjectPicApi() {
|
||||
return mRetrofit.create(ProjectPicApi.class);
|
||||
}
|
||||
|
||||
public static BrankPicApi getBrankPicApi() {
|
||||
return mRetrofit.create(BrankPicApi.class);
|
||||
}
|
||||
|
||||
public static AppLimitApi getAppLimitApi() {
|
||||
return mRetrofit.create(AppLimitApi.class);
|
||||
|
||||
}
|
||||
|
||||
public static SystemSettingApi getSystemSettingApi() {
|
||||
return mRetrofit.create(SystemSettingApi.class);
|
||||
}
|
||||
|
||||
|
||||
public static NetAndLaunchApi getNetAndLaunchApi() {
|
||||
return mRetrofit.create(NetAndLaunchApi.class);
|
||||
}
|
||||
|
||||
public static ForceDownloadApi getForceDownloadApi() {
|
||||
return mRetrofit.create(ForceDownloadApi.class);
|
||||
}
|
||||
|
||||
public static GetLockStateApi getLockState() {
|
||||
return mRetrofit.create(GetLockStateApi.class);
|
||||
}
|
||||
|
||||
public static UpdateDeviceInfoApi getUpdateDeviceInfo() {
|
||||
return mRetrofit.create(UpdateDeviceInfoApi.class);
|
||||
}
|
||||
|
||||
public static GetBatchApi getBatchApi() {
|
||||
return mRetrofit.create(GetBatchApi.class);
|
||||
}
|
||||
|
||||
public static SnTimeControl getSnTimeControlApi() {
|
||||
return mRetrofit.create(SnTimeControl.class);
|
||||
}
|
||||
|
||||
public static TopAppControlApi getTopAppControlApi() {
|
||||
return mRetrofit.create(TopAppControlApi.class);
|
||||
}
|
||||
|
||||
|
||||
public CheckUpdateApi getUpdateApi() {
|
||||
return mRetrofit
|
||||
.create(CheckUpdateApi.class);
|
||||
}
|
||||
|
||||
public CustomROMApp getCustomROMAppApi() {
|
||||
return mRetrofit.create(CustomROMApp.class);
|
||||
}
|
||||
|
||||
public GetAllApp GetAllAppApi() {
|
||||
return mRetrofit.create(GetAllApp.class);
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<DefaultApp>> getDefaultAppApi() {
|
||||
return mRetrofit.create(DefaultAppApi.class)
|
||||
.getDefaultApp(Utils.getSerial())
|
||||
@@ -438,4 +325,80 @@ public class NetInterfaceManager {
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* API
|
||||
*
|
||||
* */
|
||||
public UploadAppInfoApi getUploadAppInfoApi() {
|
||||
return mRetrofit.create(UploadAppInfoApi.class);
|
||||
}
|
||||
|
||||
public DeselectIDApi getDeselectIDApi() {
|
||||
return mRetrofit.create(DeselectIDApi.class);
|
||||
}
|
||||
|
||||
public AppLimitApi getAppLimitApi() {
|
||||
return mRetrofit.create(AppLimitApi.class);
|
||||
}
|
||||
|
||||
public SystemSettingApi getSystemSettingApi() {
|
||||
return mRetrofit.create(SystemSettingApi.class);
|
||||
}
|
||||
|
||||
public NetAndLaunchApi getNetAndLaunchApi() {
|
||||
return mRetrofit.create(NetAndLaunchApi.class);
|
||||
}
|
||||
|
||||
public ForceDownloadApi getForceDownloadApi() {
|
||||
return mRetrofit.create(ForceDownloadApi.class);
|
||||
}
|
||||
|
||||
public GetLockStateApi getLockState() {
|
||||
return mRetrofit.create(GetLockStateApi.class);
|
||||
}
|
||||
|
||||
public UpdateDeviceInfoApi getUpdateDeviceInfo() {
|
||||
return mRetrofit.create(UpdateDeviceInfoApi.class);
|
||||
}
|
||||
|
||||
public GetBatchApi getBatchApi() {
|
||||
return mRetrofit.create(GetBatchApi.class);
|
||||
}
|
||||
|
||||
public SnTimeControlApi getSnTimeControlApi() {
|
||||
return mRetrofit.create(SnTimeControlApi.class);
|
||||
}
|
||||
|
||||
public TopAppControlApi getTopAppControlApi() {
|
||||
return mRetrofit.create(TopAppControlApi.class);
|
||||
}
|
||||
|
||||
public CheckUpdateApi getUpdateApi() {
|
||||
return mRetrofit.create(CheckUpdateApi.class);
|
||||
}
|
||||
|
||||
public CustomROMAppApi getCustomROMAppApi() {
|
||||
return mRetrofit.create(CustomROMAppApi.class);
|
||||
}
|
||||
|
||||
public GetAllAppApi GetAllAppApi() {
|
||||
return mRetrofit.create(GetAllAppApi.class);
|
||||
}
|
||||
|
||||
public GetAppLogApi getAppLogApi() {
|
||||
return mRetrofit.create(GetAppLogApi.class);
|
||||
}
|
||||
|
||||
public SendDownloadTimesApi getSendTimesApi() {
|
||||
return mRetrofit.create(SendDownloadTimesApi.class);
|
||||
}
|
||||
|
||||
public SendDownloadInfoApi getSendInfoApi() {
|
||||
return mRetrofit.create(SendDownloadInfoApi.class);
|
||||
}
|
||||
|
||||
public SendScreenshotApi getScreenshotApi() {
|
||||
return mRetrofit.create(SendScreenshotApi.class);
|
||||
}
|
||||
}
|
||||
856
app/src/main/java/com/aoleyun/sn/network/HTTPInterface.java
Normal file
856
app/src/main/java/com/aoleyun/sn/network/HTTPInterface.java
Normal file
@@ -0,0 +1,856 @@
|
||||
package com.aoleyun.sn.network;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aoleyun.sn.action.JGYActions;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.aoleyun.sn.base.BaseApplication;
|
||||
import com.aoleyun.sn.bean.AppListInfo;
|
||||
import com.aoleyun.sn.bean.BrowserBookmarks;
|
||||
import com.aoleyun.sn.bean.BrowserData;
|
||||
import com.aoleyun.sn.bean.ForceDownloadBean;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.utils.CacheUtils;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
import com.aoleyun.sn.utils.URLUtils;
|
||||
import com.aoleyun.sn.bean.Appground;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.jpush.TagAliasOperatorHelper;
|
||||
import com.aoleyun.sn.manager.NetInterfaceManager;
|
||||
import com.aoleyun.sn.network.api.newapi.SnTimeControlApi;
|
||||
import com.aoleyun.sn.network.api.newapi.TopAppControlApi;
|
||||
import com.aoleyun.sn.network.api.newapi.UpdateDeviceInfoApi;
|
||||
import com.aoleyun.sn.service.MainService;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.ForegroundAppUtil;
|
||||
import com.aoleyun.sn.utils.Logger;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.TimeUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.trello.rxlifecycle2.android.ActivityEvent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.ResponseBody;
|
||||
|
||||
import static com.aoleyun.sn.jpush.TagAliasOperatorHelper.ACTION_SET;
|
||||
import static com.aoleyun.sn.jpush.TagAliasOperatorHelper.sequence;
|
||||
|
||||
public class HTTPInterface {
|
||||
private static final String TAG = HTTPInterface.class.getSimpleName();
|
||||
private static final int OK = 200;
|
||||
|
||||
private static void installTestAPK(final Context context, JSONObject jsonObject) {
|
||||
final String url = jsonObject.getString("app_url");
|
||||
int versionCode = jsonObject.getInteger("app_version_code");
|
||||
final String packageName = jsonObject.getString("app_package");
|
||||
String app_name = jsonObject.getString("app_name");
|
||||
String app_md5 = jsonObject.getString("app_md5");
|
||||
final com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
|
||||
object.put("app_name", app_name);
|
||||
object.put("app_package", packageName);
|
||||
object.put("MD5", app_md5);
|
||||
PackageManager pm = context.getPackageManager();
|
||||
PackageInfo packageInfo = null;
|
||||
try {
|
||||
packageInfo = pm.getPackageInfo(packageName, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (packageInfo == null || packageInfo.versionCode < versionCode) {
|
||||
Utils.ariaDownload(context, url, object);
|
||||
} else {
|
||||
Logutils.e("installTestAPK", "APK: " + "无更新");
|
||||
}
|
||||
}
|
||||
|
||||
synchronized public static void setJpushTags(final Context context) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getJpushTagsObservable()
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Logutils.e(TAG + ":" + "setJpushTags", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse response) {
|
||||
if (response.code == 200) {
|
||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
|
||||
String batch = jsonObject.get("batch").getAsString();
|
||||
Logutils.e(TAG + ":" + "setJpushTags", "onNext: " + batch);
|
||||
if (!TextUtils.isEmpty(batch)) {
|
||||
Set set = new HashSet();
|
||||
set.add(batch);
|
||||
JGYUtils.getInstance().getAppPlatform(new JGYUtils.GetAppPlatformCallback() {
|
||||
@Override
|
||||
public void AppPlatform(int platform) {
|
||||
if (platform == JGYUtils.MTKPlatform) {
|
||||
set.add(JGYUtils.MTKTag);
|
||||
} else if (platform == JGYUtils.ZhanruiPlatform) {
|
||||
set.add(JGYUtils.ZhanruiTag);
|
||||
}
|
||||
}
|
||||
});
|
||||
setTag(context, set);
|
||||
} else {
|
||||
Logutils.e(TAG + ":" + "setJpushTags", "onNext: " + "batch empty");
|
||||
}
|
||||
} else {
|
||||
Logutils.e(TAG + ":" + "setJpushTags", "onNext: " + response.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logutils.e(TAG + ":" + "setJpushTags", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logutils.e(TAG + ":" + "setJpushTags", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void setTag(Context context, Set set) {
|
||||
TagAliasOperatorHelper.TagAliasBean tagAliasBean = new TagAliasOperatorHelper.TagAliasBean();
|
||||
tagAliasBean.action = ACTION_SET;
|
||||
sequence++;
|
||||
tagAliasBean.tags = set;
|
||||
tagAliasBean.isAliasAction = false;
|
||||
TagAliasOperatorHelper.getInstance().handleAction(context, sequence, tagAliasBean);
|
||||
}
|
||||
|
||||
public interface GetAppinsideWebCallback {
|
||||
void onComplete();
|
||||
}
|
||||
|
||||
synchronized public static void getAppinsideWeb(Context context, GetAppinsideWebCallback callback) {
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTKPlatform) {
|
||||
Logutils.e(TAG, "getAppinsideWeb: " + "setAppinsideWeb");
|
||||
setAppinsideWeb(callback);
|
||||
} else {
|
||||
Logutils.e(TAG, "getAppinsideWeb: " + "setNewAppinsideWeb");
|
||||
setNewAppinsideWeb(callback);
|
||||
// setAppinsideWeb(callback);
|
||||
}
|
||||
}
|
||||
|
||||
private static void setAppinsideWeb(GetAppinsideWebCallback callback) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppinsideWebObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(new Observer<BaseResponse<List<Appground>>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Logutils.e("setAppinsideWeb", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<List<Appground>> listBaseResponse) {
|
||||
Logutils.e("setAppinsideWeb", "onNext: " + listBaseResponse);
|
||||
JGYUtils.getInstance().setAppinsideWeb(listBaseResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logutils.e("setAppinsideWeb", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logutils.e("setAppinsideWeb", "onComplete: ");
|
||||
callback.onComplete();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void setNewAppinsideWeb(GetAppinsideWebCallback callback) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getNewAppinsideWebObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Logutils.e("getNewAppinsideWeb", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse listBaseResponse) {
|
||||
Logutils.e("getNewAppinsideWeb", "onNext: " + listBaseResponse);
|
||||
long time1 = System.currentTimeMillis();
|
||||
JGYUtils.getInstance().setNewAppinsideWeb(listBaseResponse);
|
||||
Logutils.e(TAG, "setWhiteApp: time = " + (System.currentTimeMillis() - time1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logutils.e("getNewAppinsideWeb", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logutils.e("getNewAppinsideWeb", "onComplete: ");
|
||||
callback.onComplete();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private static void sendAllweb(Context context) {
|
||||
Intent intent = new Intent("qch_app_website")
|
||||
.setPackage("com.android.settings");
|
||||
intent.putExtra("package_name", "Invalid");
|
||||
context.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
private static void sendwebUrl(Context context) {
|
||||
Intent intent = new Intent("qch_app_inside_website")
|
||||
.setPackage("com.android.settings");
|
||||
intent.putExtra("websitelist", "Invalid");
|
||||
context.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
//设置浏览器黑白名单
|
||||
synchronized public static void setBrowserBlackList(final Context context) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getBrowserListSettingObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(new Observer<BaseResponse<BrowserData>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Logutils.e("setBrowserBlackList", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse<BrowserData> browserDataBaseResponse) {
|
||||
Logutils.e("setBrowserBlackList", "onNext: ");
|
||||
String homePage = Settings.System.getString(context.getContentResolver(), "homepagURL");
|
||||
if (browserDataBaseResponse.code == 200) {
|
||||
BrowserData data = browserDataBaseResponse.data;
|
||||
String white = data.getWhite();
|
||||
if (!TextUtils.isEmpty(white)) {
|
||||
if (!TextUtils.isEmpty(homePage) && !white.contains(homePage)) {
|
||||
white += "," + homePage;
|
||||
}
|
||||
boolean DeselectBrowserArray = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", white);
|
||||
Logutils.e("setBrowserBlackList", "setBrowserList white = " + white + ":" + DeselectBrowserArray);
|
||||
} else {
|
||||
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", homePage);
|
||||
}
|
||||
String black = data.getBlack();
|
||||
if (!TextUtils.isEmpty(black)) {
|
||||
boolean qch_webblack_url = Settings.System.putString(context.getContentResolver(), "qch_webblack_url", black);
|
||||
Logutils.e("setBrowserBlackList", "setBrowserList black = " + black + ":" + qch_webblack_url);
|
||||
} else {
|
||||
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
|
||||
}
|
||||
String white_ip = data.getWhite_ip();
|
||||
if (!TextUtils.isEmpty(white_ip)) {
|
||||
SPUtils.put(context, "white_ip", white_ip);
|
||||
} else {
|
||||
SPUtils.put(context, "white_ip", " ");
|
||||
}
|
||||
String black_ip = data.getBlack_ip();
|
||||
if (!TextUtils.isEmpty(black_ip)) {
|
||||
SPUtils.put(context, "black_ip", black_ip);
|
||||
} else {
|
||||
SPUtils.put(context, "black_ip", " ");
|
||||
}
|
||||
} else {
|
||||
Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", homePage);
|
||||
Settings.System.putString(context.getContentResolver(), "qch_webblack_url", " ");
|
||||
SPUtils.put(context, "white_ip", " ");
|
||||
SPUtils.put(context, "black_ip", " ");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Logutils.e("setBrowserBlackList", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logutils.e("setBrowserBlackList", "onComplete: ");
|
||||
new URLUtils(context).setBrowserWhiteList();
|
||||
new URLUtils(context).setBrowserBlackList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface BookmarksCallback {
|
||||
void onSubscribe();
|
||||
|
||||
void onNext();
|
||||
|
||||
void onError(Throwable e);
|
||||
|
||||
void onComplete();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param callback
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
synchronized public static void getHomePageBookmarks(Context context, BookmarksCallback callback) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getBrowserBookmarksObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(new Observer<BaseResponse<BrowserBookmarks>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
if (callback != null) {
|
||||
callback.onSubscribe();
|
||||
}
|
||||
Logutils.e("getHomePageBookmarks", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<BrowserBookmarks> browserBookmarksBaseResponse) {
|
||||
if (callback != null) {
|
||||
callback.onNext();
|
||||
}
|
||||
Logutils.e("getHomePageBookmarks", "onNext: ");
|
||||
if (browserBookmarksBaseResponse.code == 200) {
|
||||
//主页不包含白名单添加进去
|
||||
String homepagURL = browserBookmarksBaseResponse.data.getHomepage();
|
||||
Logutils.e("getHomePageBookmarks ", "homepagURL: " + homepagURL);
|
||||
String oldHome = Settings.System.getString(context.getContentResolver(), "homepagURL");
|
||||
Logutils.e("getHomePageBookmarks", "oldHome: " + oldHome);
|
||||
//数据和之前不一样的时候清除缓存
|
||||
if (!TextUtils.isEmpty(oldHome) && !oldHome.equalsIgnoreCase(homepagURL)) {
|
||||
try {
|
||||
new CacheUtils().cleanApplicationUserData(context, "com.android.browser");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Logutils.e(TAG, "setHomepagtag: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
boolean home = Settings.System.putString(context.getContentResolver(), "homepagURL", homepagURL);
|
||||
Logutils.e("getHomePageBookmarks", "onNext: homepagURL: save homepagURL = " + home);
|
||||
String whitelist = Settings.System.getString(context.getContentResolver(), "DeselectBrowserArray");
|
||||
Logutils.e("getHomePageBookmarks ", "whitelist: " + whitelist);
|
||||
|
||||
// if (!TextUtils.isEmpty(whitelist.trim())) {
|
||||
// HashSet<String> whiteLists = new HashSet<>(Arrays.asList(whitelist.trim().split(",")));
|
||||
// whiteLists.add(homepagURL);
|
||||
// String whiteString = String.join(",", whiteLists);
|
||||
// boolean white = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", whiteString);
|
||||
// Logutils.e("getHomePageBookmarks", "onNext: homepagURL: add to whiteList = " + whiteString + "write: " + white);
|
||||
// } else {
|
||||
// Logutils.e("getHomePageBookmarks", "onNext: whitelist is NULL");
|
||||
// boolean white = Settings.System.putString(context.getContentResolver(), "DeselectBrowserArray", homepagURL);
|
||||
// Logutils.e("getHomePageBookmarks", "onNext: homepagURL: homepagURL = " + homepagURL + "write: " + white);
|
||||
// }
|
||||
|
||||
//书签
|
||||
String labelpage = browserBookmarksBaseResponse.data.getLabelpage();
|
||||
Intent websiteBookMark = new Intent("qch_app_brower_website");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
websiteBookMark.setPackage("com.android.settings")
|
||||
.setPackage("com.android.browser");
|
||||
}
|
||||
if (!TextUtils.isEmpty(labelpage)) {
|
||||
HashSet<String> labels = new HashSet<>(Arrays.asList(labelpage.split(",")));
|
||||
// List<String> urlList = new ArrayList<>();
|
||||
// for (String urls : labels) {
|
||||
// urlList.add(JGYUtils.getPrefixHttpsURL(urls));
|
||||
// }
|
||||
String join = String.join(",", labels);
|
||||
Logutils.e("getHomePageBookmarks", "onNext: getHomePageBookmarks: " + join);
|
||||
websiteBookMark.putExtra("websiteBookMark", join);
|
||||
} else {
|
||||
websiteBookMark.putExtra("websiteBookMark", "Invalid");
|
||||
}
|
||||
context.sendBroadcast(websiteBookMark);
|
||||
context.sendBroadcast(websiteBookMark);
|
||||
context.sendBroadcast(websiteBookMark);
|
||||
|
||||
//主页
|
||||
Intent homepag = new Intent("qch_app_brower_homepage");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
homepag.setPackage("com.android.settings")
|
||||
.setPackage("com.android.browser");
|
||||
}
|
||||
if (!TextUtils.isEmpty(homepagURL)) {
|
||||
// String newHomePage = JGYUtils.getPrefixHttpsURL(homepagURL);
|
||||
Logutils.e("getHomePageBookmarks", "onNext: newHomePage: " + homepagURL);
|
||||
homepag.putExtra("homepage", homepagURL);
|
||||
} else {
|
||||
homepag.putExtra("homepage", "Invalid");
|
||||
}
|
||||
context.sendBroadcast(homepag);
|
||||
context.sendBroadcast(homepag);
|
||||
context.sendBroadcast(homepag);
|
||||
} else {
|
||||
Intent intent1 = new Intent("qch_app_brower_homepage");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
intent1.setPackage("com.android.settings")
|
||||
.setPackage("com.android.browser");
|
||||
}
|
||||
intent1.putExtra("homepage", "Invalid");
|
||||
context.sendBroadcast(intent1);
|
||||
|
||||
Settings.System.putString(context.getContentResolver(), "homepagURL", " ");
|
||||
Intent intent2 = new Intent("qch_app_brower_website");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
intent2.setPackage("com.android.settings")
|
||||
.setPackage("com.android.browser");
|
||||
}
|
||||
intent2.putExtra("websiteBookMark", "Invalid");
|
||||
context.sendBroadcast(intent2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
if (callback != null) {
|
||||
callback.onError(e);
|
||||
}
|
||||
Logutils.e("getHomePageBookmarks", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
if (callback != null) {
|
||||
callback.onComplete();
|
||||
}
|
||||
Logutils.e("getHomePageBookmarks", "onComplete: ");
|
||||
setBrowserBlackList(context);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void setHideDesktopIcon(final Context context) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getDesktopIconObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Logutils.e(TAG + ":" + "getDesktopIcon", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse response) {
|
||||
Logutils.e(TAG + ":" + "getDesktopIcon", "onNext: ");
|
||||
ApkUtils.showAllAPP(context);
|
||||
if (response.code == OK) {
|
||||
String data = response.data.toString();
|
||||
Logutils.e(TAG + ":" + "getDesktopIcon", "data: " + data);
|
||||
if (!TextUtils.isEmpty(data)) {
|
||||
List<String> newList = Arrays.asList(data.split(","));//新的list
|
||||
PackageManager pm = context.getPackageManager();
|
||||
for (String pack : newList) {
|
||||
try {
|
||||
// TODO: 2021/5/24 需要后端替换包名,暂时解决方案
|
||||
try {
|
||||
if ("com.mediatek.camera".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.camera2", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
if ("com.android.mms".equals(pack)) {
|
||||
pm.setApplicationEnabledSetting("com.android.messaging", PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Logutils.e(TAG + ":" + "getDesktopIcon", "Exception: ex: " + ex.getMessage());
|
||||
}
|
||||
pm.setApplicationEnabledSetting(pack, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
|
||||
Logutils.e(TAG + ":" + "getDesktopIcon", pack);
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG + ":" + "getDesktopIcon", "Exception: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Logutils.e(TAG + ":" + "getDesktopIcon", "onNext: " + response.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logutils.e(TAG + ":" + "getDesktopIcon", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logutils.e(TAG + ":" + "getDesktopIcon", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
synchronized public static void updateDeviceInfo(Context context) {
|
||||
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 latitude = String.valueOf(SPUtils.get(context, "latitude", "0"));
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("address", address);
|
||||
jsonObject.put("longitude", longitude);
|
||||
jsonObject.put("latitude", latitude);
|
||||
String add = jsonObject.toJSONString();
|
||||
UpdateDeviceInfoApi updateDeviceInfo = NetInterfaceManager.getInstance().getUpdateDeviceInfo();
|
||||
updateDeviceInfo.updateDeviceInfo(
|
||||
Utils.getSerial(),
|
||||
NetInterfaceManager.HTTP_KEY,
|
||||
Utils.getMachine(context),
|
||||
Utils.getHardware(context),
|
||||
add
|
||||
)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(ResponseBody responseBody) {
|
||||
try {
|
||||
Logutils.e("updateDeviceInfo", "上传的结果" + responseBody.string());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Logutils.e("updateDeviceInfo", e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
ApkUtils.getAppInfo(context);
|
||||
}
|
||||
|
||||
public static void getSnTimeControl(final Context context) {
|
||||
SnTimeControlApi snTimeControl = NetInterfaceManager.getInstance().getSnTimeControlApi();
|
||||
snTimeControl.getSnTimeControl(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Logutils.e(TAG, "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse response) {
|
||||
int code = response.code;
|
||||
if (code == 200) {
|
||||
JSONObject jsonObject = (JSONObject) JSON.toJSON(response.data);
|
||||
String start_time = jsonObject.getString("start_time");
|
||||
String end_time = jsonObject.getString("end_time");
|
||||
TimeUtils.ContralTime c = TimeUtils.String2ContralTime(context, start_time + "-" + end_time);
|
||||
if (null != c) {
|
||||
Logutils.e("getTimeControl", "200: " + c.toString());
|
||||
}
|
||||
} else {
|
||||
TimeUtils.setEmpty(context);
|
||||
TimeUtils.ContralTime c = TimeUtils.getDefaltContralTime(context);
|
||||
if (null != c) {
|
||||
Logutils.e("getTimeControl", c.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Logutils.e("getSnTimeControl", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(MainService.TimeChangedReceiver.ACTION_UPDATE);
|
||||
context.sendBroadcast(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getTopAppControl(final Context context) {
|
||||
TopAppControlApi topAppControl = NetInterfaceManager.getInstance().getTopAppControlApi();
|
||||
topAppControl.getSnAppControl(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse response) {
|
||||
if (response.code == 200) {
|
||||
JSONObject jsonObject = (JSONObject) JSON.toJSON(response.data);
|
||||
String app_package = jsonObject.getString("app_package");
|
||||
SPUtils.put(context, ForegroundAppUtil.TOPAPP_KEY, app_package);
|
||||
ForegroundAppUtil.setTopAppClass(context, app_package);
|
||||
ForegroundAppUtil.openTopApp(context);
|
||||
} else {
|
||||
SPUtils.put(context, ForegroundAppUtil.TOPAPP_KEY, "");
|
||||
ForegroundAppUtil.setTopAppClass(context, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getAppLimit(Context context) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppLimitObservable()
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Logutils.e("getAppLimit", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull ResponseBody responseBody) {
|
||||
try {
|
||||
String bodyString = responseBody.string();
|
||||
Logutils.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(), JGYActions.ACTION_JGY_SHORTCUTLIST, data);
|
||||
Logutils.e(TAG, "onNext: only_jgy_shortcut_list: " + write);
|
||||
JGYUtils.getInstance().writeAppPackageList(context, data);
|
||||
JGYUtils.getInstance().deleteOtherApp();
|
||||
} else {
|
||||
Logutils.e("getAppLimit", "onNext: " + bodyString);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Logutils.e("getAppLimit", "onNext: IOException: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logutils.e("getAppLimit", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logutils.e("getAppLimit", "onComplete: ");
|
||||
getAllAppList(context);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static void getAllAppList(Context context) {
|
||||
NetInterfaceManager.getInstance().GetAllAppApi()
|
||||
.getAllAppList(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseResponse<List<AppListInfo>>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
Logutils.e("getAllAppList", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseResponse<List<AppListInfo>> listBaseResponse) {
|
||||
Logutils.e("getAllAppList", "onNext: " + JSONObject.toJSONString(listBaseResponse));
|
||||
int code = listBaseResponse.code;
|
||||
if (code == 200) {
|
||||
List<AppListInfo> appListInfos = listBaseResponse.data;
|
||||
getAppAutoStartUpdateAndNet(appListInfos);
|
||||
} else {
|
||||
Logutils.e("getAllAppList", "onNext: " + "no data");
|
||||
Logutils.e("getAllAppList", "onNext: " + listBaseResponse.data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Logutils.e("getAllAppList", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logutils.e("getAllAppList", "onComplete: ");
|
||||
getForceDownload(context);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getForceDownload(Context context) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getForceDownloadObservable()
|
||||
.subscribe(new Observer<ForceDownloadBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Logutils.e(TAG + ":" + "getForceDownload", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull ForceDownloadBean forceDownloadBean) {
|
||||
Logutils.e(TAG + ":" + "getForceDownload", "onNext: ");
|
||||
switch (forceDownloadBean.getCode()) {
|
||||
case 200:
|
||||
Logutils.e(TAG + ":" + "getForceDownload", "isDownloading=" + BaseApplication.getInstance().isDownloading());
|
||||
BaseApplication.getInstance().checkIsDownloading();
|
||||
if (!BaseApplication.getInstance().isDownloading()) {
|
||||
Type type = new TypeToken<List<ForceDownloadData>>() {
|
||||
}.getType();
|
||||
Gson gson = new Gson();
|
||||
List<ForceDownloadData> forceDownloadData = gson.fromJson(gson.toJson(forceDownloadBean.getData()), type);
|
||||
JGYUtils.getInstance().forceDownload(forceDownloadData);
|
||||
} else {
|
||||
Aria.download(this).resumeAllTask();
|
||||
}
|
||||
break;
|
||||
case -200:
|
||||
boolean qch_force_app = Settings.System.putString(context.getContentResolver(), "qch_force_app", "invalid");
|
||||
Logutils.e(TAG + ":" + "getForceDownload", "qch_force_app:" + qch_force_app);
|
||||
break;
|
||||
default:
|
||||
Logutils.e(TAG + ":" + "getForceDownload", forceDownloadBean.getMsg());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logutils.e(TAG + ":" + "getForceDownload", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logutils.e(TAG + ":" + "getForceDownload", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void getAppAutoStartUpdateAndNet(List<AppListInfo> appListInfos) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppAutoStartUpdateAndNetObservable()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<NetAndLaunchBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Logutils.e("getAppAutoStartUpdateAndNet", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull NetAndLaunchBean netAndLaunchBean) {
|
||||
Logutils.e("getAppAutoStartUpdateAndNet", "onNext: " + netAndLaunchBean.toString());
|
||||
if (netAndLaunchBean.getCode() == 200) {
|
||||
JGYUtils.getInstance().setNetAndlaunch(netAndLaunchBean, appListInfos);
|
||||
} else {
|
||||
Logutils.e("getAppAutoStartUpdateAndNet", "onNext: " + netAndLaunchBean.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logutils.e("getAppAutoStartUpdateAndNet", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logutils.e("getAppAutoStartUpdateAndNet", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
synchronized public static void getNetAndLaunchSetting(final Context context) {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getAppAutoStartUpdateAndNetObservable()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<NetAndLaunchBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Logutils.e("getNetAndLaunchSetting", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull NetAndLaunchBean netAndLaunchBean) {
|
||||
Logutils.e("getNetAndLaunchSetting", "onNext: " + netAndLaunchBean.toString());
|
||||
if (netAndLaunchBean.getCode() == 200) {
|
||||
JGYUtils.getInstance().setNetAndlaunch(netAndLaunchBean);
|
||||
} else {
|
||||
Logutils.e("getNetAndLaunchSetting", "onNext: " + netAndLaunchBean.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logutils.e("getNetAndLaunchSetting", "onError: " + e.getMessage());
|
||||
onComplete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logutils.e("getNetAndLaunchSetting", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.mjsheng.myappstore.network;
|
||||
package com.aoleyun.sn.network;
|
||||
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
|
||||
import rxhttp.wrapper.annotation.DefaultDomain;
|
||||
|
||||
@@ -16,41 +14,41 @@ public class URLAddress {
|
||||
|
||||
|
||||
// 下载接口 根据包名匹配 请求后更新下载次数
|
||||
public static final String HTTP_TAG_DOWNLOAD_URL = HTTP_TAG_HEAD_NEW + "count/index";
|
||||
public static final String SEND_DOWNLOAD_TIMES = "count/index";
|
||||
//app下载完成发送下载次数
|
||||
public static final String SEND_DOWNLOAD_FILE_INFO = HTTP_TAG_HEAD_NEW + "app/downloadApp";
|
||||
public static final String SEND_DOWNLOAD_FILE_INFO = "app/downloadApp";
|
||||
//获取设备锁定状态
|
||||
public static final String GET_DEVICES_LOCKED = "lock/index";
|
||||
//发送设备信息
|
||||
public static final String SEND_DEVICES = "Mac/getMac";
|
||||
//发送app使用情况
|
||||
public static final String SEND_USEDTIME = HTTP_TAG_HEAD_NEW + "Applog/getAppLog";
|
||||
public static final String GET_APP_LOG = "Applog/getAppLog";
|
||||
//更新接口
|
||||
public static final String CHECK_UPDATE = HTTP_TAG_HEAD_NEW + "Silent/silent";
|
||||
public static final String CHECK_UPDATE = "Silent/silent";
|
||||
//获取设备标签
|
||||
public static final String GET_DEVICES_TAGS = HTTP_TAG_HEAD_NEW + "Sn/getSnTag";
|
||||
public static final String GET_DEVICES_TAGS = "Sn/getSnTag";
|
||||
//删除Aliases
|
||||
public static final String DELETE_GEDEVICE_ALIAS = HTTP_TAG_HEAD_NEW + "Sn/deleteAliases";
|
||||
public static final String DELETE_GEDEVICE_ALIAS = "Sn/deleteAliases";
|
||||
//浏览器书签主页设置
|
||||
public static final String SET_HOMEPAG_TAG = HTTP_TAG_HEAD_NEW + "Label";
|
||||
public static final String SET_HOMEPAG_TAG = "Label";
|
||||
//app内部网页管控
|
||||
public static final String SET_APPINSIDEWEB = "Appground";
|
||||
//浏览器黑白名单地址
|
||||
public static final String SET_BROWSER_LIST = HTTP_TAG_HEAD_NEW + "browser";
|
||||
public static final String SET_BROWSER_LIST = "browser";
|
||||
//强制安装应用
|
||||
public static final String GET_FORCE_INSTALL_LIST = "forceinstall/index";
|
||||
//应用白名单
|
||||
public static final String SET_WHITE_PACKAGE_LIST = "firmware/index";
|
||||
//获取隐藏桌面图标
|
||||
public static final String GET_HIDE_DESKTOPICON = HTTP_TAG_HEAD_NEW + "Icon";
|
||||
public static final String GET_HIDE_DESKTOPICON = "Icon";
|
||||
//获取应用升级自启
|
||||
public final static String NET_AND_LAUNCH_API = HTTP_TAG_HEAD_NEW + "automatic/get";
|
||||
public final static String NET_AND_LAUNCH_API = "automatic/get";
|
||||
//通过sn获取信息
|
||||
public static final String GET_STUDENTS_INFO = "Sn/getStudent";
|
||||
//上传截图
|
||||
public static final String SEND_SCREENSHOT = HTTP_TAG_HEAD_NEW + "Screenshot/addImg";
|
||||
public static final String SEND_SCREENSHOT = "Screenshot/addImg";
|
||||
//上传我的设备
|
||||
//public static final String UPDATE_DEVICEINFO = HTTP_TAG_HEAD_NEW + "Mac/getInfo";
|
||||
//public static final String UPDATE_DEVICEINFO = "Mac/getInfo";
|
||||
//获取霸屏状态
|
||||
public final static String GET_LOCK_SCREEN_STATE = "Sn/getSnScreen";
|
||||
//获取默认桌面升级
|
||||
@@ -60,7 +58,7 @@ public class URLAddress {
|
||||
//获取顶部app管控
|
||||
public final static String GET_TOP_APP_CONTROL = "Sn/getSnAppControl";
|
||||
//获取测试app
|
||||
public final static String GET_SN_APP_TEST = HTTP_TAG_HEAD_NEW + "Sn/getSnAppTest";
|
||||
public final static String GET_SN_APP_TEST = "Sn/getSnAppTest";
|
||||
//开机动画
|
||||
public final static String GET_LOGO_IMG = "Sn/getLogoImg";
|
||||
//开发人员选项开关
|
||||
@@ -75,7 +73,7 @@ public class URLAddress {
|
||||
public final static String GET_DEFAULT_APP = "app/getDefaultApp";
|
||||
|
||||
//删除alias
|
||||
public static final String DELETE_JPUSH_ALIAS = "https://device.jpush.cn/v3/aliases/" ;
|
||||
public static final String DELETE_JPUSH_ALIAS = "https://device.jpush.cn/v3/aliases/";
|
||||
//删除tags
|
||||
public static final String DELETE_JPUSH_TAG = "https://device.jpush.cn/v3/tags/" ;
|
||||
public static final String DELETE_JPUSH_TAG = "https://device.jpush.cn/v3/tags/";
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.aoleyun.sn.network.api;
|
||||
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -8,13 +8,6 @@ import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/5/7 08:28
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
|
||||
public interface AppLimitApi {
|
||||
@FormUrlEncoded
|
||||
@POST(URLAddress.SET_WHITE_PACKAGE_LIST)
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.aoleyun.sn.network.api;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -6,13 +6,6 @@ import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/5/7 08:28
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
|
||||
public interface DeselectIDApi {
|
||||
@FormUrlEncoded
|
||||
@POST("application/index")
|
||||
@@ -1,20 +1,13 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.aoleyun.sn.network.api;
|
||||
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadBean;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.ForceDownloadBean;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/5/7 08:28
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
|
||||
public interface ForceDownloadApi {
|
||||
@FormUrlEncoded
|
||||
@POST(URLAddress.GET_FORCE_INSTALL_LIST)
|
||||
@@ -1,22 +1,16 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.aoleyun.sn.network.api;
|
||||
|
||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.bean.NetAndLaunchBean;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/5/7 08:28
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
|
||||
public interface NetAndLaunchApi {
|
||||
@FormUrlEncoded
|
||||
@POST("automatic/get")
|
||||
@POST(URLAddress.NET_AND_LAUNCH_API)
|
||||
Observable<NetAndLaunchBean> getNetAndLaunchApi(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.aoleyun.sn.network.api;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -6,12 +6,6 @@ import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/5/7 08:28
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
|
||||
public interface SystemSettingApi {
|
||||
@FormUrlEncoded
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.aoleyun.sn.network.api;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -6,13 +6,6 @@ import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
* 日期 2018/5/7 08:28
|
||||
* 邮箱 501802639@qq.com
|
||||
* 来自:
|
||||
*/
|
||||
|
||||
public interface UploadAppInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST("log/index")
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
|
||||
import com.mjsheng.myappstore.bean.Appground;
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.Appground;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.BrowserBookmarks;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.BrowserBookmarks;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.BrowserData;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.BrowserData;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadData;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.ForceDownloadData;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface CustomROMApp {
|
||||
public interface CustomROMAppApi {
|
||||
@FormUrlEncoded
|
||||
@POST(URLAddress.GET_ROM_APP)
|
||||
Observable<BaseResponse> getROMApp(
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.DefaultApp;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.DefaultApp;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.AppListInfo;
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.AppListInfo;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,7 +11,7 @@ import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetAllApp {
|
||||
public interface GetAllAppApi {
|
||||
@FormUrlEncoded
|
||||
@POST(URLAddress.GET_ALL_APP)
|
||||
Observable<BaseResponse<List<AppListInfo>>> getAllAppList(
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetAppLogApi {
|
||||
@FormUrlEncoded
|
||||
@POST(URLAddress.GET_APP_LOG)
|
||||
Observable<BaseResponse> getAppLog(
|
||||
@Field("sn") String sn,
|
||||
@Field("random") String random,
|
||||
@Field("data") String data
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GetDeveloper {
|
||||
public interface GetDeveloperApi {
|
||||
@GET(URLAddress.GET_DEVELOPER)
|
||||
Observable<BaseResponse> getDeveloperState(
|
||||
@Query("sn") String sn
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface GetEBagCode {
|
||||
public interface GetEBagCodeApi {
|
||||
@FormUrlEncoded
|
||||
@POST(URLAddress.GET_EBAG_CODE)
|
||||
Observable<BaseResponse> getEBagCode(
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface JpushTagsApi {
|
||||
public interface GetJpushTagsApi {
|
||||
@GET(URLAddress.GET_DEVICES_TAGS)
|
||||
Observable<BaseResponse> getJpushTags(
|
||||
@Query("sn") String sn
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.LogoImg;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.LogoImg;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface SendDownloadInfoApi {
|
||||
@FormUrlEncoded
|
||||
@POST(URLAddress.SEND_DOWNLOAD_FILE_INFO)
|
||||
Observable<BaseResponse> sendDownloadTimes(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("userId") int userId,
|
||||
@Field("package_name") String package_name,
|
||||
@Field("app_size") long app_size
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface SendDownloadTimesApi {
|
||||
@FormUrlEncoded
|
||||
@POST(URLAddress.SEND_DOWNLOAD_TIMES)
|
||||
Observable<BaseResponse> sendDownloadTimes(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("package") String packages,
|
||||
@Field("app_id") String app_id
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
|
||||
public interface SendScreenStatusApi {
|
||||
@FormUrlEncoded
|
||||
@POST(BuildConfig.SCREEN_URL)
|
||||
Observable<BaseResponse> sendScreenStatus(
|
||||
@Field("key") String key,
|
||||
@Field("sn") String sn,
|
||||
@Field("is_online") int is_online
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
|
||||
public interface SendScreenshotApi {
|
||||
@Multipart
|
||||
@POST(URLAddress.SEND_SCREENSHOT)
|
||||
Observable<BaseResponse> sendScreenshot(
|
||||
@Field("sn") String sn,
|
||||
@Field("createtime") long createtime,
|
||||
@Part MultipartBody.Part body
|
||||
);
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface SnTimeControl {
|
||||
public interface SnTimeControlApi {
|
||||
@GET(URLAddress.GET_SN_TIME_CONTROL)
|
||||
Observable<BaseResponse> getSnTimeControl(
|
||||
@Query("sn") String sn
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.StudentsInfo;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.bean.StudentsInfo;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.aoleyun.sn.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.aoleyun.sn.network.api.newapi;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.receiver;
|
||||
package com.aoleyun.sn.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -6,22 +6,21 @@ import android.content.Intent;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mjsheng.myappstore.service.MainService;
|
||||
import com.mjsheng.myappstore.utils.BootManager;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.mjsheng.myappstore.utils.Logutils;
|
||||
import com.aoleyun.sn.service.MainService;
|
||||
import com.aoleyun.sn.utils.BootManager;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class BootReceiver extends BroadcastReceiver {
|
||||
private static String TAG = BootReceiver.class.getSimpleName() + ":myappstore";
|
||||
public static final String BOOT_COMPLETED = "com.jiaoguanyi.appstore.intent.action.BOOT_COMPLETED";
|
||||
public static final String BOOT_COMPLETED = "com.aoleyun.sn.intent.action.BOOT_COMPLETED";
|
||||
|
||||
static {
|
||||
getLockedState();
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.receiver;
|
||||
package com.aoleyun.sn.receiver;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -16,36 +16,36 @@ import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.amap.api.location.AMapLocation;
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
import com.amap.api.location.AMapLocationListener;
|
||||
import com.aoleyun.sn.action.JGYActions;
|
||||
import com.aoleyun.sn.bean.BaseResponse;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
import com.mjsheng.myappstore.R;
|
||||
import com.mjsheng.myappstore.utils.CacheUtils;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.mjsheng.myappstore.base.BaseApplication;
|
||||
import com.mjsheng.myappstore.comm.CommonDatas;
|
||||
import com.mjsheng.myappstore.manager.AmapManager;
|
||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.mjsheng.myappstore.service.MainService;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.CmdUtil;
|
||||
import com.mjsheng.myappstore.utils.ForegroundAppUtil;
|
||||
import com.mjsheng.myappstore.utils.Logutils;
|
||||
import com.mjsheng.myappstore.utils.MySQLData;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
import com.mjsheng.myappstore.utils.SaveListUtils;
|
||||
import com.mjsheng.myappstore.utils.ServiceAliveUtils;
|
||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.aoleyun.sn.R;
|
||||
import com.aoleyun.sn.utils.CacheUtils;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.base.BaseApplication;
|
||||
import com.aoleyun.sn.comm.CommonDatas;
|
||||
import com.aoleyun.sn.manager.AmapManager;
|
||||
import com.aoleyun.sn.manager.NetInterfaceManager;
|
||||
import com.aoleyun.sn.network.HTTPInterface;
|
||||
import com.aoleyun.sn.service.MainService;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.CmdUtil;
|
||||
import com.aoleyun.sn.utils.ForegroundAppUtil;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
import com.aoleyun.sn.utils.MySQLData;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.SaveListUtils;
|
||||
import com.aoleyun.sn.utils.ServiceAliveUtils;
|
||||
import com.aoleyun.sn.utils.ToastUtil;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
@@ -59,8 +59,9 @@ import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.ResponseBody;
|
||||
|
||||
public class MyJPushReceiver extends BroadcastReceiver {
|
||||
@@ -189,8 +190,6 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
String extras = bundle.getString(JPushInterface.EXTRA_EXTRA);
|
||||
String package_name = bundle.getString("package_name");
|
||||
Logutils.e(TAG, "message::" + message + "--type::" + type + "--title::" + title + "--extras::" + extras);
|
||||
// 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();
|
||||
switch (message) {
|
||||
default:
|
||||
break;
|
||||
@@ -210,9 +209,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
ToastUtil.betaShow("收到管控:系统设置");
|
||||
if (!TextUtils.isEmpty(extras)) {
|
||||
JGYUtils.getInstance().SettingSysData(extras);
|
||||
// Logutils.e(TAG, "title--------" + extras);
|
||||
}
|
||||
// getSystemSetting();
|
||||
break;
|
||||
case MSG_BROWSER:
|
||||
ToastUtil.betaShow("收到管控:浏览器网址管控");
|
||||
@@ -236,7 +233,6 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
break;
|
||||
case MSG_INSTALL:
|
||||
ToastUtil.betaShow("收到管控:应用安装");
|
||||
// mContext.sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR"));
|
||||
HTTPInterface.getAppLimit(context);
|
||||
doDownloadAndInstall(extras);
|
||||
HTTPInterface.setHideDesktopIcon(mContext);
|
||||
@@ -499,11 +495,6 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
if (packageInfo == null) {
|
||||
Logutils.e(TAG, "doDownloadAndInstall: " + app_package + "未安装");
|
||||
if (!SaveListUtils.isDownLoading(app_url)) {
|
||||
// Aria.download(this)
|
||||
// .load(app_url)
|
||||
// .setFilePath(PathUtils.getExternalDownloadsPath() + "/jgy/" + EncryptUtils.encryptMD5ToString(s) + ".apk", true)
|
||||
// .setExtendField(packageObj.toJSONString())
|
||||
// .create();
|
||||
Logutils.e(TAG, "doDownloadAndInstall: " + app_package + "开始下载");
|
||||
Utils.ariaDownload(mContext, app_url, packageObj);
|
||||
}
|
||||
@@ -516,13 +507,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
}
|
||||
if (app_version_code > appVersionCode) {
|
||||
if (!SaveListUtils.isDownLoading(app_url)) {
|
||||
// Aria.download(this)
|
||||
// .load(app_url)
|
||||
// .setFilePath(PathUtils.getExternalDownloadsPath() + "/jgy/" + EncryptUtils.encryptMD5ToString(s) + ".apk", true)
|
||||
// .setExtendField(packageObj.toJSONString())
|
||||
// .create();
|
||||
Utils.ariaDownload(mContext, app_url, packageObj);
|
||||
|
||||
}
|
||||
} else {
|
||||
Logutils.e(TAG, "doDownloadAndInstall: " + app_package + "已安装最新版");
|
||||
@@ -530,150 +515,6 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
}
|
||||
}
|
||||
|
||||
// private void getAppLimitApi() {
|
||||
// NetInterfaceManager.getAppLimitApi()
|
||||
// .getAppLimitApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new Observer<ResponseBody>() {
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Throwable param1Throwable) {
|
||||
// Logutils.e(TAG, "getAppLimitApi=onError:");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(ResponseBody param1ResponseBody) {
|
||||
// try {
|
||||
// String str2 = param1ResponseBody.string();
|
||||
// Logutils.e(TAG, str2);
|
||||
// JSONObject jSONObject = JSON.parseObject(str2);
|
||||
// JSONObject data = jSONObject.getJSONObject("data");
|
||||
// String result = "";
|
||||
// if (data != null) {
|
||||
// result = data.getString("result");
|
||||
// }
|
||||
// JGYUtils.getInstance().writeAppPackageList(mContext, result);
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable param1Disposable) {
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// private void getForceDownload() {
|
||||
// ForceDownloadApi forceDownloadApi = Network.getForceDownloadApi();
|
||||
// forceDownloadApi.getForceDownloadApi(Configure.HTTP_KEY, Utils.getSerial())
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(new Observer<ForceDownloadBean>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
// Logutils.e("getForceDownload", "forceDownloadApi---onSubscribe");
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onNext(ForceDownloadBean forceDownloadBean) {
|
||||
// switch (forceDownloadBean.getCode()) {
|
||||
// case 200:
|
||||
// Logutils.e("getForceDownload", "isDownloading=" + MyApplication.getInstance().isDownloading());
|
||||
// MyApplication.getInstance().checkIsDownloading();
|
||||
// if (!MyApplication.getInstance().isDownloading()) {
|
||||
// forceDownload(forceDownloadBean.getData());
|
||||
// } else {
|
||||
// }
|
||||
// case -200:
|
||||
// boolean qch_force_app = Settings.System.putString(MainActivity.this.getContentResolver(), "qch_force_app", "invalid");
|
||||
// Logutils.e("fht", "qch_force_app:" + qch_force_app);
|
||||
// break;
|
||||
// default:
|
||||
// Logutils.e("getForceDownload is error:" + forceDownloadBean.getMsg());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Throwable e) {
|
||||
// Logutils.e("getForceDownload", "forceDownloadApi=onError:");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onComplete() {
|
||||
// Logutils.e("getForceDownload", "forceDownloadApi---onComplete");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// private void forceDownload(List<ForceDownloadData> data) {
|
||||
// if (data == null || data.size() <= 0) {
|
||||
// return;
|
||||
// }
|
||||
// List<String> list = new ArrayList<>();
|
||||
// for (int i = 0; i < data.size(); i++) {
|
||||
// ForceDownloadData forceDownloadData = data.get(i);
|
||||
// String app_name = forceDownloadData.getApp_name();
|
||||
// String app_package = forceDownloadData.getApp_package();
|
||||
// String app_url = forceDownloadData.getApp_url();
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.put("app_name", app_name);
|
||||
// jsonObject.put("app_package", app_package);
|
||||
// int app_version_code = forceDownloadData.getApp_version_code();
|
||||
// Logutils.e("fht ", "packageName=" + app_package + ",URL= " + app_url + ",app_version_code=" + app_version_code);
|
||||
// if (data.get(i).getApp_package().equals("com.jiaoguanyi.appstore")) {
|
||||
// continue;//为自身的跳过下载
|
||||
// }
|
||||
// if (!list.contains(app_package)) {
|
||||
// list.add(app_package);
|
||||
// }
|
||||
// PackageManager pm = getPackageManager();
|
||||
// PackageInfo packageInfo = null;
|
||||
// try {
|
||||
// packageInfo = pm.getPackageInfo(app_package, 0);
|
||||
// } catch (PackageManager.NameNotFoundException e) {
|
||||
// e.printStackTrace();
|
||||
// Logutils.e("fht", "forceDownload=" + e.getMessage());
|
||||
// }
|
||||
// if (packageInfo != null) {
|
||||
// long appVersionCode;
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
// appVersionCode = packageInfo.getLongVersionCode();
|
||||
// } else {
|
||||
// appVersionCode = packageInfo.versionCode;
|
||||
// }
|
||||
// if (app_version_code > appVersionCode) {
|
||||
// Logutils.e("fht ", "download URL " + app_url);
|
||||
//// Aria.download(this)
|
||||
//// .load(app_url) //读取下载地址
|
||||
//// .setFilePath(PathUtils.getExternalDownloadsPath() + "/jgy/" + EncryptUtils.encryptMD5ToString(app_package) + ".apk", true)
|
||||
//// .setExtendField(jsonObject.toJSONString())
|
||||
//// .create(); //启动下载}
|
||||
// Utils.ariaDownload(this, app_url, jsonObject);
|
||||
// }
|
||||
// } else {
|
||||
// Logutils.e("fht ", "download URL " + app_url);
|
||||
//// if (!SaveListUtils.isDownLoading(app_package)) {
|
||||
//// Aria.download(this)
|
||||
//// .load(app_url) //读取下载地址
|
||||
//// .setFilePath(PathUtils.getExternalDownloadsPath() + "/jgy/" + EncryptUtils.encryptMD5ToString(app_package) + ".apk", true)
|
||||
//// .setExtendField(jsonObject.toJSONString())
|
||||
//// .create(); //启动下载}
|
||||
// Utils.ariaDownload(this, app_url, jsonObject);
|
||||
//
|
||||
//// SaveListUtils.addDownLoadList(app_package);
|
||||
//// }
|
||||
// }
|
||||
// }
|
||||
// SaveListUtils.setList(list);
|
||||
// SaveListUtils.sendForceAPP(this);
|
||||
// }
|
||||
|
||||
private int getBatteryLevel() {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return ((BatteryManager) this.mContext.getSystemService(Context.BATTERY_SERVICE)).getIntProperty(4);
|
||||
@@ -684,46 +525,10 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
|
||||
private void getDeselectBrowerID() {
|
||||
HTTPInterface.setBrowserBlackList(mContext);//浏览器网址管控
|
||||
|
||||
// Network.getDeselectBrowserIDApi().getDeselectBrowserIDApi("YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=", Utils.getSerial()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<ResponseBody>() {
|
||||
// public void onComplete() {
|
||||
// Logutils.e(TAG, "getDeselectBrowerID---onComplete");
|
||||
// }
|
||||
//
|
||||
// public void onError(Throwable param1Throwable) {
|
||||
// Logutils.e(TAG, "getDeselectBrowerID=onError:");
|
||||
// }
|
||||
//
|
||||
// public void onNext(ResponseBody param1ResponseBody) {
|
||||
// try {
|
||||
// String str1;
|
||||
// String str2 = param1ResponseBody.string();
|
||||
// Logutils.e(TAG, "DeselectBrowserIDApi::" + str2);
|
||||
// JSONObject jSONObject = new JSONObject(str2);
|
||||
// switch (Integer.valueOf(jSONObject.optInt("code")).intValue()) {
|
||||
// case 200:
|
||||
// str1 = jSONObject.getJSONObject("data").optString("ids");
|
||||
// writeDeselectBrowserIDtoSystem(str1);
|
||||
// return;
|
||||
// }
|
||||
// Logutils.e(TAG, "getDeselectBrowerID---code is -200");
|
||||
// return;
|
||||
// } catch (Exception e) {
|
||||
// Logutils.e(TAG, "getDeselectBrowerID---wroing----" + e.getMessage());
|
||||
// e.printStackTrace();
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// public void onSubscribe(Disposable param1Disposable) {
|
||||
// Logutils.e(TAG, "getDeselectBrowerID---onSubscribe");
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
private void getDeselectID() {
|
||||
NetInterfaceManager.getDeselectIDApi()
|
||||
NetInterfaceManager.getInstance().getDeselectIDApi()
|
||||
.getDeselectIDApi(NetInterfaceManager.HTTP_KEY,
|
||||
Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -769,7 +574,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
|
||||
private void setDisableSlideList(String s) {
|
||||
JSONObject jSONObject = JSON.parseObject(s);
|
||||
Logutils.e("mymjsheng", "jSONObject::" + jSONObject.toString());
|
||||
Logutils.e("setDisableSlideList", "jSONObject::" + jSONObject.toString());
|
||||
String strban = jSONObject.getString("ban");
|
||||
String strnot = jSONObject.getString("not");
|
||||
String qch_disable_slide = Settings.System.getString(mContext.getApplicationContext().getContentResolver(), "qch_disable_slide");
|
||||
@@ -795,10 +600,6 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
HTTPInterface.getAppLimit(mContext);
|
||||
}
|
||||
|
||||
// args[1] = message::11--type::11--title::ok--extras::{"ban":"com.lizi.yuwen,com.iyuyan.jp2listensimple,com.netease.edu.study," +
|
||||
// "cn.xuexi.android,com.tuixin.pospointsystem"
|
||||
// ,"not":"com.duoduo.child.story,com.shanbay.words,com.jiongji.andriod.card,fm.jihua.kecheng,com.duia.duiaapp," +
|
||||
// "com.handsgo.jiakao.android,com.chinessjunqi.nb,com.cktiku.gushiwenbibei,com.yangcong345.android.phone"}
|
||||
private void settingCamera(String s) {
|
||||
if (TextUtils.isEmpty(s)) {
|
||||
Intent intent = new Intent("qch_camera_forbid").setPackage("com.android.settings");
|
||||
@@ -810,8 +611,8 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
JSONObject jSONObject = JSON.parseObject(s);
|
||||
String s1 = jSONObject.getString("ban");
|
||||
// String str = jSONObject.optString("not");
|
||||
Logutils.e("mymjsheng", "ban::" + s1);
|
||||
// Logutils.e("mymjsheng", "not::" + str);
|
||||
Logutils.e("settingCamera", "ban::" + s1);
|
||||
// Logutils.e("settingCamera", "not::" + str);
|
||||
if ("0".equals(s1)) {
|
||||
Intent intent2 = new Intent("qch_camera_forbid").setPackage("com.android.settings");
|
||||
// intent2.putExtra("camera_package_name", s1);
|
||||
@@ -829,7 +630,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
// return;
|
||||
}
|
||||
JSONObject jSONObject = JSON.parseObject(s);
|
||||
Logutils.e("mymjsheng", "jSONObject::" + jSONObject.toString());
|
||||
Logutils.e("settingOneNet", "jSONObject::" + jSONObject.toString());
|
||||
|
||||
String packages = jSONObject.getString("package");
|
||||
String status = jSONObject.getString("status");
|
||||
@@ -840,7 +641,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
Logutils.e(TAG, "settingNetControl extras is null");
|
||||
}
|
||||
JSONObject jSONObject = JSON.parseObject(s);
|
||||
Logutils.e("mymjsheng", "jSONObject::" + jSONObject.toString());
|
||||
Logutils.e("settingNetControl", "jSONObject::" + jSONObject.toString());
|
||||
String disallow = jSONObject.getString("ban");
|
||||
String allow = jSONObject.getString("not");
|
||||
HashSet<String> disallowApp = new HashSet<>(Arrays.asList(disallow.split(",")));
|
||||
@@ -866,36 +667,13 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
|
||||
|
||||
private void writeDeselectBrowserIDtoSystem(String s) {
|
||||
// if (!TextUtils.isEmpty(s)) {
|
||||
boolean bool = Settings.System.putString(this.mContext.getContentResolver(), "DeselectBrowserArray", s);
|
||||
Logutils.e("SystemSetting", "DeselectBrowserArray---------" + s);
|
||||
Logutils.e("SystemSetting", "DeselectBrowserArray---------" + bool);
|
||||
// return;
|
||||
// }
|
||||
// Logutils.e(TAG, "writeDeselectBrowserIDtoSystem is null:");
|
||||
}
|
||||
|
||||
private void setHomepagtag(String s) {
|
||||
//设置主页和标签
|
||||
// HTTPInterface.setHomepagtag(mContext);//设置主页和标签
|
||||
|
||||
HTTPInterface.getHomePageBookmarks(mContext, null);
|
||||
// if (TextUtils.isEmpty(s)) {
|
||||
// Logutils.e(TAG, "setHomepagtag extras is null");
|
||||
//
|
||||
// return;
|
||||
// } else {
|
||||
// try {
|
||||
// JSONObject jsonObject = JSON.parseObject(s);
|
||||
// String packageweb = jsonObject.getString("");
|
||||
// ArrayList<String> strings = new ArrayList<>();
|
||||
// Intent intent = new Intent("action");
|
||||
// intent.putStringArrayListExtra("package", strings);
|
||||
// mContext.sendBroadcast(intent);
|
||||
// } catch (Exception e) {
|
||||
// ToastUtil.show("数据错误");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private void setAPPinsideWebsite(String s) {
|
||||
@@ -906,51 +684,8 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
Logutils.e(TAG, "ononComplete: setAPPinsideWebsite");
|
||||
}
|
||||
});
|
||||
//app内部网页管控
|
||||
|
||||
// if (TextUtils.isEmpty(s)) {
|
||||
// Logutils.e(TAG, "setAPPinsideWebsite extras is null");
|
||||
//
|
||||
// return;
|
||||
// } else {
|
||||
// try {
|
||||
// JSONObject jSONObject = new JSONObject(s);
|
||||
// String str = jSONObject.optString("package");
|
||||
// Intent intent = new Intent("qch_app_website");
|
||||
// intent.putExtra("package_name", str);
|
||||
// mContext.sendBroadcast(intent);
|
||||
// } catch (JSONException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
//应用id管控
|
||||
// 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("writeDeselectIDtoSystem", result);
|
||||
// if (!result.contains(appstore)) {
|
||||
// result = result + "," + appstore;
|
||||
// }
|
||||
// if (!result.contains(store)) {
|
||||
// result = result + "," + store;
|
||||
// }
|
||||
// String olddeselectViewArray = Settings.System.getString(this.mContext.getContentResolver(), "qch_app_forbid_id");
|
||||
// Logutils.e("SystemSetting", "olddeselectViewArray---------" + olddeselectViewArray);
|
||||
// Settings.System.putString(this.mContext.getContentResolver(), "qch_app_forbid_id", result);
|
||||
// Settings.System.putString(this.mContext.getContentResolver(), "DeselectViewArray", s1);
|
||||
// Logutils.e("qch_app_forbid_id", "qch_app_forbid_id---------" + result);
|
||||
// Logutils.e("SystemSetting", "deselectViewArray---------" + s1);
|
||||
// return;
|
||||
// } else {
|
||||
// Logutils.e(TAG, "writeDeselectIDtoSystem is null:");
|
||||
// Settings.System.putString(this.mContext.getContentResolver(), "DeselectViewArray", "Invalid");
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 锁定设备
|
||||
*
|
||||
@@ -964,7 +699,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
JSONObject jSONObject = JSON.parseObject(s);
|
||||
|
||||
int i = changeNum(jSONObject.getIntValue("lock"));
|
||||
Settings.System.putInt(this.mContext.getContentResolver(), "qch_unlock_ipad", i);
|
||||
Settings.System.putInt(this.mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, i);
|
||||
Logutils.e("SystemSetting", "qch_unlock_ipad---------" + i);
|
||||
|
||||
if (getBatteryLevel() >= CommonDatas.MIN_POWER) {
|
||||
@@ -1030,23 +765,36 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
Logutils.e("uplaodImage", "File does not exists");
|
||||
return;
|
||||
}
|
||||
OkGo.post(URLAddress.SEND_SCREENSHOT)
|
||||
.params("sn", Utils.getSerial())
|
||||
.params("createtime", time)
|
||||
.params("file", file)
|
||||
.execute(new StringCallback() {
|
||||
//设置图片格式
|
||||
// RequestBody requestFile = RequestBody.create(MediaType.parse("image/jpg"), file);
|
||||
//File转RequestBody
|
||||
MediaType mediaType = MediaType.Companion.parse("image/png");
|
||||
RequestBody fileBody = RequestBody.Companion.create(file, mediaType);
|
||||
//设置一个file文件
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("file", file.getName(), fileBody);
|
||||
NetInterfaceManager.getInstance().getScreenshotApi()
|
||||
.sendScreenshot(Utils.getSerial(), time, body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSuccess(String s, Call call, Response response) {
|
||||
JSONObject object = JSON.parseObject(s);
|
||||
int code = object.getInteger("code");
|
||||
String msg = object.getString("msg");
|
||||
Logutils.e("uplaodImage", "code:" + code + "," + msg);
|
||||
public void onSubscribe(Disposable d) {
|
||||
Log.e("uplaodImage", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Call call, Response response, Exception e) {
|
||||
super.onError(call, response, e);
|
||||
Logutils.e("uplaodImage", "e=" + e.getMessage());
|
||||
public void onNext(BaseResponse baseResponse) {
|
||||
Log.e("uplaodImage", "onNext: " + baseResponse.msg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
Log.e("uplaodImage", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("uplaodImage", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1058,9 +806,6 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
private void getTopApp(Context context, String extras) {
|
||||
JSONObject jsonObject = JSON.parseObject(extras);
|
||||
String packageName = jsonObject.getString("app_package");
|
||||
// if (TextUtils.isEmpty(packageName)) {
|
||||
// return;
|
||||
// }
|
||||
if (TextUtils.isEmpty(packageName)) {
|
||||
SPUtils.put(context, ForegroundAppUtil.TOPAPP_KEY, "");
|
||||
ForegroundAppUtil.setTopAppClass(context, "");
|
||||
@@ -1069,7 +814,6 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
ForegroundAppUtil.setTopAppClass(context, packageName);
|
||||
ForegroundAppUtil.openTopApp(context);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void setBootanimation(Context context, String extras) {
|
||||
@@ -1115,9 +859,6 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
MediaPlayer mediaPlayer;
|
||||
|
||||
public void defaultCallMediaPlayer(Context context) {
|
||||
// Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
|
||||
// Ringtone r = RingtoneManager.getRingtone(mContext, notification);
|
||||
// r.play();
|
||||
if (mediaPlayer != null) {
|
||||
mediaPlayer.stop();
|
||||
mediaPlayer.release();
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.receiver;
|
||||
package com.aoleyun.sn.receiver;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -9,27 +9,26 @@ import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.CacheUtils;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.mjsheng.myappstore.utils.Logutils;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
import com.mjsheng.myappstore.utils.SaveListUtils;
|
||||
import com.aoleyun.sn.comm.PackageNames;
|
||||
import com.aoleyun.sn.network.HTTPInterface;
|
||||
import com.aoleyun.sn.utils.ApkUtils;
|
||||
import com.aoleyun.sn.utils.CacheUtils;
|
||||
import com.aoleyun.sn.utils.JGYUtils;
|
||||
import com.aoleyun.sn.utils.Logutils;
|
||||
import com.aoleyun.sn.utils.SPUtils;
|
||||
import com.aoleyun.sn.utils.SaveListUtils;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class NewAppReceiver extends BroadcastReceiver {
|
||||
private static final String TAG = NewAppReceiver.class.getSimpleName();
|
||||
private static final String APPSTORE = "com.jiaoguanyi.store";
|
||||
|
||||
private static NewAppListener newAppListener;
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static Context mContext;
|
||||
@@ -67,27 +66,16 @@ public class NewAppReceiver extends BroadcastReceiver {
|
||||
}
|
||||
Logutils.e(TAG, "sendAppInfo: " + state + packageName);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
if (!APPSTORE.equals(packageName) || !BuildConfig.APPLICATION_ID.equals(packageName)) {
|
||||
if (!PackageNames.APPSTORE.equals(packageName) || !PackageNames.DEVICE_INFO.equals(packageName)) {
|
||||
ApkUtils.addShortcut(context);
|
||||
ApkUtils.RemoveTask(context, packageName);
|
||||
}
|
||||
Intent bootIntent = new Intent(BootReceiver.BOOT_COMPLETED);
|
||||
bootIntent.setComponent(new ComponentName("com.jiaoguanyi.store", "com.mjsheng.myappstore.receiver.BootReceiver"));
|
||||
bootIntent.setComponent(new ComponentName(PackageNames.APPSTORE, PackageNames.APP_STORE_BOOTRECEIVER));
|
||||
context.sendBroadcast(bootIntent);
|
||||
//启动教官壹
|
||||
}
|
||||
newAppListener.setNewAppListener(packageName);
|
||||
//接收卸载广播
|
||||
// if (action.equals(Intent.ACTION_PACKAGE_REMOVED)) {
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
// if (!"com.jiaoguanyi.store".equals(packageName) || !"com.jiaoguanyi.appstore".equals(packageName)) {
|
||||
// ApkUtils.addShortcut(context, result);
|
||||
// }
|
||||
// Intent intent1 = new Intent(BootReceiver.BOOT_COMPLETED);
|
||||
// intent1.setComponent(new ComponentName("com.jiaoguanyi.store", "com.mjsheng.myappstore.receiver.BootReceiver"));
|
||||
// context.sendBroadcast(intent1);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private void cleanLauncher3Cache() {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user