version:
update:2021.03.30 fix:更换包名,安装应用时只执行最后一次请求,开机动画测试 add:
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.activity;
|
||||
package com.jiaoguanyi.appstore.activity;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -16,16 +16,16 @@ import android.widget.TextView;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
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.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.ExampleUtil;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
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.jiaoguanyi.appstore.BuildConfig;
|
||||
import com.jiaoguanyi.appstore.R;
|
||||
import com.jiaoguanyi.appstore.base.BaseActivity;
|
||||
import com.jiaoguanyi.appstore.utils.ApkUtils;
|
||||
import com.jiaoguanyi.appstore.utils.ExampleUtil;
|
||||
import com.jiaoguanyi.appstore.utils.JGYUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SaveListUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SysSettingUtils;
|
||||
import com.jiaoguanyi.appstore.utils.ToastUtil;
|
||||
import com.jiaoguanyi.appstore.utils.Utils;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -38,6 +38,7 @@ import io.reactivex.Observer;
|
||||
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 {
|
||||
@BindView(R.id.imageView)
|
||||
@@ -242,7 +243,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
showDialog(jsonObject);
|
||||
} else {
|
||||
Observable.timer(5000, TimeUnit.MILLISECONDS)
|
||||
.observeOn(rx.android.schedulers.AndroidSchedulers.mainThread())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> ToastUtil.show("已经是最新版本"));
|
||||
}
|
||||
}
|
||||
@@ -337,9 +338,6 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
@@ -375,7 +373,7 @@ public class MainActivity extends BaseActivity implements MainContact.MainView {
|
||||
}
|
||||
}
|
||||
|
||||
private void setStoreUpdateListener(View view){
|
||||
private void setStoreUpdateListener(View view) {
|
||||
ObservableOnSubscribe<View> mObservableOnSubscribe = new ObservableOnSubscribe<View>() {
|
||||
@Override
|
||||
public void subscribe(@NonNull ObservableEmitter<View> emitter) throws Exception {
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.mjsheng.myappstore.activity;
|
||||
package com.jiaoguanyi.appstore.activity;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.mjsheng.myappstore.base.BasePresenter;
|
||||
import com.mjsheng.myappstore.base.BaseView;
|
||||
import com.jiaoguanyi.appstore.base.BasePresenter;
|
||||
import com.jiaoguanyi.appstore.base.BaseView;
|
||||
|
||||
public class MainContact {
|
||||
public interface MainView extends BaseView {
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mjsheng.myappstore.activity;
|
||||
package com.jiaoguanyi.appstore.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
@@ -19,27 +18,26 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.base.BaseApplication;
|
||||
import com.mjsheng.myappstore.bean.Appground;
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.Batch;
|
||||
import com.mjsheng.myappstore.bean.BrowserBookmarks;
|
||||
import com.mjsheng.myappstore.bean.BrowserData;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadBean;
|
||||
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.api.newapi.UpdateDeviceInfoApi;
|
||||
import com.mjsheng.myappstore.server.MainService;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
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.Utils;
|
||||
import com.jiaoguanyi.appstore.BuildConfig;
|
||||
import com.jiaoguanyi.appstore.base.BaseApplication;
|
||||
import com.jiaoguanyi.appstore.bean.Appground;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.bean.Batch;
|
||||
import com.jiaoguanyi.appstore.bean.BrowserBookmarks;
|
||||
import com.jiaoguanyi.appstore.bean.BrowserData;
|
||||
import com.jiaoguanyi.appstore.bean.ForceDownloadBean;
|
||||
import com.jiaoguanyi.appstore.bean.NetAndLaunchBean;
|
||||
import com.jiaoguanyi.appstore.bean.StudentsInfo;
|
||||
import com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper;
|
||||
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.UpdateDeviceInfoApi;
|
||||
import com.jiaoguanyi.appstore.server.MainService;
|
||||
import com.jiaoguanyi.appstore.utils.ApkUtils;
|
||||
import com.jiaoguanyi.appstore.utils.JGYUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SPUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SysSettingUtils;
|
||||
import com.jiaoguanyi.appstore.utils.TimeUtils;
|
||||
import com.jiaoguanyi.appstore.utils.Utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
@@ -47,12 +45,8 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
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;
|
||||
@@ -60,8 +54,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.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.ACTION_SET;
|
||||
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.sequence;
|
||||
|
||||
public class MainPresenter implements MainContact.Presenter {
|
||||
private static final String TAG = MainPresenter.class.getSimpleName();
|
||||
@@ -404,7 +398,6 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
public void setJpushTags() {
|
||||
NetInterfaceManager.getInstance()
|
||||
.getJpushTagsObservable()
|
||||
.observeOn(Schedulers.io())
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
@@ -885,10 +878,10 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse response) {
|
||||
Log.e("getDesktopIcon", "onNext: ");
|
||||
String data = response.data.toString();
|
||||
ApkUtils.showAllAPP(mContext);
|
||||
Log.e("getDesktopIcon", "data: " + data);
|
||||
if (response.code == 200) {
|
||||
String data = response.data.toString();
|
||||
Log.e("getDesktopIcon", "data: " + data);
|
||||
if (!TextUtils.isEmpty(data)) {
|
||||
List<String> newList = Arrays.asList(data.split(","));//新的list
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
@@ -1102,10 +1095,9 @@ public class MainPresenter implements MainContact.Presenter {
|
||||
Log.e("getScreenLockState", "onNext: ");
|
||||
if (response.code == 200) {
|
||||
String bodyString = response.data.toString();
|
||||
JsonObject jsonObject = JsonParser.parseString(bodyString).getAsJsonObject();
|
||||
JsonObject data = jsonObject.getAsJsonObject(response.data.toString());
|
||||
int is_screen_lock = data.get("is_screen_lock").getAsInt();
|
||||
String name = data.get("name").getAsString();
|
||||
JsonObject jsonObject = JsonParser.parseString(new Gson().toJson(response.data)).getAsJsonObject();
|
||||
int is_screen_lock = jsonObject.get("is_screen_lock").getAsInt();
|
||||
String name = jsonObject.get("name").getAsString();
|
||||
mView.setScreenLockStateFinished(is_screen_lock == 1, name);
|
||||
} else {
|
||||
mView.setScreenLockStateFinished(false, "");
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.activity;
|
||||
package com.jiaoguanyi.appstore.activity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
@@ -36,33 +36,33 @@ import com.blankj.utilcode.util.EncryptUtils;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.mjsheng.myappstore.BuildConfig;
|
||||
import com.mjsheng.myappstore.R;
|
||||
import com.mjsheng.myappstore.base.BaseApplication;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadBean;
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadData;
|
||||
import com.mjsheng.myappstore.bean.LzyResponse;
|
||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
||||
import com.mjsheng.myappstore.bean.NetAndLaunchData;
|
||||
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.network.URLAddress;
|
||||
import com.mjsheng.myappstore.network.api.AppLimitApi;
|
||||
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.SystemSettingApi;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.ExampleUtil;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
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.jiaoguanyi.appstore.BuildConfig;
|
||||
import com.jiaoguanyi.appstore.R;
|
||||
import com.jiaoguanyi.appstore.base.BaseApplication;
|
||||
import com.jiaoguanyi.appstore.bean.ForceDownloadBean;
|
||||
import com.jiaoguanyi.appstore.bean.ForceDownloadData;
|
||||
import com.jiaoguanyi.appstore.bean.LzyResponse;
|
||||
import com.jiaoguanyi.appstore.bean.NetAndLaunchBean;
|
||||
import com.jiaoguanyi.appstore.bean.NetAndLaunchData;
|
||||
import com.jiaoguanyi.appstore.bean.StudentsInfo;
|
||||
import com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper;
|
||||
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
|
||||
import com.jiaoguanyi.appstore.network.HTTPInterface;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.network.api.AppLimitApi;
|
||||
import com.jiaoguanyi.appstore.network.api.DeselectBrowserIDApi;
|
||||
import com.jiaoguanyi.appstore.network.api.DeselectIDApi;
|
||||
import com.jiaoguanyi.appstore.network.api.ForceDownloadApi;
|
||||
import com.jiaoguanyi.appstore.network.api.NetAndLaunchApi;
|
||||
import com.jiaoguanyi.appstore.network.api.SystemSettingApi;
|
||||
import com.jiaoguanyi.appstore.utils.ApkUtils;
|
||||
import com.jiaoguanyi.appstore.utils.ExampleUtil;
|
||||
import com.jiaoguanyi.appstore.utils.JGYUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SPUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SaveListUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SysSettingUtils;
|
||||
import com.jiaoguanyi.appstore.utils.ToastUtil;
|
||||
import com.jiaoguanyi.appstore.utils.Utils;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@@ -85,9 +85,9 @@ import okhttp3.ResponseBody;
|
||||
import rx.Observable;
|
||||
import rx.functions.Action1;
|
||||
|
||||
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_SET;
|
||||
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.TagAliasBean;
|
||||
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
|
||||
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.ACTION_SET;
|
||||
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.TagAliasBean;
|
||||
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.sequence;
|
||||
|
||||
public class OldActivity extends AppCompatActivity {
|
||||
private static final String TAG = OldActivity.class.getSimpleName();
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.jiaoguanyi.appstore.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.jiaoguanyi.appstore.BuildConfig;
|
||||
import com.jiaoguanyi.appstore.R;
|
||||
import com.jiaoguanyi.appstore.utils.Utils;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
public class SplashActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_home);
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
startActivity(new Intent(SplashActivity.this, MainActivity.class));
|
||||
finish();
|
||||
}
|
||||
}, 2000);
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
DebugTest();
|
||||
}
|
||||
}
|
||||
|
||||
private void DebugTest() {
|
||||
Utils.getHardware(this);
|
||||
|
||||
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();
|
||||
Log.e("bootanimation", e.getMessage());
|
||||
}
|
||||
}
|
||||
Log.e("bootanimation", "SD卡路径存在");
|
||||
try {
|
||||
Path path = Paths.get(file.getAbsolutePath());
|
||||
Files.copy(path, new FileOutputStream(path0));
|
||||
} catch (Exception e) {
|
||||
Log.e("bootanimation", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mjsheng.myappstore.activity;
|
||||
package com.jiaoguanyi.appstore.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.jiaoguanyi.appstore.R;
|
||||
|
||||
public class TopActivity extends AppCompatActivity {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.base;
|
||||
package com.jiaoguanyi.appstore.base;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.base;
|
||||
package com.jiaoguanyi.appstore.base;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -28,24 +28,24 @@ 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.NetInterfaceManager;
|
||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.mjsheng.myappstore.network.api.newapi.GetLockStateApi;
|
||||
import com.mjsheng.myappstore.receiver.NewAppReceiver;
|
||||
import com.mjsheng.myappstore.server.GuardService;
|
||||
import com.mjsheng.myappstore.server.MainService;
|
||||
import com.mjsheng.myappstore.server.StepService;
|
||||
import com.mjsheng.myappstore.statistics.AppInformation;
|
||||
import com.mjsheng.myappstore.statistics.StatisticsInfo;
|
||||
import com.mjsheng.myappstore.utils.JGYUtils;
|
||||
import com.mjsheng.myappstore.utils.NetworkUtils;
|
||||
import com.mjsheng.myappstore.utils.SystemUtils;
|
||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.jiaoguanyi.appstore.BuildConfig;
|
||||
import com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper;
|
||||
import com.jiaoguanyi.appstore.manager.AmapManager;
|
||||
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
|
||||
import com.jiaoguanyi.appstore.network.HTTPInterface;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.GetLockStateApi;
|
||||
import com.jiaoguanyi.appstore.receiver.NewAppReceiver;
|
||||
import com.jiaoguanyi.appstore.server.GuardService;
|
||||
import com.jiaoguanyi.appstore.server.MainService;
|
||||
import com.jiaoguanyi.appstore.server.StepService;
|
||||
import com.jiaoguanyi.appstore.statistics.AppInformation;
|
||||
import com.jiaoguanyi.appstore.statistics.StatisticsInfo;
|
||||
import com.jiaoguanyi.appstore.utils.JGYUtils;
|
||||
import com.jiaoguanyi.appstore.utils.NetworkUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SystemUtils;
|
||||
import com.jiaoguanyi.appstore.utils.ToastUtil;
|
||||
import com.jiaoguanyi.appstore.utils.Utils;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
@@ -74,7 +74,7 @@ import rx.functions.Action1;
|
||||
*/
|
||||
|
||||
//public class MyApplication extends MultiDexApplication implements Thread.UncaughtExceptionHandler {
|
||||
public class BaseApplication extends MultiDexApplication {
|
||||
public class BaseApplication extends MultiDexApplication{
|
||||
private final String TAG = BaseApplication.class.getSimpleName();
|
||||
|
||||
public static Context context;
|
||||
@@ -621,7 +621,7 @@ public class BaseApplication extends MultiDexApplication {
|
||||
data.put("data", appinfo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("fht", e.getMessage());
|
||||
Log.e("sendAppUsedTime", e.getMessage());
|
||||
}
|
||||
OkGo.post(URLAddress.SEND_USEDTIME)
|
||||
.params("sn", Utils.getSerial())
|
||||
@@ -639,7 +639,7 @@ public class BaseApplication extends MultiDexApplication {
|
||||
@Override
|
||||
public void onError(Call call, Response response, Exception e) {
|
||||
super.onError(call, response, e);
|
||||
Log.e("fht", e.getMessage());
|
||||
Log.e("sendAppUsedTime", e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.base;
|
||||
package com.jiaoguanyi.appstore.base;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.jiaoguanyi.appstore.base;
|
||||
|
||||
public interface BaseView {
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
@@ -11,9 +11,9 @@ import android.content.pm.ResolveInfo;
|
||||
import android.database.Cursor;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mjsheng.myappstore.database.DBHelper;
|
||||
import com.mjsheng.myappstore.database.DBSqlBuilder;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.jiaoguanyi.appstore.database.DBHelper;
|
||||
import com.jiaoguanyi.appstore.database.DBSqlBuilder;
|
||||
import com.jiaoguanyi.appstore.utils.Utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/1/10.
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
|
||||
import java.util.List;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonIOException;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
|
||||
import java.util.List;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.lzy.okgo.callback.AbsCallback;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
|
||||
import java.util.List;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2016/10/9.
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
public class SearchBean {
|
||||
private String category;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.bean;
|
||||
package com.jiaoguanyi.appstore.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.comm;
|
||||
package com.jiaoguanyi.appstore.comm;
|
||||
|
||||
|
||||
public class CommonDatas {
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.database;
|
||||
package com.jiaoguanyi.appstore.database;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.database;
|
||||
package com.jiaoguanyi.appstore.database;
|
||||
|
||||
public class DBSqlBuilder {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.jiaoguanyi.appstore.jpush;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.jiaoguanyi.appstore.jpush;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.jiaoguanyi.appstore.jpush;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.jiaoguanyi.appstore.jpush;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mjsheng.myappstore.base.BaseApplication;
|
||||
import com.jiaoguanyi.appstore.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.jiaoguanyi.appstore.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.jiaoguanyi.appstore.activity.MainActivity;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.jiaoguanyi.appstore.jpush;
|
||||
|
||||
import cn.jpush.android.service.JCommonService;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush;
|
||||
package com.jiaoguanyi.appstore.jpush;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.jpush.invalid;
|
||||
package com.jiaoguanyi.appstore.jpush.invalid;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import com.mjsheng.myappstore.jpush.Logger;
|
||||
import com.jiaoguanyi.appstore.jpush.Logger;
|
||||
|
||||
import cn.jpush.android.api.JPushInterface;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush.invalid;
|
||||
package com.jiaoguanyi.appstore.jpush.invalid;
|
||||
|
||||
|
||||
//public class MainActivity extends InstrumentedActivity implements OnClickListener{
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush.invalid;
|
||||
package com.jiaoguanyi.appstore.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.jiaoguanyi.appstore.jpush.invalid;
|
||||
|
||||
//public class SettingActivity extends InstrumentedActivity implements OnClickListener {
|
||||
// TimePicker startTime;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.jpush.invalid;
|
||||
package com.jiaoguanyi.appstore.jpush.invalid;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.log;
|
||||
package com.jiaoguanyi.appstore.log;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@@ -1,13 +1,10 @@
|
||||
package com.mjsheng.myappstore.log;
|
||||
package com.jiaoguanyi.appstore.log;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.os.Process;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.manager;
|
||||
package com.jiaoguanyi.appstore.manager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
@@ -7,7 +7,7 @@ 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.SPUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SPUtils;
|
||||
|
||||
public class AmapManager {
|
||||
private static AmapManager sInstance;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.manager;
|
||||
package com.jiaoguanyi.appstore.manager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
@@ -0,0 +1,367 @@
|
||||
package com.jiaoguanyi.appstore.manager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Environment;
|
||||
|
||||
import com.jiaoguanyi.appstore.BuildConfig;
|
||||
import com.jiaoguanyi.appstore.bean.Appground;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.bean.BrowserBookmarks;
|
||||
import com.jiaoguanyi.appstore.bean.BrowserData;
|
||||
import com.jiaoguanyi.appstore.bean.ForceDownloadBean;
|
||||
import com.jiaoguanyi.appstore.bean.NetAndLaunchBean;
|
||||
import com.jiaoguanyi.appstore.bean.StudentsInfo;
|
||||
import com.jiaoguanyi.appstore.network.api.AppLimitApi;
|
||||
import com.jiaoguanyi.appstore.network.api.BrankPicApi;
|
||||
import com.jiaoguanyi.appstore.network.api.CategoryPicApi;
|
||||
import com.jiaoguanyi.appstore.network.api.DeselectBrowserIDApi;
|
||||
import com.jiaoguanyi.appstore.network.api.DeselectIDApi;
|
||||
import com.jiaoguanyi.appstore.network.api.ForceDownloadApi;
|
||||
import com.jiaoguanyi.appstore.network.api.NetAndLaunchApi;
|
||||
import com.jiaoguanyi.appstore.network.api.ProjectPicApi;
|
||||
import com.jiaoguanyi.appstore.network.api.RankAppApi;
|
||||
import com.jiaoguanyi.appstore.network.api.SystemSettingApi;
|
||||
import com.jiaoguanyi.appstore.network.api.UploadAppInfoApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.AppinsideWebApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.BrowserBookmarksApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.BrowserListApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.CheckTestUpdateApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.CheckUpdateApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.DesktopIconApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.DevicesLockedStateApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.GetBatchApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.GetDesktopApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.GetLockStateApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.JpushTagsApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.MACAddressApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.ScreenLockStateApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.SnTimeControl;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.StudentsInfosApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.TopAppControlApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.UpdateDeviceInfoApi;
|
||||
import com.jiaoguanyi.appstore.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import cn.jpush.android.api.JPushInterface;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.Cache;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.CallAdapter;
|
||||
import retrofit2.Converter;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class NetInterfaceManager {
|
||||
private static NetInterfaceManager sInstance;
|
||||
private Context mContext;
|
||||
private static Retrofit mRetrofit;
|
||||
|
||||
public static final String ROOT_URL = BuildConfig.ROOT_URL;
|
||||
public static final String WEBSOCKET_URL = BuildConfig.WebsocketURL;
|
||||
public static final String HTTP_KEY = "YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=";
|
||||
|
||||
|
||||
private NetInterfaceManager(Context context) {
|
||||
this.mContext = context;
|
||||
if (null == mRetrofit) {
|
||||
mRetrofit = new Retrofit.Builder()
|
||||
.client(okHttpClient)
|
||||
.baseUrl(ROOT_URL)
|
||||
.addConverterFactory(gsonConverterFactory)
|
||||
.addCallAdapterFactory(rxJavaCallAdapterFactory)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new NetInterfaceManager(context);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static NetInterfaceManager getInstance() {
|
||||
if (sInstance == null) {
|
||||
throw new IllegalStateException("You must be init NetworkManager first");
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
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)
|
||||
.getStudentsInfo(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备锁状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Observable<BaseResponse> getDevicesLockedStateObservable() {
|
||||
return mRetrofit
|
||||
.create(DevicesLockedStateApi.class)
|
||||
.getLockedState(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送设备mac地址
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Observable<BaseResponse> sendMACAddressObservable() {
|
||||
return mRetrofit
|
||||
.create(MACAddressApi.class)
|
||||
.sendMACaddress(Utils.getSerial(),
|
||||
Utils.getAndroid7MAC(),
|
||||
JPushInterface.getRegistrationID(mContext),
|
||||
Utils.getProperty("ro.custom.build.version", "获取失败"),
|
||||
BuildConfig.VERSION_NAME,
|
||||
Utils.getAPPVersionName(mContext)
|
||||
)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取极光推送的tag
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Observable<BaseResponse> getJpushTagsObservable() {
|
||||
return mRetrofit
|
||||
.create(JpushTagsApi.class)
|
||||
.getJpushTags(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
|
||||
public Observable<BaseResponse<BrowserData>> getBrowserListSettingObservable() {
|
||||
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)
|
||||
.getBrowserBookmarks(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getDesktopIconObservable() {
|
||||
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)
|
||||
.getNetAndLaunchApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<ResponseBody> getAppIDControlObservable() {
|
||||
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)
|
||||
.getAppinsideWeb(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<ResponseBody> getSystemSettingObservable() {
|
||||
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)
|
||||
.getAppLimitApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<ForceDownloadBean> getForceDownloadObservable() {
|
||||
return mRetrofit
|
||||
.create(ForceDownloadApi.class)
|
||||
.getForceDownloadApi(NetInterfaceManager.HTTP_KEY, Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
|
||||
public Observable<BaseResponse> getTestUpdateObservable() {
|
||||
return mRetrofit
|
||||
.create(CheckTestUpdateApi.class)
|
||||
.getTestUpdate(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getSnTimeObservable() {
|
||||
return mRetrofit
|
||||
.create(SnTimeControl.class)
|
||||
.getSnTimeControl(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getScreenLockObservable() {
|
||||
return mRetrofit
|
||||
.create(ScreenLockStateApi.class)
|
||||
.getScreenLockState(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getDesktopObservable() {
|
||||
return mRetrofit
|
||||
.create(GetDesktopApi.class)
|
||||
.getDesktop(Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<ResponseBody> getBatchObservable() {
|
||||
return mRetrofit
|
||||
.create(GetBatchApi.class)
|
||||
.getBatch(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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network;
|
||||
package com.jiaoguanyi.appstore.network;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
@@ -18,23 +18,23 @@ import com.alibaba.fastjson.JSONException;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.mjsheng.myappstore.base.BaseApplication;
|
||||
import com.mjsheng.myappstore.bean.Appground;
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
||||
import com.mjsheng.myappstore.bean.NetAndLaunchData;
|
||||
import com.mjsheng.myappstore.jpush.TagAliasOperatorHelper;
|
||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
||||
import com.mjsheng.myappstore.network.api.newapi.SnTimeControl;
|
||||
import com.mjsheng.myappstore.network.api.newapi.TopAppControlApi;
|
||||
import com.mjsheng.myappstore.network.api.newapi.UpdateDeviceInfoApi;
|
||||
import com.mjsheng.myappstore.server.MainService;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.ForegroundAppUtil;
|
||||
import com.mjsheng.myappstore.utils.Logger;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
import com.mjsheng.myappstore.utils.TimeUtils;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.jiaoguanyi.appstore.base.BaseApplication;
|
||||
import com.jiaoguanyi.appstore.bean.Appground;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.bean.NetAndLaunchBean;
|
||||
import com.jiaoguanyi.appstore.bean.NetAndLaunchData;
|
||||
import com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper;
|
||||
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.SnTimeControl;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.TopAppControlApi;
|
||||
import com.jiaoguanyi.appstore.network.api.newapi.UpdateDeviceInfoApi;
|
||||
import com.jiaoguanyi.appstore.server.MainService;
|
||||
import com.jiaoguanyi.appstore.utils.ApkUtils;
|
||||
import com.jiaoguanyi.appstore.utils.ForegroundAppUtil;
|
||||
import com.jiaoguanyi.appstore.utils.Logger;
|
||||
import com.jiaoguanyi.appstore.utils.SPUtils;
|
||||
import com.jiaoguanyi.appstore.utils.TimeUtils;
|
||||
import com.jiaoguanyi.appstore.utils.Utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
@@ -50,8 +50,8 @@ import okhttp3.Call;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.ResponseBody;
|
||||
|
||||
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.ACTION_SET;
|
||||
import static com.mjsheng.myappstore.jpush.TagAliasOperatorHelper.sequence;
|
||||
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.ACTION_SET;
|
||||
import static com.jiaoguanyi.appstore.jpush.TagAliasOperatorHelper.sequence;
|
||||
|
||||
public class HTTPInterface {
|
||||
// //获取我的设备接口
|
||||
@@ -373,7 +373,7 @@ public class HTTPInterface {
|
||||
@Override
|
||||
public void onError(Call call, Response response, Exception e) {
|
||||
super.onError(call, response, e);
|
||||
Log.e("fht", e.getMessage());
|
||||
Log.e("setJpushTags", e.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -395,7 +395,7 @@ public class HTTPInterface {
|
||||
@Override
|
||||
public void onError(Call call, Response response, Exception e) {
|
||||
super.onError(call, response, e);
|
||||
Log.e("fht", e.getMessage() + "???");
|
||||
Log.e("cleanJpushAlias", e.getMessage() + "???");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -801,6 +801,7 @@ public class HTTPInterface {
|
||||
jsonObject.put("address", address);
|
||||
jsonObject.put("longitude", longitude);
|
||||
jsonObject.put("latitude", latitude);
|
||||
String add = jsonObject.toJSONString();
|
||||
UpdateDeviceInfoApi updateDeviceInfo = NetInterfaceManager.getUpdateDeviceInfo();
|
||||
updateDeviceInfo.updateDeviceInfo(
|
||||
Utils.getSerial(),
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mjsheng.myappstore.network;
|
||||
package com.jiaoguanyi.appstore.network;
|
||||
|
||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
||||
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import com.mjsheng.myappstore.bean.CommonPicBean;
|
||||
import com.jiaoguanyi.appstore.bean.CommonPicBean;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import com.mjsheng.myappstore.bean.CategoryPicBean;
|
||||
import com.jiaoguanyi.appstore.bean.CategoryPicBean;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import com.mjsheng.myappstore.bean.ForceDownloadBean;
|
||||
import com.jiaoguanyi.appstore.bean.ForceDownloadBean;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import com.mjsheng.myappstore.bean.NetAndLaunchBean;
|
||||
import com.jiaoguanyi.appstore.bean.NetAndLaunchBean;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import com.mjsheng.myappstore.bean.CommonPicBean;
|
||||
import com.mjsheng.myappstore.bean.ProjectPicBean;
|
||||
import com.jiaoguanyi.appstore.bean.CommonPicBean;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import com.mjsheng.myappstore.bean.AppInfoBean;
|
||||
import com.jiaoguanyi.appstore.bean.AppInfoBean;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.POST;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,6 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
|
||||
import com.mjsheng.myappstore.bean.CommonPicBean;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,14 +1,10 @@
|
||||
package com.mjsheng.myappstore.network.api;
|
||||
package com.jiaoguanyi.appstore.network.api;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.Multipart;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.Path;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
|
||||
import com.mjsheng.myappstore.bean.Appground;
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.Appground;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.BrowserBookmarks;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.bean.BrowserBookmarks;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.BrowserData;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.bean.BrowserData;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.BrowserBookmarks;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,9 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.Batch;
|
||||
import com.mjsheng.myappstore.bean.LzyResponse;
|
||||
|
||||
import java.util.List;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.StudentsInfo;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.bean.StudentsInfo;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.bean.StudentsInfo;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Field;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import com.mjsheng.myappstore.bean.BaseResponse;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.bean.BaseResponse;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.GET;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.network.api.newapi;
|
||||
package com.jiaoguanyi.appstore.network.api.newapi;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.ResponseBody;
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.mjsheng.myappstore.receiver;
|
||||
package com.jiaoguanyi.appstore.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mjsheng.myappstore.network.HTTPInterface;
|
||||
import com.mjsheng.myappstore.server.GuardService;
|
||||
import com.mjsheng.myappstore.server.MainService;
|
||||
import com.mjsheng.myappstore.server.StepService;
|
||||
import com.jiaoguanyi.appstore.network.HTTPInterface;
|
||||
import com.jiaoguanyi.appstore.server.GuardService;
|
||||
import com.jiaoguanyi.appstore.server.MainService;
|
||||
import com.jiaoguanyi.appstore.server.StepService;
|
||||
|
||||
public class BootReceiver extends BroadcastReceiver {
|
||||
private String TAG = BootReceiver.class.getSimpleName();
|
||||
@@ -21,7 +21,7 @@ public class BootReceiver extends BroadcastReceiver {
|
||||
HTTPInterface.updateDeviceInfo(context);
|
||||
startService(context);
|
||||
} else if (
|
||||
intent.getAction().equals("android.intent.action.BroadcastReceiver")
|
||||
intent.getAction().equals(BOOT_COMPLETED)
|
||||
|| intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)
|
||||
|| intent.getAction().equals(Intent.ACTION_BATTERY_LOW)
|
||||
|| intent.getAction().equals(Intent.ACTION_BATTERY_OKAY)
|
||||
@@ -48,15 +48,15 @@ public class BootReceiver extends BroadcastReceiver {
|
||||
) {
|
||||
//除了USER_PRESENT应该都收不到
|
||||
// Log.e("fht", "BootReceiver MSG:" + intent.getAction());
|
||||
// startService(context);
|
||||
startService(context);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void startService(Context context) {
|
||||
context.startService(new Intent(context, MainService.class));
|
||||
context.startService(new Intent(context, StepService.class));
|
||||
context.startService(new Intent(context, GuardService.class));
|
||||
context.startService(new Intent(context, MainService.class));
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.receiver;
|
||||
package com.jiaoguanyi.appstore.receiver;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
@@ -23,22 +23,22 @@ import com.amap.api.location.AMapLocationListener;
|
||||
import com.blankj.utilcode.util.PathUtils;
|
||||
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.server.MainService;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.CmdUtil;
|
||||
import com.mjsheng.myappstore.utils.ForegroundAppUtil;
|
||||
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.SysSettingUtils;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.jiaoguanyi.appstore.base.BaseApplication;
|
||||
import com.jiaoguanyi.appstore.comm.CommonDatas;
|
||||
import com.jiaoguanyi.appstore.manager.AmapManager;
|
||||
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
|
||||
import com.jiaoguanyi.appstore.network.HTTPInterface;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.server.MainService;
|
||||
import com.jiaoguanyi.appstore.utils.ApkUtils;
|
||||
import com.jiaoguanyi.appstore.utils.CmdUtil;
|
||||
import com.jiaoguanyi.appstore.utils.ForegroundAppUtil;
|
||||
import com.jiaoguanyi.appstore.utils.MySQLData;
|
||||
import com.jiaoguanyi.appstore.utils.SPUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SaveListUtils;
|
||||
import com.jiaoguanyi.appstore.utils.ServiceAliveUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SysSettingUtils;
|
||||
import com.jiaoguanyi.appstore.utils.Utils;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
@@ -268,7 +268,6 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
setAPPinsideWebsite(extras);
|
||||
break;
|
||||
case DISABLE_APPUPDATE:
|
||||
Log.e("fht", extras);
|
||||
setDisableUpdateList(extras);
|
||||
break;
|
||||
case HIDE_DESKTOP_ICON:
|
||||
@@ -982,6 +981,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
}
|
||||
|
||||
private void setDisableUpdateList(String s) {
|
||||
Log.e("setDisableUpdateList", s);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(s);
|
||||
String ban = jsonObject.getString("ban");
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.jiaoguanyi.appstore.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.jiaoguanyi.appstore.BuildConfig;
|
||||
import com.jiaoguanyi.appstore.network.HTTPInterface;
|
||||
import com.jiaoguanyi.appstore.utils.ApkUtils;
|
||||
import com.jiaoguanyi.appstore.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;
|
||||
private static Context mContext;
|
||||
|
||||
static {
|
||||
sendAppInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
mContext = context;
|
||||
String action = intent.getAction();
|
||||
Log.e(TAG, "onReceive: " + "action = " + action);
|
||||
String state = "";
|
||||
if (TextUtils.isEmpty(action)) {
|
||||
Log.e(TAG, "onReceive: " + "action is empty ");
|
||||
return;
|
||||
}
|
||||
String packageName = intent.getDataString().replace("package:", "");
|
||||
switch (action) {
|
||||
case Intent.ACTION_PACKAGE_ADDED:
|
||||
state = "安装了";
|
||||
break;
|
||||
case Intent.ACTION_PACKAGE_REPLACED:
|
||||
state = "重装了";
|
||||
break;
|
||||
case Intent.ACTION_PACKAGE_REMOVED:
|
||||
state = "卸载了";
|
||||
break;
|
||||
default:
|
||||
state = "未知";
|
||||
break;
|
||||
}
|
||||
Log.e(TAG, "sendAppInfo: " + state + packageName);
|
||||
String result = Settings.System.getString(context.getContentResolver(), "qch_app_forbid");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
if (!APPSTORE.equals(packageName) || !BuildConfig.APPLICATION_ID.equals(packageName)) {
|
||||
ApkUtils.addShortcut(context, result);
|
||||
ApkUtils.RemoveTask(context, packageName);
|
||||
}
|
||||
Intent bootIntent = new Intent(BootReceiver.BOOT_COMPLETED);
|
||||
bootIntent.setComponent(new ComponentName("com.jiaoguanyi.store", "com.jiaoguanyi.store.receiver.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);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
public interface NewAppListener {
|
||||
void setNewAppListener(String packageName);
|
||||
}
|
||||
|
||||
private static void sendAppInfo() {
|
||||
Observable.create(new ObservableOnSubscribe<String>() {
|
||||
@Override
|
||||
public void subscribe(@NonNull ObservableEmitter<String> emitter) throws Exception {
|
||||
newAppListener = new NewAppListener() {
|
||||
@Override
|
||||
public void setNewAppListener(String packageName) {
|
||||
emitter.onNext(packageName);
|
||||
}
|
||||
};
|
||||
}
|
||||
})
|
||||
.throttleLast(5, TimeUnit.SECONDS)
|
||||
//这句很关键,这是RxJava中的操作符,在规定时间内观察者不在接收被观察者发送的事件
|
||||
.subscribe(new Observer<String>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull String s) {
|
||||
Log.e(TAG, "sendAppInfo: onNext: " + s);
|
||||
SaveListUtils.getDownLoadList().remove(s);
|
||||
ApkUtils.getAppInfo(mContext);
|
||||
HTTPInterface.getNetAndLaunchSetting(mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e(TAG, "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mjsheng.myappstore.server;
|
||||
package com.jiaoguanyi.appstore.server;
|
||||
|
||||
/**
|
||||
* 作者 mjsheng
|
||||
@@ -33,15 +33,15 @@ import com.arialyy.aria.core.download.DownloadEntity;
|
||||
import com.arialyy.aria.core.task.DownloadTask;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.callback.StringCallback;
|
||||
import com.mjsheng.myappstore.KeepAliveConnection;
|
||||
import com.mjsheng.myappstore.base.BaseApplication;
|
||||
import com.mjsheng.myappstore.manager.NetInterfaceManager;
|
||||
import com.mjsheng.myappstore.network.URLAddress;
|
||||
import com.mjsheng.myappstore.utils.ApkUtils;
|
||||
import com.mjsheng.myappstore.utils.SPUtils;
|
||||
import com.mjsheng.myappstore.utils.ServiceAliveUtils;
|
||||
import com.mjsheng.myappstore.utils.ToastUtil;
|
||||
import com.mjsheng.myappstore.utils.Utils;
|
||||
import com.jiaoguanyi.appstore.KeepAliveConnection;
|
||||
import com.jiaoguanyi.appstore.base.BaseApplication;
|
||||
import com.jiaoguanyi.appstore.manager.NetInterfaceManager;
|
||||
import com.jiaoguanyi.appstore.network.URLAddress;
|
||||
import com.jiaoguanyi.appstore.utils.ApkUtils;
|
||||
import com.jiaoguanyi.appstore.utils.SPUtils;
|
||||
import com.jiaoguanyi.appstore.utils.ServiceAliveUtils;
|
||||
import com.jiaoguanyi.appstore.utils.ToastUtil;
|
||||
import com.jiaoguanyi.appstore.utils.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
@@ -159,13 +159,9 @@ public class GuardService extends Service {
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
|
||||
|
||||
Aria.init(this);
|
||||
Aria.get(this).getDownloadConfig().setMaxTaskNum(1);
|
||||
|
||||
Aria.download(this).register();
|
||||
|
||||
// startForeground(1, new Notification());
|
||||
// 绑定建立链接
|
||||
bindService(new Intent(this, StepService.class), mServiceConnection, Context.BIND_IMPORTANT);
|
||||
@@ -180,8 +176,6 @@ public class GuardService extends Service {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private NetworkChangedRecceiver mNetworkChangedRecceiver;
|
||||
|
||||
public void registerNetworkReceiver() {
|
||||
@@ -361,9 +355,6 @@ public class GuardService extends Service {
|
||||
} catch (Exception e) {
|
||||
Log.e("aria", "taskFail");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user